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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://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
 ******************************************************************************/

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

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

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

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

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation
 Andy Clement (vmware) - bug 344614

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation
 Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584

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

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 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 h(c,b,a,j,d,f){b[c]&&(a.push(c),(b[c]===!0||b[c]===1)&&j.push(d+c+"/"+f))}function k(c,b,a,j,d){b=j+b+"/"+d;require._fileExists(c.toUrl(b+".js"))&&a.push(b)}function g(c,b,a){for(var j in b)b.hasOwnProperty(j)&&(!c.hasOwnProperty(j)||a)?c[j]=b[j]:typeof b[j]==="object"&&g(c[j],b[j],a)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var b=c.config?c.config():{};return{version:"2.0.1+",load:function(a,j,d,f){f=f||{};if(f.locale)b.locale=f.locale;
var i=e.exec(a),c=i[1],o=i[4],m=i[5],s=o.split("-"),r=[],p={},q,t="";if(i[5])c=i[1],a=c+m;else{m=i[4];o=b.locale;if(!o)o=b.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();s=o.split("-")}if(f.isBuild){r.push(a);k(j,"root",r,c,m);for(q=0;q<s.length;q++)f=s[q],t+=(t?"-":"")+f,k(j,t,r,c,m);j(r,function(){d()})}else j([a],function(f){var a=[],i;h("root",f,a,r,c,m);for(q=0;q<s.length;q++)i=s[q],t+=(t?"-":"")+i,h(t,f,a,r,c,m);j(r,function(){var i,
b,e;for(i=a.length-1;i>-1&&a[i];i--){e=a[i];b=f[e];if(b===!0||b===1)b=j(c+e+"/"+m);g(p,b)}d(p)})})}}})})();
define("orion/i18n",[],function(){return{load:function(h,k,g,e){var e=e||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,b=c.exec(h);if(b)if(k.defined(h))g(k(h));else if(e.isBuild||e.isTest)g({});else{var a=b[1],j=b[3]?b[2]:"",d=b[3]||b[2];k(["orion/bootstrap"],function(f){f.startup().then(function(f){var l=f.serviceRegistry,f=l.getServiceReferences("orion.i18n.message");if(j)f.some(function(f){return h===f.getProperty("name")?(l.getService(f).getMessageBundle().then(function(f){g(f)},function(){g({})}),
!0):!1})||g({});else{var o={},m;f.forEach(function(f){var i=f.getProperty("name");if((b=c.exec(i))&&a===b[1]&&d===(b[3]||b[2]))if(j=b[3]?b[2]:""){if((f=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&f.toLowerCase().indexOf(j.toLowerCase())===0)o[j]=!0,k.specified(i)||define(i,["orion/i18n!"+i],function(f){return f})}else m=f});k.specified(h)?g(o):m?l.getService(m).getMessageBundle().then(function(f){Object.keys(o).forEach(function(a){typeof f[a]==="undefined"&&
(f[a]=o[a])});define(h,[],f);g(f)},function(){define(h,[],o);g(o)}):(define(h,[],o),g(o))}})})}else g(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","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","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"," authored by ${0} (${1})) on ${2}":" authored by ${0} (${1})) on ${2}",
"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","Show in Navigator":"Show in Navigator","Show the repository folder in the file navigator":"Show the repository folder in the file navigator",
"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.",
"The content of your active branch will be replaced with ":"The content of your active branch will be replaced with ","All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?":"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","Clone Git Repository":"Clone 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."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/browserCompatibility",[],function(){function h(){for(var c=navigator.userAgent,b={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:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],j=0;j<a.length;j++){var d=a[j],f=c.match(d.regExp);if(f){b.browser=!0;b.version=f[1]>=d.minVersion;b.name=d.name;break}}return b}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(c){return!1}}function g(c){alert(c);throw"unsupported browser";}var e=h();if(e.browser)e.version||g("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+e.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()||g("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:h,supportsLocalStorage:k,throwBrowserAlert:g}});
(function(h,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(h.orion=h.orion||{},h.orion.Deferred=k())})(this,function(){function h(){for(var f;f=a.shift()||j.shift();)f();d=!1}function k(f,i){(i?j:a).push(f);d||(d=!0,i?setTimeout(h,0):h())}function g(f){return function(){f.apply(null,arguments)}}function e(){}function c(){var f=Error("Cancel");f.name="Cancel";return f}function b(){function f(){for(var f;f=j.shift();){var b=f.deferred,
c=d==="resolved"?"resolve":"reject";if(typeof f[c]==="function")try{var m=f[c](a);m&&typeof m.then==="function"?(b.cancel=m.cancel||e,m.then(g(b.resolve),g(b.reject),b.progress)):b.resolve(m)}catch(h){b.reject(h)}else b[c](a)}}var a,d,j=[],m=this;this.reject=function(b){d||(d="rejected",a=b,j.length&&k(f));return m.promise};this.resolve=function(b){d||(d="resolved",a=b,j.length&&k(f));return m.promise};this.progress=function(f){d||j.forEach(function(a){a.progress&&a.progress(f)});return m.promise};
this.cancel=function(){d||m.reject(c())};this.then=function(a,i,c){var a={resolve:a,reject:i,progress:c,deferred:new b},e=a.deferred,g=!1,n=function(){g||(g=!0,k(function(){var f=e.cancel===n?m.cancel:e.cancel;typeof f==="function"&&f()},!0))};e.cancel=n;j.push(a);d&&k(f,!0);return e.promise};this.promise=Object.create(Object.prototype,{then:{value:m.then},cancel:{get:function(){return m.cancel},set:function(f){m.cancel=f}}})}var a=[],j=[],d=!1;b.all=function(f,a){function d(f,a){r||(e[f]=a,--c===
0&&g.resolve(e))}function j(f,b){if(!r){if(a)try{d(f,a(b));return}catch(n){b=n}g.reject(b)}}var c=f.length,e=[],r=!1,g=new b;g.then(null,function(){r=!0;f.forEach(function(f){f.cancel&&f.cancel()})});c===0?g.resolve(e):f.forEach(function(f,a){f.then(d.bind(null,a),j.bind(null,a))});return g.promise};b.when=function(f,a,d,j){var c;if(!(f&&typeof f.then==="function"))c=new b,c.resolve(f),f=c.promise;return f.then(a,d,j)};return b});
define("orion/EventTarget",[],function(){function h(){this._namedListeners={}}h.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var g=this._namedListeners[h.type];g&&g.forEach(function(e){try{typeof e==="function"?e(h):e.handleEvent(h)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!h.defaultPrevented},addEventListener:function(h,g){if(typeof g==="function"||g.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(g)},
removeEventListener:function(h,g){var e=this._namedListeners[h];if(e)for(var c=0;c<e.length;c++)if(e[c]===g){e.length===1?delete this._namedListeners[h]:e.splice(c,1);break}}};h.prototype.constructor=h;h.attach=function(k){var g=new h;k.dispatchEvent=g.dispatchEvent.bind(g);k.addEventListener=g.addEventListener.bind(g);k.removeEventListener=g.removeEventListener.bind(g)};return h});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(h,k){function g(a,d,f){this._properties=f||{};this._properties["service.id"]=a;this._properties.objectClass=d;this._properties["service.names"]=d}function e(a,d,f){this._serviceId=a;this._serviceReference=d;this._internalRegistry=f}function c(a,d){function f(f){return function(){var i;try{if(!d())throw Error("Service was unregistered");var b=a[f].apply(a,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else i=new h,i.resolve(b)}catch(c){i=new h,i.reject(c)}return i.promise}}for(var i in a)typeof a[i]==="function"&&(this[i]=f(i))}function b(a,d){this.type=a;this.serviceReference=d}function a(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(d){return a._entries[d]?!0:!1},unregisterService:function(d){var f=a._entries[d];if(!f)throw Error("already unregistered");var i=f.reference;a._serviceEventTarget.dispatchEvent(new b("unregistering",
i));a._entries[d]=null;i.getProperty("objectClass").forEach(function(f){for(var d=a._namedReferences[f],b=0;b<d.length;b++)if(d[b]===i){d.length===1?delete a._namedReferences[f]:d.splice(b,1);break}})},modifyService:function(d){d=a._entries[d];if(!d)throw Error("already unregistered");a._serviceEventTarget.dispatchEvent(new b("modified",d.reference))}}}g.prototype={getPropertyKeys:function(){var a=[],d;for(d in this._properties)this._properties.hasOwnProperty(d)&&a.push(d);return a},getProperty:function(a){return this._properties[a]}};
g.prototype.constructor=g;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(a){var d=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=d.objectClass;a["service.names"]=d["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
e.prototype.constructor=e;a.prototype={getService:function(a){var d;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(f){d=this._entries[f.getProperty("service.id")].service;return!!d},this);else if(a=this._entries[a.getProperty("service.id")])d=a.service;return d||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var d=[];this._entries.forEach(function(f){f&&d.push(f.reference)});return d},registerService:function(a,d,f){if(typeof d===
"undefined"||d===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var i=this._entries.length,l=new g(i,a,f),o=this._namedReferences;a.forEach(function(f){o[f]=o[f]||[];o[f].push(l)});a=new c(d,this._internalRegistry.isRegistered.bind(null,i));this._entries.push({reference:l,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new b("registered",l));return new e(i,l,a)},addEventListener:function(a,d){this._serviceEventTarget.addEventListener(a,
d)},removeEventListener:function(a,d){this._serviceEventTarget.removeEventListener(a,d)}};a.prototype.constructor=a;return{ServiceRegistry:a}});
define("orion/xhr",["orion/Deferred"],function(h){function k(g,e,c,b){var a=typeof c.response!=="undefined"?c.response:c.responseText,j;try{j=c.status}catch(d){j=0}g={args:e,response:a,responseText:typeof a==="string"?a:null,status:j,url:g,xhr:c};if(typeof b!=="undefined")g.error=b;return g}return function(g,e,c){var c=c||{},b=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,a=new h,j=c.headers||{},d=c.log||!1,f;typeof j["X-Requested-With"]==="undefined"&&(j["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(g==="POST"||g==="PUT"))f=c.data;b.onprogress=function(f){f.xhr=b;a.progress(f)};b.onreadystatechange=function(){if(b.readyState===4){var f=k(e,c,b),i=b.status;200<=i&&i<400?a.resolve(f):(d&&typeof console!=="undefined"&&console.log(Error(b.statusText)),a.reject(f))}};try{b.open(g,e,!0);if(typeof c.responseType==="string")b.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof b.timeout==="number")b.timeout=c.timeout,b.addEventListener("timeout",function(){a.reject(k(e,
c,b,"Timeout exceeded"))});else{var i=setTimeout(function(){a.reject(k(e,c,b,"Timeout exceeded"))},c.timeout);a.then(clearTimeout.bind(null,i),clearTimeout.bind(null,i))}Object.keys(j).forEach(function(f){b.setRequestHeader(f,j[f])});b.send(f)}catch(l){a.reject(k(e,c,b,l))}return a.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(h,k,g){function e(f,a){this._name=f;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function c(f,a){return{get:function(d,b){if(a===0)return null;var j=localStorage.getItem(f+d);if(j===null)return null;j=JSON.parse(j);return b||a===-1||j._expires&&j._expires>(new Date).getTime()?(delete j._expires,j):null},set:function(d,b){if(a!==0){if(a!==-1)b._expires=(new Date).getTime()+1E3*a;
if(Object.keys(b).length===0)localStorage.removeItem(f+d);else{var j=JSON.stringify(b);localStorage.setItem(f+d,j);delete b._expires}}},remove:function(a){localStorage.removeItem(f+a)}}}function b(f){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=f.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=f.getService(a[0])}return!!this._service}}function a(f){this._location=
f;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function j(){this._cache=new c("/orion/preferences/local",-1)}function d(f,d){this._userProvider=new b(f);this._localProvider=new j;d=d||"defaults.pref";d.indexOf("://")===-1&&(d=h.toUrl(d));this._defaultsProvider=new a(d);this._serviceRegistration=f.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var f=[],a=0;a<this._stores.length;++a){var d=this._stores[a];this._dirty.indexOf(d)!==-1&&
f.push(this._providers[a].put(this._name,d))}this._dirty=[];return k.all(f)},_scheduleFlush:function(f){this._dirty.indexOf(f)===-1&&this._dirty.push(f);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 f=0;f<this._stores.length;++f){var a=this._stores[f],d;for(d in a)a.hasOwnProperty(d)&&typeof this._cached[d]==="undefined"&&(this._cached[d]=
a[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(f){return this._getCached()[f]},put:function(f,a){if(this._stores.length!==0){var d=this._stores[0];if(d[f]!==a)d[f]=a,this._cached=null,this._scheduleFlush(d)}},remove:function(f){for(var a=0;a<this._stores.length;++a){var d=this._stores[a];if(d.hasOwnProperty(f))return delete d[f],this._cached=null,this._scheduleFlush(d),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]=
{},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var d=this,b=[],j=0;j<this._providers.length;++j)b.push(this._providers[j].get(this._name,a).then(function(a){return function(f){d._stores[a]=f}}(j)));return k.all(b).then(function(){d._cached=null;d._getCached()})},flush:function(){this._flush()}};b.prototype={get:function(a,d){if(this._currentPromises[a])return this._currentPromises[a];var b=new k,j=null;
d?this._cache.remove(a):j=this._cache.get(a);if(j!==null)b.resolve(j);else{this._currentPromises[a]=b;var c=this;this._service.get(a).then(function(d){c._cache.set(a,d);delete c._currentPromises[a];b.resolve(d)},function(d){d.status===404?(d={},c._cache.set(a,d),delete c._currentPromises[a],b.resolve(d)):(delete c._currentPromises[a],b.resolve(c._cache.get(a,!0)||{}))})}return b},put:function(a,d){this._cache.set(a,d);return this._service.put(a,d)}};a.prototype={get:function(a,d){if(this._currentPromise)return this._currentPromise;
var b=new k,j=null;d?this._cache.remove(a):j=this._cache.get(a);if(j!==null)b.resolve(j);else{this._currentPromise=b;var c=this;g("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){d=JSON.parse(d.response);c._cache.set(a,d[a]||{});c._currentPromise=null;b.resolve(d[a]||{})},function(d){d.xhr.status===401||d.xhr.status===404?(c._cache.set(a,{}),c._currentPromise=null,b.resolve({})):(c._currentPromise=null,d=c._cache.get(a,!0),d!==null?b.resolve(d[a]||{}):b.resolve({}))})}return b},
put:function(){var a=new k;a.resolve();return a}};j.prototype={get:function(a){var d=new k,a=this._cache.get(a);a!==null?d.resolve(a):d.resolve({});return d},put:function(a,d){var b=new k;this._cache.set(a,d);b.resolve();return b}};d.DEFAULT_SCOPE=1;d.LOCAL_SCOPE=2;d.USER_SCOPE=4;d.prototype={listenForChangedSettings:function(a,i,b){if(!i||typeof i!=="number"||i>7||i<1)b=i,i=d.DEFAULT_SCOPE|d.LOCAL_SCOPE|d.USER_SCOPE;window.addEventListener("storage",b,!1);if((d.USER_SCOPE&i)!==0)return"/orion/preferences/user"+
a;else if((d.LOCAL_SCOPE&i)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,i){if(!i||typeof i!=="number"||i>7||i<1)i=d.DEFAULT_SCOPE|d.LOCAL_SCOPE|d.USER_SCOPE;var b=[];d.USER_SCOPE&i&&this._userProvider.available()&&b.push(this._userProvider);d.LOCAL_SCOPE&i&&b.push(this._localProvider);d.DEFAULT_SCOPE&i&&b.push(this._defaultsProvider);var j=new e(a,b);return j.sync().then(function(){return j})},getSetting:function(a,d,b){for(var j,c=0;c<a.length;c++)if(a[c].label===
d)for(var e=0;e<a[c].data.length;e++)if(a[c].data[e].label===b){j=a[c].data[e].value;break}return j}};return{PreferencesService:d}});
(function(){function h(a){if(typeof a!=="string")throw new TypeError;}function k(a){return a?a.split("&"):[]}function g(a){return a.length===0?"":a.join("&")}function e(a){var d=/([^=]*)(?:=?)(.*)/.exec(a),a=d[1]?decodeURIComponent(d[1]):"",d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function c(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="="+encodeURIComponent(a[1]));return d}function b(a,d){var f="",n=[],i=0;return{next:function(){if(f!==a.query)f=a.query,n=k(f);if(i<n.length){var b=e(n[i++]);
switch(d){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw u;}}}function a(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function j(a){var d=[];a.split("/").forEach(function(a){a===".."?d.pop():a!=="."&&d.push(a)});return d.join("/")}function d(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function f(a,f){if(typeof a!=="string")throw new TypeError;var a=d(a),n=o.exec(a);
if(!n)return null;var i={};i.scheme=n[1]||"";if(i.scheme&&!s.test(i.scheme))return null;var b=n[2];if(b&&(b=m.exec(b),i.userinfo=b[1],i.host=b[2],i.port=b[3],i.port&&!r.test(i.port)))return null;i.path=n[3];i.query=n[4];i.fragment=n[5];if(!i.scheme&&f&&(i.scheme=f.scheme,!i.host&&f.host))i.userinfo=f.userinfo,i.host=f.host,i.port=f.port,i.pathRelative=!0;if(i.pathRelative)if(i.path){if(i.path[0]!=="/")n=/^(.*\/)[^\/]*$/.exec(f.path)[1]||"/",i.path=n+i.path}else i.path=f.path;if(i.scheme)i.scheme=
i.scheme.toLowerCase();if(i.port)i.port=/[1-9]\d*$/.exec(i.port)[0];if(i.host&&i.path)i.path=j(i.path);return i}function i(d,n){var i;if(n){n=n.href||n;i=f(n);if(!i||!i.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:i})}i=f(d,i);if(!i)throw new SyntaxError;Object.defineProperty(this,"_input",{value:d,writable:!0});Object.defineProperty(this,"_url",{value:i,writable:!0});var b=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?b:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(l){}var o=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,m=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,s=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,n=/^([^\s]*)$/,v=/^\S*$/,w=/([^:]*):?(.*)/,u=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(a){h(a);var d;k(this._url.query).some(function(f){f=e(f);if(f[0]===a)return d=f[1],!0});return d},enumerable:!0},set:{value:function(a,d){h(a);h(d);var f=k(this._url.query);f.some(function(n,i){var b=e(n);if(b[0]===a)return b[1]=d,f[i]=c(b),!0})||f.push(c([a,d]));this._url.query=g(f)},enumerable:!0},has:{value:function(a){h(a);return k(this._url.query).some(function(d){if(e(d)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){h(a);var d=k(this._url.query),f=d.filter(function(d){return e(d)[0]!==a});return f.length!==d.length?(this._url.query=g(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if(typeof a!=="function")throw new TypeError;var f=b(this._url,"keys+values");try{for(;;){var n=f.next();a.call(d,n[1],n[0],this)}}catch(i){if(i!==u)throw i;}},enumerable:!0},keys:{value:function(){return b(this._url,
"keys")},enumerable:!0},values:{value:function(){return b(this._url,"values")},enumerable:!0},items:{value:function(){return b(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(a){h(a);var d=[];k(this._url.query).forEach(function(f){f=e(f);f[0]===a&&d.push(f[1])});return d},enumerable:!0},append:{value:function(a,d){h(a);h(d);var f=k(this._url.query);f.push(c([a,d]));this._url.query=g(f)},enumerable:!0}});Object.defineProperties(i.prototype,
{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(a){h(a);this._input=a;this._url=f(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?
this._url.scheme+":":":"},set:function(a){h(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,s.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){h(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=w.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){h(a);if(this._url){var d=w.exec(this._userinfo),a=[encodeURIComponent(a||"")];
d[2]&&a.push(d[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=w.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){h(a);if(this._url){var d=[w.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},set:function(a){h(a);if(this._url&&(a=q.exec(a)))this._url.host=
a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){h(a);if(this._url&&p.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===y[this.protocol]&&(a="");return a},set:function(a){h(a);if(this._url&&r.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){h(a);if(this._url&&t.exec(a))this._url.host&&
a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?j(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){h(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),n.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){h(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),v.exec(a)))this._url.fragment=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(i,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(i,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=i})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(h,k){function g(a,f){var i=Object.keys(a),b=Object.keys(f);if(i.length!==b.length)return!1;i.sort();b.sort();for(var j=0,c=i.length;j<c;j++){var e=i[j];if(e!==b[j])return!1;var r=a[e],e=f[e];if(r!==e&&JSON.stringify(r)!==JSON.stringify(e))return!1}return!0}function e(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(f){}return a}function c(a){var f=null;return{key:function(i){return(f=
f||Object.keys(a))[i]},getItem:function(f){return a[f]},setItem:function(i,b){a[i]=b;f=null},removeItem:function(i){delete a[i];f=null},clear:function(){(f=f||Object.keys(a)).forEach(function(f){delete a[f]}.bind(this));f=null}}}function b(a,f){return{type:a,plugin:f}}function a(a,f,i){function j(a,d,f){if(!B)return(new h).reject(Error("plugin not connected"));var n=F++,b=new h;b.then(null,function(a){y==="active"&&a instanceof Error&&a.name==="Cancel"&&i.postMessage({id:n,cancel:a.message||"Cancel"},
B)});G[String(n)]=b;i.postMessage({id:n,serviceId:a,method:d,params:f},B);return b.promise}function c(a){var d={};if(a.methods&&(a.methods.forEach(function(f){d[f]=function(){var d=Array.prototype.slice.call(arguments);return y==="active"?j(a.serviceId,f,d):q.start({"transient":!0}).then(function(){return j(a.serviceId,f,d)})}}),d.addEventListener&&d.removeEventListener)){var f=new k;d.dispatchEvent=f.dispatchEvent.bind(f);var n=d.addEventListener;d.addEventListener=function(a,d){f._namedListeners[a]||
n(a);f.addEventListener(a,d)};var i=d.removeEventListener;d.removeEventListener=function(a,d){f.removeEventListener(a,d);f._namedListeners[a]&&i(a)}}return d}function e(f){var n=JSON.parse(JSON.stringify(f.properties));n.__plugin__=a;f=f.names||f.type||[];Array.isArray(f)||(f=[f]);n.objectClass=f;return n}function s(a){var d=c(a),f=e(a),f=i.registerService(a.names||a.type,d,f);A[a.serviceId]={registration:f,proxy:d}}function r(){i.persist(a,{created:t,headers:n,services:v,autostart:w,lastModified:u})}
function p(a){var d;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var f=a.params[0];I({headers:f.headers,services:f.services}).then(function(){z.resolve(q)})}else if("dispatchEvent"===a.method){var n=A[a.serviceId].proxy;n.dispatchEvent.apply(n,a.params)}else if("progress"===a.method)d=G[String(a.requestId)],d.progress.apply(d,a.params);else if("timeout"===a.method)z&&z.reject(a.error);else throw Error("Bad response method: "+a.method);else if(d=G[String(a.id)],delete G[String(a.id)],
a.error){var b=i.handleServiceError(q,a.error);d.reject(b)}else d.resolve(a.result)}catch(j){console.log("Plugin._responseHandler "+j)}}var q=this,f=f||{},t=f.created||(new Date).getTime(),n=f.headers||{},v=f.services||[],w=f.autostart,u=f.lastModified||0,y="installed",E,z,B,A={},F=0,G={},I;this._persist=r;this._resolve=function(){y="resolved";i.dispatchEvent(new b("resolved",q))};this._getAutostart=function(){return w};this._getCreated=function(){return t};this.getLocation=function(){return a};this.getHeaders=
function(){return JSON.parse(JSON.stringify(n))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return u};this.getServiceReferences=function(){var a=[];Object.keys(A).forEach(function(d){a.push(A[d].registration.getReference())});return a};this.getState=function(){return y};this.start=function(f){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));
if(E)return E.promise.then(this.start.bind(this,f));if(y==="active")return(new h).resolve();if(!f||!f["transient"]){var n=f&&f.lazy?"lazy":"started";n!==w&&(w=n,r())}n=i.getState();if(n!=="starting"&&n!=="active")return f["transient"]?(new h).reject(Error("start transient error")):(new h).resolve();if(y==="installed")try{this._resolve()}catch(j){return(new h).reject(j)}y==="resolved"&&v.forEach(function(a){s(a)});if(f&&f.lazy)return y!=="starting"&&(y="starting",i.dispatchEvent(new b("lazy activation",
q))),(new h).resolve();var c=new h;E=c;y="starting";i.dispatchEvent(new b("starting",q));z=new h;B=i.connect(a,p);z.then(function(){z=null;y="active";i.dispatchEvent(new b("started",q));E=null;c.resolve()},function(){z=null;y="stopping";i.dispatchEvent(new b("stopping",q));Object.keys(A).forEach(function(a){A[a].registration.unregister();delete A[a]});i.disconnect(B);B=null;y="resolved";E=null;i.dispatchEvent(new b("stopped",q));c.reject(Error("plugin activation error"))});return c.promise};this.stop=
function(a){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(E)return E.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==w)w="stopped",r();if(y!=="active"&&y!=="starting")return(new h).resolve();E=a=new h;y="stopping";i.dispatchEvent(new b("stopping",q));Object.keys(A).forEach(function(a){A[a].registration.unregister();delete A[a]});B&&(i.disconnect(B),B=null);y="resolved";E=null;i.dispatchEvent(new b("stopped",q));a.resolve();return a.promise};
I=function(f){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(!f)return u===0&&(u=(new Date).getTime(),r()),i.loadManifest(a).then(I);var j=n,c=v,l=w;n=f.headers||{};v=f.services||{};w=f.autostart||w;f.lastModified?u=f.lastModified:(u=(new Date).getTime(),r());if(g(n,j)&&g(v,c)&&w===l)return(new h).resolve();if(y==="active"||y==="starting"){var o=[];Object.keys(v).forEach(function(a){var f=v[a];o.push(a);var d=A[a];if(d){if(g(f.methods,Object.keys(d.proxy))){var a=e(f),
n=d.registration.getReference(),i={};n.getPropertyKeys().forEach(function(a){i[a]=n.getProperty(a)});g(a,i)||d.registration.setProperties(a);return}d.registration.unregister();delete A[a]}s(f)});Object.keys(A).forEach(function(a){o.indexOf(a)===-1&&(A[a].registration.unregister(),delete A[a])})}y==="active"&&(i.disconnect(B),z=new h,B=i.connect(a,p),z.then(function(){z=null},function(){z=null;y="stopping";i.dispatchEvent(new b("stopping"),q);Object.keys(A).forEach(function(a){A[a].registration.unregister();
delete A[a]});i.disconnect(B);B=null;y="resolved";i.dispatchEvent(new b("stopped",q))}));return(new h).resolve()};this.update=function(a){return I(a).then(function(){i.dispatchEvent(new b("updated",q))})};this.uninstall=function(){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(y==="active"||y==="starting"||y==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));i.removePlugin(this);y="uninstalled";i.dispatchEvent(new b("uninstalled",
q));return(new h).resolve()}}var j=/^http[s]?/i;return{Plugin:a,PluginRegistry:function(d,f){function i(a){var f=a.source;s.some(function(d){if(f===d.target){if(typeof d.useStructuredClone==="undefined")d.useStructuredClone=typeof a.data!=="string";d.handler(d.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var f=f||{},l=f.storage||localStorage;l.getItem||(l=c(l));var o="installed",m=[],s=[],r=new k,g={},q={registerService:d.registerService.bind(d),connect:function(a,d,i){function b(a){a=
Error(a);a.name="timeout";d({method:"timeout",error:a})}var j={handler:d,url:a},c=setTimeout(b.bind(null,"Load timeout for: "+a),i||15E3),e=document.createElement("iframe");e.name=a+"_"+(new Date).getTime();if(!f.visible)e.style.display="none",e.style.visibility="hidden";e.src=a;e.onload=function(){clearTimeout(c);setTimeout(b.bind(null,"Plugin handshake timeout for: "+a),5E3)};e.sandbox="allow-scripts allow-same-origin";document.body.appendChild(e);j.target=e.contentWindow;j.close=function(){e&&
(document.body.removeChild(e),e=null)};s.push(j);return j},disconnect:function(a){for(var d=0;d<s.length;d++)if(a===s[d]){s.splice(d,1);try{a.close()}catch(f){}break}},removePlugin:function(a){for(var d=0;d<m.length;d++)if(a===m[d]){m.splice(d,1);break}l.removeItem("plugin."+a.getLocation())},persist:function(a,d){l.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{r.dispatchEvent(a)}catch(d){console&&
console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new h,f=q.connect(a,function(a){f&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],q.disconnect(f),f=null,d.resolve(a)):"timeout"===a.method&&(q.disconnect(f),f=null,d.reject(a.error)))});return d.promise},getState:function(){return o},handleServiceError:function(a,d){if(d&&d.status===401){var f=a.getHeaders(),i=a.getName()||a.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+
i+"."));if(f.login)b.appendChild(document.createTextNode(" ")),i=document.createElement("a"),i.target="_blank",i.textContent="Login",i.href=f.login,j.test(i.href)?(b.appendChild(i),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+f.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(b)}}if(d.__isError){var c=d,d=Error(c.message);Object.keys(c).forEach(function(a){d[a]=c[a]});delete d.__isError}return d}};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=q.getState;this.init=function(){if(!(o==="starting"||o==="active"||o==="stopping")){addEventListener("message",i,!1);for(var d=[],n=0,b=l.length;n<b;n++)d.push(l.key(n));d.forEach(function(d){if(d.indexOf("plugin.")===0){var f=d.substring(7),d=JSON.parse(l.getItem(d));d.created&&m.push(new a(f,d,q))}});
m.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});f.plugins&&Object.keys(f.plugins).forEach(function(d){d=e(d);if(!this.getPlugin(d)){var n=f.plugins[d],n=typeof n==="object"||{};n.autostart=n.autostart||f.defaultAutostart||"lazy";m.push(new a(d,n,q))}}.bind(this));o="starting"}};this.start=function(){o!=="starting"&&this.init();if(o!=="starting")return(new h).reject("Cannot start framework. Framework is already "+o+".");var a=[],d=(new Date).getTime();m.forEach(function(f){var i=
f._getAutostart();f.getLastModified()===0?a.push(f.update().then(function(){if("started"===i)return f.start({"transient":!0});if("lazy"===i)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===i?a.push(f.start({"transient":!0})):"lazy"===i?(a.push(f.start({lazy:!0,"transient":!0})),d>f.getLastModified()+864E5&&f.update()):f._resolve()});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){o="active"})};this.stop=function(){if(o!=="starting"&&o!=="active")return(new h).reject("Cannot stop registry. Registry is already "+
o+".");o="stopping";var a=[];m.forEach(function(d){a.push(d.stop({"transient":!0}))});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",i);o="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new h).reject("Cannot uninstall registry")};this.installPlugin=function(d,f){var d=e(d),i=this.getPlugin(d);if(i)return(new h).resolve(i);if(g[d])return g[d];if(f)return i=new a(d,f,q),m.push(i),
i._persist(),q.dispatchEvent(new b("installed",i)),(new h).resolve(i);var j=q.loadManifest(d).then(function(f){i=new a(d,f,q);m.push(i);i._persist();delete g[d];q.dispatchEvent(new b("installed",i));return i},function(a){delete g[d];throw a;});return g[d]=j};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var d=null,a=e(a);m.some(function(f){if(a===f.getLocation())return d=f,!0});return d};this.addEventListener=r.addEventListener.bind(r);this.removeEventListener=r.removeEventListener.bind(r);
this.resolvePlugins=function(){var a=!0;m.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function h(e,c){function b(a){var f=a.getProperty("service.id"),i=this.addingService(a);i&&(j[f]=a,d[f]=i)}function a(a){var f=a.getProperty("service.id"),i=d[f];delete j[f];delete d[f];this.removedService(a,i)}this.serviceRegistry=e;var j={},d={},f=k,i,l;this.close=function(){if(f!==g)throw"Already closed";f=k;e.removeEventListener("registered",i);e.removeEventListener("unregistering",l);l=i=null;var d=this;this.getServiceReferences().forEach(function(f){a.call(d,
f)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return j.length?Object.keys(j).map(function(a){return j[a]}):null};this.open=function(){if(f!==k)throw"Already open";f=g;var d=this;i=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(b.call(d,a.serviceReference),typeof d.onServiceAdded==="function"))return d.onServiceAdded(a.serviceReference,d.serviceRegistry.getService(a.serviceReference))};l=function(f){f.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&a.call(d,f.serviceReference)};e.addEventListener("registered",i);e.addEventListener("unregistering",l);e.getServiceReferences(c).forEach(function(a){b.call(d,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,g=1;h.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return h});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(h,k){var g,e,c,b,a,j="pid";g=function(a,d,b){function c(a,f,b){f.forEach(function(n,j){try{var c=a[j].getProperty("__plugin__"),e=c&&d.getPlugin(c);(!c||e&&e.getState()==="active")&&f[j].updated(b)}catch(l){typeof console!=="undefined"&&console.log(l)}})}k.call(this,a,"orion.cm.managedservice");var e={},s={},g=function(d){var i=[];d.plugin.getServiceReferences().forEach(function(d){if(d.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var n=d.getProperty(j),d=a.getService(d);n&&d&&(n=(n=b._find(n))&&n.getProperties(),i.push(d.updated(n)))}});return h.all(i)};this.addingService=function(d){var i=d.getProperty(j),b=a.getService(d);if(!i||!b)return null;e[i]||(e[i]=[]);s[i]||(s[i]=[]);e[i].push(d);s[i].push(b);return b};this.onServiceAdded=function(a,d){var f=a.getProperty(j),f=b._find(f);c([a],[d],f&&f.getProperties())};this.onOpen=function(){d.addEventListener("started",g)};this.onClose=function(){d.removeEventListener("started",
g)};this.notifyUpdated=function(a){var d=a.getPid();c(e[d]||[],s[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();c(e[a]||[],s[a]||[],null)};this.removedService=function(a,d){var f=a.getProperty(j),i=e[f],b=s[f];i.length>1?i.splice(i.indexOf(a),1):delete e[f];b.length>1?b.splice(b.indexOf(d),1):delete s[f]}};e=function(){function a(d,f,j){this.store=new c(this,j);this.configAdmin=new b(this,this.store);this.tracker=new g(d,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(d){a.tracker.open();return d})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(d,f){this.factory=d;this.store=f}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var d="/cm/configurations";
c=function(){function f(f,b){this.factory=f;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(d).then(function(d){c.pref=d;d.keys().forEach(function(f){if(!c.configs[f]){var i=d.get(f);typeof i==="object"&&i!==null&&Object.keys(i).length>0&&(i[j]=f,c.configs[f]=new a(c.factory,c,i))}})})}f.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(d){var f=this._find(d);
f||(f=new a(this.factory,this,d),this.configs[d]=f);return f},list:function(){var a=this,d=[];this.pref.keys().forEach(function(f){(f=a._find(f))&&f.getProperties()!==null&&d.push(f)});return d},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,d){this.pref.put(a,d.getProperties(!0)||{})}};return f}();a=function(){function a(d){for(var f={},i=Object.keys(d),b=0;b<i.length;b++){var j=i[b],c=d[j];f[j]=c instanceof Array?c.slice():c}return f}function d(i,b,c){this.factory=
i;this.store=b;if(c!==null&&typeof c==="object")this.pid=c[j],i=a(c),delete i[j],this.properties=i;else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}d.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(d){this._checkRemoved();var i=null;if(this.properties&&(i=a(this.properties),!d))i[j]=this.pid;return i},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(d){this._checkRemoved();d=a(d);delete d[j];this.properties=d;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return d}();return{ConfigurationAdminFactory:e}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(h,k,g,e,c,b){var a;return{startup:function(){if(a)return a;a=new k;var j=new g.ServiceRegistry,d=new e.PreferencesService(j);return d.getPreferences("/plugins").then(function(f){var i={plugins:{}};f.keys().forEach(function(a){var d=h.toUrl(a);i.plugins[d]=f[a]});var e=new c.PluginRegistry(j,i);return e.start().then(function(){if(j.getServiceReferences("orion.core.preference.provider").length>
0)return d.getPreferences("/plugins",d.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=h.toUrl(a);e.getPlugin(a)||d.push(e.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(d,function(a){console.log(a)})})}).then(function(){return(new b.ConfigurationAdminFactory(j,e,d)).getConfigurationAdmin().then(j.registerService.bind(j,"orion.cm.configadmin"))}).then(function(){var a=j.getService("orion.core.auth");
if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return d}}).then(function(){var f={serviceRegistry:j,preferences:d,pluginRegistry:e};a.resolve(f);return f})})}}});
define("orion/webui/littlelib",[],function(){function h(a,d){d||(d=document);return d.querySelectorAll(a)}function k(a,d){var f=a.compareDocumentPosition(d);return a===d||Boolean(f&16)}function g(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var d=0;d<a.childNodes.length;d++){var f=g(a.childNodes[d]);if(f)return f}return null}function e(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var d=a.childNodes.length-1;d>=0;d--){var f=e(a.childNodes[d]);if(f)return f}return null}function c(a,
d){if(a.nodeType===3){var f=b.exec(a.nodeValue);f&&f.length>1&&d(a,f)}if(a.hasChildNodes())for(f=0;f<a.childNodes.length;f++)c(a.childNodes[f],d)}var b=/\$\{([^\}]+)\}/,a=[];return{$:function(a,d){d||(d=document);return d.querySelector(a)},$$:h,$$array:function(a,d){return Array.prototype.slice.call(h(a,d))},node:function(a){var d=a;typeof a==="string"&&(d=document.getElementById(a));return d},contains:k,bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.body.scrollLeft,top:a.top+
document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:g,lastTabbable:e,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,d){c(a,function(a,i){a.parentNode.replaceChild(document.createTextNode(d[i[1]]||i[1]),a)})},processDOMNodes:function(a,d){c(a,function(a,i){var b=d[i[1]];if(b){var c=document.createRange(),j=i.index;c.setStart(a,j);c.setEnd(a,
j+i[0].length);c.deleteContents();c.insertNode(b)}})},addAutoDismiss:function(b,d){a.length===0&&document.addEventListener("click",function(d){for(var i=[],b=0;b<a.length;b++){var c=a[b].dismiss,j=!1,e;if(a[b].excludeNodes.every(function(a){return a&&(j=document.compareDocumentPosition(document,a)!==1)&&k(a,d.target)?(e=a,!1):!0})){try{c()}catch(g){typeof console!=="undefined"&&console&&console.error(g&&g.message)}j=document.compareDocumentPosition(document,e)!==1}j&&i.push(a[b])}a=i},!0);a.push({excludeNodes:b,
dismiss:d})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",
"Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error",
"no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("text",["module"],function(h){var k,g,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,b=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,j=a&&location.protocol&&location.protocol.replace(/\:/,""),d=a&&location.hostname,f=a&&(location.port||void 0),i=[],l=h.config&&h.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),d=a.match(b);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,d,f;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(d=0;d<3;d+=1){f=e[d];try{a=new ActiveXObject(f)}catch(i){}if(a){e=[f];break}}return a},parseName:function(a){var d,
f,i=!1,b=a.indexOf(".");d=a.indexOf("./")===0||a.indexOf("../")===0;b!==-1&&(!d||b>1)?(d=a.substring(0,b),f=a.substring(b+1,a.length)):d=a;a=f||d;b=a.indexOf("!");b!==-1&&(i=a.substring(b+1)==="strip",a=a.substring(0,b),f?f=a:d=a);return{moduleName:d,ext:f,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,f,i){var b,c;b=k.xdRegExp.exec(a);if(!b)return!0;a=b[2];b=b[3];b=b.split(":");c=b[1];b=b[0];return(!a||a===d)&&(!b||b.toLowerCase()===f.toLowerCase())&&(!c&&!b||c===i)},finishLoad:function(a,
d,f,b){f=d?k.strip(f):f;l.isBuild&&(i[a]=f);b(f)},load:function(i,b,c,e){if(e.isBuild&&!e.inlineText)c();else{l.isBuild=e.isBuild;var g=k.parseName(i),e=g.moduleName+(g.ext?"."+g.ext:""),h=b.toUrl(e),t=l.useXhr||k.useXhr;!a||t(h,j,d,f)?k.get(h,function(a){k.finishLoad(i,g.strip,a,c)},function(a){c.error&&c.error(a)}):b([e],function(a){k.finishLoad(g.moduleName+"."+g.ext,g.strip,a,c)})}},write:function(a,d,f){if(i.hasOwnProperty(d)){var b=k.jsEscape(i[d]);f.asModule(a+"!"+d,"define(function () { return '"+
b+"';});\n")}},writeFile:function(a,d,f,i,b){var d=k.parseName(d),c=d.ext?"."+d.ext:"",j=d.moduleName+c,n=f.toUrl(d.moduleName+c)+".js";k.load(j,f,function(){var d=function(a){return i(n,a)};d.asModule=function(a,d){return i.asModule(a,n,d)};k.write(a,j,d,b)},b)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)g=require.nodeRequire("fs"),k.get=function(a,d){var f=g.readFileSync(a,"utf8");f.indexOf("\ufeff")===0&&(f=f.substring(1));d(f)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,d,f,i){var b=k.createXhr(),c;b.open("GET",a,!0);if(i)for(c in i)i.hasOwnProperty(c)&&b.setRequestHeader(c.toLowerCase(),i[c]);if(l.onXhr)l.onXhr(b,a);b.onreadystatechange=function(){var i;if(b.readyState===4)i=b.status,i>399&&i<600?(i=Error(a+" HTTP status: "+i),i.xhr=b,f(i)):d(b.responseText)};b.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,d){var f,i,b=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),j="";try{f=new java.lang.StringBuffer;(i=b.readLine())&&i.length()&&i.charAt(0)===65279&&(i=i.substring(1));for(f.append(i);(i=b.readLine())!==null;)f.append(c),f.append(i);j=String(f.toString())}finally{b.close()}d(j)};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(h,k,g){return{slideoutHTMLFragment:function(e){var c=document.createElement("div");c.innerHTML=g;var b=k.$("#slideContainer",c);b.id=e+b.id;b=k.$("#pageCommandParameters",c);b.id=e+b.id;b=k.$("#pageCommandDismiss",c);b.id=e+b.id;return c.innerHTML}}});
define("orion/util",[],function(){var h=navigator.userAgent,k=parseFloat(h.split("MSIE")[1])||void 0,g=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,e=h.indexOf("Opera")!==-1,c=parseFloat(h.split("Chrome/")[1])||void 0,b=h.indexOf("Safari")!==-1&&!c,a=parseFloat(h.split("WebKit/")[1])||void 0,j=h.indexOf("Android")!==-1,d=h.indexOf("iPad")!==-1,h=h.indexOf("iPhone")!==-1,f=d||h,i=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,o=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return d[(f<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:k,isFirefox:g,isOpera:e,isChrome:c,isSafari:b,isWebkit:a,isAndroid:j,isIPad:d,isIPhone:h,isIOS:f,isMac:i,isWindows:l,isLinux:o,platformDelimiter:l?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(h){function k(e,c,b,a,j,d){this.type=d||"keydown";this.keyCode=typeof e==="string"&&this.type==="keydown"?e.toUpperCase().charCodeAt(0):e;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=b!==void 0&&b!==null?b:!1;this.mod3=a!==void 0&&a!==null?a:!1;this.mod4=j!==void 0&&j!==null?j:!1}function g(e){this.keys=e}k.prototype={getKeys:function(){return[this]},match:function(e,c){if(c!==void 0){if(c!==0)return!1}else if(e instanceof Array){if(e.length>1)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(h.isOpera?e.which:e.charCode!==void 0?e.charCode:e.keyCode)?this.mod1!==(h.isMac?e.metaKey:e.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==e.shiftKey?!1:this.mod3!==e.altKey?!1:h.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e?!1:this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0}};g.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(e,c){var b=this.keys;if(c!==void 0)return c>b.length?!1:b[c].match(e)?c===b.length-1?!0:c+1:!1;else{e instanceof Array||(e=[e]);if(e.length>b.length)return!1;var a;for(a=0;a<e.length;a++)if(!b[a].match(e[a]))return!1;return a===b.length?!0:a}},equals:function(e){if(!e.keys)return!1;if(e.keys.length!==this.keys.length)return!1;for(var c=0;c<e.keys.length;c++)if(!e.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:g}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(h,k){function g(e){this._init(e)}g.prototype={_init:function(e){this._dropdownNode=k.node(e.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=e.populate;var c=this;this._triggerNode.addEventListener("click",function(b){c.toggle()&&k.stop(b)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)c.toggle(),k.stop(b)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();if(e.length>0){if(!this._hookedAutoDismiss){var c=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(c)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();e[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var e=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=
0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||!e.parentNode.style?e:this._boundingNode(e.parentNode)},close:function(e){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");e&&this._triggerNode.focus();return!0},getItems:function(){var e=[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&
e.push(b)});return e},empty:function(){var e=this;k.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===e._dropdownNode&&c.parentNode.removeChild(c)})},_dropdownKeyDown:function(e){if(e.keyCode===k.KEY.UP||e.keyCode===k.KEY.DOWN||e.keyCode===k.KEY.RIGHT||e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.LEFT){var c=this.getItems(),b=document.activeElement;if(c.length&&c.length>0&&b){var a=c.indexOf(b);a<0&&(a=c.indexOf(b.parentNode));a>=0&&(e.keyCode===k.KEY.UP&&a>0?(a--,c[a].focus()):e.keyCode===
k.KEY.DOWN&&a<c.length-1?(a++,c[a].focus()):e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.RIGHT?b.classList.contains("dropdownTrigger")&&b.dropdown&&b.dropdown.open():e.keyCode===k.KEY.LEFT&&b.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(e))}}else e.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(e))}};g.prototype.constructor=g;return{Dropdown:g}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(h,k){function g(e){this._init(e)}g.prototype={_init:function(e){this._node=k.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=e.hideDelay===void 0?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===c._node&&(c.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",function(a){k.contains(c._node,a.target)&&(c.show(),k.stop(a))},!1);for(var b=0;b<e.length;b++)this._node.addEventListener(e[b],function(a){k.contains(c._node,a.target)&&c.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var e=this;k.addAutoDismiss([this._tip,this._node],function(){e.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(e._timeout)window.clearTimeout(e._timeout),e._timeout=null;e._tip.addEventListener("mouseout",function(c){k.contains(e._tip,c.target)&&(e.hide(),k.stop(c))},!1)},!1)}return this._tip},_positionTip:function(e,c){this._makeTipNode();e==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var b=this._node,a;for(a=k.bounds(b);b&&!a.width&&!a.height;b=b.parentNode)a=
k.bounds(b);var b=k.bounds(this._tipInner),j;switch(e){case "above":j=a.top-b.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":j=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":j=a.top-this._tailSize/2;a=a.left-b.width-this._tailSize-1;break;default:j=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var d=k.bounds(document.documentElement);if(j+b.height>d.height)if(c)j=d.height-b.height-1;else return!1;if(a+b.width>d.width)if(c)a=d.width-b.width-
1;else return!1;if(a<0)if(c)a=4;else return!1;if(j<0)if(c)j=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+e),e==="above"||e==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),e==="left"))this._tail.style.left=b.width+"px";this._tip.style.top=j+"px";this._tip.style.left=a+"px";this._tip.style.width=b.width+"px";this._tip.style.height=b.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var e=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var c=!1,b=0;!c&&b<e._position.length;)c=e._positionTip(e._position[b]),b++;c||e._positionTip(e._position[0],!0);e._tip.classList.add("tooltipShowing");e._afterShowing&&e._afterShowing()},this._showDelay)}},hide:function(e){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(e===void 0)e=this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},e)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipInner=this._tip=null}};g.prototype.constructor=g;return{Tooltip:g}});
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(h,k,g,e,c,b,a,j){function d(a,d){for(var f in d)if(d[f]&&d[f].keyBinding&&d[f].command&&d[f].keyBinding.match(a)){var i=d[f],b=i.keyBinding;if(!b.domScope||g.contains(g.node(b.domScope),a.target)){var n=i.invocation;if(n){var c=i.command;if(c.hrefCallback){g.stop(a);
f=c.hrefCallback.call(n.handler||window,n);f.then?f.then(function(a){window.open(a)}):window.open(f);break}else if(c.onClick||c.callback){g.stop(a);window.setTimeout(function(){(c.onClick||c.callback).call(n.handler||window,n)},0);break}}}}}function f(a,d,f){d.classList.add("commandImage");var i;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(i=document.createElement("span"),d.appendChild(i),i.classList.add(a.spriteClass),i.classList.add(a.imageClass)):(i=new Image,i.alt=a.name,
i.name=f,i.id=f,i.src=a.image,d.appendChild(i));return i}function i(a,d,f,i,b){this.commandRegistry=b;this.handler=a;this.items=d;this.userData=f;this.command=i;if(i.parameters)this.parameters=i.parameters.makeCopy();this.id=i.id}function l(a){this._init(a)}var o=null,m={};window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===
90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var f=a.target.nodeName.toLowerCase();if(f==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(f===
"textarea")return}f={};if(o){var i,b,c;b=Object.keys(m);for(i=0;i<b.length;i++)c=b[i],f[c]=m[c];var n=o();b=Object.keys(n);for(i=0;i<b.length;i++)c=b[i],f[c]=n[c]}else f=m;d(a,f)},!1);i.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new i(this.handler,this.items,this.userData,this.command,this.commandRegistry);d.domNode=this.domNode;d.domParent=this.domParent;if(a)d.parameters=a.makeCopy();else if(this.parameters)d.parameters=
this.parameters.makeCopy();return d}};i.prototype.constructor=i;l.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||h.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,
d,f,i,b){this.getChoices(d,f,i).forEach(function(f){if(f.name){var i=document.createElement("li");a.appendChild(i);var c=document.createElement("span");c.tabIndex=0;c.role="menuitem";c.classList.add("dropdownMenuItem");var j=document.createTextNode(f.name);c.appendChild(j);i.appendChild(c);c.choice=f;c.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);c.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else b._generateMenuSeparator(a)})},getChoices:function(a,d,f){return this.choiceCallback?this.choiceCallback.call(d,a,f):null},makeChoiceCallback:function(a,d){return function(f){a.callback&&a.callback.call(a,d,f)}},hasImage:function(){return this.imageClass||this.image!==h.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:i,createDropdownMenu:function(a,d,i,b,j,n){a=g.node(a);if(!a)throw"no parent node was specified";
var l=document.createRange();l.selectNode(a);l=l.createContextualFragment(c);g.processTextNodes(l,{ButtonText:d});a.appendChild(l);a=a.lastChild;l=a.previousSibling;b?l.classList.add(b):(l.classList.add("orionButton"),l.classList.add("commandButton"));if(j){if(!n)l.textContent="",l.setAttribute("aria-label",d);f({spriteClass:"commandSprite",imageClass:j},l,d);l.classList.add("orionButton")}l.dropdown=new e.Dropdown({dropdown:a,populate:i});a.dropdown=l.dropdown;return{menuButton:l,menu:a,dropdown:l.dropdown}},
createCheckedMenuItem:function(d,f,i,b){d=g.node(d);if(!d)throw"no parent node was specified";var c=document.createRange();c.selectNode(d);c=c.createContextualFragment(a);g.processTextNodes(c,{ItemText:f});d.appendChild(c);d=g.$(".checkedMenuItem",d.lastChild);d.checked=i;d.addEventListener("change",b,!1)},createCommandItem:function(a,d,i,b,c,n,e){var l,n=n||!d.name&&d.hasImage();if(d.hrefCallback)l=document.createElement("a"),l.id=b,n&&d.hasImage()?f(d,l,b):(l.className="commandLink",l.appendChild(document.createTextNode(d.name))),
e=d.hrefCallback.call(i.handler,i),e.then?e.then(function(a){l.href=a}):l.href=e?e:"#";else{l=document.createElement("button");l.className="orionButton";n?d.hasImage()?(f(d,l,b),d.name&&l.setAttribute("aria-label",d.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(d.name))):(l.classList.add("commandButton"),b=document.createTextNode(d.name),l.appendChild(b));var u=e||d.callback;if(u)d.onClick=u,l.addEventListener("click",function(){u.call(i.handler,
i)},!1)}a.nodeName.toLowerCase()==="ul"?(e=document.createElement("li"),a.appendChild(e),a=e):l.classList.add("commandMargins");a.appendChild(l);if(d.tooltip)l.commandTooltip=new j.Tooltip({node:l,text:d.tooltip,position:["above","below","right","left"]});c&&(m[d.id]={keyBinding:c,command:d,invocation:i});return l},createCommandMenuItem:function(a,d,f,i,b){var n,c=a.dropdown;if(d.hrefCallback)n=document.createElement("a"),n.appendChild(document.createTextNode(d.name)),b=d.hrefCallback.call(f.handler,
f),b.then?b.then(function(a){n.href=a}):n.href=b?b:"#";else{n=document.createElement("span");n.tabIndex=0;n.appendChild(document.createTextNode(d.name));var e=b||d.callback;if(e)d.onClick=e,n.addEventListener("click",function(){c.close(!0);e.call(f.handler,f)},!1)}if(d.tooltip)n.commandTooltip=new j.Tooltip({node:n,text:d.tooltip,position:["right","left","above","below"]});n.className="dropdownMenuItem";n.role="menuitem";b=document.createElement("li");a.appendChild(b);b.appendChild(n);i&&(m[d.id]=
{keyBinding:i,command:d,invocation:f});return n},setKeyBindingProvider:function(a){o=a},localKeyBindings:m,_testMethodProcessKey:d}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function g(c){var b="",a=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(b+=a?"Cmd+":"Ctrl+");c.mod2&&(b+="Shift+");c.mod3&&(b+="Alt+");c.mod4&&a&&(b+="Ctrl+");if(c.alphaKey)return b+c.alphaKey;if(c.type==="keypress")return b+c.keyCode;for(var j in k.KEY)if(typeof(k.KEY[j]==="number")&&k.KEY[j]===c.keyCode)return b+j;var d;switch(c.keyCode){case 59:d=c.mod2?":":";";break;case 61:d=c.mod2?"+":"=";break;case 188:d=
c.mod2?"<":",";break;case 190:d=c.mod2?">":".";break;case 191:d=c.mod2?"?":"/";break;case 192:d=c.mod2?"~":"`";break;case 219:d=c.mod2?"{":"[";break;case 220:d=c.mod2?"|":"\\";break;case 221:d=c.mod2?"}":"]";break;case 222:d=c.mod2?'"':"'"}return d?b+d:c.keyCode>=112&&c.keyCode<=123?b+"F"+(c.keyCode-111):b+String.fromCharCode(c.keyCode)}function e(c){var b=window.navigator.platform.indexOf("Mac")!==-1;return b&&c.metaKey||!b&&c.ctrlKey}return{getUserKeyString:function(c){for(var b="",c=c.getKeys(),
a=0;a<c.length;a++)a!==0&&(b+=" "),b+=g(c[a]);return b},getUserText:function(c,b,a,j,d,f,i,e,o){var m=!1,i=function(i){return function(e){if(!m){var l=k.node(c),g=l.value;if(l)if(i&&e.keyCode===k.KEY.ESCAPE){if(a)b.style.display="inline";m=!0;l.parentNode.removeChild(l);f&&f()}else if(!(i&&e.keyCode!==k.KEY.ENTER)){if(g.length===0||!o&&g===j){if(a)b.style.display="inline"}else d(g);m=!0;l.parentNode&&l.parentNode.removeChild(l);f&&f()}}}},g=document.createElement("input");g.id=c;g.value=j||"";b.parentNode.insertBefore(g,
b.nextSibling);g.classList.add("userEditBoxPrompt");if(a)b.style.display="none";g.addEventListener("keydown",i(!0),!1);g.addEventListener("blur",i(!1),!1);window.setTimeout(function(){g.focus();if(j){var a=k.node(c),d=e?j.indexOf(e):-1;if(d>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",d),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,d);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=d}else a.select()}},
0)},openInNewWindow:e,followLink:function(c,b){b&&e(b)?window.open(c):window.location=c},createButton:function(c,b){var a=document.createElement("button");a.className="orionButton commandButton commandMargins";a.addEventListener("click",function(a){b();k.stop(a)},!1);c&&a.appendChild(document.createTextNode(c));return a},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var h=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(g){var g=g||window.location.toString(),e={resource:""},c=g.indexOf("#");if(c!==-1&&(g=g.substring(c+1),g.length!==0)){g=g.split(",");Object.defineProperty(e,"resourceRaw",{value:g[0]});e.resource=decodeURIComponent(g[0]);if(!e.resource.match(h))e.resource=encodeURI(e.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(c=1;c<g.length;c++){var b=
/([^=]*)(=?)(.*)/.exec(g[c]),a=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");a!==""&&a!=="resource"&&(e[a]=b)}}return e},validateURLScheme:function(g,e){var c=g;if(g.indexOf("://")===-1){var b=document.createElement("a");b.href=g;c=b.href}b=!1;return(b=e?e.some(function(a){return RegExp("^"+a+":","i").test(c)}):k.test(c))?g:(console.log("Illegal URL Scheme: '"+g+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function h(g,e){if(!k&&g)g.push({domNode:e}),e.tabIndex=-1,e.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(g,e,c){g&&(g=g.getGridNavHolder(e,!0))&&h(g,c)},generateNavGrid:h,removeNavGrid:function(g,e){if(g)for(var c=0;c<g.length;c++)if(g[c].domNode===e){g.splice(c,1);break}}}});
define("orion/commandRegistry","require,orion/commands,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(h,k,g,e,c,b,a,j,d,f,i){function l(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function o(a,d){this.token=a;this.parameterName=d}function m(a,d,f,i,b){this.name=a;this.type=d;this.label=f;this.value=i;this.lines=b||1}function s(a,d,f){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=d&&d.clientCollect}l.prototype={_init:function(a){this._selectionService=a.selection;var d=this;k.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&
this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var f=this._urlBindings[d].urlBinding.match(a);if(f){var i=this._urlBindings[d],b=i.command,c=i.invocation;if(c&&c.parameters&&b.callback){c.parameters.setValue(f.parameterName,f.parameterValue);var j=this;window.setTimeout(function(){j._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,f,i){d?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback&&this._invoke(new k.CommandInvocation(f,
d,null,a,this),i):(d=this._urlBindings[a])&&d.command&&d.command.callback&&this._invoke(d.invocation,i)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,d,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,f))},confirm:function(a,d,f,i,b,c){var j=!1;if(this._parameterCollector&&!b){var e=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,b){var n=document.createElement("span");n.classList.add("parameterPrompt");n.textContent=d;a.appendChild(n);n=document.createElement("button");n.addEventListener("click",function(){j=!0;e._parameterCollector.close()},!1);b.appendChild(n);n.appendChild(document.createTextNode(f));n.className="dismissButton";var c=document.createElement("button");c.addEventListener("click",function(){j=!1;e._parameterCollector.close()},!1);b.appendChild(c);c.appendChild(document.createTextNode(i));c.className=
"dismissButton";return n},function(){c(j)}))return}j=window.confirm(d);c(j)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,d){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){var i=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(i=this._parameterCollector.collectParameters(a),!i)){var b=new f.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),i=b.contentContainer();i.classList.add("parameterPopup");var n=window.document.activeElement,c=this._parameterCollector.getFillFunction(a,function(){n&&n.focus();b.destroy()})(i);b.show();window.setTimeout(function(){c.focus();c.select()},0);i=!0}i||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||
window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function d(a){var f=a.invocation;if(f)if(a=a.command,a.hrefCallback)f=a.hrefCallback.call(f.handler||window,f),f.then?f.then(function(a){window.open(a)}):window.open(f);else if(a.onClick||a.callback)(a.onClick||a.callback).call(f.handler||window,f)}function f(a){return function(){d(a)}}var i=
{},b,c,j=[],e;for(e in this._activeBindings)(c=this._activeBindings[e])&&c.keyBinding&&c.command&&j.push(c);j.sort(function(a,d){return a.command.name.localeCompare(d.command.name)});for(e=0;e<j.length;e++)c=j[e],c.keyBinding.scopeName?(i[c.keyBinding.scopeName]||(i[c.keyBinding.scopeName]=[]),i[c.keyBinding.scopeName].push(c)):(b=g.getUserKeyString(c.keyBinding),a.createItem(b,c.command.name,f(c)));for(var l in i)i[l].length&&i[l].length>0&&(a.createHeader(l),i[l].forEach(function(d){b=g.getUserKeyString(d.keyBinding);
a.createItem(b,d.command.name,f(d))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var f=this;d.forEach(function(d){f._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,d,f,i,b,c,j,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));if(a[d]){if(i)a[d].title=i;if(f)a[d].position=f;if(j)a[d].imageClass=
j;if(e)a[d].tooltip=e;a[d].emptyGroupMessage=c}else a[d]={title:i,position:f,emptyGroupMessage:c,imageClass:j,tooltip:e,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){if(d.length>1)a[d]||(a[d]={position:0,children:{}}),a=a[d].children});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,
d,f,i,b,c,j){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];i&&(a=this._createEntryForPath(a,i));a[d]={position:f};c&&((f=this._commandList[d])?this._addBinding(f,"key",c,b):this._addPendingBinding(d,"key",c,b));j&&((f=this._commandList[d])?this._addBinding(f,"url",j,b):this._addPendingBinding(d,"url",j,b));a.sortedContributions=null},_addBinding:function(a,d,f,i){if(!a.id)throw Error("No command id: "+a);d==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:f,bindingOnly:i}:d==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:i})},_addPendingBinding:function(a,d,f,i){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,binding:f,bindingOnly:i})},_checkForTrailingSeparator:function(a,d,f){var i;if(d==="tool"||d==="button")if((i=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&i.classList.contains("commandSeparator"))return f?(a.removeChild(i),!1):!0;if(d===
"menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(i=a[a.length-1],f)i.parentNode.parentNode.removeChild(i.parentNode);else return!0;return!1},renderCommands:function(a,d,f,i,b,j,e){if(typeof a!=="string")throw"a scope id for rendering must be specified";d=c.node(d);if(!d)throw"no parent";var l=this._contributionsByScopeId[a];if(!f&&l){var f=l.localSelectionService||this._selectionService,o=this;f&&f.getSelections(function(f){o.renderCommands(a,
d,f,i,b,j)})}else l&&(this._render(this._contributionsByScopeId[a],d,f,i,b||"button",j,e),this._checkForTrailingSeparator(d,b,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,d,b,c,n,j,e){var l=a.sortedContributions;if(!l){var l=[],o=!1,m;for(m in a)if(!a.hasOwnProperty||a.hasOwnProperty(m)){var g=
a[m];if(g&&typeof g.position==="number")g.id=m,l.push(g),o=!0}if(o)l.sort(function(a,d){return a.position-d.position}),a.sortedContributions=l}var h=0,s=this;l.forEach(function(a){var l,u;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){l=a.children;var o;if(n==="tool"||n==="button")if(a.title)o=s._createDropdownMenu(d,a.title,null,null,a.imageClass,a.tooltip),e&&i.generateNavGrid(e,o.menuButton),window.setTimeout(function(){s._render(a.children,o.menu,
b,c,"menu",j,e);s._checkForTrailingSeparator(o.menu,"menu",!0);if(o.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!o.menuButton.emptyGroupTooltip)o.menuButton.emptyGroupTooltip=new f.Tooltip({node:o.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else e&&i.removeNavGrid(e,o.menuButton),o.menu.parentNode&&o.menu.parentNode.removeChild(o.menu),o.destroyButton&&o.destroyButton.parentNode&&o.destroyButton.parentNode.removeChild(o.destroyButton);
else o.menuButton.style.visibility="visible"},0);else{var m;d.childNodes.length>0&&!s._checkForTrailingSeparator(d,n)&&(m=s.generateSeparatorImage(d));s._render(l,d,b,c,n,j,e);d.childNodes.length>0&&d.childNodes[d.childNodes.length-1]!==m&&(m=s.generateSeparatorImage(d))}else if(a.title){if(m=s._createDropdownMenu(d,a.title,!0,null,null,a.imageClass))s._render(l,m.menu,b,c,"menu",j,e),m.menu.childNodes.length===0&&m.destroyButton&&d.removeChild(m.destroyButton)}else d.childNodes.length>0&&s._generateMenuSeparator(d),
s._render(l,d,b,c,n,j,e),s._generateMenuSeparator(d)}else{var g=s._commandList[a.id];l=g?!0:!1;var y=null,y=null;if(g){u=new k.CommandInvocation(c,b,j,g,s);u.domParent=d;m=l&&(g.visibleWhen?g.visibleWhen(b):!0);if(s._activeBindings[g.id]&&s._activeBindings[g.id].keyBinding)y=s._activeBindings[g.id],y.invocation=m?u:null,y.bindingOnly&&(l=!1);if(s._urlBindings[g.id]&&s._urlBindings[g.id].urlBinding)y=s._urlBindings[g.id],y.invocation=m?u:null,y.bindingOnly&&(l=!1);l=l&&m}if(l)g.choiceCallback?(n===
"tool"||n==="button"?(l=d,m=!1,d.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),d.appendChild(l))):(l=d,m=!0),s._createDropdownMenu(l,g.name,m,function(a){g.populateChoicesMenu(a,b,c,j,s)}.bind(g),g.imageClass,g.tooltip||g.title)):(u.handler=u.handler||this,u.domParent=d,m=function(){s._invoke(u)},n==="menu"?l=k.createCommandMenuItem(d,g,u,null,m):(l=n+g.id+h,l=k.createCommandItem(d,g,u,l,null,n==="tool",m)),i.generateNavGrid(e,l),u.domNode=l,h++)}})},_createDropdownMenu:function(a,
d,i,e,n,l){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var o,u=a;if(i)l=document.createRange(),l.selectNode(a),l=l.createContextualFragment(j),c.processTextNodes(l,{ButtonText:d}),a.appendChild(l),o=a.lastChild,a=o.lastChild,d=a.previousSibling,d.dropdown=new b.Dropdown({dropdown:a,populate:e}),a.dropdown=d.dropdown;else if(a.nodeName.toLowerCase()==="ul"&&(u=document.createElement("li"),a.appendChild(u),o=u),a=null,n&&(a="dropdownButtonWithIcon",l=l||d),l=n?l||d:l,e=k.createDropdownMenu(u,
d,e,a,n),d=e.menuButton,a=e.menu,l)d.commandTooltip=new f.Tooltip({node:d,text:l,position:["above","below","right","left"]});return{menuButton:d,menu:a,dropdown:d.dropdown,destroyButton:o}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");d.appendChild(f);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};l.prototype.constructor=l;o.prototype={match:function(a){a=e.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};o.prototype.constructor=o;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;s.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:
null},setValue:function(a,d){var f=this.parameterTable[a];if(f)f.value=d},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new m(d.name,d.type,d.label,d.value,d.lines);a.push(d)});var d=new s(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=
s;return{CommandRegistry:l,URLBinding:o,ParametersDescription:s,CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(h,k,g){function e(c,b){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=b}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&g.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&g.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,b,a){typeof c==="string"&&(c=g.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=a;var j=b(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!j)return!1;this._activeElements.focusNode=j;c=g.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){b=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=h.Close;b.appendChild(c);var d=this;c.addEventListener("click",function(){d.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(j)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){j.focus();j.select&&j.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,b){g.$$array("input",b).forEach(function(a){a.type==="checkbox"?c.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&c.parameters.setValue(a.parameterName,a.value.trim())});g.$$array("textArea",b).forEach(function(a){c.parameters.setValue(a.parameterName,a.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,b){var a=this;return function(j,d){var f=null,i=function(){b&&b();a.close()},e=function(d){d.keyCode===g.KEY.ENTER&&a._collectAndCall(c,j);if(d.keyCode===g.KEY.ESCAPE||d.keyCode===g.KEY.ENTER)i(),g.stop(d)};c.parameters.forEach(function(a){var d=null;if(a.label)d=document.createElement("label"),d.classList.add("parameterInput"),d.setAttribute("for",a.name+
"parameterCollector"),d.textContent=a.label,j.appendChild(d);var b=a.name+"parameterCollector",c=d||j;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)d=document.createElement("textarea"),d.rows=a.lines,d.type="textarea",d.id=b,c.appendChild(d),e=function(a){a.keyCode===g.KEY.ESCAPE&&(i(),g.stop(a))};else if(a.type==="boolean"){if(d=document.createElement("input"),d.type="checkbox",d.id=b,c.appendChild(d),a.value)d.checked=!0}else if(d=document.createElement("input"),d.type=a.type,d.id=b,
c.appendChild(d),a.value)d.value=a.value;d.classList.add("parameterInput");d.setAttribute("speech","speech");d.setAttribute("x-webkit-speech","x-webkit-speech");d.parameterName=a.name;f||(f=d);d.addEventListener("keydown",e,!1)});var o=d;if(!o)o=document.createElement("span"),o.className="layoutRight parametersDismiss",j.appendChild(o);var m=function(a,d){var f=document.createElement("button");d.appendChild(f);a&&f.appendChild(document.createTextNode(a));f.classList.add("dismissButton");return f};
if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,m(h.More,o).addEventListener("click",function(){c.parameters.optionsRequested=!0;a._collectAndCall(c,j);i()},!1);m(h.Submit,o).addEventListener("click",function(){a._collectAndCall(c,j);i()},!1);o=m(null,o);o.id="closebox";o.classList.add("imageSprite");o.classList.add("core-sprite-close");o.title=h.Close;o.addEventListener("click",function(){i()},!1);return f}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});
define("orion/editor/regex",[],function(){return{escape:function(h){return h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(h){return(h=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(h))?{pattern:h[1],flags:h[2]}:null}}});
define("orion/contentTypes",[],function(){function h(b,a){function c(a,d,f,i){var f=d.filename.indexOf(f)>=0,b=d.extension.indexOf(i)>=0;if(f||b)if(!a||f&&a.extension.indexOf(i)>=0)return d;return a}for(var d=b&&b.split(".").pop(),f=null,i=0;i<a.length;i++){var e=a[i];c(f,e,b,d)===e&&(f=e)}return f}function k(b){this.serviceRegistry=b;this.map=function(a){function b(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var a=a.getServiceReferences(e).concat(a.getServiceReferences(c)),
d={},f=0;f<a.length;f++)for(var i=b(a[f].getProperty("contentTypes")),l=0;l<i.length;l++){var o=i[l];d[o.id]||(d[o.id]={id:o.id,name:o.name,image:o.image,"extends":o["extends"],extension:b(o.extension),filename:b(o.filename)})}return d}(b);b.registerService(g,this)}var g="orion.core.contenttypes",e="orion.core.contenttype",c="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(b[c]);return a},getContentTypesMap:function(){return this.map},
getFileContentType:function(b){return h(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return h(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 c=b,d={};c&&(c=this.getContentType(c["extends"]));){if(c.id===a.id)return!0;if(d[c.id])throw Error("Cycle: "+c.id);d[c.id]=!0}return!1},
isSomeExtensionOf:function(b,a){for(var c=0;c<a.length;c++)if(this.isExtensionOf(b,a[c]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:h}});
define("orion/URITemplate",[],function(){function h(a){this._text=a}function k(a,f){if(f==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(f==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(f==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+f);}function g(a,f,i){for(var b=[],c=0;c<a.length;c++)typeof a[c]!=="undefined"&&
b.push(k(a[c],f));return b.join(i)}function e(a,f,i,b){for(var c=Object.keys(a),j=[],e=0;e<c.length;e++)typeof a[c[e]]!=="undefined"&&j.push(k(c[e],f)+i+k(a[c[e]],f));return j.join(b)}function c(d){if(d.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=a[d[0]])?d=d.substring(1):this._operator=a.NUL;for(var f=[],i=d.split(","),b=0;b<i.length;b++){var c=i[b].match(j);if(c===null)throw Error("Bad VarSpec: "+d);f.push({name:c[1],explode:!!c[2],prefix:c[3]?parseInt(c[3],
10):-1})}this._varSpecList=f}function b(a){for(var f=[],i=0,b=a.indexOf("{",i);b!==-1;){f.push(new h(a.substring(i,b)));i=a.indexOf("}",b+1);if(i===-1)throw Error("Invalid template: "+a);f.push(new c(a.substring(b+1,i)));i+=1;b=a.indexOf("{",i)}f.push(new h(a.substring(i)));this._templateComponents=f}var a={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-,"}},j=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;h.prototype={expand:function(){return encodeURI(this._text)}};c.prototype={expand:function(a){for(var f=[],i=
0;i<this._varSpecList.length;i++){var b=this._varSpecList[i],c=b.name,j=a[c],h=typeof j;if(h!=="undefined"&&j!==null){var r=f.length===0?this._operator.first:this._operator.sep;if(h==="string")this._operator.named&&(r+=k(c,"U+R"),r+=j.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<j.length&&(j=j.substring(0,b.prefix)),r+=k(j,this._operator.allow);else if(Array.isArray(j))b.explode?r+=g(j,this._operator.allow,this._operator.sep):(this._operator.named&&(r+=k(c,"U+R"),r+=j.length===0?this._operator.ifemp:
"="),r+=g(j,this._operator.allow,","));else if(h==="object")b.explode?r+=e(j,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(r+=k(c,"U+R"),r+=Object.keys(j).length===0?this._operator.ifemp:"="),r+=e(j,this._operator.allow,",",","));else throw Error("bad param type: "+c+" : "+h);f.push(r)}}return f.join("")}};b.prototype={expand:function(a){for(var f=[],i=0;i<this._templateComponents.length;i++)f.push(this._templateComponents[i].expand(a));return f.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(h,k){function g(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var e={};return{getMessageBundle:function(c){function b(){h(["i18n!"+c],function(d){if(d){var i=c;d._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+i,JSON.stringify(d));delete d._expires}a.resolve(d)})}if(e[c])return e[c];var a=new k;e[c]=
a;var j=g(c);if(j)return a.resolve(j),a;try{h([c],b)}catch(d){h(["orion/i18n!"+c],b)}return a},formatMessage:function(c){var b=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(h,k,g,e,c){function b(){return(new URL(h.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function a(a,d){var f=a.getServiceReferences(d||"orion.page.link"),i=g.matchResourceParameters(window.location.href),l={OrionHome:b(),Location:i.resource},o=[];f.forEach(function(a){var d={};a.getPropertyKeys().forEach(function(f){d[f]=a.getProperty(f)});if(d.uriTemplate&&
d.nls&&(d.name||d.nameKey)){var f=new k;c.getMessageBundle(d.nls).then(function(a){var i=new e(d.uriTemplate),i=window.decodeURIComponent(i.expand(l)),i=g.validateURLScheme(i);d.href=i;d.textContent=d.nameKey?a[d.nameKey]:d.name;f.resolve(d)});o.push(f)}else if(d.uriTemplate&&d.name){var i=new e(d.uriTemplate),i=window.decodeURIComponent(i.expand(l)),i=g.validateURLScheme(i);d.href=i;d.textContent=d.name;o.push((new k).resolve(d))}});return k.all(o)}return{createPageLinks:function(b,d){return a(b,
d).then(function(a){a.sort(function(a,d){var f=a.textContent&&a.textContent.toLowerCase(),b=d.textContent&&d.textContent.toLowerCase();return f<b?-1:f>b?1:0});return a.map(function(a){var d=a.href,a=a.textContent,f=document.createElement("a");f.href=d;f.target="_self";f.classList.add("targetSelector");f.textContent=a;return f})})},getPageLinksInfo:a,getOrionHome:b}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(h,k,g,e,c,b,a,j,d){var f={},i=d.getOrionHome();f._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var d=a.constructor(),f;for(f in a)f!=="children"&&f!=="Children"&&(d[f]=m(a[f]));return d};f._getOpenWithNavCommandExtensions=function(a){function d(a,f){for(var i=a.getServiceReferences("orion.navigate.openWith"),
b=[],n=0;n<i.length;n++){var c=i[n];c.getProperty("editor")===f.id&&(c=c.getProperty("contentType"),c instanceof Array?b=b.concat(c):c!==null&&typeof c!=="undefined"&&b.push(c))}return b}for(var f=function(){for(var d=a.getServiceReferences("orion.edit.editor"),f=[],i=0;i<d.length;i++){var b=d[i],c=b.getProperty("id");f.push({id:c,name:b.getProperty("name"),nameKey:b.getProperty("nameKey"),nls:b.getProperty("nls"),uriTemplate:b.getProperty("orionTemplate")||b.getProperty("uriTemplate")})}return f}(),
i=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),b=[],c=0;c<f.length;c++){var n=f[c],j=i&&i.editor===n.id,e=d(a,n);e.length&&b.push({properties:{name:n.name||n.id,nameKey:n.nameKey,id:"eclipse.openWithCommand."+n.id,tooltip:n.name,tooltipKey:n.nameKey,contentType:e,uriTemplate:n.uriTemplate,nls:n.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return b};f._makeValidator=function(a,
d,f,j){function e(a,d,f,i){var b=f.match,c;if(d.indexOf("|")>=0)return c=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),e(a,c,f,i)?!0:e(a,d,f,i);else if(d.indexOf(":")>=0)return c=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[c]?e(a[c],d,f,i):!1;else{a:{c=!1;var j;if(typeof a[d]!=="undefined"){if(typeof b==="undefined")j=a[d],c=!0;else if(typeof b==="string"){if(!typeof(a[d]==="string")){f=!1;break a}if(f.variableName){if(b=RegExp(b).exec(a[d]))c=b[0],j=f.variableMatchPosition===
"before"?a[d].substring(0,b.index):f.variableMatchPosition==="after"?a[d].substring(b.index+c.length):f.variableMatchPosition==="only"?c:a[d],c=!0}else{f=RegExp(b).test(a[d]);break a}}else a[d]===b&&(j=a[d],c=!0);if(c&&f.variableName&&(i[f.variableName]=j,i.itemCached=a,f.replacements))for(a=0;a<f.replacements.length;a++)d=!1,f.replacements[a].pattern?i[f.variableName]=i[f.variableName].replace(RegExp(f.replacements[a].pattern),f.replacements[a].replacement||""):d=!0,d&&window.console.log("Invalid replacements specified in validation property.  "+
f.replacements[a]);f=c}else f=!1}return f}}return{info:a,validationFunction:function(d){typeof j==="function"&&(d=j.call(this,d));if(d){if(Array.isArray(d)){if((this.info.forceSingleItem||this.info.uriTemplate)&&d.length!==1)return!1;if(d.length<1)return!1}else d=[d];for(var i=0;i<d.length;i++){var b;a:{var l=d[i],u=f;if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var g=this.info.validationProperties[b];if(typeof g.source!=="undefined"){if(!e(l,g.source,g,this)){b=
!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");b=!1;break a}}if(this.info.contentType&&u){g=!1;if(l=c.getFilenameContentType(l.Name,u))for(b=0;b<this.info.contentType.length;b++)if(l.id===this.info.contentType[b]){g=!0;break}b=g}else b=!0}if(!b)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},f;for(f in a)a.hasOwnProperty(f)&&(d[f]=a[f]);if(this.info.validationProperties)for(f=
0;f<this.info.validationProperties.length;f++){var c=this.info.validationProperties[f];c.source&&c.variableName&&(this.itemCached===a&&this[c.variableName]||e(a,c.source,c,this),a[c.variableName]?window.console.log("Variable name "+c.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[c.variableName]=this[c.variableName])}d.OrionHome=i;a=new b(this.info.uriTemplate);return window.decodeURIComponent(a.expand(d))}return null}}};f._createCommandOptions=
function(d,i,b,c,j,e){function n(a,n){var l=f._makeValidator(d,b,c,e);a.visibleWhen=l.validationFunction.bind(l);if(j)if(l.generatesURI.bind(l)())a.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return l.getURI.bind(l)(a)};else{var v=d;a.callback=function(d){var c;if(v.forceSingleItem)d=Array.isArray(d.items)?d.items[0]:d.items,c=f._cloneItemWithoutChildren(d);else if(Array.isArray(d.items)){c=[];for(var n=0;n<d.items.length;n++)c.push(f._cloneItemWithoutChildren(d.items[n]))}else c=
f._cloneItemWithoutChildren(d.items);if(b)var j=b.getService("orion.page.progress");i.run?j?j.progress(i.run(c),"Running command: "+a.name):i.run(c):b&&(j?j.progress(b.getService(i).run(c),"Running command: "+a.name):b.getService(i).run(c))}}n.resolve(a)}var l=new k;d.nls?a.getMessageBundle(d.nls).then(function(a){n({name:d.nameKey?a[d.nameKey]:d.name,image:d.image,id:d.id||d.name,tooltip:d.tooltipKey?a[d.tooltipKey]:d.tooltip,isEditor:d.isEditor,showGlobally:d.showGlobally},l)}):n({name:d.name,image:d.image,
id:d.id||d.name,tooltip:d.tooltip,isEditor:d.isEditor,showGlobally:d.showGlobally},l);return l};f.getOpenWithCommands=function(a){var d=[],f;for(f in a._commandList){var i=a._commandList[f];i.isEditor&&d.push(i)}return d};var l;f.createAndPlaceFileCommandsExtension=function(a,d,i,b,c,j){var n=!!j;return f.createFileCommands(a,null,j?"all":void 0,n).then(function(a){d._addedOpenWithCommands=n;var f=!1,j=!1;a.forEach(function(a){d.addCommand(a);c&&!f&&(f=!0,d.addCommandGroup(i,"eclipse.fileCommandExtensions",
1E3,null,c));c&&!j&&(j=!0,d.addCommandGroup(i,"eclipse.openWith",1E3,"Open With",c+"/eclipse.fileCommandExtensions"));this.isEditor?d.registerCommandContribution(i,a.id,b+this.index,c?c+"/eclipse.fileCommandExtensions/eclipse.openWith":null):d.registerCommandContribution(i,a.id,b+this.index,c?c+"/eclipse.fileCommandExtensions":null)});return{}})};f.createFileCommands=function(a,d,i,b){var i=i===void 0?"global":i,b=b===void 0?!0:b,c=a.getServiceReferences("orion.navigate.command"),j=[];if(i==="all"||
i==="global")for(var n=0;n<c.length;n++)if(c[n].getProperty("id")!=="orion.navigateFromMetadata"){for(var e=a.getService(c[n]),w={},u=c[n].getPropertyKeys(),h=0;h<u.length;h++)w[u[h]]=c[n].getProperty(u[h]);(i==="all"||w.forceSingleItem&&w.showGlobally)&&j.push({properties:w,service:e})}return k.when(function(){var f=a.getService("orion.core.contenttypes")||d;return l||k.when(f.getContentTypes(),function(a){return l=a})}(),function(){j=b?j.concat(f._getOpenWithNavCommandExtensions(a,l)):j;var d=j.map(function(d){var i=
d.properties;return f._createCommandOptions(i,d.service,a,l,!0).then(function(a){a=new g.Command(a);if(i.isEditor)a.isEditor=i.isEditor;return a})});return k.all(d,function(a){return{_error:a}}).then(function(a){return a})})};f.createOpenWithCommands=function(a,d,i){return i&&i._addedOpenWithCommands?(new k).resolve(f.getOpenWithCommands(i)):f.createFileCommands(a,d,"none",!0)};return f});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(h,k){function g(e){this._init(e)}g.prototype={_init:function(e){var c=k.node(e.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents){e=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,c):e.href=h.toUrl("navigate/table.html")+"#"+c}else e=document.createElement("span");k.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(e){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(e));return c},addSegmentHref:function(e,c){this._makeHref?this._makeHref(e,c.Location,c):e.href=h.toUrl("navigate/table.html")+"#"+c.ChildrenLocation},buildSegments:function(e,c){if(this._resource.Parents){var b=this._resource.Parents.slice(0),a,j;b&&(b=b.slice(0),c==="reverse"&&(b=b.reverse().slice(0)),b.forEach(function(d){e?(j=e,e=null):j=d.Name;a=this.buildSegment(j);
this.path+=d.Name;this.addSegmentHref(a,d);a.include=!1;this.segments.push(a)}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},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(e){this.crumbs.appendChild(e)},addTitle:function(e,c){var b=c||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(b)),e.classList.add("breadcrumb"),e.classList.add("currentLocation"),
this.append(e))},finalSegment:function(e,c){e=document.createElement("span");c?e.appendChild(document.createTextNode(c)):e.appendChild(document.createTextNode(this._resource.Name));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)},firstSegment:function(e){if(e)this.append(e),this._resource&&this._resource.Parents?(e.classList.add("breadcrumb"),this.addDivider()):(e.href="",e.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){e.include===
!0&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=e.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;
if(c)this.addTitle(e,c);else if(this.finalSegment(e,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(e)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(e,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(e),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,
c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(h,k){function g(e){this._init(e)}g.prototype={_init:function(e){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(e.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(e.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(e.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=e.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(e.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=e.closeByDefault;this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display=
"block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(e){this._resizeListeners.push(e)},_initializeFromStoredSettings:function(){var e=localStorage.getItem(this._prefix+"/toggleState");this._closed=e?e==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(e=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(e,10);else{if(this._closeByDefault)this._splitTop=150}else if(e=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(e,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(e){var c=k.bounds(this.$node),b=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(e||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);e=this._splitTop;this.$node.parentNode.style.position==="relative"&&(e=this._splitTop-b.top);this.$sideNode.style.height=e+"px";this.$sideNode.style.bottom=e-1+"px";this.$sideNode.style.display="block";this.$node.style.top=e+"px"}else{this._splitWidth=c.width;if(e||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);e=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(e=this._splitLeft-b.left);this.$sideNode.style.width=
e+"px";this.$sideNode.style.right=e-1+"px";this.$sideNode.style.display="block";this.$node.style.left=e+"px"}this._resize()},_resize:function(e){var e=e||0,c=k.bounds(this.$node.parentNode),b=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=c.height-(b.top-c.top+b.height)+"px":this.$mainNode.style.width=c.width-(b.left-c.left+b.width)+"px";var a=this;window.setTimeout(function(){a._notifyResizeListeners(a.$mainNode)},e);window.setTimeout(function(){a._notifyResizeListeners(a.$sideNode)},
e)},_notifyResizeListeners:function(e){for(var c=0;c<this._resizeListeners.length;c++)this._resizeListeners[c](e)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=
0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},_removeAnimation:function(){var e=this;window.setTimeout(function(){e.$sideNode.classList.remove("sidePanelLayoutAnimation");e.$mainNode.classList.remove("mainPanelLayoutAnimation");e.$node.classList.remove("splitLayoutAnimation");e._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");
this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(e){if(e.target===this._thumb)return k.stop(e),this._thumbDown(e);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),
k.stop(e)},_mouseMove:function(e){if(this._tracking){var c=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=e.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-c.top);this.$node.style.top=b+"px"}else{this._splitLeft=e.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>c.left+c.width-
5)this._splitLeft=c.left+c.width-5;b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-c.left);this.$node.style.left=b+"px"}this._adjustToSplitPosition(!0);k.stop(e)}},_mouseUp:function(e){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),k.stop(e)}};g.prototype.constructor=g;return{Splitter:g}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(h){return{makeRelative:function(h){if(!h)return h;var g=window.location.protocol+"//"+window.location.host;return h.indexOf(g)===0?h.substring(g.length):h},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var g=new URL(h.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(g.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(h,k,g){function e(c){this._favorites=[];g.attach(this);this._init(c);this._initializeFavorites()}e.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(c){for(var c=Array.isArray(c)?
c:[c],b=0;b<c.length;b++){var a=c[b],j=a.ChildrenLocation?a.ChildrenLocation:a.Location,j=k.makeRelative(j);this.addFavorite(a.Name,j,a.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,!1,!0)},addFavorite:function(c,b,a){this._favorites.push({name:c,path:b,directory:a,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===
c){this._favorites.splice(b,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,b){var a=!1,j;for(j in this._favorites)if(this._favorites[j].path===c){var d=this._favorites[j];if(d.name!==b)d.name=b,a=!0}a&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===c)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var b;
if(!c)return this._favorites;var a="";for(b=0;b<c.length;b++){var j=c.charAt(b);a+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}a+=".*";c=RegExp(a);a=[];for(b in this._favorites)this._favorites[b].name.search(c)===0&&a.push(this._favorites[b]);return a},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var a,b=b.get("navigate");typeof b==="string"&&(b=JSON.parse(b));if(b)for(a in b)b[a].isFavorite=
!0,c._favorites.push(b[a]);c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("navigate",c)})},_sorter:function(c,b){var a=c.name.toLowerCase(),j=b.name.toLowerCase();return a>j?1:a<j?-1:0},getFavorites:function(){return{navigator:this._favorites}}};e.prototype.constructor=e;return{FavoritesService:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function h(h,g){this._preferences=h;this._themeData=g;var e=g.getThemeStorageInfo(),c=h.listenForChangedSettings(e.storage,2,function(b){b.key===c&&this.apply()}.bind(this))}h.prototype={_initialize:function(h,g,e){var c=e.get(h.styleset);c||(c=g.getStyles(),e.put(h.styleset,JSON.stringify(c)));(g=e.get("selected"))&&(g=JSON.parse(g));if(!g||g[h.selectedKey]===void 0)g=g||{},g[h.selectedKey]=h.defaultTheme,e.put("selected",JSON.stringify(g))},
apply:function(){this.setTheme()},getTheme:function(h){var g=this._themeData,e=g.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,g,c);var b=JSON.parse(c.get("selected")),c=JSON.parse(c.get(e.styleset)),a;if(c)for(var j=0;j<c.length;j++)if(c[j].name===b[e.selectedKey]){a=c[j];break}h({style:a,styles:c})}.bind(this))},setTheme:function(h,g){var e=this._themeData,c=e.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(b){this._initialize(c,
e,b);var a=JSON.parse(b.get("selected"));h||(h=a[c.selectedKey]);a[c.selectedKey]=h;b.put("selected",JSON.stringify(a));g?b.put(c.styleset,JSON.stringify(g)):g=JSON.parse(b.get(c.styleset));for(b=0;b<g.length;b++)if(g[b].name===a[c.selectedKey]){e.processSettings(g[b]);break}}.bind(this))},setFontSize:function(h){var g=this._themeData,e=g.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,g,c);var b=JSON.parse(c.get("selected")),a=JSON.parse(c.get(e.styleset)),
j;if(a)for(var d=0;d<a.length;d++)a[d].fontSize=h,a[d].name===b[e.selectedKey]&&(j=a[d]);c.put(e.styleset,JSON.stringify(a));g.processSettings(j)}.bind(this))}};return{ThemePreferences:h}});
define("orion/editor/eventTarget",[],function(){function h(){}h.addMixin=function(k){var g=h.prototype,e;for(e in g)g.hasOwnProperty(e)&&(k[e]=g[e])};h.prototype={addEventListener:function(h,g,e){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[h];c||(c=this._eventTypes[h]={level:0,listeners:[]});c.listeners.push({listener:g,useCapture:e})},dispatchEvent:function(h){var g=h.type;this._dispatchEvent("pre"+g,h);this._dispatchEvent(g,h);this._dispatchEvent("post"+g,h)},_dispatchEvent:function(h,
g){var e=this._eventTypes?this._eventTypes[h]:null;if(e){var c=e.listeners;try{if(e.level++,c)for(var b=0,a=c.length;b<a;b++)if(c[b]){var j=c[b].listener;typeof j==="function"?j.call(this,g):j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(g)}}finally{if(e.level--,e.compact&&e.level===0){for(b=c.length-1;b>=0;b--)c[b]||c.splice(b,1);c.length===0&&delete this._eventTypes[h];e.compact=!1}}}},isListening:function(h){return!this._eventTypes?!1:this._eventTypes[h]!==void 0},removeEventListener:function(h,
g,e){if(this._eventTypes){var c=this._eventTypes[h];if(c){for(var b=c.listeners,a=0,j=b.length;a<j;a++){var d=b[a];if(d&&d.listener===g&&d.useCapture===e){c.level!==0?(b[a]=null,c.compact=!0):b.splice(a,1);break}}b.length===0&&delete this._eventTypes[h]}}}};return{EventTarget:h}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(h,k,g){function e(b){b=b||{};this._document=b.document||document}var c={};e.getTheme=function(b){var b=b||"default",a=c[b];a||(a=c[b]=new e);return a};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,a){var c=this,d=c._themeClass;c._themeClass=b;this._load(b,a,function(){c.onThemeChanged({type:"ThemeChanged",oldValue:d,newValue:c.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,a){function c(a,i,j){i&&(d.push("."+b+" ."+a+" {"),d.push("\t"+(j?"background-color":"color")+": "+i+";"),d.push("}"))}var d=[];d.push("");d.push("."+b+" {");a.fontFamily&&d.push("\tfont-family: "+a.fontFamily+";");a.fontSize&&d.push("\tfont-size: "+a.fontSize+";");a.fontSize&&d.push("\tcolor: "+a.text+";");d.push("}");d.push("."+b+".textview {");a.background&&d.push("\tbackground-color: "+a.background+";");d.push("}");c("ruler.annotations",a.annotationRuler,!0);c("ruler.lines",
a.annotationRuler,!0);c("ruler.folding",a.annotationRuler,!0);c("ruler.overview",a.overviewRuler,!0);c("rulerLines",a.lineNumber,!1);c("rulerLines.even",a.lineNumberEven,!1);c("rulerLines.odd",a.lineNumberOdd,!1);c("annotationLine.currentLine",a.currentLine,!0);c("entity-name-tag",a.keyword,!1);c("entity-other-attribute-name",a.attribute,!1);c("string-quoted",a.string,!1);c("line_caret",a.currentLine,!0);c("token_keyword",a.keyword,!1);c("token_string",a.string,!1);c("token_singleline_comment",a.comment,
!1);c("token_multiline_comment",a.comment,!1);c("token_doc_comment",a.comment,!1);c("token_doc_html_markup",a.comment,!1);return d.join("\n")},_createStyle:function(b,a,c,d){var f=this._document,b="orion-theme-"+b,i=f.getElementById(b);if(i){if(d||i.firstChild.data===a)return;i.removeChild(i.firstChild);i.appendChild(f.createTextNode(a))}else d?(i=g.createElement(f,"link"),i.rel="stylesheet",i.type="text/css",i.href=a,i.addEventListener("load",function(){c()})):(i=g.createElement(f,"style"),i.appendChild(f.createTextNode(a))),
i.id=b,(f.getElementsByTagName("head")[0]||f.documentElement).appendChild(i);d||c()},_load:function(b,a,c){if(b)if(typeof a==="string")this._createStyle(b,a,c);else if(a=a.href,a.substring(a.length-4)!==".css"&&(a+=".css"),/^\//.test(a)||/[a-zA-Z0-9]+:\/\//i.test(a)||!h.toUrl)this._createStyle(b,a,c,!0);else{var d=this;h(["text!"+a],function(a){d._createStyle(b,a,c,!1)})}else c()}};k.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
define("orion/widgets/themes/ThemeClass",[],function(){function h(h){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=h;this.classString="."+h+"{ "}h.prototype.className=null;h.prototype.classString=void 0;h.prototype.style=void 0;h.prototype.closeString=" }\n";h.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:h}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(h){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 g="",e=[],c=new h.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";e.push(c);c=new h.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="15px";c.style.padding="10px";c.style.paddingRight="3px";e.push(c);c=new h.ThemeClass("a");c.style.textDecoration="none";c.style.color=this.content;e.push(c);c=new h.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;e.push(c);c=new h.ThemeClass("primaryNav");
c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";e.push(c);c=new h.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign="baseline";c.style.textDecoration="none";e.push(c);c=new h.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";e.push(c);for(var b in e)g+=
e[b].toString();return g};k.prototype.writeLocationStyle=function(){var g="",e=[],c=new h.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";e.push(c);c=new h.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration=
"none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";e.push(c);c=new h.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";e.push(c);c=new h.ThemeClass("breadcrumbSeparator");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2";c.style.fontWeight="bold";e.push(c);c=new h.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color="#f1f1f2";c.style.textDecoration=
"none";c.style.textWrap="normal";c.style.lineHeight="10pt";e.push(c);c=new h.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";e.push(c);c=new h.ThemeClass("navlinkonpage");c.style.color=this.content;e.push(c);c=new h.ThemeClass("progressPane_running");c.style.background="url(../images/progress_running_dark.gif) no-repeat center";c.style.width="16px";c.style.height="16px";e.push(c);
for(var b in e)g+=e[b].toString();return g};k.prototype.writeButtonStyle=function(){var g="",e=[],c=new h.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="baseline";c.style.cursor="pointer";c.style.display="inline-block";c.style.padding="5px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="8pt";c.style.userSelect="none";e.push(c);c=new h.ThemeClass("commandButton:over");
c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";e.push(c);c=new h.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";e.push(c);c=new h.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";e.push(c);
for(var b in e)g+=e[b].toString();return g};k.prototype.writeMainStyle=function(){var g="",e=[],c=new h.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height="12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding=
"0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(c);c=new h.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline="none";e.push(c);c=new h.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";e.push(c);c=new h.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=
this.content;e.push(c);c=new h.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";c.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";e.push(c);c=new h.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;e.push(c);c=new h.ThemeClass("mainToolbar");c.style.background=this.toolpanel;
c.style.height="34px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="2px";e.push(c);for(var b in e)g+=e[b].toString();return g};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=
g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(h,k){function g(){}function e(){this.styles=[];var b=new g;b.name="Orion";b.navbar="#333";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";this.styles.push(b);b=new g;b.name="Green Zone";b.navbar=
"seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";this.styles.push(b);b=new g;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";
b.breadcrumb="#3087B3";b.separator="plum";this.styles.push(b);b=new g;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";this.styles.push(b);b=new g;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";this.styles.push(b);b=new g;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";this.styles.push(b);
b=new g;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";this.styles.push(b)}function c(){return this.styles}g.prototype.name="Orion";g.prototype.navbar="#333";g.prototype.button="#EFEFEF";g.prototype.location="#333";g.prototype.breadcrumb="#3087B3";g.prototype.separator="#333";g.prototype.selection=
"FEC";g.prototype.sidepanel="#FBFBFB";g.prototype.mainpanel="white";g.prototype.toolpanel="white";g.prototype.navtext="#bfbfbf";g.prototype.content="#3087B3";g.prototype.search="#444";e.prototype.styles=[];e.prototype.getStyles=c;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};e.prototype.getViewData=function(){for(var b={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+a*20,x2:165,y2:124+a*20,x3:160,y3:127+a*20,family:"navbar",fill:"#333"});
b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};e.prototype.processSettings=function(b){var a=new k.ThemeSheetWriter;(new h.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:e,getStyles:c}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Populating favorites...":"Populating favorites...",Favorite:"Favorite","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'."});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(h,k,g,e){function c(b){this._displaySignOut=!0;this._init(b)}c.prototype={_init:function(b){this._dropdownNode=g.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=b.noSeparator;this._dropDownItemClass=
b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.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(b){var a=0,c;for(c in b)b.hasOwnProperty(c)&&a++;return a},_makeMenuItem:function(b,a){var c=document.createElement("span");c.role="menuitem";
c.tabIndex=0;var d=document.createTextNode(b);c.appendChild(d);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");c.addEventListener("click",a,!1);c.addEventListener("keydown",function(d){(d.keyCode===g.KEY.ENTER||d.keyCode===g.KEY.SPACE)&&a()},!1);return c},_renderAuthenticatedService:function(b){var a=this,c=this.authenticatedServices[b].authService;if(c&&c.logout&&this._displaySignOut){var d=document.createElement("li"),
f=this._makeMenuItem(h["Sign Out"],function(){c.logout().then(function(){a.addUserItem(b,c,a.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var d=localStorage.length-1;d>=0;d--){var f=localStorage.key(d);f&&f.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(f)}c.getAuthForm(window.location.href).then(function(a){window.location=a})})});d.appendChild(f);this._dropdownNode.appendChild(d)}},renderServices:function(){function b(d){c[d]||
(c[d]=a.createDocumentFragment());return c[d]}var a=document,c=[];e.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(d){this._dropdown?this._dropdown.empty():this._dropdownNode&&g.empty(this._dropdownNode);d.forEach(function(d){var f=b(typeof d.category==="number"?d.category:1),i=a.createElement("li"),c=a.createElement("a");c.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");
c.href=d.href;c.textContent=d.textContent;i.appendChild(c);f.appendChild(i)}.bind(this));if(this.keyAssistFunction){var d=document.createElement("li"),f=this._makeMenuItem(h["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem");d.appendChild(f);b(0).appendChild(d)}var i=this;c.sort(function(a,d){return a-d}).forEach(function(a,d){if(d<c.length-1&&!this._noSeparator){var f=
document.createElement("li");f.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");f.appendChild(b);a.appendChild(f)}i._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var e in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(e)&&this._renderAuthenticatedService(e,0)}.bind(this))},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,a,c,d){d?(this.unauthenticatedServices[b]&&
delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:a,label:c,data:d}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:a,label:c,pending:this.unauthenticatedServices[b].pending}:{authService:a,label:c});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(h,k,g,e,c,b){function a(a,f,i){var b="";i&&(b="^");if(b=g.parse("/"+b+a.searchStr+"/"))i=b.pattern,b=b.flags,b.indexOf("i")===-1&&!f.caseSensitive&&(b+="i"),a.regExp={pattern:i,flags:b},a.wildCard=!0}var j={ALL_FILE_TYPE:"*.*"};j.doSearch=function(a,f,i,b){if(a){var c=!0;i==="*"&&(i="");i===""&&(c=b&&b.type!==j.ALL_FILE_TYPE);if(c){i!==""&&j.addRecentSearch(f,
i,b?b.regEx:!1);var a=a.createSearchParams(i,!1,!1,b),e=j.generateSearchHref(a);j.getOpenSearchPref(f,function(a){a?window.open(e):window.location=e})}}else window.alert(h["Can't search: no search service is available"])};j.generateSearchHelper=function(d,f){var i=d.keyword,b=i,c={};d.fileType&&d.fileType!==j.ALL_FILE_TYPE&&i===""&&(b="*."+d.fileType);if(d.regEx)c.searchStr=i,a(c,d,f);else{var e=i.indexOf("*")>-1,g=i.indexOf("?")>-1;e&&(i=i.split("*").join(".*"));g&&(i=i.split("?").join("."));!e&&
!g&&!d.nameSearch?(c.searchStr=d.caseSensitive?i.split("\\").join(""):i.split("\\").join("").toLowerCase(),c.wildCard=!1):(c.searchStr=d.caseSensitive?i:i.toLowerCase(),a(c,d,f),c.wildCard=!0)}c.searchStrLength=c.searchStr.length;return{params:d,inFileQuery:c,displayedSearchTerm:b}};j.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"};j.copySearchParams=function(a,f){var i={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(f||b!=="replace"))i[b]=a[b];return i};j.generateSearchHref=function(a){var f=k.toUrl("search/search.html"),a=j.copySearchParams(a,!0),i=a.resource;a.resource=void 0;return(new b(f+"#{,resource,params*}")).expand({resource:i,params:a})};j.generateFindURLBinding=function(a,
f,i,c){a={find:f.searchStr,regEx:f.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof c==="string"?c:void 0,atLine:typeof i==="number"?i:void 0};return","+(new b("{,params*}")).expand({params:a})};j.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)};j.replaceRegEx=function(a,
f,b){return a.replace(RegExp(f.pattern,f.flags),b)};j.replaceStringLiteral=function(a,f,b){f=g.parse("/"+f+"/gim");return j.replaceRegEx(a,f,b)};j.searchOnelineLiteral=function(a,f,b){var c;c=0;for(var j=!1,e=[];;)if(c=f.indexOf(a.searchStr,c),c<0)break;else{e.push({startIndex:c,length:a.searchStrLength});j=!0;if(b)break;c+=a.searchStrLength}return j?e:null};j.findRegExp=function(a,f,b,c){if(!f)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var j=null;return(j=RegExp(f,
b).exec(a.substring(c)))&&{startIndex:j.index+c,length:j[0].length}};j.searchOnelineRegEx=function(a,f,b){for(var c=0,e=!1,g=[];;)if(c=j.findRegExp(f,a.regExp.pattern,a.regExp.flags,c)){g.push(c);e=!0;if(b)break;c=c.startIndex+c.length}else break;return e?g:null};j.generateNewContents=function(a,f,b,c,e,g){if(c&&f){if(!a)b.contents=[];for(var h=0;h<f.length;h++){for(var k=f[h],p=!1,q=!1,t=[],n,v=0,w=0;w<c.children.length;w++)if(c.children[w].lineNumber-1===h){v=w;for(p=0;p<c.children[w].matches.length;p++)c.children[w+
p].checked!==!1&&t.push(p);q=t.length>0;n=c.children[w].matches;p=!0;break}if(p){if(q){t=j.replaceCheckedMatches(k,e,n,t,g);k=t.replacedStr;for(p=0;p<c.children[v].matches.length;p++)c.children[v+p].newMatches=t.newMatches}else for(p=0;p<c.children[v].matches.length;p++)c.children[v+p].newMatches=c.children[v+p].matches;a?b.contents[h]=k:b.contents.push(k)}else a||b.contents.push(k)}}};j.generateMatchContext=function(a,f,b){var c=[],j=a*2+1,e;f.length<=j?(e=0,a=f.length-1):(e=b-a,e<0?(e=0,a=e+j-1):
(a=b+a,a>f.length-1&&(a=f.length-1,e=a-j+1)));for(j=e;j<=a;j++)c.push({context:f[j],current:j===b});return c};j.splitFile=function(a){for(var f=0,b=0,c=0,j=0,e=[];;){f!==-1&&f<=c&&(f=a.indexOf("\r",c));b!==-1&&b<=c&&(b=a.indexOf("\n",c));if(b===-1&&f===-1){e.push(a.substring(j));break}var g=1;f!==-1&&b!==-1?f+1===b?(g=2,c=b+1):c=(f<b?f:b)+1:c=f!==-1?f+1:b+1;e.push(a.substring(j,c-g));j=c}return e};j.searchWithinFile=function(a,f,b,c,e,g){b=j.splitFile(b);if(e)f.contents=b;if(f){f.children=[];for(var h=
c=0;h<b.length;h++){var k=b[h];if(k&&k.length>0){var p=g?k:k.toLowerCase();if(p=a.wildCard?j.searchOnelineRegEx(a,p):j.searchOnelineLiteral(a,p)){var q,t=h+1;if(e)for(var n=0;n<p.length;n++)q=n+1,q={parent:f,checked:f.checked,type:"detail",matches:p,lineNumber:t,matchNumber:q,name:k,location:f.location+"-"+t+"-"+q},f.children.push(q);else q={parent:f,context:j.generateMatchContext(2,b,h),checked:f.checked,type:"detail",matches:p,lineNumber:t,name:k,location:f.location+"-"+t},f.children.push(q);c+=
p.length}}}f.totalMatches=c}};j.replaceCheckedMatches=function(a,f,b,c,j){for(var e=0,g="",h=[],k=0;k<b.length;k++){e!==b[k].startIndex&&(g+=a.substring(e,b[k].startIndex));if(b[k].length)j=b[k].length;for(var e=!1,q=0;q<c.length;q++)if(c[q]===k){e=!0;break}e?(h.push({startIndex:g.length,length:f.length}),g+=f):(h.push({startIndex:g.length,length:j}),g+=a.substring(b[k].startIndex,b[k].startIndex+j));e=b[k].startIndex+j}e<a.length&&(g+=a.substring(e));return{replacedStr:g,newMatches:h}};j.fullPathNameByMeta=
function(a){var f=a.length,b="";if(f>0)for(f-=1;f>-1;f--)b=b+(b===""?"":"/")+a[f].Name;return b};j.path2FolderName=function(a,f,b){return a.substring(0,a.length-f.length-(b?0:1))};j._storeRecentSearch=function(a,f,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",f);b&&window.setTimeout(function(){b.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};j.addRecentSearch=function(a,f,b){typeof f==="string"&&f&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,
c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c){for(e in c)if(c[e].name===f)return;c.length>=20&&c.splice(19,c.length-20+1)}else c=[];c.splice(0,0,{name:f,regEx:b});j._storeRecentSearch(a,c)})};j.removeRecentSearch=function(a,f,b){typeof f==="string"&&f&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c)for(e in c)if(c[e].name===f){c.splice(e,1);j._storeRecentSearch(a,
c,b);break}})};j.getSearches=function(a,f,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(f);typeof a==="string"&&(a=JSON.parse(a));a&&b&&b(a)})};j.getMixedSearches=function(a,f,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var d=a.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));f&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(b){var f=j.parseQueryStr(a.query);
d.some(function(a){return f.searchStrTitle===a.name})||d.push({name:f.searchStrTitle,label:a.name})}else d.push({name:null,label:a.name,value:a.query})}));d&&c&&c(d)})};j.getOpenSearchPref=function(a,f){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");f(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};j.setOpenSearchPref=function(a,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:f})})};return j});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(h,k,g,e,c,b){function a(a,d,f,b){this.registry=a;this.fileClient=d;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=f;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(f);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.childrenLocation:this._location}a.prototype.search=function(a){var d=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;d.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,d){if(a)this.searchHelper=e.generateSearchHelper(a,!0);if(d)this.onSearchNameComplete=d;var f=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var b=0;b<this.fileSkeleton.length;b++){var c=this.fileSkeleton[b].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(f.push(this.fileSkeleton[b]),
f.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:f.length,docs:f}})}};a.prototype.buildSkeleton=function(a,d){this._buildingSkeleton=!0;var f=this.registry.getService("orion.core.contenttypes"),b=this;a();f.getContentTypes().then(function(a){b.contentTypesCache=a;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;d();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};a.prototype._searchCompleted=function(){console.log("Search Completed.")};
a.prototype._searchFiles=function(){var a=[],d;if(this.fileLocations.length>0){d=this;for(var f=0;f<d.fileLocations.length;f++)a.push(d._sniffSearch(d.fileLocations[f]))}return b.all(a)};a.prototype._sort=function(a){a.sort(function(a,f){var b=a.Name&&a.Name.toLowerCase(),c=f.Name&&f.Name.toLowerCase();return b<c?-1:b>c?1:0})};a.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};a.prototype._visitRecursively=function(a){var d=[],f=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var i=f.registry.getService("orion.page.progress");return(i?i.progress(f.fileClient.fetchChildren(a),"Crawling search for children of "+a):f.fileClient.fetchChildren(a)).then(function(a){for(var i=0;i<a.length;i++)if(a[i].Directory!==void 0&&a[i].Directory===!1)if(f._searchOnName)d.push(f._buildSingleSkeleton(a[i]));else if(f._buildSkeletonOnly)d.push(f._buildSingleSkeleton(a[i]));
else{var j=c.getFilenameContentType(a[i].Name,f.contentTypesCache);j&&(j["extends"]==="text/plain"||j.id==="text/plain")&&f._onFileType(j)&&d.push(f._sniffSearch(a[i]))}else a[i].Location&&d.push(f._visitRecursively(a[i].ChildrenLocation));return b.all(d)})};a.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):e.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._sniffSearch=function(a){this._totalCounter++;var d=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:g.formatMessage(h["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(d.fileClient.read(a.Location),"Reading file "+a.Location).then(function(f){d._hitOnceWithinFile(f)&&d._reportSingleHit(a);d.registry.getService("orion.page.message").setProgressResult({Message:g.formatMessage(h["${0} files found out of ${1}"],d._hitCounter,d._totalCounter)})},function(a){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 b;a.resolve(this._totalCounter);return a};a.prototype.constructor=a;return{SearchCrawler:a}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(h,k,g,e){function c(){}c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var 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&&g.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=g.$("#closeDialog",this.$frame);var c=this;this.$close.addEventListener("click",function(){c.hide()},!1);this.$parent=g.$(".dialogContent",this.$frame);a=document.createRange();a.selectNode(this.$parent);
b=a.createContextualFragment(this.TEMPLATE);this.messages&&g.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=g.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE?c.hide():a.keyCode===g.KEY.ENTER&&typeof c._defaultCallback==="function"&&c._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(a){var c=e.createButton(a.text,a.callback);if(a.id)c.id=a.id,b["$"+c.id]=c;if(a.isDefault)b._defaultCallback=a.callback,b._defaultButton=c;b.$buttonContainer.appendChild(c)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!g.contains(b.$frame,a.target);if(d)for(var f=0;f<
b.$$modalExclusions.length;f++)if(g.contains(b.$$modalExclusions[f],a.target)){d=!1;break}d&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),g.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var a=this.$frameParent.childNodes,c=!1;this._addedBackdrop=[];for(var d=0;d<a.length;d++){for(var f=0;f<this.$$modalExclusions.length;f++)if(g.contains(this.$$modalExclusions[f],a[d])){c=
!0;break}!c&&a[d]!==b.$frame&&a[d].classList&&!a[d].classList.contains("tooltipContainer")&&(f=a[d],f.classList.contains("modalBackdrop")||(f.classList.add("modalBackdrop"),this._addedBackdrop.push(f)))}(a=g.lastTabbable(this.$buttonContainer)||g.lastTabbable(this.$parent))&&a.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.TAB){var d=b._getFirstFocusField();d&&d!==a.target&&d.focus();g.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_bindElements:function(b){for(var a=
0;a<b.childNodes.length;a++){var c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},
0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var a=g.bounds(this.$frame),c=g.bounds(document.documentElement),d;b?(d=g.bounds(b),b=d.top+d.height+4,d=d.left+4,b+a.height>c.height&&(b=Math.max(0,c.height-a.height-4)),d+a.width>c.width&&(d=Math.max(0,c.width-a.width-4))):(d=Math.max(0,(c.width-a.width)/2),b=Math.max(0,(c.height-a.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=d+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return g.firstTabbable(this.$parent)||this._defaultButton||g.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}};c.prototype.constructor=c;return{Dialog:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(h,k,g,e,c,b,a){function j(a){this._init(a)}j.prototype=new a.Dialog;j.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="'+e.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';j.prototype._init=function(a){this.title=a.title||h["Find File Named"];this.modal=!0;this.messages=h;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new g.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(h["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(h["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(h["Missing required argument: favService"]);this._initialize()};j.prototype._bindToDom=function(a){var f=this;f.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",h.Search);this.$fileName.addEventListener("input",function(){f._time=+new Date;f._timeoutId&&clearTimeout(f._timeoutId);
f._timeoutId=setTimeout(f.checkSearch.bind(f),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var d=c.$("a",f.$results);d&&(c.stop(a),window.open(d.href),f.hide())}},!1);a.addEventListener("keydown",function(a){var d,b,j,e,g;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)b=c.$$array("a",f.$results),d=c.$$array("a",f.$favresults),j=document.activeElement,g=b.indexOf(j),e=d.indexOf(j),a.keyCode===c.KEY.DOWN?e>=0?(e<d.length-1?d[e+1]:b.length>0?b[0]:d[0]).focus():
g>=0?(g<b.length-1?b[g+1]:d.length>0?d[0]:b[0]).focus():(b.length>0||d.length>0)&&(-1<d.length-1?d[0]:b[0]).focus():e>=0?(j=f.$fileName,(e>0?d[e-1]:j).focus()):g>=0?(j=f.$fileName,(g>0?b[g-1]:d.length>0?d[d.length-1]:j).focus()):b.length>0?b[b.length-1].focus():d.length>0&&d[d.length-1].focus(),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(f._forceUseCrawler||!f._fileService.getService(f._searcher.getSearchLocation()).search){var a=
f._searchOnRoot?f._searcher.getSearchRootLocation():f._searcher.getChildrenLocation(),a=new k.SearchCrawler(f._searcher.registry,f._fileService,"",{searchOnName:!0,location:a});f._searcher.setCrawler(a);a.buildSkeleton(function(){f.$crawlingProgress.style.display="inline";f.$progress.appendChild(document.createTextNode(h["Building file skeleton..."]))},function(){f.$crawlingProgress.style.display="none";f.$progress.removeChild(f.$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()};j.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(h["Populating favorites&#x2026;"]));c.empty(this.$favresults);this.$favresults.appendChild(a);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());
this._favService.addEventListener("favoritesChanged",this.showFavorites())};j.prototype.showFavorites=function(){var a=this;return function(f){if(f.navigator)f=f.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(f);if(f&&f.length>0)f=document.createElement("div"),f.style.borderBottom="1px dashed #BBBBBB",f.style.padding="5px",a.$favresults.appendChild(f)}};j.prototype.showFavoritesImage=function(a){var f=new Image;
f.classList.add("modelDecorationSprite");f.classList.add("core-sprite-favorite");f.src=e.toUrl("images/none.png");f.title=h.Favorite;a.appendChild(f);f.style.verticalAlign="middle"};j.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)};j.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var f=this._searcher.createSearchParams(a,
this._nameSearch,this._searchOnRoot),i=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=i;var j=document.createElement("div");j.appendChild(document.createTextNode(this._nameSearch?h["Searching..."]:b.formatMessage(h["Searching for occurrences of"],a)));c.empty(this.$results);this.$results.appendChild(j);this._searcher.search(f,!1,function(){i===this.currentSearch&&i.apply(null,arguments)}.bind(this))}};j.prototype.decorateResult=
function(a){for(var f=this,a=c.$$array("a",a),b=0;b<a.length;b++){var j=a[b];j.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&f.hide()},!1);j.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&f.hide()},!1)}};j.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};j.prototype._afterHiding=function(){this._onHide&&this._onHide()};j.prototype.constructor=j;return{OpenResourceDialog:j}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<div class="centralNavigation" id="centralNavigation" tabindex="0" role="button" style="margin-top:0;"></div>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=3.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility:hidden;">\n</div>\n<div class="layoutRight" style="padding-left:7px;margin-left:4px;margin-top:6px;" id="settingsTab" style="visibility:hidden;">\n\t<button class="layoutRight core-sprite-wrench imageSprite" id="settingsAction" aria-live="off" style="visibility:hidden;"></button>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/objects",[],function(){return{mixin:function(h){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var g=Object.keys(k),e=0;e<g.length;e++){var c=g[e];h[c]=k[c]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(h,k){function g(e,c,b){this.CLEAR_PANEL=b!==null?b:!0;this.OPEN="false";b="";e.nodeType?this.node=e:(b=e+"_",e=document.getElementById(e),this.node=e.nodeType?e:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=b+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=b+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=b+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(c.icon)this.node.className=this.node.className+" "+c.icon,this.node.onclick=this.click.bind(this);else{if(c.label)e=document.getElementById(this.navLabelId),e.textContent=c.label,e.onclick=this.click.bind(this);if(c.caret)document.getElementById(this.arrowId).className=c.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}h.mixin(g.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var e=document.getElementById(this.navDropDownId);e.style.display==="none"?this.updateContent(this.getContentNode(),function(){e.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,e],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(e){document.getElementById(this.navDropDownId).innerHTML=e},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(e,c){c()},toggleLabel:function(e){document.getElementById(this.navLabelId).style.display=e?"":"none";document.getElementById(this.arrowId).style.display=e?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var e=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||
!e.parentNode.style?e:this._boundingNode(e.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return g});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(h){function k(){}h.mixin(k.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">Main Pages</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">Related Links</span><nav><ul id="relatedLinks"></ul></nav></section></div>',getContentPane:function(){return this.templateString}});
return k});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder","Choose a Folder":"Choose a Folder",
"Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
"Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to",
"Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location","Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer",
"Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content",Favorites:"Favorites","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:",
"Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});
define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(h,k,g){function e(a,b,d){if(!a[b])throw b+h[" is not supported in this file system"];return a[b].apply(a,d)}function c(a,b,d,f){if(!a.readBlob)throw h["source file service does not support binary read"];if(!d.writeBlob)throw h["target file service does not support binary write"];if(b[b.length-1]!=="/")return e(a,"readBlob",[b]).then(function(a){return e(d,"writeBlob",[f,a])});var i=f.substring(0,
f.length-1),l=decodeURIComponent(i.substring(i.lastIndexOf("/")+1)),i=i.substring(0,i.lastIndexOf("/")+1);return e(d,"createFolder",[i,l]).then(function(){},function(){}).then(function(){return e(a,"fetchChildren",[b]).then(function(b){for(var i=[],j=0;j<b.length;++j){var e=b[j].Location,l=e;b[j].Directory&&(l=e.substring(0,e.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=f+encodeURIComponent(l);b[j].Directory&&(l+="/");i[j]=c(a,e,d,l)}return k.all(i)})})}function b(a,b){function d(a){var d=
new k;d.reject(h["No Matching FileService for location:"]+a);return d}var f=a.getServiceReferences("orion.core.file"),c=f;if(b)for(var c=[],e=0;e<f.length;++e)b(f[e])&&c.push(f[e]);for(var o=[],m=[],s=[],r=[],p={fetchChildren:function(){var a=new k;a.resolve(r);return a},createWorkspace:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:h["File Servers"],Location:"/",Children:r,ChildrenLocation:"/"})},100);return a},search:d,createProject:d,createFolder:d,createFile:d,deleteFile:d,moveFile:d,copyFile:d,read:d,write:d},f=0;f<c.length;++f)r[f]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[f].getProperty("top"),ChildrenLocation:c[f].getProperty("top"),Name:c[f].getProperty("Name")},e=c[f].getProperty("pattern")||".*",e[0]!=="^"&&(e="^"+e),o[f]=RegExp(e),m[f]=a.getService(c[f]),s[f]=c[f].getProperty("Name"),
c[f].getProperty("NameKey")&&c[f].getProperty("nls")&&g.getMessageBundle(c[f].getProperty("nls")).then(function(a,d){r[a].Name=d[c[a].getProperty("NameKey")];s[a]=d[c[a].getProperty("NameKey")]}.bind(this,f));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return m[0]?0:-1;for(var d=0;d<o.length;++d)if(o[d].test(a))return d;throw h["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?p:m[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?p.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?p.Location:r[a].Location}}b.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 e(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return e(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return e(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,b,d,f){return e(this._getService(a),"createProject",arguments)},createFolder:function(a,b){return e(this._getService(a),"createFolder",arguments)},createFile:function(a,b){return e(this._getService(a),"createFile",arguments)},deleteFile:function(a){return e(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,b,d){var f=this._getService(a),i=this._getService(b);if(f===i)return e(f,"moveFile",arguments);var l=a[a.length-1]==="/",o=b;o[o.length-1]!=="/"&&(o+="/");if(d)o+=encodeURIComponent(d);else{var g=a;l&&(g=g.substring(0,g.length-1));o+=g.substring(g.lastIndexOf("/")+1)}l&&o[o.length-1]!=="/"&&(o+="/");return c(f,a,i,o).then(function(){return e(f,"deleteFile",[a])})},copyFile:function(a,b,d){var f=this._getService(a),i=this._getService(b);if(f===i)return e(f,"copyFile",arguments);
var l=a[a.length-1]==="/",g=b;g[g.length-1]!=="/"&&(g+="/");if(d)g+=encodeURIComponent(d);else{var h=a;l&&(h=h.substring(0,h.length-1));g+=h.substring(h.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return c(f,a,i,g)},read:function(a,b){return e(this._getService(a),"read",arguments)},write:function(a,b,d){return e(this._getService(a),"write",arguments)},remoteImport:function(a,b){return e(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,b){return e(this._getService(a),
"remoteExport",arguments)},search:function(a){return e(this._getService(a.resource),"search",arguments)}};b.prototype.constructor=b;return{FileClient:b}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(h,
k,g,e,c,b,a,j,d,f,i,l,o,m,s,r,p,q,t,n,v,w,u,y,E,z,B,A,F,G,I,K,O){function R(a,d){if(a.getLabel)return a.getLabel();else{var f=new w;f.resolve(d.properties.name);return f}}function T(a){l.node("progressPane").setAttribute("aria-label",h["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function U(a,d){var f=a.getServiceReferences("orion.core.auth");P=[];for(var b=J.createMenuGenerator.apply(this,arguments),c=0;c<f.length;c++){var i=
f[c],n=a.getService(i);R(n,i).then(function(a){n.getKey().then(function(d){P.push(d);n.getUser().then(function(f){b.addUserItem(d,n,a,f)},function(f,c){b.addUserItem(d,n,a,c)});window.addEventListener("storage",function(){M[d]!==localStorage.getItem(d)&&(M[d]=localStorage.getItem(d),n.getUser().then(function(f){b.addUserItem(d,n,a,f)},function(){b.addUserItem(d,n,a)}))},!1)})})}}function x(a,d,f,c,i){var n=arguments,e,u=a&&a.getServiceReferences("orion.page.link.related");u&&u.length!==0&&w.when(function(){if(e)return e;
var d=a.getService("orion.core.contenttypes");d||(d=new p.ContentTypeService(a),d=a.getService("orion.core.contenttypes"));return d.getContentTypes().then(function(a){return e=a})}(),function(){var l;if(J.beforeGenerateRelatedLinks.apply(this,n)){for(var v=[],g=0;g<u.length;g++){var o={},h,m=u[g].getPropertyKeys();for(h=0;h<m.length;h++)o[m[h]]=u[g].getProperty(m[h]);if(o.id){var y=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(d)){var f=new b.CommandInvocation(d,d,null,a,c);J.addRelatedLinkCommand(a,
f)}else typeof i==="function"&&(l||(l=i()),w.when(l,function(f){f&&d===N&&(!a.visibleWhen||a.visibleWhen(f))&&J.addRelatedLinkCommand(a,new b.CommandInvocation(f,f,null,a,c))}))},z=null;h=null;if(f.indexOf(o.id)<0)if((o.nls&&o.nameKey||o.name)&&o.uriTemplate)h=j._createCommandOptions(o,u[g],a,e,!0),v.push(h),h.then(function(a){a=new b.Command(a);y(a)});else{if(!z&&(z=c.findCommand(o.id))){y(z);continue}if(!z){var k=a.getServiceReferences("orion.navigate.command");for(h=0;h<k.length;h++)if(k[h].getProperty("id")===
o.id){for(var o={},m=k[h].getPropertyKeys(),s=0;s<m.length;s++)o[m[s]]=k[h].getProperty(m[s]);h=j._createCommandOptions(o,k[h],a,e,!0);v.push(h);h.then(function(a){z=new b.Command(a);y(z)});break}}}}}w.all(v,function(a){return a}).then(function(){J.afterGenerateRelatedLinks.apply(this,n)})}})}function C(a){var d=l.node("globalActions");d&&(a.destroy(d),a.renderCommands(d.id,d,{},{},"tool"))}function D(a){var d={},f=null;typeof a==="string"&&(a=l.node(a));a||(a=l.node("pageActions"));for(var b=a;b&&
b.classList;){if(b.classList.contains("toolComposite")){f=b;break}b=b.parentNode}if(a.classList.contains("commandMarker"))d.commandNode=a;if(f&&(d.slideContainer=l.$(".slideParameters",f),d.parameterArea=l.$(".parameters",f),d.dismissArea=l.$(".parametersDismiss",f),d.notifications=l.$("#notificationArea",f),f.parentNode&&(d.toolbarTarget=l.$(".toolbarTarget",f.parentNode),d.toolbarTarget)))a=l.bounds(f),d.toolbarTargetY=a.height+1;return d}function H(a){if(a.toolbarTarget&&a.toolbarTargetY){var d=
0,f;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(f=l.bounds(a.notifications),d+=f.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(f=l.bounds(a.slideContainer),d+=f.height);d>0&&(d+=8);a.toolbarTarget.style.top=a.toolbarTargetY+d+"px";a.toolbarTarget.style.bottom=0}}var c=function(a){var d=document.createElement("a");d.href=a;return d.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},J={createMenuGenerator:K.createMenuGenerator||
function(a,d){if(l.node("userMenu")){var f=l.node("userDropdown"),b=new m.Dropdown({dropdown:f}),f=new u.UserMenu({dropdownNode:f,dropdown:b,serviceRegistry:a}),b=l.node("userTrigger");new s.Tooltip({node:b,text:h.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),c=b.className;c+=" imageSprite core-sprite-silhouette";b.className=c;f.setKeyAssist(d);return f}},beforeGenerateRelatedLinks:K.beforeGenerateRelatedLinks||function(){var a=l.node("relatedLinks");l.empty(a);
return!0},addRelatedLinkCommand:K.addRelatedLinkCommand||function(a,d){var f=l.node("relatedLinks");b.createCommandMenuItem(f,a,d).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:K.afterGenerateRelatedLinks||function(){},afterSetPageTarget:K.afterSetPageTarget||function(){},generateNavigationMenu:K.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new s.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new F("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),d=new G;a.addContent(d.getContentPane())},afterGenerateBanner:K.afterGenerateBanner||function(){}},P=[],N,S=[],L,Q=null;return{addSettings:function(a){(new F("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(f,c,i,j,u,w,m){function s(){this.create();this._filterString=""}function F(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",d=l.$$array(".targetSelector"),f=0;f<d.length;f++)d[f].target=a}},{pid:"nav.config"})}(new n.ThemePreferences(j,new v.ThemeData)).apply();var p=l.node(f);if(!p)throw h["could not find banner parent, id was "]+f;var q=document.createRange();q.selectNode(p);q=q.createContextualFragment(z);l.processTextNodes(q,h);p.firstChild?p.insertBefore(q,p.firstChild):p.appendChild(q);p=l.node("home");p.href=k.toUrl("navigate/table.html");p.setAttribute("aria-label",
h["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(p=l.node("pageToolbar"))p.classList.add("toolbarLayout"),p.innerHTML=A+g.slideoutHTMLFragment("mainToolbar");(p=l.node("closeNotifications"))&&p.setAttribute("aria-label",h["Close notification"]);if(p=l.node("footer"))p.innerHTML=B,l.processTextNodes(p,h);i.setParameterCollector(new a.CommandParameterCollector(D,H));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);J.generateNavigationMenu.apply(this,arguments);var G=l.node("navigationlinks");G&&y.createPageLinks(c,"orion.page.link").then(function(a){a.forEach(function(a){var d=document.createElement("li");d.appendChild(a);G.appendChild(d)})});if(p=l.$(".split")){var q=l.$(".sidePanelLayout"),K=l.$(".mainPanelLayout");if(q&&K)Q={side:q,main:K},Q.splitter=new o.Splitter({node:p,sidePanel:q,mainPanel:K,toggle:!0,closeByDefault:p.style&&p.style.left==="0%"}),p=new b.Command({name:h["Toggle side panel"],
tooltip:h["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Q.splitter.toggleSidePanel()}}),i.addCommand(p),i.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new e.KeyBinding("o",!0)),m&&Q.splitter.addResizeListener(function(a){m&&a===K&&(a=m.getTextView())&&a.resize()})}p=new b.Command({name:h["Make Favorite"],tooltip:h["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?
a:[a];if(a.length===0)return!1;for(var d=0;d<a.length;d++)if(!a[d].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],d=c.getService("orion.core.favorite"),f=c.getService("orion.page.progress"),b=function(a){return function(b){b?c.getService("orion.page.message").setMessage(a.Name+h[" is already a favorite."],2E3):f.progress(d.makeFavorites(a),"Making favorite "+a.Name)}},i=0;i<a.length;i++){var n=a[i];f.progress(d.hasFavorite(n.ChildrenLocation||n.Location),
"Checking favorite "+n.Name).then(b(n))}}});i.addCommand(p);var t=!1,R=function(a,d,f){if(!t){var b=d.getService("orion.core.favorite"),c=d.getService("orion.page.progress");b||(b=new r.FavoritesService({serviceRegistry:d}),b=d.getService("orion.core.favorite"));var i=new E.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,favoriteService:b,onHide:function(){t=!1;f&&f.getTextView()&&f.getTextView().focus()}});window.setTimeout(function(){t=!0;i.show()},0)}},p=new b.Command({name:h["Find File Named..."],
tooltip:h["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){R(u,c,m)}});i.addCommand(p);i.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));p=new b.Command({name:h["Toggle banner and footer"],tooltip:h["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=l.node("banner"),d=l.node("footer"),f=l.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",d.style.visibility="visible",f.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",d.style.visibility="hidden",f.classList.add("content-fixedHeight-maximized"));m&&m.getTextView()&&m.getTextView().resize();return!0}});i.addCommand(p);i.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));p=new b.Command({name:h["System Configuration Details"],tooltip:h["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
i.addCommand(p);i.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new e.KeyBinding(112,!0,!0));p=new b.Command({name:h["Background Operations"],tooltip:h["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});i.addCommand(p);i.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));s.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");d.classList.add("keyAssistInput");d.type="text";d.placeholder=h["Filter bindings"];a.appendChild(d);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(I.isIOS||I.isAndroid)f.style.overflowY="auto";a.appendChild(f);var b=this._keyAssistTable=document.createElement("table");
b.tabIndex=0;b.classList.add("keyAssistList");f.appendChild(b);document.body.appendChild(a);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(){this.filterChanged()}.bind(this));f.addEventListener(I.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));
l.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(m&&m.getTextView()){var a=m.getTextView(),f=a.getActions(!0).filter(function(d){return(d=a.getActionDescription(d))&&d.name});f.sort(function(d,f){return a.getActionDescription(d).name.localeCompare(a.getActionDescription(f).name)});this.createHeader(h.Editor);for(var b=function(d){return function(){a.focus();
return a.invokeAction(d)}},c={},n,e=0;e<f.length;e++)for(var j=f[e],u=a.getActionDescription(j),v=a.getKeyBindings(j),g=0;g<v.length;g++){n=v[g];var o=d.getUserKeyString(n);n.scopeName?(c[n.scopeName]||(c[n.scopeName]=[]),c[n.scopeName].push({bindingString:o,name:u.name,execute:b(j)})):this.createItem(o,u.name,b(j))}for(var w in c)if(c[w].length){this.createHeader(w);for(f=0;f<c[w].length;f++)n=c[w][f],this.createItem(n.bindingString,n.name,n.execute)}}this.createHeader(h.Global);i.showKeyBindings(this)},
createItem:function(a,d,f){if(this._filterString){var b=this._filterString.toLowerCase(),c;b!==this._filterString?(b=this._filterString,c=function(a){return a}):c=function(a){return a.toLowerCase()};if(c(d).indexOf(b)===-1&&c(a).indexOf(b)===-1&&c(this._lastHeader).indexOf(b)===-1)return}var i=this._keyAssistTable.insertRow(-1);i.id="keyAssist-keyBinding-"+this._idCount++;i.setAttribute("role","menuitem");i._execute=f;i.classList.add("keyAssistItem");i.addEventListener("click",function(a){this._selectedRow=
i;this.execute();a.preventDefault()}.bind(this));f=i.insertCell(-1);f.classList.add("keyAssistName");f.appendChild(document.createTextNode(d));f=i.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var d=this._keyAssistTable.insertRow(-1);d.classList.add("keyAssistSection");var d=d.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(a));d.appendChild(f)},execute:function(){window.setTimeout(function(){this.hide();
var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){var a=document.activeElement,d=this._keyAssistDiv,a=d===a||(d.compareDocumentPosition(a)&16)!==0;d.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(d.length===0)this._selectedIndex=-1;else{var f=this._selectedIndex;f+=a?1:-1;f%=d.length;f<0&&(f=d.length-1);if(this._selectedIndex!==-1)a=d[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=f;if(this._selectedIndex!==-1){this._selectedRow=
a=d[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var d=a.getBoundingClientRect(),b=this._keyAssistContents,c=b.getBoundingClientRect();a.offsetTop<b.scrollTop?f===0?b.scrollTop=0:a.scrollIntoView(!0):d.bottom>c.bottom&&a.scrollIntoView(!1)}}},show:function(){this._previousActiveElement=document.activeElement;this.createContents();this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px";this._keyAssistDiv.style.display="block";this._keyAssistInput.value=this._filterString;this._keyAssistInput.focus();this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var d=0,d=I.isIE||I.isOpera?-a.wheelDelta:I.isFirefox?a.detail*40:-a.wheelDeltaY,f=this._keyAssistContents,b=f.scrollTop;f.scrollTop+=d;if(b!==f.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var O=new s,x=new b.Command({name:h["Show Keys"],tooltip:h["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){O.isVisible()?O.hide():O.show();return!0}});i.addCommand(x);i.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));p=function(){m.getTextView().setKeyBinding(new e.KeyBinding(191,!1,!0,!I.isMac,I.isMac),x.id);m.getTextView().setAction(x.id,x.callback,x)};m&&(m.getTextView()?
p():m.addEventListener("TextViewInstalled",p));C(i);U(c,x.callback);T(c);window.addEventListener("hashchange",function(){i.processURL(window.location.href)},!1);window.setTimeout(function(){F(c)},0);J.afterGenerateBanner.apply(this,arguments)},getToolbarElements:D,getMainSplitter:function(){return Q},layoutToolbarElements:H,setPageTarget:function(a){var d,f,b=a.breadcrumbRootName,c=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(f=b?b+" ":"",f+=a.fileService.fileServiceName(a.target.Location),b=null),d=a.name||a.target.Name,N=a.target,x(c,a.target,S,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(b=b||a.task||a.name),d=a.name,x(c,{NoTarget:""},S,a.commandService,a.makeAlternate));(L=a.title)||(L=d?d+" - "+a.task:a.task);window.document.title=L;J.afterSetPageTarget.apply(this,arguments);if(d=l.node("location")){l.empty(d);var n=c&&new O.FileClient(c),c=a.breadcrumbTarget||a.target,n=n&&c&&c.Location?n.fileServiceRootURL(c.Location):
null;new i.BreadCrumbs({container:d,resource:c,rootSegmentName:b,workspaceRootSegmentName:f,workspaceRootURL:n,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(L)L.charAt(0)==="*"&&!a&&(L=L.substring(1)),a&&L.charAt(0)!=="*"&&(L="*"+L),window.document.title=L;var d=l.node("dirty");if(d)d.textContent=a?"*":""},setPageCommandExclusions:function(a){S=a},notifyAuthenticationSite:c}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(h){return{detectValidURL:function(k){for(var g=/\[([^\]]*)\]\(([^\)]+)\)/g,e=g.exec(k),c=[],b=0;e;){if(e.length===3&&e[2].length>0){var a=new URL(e[2]);a.protocol!==":"&&h.validateURLScheme(a.href)&&(e.index>b&&c.push({segmentStr:k.substring(b,e.index)}),c.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),b=e.index+e[0].length)}e=g.exec(k)}if(b===0)return null;b<k.length-1&&c.push({segmentStr:k.substring(b)});return c},processURLSegments:function(h,
g){g.forEach(function(e){if(e.urlStr){var c=document.createElement("a");c.href=e.urlStr;c.appendChild(document.createTextNode(e.segmentStr))}else c=document.createElement("span"),c.textContent=e.segmentStr;h.appendChild(c)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(h,k,g,e,c){function b(a,d,f,b,c){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=c;this.domId=f;this.progressDomId=b||f;this._hookedClose=!1;this._timer=null}var a;b.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&!this._hookedClose)this._hookedClose=!0,
a.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=g.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,d,f){this._init();this.currentMessage=a;var b=k.node(this.domId);if(typeof f==="boolean"){var c=b.getAttribute("aria-live");b.setAttribute("aria-live",f?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(b),b.appendChild(document.createTextNode(a)),window.setTimeout(function(){b.setAttribute("aria-live",c)},100))}.bind(this),100)}else k.empty(b),b.appendChild(document.createTextNode(a));typeof d==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(b),b.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(a){this.currentMessage=a;this._init();var d=a.responseText||a.message||a;if(typeof d==="string")try{d=JSON.parse(d)}catch(f){}var a=
d.Message||d,b="red";if(d.Severity)switch(d.Severity){case "Warning":b="#FFCC00";break;case "Error":b="red";break;case "Info":case "Ok":b="green"}d=document.createElement("span");d.style.color=b;d.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(d)},setProgressMessage:function(a){this._init();this.currentMessage=a;var d=document.createElement("span");d.classList.add("imageSprite");d.classList.add("progressIcon");d.classList.add("core-sprite-progress");var f=k.node(this.progressDomId);
k.empty(f);f.appendChild(d);f.appendChild(document.createTextNode(a));d=k.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(a&&a.length>0)d.classList.add("progressNormal"),d.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else d.classList.remove("notificationShow"),d.classList.add("notificationHide")},setProgressResult:function(a){this.currentMessage=a;var d=a.responseText||a;if(typeof d===
"string")try{d=JSON.parse(d)}catch(f){}this._init();var b=d.Message||d,e="core-sprite-information",g="progressInfo",h=document.createElement("span");h.classList.add("imageSprite");h.classList.add("progressIcon");a=[];if(d.Severity)switch(d.Severity){case "Warning":e="core-sprite-warning";g="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":e="core-sprite-error";g="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");h.classList.add(e);var s=k.node(this.progressDomId),e=k.node(this.notificationContainerDomId);k.empty(s);s.appendChild(h);if(d.HTML)d=document.createElement("span"),d.innerHTML=b,s.appendChild(d);else{if(h=c.detectValidURL(b))b=document.createDocumentFragment(),c.processURLSegments(b,h),Array.prototype.forEach.call(k.$$("a",b),function(a){a.target="_blank"});else{if(d.Severity!=="Warning"&&
d.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);b=document.createTextNode(b)}s.appendChild(b)}if(g&&this.progressDomId!==this.domId){e.classList.add(g);for(g=0;g<a.length;g++)e.classList.remove(a[g])}e.classList.add("notificationShow")},showWhile:function(a,d){var f=this;if(d){f.setProgressMessage(d);var b=function(){d===f.currentMessage&&f.setProgressMessage("")};a.then(b,b)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new a(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",d=!0,f;for(f in this._progressMonitors)this._progressMonitors[f].status&&(d||(a+=", "),a+=this._progressMonitors[f].status,d=!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;a=function(a,d,f,b){this.statusService=a;this.progressId=d;if(f){this.deferred=f;this.begin(b);var c=this;f.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};
a.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};a.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};a.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};a.prototype.constructor=a;return{StatusReportingService:b,ProgressMonitor:a}});
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(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(h,k,g,e){function c(){}c.prototype={_initialize:function(b,a,c,d,f){this._tooltip=new e.Tooltip({node:b,hideDelay:f||0,afterShowing:this._afterShowingFunction(a).bind(this),afterHiding:c,trigger:d?d:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&g.processTextNodes(b,h);this.$parent.appendChild(b);var i=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&i.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 c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var a=
g.firstTabbable(this.$parent);a&&a.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(h,k,g,e){var c={};(function(){var b=!1;c.updateNavTools=function(a,c,d,f,i,e){var o=g.node(f);if(o)c.destroy(o);else throw h["could not find toolbar "]+f;c.renderCommands(f,o,e,d,"button");if(i&&(f=g.node(i)))c.destroy(f),c.renderCommands(i,f,null,d,"button");b||(b=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var f=g.node(i);
f&&(c.destroy(f),c.renderCommands(i,f,a.selections,d,"button"))}))};c.createOperationsCommands=function(a,b,d){function f(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var c=new e.Command({name:h["Remove Completed"],tooltip:h["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){d.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(c);
c=new e.Command({name:h.Remove,tooltip:h["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],f=0;f<a.length;f++){var c=a[f];d.removeOperation.bind(d)(c.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!f(a);for(var d in a)if(f(a[d]))return!1;return!0}});a.addCommand(c);
c=new e.Command({name:h.Cancel,tooltip:h["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],d=0;d<a.length;d++){var f=a[d];f.deferred&&f.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return f(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var d in a)if(!f(a[d])||!a[d].operation||!a[d].operation.cancelable)return!1;return!0}});a.addCommand(c)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(h,k,g,e,c){function b(a){this._options=a}b.prototype=new e.PopupDialog;b.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>';b.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};b.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};b.prototype.setOperations=function(a,b){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var d in a)this._myOperations.push(a[d]),this._operationsDeferreds.push(b[d]);this._renderOperations()};b.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var d={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==d.Message)d.DetailedMessage=a.DetailedMessage;return d};b.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};b.prototype._renderOperationsTable=function(a,b,d){g.empty(a);for(var f=0;f<b.length;f++){var c=b[f],e=document.createElement("tr"),o=document.createElement("td");o.style.paddingLeft="5px";o.style.paddingRight="5px";o.textContent=c.Name;e.appendChild(o);var m=document.createElement("div");o.appendChild(m);o=document.createElement("span");o.style.paddingRight="5px";o.classList.add("imageSprite");switch(c.type){case "Warning":o.classList.add("core-sprite-warning");o.setAttribute("aria-label",
h["Operation resulted in a warning."]);break;case "error":o.classList.add("core-sprite-error");o.setAttribute("aria-label",h["Operation resulted in an error."]);break;case "loadstart":case "progress":o.classList.add("core-sprite-start");o.setAttribute("aria-label",h["Operation is running."]);break;case "abort":o.classList.add("core-sprite-stop");o.setAttribute("aria-label",h["Operation is canceled."]);break;case "load":case "loadend":o.classList.add("core-sprite-ok"),o.setAttribute("aria-label","Operation ok.")}m.appendChild(o);
o=document.createElement("span");o.classList.add("operationStatus");o.textContent=c.Name;m.appendChild(o);if(c.error){var k=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(k+=": "+c.error.DetailedMessage);o.textContent=k;o.classList.remove("operationStatus");o.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:c,deferred:d[f]},this,"tool");a.appendChild(e)}this._setOperationsVisibility()};b.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"};b.prototype.constructor=b;return{OperationsDialog:b}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(h,k,g,e,c){function b(a,d){if(!this._progressPane){this._progressPane=e.node(a);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:d});var f=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===e.KEY.ENTER)&&f._operationsDialog.show()})}}function a(a,d,f,b){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=f;this._operationsClient=d;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}b.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,d){var f=
{},b;for(b in a)a[b].progressMonitor||(f[b]=a[b]);if(this._isEmpty(f))this._switchIconTo("progressPane_empty"),this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var c="";for(b in f){var e=f[b];if(e.type&&(e.type==="loadstart"||e.type==="progress")){c="running";break}}switch(c){case "running":this._progressPane.title=h["Operations running"];this._progressPane.alt=h["Operations running"];
this._progressPane.setAttribute("aria-valuetext",h["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=h["Some operations finished with warning"];this._progressPane.alt=h["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=h["Some operations finished with error"];this._progressPane.alt=
h["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(f,d)},_isEmpty:function(a){for(var d in a)return!1;return!0}};
b.prototype.constructon=b;a.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new b(a,this._commandRegistry)},progress:function(a,d,f){var b=this,c=this._operationsIndex++;!f&&this._progressMonitorClass&&(f=new this._progressMonitorClass,f.begin(d));a.then(function(){if(b._operations[c]){var e=b._operations[c];if(d)e.Name=d;b._lastOperation=e;e.type="loadend";if(f)e.progressMonitor=f;b.writeOperation.bind(b)(c,e,a);e.Location||b._removeOperationFromTheList.bind(b)(c)}},
function(e){if(b._operations[c]){var g=b._operations[c];if(d)g.Name=d;if(f)g.progressMonitor=f;b._lastOperation=g;g.type=e.canceled?"abort":"error";g.error=e;b.writeOperation.bind(b)(c,g,a);g.Location||b._removeOperationFromTheList.bind(b)(c)}},function(e){if(d)e.Name=d;if(f)e.progressMonitor=f;b.writeOperation.bind(b)(c,e,a)});return a},removeOperation:function(a){for(var d in this._operations)if(this._operations[d].Location&&this._operations[d].Location===a){this._removeOperationFromTheList(d);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var d=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];d?d.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var d=this._operations[a];if(d.type&&d.type!=="loadstart"&&d.type!=="progress")(d=this._operations[a].progressMonitor)&&
d.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,d){d&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(d);var f=this;a.then(function(){f._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){f.setProgressResult.bind(f)(a);
return a});return this.progress(a,d)},writeOperation:function(a,d,f){this._operations[a]=d;this._operationDeferrds[a]=f;d.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(d.Location,{Name:d.Name,expires:d.expires})});d.progressMonitor?d.progressMonitor.progress(d.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};a.prototype.constructor=a;return{ProgressService:a}});
define("orion/dialogs",[],function(){function h(h){this._serviceRegistry=h;this._serviceRegistration=h.registerService("orion.page.dialog",this)}h.prototype={confirm:function(h,g){g(window.confirm(h))},openFiles:function(){}};h.prototype.constructor=h;return{DialogService:h}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(h){function k(g,e){e||(e="orion.page.selection");this._serviceRegistry=g;h.attach(this);this._serviceRegistration=g.registerService(e,this);this._selections=null}k.prototype={getSelection:function(g){var e=this._getSingleSelection();typeof g==="function"&&g(e);return e},getSelections:function(g){var e=Array.isArray(this._selections)?this._selections.slice():[];typeof g==="function"&&g(e);return e},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(g){var e=this._selections;this._selections=Array.isArray(g)?g.length>0?g.slice():null:g?[g]:null;e!==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(h,k){function g(a,b,d){return a[b].apply(a,d)}function e(a){this._location=a}function c(){var a=new k;a.reject(h["No Matching OperationService for location:"]+this._location);return a}function b(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
d=0;d<b.length;d++){var f=a.getService(b[d]);this._services[d]=f;f=b[d].getProperty("pattern")||".*";f[0]!=="^"&&(f="^"+f);this._patterns[d]=RegExp(f)}this._getService=function(a){if(!a)return this._services[0];for(var d=0;d<this._patterns.length;++d)if(this._patterns[d].test(a))return this._services[d];return new e(a)}}e.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};e.prototype.constructor=e;b.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(d){b._operations=d;a.resolve(b._operations)});return a},getOperation:function(a){return g(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,d=0;d<this._services.length;d++){var f=this._patterns[d],c=new k;a[d]=c.promise;g(this._services[d],"removeCompletedOperations").then(function(a){return function(d){Array.isArray(d)&&
b.getOperations.bind(b)().then(function(b){for(var c=b.keys(),i=0;i<c.length;i++){var e=c[i];f.test(e)&&d.indexOf(e)<0&&b.remove(e)}a.resolve()})}}(c),function(a){return function(d){a.reject(d)}}(c))}return k.all(a)},removeOperation:function(a){var b=this;return g(this._getService(a),"removeOperation",arguments).then(function(){b.getOperations.bind(b)().then(function(d){d.remove(a)})},function(a){return a},function(a){return a})}};b.prototype.constructor=b;return{OperationsClient:b}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search",
"Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function g(e){this._init(e)}g.prototype={_init:function(e){var c=e.parent,b=this,c=k.node(c);if(!c)throw h["no parent"];if(!e.model)throw h["no tree model"];if(!e.renderer)throw h["no renderer"];this._parent=c;this._treeModel=e.model;this._renderer=e.renderer;this._showRoot=e.showRoot===void 0?!1:e.showRoot;this._indent=e.indent===void 0?16:e.indent;this._onCollapse=e.onCollapse;this._labelColumnIndex=
e.labelColumnIndex===void 0?0:e.labelColumnIndex;this._id=e.id===void 0?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){b._showRoot?(a._depth=0,b._generate([a],0)):b._treeModel.getChildren(a,function(a){b._generate(a,0)})})},_generate:function(e,c){k.empty(this._parent);var b=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(b);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";this._generateChildren(e,c);a.appendChild(this._bodyElement);b.appendChild(a);
this._parent.appendChild(b);this._rowsChanged()},_generateChildren:function(e,c,b){for(var a=0;a<e.length;a++){var j=document.createElement(this._tableRowElement);j.id=this._treeModel.getId(e[a]);this._renderer.rowCallback&&this._renderer.rowCallback(j);j._depth=c;j._item=e[a];this._renderer.render(e[a],j);j.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*c+"px";b?(this._bodyElement.insertBefore(j,b.nextSibling),b&&(b=j)):this._bodyElement.appendChild(j)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,c,b){var a=this._treeModel.getId(e),j;if(a===this._id)this._removeChildRows(a),this._generateChildren(c,0),this._rowsChanged();else{var d=k.node(a);d?(d._item=e,d&&(b||d._expanded)?(d._expanded=!0,this._removeChildRows(a),this._renderer.updateExpandVisuals(d,!0),c?(this._generateChildren(c,d._depth+1,d),this._rowsChanged()):(j=this,c=this._treeModel.getChildren(d._item,function(a){j._generateChildren(a,
d._depth+1,d);j._rowsChanged()}))):this._renderer.updateExpandVisuals(d,!1)):console.log(h["could not find table row "]+a)}},getItem:function(e){var c=k.node(e);return c&&c._item?c._item:e},toggle:function(e){var c=k.node(e);c&&(c._expanded?(this.collapse(e),this._renderer.updateExpandVisuals(c,!1)):(this.expand(e),this._renderer.updateExpandVisuals(c,!0)))},isExpanded:function(e){return(e=k.node(e))?e._expanded:!1},expand:function(e,c,b){var e=typeof e==="string"?e:this._treeModel.getId(e),a=k.node(e);
if(a&&!a._expanded){a._expanded=!0;var j=this;this._renderer.updateExpandVisuals(a,!0);this._treeModel.getChildren(a._item,function(d){j._generateChildren(d,a._depth+1,a);j._rowsChanged();c&&c.apply(j,b)})}},_removeChildRows:function(e){for(var c=e===this._id,b=!1,a=-1,j=[],d=k.$$array(".treeTableRow",this._parent),f=0;f<d.length;f++){var i=d[f];if(b)break;if(c)i._depth>a?j.push(i):b=!0;else if(i.id===e)c=!0,a=i._depth}for(e=0;e<j.length;e++)c=j[e],c.parentNode.removeChild(c)},collapse:function(e){var e=
typeof e==="string"?e:this._treeModel.getId(e),c=k.node(e);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/treeModelIterator",[],function(){var h={};h.TreeModelIterator=function(){function h(g,e){this.firstLevelChildren=g;this.reset();this._init(e)}h.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var e=this._getChildren(g),e=e&&e.length>0;this.isExpanded&&e&&(e=this.isExpanded(g));return e},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&c.setCursor(b)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(g){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(g&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var c=this;return this.forceExpandFunc(e,"last",function(b){b&&
c.setCursor(b)})}e&&this.setCursor(e);return e},_findSibling:function(g,e){for(var c=this.topLevel(g),b=this._getChildren(g.parent),b=c?this.firstLevelChildren:b,a=0;a<b.length;a++)if(b[a]===g)return a===0&&!e?c?null:g.parent:a===b.length-1&&e?c?null:this._findSibling(g.parent,e):e?b[a+1]:b[a-1];return null},_inParentChain:function(g,e){for(var c=g.parent;c;){if(c===e)return!0;c=c.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,e,c){this.setCursor(e);var b=[];for(b.push(e);;){if(this.iterate(g))b.push(this.cursor());else break;if(c===this.cursor())return b}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,e){var c=this.cursor(),
b=this._scan(!0,g,e);b||(b=this._scan(!1,g,e));this.setCursor(c);return b},iterate:function(g,e){return g?this._forward(e):this._backward(e)},iterateOnTop:function(g,e){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):e&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return h}();return h});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(h,k,g){var h={},e=navigator.userAgent.indexOf("iPad")!==-1,c=window.navigator.platform.indexOf("Mac")!==-1;h.ExplorerNavHandler=function(){function b(a,b,d){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;var f=this._getEventListeningDiv();f.tabIndex=0;f.classList.add("selectionModelContainer");
var c=this;this._modelIterator=new g.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.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,d,f){return c.explorer.forceExpandFunc(a,d,f)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&f.focus();a=function(a){if(a.target===f){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)}};f.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);else c.toggleCursor(null,
!1)};f.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};f.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=f}b.prototype={_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=
a.postDefaultFunc},_ctrlKeyOn:function(a){return c?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(a):k.node(this.explorer._parentId)},
isExpandable:function(a){return!a?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){b._clearSelection();for(var f=0;f<d.length;f++)b._selections.push(d[f]);b._selections.length>0&&b.cursorOn(b._selections[0],!0,!1,a)})},refreshModel:function(a,b,d,f){this._currentColumn=
0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!f&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),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=[]},setSelection:function(a,b){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!b||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a;else{var d=this._inSelection(a);d>=0?(this._checkRow(a,
!0),this._selections.splice(d,1)):(this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,b){a||(a=this.currentModel());var d=this._getGridChildren(a);if(d&&d.length>1||b===0&&d){b!==0&&this.toggleCursor(a,!1);var f=this._currentColumn,c=!0;f+=b;f<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():c=!1),
f=c?d.length-1:this._currentColumn):f>=d.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():c=!1),f=c?0:this._currentColumn);this._currentColumn=f;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,d;a&&a!==b&&(d=a.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var d=this.getRowDiv(a),f=this.getCurrentGrid(a);f?(d&&(b?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),f.domNode&&(d=this.getAriaContainerElement(f.domNode),b?(f.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",f.domNode.id)):f.domNode.classList.remove("treeIterationCursor"))):
d&&(b?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,d,f){var d=d===void 0?!1:d,c,e;if(a||b){if(e===this._modelIterator.cursor())return;c=this._modelIterator.cursor();e=a;this._modelIterator.setCursor(e)}else c=this._modelIterator.prevCursor(),e=this._modelIterator.cursor();if(c!==e||b)if(this.toggleCursor(c,!1),!b||e)if(this.moveColumn(null,0),this.toggleCursor(e,
!0),(a=this.getRowDiv())&&!f&&!this._visible(a)&&a.scrollIntoView(!d),this.explorer.onCursorChanged)this.explorer.onCursorChanged(c,e)},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,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),d&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(a);if(d){var f=k.node(this.explorer.renderer.getCheckBoxId(d.id)),c=b?!f.checked:!0;if(c!==f.checked)this.explorer.renderer.onCheck(d,f,c,!0)}}else this._select(a,b)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(a){return(a=k.node(a))?k.bounds(a).height:0},_visible:function(a){if(a.offsetWidth===0||a.offsetHeight===0)return!1;var b=0;b+=this._getToolBarHeight("staticBanner");b+=this._getToolBarHeight("titleArea");b+=this._getToolBarHeight("pageToolbar");var d=this._getEventListeningDiv(!0).getClientRects()[0],f=this._vpHeight();this._vpWidth();for(var b=d.top>b?d.top:
b,d=d.bottom<f?d.bottom:f,a=a.getClientRects(),f=0,c=a.length;f<c;f++){var e=a[f];if(e.top>=b&&e.top<=d&&e.bottom>=b&&e.bottom<=d)return!0}return!1},_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 d=this._getGridChildren(a);if(d)for(var f=0;f<d.length;f++)if(b.target===d[f].domNode)return!0;return!1},onClick:function(a,b){var d=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(b.target!==d&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,b)))if(this.cursorOn(a,!0,!1,!0),e)this.setSelection(a,!0);else if(this._ctrlKeyOn(b))this.setSelection(a,!0);else if(b.shiftKey&&this._lastSelection){if(d=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var f=0;f<d.length;f++)this.setSelection(d[f],!0)}}else this.setSelection(a,!1)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,
!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},_shouldMoveColumn:function(a){var b=this.currentModel(),d=this._getGridChildren(b);return d&&d.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))},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);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 d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(d)}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 b}();h.ExplorerNavDict=function(){function b(a){this._dict={};this._model=a}b.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 d=this._model.getId(a);if(this._dict[d]){if(!this._dict[d].gridChildren&&b)this._dict[d].gridChildren=[];return this._dict[d].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return b}();return h});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(h,k,g,e,c,b){var a={};a.Explorer=function(){function a(d,b,c,e){this.registry=d;this.renderer=c;this.selection=b;this.commandService=e;this.myTree=null}a.prototype={changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,b,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=b+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=b+"placeHolderRow";var e=document.createElement("td");e.id=b+"placeHolderCol";c.appendChild(e);a.appendChild(c);c=g.node(b+"placeHolderRow");a=g.node(b+"placeHolderCol");if(c&&a)return{tempNode:c,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return g.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this._expandRecursively(a[b])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var d=a.length,c=0;c<d;c++)b._expandRecursively(a[c])})})}},createTree:function(a,b,i){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var j=a+"innerTree",h=g.node(j);h&&g.empty(h);if(b)b.rootId=j;this.model=b;this._parentId=a;this._treeOptions=i;if(!i||i&&!i.noSelection)this.selectionPolicy=i?i.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:j,
model:b,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:i?!!i.showRoot:!1,indent:i?i.indent:void 0,onCollapse:i?i.onCollapse:void 0,navHandlerFactory:i?i.navHandlerFactory:void 0,tableElement:i?i.tableElement:void 0,tableBodyElement:i?i.tableBodyElement:void 0,tableRowElement:i?i.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},
refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var c=a.getSelection(),e=0;e<c.length;e++){var j=a.getRowDiv(c[e]);j&&j.parentNode&&(j=this.getNavDict().getValue(this.model.getId(c[e])),j.model&&b.push(j.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=
a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,
c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();a.createExplorerCommands=function(a,d){function f(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?d?d(a):!0:!1:!1}var c=new b.Command({tooltip:h["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.expandAll()}}),e=new b.Command({tooltip:h["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.collapseAll()}});a.addCommand(c);a.addCommand(e)};a.ExplorerModel=function(){function a(d,b,c){this.rootPath=d;this.fetchItems=b;this.idPrefix=c||""}a.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return a}();a.ExplorerFlatModel=function(){function b(a,f,c){this.rootPath=a;this.fetchItems=f;this.root=c}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=
this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return b}();a.ExplorerRenderer=function(){function a(d,b){this.explorer=b;this._init(d);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;g.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,e,j){var c=c||"tool",g=document.createElement("td");g.id=b.id+"actionswrapper";e&&g.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,c,null,j&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(b.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=b.id;if(this.getCheckedFunc)e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&b.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on"));c.appendChild(e);var j=this;e.addEventListener("click",function(a){j.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,e,j){(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,e);this.explorer.getNavHandler()&&j&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var b;if(a&&this.explorer.getNavDict()){var c=[];for(b=0;b<a.length;b++){var e=this.explorer.getNavDict().getValue(a[b]);if(e&&e.rowDomNode&&
e.model&&(c.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=g.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(c),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+
"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var e;if(c)for(e=0;e<c.length;e++)if(g.node(c[e])){this._expanded.push(c[e]);var j=this;this.tableTree.expand(c[e],function(){j._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=g.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,e){var j=document.createElement("span");j.id=this.expandCollapseImageId(a.id);b.appendChild(j);j.classList.add(this._twistieSpriteClass);j.classList.add(this._collapseImageClass);if(c){var g=document.createElement("span");b.appendChild(g);g.classList.add(e||"imageSprite");g.classList.add(c)}var h=
this;j.onclick=function(){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id);else for(var b in h._expanded)if(h._expanded[b]===a.id){h._expanded.splice(b,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)};return j},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=
g.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],e=g.node(c.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,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,c){this._init(a);this.explorer=c}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 e=0,j=this.getCellHeaderElement(e);j;)j.innerHTML.length>0&&j.classList.add("navColumn"),c.appendChild(j),j=this.getCellHeaderElement(++e);b.appendChild(c);e>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 e=this;b.addEventListener("click",function(b){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,j=this.getCellElement(c,a,b);j;)b.appendChild(j),c===0?this.getPrimColumnStyle?j.classList.add(this.getPrimColumnStyle()):j.classList.add("navColumn"):this.getSecondaryColumnStyle?j.classList.add(this.getSecondaryColumnStyle()):j.classList.add("secondaryColumn"),
j=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();a.SimpleFlatModel=function(){function b(a,c,i){this.items=a;this.getKey=i;this.idPrefix=c;this.root={children:a}}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.destroy=function(){};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/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(h,k,g,e,c,b){function a(a,c,i,e,j,g,h){var r;if(c.Directory)r=document.createElement("a"),r.className="navlinkonpage",r.href=a+"#"+c.ChildrenLocation,r.appendChild(document.createTextNode(c.Name));else{j||(j=b.getOpenWithCommands(i));if(!g)for(a=0;a<j.length;a++)j[a].isEditor===
"default"&&(g=j[a]);r=document.createElement("a");r.className="navlink targetSelector";h&&typeof h==="object"&&Object.keys(h).forEach(function(a){r[a]=h[a]});r.appendChild(document.createTextNode(c.Name));for(var p=c.Location,q=!1,a=0;a<j.length;a++)if(i=j[a],i.visibleWhen(c)){p=i.hrefCallback({items:c});q=!0;break}k.when(e.getFileContentType(c),function(a){var b;if(b=!q)if(b=g){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":b=
!0;break a}b=!1}b=!b}b&&(p=g.hrefCallback({items:c}));b=r;var d=c.Location,i;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":i=document.createElement("img");i.src=d;i.classList.add("thumbnail");break;default:a&&a.image?(i=document.createElement("img"),i.src=a.image,i.classList.add("thumbnail")):(i=document.createElement("span"),i.className="core-sprite-file_model modelDecorationSprite")}b.firstChild?b.insertBefore(i,b.firstChild):
b.appendChild(i);r.href=p})}return r}function j(a,b,c,e){this.explorer=b;this.commandService=c;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}j.prototype=new e.SelectionRenderer;j.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};j.prototype.tableCallback=function(a){a.setAttribute("aria-label",h.Navigator);a.setAttribute("role","presentation")};j.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
j.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"}};j.prototype.setTarget=function(a){this.target=a};j.prototype.createFolderNode=function(b){var c;this.showFolderLinks?c=a(this.folderLink||"",b,this.commandService,this.contentTypeService):(c=document.createElement("span"),c.textContent=b.Name);return c};j.prototype.showFolderLinks=!0;j.prototype.getCellElement=function(d,f,i){switch(d){case 0:var d=
document.createElement("td"),e=document.createElement("span");e.id=i.id+"MainCol";e.setAttribute("role","presentation");d.appendChild(e);d.setAttribute("role","presentation");e.className="mainNavColumn";var j;if(f.Directory)this.getExpandImage(i,e),j=this.createFolderNode(f),e.appendChild(j),this.explorer._makeDropTarget(f,j),this.explorer._makeDropTarget(f,i);else{if(!this.openWithCommands){this.openWithCommands=b.getOpenWithCommands(this.commandService);for(j=0;j<this.openWithCommands.length;j++)if(this.openWithCommands[j].isEditor===
"default")this.defaultEditor=this.openWithCommands[j]}j=a("",f,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});e.appendChild(j)}if(j)j.id=i.id+"NameLink",j.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),f,j),j.setAttribute("role","link"),j.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,f,this.explorer,"tool",null,!0);return d;case 1:if(this.oneColumn)return null;i=document.createElement("td");
if(f.LocalTimeStamp)i.textContent=(new Date(f.LocalTimeStamp)).toLocaleString();return i;case 2:if(this.oneColumn)return null;i=document.createElement("td");if(!f.Directory&&typeof f.Length==="number")f=parseInt(f.Length,10)/1024,i.textContent=Math.ceil(f).toLocaleString()+" KB";i.style.textAlign="right";return i}};j.prototype.constructor=j;return{NavigatorRenderer:j,createLink:a}});
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(h,k,g,e,c,b,a,j,d){function f(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function i(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new f(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}f.prototype.makeRenderFunction=function(b,c,f,i,r){var p=this.serviceRegistry,q=this.commandRegistry;this.openWithCommands=this.openWithCommands||j.createOpenWithCommands(p,b,q);var t=this;return function(n,j,w){d.when(t.openWithCommands,function(d){if(w)g.empty(c),d=document.createElement("div"),d.appendChild(document.createTextNode(h["Search failed."])),c.appendChild(d),typeof i==="function"&&i(c);else{var y=
function(){function a(b,d){var c=d.folderName?d.folderName:d.path,f=document.createElement("span");f.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+c+" "));b.appendChild(f)}var b={};return function(d,c){var f=c.name;if(b.hasOwnProperty(f)){a(d,c);var n=b[f];typeof n==="function"&&(b[f]=null,n())}else b[f]=function(){a(d,c)}}}(),E=!1;g.empty(c);if(n&&n.length>0){var z=document.createElement("table");z.setAttribute("role","presentation");for(var B=0;B<n.length;B++){var A=
n[B],F;if(!E&&(E=!0,f))F=z.insertRow(0).insertCell(0),F.textContent=f;F=z.insertRow(-1).insertCell(0);F.colspan=2;r&&r(F);var p={Name:A.name,Directory:A.directory,Location:A.path||A.location},p=a.createLink(k.toUrl("navigate/table.html"),p,q,b,d,null,{"aria-describedby":(A.folderName?A.folderName:A.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});A.LineNumber&&p.appendChild(document.createTextNode(" (Line "+A.LineNumber+")"));F.appendChild(p);y(F,A)}c.appendChild(z);typeof i===
"function"&&i(c)}!E&&j&&(d=e.formatMessage(h["No matches found for ${0}"],j),g.empty(c),c.appendChild(document.createTextNode(d)),typeof i==="function"&&i(c))}})}};i.prototype={search:function(a,d,f){var i=function(a){for(var b=[],d=0;d<a.response.docs.length;d++){var f=a.response.docs[d];b.push({name:f.Name,path:f.Location,folderName:c.path2FolderName(f.Path?f.Path:f.Location,f.Name),directory:f.Directory,lineNumber:f.LineNumber})}return b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,
function(a){f(i(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);f(i(b),d)},function(a){f(null,null,a)})}catch(e){typeof e==="string"&&e.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(a){f(i(a),null)}):typeof e==="string"&&e.indexOf("search")>-1&&!a.nameSearch?(new b.SearchCrawler(this.registry,this._fileService,
a,{childrenLocation:this.getChildrenLocation()})).search(function(a){f(i(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(e)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);g.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var d="",c=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>
0?c=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(c=a);if(c)this.setLocationbyURL(c.Location),d=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),d=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;c=g.node("search");d||(d="");if(c&&c.placeholder){c.value="";var f=e.formatMessage(h["Search ${0}"],d);c.placeholder=f.length>30?f.substring(0,27)+"...":e.formatMessage(h["Search ${0}"],
d)}if(c&&c.title)c.title=h["Type a keyword or wild card to search in "]+d},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?
this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,d,c){d=d?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:d,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:d,sort:c&&c.sort?c.sort:"Path asc",rows:c&&c.rows?c.rows:40,start:0,caseSensitive:c?c.caseSensitive:void 0,regEx:c?c.regEx:void 0,fileType:c?c.fileType:void 0,keyword:a,replace:c?c.replace:void 0}}};i.prototype.constructor=i;return{Searcher:i}});
define("orion/widgets/themes/editor/ThemeData",["orion/editor/textTheme"],function(h){function k(){}function g(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name=
"Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";
a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";
a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);
a=new k;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string=
"#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";a.lineNumber="#E73E36";a.currentLine=
"#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a)}function e(){return this.styles}var c='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";g.prototype.styles=[];g.prototype.getStyles=e;g.prototype.fontSettable=!0;g.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};g.prototype.parseToXML=function(a){try{var b=null;if(window.DOMParser){var b=(new DOMParser).parseFromString(a,
"text/xml"),d=b.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?b:null}else return b=new ActiveXObject("Microsoft.XMLDOM"),b.async=!1,b.loadXML(a),b}catch(c){}};g.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};g.prototype.importTheme=function(a){console.log("import theme");console.log(a);var b=this.parseToXML(a.parameters.valueFor("name")),d=new k;d.name=b.getElementsByTagName("colorTheme")[0].attributes[1].value;d.annotationRuler=b.getElementsByTagName("background")[0].attributes[0].value;
d.background=b.getElementsByTagName("background")[0].attributes[0].value;d.comment=b.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=b.getElementsByTagName("keyword")[0].attributes[0].value;d.text=b.getElementsByTagName("foreground")[0].attributes[0].value;d.string=b.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=b.getElementsByTagName("background")[0].attributes[0].value;d.lineNumberOdd=b.getElementsByTagName("lineNumber")[0].attributes[0].value;
d.lineNumberEven=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=b.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=b.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(d)};g.prototype.processSettings=function(a){var b=h.TextTheme.getTheme();b.setThemeClass("editorTheme",b.buildStyleSheet("editorTheme",a))};g.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},b=a.left,d=a.top;a.shapes=[{type:"TEXT",
name:"Line Numbers",label:"1",x:b+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Background",x:b+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:"Strings",label:"'text/javascript'",x:b+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+124,y:d+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:d+
87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Overview Ruler",x:b+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:"Comments",label:"/* comment */",x:b+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<script",x:b+55,y:d+20,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"Strings",label:"'Result'",x:b+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"multiply(a,b){",x:b+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",
name:"keywords",label:"function",x:b+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Keywords",label:"var",x:b+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output = ",x:b+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:";",x:b+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"var",x:b+95,
y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"result = a*b;",x:b+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"return",x:b+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output + result;",x:b+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"}",x:b+75,y:d+140,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<\/script>",x:b+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<style",x:b+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:"Strings",label:"'text/css'",x:b+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:".some-class",x:b+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"{",x:b+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Attribute",
label:"color:",x:b+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Value",label:"#123456",x:b+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Text",label:";",x:b+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"}",x:b+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"</style>",x:b+55,y:d+280,
fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Annotation Ruler",x:b,y:d,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var c=0;c<16;c++)a.shapes.push({type:"TEXT",name:"Line Numbers",label:c+1,x:b+20,y:d+20*c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:g,getStyles:e}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(h,k,g,e){function c(a,b){var d=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 c=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var i=0;i<c.length;i++)this.domNode.classList.add(c[i]);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===d.titleNode||a.target===d.twistie)&&d._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===h.KEY.ENTER&&(a.target===d.domNode||a.target===d.titleNode||a.target===d.twistie)&&d._changeExpandedState()},!1);if(b.iconClass){var g=document.createElement("span");g.classList.add("sectionIcon");this.domNode.appendChild(g);(Array.isArray(b.iconClass)?b.iconClass:[b.iconClass]).forEach(function(a){g.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")c=document.createElement("div"),c.classList.add("layoutLeft"),c.classList.add("sectionItemCount"),this.domNode.appendChild(c),c.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);c=document.createElement("div");c.id=b.id+"FilterSearchBox";this.domNode.appendChild(c);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&&(c=e.slideoutHTMLFragment(b.id),i=document.createRange(),i.selectNode(this.domNode),c=i.createContextualFragment(c),this.domNode.appendChild(c));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 o=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(o.id);if(a!==void 0)o.hidden=!a;if(!o.hidden)o._contentParent.style.display="block";o._updateExpandedState(!o.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function b(a){this._section=a;this._id=++a._lastMonitor}c.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new b(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility=
"visible";this._loading[a]=b;var d="",c;for(c in this._loading)d!==""&&(d+="\n"),d+=this._loading[c];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,c=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(b){b.put(c,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};c.prototype.constructor=c;b.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)}};b.prototype.constructor=b;return{Section:c}});
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:"});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(h,k,g,e){var c={};c.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 c=new k.Command({name:h["Copy current change from right to left"],tooltip:h["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()}}),i=new k.Command({name:h["Copy current change from left to right"],tooltip:h["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()}}),e=new k.Command({tooltip:h["Switch to unified diff"],name:h.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()}}),
o=new k.Command({tooltip:h["Switch to side by side diff"],name:h["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:h["Next diff block"],tooltip:h["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),
s=new k.Command({name:h["Previous diff block"],tooltip:h["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),r=new k.Command({name:h["Next diff change"],tooltip:h["Next diff change"],imageClass:"core-sprite-move_down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),p=new k.Command({name:h["Previous diff change"],tooltip:h["Previous diff change"],
imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});d.addCommand(c);d.addCommand(i);d.addCommand(o);d.addCommand(e);d.addCommand(m);d.addCommand(s);d.addCommand(r);d.addCommand(p);d.registerCommandContribution(b,"orion.compare.toggle2Inline",108);d.registerCommandContribution(b,"orion.compare.toggle2TwoWay",109);d.registerCommandContribution(b,"orion.compare.copyToLeft",110,null,!1,new g.KeyBinding(37,!0,!1,!0));
d.registerCommandContribution(b,"orion.compare.copyToRight",111,null,!1,new g.KeyBinding(39,!0,!1,!0));d.registerCommandContribution(b,"orion.compare.nextDiff",112,null,!1,new g.KeyBinding(40,!0));d.registerCommandContribution(b,"orion.compare.prevDiff",113,null,!1,new g.KeyBinding(38,!0));a.options.wordLevelNav?(d.registerCommandContribution(b,"orion.compare.nextChange",114,null,!1,new g.KeyBinding(40,!0,!0)),d.registerCommandContribution(b,"orion.compare.prevChange",115,null,!1,new g.KeyBinding(38,
!0,!0))):(d.registerCommandContribution(b,"orion.compare.nextChange",114,null,!0,new g.KeyBinding(40,!0,!0)),d.registerCommandContribution(b,"orion.compare.prevChange",115,null,!0,new g.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var b=this.options.commandSpanId,d=this.options.commandService;d&&b&&(e.empty(e.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),d.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(d.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):d.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):d.renderCommands(b,b,a,a,"tool",null))}};return b}();return c});
define("orion/compare/compareUtils",["orion/URITemplate"],function(h){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,e,c){for(var b=0,a=0;a<g.length;a++){var j=g[a][e];j===0&&(j=1);if(c>=b&&c<b+j)return{mapperIndex:a,startFrom:b};if(a===g.length-1)break;b+=g[a][e]}return{mapperIndex:g.length-1,startFrom:b}};k.compareUtils.lookUpLineIndex=function(g,e,c){if(c===0)return 0;for(var b=0,a=0;a<c;a++)b+=g[a][e];return b};k.compareUtils.updateMapper=function(g,e,c,b,
a){if(b!==a&&(b>0||a>0)){var j=k.compareUtils.lookUpMapper(g,e,c);if(!(j.mapperIndex<0)){if(b>0)for(var d=c-j.startFrom,c=j.mapperIndex;c<g.length;c++){d=g[c][e]-d;if(b<=d){g[c][e]-=b;break}g[c][e]-=d;b-=d;d=0}a>0&&(g[j.mapperIndex][e]+=a)}}};k.compareUtils.overlapMapper=function(g,e,c,b,a){g=c+g[e]-1;g<c&&(g=c);a<b&&(a=b);return g<b||a<c?!1:!0};k.compareUtils.findFirstDiff=function(g,e,c,b){for(var a=0,j=null,d=0;d<g.length;d++){if(a>b)break;if(k.compareUtils.overlapMapper(g[d],e,a,c,b)&&(j={mapperIndex:d,
startFrom:a},g[d][2]!==0))break;a+=g[d][e]}return j};k.compareUtils.matchMapper=function(g,e,c,b){if(g.length===0)return c;var a=c+Math.round((b-c)/3),j=k.compareUtils.findFirstDiff(g,e,c,b),d=g[j.mapperIndex][e]===0?j.startFrom:j.startFrom+g[j.mapperIndex][e]-1,f=k.compareUtils.lookUpLineIndex(g,1-e,j.mapperIndex),i=j.startFrom-c;return g[j.mapperIndex][2]===0?f-i:a>=j.startFrom&&a<=d?f-Math.round((b-c)/3):a<j.startFrom?f-i:(g[j.mapperIndex][1-e]===0?f:f+g[j.mapperIndex][1-e]-1)-(d-c)};k.compareUtils.getMapperLineCount=
function(g){for(var e=0,c=0;c<g.length;c++)e+=Math.max(g[c][0],g[c][1]);return e};k.compareUtils.getAnnotationIndex=function(g,e){for(var c=0;c<g.length;c++)if(g[c][0]===e)return c;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,e){return g[e][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,e){for(var c=0;c<g.length;c++)if(g[c][1]===e)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,e){return e<0?!1:!g[e][3]?!1:
g[e][3]===1};k.compareUtils.mergeDiffBlocks=function(g,e,c,b,a,j){for(var d=0;d<e.length;d++){var f=e[d][0],i=c[e[d][1]];if(i[0]>0){for(var h="",o=0;o<i[0];o++)h=h+b[i[2]-1+o].substring(a)+j;i=g.getLineCount();f>=i&&(f=i-1);f=g.getLineStart(f);g.setText(h,f,f)}}};k.compareUtils.generateCompareHref=function(g,e){var c=require.toUrl("compare/compare.html");if(!e.conflict)e.conflict=void 0;if(!e.readonly)e.readonly=void 0;return(new h(c+"#{,resource,params*}")).expand({resource:g,params:e})};k.compareUtils.generateCompareTreeHref=
function(g,e){var c=require.toUrl("compare-tree/compare-tree.html");return(new h(c+"#{,resource,params*}")).expand({resource:g,params:e})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(h,k){function g(c,b,a){var e=new k;c[b].apply(c,a).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}function e(c,b){var a=c.getServiceReferences("orion.core.diff"),e,d=a;if(b){d=[];for(e=0;e<a.length;++e)b(a[e])&&d.push(a[e])}var f=[],i=[];for(e=0;e<d.length;++e)f[e]=RegExp(d[e].getProperty("pattern")||".*"),i[e]=c.getService(d[e]);this._getService=function(a){if(a.indexOf("://")===-1){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<f.length;++b)if(f[b].test(a))return i[b];throw h["No Matching DiffService for location:"]+a;}}e.prototype={getDiffContent:function(c){return g(this._getService(c),"getDiffContent",arguments)},getDiffFileURI:function(c){return g(this._getService(c),"getDiffFileURI",arguments)}};return{DiffProvider:e}});
define("orion/compare/diffParser",[],function(){var h=h||{};h.DiffParser=function(){function h(e,c){this._lineDelimiter=e?e:g?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=!1}var g=window.navigator.platform.indexOf("Win")!==-1;h.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(e){this._diffLineDelimiter=this._lineDelimiter=e},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(e,c,b,a){this._init();if(c==="")return{outPutFile:e,mapper:[]};this._oFileContents=e===""?[]:e.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var j=0;j<c;j++){var d=this._parseHunkRange(j);d&&this._hunkRanges.push(d)}if(0===this._hunkRanges.length)return{outPutFile:e,
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(e=0;e<this._hunkRanges.length;e++)this._parseHunkBlock(e);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(b);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 e=0;e<this._deltaMap.length;e++)if(console.log(JSON.stringify(this._deltaMap[e])),
this._deltaMap[e][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[e][0];c++)console.log("    "+this._diffContents[this._deltaMap[e][2]+c-1])}},_logNewFile:function(){for(var e=0;e<this._nFileContents.length;e++)console.log(this._nFileContents[e])},_createBlock:function(e,c,b,a){a===b&&e===" "||(b=[b,a-b,"s"],e==="-"?b[2]="r":e==="+"?b[2]="a":e==="c"&&(b[2]="c"),c.push(b))},_createMinusBlock:function(e,c,b){var a=this._oBlocks.length;a===0||e!==this._oBlocks[a-
1][0]?(this._oBlocks.push([e===0?1:e,b]),this._nBlocks.push([c,0,-2])):this._oBlocks[a-1][1]+=b},_createPlusBlock:function(e,c,b,a){var j=this._nBlocks.length;j===0||c!==this._nBlocks[j-1][0]?(this._oBlocks.push([e===0?1:e,0]),this._nBlocks.push([c,b,a])):(this._nBlocks[j-1][1]+=b,this._nBlocks[j-1][2]=a)},_parseHunkBlock:function(e){for(var c=" ",b=this._hunkRanges[e][0]+1,a=e===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[e+1][0],j=0,d=0,f=this._hunkRanges[e][1],i=this._hunkRanges[e][3],
g=b,h=b;h<a;h++)if(0!==this._diffContents[h].length){var m=this._diffContents[h][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[h].substring(0,this._diffContents[h].length-1)||"\\ No newline at end of file"===this._diffContents[h]))c==="-"?this._oNewLineAtEnd=!1:c===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,h>b&&this._diffContents[h-1][this._diffContents[h-1].length-1]==="\r"&&(this._diffContents[h-1]=this._diffContents[h-1].substring(0,this._diffContents[h-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(c!==m){m==="+"&&(g=h);switch(c){case " ":f=this._hunkRanges[e][1]+j;i=this._hunkRanges[e][3]+d;break;case "-":this._createMinusBlock(f,i,this._hunkRanges[e][1]+j-f);break;case "+":this._createPlusBlock(f,i,this._hunkRanges[e][3]+d-i,g)}c=m}switch(m){case "-":j++;break;case "+":d++;break;case " ":j++,d++}}}switch(c){case "-":this._createMinusBlock(f,i,this._hunkRanges[e][1]+j-f);break;case "+":this._createPlusBlock(f,
i,this._hunkRanges[e][3]+d-i,g)}},_detectConflictes:function(e,c){if(e<0)return!1;for(var b=e+c,a=e;a<b;a++){var j=this._diffContents[a];if(j.indexOf("<<<<<")>-1||j.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){var c=this._oBlocks.length,b=this._oFileContents.length,a=0,j;j=1;for(var d=0;d<c;d++)j=this._oBlocks[d][0]-j,j>0&&(this._deltaMap.push([j,j,0]),a+=j),e&&this._detectConflictes(this._nBlocks[d][2],this._nBlocks[d][1])?this._deltaMap.push([this._nBlocks[d][1],this._oBlocks[d][1],
this._nBlocks[d][2]+1,1]):this._deltaMap.push([this._nBlocks[d][1],this._oBlocks[d][1],this._nBlocks[d][2]+1]),a+=this._oBlocks[d][1],j=this._oBlocks[d][0]+this._oBlocks[d][1];0<b-j&&(this._deltaMap.push([b-j+1,b-j+1,0]),a+=b-j+1);a<b&&(j=b-a,e=this._deltaMap[this._deltaMap.length-1],e[2]===0?(e[0]+=j,e[1]+=j):e[2]===-1?this._deltaMap.push([j,j,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([j,j,0]):(this._nNewLineAtEnd&&(e[0]+=j),this._oNewLineAtEnd&&(e[1]+=j)))},_buildNewFile:function(){var e=
1,c=!1,b=this._deltaMap.length,a,j;for(a=0;a<b;a++){c=!1;if(this._deltaMap[a][2]===0){for(j=0;j<this._deltaMap[a][0];j++)this._nFileContents.push(this._oFileContents[e+j-1]);c=!0}else if(this._deltaMap[a][2]>0)for(j=0;j<this._deltaMap[a][0];j++)this._nFileContents.push(this._diffContents[this._deltaMap[a][2]+j-1].substring(1));e+=this._deltaMap[a][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},_parseHRangeBody:function(e,c){if(0<e.indexOf(",")){var b=e.split(","),a=parseInt(b[0],10),b=
parseInt(b[1],10);c.push(a>=0?a:1);c.push(b>=0?b:1)}else a=parseInt(e,10),c.push(a>=0?a:1),c.push(1)},_parseHunkRange:function(e){var c=this._diffContents[e];if(8>c.length)return null;if("@@"!==c.substring(0,2))return null;var c=c.substring(2),b=c.indexOf("@@");if(b<0)return null;var c=c.substring(0,b),b=c.indexOf("-"),a=c.indexOf("+");if(b<0||a<0)return null;e=[e];b<a?(c=c.substring(b+1).split("+"),this._parseHRangeBody(c[0],e),this._parseHRangeBody(c[1],e)):(c=c.substring(a+1).split("-"),this._parseHRangeBody(c[1],
e),this._parseHRangeBody(c[0],e));return e}};return h}();return h});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(h){var k=k||{};k.CompareRuler=function(){function g(e,c,b){this._location=e||"left";this._overview=c||"page";this._rulerStyle=b;this._editor=null;var a=this;this._listener={onModelChanged:function(b){a._onModelChanged(b)}}}g.prototype={setView:function(e){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=e;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(e,c){for(var b=[],a=e;a<c;a++){var j=this.getStyle(a);j&&(b[a]={html:this.getHTML(a),style:j})}return b},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return g}();k.LineNumberCompareRuler=function(){function g(e,c,b,a,j,d){k.CompareRuler.call(this,b,"page",a);this._diffNavigator=e;this._oddStyle=j||{style:{backgroundColor:"white"}};this._evenStyle=d||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(e){return e===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(e){var c=this._editor.getModel(),
b=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!b?"":e===-1?c.getLineCount():b.getLineNumber?(e=b.getLineNumber(e),e===-1?"":e+1):e+1};g.prototype._onModelChanged=function(e){var e=e.start,c=this._editor.getModel(),b=c.getLineCount(),a=(b+"").length;if(this._numOfDigits!==a)this._numOfDigits=a,this._editor.redrawLines(c.getLineAtOffset(e),b,this)};return g}();k.CompareOverviewRuler=function(){function g(e,c,b,a){this._diffNavigator=b;this._onClick=a;k.CompareRuler.call(this,e,
"document",c)}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(e){var c,b;if(e===void 0)c=this._rulerStyle||{},b=c.style||(c.style={}),b.lineHeight="1px",b.fontSize="1px",b.width="14px";else if(c=e!==-1?{styleClass:"annotationOverview breakpoint"}:{},b=c.style||(c.style={}),b.cursor="pointer",b.width="8px",b.left="2px",e>=0){var a;if(this._diffNavigator&&this._diffNavigator.getFeeder())a=this._diffNavigator.getFeeder().getDiffBlocks();else return null;e=h.getAnnotationIndex(a,e);if(e===
-1)return null;a=h.getAnnotationMapperIndex(a,e);var j;j=this._diffNavigator.getMapper();if(a=h.isMapperConflict(j,a))b.border="1px #FF0000 solid";if(e===this._diffNavigator.getCurrentBlockIndex())b.backgroundColor=a?"red":"blue";e=this._diffNavigator.getFeeder().getDiffBlockH(e);a=this._diffNavigator.getFeeder().getOverviewLineCount();if(e<0)return null;j=this._editor.getClientArea();e=Math.floor(j.height*e/a);e<2&&(e=2);b.height=e+"px"}else return null;return c};g.prototype.setDiffNavigator=function(e){this._diffNavigator=
e};g.prototype.getHTML=function(){return"&nbsp;"};g.prototype.onClick=function(e){e!==void 0&&this._onClick(e,this)};g.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return g}();k.CompareCurveRuler=function(){function g(e){this._canvasDiv=e;this._mapper=void 0}g.prototype={init:function(e,c,b,a){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=e;this._leftEditor=c;this._rightEditor=b;this._leftTextView=c.getTextView();
this._rightTextView=b.getTextView();this._diffNavigator=a;this.render()},matchPositionFrom:function(e){var c=e?this._leftTextView:this._rightTextView,b=e?this._rightTextView:this._leftTextView,a=c.getTopIndex(),c=c.getBottomIndex(),e=h.matchMapper(this._mapper,e?0:1,a,c);b.setTopIndex(e)},copyTo:function(e){if(this._diffNavigator.iterator){var c=this._diffNavigator.iterator.cursor();if(c){var b=e?this._rightTextView.getText(c.oldA.start,c.oldA.end):this._leftTextView.getText(c.newA.start,c.newA.end),
c=e?c.newA:c.oldA;(e?this._leftTextView:this._rightTextView).setText(b,c.start,c.end)}}},render:function(){if(this._mapper){var e=this._canvasDiv.getContext("2d");e.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);e.strokeStyle="#AAAAAA";e.lineWidth=1;e.beginPath();var c=this._leftTextView.getTopIndex(),b=this._leftTextView.getBottomIndex(),a=this._rightTextView.getTopIndex(),j=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var d=0,f=0,i=!1,g=0;g<this._mapper.length;g++){if(this._mapper[g][2]!==0)if(h.overlapMapper(this._mapper[g],0,d,c,b)||h.overlapMapper(this._mapper[g],1,f,a,j))this._renderCurve(g,d,f,this._canvasDiv,e,c,b,a,j),i=!0;else if(i)break;d+=this._mapper[g][0];f+=this._mapper[g][1]}e.stroke()}},_renderCurve:function(e,c,b,a,j){var d=this._mapper[e],c=this._leftTextView.getLinePixel(c+d[0]/2)+d[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),b=this._rightTextView.getLinePixel(b+d[1]/2)+d[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),a=a.parentNode.clientWidth;e===this._diffNavigator.getCurrentMapperIndex()?(j.stroke(),j.strokeStyle="#000",j.lineWidth=1,j.beginPath(),j.moveTo(0,c),j.bezierCurveTo(a/3,c,a*0.666,b,a,b),j.stroke(),j.strokeStyle="#AAAAAA",j.lineWidth=1,j.beginPath()):(j.moveTo(0,c),j.bezierCurveTo(a/3,c,a*0.666,b,a,b),j.stroke())},onChanged:function(e,c){var b=c?this._rightIniting:this._leftIniting;if(e.removedLineCount!==e.addedLineCount){var a=c?this._rightTextView:
this._leftTextView;b||h.updateMapper(this._mapper,c?1:0,a.getModel().getLineAtOffset(e.start),e.removedLineCount,e.addedLineCount);(e.removedLineCount>0||e.addedLineCount>0)&&this.render()}c?this._rightIniting=!1:this._leftIniting=!1;return b}};return g}();return k});define("orion/editor/i18n",{load:function(h,k,g){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+h],function(e){g(e)}):g({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",
clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",
incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",
toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",
viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",
vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",
viP:"Paste Before Char or Line",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(h,k){var g={root:k},e;for(e in h)h.hasOwnProperty(e)&&typeof g[e]==="undefined"&&(g[e]=h[e]);return g});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(h,k){function g(e,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(e);this.setLineDelimiter(c)}g.prototype={find:function(e){if(this._text.length>1)this._text=[this._text.join("")];var c=e.string,b=c,a=e.caseInsensitive;!e.regex&&c&&(b=c.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(b=b.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var j=null,d;if(b){var c=e.reverse,f=e.wrap,i=e.wholeWord,
g=e.start||0,e=e.end,h=e!==null&&e!==void 0,m="";m.indexOf("g")===-1&&(m+="g");a&&m.indexOf("i")===-1&&(m+="i");i&&(b="\\b"+b+"\\b");var k=this._text[0],r,p,q=0;h&&(a=g<e?g:e,k=k.substring(a,g<e?e:g),q=a);var t=RegExp(b,m);if(c)d=function(){var a=null;for(t.lastIndex=0;;){p=t.lastIndex;r=t.exec(k);if(p===t.lastIndex)return null;if(r){if(!(r.index+q<g)){if(!f||a)break;g=k.length+q}a={start:r.index+q,end:t.lastIndex+q}}else break}if(a)g=a.start;return a};else{if(!h)t.lastIndex=g;d=function(){for(;;){p=
t.lastIndex;r=t.exec(k);if(p===t.lastIndex)break;if(r)return{start:r.index+q,end:t.lastIndex+q};if(!(p!==0&&f))break}return null}}j=d()}return{next:function(){var a=j;a&&(j=d());return a},hasNext:function(){return j!==null}}},getCharCount:function(){for(var e=0,c=0;c<this._text.length;c++)e+=this._text[c].length;return e},getLine:function(e,c){var b=this.getLineCount();if(!(0<=e&&e<b))return null;var a=this._lineOffsets[e];if(e+1<b){b=this.getText(a,this._lineOffsets[e+1]);if(c)return b;for(var a=
b.length,j;(j=b.charCodeAt(a-1))===10||j===13;)a--;return b.substring(0,a)}else return this.getText(a)},getLineAtOffset:function(e){var c=this.getCharCount();if(!(0<=e&&e<=c))return-1;var b=this.getLineCount();if(e===c)return b-1;var a,j,d=this._lastLineIndex;if(0<=d&&d<b&&(a=this._lineOffsets[d],j=d+1<b?this._lineOffsets[d+1]:c,a<=e&&e<j))return d;for(var f=b,i=-1;f-i>1;)if(d=Math.floor((f+i)/2),a=this._lineOffsets[d],j=d+1<b?this._lineOffsets[d+1]:c,e<=a)f=d;else if(e<j){f=d;break}else i=d;return this._lastLineIndex=
f},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,c){var b=this.getLineCount();if(!(0<=e&&e<b))return-1;if(e+1<b){b=this._lineOffsets[e+1];if(c)return b;for(var a=this.getText(Math.max(this._lineOffsets[e],b-2),b),j=a.length,d;(d=a.charCodeAt(j-1))===10||d===13;)j--;return b-(a.length-j)}else return this.getCharCount()},getLineStart:function(e){return!(0<=e&&e<this.getLineCount())?-1:this._lineOffsets[e]},getText:function(e,
c){e===void 0&&(e=0);c===void 0&&(c=this.getCharCount());if(e===c)return"";for(var b=0,a=0,j;a<this._text.length;){j=this._text[a].length;if(e<=b+j)break;b+=j;a++}for(var d=b,f=a;a<this._text.length;){j=this._text[a].length;if(c<=b+j)break;b+=j;a++}if(f===a)return this._text[f].substring(e-d,c-b);d=this._text[f].substring(e-d);b=this._text[a].substring(0,c-b);return d+this._text.slice(f+1,a).join("")+b},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},
setLineDelimiter:function(e,c){e==="auto"&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=e?e:k.platformDelimiter;if(c){var b=this.getLineCount();if(b>1){for(var a=Array(b),j=0;j<b;j++)a[j]=this.getLine(j);this.setText(a.join(this._lineDelimiter))}}},setText:function(e,c,b){e===void 0&&(e="");c===void 0&&(c=0);b===void 0&&(b=this.getCharCount());if(!(c===b&&e==="")){for(var a=this.getLineAtOffset(c),j=this.getLineAtOffset(b),d=c,f=
b-c,i=j-a,g=e.length,h=0,m=this.getLineCount(),k=0,r=0,p=0,q=[];;){k!==-1&&k<=p&&(k=e.indexOf("\r",p));r!==-1&&r<=p&&(r=e.indexOf("\n",p));if(r===-1&&k===-1)break;p=k!==-1&&r!==-1?k+1===r?r+1:(k<r?k:r)+1:k!==-1?k+1:r+1;q.push(c+p);h++}this.onChanging({type:"Changing",text:e,start:d,removedCharCount:f,addedCharCount:g,removedLineCount:i,addedLineCount:h});q.length===0&&(p=this.getLineStart(a),j=j+1<m?this.getLineStart(j+1):this.getCharCount(),c!==p&&(e=this.getText(p,c)+e,c=p),b!==j&&(e+=this.getText(b,
j),b=j));p=g-f;for(j=a+i+1;j<m;j++)this._lineOffsets[j]+=p;if(q.length<5E4)a=[a+1,i].concat(q),Array.prototype.splice.apply(this._lineOffsets,a);else{p=a+1;this._lineOffsets.splice(p,i);for(m=0;m<q.length;m+=5E4)a=[p,0].concat(q.slice(m,Math.min(q.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,a),p+=5E4}for(p=m=0;p<this._text.length;){j=this._text[p].length;if(c<=m+j)break;m+=j;p++}a=m;for(q=p;p<this._text.length;){j=this._text[p].length;if(b<=m+j)break;m+=j;p++}j=this._text[p];c=
this._text[q].substring(0,c-a);b=j.substring(b-m);q=[q,p-q+1];c&&q.push(c);e&&q.push(e);b&&q.push(b);Array.prototype.splice.apply(this._text,q);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:d,removedCharCount:f,addedCharCount:g,removedLineCount:i,addedLineCount:h})}}};h.EventTarget.addMixin(g.prototype);return{TextModel:g}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(h,k){function g(c){if(c)this._view=c,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function e(c){g.call(this,c)}g.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(c){for(var b=[],a=this._keyBindings,e=0;e<a.length;e++)a[e].actionID===c&&b.push(a[e].keyBinding);return b},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var b=this._keyBindingIndex,a=this._matchingKeyBindings||this._keyBindings,e=[],d=0;d<a.length;d++){var f=a[d],i=f.keyBinding.match(c,b);if(i===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,f.actionID;else typeof i==="number"&&e.push(f)}if(e.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=e,"noop"},setKeyBinding:function(c,
b){for(var a=this._keyBindings,e=0;e<a.length;e++){var d=a[e];if(d.keyBinding.equals(c)){b?d.actionID=b:d.predefined?d.actionID="noop":a.splice(e,1);return}}b&&a.push({keyBinding:c,actionID:b})},setView:function(c){this._view=c}};e.prototype=new g;e.prototype.createKeyBindings=function(){var c=h.KeyBinding,b=[];b.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});b.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});b.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
b.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(b.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),b.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),b.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
b.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),b.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),b.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(b.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(b.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(b.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));b.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});b.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});b.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});b.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});b.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});b.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(b.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),b.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
b.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(b.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),b.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));b.push({actionID:"undo",keyBinding:new h.KeyBinding("z",!0),predefined:!0});k.isMac?b.push({actionID:"redo",keyBinding:new h.KeyBinding("z",!0,!0),predefined:!0}):b.push({actionID:"redo",keyBinding:new h.KeyBinding("y",!0),predefined:!0});
b.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});b.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});b.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});b.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});b.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
b.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});b.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});b.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(b.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),b.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));b.push({actionID:"toggleWrapMode",keyBinding:new h.KeyBinding("w",!0,!1,!0)});b.push({actionID:"toggleOverwriteMode",keyBinding:new h.KeyBinding(45)});if(!k.isFirefox){var a=k.isMac&&k.isChrome;b.push({actionID:"noop",keyBinding:new c("u",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("i",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("b",!a,!1,!1,a),predefined:!0})}k.isFirefox&&
(b.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),b.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),b.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(b.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),b.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(b.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(b.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return b};return{KeyMode:g,DefaultKeyMode:e}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/util".split(","),function(h,k,g,e,c,b){function a(a,b,d,c){typeof a.addEventListener==="function"?a.addEventListener(b,d,c===!0):a.attachEvent("on"+b,d)}function j(a,d,c){if(c){d.className="";for(var c=d.attributes,f=c.length;f-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&c[f].specified)&&d.removeAttribute(c[f].name)}if(a){if(a.styleClass)d.className=
a.styleClass;if(c=a.style)for(var e in c)c.hasOwnProperty(e)&&(d.style[e]=c[e]);if(a=a.attributes)for(var i in a)a.hasOwnProperty(i)&&d.setAttribute(i,a[i])}}function d(a){return a instanceof Array?a.slice(0):a}function f(a,b){if(!a)return b;if(!b)return a;for(var d in b)b.hasOwnProperty(d)&&(a.hasOwnProperty(d)||(a[d]=b[d]));return a}function i(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 d=0;d<a.length;d++)if(!i(a[d],b[d]))return!1;return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)){if(!b.hasOwnProperty(d))return!1;if(!i(a[d],b[d]))return!1}for(d in b)if(!a.hasOwnProperty(d))return!1;return!0}function l(a,b,d){for(var c=0,f=0,e=0,i=a.length;e<i;){c!==-1&&c<=e&&(c=a.indexOf("\r",e));f!==-1&&f<=e&&(f=a.indexOf("\n",e));var j=e,g;if(f===-1&&c===-1){b(a.substring(e));
break}c!==-1&&f!==-1?c+1===f?(g=c,e=f+1):(g=c<f?c:f,e=(c<f?c:f)+1):c!==-1?(g=c,e=c+1):(g=f,e=f+1);b(a.substring(j,g));d()}}function o(a){var b,d,c,f,e=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(e.getComputedStyle)a=e.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),d=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-right"),f=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,d=a.currentStyle.paddingTop,c=a.currentStyle.paddingRight,
f=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(d,10)||0,right:parseInt(c,10)||0,bottom:parseInt(f,10)||0}}function m(a){var b,d,c,f,e=a._trim;if(!e){var e=o(a),i=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(i.getComputedStyle)f=i.getComputedStyle(a,null),b=f.getPropertyValue("border-left-width"),d=f.getPropertyValue("border-top-width"),c=f.getPropertyValue("border-right-width"),f=f.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
d=a.currentStyle.borderTopWidth,c=a.currentStyle.borderRightWidth,f=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;d=parseInt(d,10)||0;c=parseInt(c,10)||0;f=parseInt(f,10)||0;e.left+=b;e.top+=d;e.right+=c;e.bottom+=f;a._trim=e}return e}function s(a,b,d){this.start=a;this.end=b;this.caret=d}function r(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function p(a,b,d){this.view=a;this.lineIndex=b;this._lineDiv=d}function q(a){this._init(a||{})}var t=function(){function a(b){this.options=
b}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,d=this.options.onAnimate||function(){},c=this.options.curve[0],f=this.options.curve[1],e=f-c,i=-1,n,j=this;this.interval=this.options.window.setInterval(function(){i=i===-1?(new Date).getTime():i;var g=((new Date).getTime()-i)/a;g<1?(g=b(g),n=c+g*e,d(n)):(d(f),j.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}();s.prototype={clone:function(){return new s(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}};r.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};p.prototype={create:function(a,b){if(!this._lineDiv){var d=this._lineDiv=this._createLine(a,b,this.lineIndex);d._line=
this;return d}},_createLine:function(a,d,c){var f=this.view,e=f._model,g=e.getLine(c),h=e.getLineStart(c),l={type:"LineStyle",textView:f,lineIndex:c,lineText:g,lineStart:h};if(g.length<2E3)f.onLineStyle(l);e=d||b.createElement(a.ownerDocument,"div");if(!d||!i(d.viewStyle,l.style)){j(l.style,e,d);if(d)d._trim=null;e.viewStyle=l.style;e.setAttribute("role","presentation")}e.lineIndex=c;c=[];this._createRanges(l.ranges,g,0,g.length,h,{tabOffset:0,ranges:c});g=" ";!f._fullSelection&&b.isIE<9&&(g="\ufeff");
b.isWebkit&&(g="\u200c");l={text:g,style:f._metrics.largestFontStyle,ignoreChars:1};c.length===0||!c[c.length-1].style||c[c.length-1].style.tagName!=="div"?c.push(l):c.splice(c.length-1,0,l);var o,m,k,s,p,g=f=0,r,q;if(d){if(m=d.modelChangedEvent)m.removedLineCount===0&&m.addedLineCount===0?(q=m.start-h,r=m.addedCharCount-m.removedCharCount):q=-1,d.modelChangedEvent=void 0;m=d.firstChild}for(h=0;h<c.length;h++){l=c[h];s=l.text;f+=s.length;o=l.style;if(m)if(p=m.firstChild.data,k=m.viewStyle,p===s&&
i(o,k)){g+=p.length;m._rectsCache=void 0;o=m=m.nextSibling;continue}else for(;m;){if(q!==-1){k=f;k>=q&&(k-=r);p=(p=m.firstChild.data)?p.length:0;if(g+p>k)break;g+=p}k=m.nextSibling;e.removeChild(m);m=k}o=this._createSpan(e,s,o,l.ignoreChars);m?e.insertBefore(o,m):e.appendChild(o);if(d)d.lineWidth=void 0}if(d)for(a=o?o.nextSibling:null;a;)k=a.nextSibling,d.removeChild(a),a=k;else a.appendChild(e);return e},_createRanges:function(a,b,d,c,f,e){if(!(d>c)){if(a)for(var j=0;j<a.length;j++){var g=a[j];if(!(g.end<
f+d)){var h=Math.max(f+d,g.start)-f;if(h>c)break;var l=Math.min(f+c,g.end)-f;if(h<=l){h=Math.max(d,h);l=Math.min(c,l);for(d<h&&this._createRange(b,d,h,null,e);j+1<a.length&&a[j+1].start-f===l&&i(g.style,a[j+1].style);)g=a[j+1],l=Math.min(f+c,g.end)-f,j++;this._createRange(b,h,l,g.style,e);d=l}}}d<c&&this._createRange(b,d,c,null,e)}},_createRange:function(a,b,d,c,f){if(!(b>d)){var e=this.view._customTabSize;if(e&&e!==8)for(var i=a.indexOf("\t",b);i!==-1;){b<i&&(b={text:a.substring(b,i),style:c},f.ranges.push(b),
f.tabOffset+=b.text.length);b=e-f.tabOffset%e;if(b>0){for(var j="\u00a0",g=1;g<b;g++)j+=" ";b={text:j,style:c,ignoreChars:b-1};f.ranges.push(b);f.tabOffset+=b.text.length}b=i+1;if(b===d)return;i=a.indexOf("\t",b)}b<=d&&(b={text:a.substring(b,d),style:c},f.ranges.push(b),f.tabOffset+=b.text.length)}},_createSpan:function(d,c,f,e){var i=this.view,g="span";f&&f.tagName&&(g=f.tagName.toLowerCase());var h=g==="a";if(h)d.hasLink=!0;h&&!i._linksVisible&&(g="span");h=d.ownerDocument;d=b.createElement(d.ownerDocument,
g);f&&f.html?(d.innerHTML=f.html,d.ignore=!0):f&&f.node?(d.appendChild(f.node),d.ignore=!0):d.appendChild(h.createTextNode(f&&f.text?f.text:c));j(f,d);if(g==="a"){var l=i._getWindow();a(d,"click",function(a){return i._handleLinkClick(a?a:l.event)},!1)}d.viewStyle=f;if(e)d.ignoreChars=e;return d},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,d){var c=this._ensureCreated(),f=this.view;if(a===void 0)return this._getLineBoundingClientRect(c,
!0);var e=f._model,i=c.ownerDocument,j=this.lineIndex,g=null;if(a<e.getLineEnd(j)){e=e.getLineStart(j);for(j=c.firstChild;j;){if(!j.ignore){var h=j.firstChild,l=h.length;j.ignoreChars&&(l-=j.ignoreChars);if(e+l>a){g=a-e;if(f._isRangeRects)i=i.createRange(),i.setStart(h,g),i.setEnd(h,g+1),g=new r(i.getBoundingClientRect());else if(b.isIE)i=i.body.createTextRange(),i.moveToElementText(j),i.collapse(),i.moveEnd("character",g+1),i.moveStart("character",g),g=new r(i.getBoundingClientRect());else{var m=
h.data;j.removeChild(h);j.appendChild(i.createTextNode(m.substring(0,g)));var o=b.createElement(i,"span");o.appendChild(i.createTextNode(m.substring(g,g+1)));j.appendChild(o);j.appendChild(i.createTextNode(m.substring(g+1)));g=new r(o.getBoundingClientRect());j.innerHTML="";j.appendChild(h);this._createdDiv||(i=f._getSelection(),(e<=i.start&&i.start<e+l||e<=i.end&&i.end<e+l)&&f._updateDOMSelection())}b.isIE&&(i=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,c=i.screen.logicalXDPI/i.screen.deviceXDPI,
i=i.screen.logicalYDPI/i.screen.deviceYDPI,g.left*=c,g.right*=c,g.top*=i,g.bottom*=i);break}e+=l}j=j.nextSibling}}c=this.getBoundingClientRect();if(!g)f._wrapMode?(f=this.getClientRects(),g=f[f.length-1],g.left=g.right,g.left+=c.left,g.top+=c.top,g.right+=c.left,g.bottom+=c.top):(g=new r(c),g.left=g.right);if(d||d===void 0)g.left-=c.left,g.top-=c.top,g.right-=c.left,g.bottom-=c.top;return g},_getClientRects:function(a,b){var d,c,f,e;if(!a._rectsCache){d=a.getClientRects();c=Array(d.length);for(e=
0;e<d.length;e++)f=c[e]=new r(d[e]),f.left-=b.left,f.top-=b.top,f.right-=b.left,f.bottom-=b.top;a._rectsCache=c}d=a._rectsCache;c=[d.length];for(e=0;e<d.length;e++)c[e]=new r(d[e]);return c},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),d=[],c=b.firstChild,f,e=b.getBoundingClientRect();c;){if(!c.ignore)for(var i=this._getClientRects(c,e),b=0;b<i.length;b++){var j=i[b],g;if(j.top!==j.bottom){var h=j.top+(j.bottom-j.top)/2;for(g=
0;g<d.length;g++)if(f=d[g],f.top<=h&&h<f.bottom)break;if(g===d.length)d.push(j);else{if(j.left<f.left)f.left=j.left;if(j.top<f.top)f.top=j.top;if(j.right>f.right)f.right=j.right;if(j.bottom>f.bottom)f.bottom=j.bottom}}}c=c.nextSibling}return a!==void 0?d[a]:d},_getLineBoundingClientRect:function(a,b){var d=new r(a.getBoundingClientRect());if(!this.view._wrapMode){d.right=d.left;for(var c=a.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(c)c=c.getBoundingClientRect(),d.right=
c.right+m(a).right}b&&(c=m(a),d.left+=c.left,d.right-=c.right);return d},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,d=0;d<b.length;d++)if(b[d].top<=a&&a<b[d].bottom)return d;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();
return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(a,d){var c=this.view,f=c._model,e=this.lineIndex,i=f.getLineStart(e),j=f.getLineEnd(e);if(i===j)return i;var g=this._ensureCreated(),h=this.getBoundingClientRect(),l,m;if(c._wrapMode){l=this.getClientRects();if(d<l[0].top)d=l[0].top;for(var o=0;o<l.length;o++)if(m=l[o],m.top<=d&&d<m.bottom)break;if(a<m.left)a=m.left;a>m.right&&(a=m.right-1)}else a<0&&(a=0),a>h.right-h.left&&(a=h.right-h.left);var k=g.ownerDocument,o=k.defaultView||
k.parentWindow,s=b.isIE?o.screen.logicalXDPI/o.screen.deviceXDPI:1,p=b.isIE?o.screen.logicalYDPI/o.screen.deviceYDPI:1,o=i,r=g.firstChild;a:for(;r;){if(!r.ignore){var q=r.firstChild,g=q.length;r.ignoreChars&&(g-=r.ignoreChars);var t,C,D;l=this._getClientRects(r,h);for(var H=0;H<l.length;H++)if(m=l[H],m.left<=a&&a<m.right&&(!c._wrapMode||m.top<=d&&d<m.bottom)){if(b.isIE||c._isRangeRects){for(var k=c._isRangeRects?k.createRange():k.body.createTextRange(),H=g,M=-1;H-M>1;){var J=Math.floor((H+M)/2);l=
M+1;m=J===g-1&&r.ignoreChars?q.length:J+1;c._isRangeRects?(k.setStart(q,l),k.setEnd(q,m)):(k.moveToElementText(r),k.move("character",l),k.moveEnd("character",m-l));l=k.getClientRects();for(var P=!1,N=0;N<l.length;N++)if(m=l[N],t=m.left*s-h.left,D=m.right*s-h.left,C=m.top*p-h.top,m=m.bottom*p-h.top,t<=a&&a<D&&(!c._wrapMode||C<=d&&d<m)){P=!0;break}P?H=J:M=J}o+=H;l=H;m=H===g-1&&r.ignoreChars?q.length:Math.min(H+1,q.length);c._isRangeRects?(k.setStart(q,l),k.setEnd(q,m)):(k.moveToElementText(r),k.move("character",
l),k.moveEnd("character",m-l));m=k.getClientRects()[0];t=m.left*s-h.left;D=m.right*s-h.left;c=a>t+(D-t)/2;h=o-i;f=f.getLine(e);e=f.charCodeAt(h);55296<=e&&e<=56319&&c?h<f.length&&(e=f.charCodeAt(h+1),56320<=e&&e<=57343&&(o+=1)):56320<=e&&e<=57343&&!c&&h>0&&(e=f.charCodeAt(h-1),55296<=e&&e<=56319&&(o-=1));c&&o++}else{f=[];for(e=0;e<g;e++)f.push("<span>"),e===g-1?f.push(q.data.substring(e)):f.push(q.data.substring(e,e+1)),f.push("</span>");r.innerHTML=f.join("");for(f=r.firstChild;f;){m=f.getBoundingClientRect();
t=m.left-h.left;D=m.right-h.left;if(t<=a&&a<D){a>t+(D-t)/2&&o++;break}o++;f=f.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(q),h=c._getSelection(),(o<=h.start&&h.start<o+g||o<=h.end&&h.end<o+g)&&c._updateDOMSelection()}break a}o+=g}r=r.nextSibling}return Math.min(j,Math.max(i,o))},getNextOffset:function(a,d){if(d.unit==="line"){var c=this.view._model,f=c.getLineAtOffset(a);if(d.count>0)return d.count--,c.getLineEnd(f);d.count++;return c.getLineStart(f)}return d.unit==="wordend"||d.unit===
"wordWS"||d.unit==="wordendWS"?this._getNextOffset_W3C(a,d):b.isIE?this._getNextOffset_IE(a,d):this._getNextOffset_W3C(a,d)},_getNextOffset_W3C:function(a,b){function d(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function c(a){return a===32||a===9}var f=this.view._model,e=f.getLineAtOffset(a),i=f.getLine(e),j=f.getLineStart(e),f=f.getLineEnd(e),e=i.length,g=a-j,h,l=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var m,
o,k;b.count!==0;){if(b.count>0){if(g===e)return f;h=i.charCodeAt(g);m=d(h);o=!m&&!c(h);for(g++;g<e;){h=i.charCodeAt(g);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=d(h);if(b.unit==="wordend"){if(!k&&m)break}else if(k&&!m)break;h=!k&&!c(h)}else h=!c(h);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!h&&o)break}else if(h&&!o)break;o=h;m=k;g++}}else{if(g===0)return j;g--;h=i.charCodeAt(g);m=d(h);for(o=!m&&!c(h);0<g;){h=i.charCodeAt(g-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=d(h);if(b.unit===
"wordend"){if(k&&!m)break}else if(!k&&m)break;h=!k&&!c(h)}else h=!c(h);if(b.unit==="wordend"||b.unit==="wordendWS"){if(h&&!o)break}else if(!h&&o)break;o=h;m=k;g--}}b.count-=l}else for(;b.count!==0&&0<=g+l&&g+l<=e;)g+=l,h=i.charCodeAt(g),56320<=h&&h<=57343&&g>0&&(h=i.charCodeAt(g-1),55296<=h&&h<=56319&&(g+=l)),b.count-=l;return j+g},_getNextOffset_IE:function(a,b){var d=this._ensureCreated(),c=this.view._model,f=this.lineIndex,e=0,i;i=c.getLineStart(f);var j=d.ownerDocument,g=b.count<0?-1:1;if(a===
c.getLineEnd(f)){for(d=d.lastChild;d&&d.ignoreChars;)d=d.previousSibling;if(!d)return i;e=j.body.createTextRange();e.moveToElementText(d);i=e.text.length;e.moveEnd(b.unit,g);e=a+e.text.length-i}else if(a===i&&b.count<0)e=i;else for(d=d.firstChild;d;){c=d.firstChild.length;d.ignoreChars&&(c-=d.ignoreChars);if(i+c>a){e=j.body.createTextRange();a===i&&b.count<0?e.moveToElementText(d.previousSibling):(e.moveToElementText(d),e.collapse(),e.moveEnd("character",a-i));i=e.text.length;e.moveEnd(b.unit,g);
e=a+e.text.length-i;break}i=c+i;d=d.nextSibling}b.count-=g;return e},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};q.prototype={addKeyMode:function(a,b){var d=this._keyModes;b!==void 0?d.splice(b,0,a):d.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var d=this._rulers;if(b!==void 0){var c,f;for(c=0,f=0;c<d.length&&f<b;c++)a.getLocation()===d[c].getLocation()&&f++;d.splice(f,0,a);b=f}else d.push(a);this._createRuler(a,
b);this._update()},computeSize:function(){var a=0,d=0,c=this._model,f=this._clientDiv;if(!f)return{width:a,height:d};var e=f.style.width;if(b.isWebkit)f.style.width="0x7fffffffpx";for(var c=c.getLineCount(),i=0;i<c;i++){var j=this._getLine(i),g=j.getBoundingClientRect(),a=Math.max(a,g.right-g.left);d+=g.bottom-g.top;j.destroy()}if(b.isWebkit)f.style.width=e;f=this._getViewPadding();a+=f.right+f.left+this._metrics.scrollWidth;d+=f.bottom+f.top+this._metrics.scrollWidth;return{width:a,height:d}},convert:function(a,
b,d){if(this._clientDiv){var c=this._getScroll(),f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-c.x+e.left+f.left),a.y!==void 0&&(a.y+=-c.y+e.top+f.top));d==="document"&&(a.x!==void 0&&(a.x+=c.x-e.left-f.left),a.y!==void 0&&(a.y+=c.y-e.top-f.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(),b.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],d=this._actions,c;for(c in d)d.hasOwnProperty(c)&&(a||!d[c].defaultHandler)&&b.push(c);return b},getBottomIndex:function(a){return!this._clientDiv?
0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],d=this._keyModes,
c=0;c<d.length;c++)b=b.concat(d[c].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),d=this._getLine(b),
a=d.getBoundingClientRect(a);d.destroy();d=a.left;b=this._getLinePixel(b)+a.top;return{x:d,y:b}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return d(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var c in a)a.hasOwnProperty(c)&&(a[c]=d(this["_"+c]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;
var d=this._getLineIndex(b),c=this._getLine(d),d=c.getOffset(a,b-this._getLinePixel(d));c.destroy();return d},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,d){if(this._clientDiv){if(a=this._actions[a]){if(!b&&
a.handler&&a.handler(d))return!0;if(a.defaultHandler)return typeof a.defaultHandler(d)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},
onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},
onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>
0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var d=this.getRulers(),c=0;c<d.length;c++)this.redrawLines(a,b,d[c])},redrawLines:function(a,b,d){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var c=this._clientDiv;if(c){if(d)for(c=(d.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;c;){if(c._ruler===d)break;c=c.nextSibling}d?c.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!d||d.getOverview()==="page")for(c=c.firstChild;c;){var f=c.lineIndex;if(a<=f&&f<b)c.lineChanged=!0;c=c.nextSibling}if(!d&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var d=this._model;a===void 0&&(a=0);b===void 0&&(b=d.getCharCount());var c=d.getLineAtOffset(a),d=d.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(c,d)}},removeKeyMode:function(a){for(var b=this._keyModes,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,d){if(a){var c=this._actions,f=c[a];f||(f=c[a]={});f.handler=b;if(d!==void 0)f.actionDescription=
d}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,d){var c=this._model.getCharCount(),a=Math.max(0,Math.min(a,c));this._setSelection(new s(a,a,!1),b===void 0||b,!0,d)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);
this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),d=this._model.getCharCount(),c=a.getLineCount(),f=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:d,addedCharCount:f,removedLineCount:b,addedLineCount:c};this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:d,addedCharCount:f,removedLineCount:b,addedLineCount:c};this.onModelChanged(e);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var b=this._defaultOptions(),c;for(c in a)if(a.hasOwnProperty(c)){var f=a[c];if(!i(this["_"+c],f)){var e=b[c]?b[c].update:null;e?e.call(this,f):this["_"+c]=d(f)}}},setSelection:function(a,b,d,c){var f=a>b;if(f)var e=a,a=b,b=e;e=this._model.getCharCount();a=Math.max(0,Math.min(a,e));b=Math.max(0,Math.min(b,e));this._setSelection(new s(a,b,f),
d===void 0||d,!0,c)},setText:function(a,d,c){var f=d===void 0&&c===void 0;d===void 0&&(d=0);c===void 0&&(c=this._model.getCharCount());if(f)this._variableLineHeight=!1;this._modifyContent({text:a,start:d,end:c,_code:!0},!f);if(f)this._columnX=-1,this._setSelection(new s(0,0,!1),!0),b.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&(a&&this._updateStyle(),b===void 0||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(!this._ignoreEvent(a)){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var d=this._overlayDiv||this._clientDiv;if(b.isIE<9)d=this._viewDiv;for(var c=a.target?a.target:a.srcElement;c;){if(d===c)return;
c=c.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var f=this;this._getWindow().setTimeout(function(){f._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&b.isFirefox&&a.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(b.isIE<9&&!this._getSelection().isEmpty()){var a=
this._rootDiv,d=b.createElement(a.ownerDocument,"div");a.appendChild(d);a.removeChild(d)}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",a=this._getWindow(),d=this._selDiv1.ownerDocument,a.getSelection){d=a.getSelection();for(a=d.anchorNode;a;){if(a===this._clientDiv){d.rangeCount>0&&d.removeAllRanges();break}a=a.parentNode}}else if(d.selection){this._ignoreSelect=
!1;for(a=d.selection.createRange().parentElement();a;){if(a===this._clientDiv){d.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var d=!1;this.isListening("ContextMenu")?(d=this._createMouseEvent("ContextMenu",a),d.screenX=a.screenX,d.screenY=a.screenY,this.onContextMenu(d),d=d.defaultPrevented):b.isMac&&b.isFirefox&&
a.button===0&&(d=!0);if(d)return a.preventDefault&&a.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(a){if(!this._ignoreEvent(a)){if(b.isFirefox){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.contentEditable=!0;d._clientDiv.draggable=!1;d._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var d=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(d=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
a)));if(b.isWebkit||d)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var d=!0;this.isListening("DragOver")&&(d=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||d){if(d)a.dataTransfer.dropEffect="none";a.preventDefault&&a.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;b.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 a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=
a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var d=this._createKeyEvent("KeyDown",a);this.onKeyDown(d);if(d.defaultPrevented){if(b.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}d=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:d=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;d=!0;if(b.isSafari&&b.isMac&&
a.ctrlKey)d=!1,a.keyCode=129;d&&this._startIME()}else d||this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(b.isMac&&b.isWebkit&&(63232<=
a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var d=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&d)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(d=this._createKeyEvent("KeyPress",a),this.onKeyPress(d),d.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?
(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;d=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)d=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)d=!0}else a.ctrlKey^a.altKey&&(d=!0);if(!d&&(d=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,d>31))return this._doContent(String.fromCharCode(d)),a.preventDefault&&a.preventDefault(),!1}},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var d=this._createKeyEvent("KeyUp",a);
this.onKeyUp(d);if(d.defaultPrevented){a.preventDefault();return}}(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var d=this._getWindow(),c=!0,f=d;if(b.isIE||b.isFirefox&&!this._overlayDiv)f=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var e=this;d.setTimeout(function(){e.focus();e._ignoreFocus=
!1},0)}this._clickCount===1?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(f):(this._isW3CEvents&&this._setGrab(f),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return c},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if((a.target||a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var d=a.which;d||(a.button===4&&(d=2),a.button===2&&(d=3),a.button===1&&(d=1));var c=d!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),f=c-this._lastMouseTime,e=Math.abs(this._lastMouseX-a.clientX),i=Math.abs(this._lastMouseY-a.clientY),j=this._lastMouseButton===d;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=c;this._lastMouseButton=d;if(d===1)this._isMouseDown=!0,j&&f<=this._clickTime&&e<=this._clickDist&&i<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(c=this._createMouseEvent("MouseDown",a),this.onMouseDown(c),c.defaultPrevented)){a.preventDefault();return}if(d===1&&this._handleMouse(a)&&(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.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(a){if(!this._animation){var d=this._isClientDiv(a);if(this.isListening("MouseMove")&&d)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(c&&!this._isMouseDown&&(b.isMac?
a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&d)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var d=a.clientX,a=a.clientY,f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),i=this._getClientWidth(),j=this._getClientHeight(),c=e.left+f.left,g=e.top+f.top,i=e.left+f.left+i,f=e.top+f.top+j;a<g?this._doAutoScroll("up",
d,a-g):a>f?this._doAutoScroll("down",d,a-f):d<c&&!this._wrapMode?this._doAutoScroll("left",d-c,a):d>i&&!this._wrapMode?this._doAutoScroll("right",d-i,a):(this._endAutoScroll(),this._setSelectionTo(d,a,!0))}}}},_isClientDiv:function(a){for(var b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var d=
this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:d.x,y:d.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var d=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||d&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible&&d&&this._isMouseDown){if(this._dragOffset!==-1)d=this._getSelection(),d.extend(this._dragOffset),d.collapse(),
this._setSelection(d,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var d=this._getLineHeight(),c=0,f=0;b.isIE||b.isOpera?f=-a.wheelDelta/40*d:b.isFirefox?(d=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*d,a.axis===a.HORIZONTAL_AXIS?c=d:f=d):b.isMac?(f=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=a.wheelDeltaX%120!==0?1:f<40?40/(40-f):40,f=
a.wheelDeltaY%120!==0?1:f<40?40/(40-f):40,c=Math.ceil(-a.wheelDeltaX/c),-1<c&&c<0&&(c=-1),0<c&&c<1&&(c=1),f=Math.ceil(-a.wheelDeltaY/f),-1<f&&f<0&&(f=-1),0<f&&f<1&&(f=1)):(c=-a.wheelDeltaX,f=-a.wheelDeltaY/120*8*d);if(b.isSafari){for(d=a.target;d&&d.lineIndex===void 0;)d=d.parentNode;this._mouseWheelLine=d}d=this._getScroll();this._scrollView(c,f);c=this._getScroll();if(d.x!==c.x||d.y!==c.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&
this._doPaste(a)){if(b.isIE){var d=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){d._updateDOMSelection();d._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,d=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==d)this._parentWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=d,b.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,d=b.lineIndex;b&&!b._ruler;){if(d===void 0&&b.lineIndex!==void 0)d=b.lineIndex;b=b.parentNode}b=b?b._ruler:null;if(d===void 0&&b&&b.getOverview()==="document"){var d=this._getClientHeight(),c=this._model.getLineCount(),f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),d=Math.floor((a.clientY-e.top-this._metrics.scrollWidth)*c/(d+f.top+f.bottom-2*this._metrics.scrollWidth));0<=d&&d<c||(d=void 0)}if(b)switch(a.type){case "click":if(b.onClick)b.onClick(d,
a);break;case "dblclick":if(b.onDblClick)b.onDblClick(d,a);break;case "mousemove":if(b.onMouseMove)b.onMouseMove(d,a);break;case "mouseover":if(b.onMouseOver)b.onMouseOver(d,a);break;case "mouseout":if(b.onMouseOut)b.onMouseOut(d,a)}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,d=this._vScroll;if(b!==a.x||d!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(d===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:d},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var d;d=a.tagName==="DIV"?a:a.parentNode.parentNode;var c=0,f=d.lineIndex;if(a.tagName!=="DIV")for(d=d.firstChild;d;){var e=d.firstChild;if(e===a){d.ignoreChars&&(c-=d.ignoreChars);c+=b;break}d.ignoreChars&&(c-=d.ignoreChars);c+=e.data.length;d=d.nextSibling}return Math.max(0,c)+this._model.getLineStart(f)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new s(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var d=this;this._selTimer=a.setTimeout(function(){if(d._clientDiv)d._selTimer=null,d._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;if(b.isAndroid){for(var d=
this._getWindow().getSelection(),c=d.anchorNode;c;){if(c.lineIndex!==void 0)break;c=c.parentNode}if(c){var f=this._model,e=c.lineIndex,i=f.getLine(e),j=i,g=0,f=f.getLineStart(e);if(d.rangeCount>0)d.getRangeAt(0).deleteContents(),e=c.ownerDocument.createTextNode(a.data),d.getRangeAt(0).insertNode(e),g=this._getDOMText(c,e),j=g.text,g=g.offset,e.parentNode.removeChild(e);c.lineRemoved=!0;for(c=0;i.charCodeAt(c)===j.charCodeAt(c)&&c<g;)c++;d=i.length-1;for(e=j.length-i.length;i.charCodeAt(d)===j.charCodeAt(d+
e)&&d+e>=g+a.data.length;)d--;d++;i=j.substring(c,d+e);c+=f;d+=f;this._modifyContent({text:i,start:c,end:d,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var d=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",d.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var c=a.touches;if(c.length===1){var c=c[0],f=c.clientX,e=c.clientY;this._touchStartX=
f;this._touchStartY=e;if(b.isAndroid&&(e<c.pageY-d.pageYOffset||f<c.pageX-d.pageXOffset))f=c.pageX-d.pageXOffset,e=c.pageY-d.pageYOffset;d=this.convert({x:f,y:e},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(d.x,d.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var d=this,c=this._getWindow();this._touchScrollTimer=c.setInterval(function(){var a=0,b=0;if(d._touching)a=d._touchStartX-d._touchCurrentX,b=d._touchStartY-d._touchCurrentY,d._touchSpeedX=a/10,d._touchSpeedY=b/10,d._touchStartX=d._touchCurrentX,d._touchStartY=d._touchCurrentY;else if(Math.abs(d._touchSpeedX)<0.1&&Math.abs(d._touchSpeedY)<0.1){d._vScrollDiv.style.display="none";d._hScrollDiv.style.display="none";c.clearInterval(d._touchScrollTimer);
d._touchScrollTimer=null;return}else a=d._touchSpeedX*10,b=d._touchSpeedY*10,d._touchSpeedX*=0.95,d._touchSpeedY*=0.95;d._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,d,c=this._keyModes;for(d=c.length-1;d>=0;d--)if(b=c[d],typeof b.match==="function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var d=this._model,c=b.getCaret(),f=d.getLineAtOffset(c);
if(!a.count)a.count=1;for(;a.count!==0;){var e=d.getLineStart(f);if(a.count<0&&c===e)if(f>0)a.unit==="character"&&a.count++,f--,b.extend(d.getLineEnd(f));else break;else if(a.count>0&&c===d.getLineEnd(f))if(f+1<d.getLineCount())a.unit==="character"&&a.count--,f++,b.extend(d.getLineStart(f));else break;else{var i=!1;a.expandTab&&a.unit==="character"&&(c-e)%this._tabSize===0&&(i=!/[^ ]/.test(d.getText(e,c)));i?(b.extend(c-this._tabSize),a.count+=a.count<0?1:-1):(e=this._getLine(f),b.extend(e.getNextOffset(c,
a)),e.destroy())}c=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var d=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":d=d.toLowerCase();break;case "capitalize":d=d.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(b=0;b<d.length;b++){var c=d[b],f=c.toLowerCase(),c=f!==c?f:c.toUpperCase();a+=c}d=a;break;default:d=d.toUpperCase()}this._doContent(d);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var d=this._model,c=d.getLineAtOffset(b.end);b.end<d.getLineEnd(c)&&(d=this._getLine(c),b.extend(d.getNextOffset(b.getCaret(),{unit:"character",count:1})),d.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);
return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),d=this._model,c;if(a.ctrl)b.extend(d.getCharCount()),c=function(){};else{var f=b.getCaret(),e=d.getLineAtOffset(f);if(this._wrapMode){var i=this._getLine(e),
f=i.getLineIndex(f),f=f===i.getLineCount()-1?d.getLineEnd(e):i.getLineStart(f+1)-1;i.destroy()}else a.count&&a.count>0&&(e=Math.min(e+a.count-1,d.getLineCount()-1)),f=d.getLineEnd(e);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doEnter:function(a){var b=this._model,d=this._getSelection();this._doContent(b.getLineDelimiter());if(a&&a.noCursor)d.end=d.start,this._setSelection(d,!0);return!0},_doHome:function(a){var b=this._getSelection(),d=this._model,c;if(a.ctrl)b.extend(0),
c=function(){};else{var f=b.getCaret(),e=d.getLineAtOffset(f);this._wrapMode?(d=this._getLine(e),f=d.getLineIndex(f),f=d.getLineStart(f),d.destroy()):f=d.getLineStart(e);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doLineDown:function(a){var d=this._model,c=this._getSelection(),f=c.getCaret(),e=d.getLineAtOffset(f),i=this._getLine(e),j=this._columnX,g=1,h=!1;if(j===-1||a.wholeLine||a.select&&b.isIE)j=a.wholeLine?d.getLineEnd(e+1):f,j=i.getBoundingClientRect(j).left;
(f=i.getLineIndex(f))<i.getLineCount()-1?g=i.getClientRects(f+1).top+1:(f=d.getLineCount()-1,h=e===f,a.count&&a.count>0?e=Math.min(e+a.count,f):e++);f=!1;if(h){if(a.select||b.isMac||b.isLinux)c.extend(d.getCharCount()),f=!0}else i.lineIndex!==e&&(i.destroy(),i=this._getLine(e)),c.extend(i.getOffset(j,g)),f=!0;f&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=j;i.destroy();return!0},_doLineUp:function(a){var d=this._model,c=this._getSelection(),f=c.getCaret(),e=d.getLineAtOffset(f),
i=this._getLine(e),j=this._columnX,g=!1,h;if(j===-1||a.wholeLine||a.select&&b.isIE)j=a.wholeLine?d.getLineStart(e-1):f,j=i.getBoundingClientRect(j).left;(f=i.getLineIndex(f))>0?h=i.getClientRects(f-1).top+1:(g=e===0,g||(a.count&&a.count>0?e=Math.max(e-a.count,0):e--,h=this._getLineHeight(e)-1));f=!1;if(g){if(a.select||b.isMac||b.isLinux)c.extend(0),f=!0}else i.lineIndex!==e&&(i.destroy(),i=this._getLine(e)),c.extend(i.getOffset(j,h)),f=!0;f&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=
j;i.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var d=this,c=this._model,f=this._getSelection(),e=f.getCaret(),i=c.getLineAtOffset(e),j=c.getLineCount(),g=this._getScroll(),c=this._getClientHeight(),h,l;if(this._lineHeight){h=this._columnX;g=this._getBoundsAtOffset(e);if(h===-1||a.select&&b.isIE)h=g.left;e=this._getLineIndex(g.top+c);l=this._getLine(e);i=this._getLinePixel(e);e=l.getOffset(h,g.top+c-i);c=l.getBoundingClientRect(e);l.destroy();f.extend(e);a.select||f.collapse();
this._setSelection(f,!0,!0,function(){d._columnX=h},c.top+i-g.top);return!0}if(i<j-1){var m=this._getLineHeight(),o=Math.min(j-i-1,Math.floor(c/m)),o=Math.max(1,o);h=this._columnX;if(h===-1||a.select&&b.isIE)l=this._getLine(i),h=l.getBoundingClientRect(e).left,l.destroy();l=this._getLine(i+o);f.extend(l.getOffset(h,0));l.destroy();a.select||f.collapse();a=j*m;e=g.y+o*m;e+c>a&&(e=a-c);this._setSelection(f,!0,!0,function(){d._columnX=h},e-g.y)}return!0},_doPageUp:function(a){var d=this,c=this._model,
f=this._getSelection(),e=f.getCaret(),i=c.getLineAtOffset(e),j=this._getScroll(),g=this._getClientHeight(),h;if(this._lineHeight){h=this._columnX;j=this._getBoundsAtOffset(e);if(h===-1||a.select&&b.isIE)h=j.left;e=this._getLineIndex(j.bottom-g);c=this._getLine(e);i=this._getLinePixel(e);e=c.getOffset(h,j.bottom-g-i);g=c.getBoundingClientRect(e);c.destroy();f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){d._columnX=h},g.top+i-j.top);return!0}if(i>0){var l=this._getLineHeight(),
g=Math.max(1,Math.min(i,Math.floor(g/l)));h=this._columnX;if(h===-1||a.select&&b.isIE)c=this._getLine(i),h=c.getBoundingClientRect(e).left,c.destroy();c=this._getLine(i-g);f.extend(c.getOffset(h,this._getLineHeight(i-g)-1));c.destroy();a.select||f.collapse();a=Math.max(0,j.y-g*l);this._setSelection(f,!0,!0,function(){d._columnX=h},a-j.y)}return!0},_doPaste:function(a){var d=this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&d._lastMouseButton===2&&(new Date).getTime()-d._lastMouseTime<=
d._clickTime&&d._setSelectionTo(d._lastMouseX,d._lastMouseY),d._doContent(a))})!==null},_doScroll:function(a){var b=a.type,d=this._model,c=d.getLineCount(),a=this._getClientHeight(),f=this._getLineHeight();c*=f;var e=this._getScroll().y,i;switch(b){case "textStart":i=0;break;case "textEnd":i=c-a;break;case "pageDown":i=e+a;break;case "pageUp":i=e-a;break;case "lineDown":i=e+f;break;case "lineUp":i=e-f;break;case "centerLine":b=this._getSelection(),i=d.getLineAtOffset(b.start),d=(d.getLineAtOffset(b.end)-
i+1)*f,i=i*f-a/2+d/2}i!==void 0&&(i=Math.min(Math.max(0,i),c-a),this._scrollViewAnimated(0,i-e,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),d=b.getLineAtOffset(a),b=b.getLineStart(d),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);
return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=this._model,d=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),f=d.getCaret(),
e=a.getLineCount(),i=a.getLineAtOffset(f),j;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")f=this._autoScrollY/this._getLineHeight(),f=f<0?Math.floor(f):Math.ceil(f),j=Math.max(0,Math.min(e-1,i+f));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")j=this._getLineIndex(c.y),i=this._getLine(i),c.x+=i.getBoundingClientRect(f,!1).left,i.destroy();j===0&&(b.isMac||b.isLinux)?d.extend(0):j===e-1&&(b.isMac||b.isLinux)?d.extend(a.getCharCount()):(i=this._getLine(j),d.extend(i.getOffset(c.x,
c.y-this._getLinePixel(j))),i.destroy());this._setSelection(d,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),d=0;if(a){for(var a=0,c=(new Date).getTime(),f=0;d<b;)if(this._lineHeight[d]||(a++,f||(f=d),this._lineHeight[d]=this._calculateLineHeight(d)),d++,(new Date).getTime()-
c>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(d!==b){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,d=a.ownerDocument,
c=b.createElement(d,"div");c.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);j(f.style,c);c.style.position="fixed";c.style.left="-1000px";var e=b.createElement(d,"span");e.appendChild(d.createTextNode(" "));c.appendChild(e);var i=b.createElement(d,"span");i.style.fontStyle="italic";i.appendChild(d.createTextNode(" "));c.appendChild(i);var g=b.createElement(d,"span");g.style.fontWeight="bold";g.appendChild(d.createTextNode(" "));
c.appendChild(g);f=b.createElement(d,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(d.createTextNode(" "));c.appendChild(f);a.appendChild(c);var h=c.getBoundingClientRect(),e=e.getBoundingClientRect(),i=i.getBoundingClientRect(),g=g.getBoundingClientRect(),f=f.getBoundingClientRect(),e=e.bottom-e.top,i=i.bottom-i.top,g=g.bottom-g.top,l=f.bottom-f.top,k=0,f=h.bottom-h.top<=0,h=Math.max(1,h.bottom-h.top);i>e&&(k=1);g>i&&(k=2);l>g&&(k=3);var s;if(k!==0){s={style:{}};if((k&
1)!==0)s.style.fontStyle="italic";if((k&2)!==0)s.style.fontWeight="bold"}e=m(c);a.removeChild(c);i=o(this._viewDiv);c=b.createElement(d,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=i.left+"px";c.style.paddingTop=i.top+"px";c.style.paddingRight=i.right+"px";c.style.paddingBottom=i.bottom+"px";c.style.width="100px";c.style.height="100px";g=b.createElement(d,"div");g.style.width="100%";g.style.height="100%";c.appendChild(g);a.appendChild(c);d=c.getBoundingClientRect();i=
g.getBoundingClientRect();c.style.overflow="hidden";g.style.height="200px";g=c.clientWidth;c.style.overflow="scroll";l=c.clientWidth;a.removeChild(c);i={left:i.left-d.left,top:i.top-d.top,right:d.right-i.right,bottom:d.bottom-i.bottom};return{lineHeight:h,largestFontStyle:s,lineTrim:e,viewPadding:i,scrollWidth:g-l,invalid:f}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;a===
"next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),d=a.getLineStart(b),c=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),d=this._imeOffset-d,a=d+c.length-a.length;d!==a&&this._doContent(c.substring(d,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new g.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!1}))},actionDescription:{name:h.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!1}))},actionDescription:{name:h.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,
{select:!1,unit:"character"}))},actionDescription:{name:h.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"character"}))},actionDescription:{name:h.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(f(b,{select:!1}))},actionDescription:{name:h.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(f(b,{select:!1}))},actionDescription:{name:h.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageUp"}))},
actionDescription:{name:h.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageDown"}))},actionDescription:{name:h.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"lineUp"}))},actionDescription:{name:h.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(f(b,{type:"lineDown"}))},actionDescription:{name:h.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!1,
unit:"word"}))},actionDescription:{name:h.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"word"}))},actionDescription:{name:h.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!0}))},actionDescription:{name:h.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!1,ctrl:!0}))},actionDescription:{name:h.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textStart"}))},
actionDescription:{name:h.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textEnd"}))},actionDescription:{name:h.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(f(b,{type:"centerLine"}))},actionDescription:{name:h.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!0}))},actionDescription:{name:h.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0}))},actionDescription:{name:h.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!0,ctrl:!1}))},actionDescription:{name:h.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!0,ctrl:!1}))},
actionDescription:{name:h.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(f(b,{select:!0}))},actionDescription:{name:h.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(f(b,
{select:!0}))},actionDescription:{name:h.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(f(b,
{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"character"}))},actionDescription:{name:h.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"character"}))},actionDescription:{name:h.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"word"}))},actionDescription:{name:h.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(f(b,
{unit:"word"}))},actionDescription:{name:h.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"line"}))},actionDescription:{name:h.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"line"}))},actionDescription:{name:h.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:h.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:h.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:h.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(f(b,{noCursor:!0}))},actionDescription:{name:h.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:h.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:h.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:h.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:h.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(f(b,{type:"upper"}))},actionDescription:{name:h.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(f(b,{type:"lower"}))},actionDescription:{name:h.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(f(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:h.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(f(b,{type:"reverse"}))},actionDescription:{name:h.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:h.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:h.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:h.toggleWrapMode}}}},_createRuler:function(a,d){if(this._clientDiv){var c=a.getLocation()==="left"?this._leftDiv:this._rightDiv;c.style.display="block";var f=b.createElement(c.ownerDocument,"div");f._ruler=a;f.rulerChanged=!0;f.style.position="relative";f.style.cssFloat=
"left";f.style.styleFloat="left";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";if(d===void 0||d<0||d>=c.children.length)c.appendChild(f);else{for(var e=c.firstChild;e&&--d>0;)e=e.nextSibling;c.insertBefore(f,e)}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var d=a.ownerDocument,c=b.createElement(d,"div");this._rootDiv=c;c.tabIndex=-1;c.style.position="relative";c.style.overflow="hidden";
c.style.width="100%";c.style.height="100%";c.style.overflow="hidden";c.style.WebkitTextSizeAdjust="100%";c.setAttribute("role","application");a.appendChild(c);a=b.createElement(d,"div");a.className="textviewLeftRuler";this._leftDiv=a;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");c.appendChild(a);
a=b.createElement(d,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;a.style.overflow="auto";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";a.style.background="transparent";if(b.isMac&&b.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";c.appendChild(a);var f=b.createElement(d,"div");f.className="textviewRightRuler";this._rightDiv=f;f.tabIndex=-1;f.style.display="none";f.style.overflow=
"hidden";f.style.MozUserSelect="none";f.style.WebkitUserSelect="none";f.style.position="absolute";f.style.top="0px";f.style.bottom="0px";f.style.cursor="default";f.style.right="0px";f.setAttribute("aria-hidden","true");c.appendChild(f);this._scrollDiv=f=b.createElement(d,"div");f.style.margin="0px";f.style.borderWidth="0px";f.style.padding="0px";a.appendChild(f);if(b.isFirefox)this._clipboardDiv=a=b.createElement(d,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",c.appendChild(a);
if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(d,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",c.appendChild(a),this._clipScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.height="1px",f.style.top="-1000px",f.style.background="transparent",a.appendChild(f);this._setFullSelection(this._fullSelection,!0);a=b.createElement(d,"div");a.className="textviewContent";
this._clientDiv=a;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||c).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",
f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.width="8px",f.style.display="none",c.appendChild(f),this._hScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",
f.style.outline="none",f.style.zIndex="3",f.style.height="8px",f.style.display="none",c.appendChild(f);if(b.isFirefox&&!a.setCapture)this._overlayDiv=d=b.createElement(d,"div"),d.style.position=a.style.position,d.style.borderWidth=a.style.borderWidth,d.style.margin=a.style.margin,d.style.padding=a.style.padding,d.style.cursor="text",d.style.zIndex="2",(this._clipDiv||c).appendChild(d);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,
!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._hookEvents();c=this._rulers;for(d=0;d<c.length;d++)this._createRuler(c[d]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,
update:this._setTabSize},expandTab:{value:!1,update:null},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:c.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(b)for(var d=b.firstChild;d;){if(d._ruler===a){d._ruler=
void 0;b.removeChild(d);if(b.children.length===0)b.style.display="none";break}d=d.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,d){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=d;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var d=this._model;d.getBaseModel&&(a=d.mapOffset(a),b=d.mapOffset(b),d=d.getBaseModel());return d.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._clientDiv.getBoundingClientRect();a.bottom>d.bottom&&(b=this._getLinePrevious(b)||
b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),d=this._getLinePixel(b.lineIndex);a.top+=d;a.bottom+=d;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,d){var c=this._model.getLineDelimiter(),
f,e,i=this._getWindow();if(i.clipboardData)return f=[],e=i.clipboardData.getData("Text"),l(e,function(a){f.push(a)},function(){f.push(c)}),e=f.join(""),d&&d(e),e;if(b.isFirefox){this._ignoreFocus=!0;var j=this._clipboardDiv;j.innerHTML="<pre contenteditable=''></pre>";j.firstChild.focus();var g=this,h=function(){var a=g._getTextFromElement(j);j.innerHTML="";f=[];l(a,function(a){f.push(a)},function(){f.push(c)});return f.join("")},m=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{m=
j.ownerDocument.execCommand("paste",!1,null)}catch(o){m=j.childNodes.length>1||j.firstChild&&j.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!m)return a?(i.setTimeout(function(){g.focus();(e=h())&&d&&d(e);g._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(e=h())&&d&&d(e);return e}return a&&a.clipboardData?(f=[],e=a.clipboardData.getData("text/plain"),l(e,function(a){f.push(a)},function(){f.push(c)}),(e=f.join(""))&&d&&d(e),e):""},_getDOMText:function(a,
b){for(var d=a.firstChild,c="",f=0;d;){var e;if(!d.ignore)if(d.ignoreChars){e=d.lastChild;for(var i=0,j=[],g=-1;e;){for(var h=e.data,l=h.length-1;l>=0;l--){var m=h.substring(l,l+1);i<d.ignoreChars&&(m===" "||m==="\u200c"||m==="\ufeff")?i++:j.push(m==="\u00a0"?"\t":m)}if(b===e)g=j.length;e=e.previousSibling}j=j.reverse().join("");g!==-1&&(f=c.length+j.length-g);c+=j}else for(e=d.firstChild;e;){if(b===e)f=c.length;c+=e.data;e=e.nextSibling}d=d.nextSibling}return{text:c,offset:f}},_getTextFromElement:function(a){var b=
a.ownerDocument,d=b.defaultView;if(!d.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);var a=d.getSelection(),d=[],c;for(c=0;c<a.rangeCount;c++)d.push(a.getRangeAt(c));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(c=0;c<d.length;c++)a.addRange(d[c]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?
b._line:new p(this,a)},_getLineHeight:function(a,b){if(a!==void 0&&this._lineHeight){var d=this._lineHeight[a];if(d)return d;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),d=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)d+=this._getLineHeight(b);else for(b-=1;b>=a;b--)d-=this._getLineHeight(b);return d}return this._getLineHeight()*a},_getLineIndex:function(a){var b,d=0,c=this._model.getLineCount();if(this._lineHeight){var d=this._getTopIndex(),
f=-this._topIndexY+this._getScroll().y;if(a!==f)if(a<f)for(;a<f&&d>0;)a+=this._getLineHeight(--d);else for(b=this._getLineHeight(d);a-b>=f&&d<c-1;)a-=b,b=this._getLineHeight(++d)}else b=this._getLineHeight(),d=Math.floor(a/b);return Math.max(0,Math.min(c-1,d))},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect();a.top<c.top+d.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var d=this;this._modelListener={onChanging:function(a){d._onModelChanging(a)},onChanged:function(a){d._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){d._setThemeClass(d._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var c=this._handlers=[],f=this._clientDiv,e=this._viewDiv,i=this._rootDiv,j=this._overlayDiv||f,g=f.ownerDocument,h=this._getWindow(),l=b.isIE?g:h;c.push({target:h,type:"resize",handler:function(a){return d._handleResize(a?a:h.event)}});c.push({target:f,type:"blur",handler:function(a){return d._handleBlur(a?a:h.event)}});c.push({target:f,type:"focus",handler:function(a){return d._handleFocus(a?
a:h.event)}});c.push({target:e,type:"focus",handler:function(){f.focus()}});c.push({target:e,type:"scroll",handler:function(a){return d._handleScroll(a?a:h.event)}});c.push({target:f,type:"textInput",handler:function(a){return d._handleTextInput(a?a:h.event)}});c.push({target:f,type:"keydown",handler:function(a){return d._handleKeyDown(a?a:h.event)}});c.push({target:f,type:"keypress",handler:function(a){return d._handleKeyPress(a?a:h.event)}});c.push({target:f,type:"keyup",handler:function(a){return d._handleKeyUp(a?
a:h.event)}});c.push({target:f,type:"contextmenu",handler:function(a){return d._handleContextMenu(a?a:h.event)}});c.push({target:f,type:"copy",handler:function(a){return d._handleCopy(a?a:h.event)}});c.push({target:f,type:"cut",handler:function(a){return d._handleCut(a?a:h.event)}});c.push({target:f,type:"paste",handler:function(a){return d._handlePaste(a?a:h.event)}});if(b.isIOS||b.isAndroid)c.push({target:g,type:"selectionchange",handler:function(a){return d._handleSelectionChange(a?a:h.event)}}),
c.push({target:f,type:"touchstart",handler:function(a){return d._handleTouchStart(a?a:h.event)}}),c.push({target:f,type:"touchmove",handler:function(a){return d._handleTouchMove(a?a:h.event)}}),c.push({target:f,type:"touchend",handler:function(a){return d._handleTouchEnd(a?a:h.event)}});else{c.push({target:f,type:"selectstart",handler:function(a){return d._handleSelectStart(a?a:h.event)}});c.push({target:f,type:"mousedown",handler:function(a){return d._handleMouseDown(a?a:h.event)}});c.push({target:f,
type:"mouseover",handler:function(a){return d._handleMouseOver(a?a:h.event)}});c.push({target:f,type:"mouseout",handler:function(a){return d._handleMouseOut(a?a:h.event)}});c.push({target:l,type:"mouseup",handler:function(a){return d._handleMouseUp(a?a:h.event)}});c.push({target:l,type:"mousemove",handler:function(a){return d._handleMouseMove(a?a:h.event)}});c.push({target:i,type:"mousedown",handler:function(a){return d._handleRootMouseDown(a?a:h.event)}});c.push({target:i,type:"mouseup",handler:function(a){return d._handleRootMouseUp(a?
a:h.event)}});c.push({target:j,type:"dragstart",handler:function(a){return d._handleDragStart(a?a:h.event)}});c.push({target:j,type:"drag",handler:function(a){return d._handleDrag(a?a:h.event)}});c.push({target:j,type:"dragend",handler:function(a){return d._handleDragEnd(a?a:h.event)}});c.push({target:j,type:"dragenter",handler:function(a){return d._handleDragEnter(a?a:h.event)}});c.push({target:j,type:"dragover",handler:function(a){return d._handleDragOver(a?a:h.event)}});c.push({target:j,type:"dragleave",
handler:function(a){return d._handleDragLeave(a?a:h.event)}});c.push({target:j,type:"drop",handler:function(a){return d._handleDrop(a?a:h.event)}});c.push({target:this._clientDiv,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?a:h.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(e=h.MutationObserver||h.MozMutationObserver)?(this._mutationObserver=new e(function(a){d._handleDataModified(a)}),this._mutationObserver.observe(f,{subtree:!0,characterData:!0})):
c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return d._handleDataModified(a?a:h.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return d._handleMouseDown(a?a:h.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return d._handleMouseOver(a?a:h.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return d._handleMouseOut(a?a:h.event)}}),c.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return d._handleContextMenu(a?a:h.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(a){return d._handleDblclick(a?a:h.event)}})}e=this._leftDiv;i=this._rightDiv;b.isIE&&c.push({target:e,type:"selectstart",handler:function(){return!1}});c.push({target:e,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?a:h.event)}});c.push({target:e,type:"click",handler:function(a){d._handleRulerEvent(a?
a:h.event)}});c.push({target:e,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:e,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:e,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:e,type:"mouseout",handler:function(a){d._handleRulerEvent(a?a:h.event)}});b.isIE&&c.push({target:i,type:"selectstart",handler:function(){return!1}});c.push({target:i,type:b.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return d._handleMouseWheel(a?a:h.event)}});c.push({target:i,type:"click",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:i,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:i,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:i,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:h.event)}});c.push({target:i,type:"mouseout",handler:function(a){d._handleRulerEvent(a?a:h.event)}});
for(e=0;e<c.length;e++)i=c[e],a(i.target,i.type,i.handler,i.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var d=a.parent;typeof d==="string"&&(d=(a.document||document).getElementById(d));if(!d)throw"no parent";a.parent=d;a.model=a.model||new k.TextModel;var c=this._defaultOptions(),f;for(f in c)c.hasOwnProperty(f)&&
(this["_"+f]=a[f]!==void 0?a[f]:c[f].value);this._keyModes=[];this._rulers=[];this._selection=new s(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=(!b.isIE||b.isIE>=9)&&typeof d.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=d.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=
50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var d=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;d.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(d=this._getSelection(),d.setCaret(a.start+a.text.length),this._setSelection(d,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,d=a.addedCharCount,c=a.removedCharCount,f=a.addedLineCount,e=a.removedLineCount,i=this._getSelection();i.end>b&&(i.end>b&&i.start<b+c?i.setCaret(b+d):(i.start+=d-c,i.end+=d-c),this._setSelection(i,
!1,!1));b=this._model.getLineAtOffset(b);for(d=this._getLineNext();d;){c=d.lineIndex;if(b<=c&&c<=b+e)b===c&&!d.modelChangedEvent&&!d.lineRemoved?(d.modelChangedEvent=a,d.lineChanged=!0):(d.lineRemoved=!0,d.lineChanged=!1,d.modelChangedEvent=null);if(c>b+e)d.lineIndex=c+f-e,d._line.lineIndex=d.lineIndex;d=this._getLineNext(d)}this._lineHeight&&(a=[b,e].concat(Array(f)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+e)this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var d=a;d<b;d++)this._lineHeight[d]=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 s(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var a=this._clientDiv;if(a){for(var d=a.firstChild;d;)d.lineRemoved=!0,d=d.nextSibling;if(b.isFirefox)this._ignoreFocus=!1,(d=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,d&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,d){if(d&&this._scrollAnimation){var c=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);c._scrollView(0,a);b-=a},onEnd:function(){c._animation=null;c._scrollView(a,
b);d&&d()}});this._animation.play()}else this._scrollView(a,b),d&&d()},_scrollView:function(a,b){this._ensureCaretVisible=!1;var d=this._viewDiv;a&&(d.scrollLeft+=a);b&&(d.scrollTop+=b)},_setClipboardText:function(a,d){var c,f=this._parent.ownerDocument,e=this._getWindow();if(e.clipboardData)return c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),e.clipboardData.setData("Text",c.join(""));if(d&&d.clipboardData&&(c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),
d.clipboardData.setData("text/plain",c.join(""))))return!0;var i=b.createElement(f,"pre");i.style.position="fixed";i.style.left="-1000px";l(a,function(a){i.appendChild(f.createTextNode(a))},function(){i.appendChild(b.createElement(f,"br"))});i.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(i);var j=f.createRange();j.setStart(i.firstChild,0);j.setEndBefore(i.lastChild);var g=e.getSelection();g.rangeCount>0&&g.removeAllRanges();g.addRange(j);var h=this,j=function(){i&&i.parentNode===
h._clientDiv&&h._clientDiv.removeChild(i);h._updateDOMSelection()},g=!1;this._ignoreCopy=!0;try{g=f.execCommand("copy",!1,null)}catch(m){}this._ignoreCopy=!1;if(!g&&d)return e.setTimeout(j,0),!1;j();return!0},_setDOMSelection:function(a,d,c,f,e){for(var i,j,g,h,l=0,m=a.firstChild,o,k,s=this._model.getLine(a.lineIndex).length;m;){if(!m.ignore){o=m.firstChild;k=o.length;m.ignoreChars&&(k-=m.ignoreChars);if(l+k>d||l+k>=s){i=o;j=d-l;m.ignoreChars&&k>0&&j===k&&(j+=m.ignoreChars);break}l+=k}m=m.nextSibling}for(var l=
0,m=c.firstChild,r=this._model.getLine(c.lineIndex).length;m;){if(!m.ignore){o=m.firstChild;k=o.length;m.ignoreChars&&(k-=m.ignoreChars);if(k+l>f||l+k>=r){g=o;h=f-l;m.ignoreChars&&k>0&&h===k&&(h+=m.ignoreChars);break}l+=k}m=m.nextSibling}this._setDOMFullSelection(a,d,s,c,f,r);a=this._getWindow();d=this._parent.ownerDocument;if(a.getSelection){c=a.getSelection();a=d.createRange();a.setStart(i,j);a.setEnd(g,h);if(this._hasFocus&&(c.anchorNode!==i||c.anchorOffset!==j||c.focusNode!==g||c.focusOffset!==
h||c.anchorNode!==g||c.anchorOffset!==h||c.focusNode!==i||c.focusOffset!==j))this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=d.createRange(),e?(a.setStart(i,j),a.setEnd(i,j)):(a.setStart(g,h),a.setEnd(g,h)),g=a.getClientRects()[0],h=this._cursorDiv.parentNode,i=h.getBoundingClientRect(),g&&i))this._cursorDiv.style.top=g.top-i.top+h.scrollTop+"px",this._cursorDiv.style.left=g.left-i.left+h.scrollLeft+"px"}else if(d.selection&&this._hasFocus)e=
d.body,a=b.createElement(d,"div"),e.appendChild(a),e.removeChild(a),a=e.createTextRange(),a.moveToElementText(i.parentNode),a.moveStart("character",j),i=e.createTextRange(),i.moveToElementText(g.parentNode),i.moveStart("character",h),a.setEndPoint("EndToStart",i),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,d,c,f){if(this._selDiv1&&(d=this._selDiv1,d.style.width="0px",d.style.height="0px",d=this._selDiv2,d.style.width="0px",d.style.height="0px",d=this._selDiv3,
d.style.width="0px",d.style.height="0px",!(a===c&&b===f))){var e=this._model,i=this._getViewPadding(),j=this._clientDiv.getBoundingClientRect(),g=this._viewDiv.getBoundingClientRect(),d=g.left+i.left,h=j.right,i=g.top+i.top,l=j.bottom,g=j=0;this._clipDiv?(g=this._clipDiv.getBoundingClientRect(),j=g.left-this._clipDiv.scrollLeft):(g=this._rootDiv.getBoundingClientRect(),j=g.left);g=g.top;this._ignoreDOMSelection=!0;var a=(new p(this,a.lineIndex,a)).getBoundingClientRect(e.getLineStart(a.lineIndex)+
b,!1),m=a.left,f=(new p(this,c.lineIndex,c)).getBoundingClientRect(e.getLineStart(c.lineIndex)+f,!1),b=f.left;this._ignoreDOMSelection=!1;var e=this._selDiv1,m=Math.min(h,Math.max(d,m)),o=Math.min(l,Math.max(i,a.top)),k=h,c=Math.min(l,Math.max(i,a.bottom));e.style.left=m-j+"px";e.style.top=o-g+"px";e.style.width=Math.max(0,k-m)+"px";e.style.height=Math.max(0,c-o)+"px";if(a.top===f.top)k=Math.min(b,h),e.style.width=Math.max(0,k-m)+"px";else if(a=Math.min(l,Math.max(i,f.top)),b=Math.min(h,Math.max(d,
b)),i=Math.min(l,Math.max(i,f.bottom)),l=this._selDiv3,l.style.left=d-j+"px",l.style.top=a-g+"px",l.style.width=Math.max(0,b-d)+"px",l.style.height=Math.max(0,i-a)+"px",a-c>0)i=this._selDiv2,i.style.left=d-j+"px",i.style.top=c-g+"px",i.style.width=Math.max(0,h-d)+"px",i.style.height=Math.max(0,a-c)+"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(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=this._hasFocus;var d=this._clientDiv;d.contentEditable=!a;this._hadFocus&&!a&&d.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(d=a.firstChild;d;)if(d.ignore)d=d.nextSibling;else{var c=d.nextSibling,f=d.viewStyle;f&&f.tagName&&f.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,d.firstChild.data,f),d);d=c}a=this._getLineNext(a)}this._updateDOMSelection()}},
_setSelection:function(a,b,d,c,f){if(a){this._columnX=-1;d===void 0&&(d=!0);var e=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,c,b,f);d&&this._updateDOMSelection();if(!e.equals(a))this.onSelection({type:"Selection",oldValue:{start:e.start,end:e.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,d,c){var f=this._model,e=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){f=this._getLine(a);a=f.getOffset(b.x,
b.y-this._getLinePixel(a));f.destroy();if(c&&!d&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);d||e.collapse()}else(this._clickCount&1)===0?(f=this._getLine(a),a=f.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(d=this._doubleClickSelection.start,c=f.getNextOffset(a,{unit:"wordend",count:1})):(d=f.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(d=f.getNextOffset(a,{unit:"word",count:-1}),c=f.getNextOffset(d,
{unit:"wordend",count:1})),f.destroy()):this._doubleClickSelection?(c=f.getLineAtOffset(this._doubleClickSelection.start),a>=c?(d=f.getLineStart(c),c=f.getLineEnd(a)):(d=f.getLineStart(a),c=f.getLineEnd(c))):(d=f.getLineStart(a),c=f.getLineEnd(a)),e.setCaret(d),e.extend(c);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(a,d){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!b.isIOS){var f=c.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var e=b.createElement(f,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";c.appendChild(e);var i=b.createElement(f,"div");this._selDiv2=i;i.style.position="absolute";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding=
"0px";i.style.outline="none";i.style.background=this._highlightRGB;i.style.width="0px";i.style.height="0px";i.style.zIndex="0";c.appendChild(i);this._selDiv3=f=b.createElement(f,"div");f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";c.appendChild(f);if(b.isFirefox&&b.isMac){c=this._getWindow().getComputedStyle(f,null).getPropertyValue("background-color");
switch(c){case "rgb(119, 141, 168)":c="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;e.style.background=c;i.style.background=c;f.style.background=
c}d||this._updateDOMSelection()}}else{if(this._selDiv1)c.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)c.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)c.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 a=
b.createElement(document,"div");a.className="textviewBlockCursor";this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(a,
d){this._tabSize=a;this._customTabSize=void 0;var c=this._clientDiv;if(b.isOpera){if(c)c.style.OTabSize=this._tabSize+""}else if(b.isWebkit>=537.1){if(c)c.style.tabSize=this._tabSize+""}else if(b.isFirefox>=4){if(c)c.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;d||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var d="textview",c=this._theme.getThemeClass();c&&(d+=" "+c);this._themeClass&&c!==this._themeClass&&(d+=" "+this._themeClass);this._rootDiv.className=d;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var d=this._clientDiv,c=this._viewDiv;a?(d.style.whiteSpace="pre-wrap",d.style.wordWrap="break-word",c.style.overflowX="hidden",c.style.overflowY="scroll"):
(d.style.whiteSpace="pre",d.style.wordWrap="normal",c.style.overflowX="auto",c.style.overflowY="auto");b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,d,c){if(this._clientDiv){var f=this._model,e=this._getSelection(),i=this._getScroll(),j=e.getCaret(),g=e.start,h=e.end,l=f.getLineAtOffset(h),m=Math.max(Math.max(g,f.getLineStart(l)),h-1),f=this._getClientWidth(),l=this._getClientHeight(),o=f/4,k=this._getBoundsAtOffset(j===g?g:m),s=k.left,r=k.right,p=k.top,
q=k.bottom;a&&!e.isEmpty()&&(k=this._getBoundsAtOffset(j===h?g:m),k.top===p?j===g?r=s+Math.min(k.right-s,f):s=r-Math.min(r-k.left,f):j===g?q=p+Math.min(k.bottom-p,l):p=q-Math.min(q-k.top,l));a=0;s<i.x&&(a=Math.min(s-i.x,-o));r>i.x+f&&(a=Math.max(r-i.x-f,o));e=0;p<i.y?e=p-i.y:q>i.y+l&&(e=q-i.y-l);c&&(c>0?e>0&&(e=Math.max(e,c)):e<0&&(e=Math.min(e,c)));if(a!==0||e!==0)return e!==0&&typeof d==="number"&&(d<0&&(d=0),d>1&&(d=1),e+=Math.floor(e>0?d*l:-d*l)),this._scrollViewAnimated(a,e,b),l!==this._getClientHeight()||
f!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);
this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a],d=b.target,c=b.type,b=b.handler;typeof d.removeEventListener==="function"?d.removeEventListener(c,b,!1):d.detachEvent("on"+c,b)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,d=b.getLineAtOffset(a.start),c=b.getLineAtOffset(a.end),
f=this._getLineNext();if(f){var e=this._getLinePrevious(),i;d<f.lineIndex?(i=f,d=0):d>e.lineIndex?(i=e,d=0):(i=this._getLineNode(d),d=a.start-b.getLineStart(d));c<f.lineIndex?b=0:c>e.lineIndex?(f=e,b=0):(f=this._getLineNode(c),b=a.end-b.getLineStart(c));this._setDOMSelection(i,d,f,b,a.caret)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var d=this._clientDiv;if(d){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var c=this._model,f=this._getScroll(!1),e=this._getViewPadding(),i=c.getLineCount(),j=this._getLineHeight(),g=this._getClientWidth();if(this._wrapMode)d.style.width=g+"px";var h,l,m,o,k=0,s=0;if(this._lineHeight){for(;s<i;){l=this._getLineHeight(s);if(k+l>f.y)break;k+=l;s++}h=s;l=Math.max(0,h-1);m=c=f.y-k;h>0&&(c+=this._getLineHeight(h-1))}else o=Math.max(0,f.y)/j,h=Math.floor(o),l=Math.max(0,h-1),c=Math.round((o-l)*j),m=Math.round((o-h)*j);this._topIndexY=
m;o=this._parent;var r=o.clientWidth,q=o.clientHeight;o=this._getClientHeight();if(a){j=0;this._leftDiv&&(h=this._leftDiv.getBoundingClientRect(),j=h.right-h.left);h=g;for(this._wrapMode||(h=Math.max(this._maxLineWidth,h));s<i;)l=this._getLineHeight(s,!1),k+=l,s++;i=k}else{g=this._viewDiv;m=Math.min(h+Math.floor((o+m)/j),i-1);for(var f=Math.min(m+1,i-1),t,x=d.firstChild;x;){t=x.lineIndex;var C=x.nextSibling;if(!(l<=t&&t<=f)||x.lineRemoved||x.lineIndex===-1)this._mouseWheelLine===x?(x.style.display=
"none",x.lineIndex=-1):d.removeChild(x);x=C}var x=this._getLineNext(),C=g.ownerDocument,D=C.createDocumentFragment();for(t=l;t<=f;t++)if(!x||x.lineIndex>t)(new p(this,t)).create(D,null);else{D.firstChild&&(d.insertBefore(D,x),D=C.createDocumentFragment());if(x&&x.lineChanged)x=(new p(this,t)).create(D,x),x.lineChanged=!1;x=this._getLineNext(x)}D.firstChild&&d.insertBefore(D,x);if(b.isWebkit&&!this._wrapMode)d.style.width="0x7fffffffpx";x=this._getLineNext();t=o+c;for(D=!1;x;){l=x.lineWidth;if(l===
void 0)if(C=x._line.getBoundingClientRect(),l=x.lineWidth=Math.ceil(C.right-C.left),C=C.bottom-C.top,this._lineHeight)this._lineHeight[x.lineIndex]=C;else if(j!==0&&C!==0&&Math.ceil(j)!==Math.ceil(C))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[x.lineIndex]=C;if(this._lineHeight&&!D&&(t-=this._lineHeight[x.lineIndex],t<0))m=x.lineIndex,D=!0;if(!this._wrapMode){if(l>=this._maxLineWidth)this._maxLineWidth=l,this._maxLineIndex=x.lineIndex;if(this._checkMaxLineIndex===x.lineIndex)this._checkMaxLineIndex=
-1}if(x.lineIndex===h)this._topChild=x;if(x.lineIndex===m)this._bottomChild=x;x=this._getLineNext(x)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<i)){j=new p(this,t);C=j.getBoundingClientRect();l=C.right-C.left;if(l>=this._maxLineWidth)this._maxLineWidth=l,this._maxLineIndex=t;j.destroy()}for(;s<i;)l=this._getLineHeight(s,s<=m),k+=l,s++;i=k;this._updateRuler(this._leftDiv,h,f,q);this._updateRuler(this._rightDiv,h,f,q);j=0;this._leftDiv&&(h=this._leftDiv.getBoundingClientRect(),
j=h.right-h.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-f.left);g.style.left=j+"px";g.style.right=f+"px";f=this._scrollDiv;f.style.height=i+"px";k=g=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));h=k;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>g)k+=e.right+e.left;f.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";f=this._getScroll(!1)}if(this._vScrollDiv)k=o-8,s=Math.max(15,Math.ceil(Math.min(1,k/(i+e.top+
e.bottom))*k)),this._vScrollDiv.style.left=j+g-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*k/i))+"px",this._vScrollDiv.style.height=s+"px";if(!this._wrapMode&&this._hScrollDiv)k=g-8,s=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+e.left+e.right))*k)),this._hScrollDiv.style.left=j+Math.floor(Math.max(0,Math.floor(f.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=o-9+"px",this._hScrollDiv.style.width=s+"px";x=f.x;l=this._clipDiv;k=this._overlayDiv;if(l){l.scrollLeft=
x;l.scrollTop=0;s=j+e.left;m=e.top;a=g;j=o;x=0;t=-c;if(f.x===0)s-=e.left,a+=e.left,x=e.left;f.x+g===h&&(a+=e.right);f.y===0&&(m-=e.top,j+=e.top,t+=e.top);f.y+o===i&&(j+=e.bottom);l.style.left=s+"px";l.style.top=m+"px";l.style.right=r-a-s+"px";l.style.bottom=q-j-m+"px";d.style.left=x+"px";d.style.top=t+"px";d.style.width=h+"px";d.style.height=o+c+"px";if(k)k.style.left=d.style.left,k.style.top=d.style.top,k.style.width=d.style.width,k.style.height=d.style.height}else{s=x;m=c;r=x+g;q=c+o;s===0&&(s-=
e.left);m===0&&(m-=e.top);r===h&&(r+=e.right);f.y+o===i&&(q+=e.bottom);d.style.clip="rect("+m+"px,"+r+"px,"+q+"px,"+s+"px)";d.style.left=-x+j+e.left+"px";d.style.width=(b.isWebkit?h:g+x)+"px";if(!a)d.style.top=-c+e.top+"px",d.style.height=o+c+"px";if(k&&(k.style.clip=d.style.clip,k.style.left=d.style.left,k.style.width=d.style.width,!a))k.style.top=d.style.top,k.style.height=d.style.height}this._updateDOMSelection();d=this._ensureCaretVisible;this._ensureCaretVisible=!1;o!==this._getClientHeight()&&
(this._update(),d&&this._showCaret())}}},_updateRuler:function(a,d,c,f){if(a)for(var e=this._parent.ownerDocument,i=this._getLineHeight(),g=this._getViewPadding(),a=a.firstChild;a;){var h=a._ruler,l=i,m=h.getOverview();m==="page"&&(l+=this._topIndexY);a.style.top=-l+"px";a.style.height=f+l+"px";a.rulerChanged&&j(h.getRulerStyle(),a);var o,k=a.firstChild;k?(o=k,k=k.nextSibling):(o=b.createElement(e,"div"),o.style.visibility="hidden",a.appendChild(o));var s;if(a.rulerChanged&&o){l=-1;if(s=h.getWidestAnnotation())if(j(s.style,
o),s.html)o.innerHTML=s.html;o.lineIndex=l;o.style.height=i+g.top+"px"}var r;if(m==="page"){for(h=h.getAnnotations(d,c+1);k;)l=k.lineIndex,s=k.nextSibling,(!(d<=l&&l<=c)||k.lineChanged)&&a.removeChild(k),k=s;k=a.firstChild.nextSibling;r=e.createDocumentFragment();for(l=d;l<=c;l++)if(!k||k.lineIndex>l){o=b.createElement(e,"div");if(s=h[l]){j(s.style,o);if(s.html)o.innerHTML=s.html;o.annotation=s}o.lineIndex=l;o.style.height=this._getLineHeight(l)+"px";r.appendChild(o)}else if(r.firstChild&&(a.insertBefore(r,
k),r=e.createDocumentFragment()),k)k=k.nextSibling;r.firstChild&&a.insertBefore(r,k)}else{s=this._getClientHeight();l=this._model.getLineCount();k=s+g.top+g.bottom-2*this._metrics.scrollWidth;m=i*l<k?i:k/l;if(a.rulerChanged){for(s=a.childNodes.length;s>1;)a.removeChild(a.lastChild),s--;h=h.getAnnotations(0,l);r=e.createDocumentFragment();for(var p in h)if(l=p>>>0,!(l<0)){o=b.createElement(e,"div");s=h[p];j(s.style,o);o.style.position="absolute";o.style.top=this._metrics.scrollWidth+i+Math.floor(l*
m)+"px";if(s.html)o.innerHTML=s.html;o.annotation=s;o.lineIndex=l;r.appendChild(o)}a.appendChild(r)}else if(a._oldTrackHeight!==k)for(o=a.firstChild?a.firstChild.nextSibling:null;o;)o.style.top=this._metrics.scrollWidth+i+Math.floor(o.lineIndex*m)+"px",o=o.nextSibling;a._oldTrackHeight=k}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";b.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");b.isFirefox&&b.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var d=document.getElementById("_textviewStyle");if(d)d.removeChild(d.firstChild),d.appendChild(document.createTextNode(a));else{d=b.createElement(document,"style");d.id="_textviewStyle";var c=document.getElementsByTagName("head")[0]||document.documentElement;d.appendChild(document.createTextNode(a));c.insertBefore(d,c.firstChild)}}},_updateStyle:function(a){if(!a&&b.isIE)this._rootDiv.style.lineHeight=
"normal";var d=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?d.lineHeight-(d.lineTrim.top+d.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};e.EventTarget.addMixin(q.prototype);return{TextView:q}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(h,k){function g(e){this._model=e;this._projections=[]}g.prototype={addProjection:function(e){if(e){var c=this._model,b=this._projections;e._lineIndex=c.getLineAtOffset(e.start);e._lineCount=c.getLineAtOffset(e.end)-e._lineIndex;var a=e.text;a||(a="");e._model=typeof a==="string"?new h.TextModel(a,c.getLineDelimiter()):a;var c=this.mapOffset(e.start,!0),a=e.end-e.start,j=e._lineCount,d=e._model.getCharCount(),
f=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:e._model.getText(),start:c,removedCharCount:a,addedCharCount:d,removedLineCount:j,addedLineCount:f});var i=this._binarySearch(b,e.start);b.splice(i,0,e);this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:d,removedLineCount:j,addedLineCount:f})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,c){var b=this._projections,a=0,j,d;if(c){for(j=
0;j<b.length;j++){d=b[j];if(d.start>e)break;if(d.end>e)return-1;a+=d._model.getCharCount()-(d.end-d.start)}return e+a}for(j=0;j<b.length;j++){d=b[j];if(d.start>e-a)break;var f=d._model.getCharCount();if(d.start+f>e-a)return-1;a+=f-(d.end-d.start)}return e-a},removeProjection:function(e){var c,b=0;for(c=0;c<this._projections.length;c++){var a=this._projections[c];if(a===e){e=a;break}b+=a._model.getCharCount()-(a.end-a.start)}if(c<this._projections.length){var a=this._model,b=e.start+b,j=e.end-e.start,
d=e._lineCount,f=e._model.getCharCount(),i=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:a.getText(e.start,e.end),start:b,removedCharCount:f,addedCharCount:j,removedLineCount:i,addedLineCount:d});this._projections.splice(c,1);this.onChanged({type:"Changed",start:b,removedCharCount:f,addedCharCount:j,removedLineCount:i,addedLineCount:d})}},_binarySearch:function(e,c){for(var b=e.length,a=-1,j;b-a>1;)j=Math.floor((b+a)/2),c<=e[j].start?b=j:a=j;return b},getCharCount:function(){for(var e=
this._model.getCharCount(),c=this._projections,b=0;b<c.length;b++){var a=c[b];e+=a._model.getCharCount()-(a.end-a.start)}return e},getLine:function(e,c){if(e<0)return null;var b=this._model,a=this._projections,j=0,d=[],f=0,i,g,h;for(i=0;i<a.length;i++){h=a[i];if(h._lineIndex>=e-j)break;g=h._model.getLineCount()-1;if(h._lineIndex+g>=e-j)if(f=e-(h._lineIndex+j),f<g)return h._model.getLine(f,c);else d.push(h._model.getLine(g));f=h.end;j+=g-h._lineCount}for(f=Math.max(f,b.getLineStart(e-j));i<a.length;i++){h=
a[i];if(h._lineIndex>e-j)break;d.push(b.getText(f,h.start));g=h._model.getLineCount()-1;if(h._lineIndex+g>e-j)return d.push(h._model.getLine(0,c)),d.join("");d.push(h._model.getText());f=h.end;j+=g-h._lineCount}a=b.getLineEnd(e-j,c);f<a&&d.push(b.getText(f,a));return d.join("")},getLineAtOffset:function(e){for(var c=this._model,b=this._projections,a=0,j=0,d=0;d<b.length;d++){var f=b[d];if(f.start>e-a)break;var i=f._model.getCharCount();if(f.start+i>e-a){b=e-(f.start+a);j+=f._model.getLineAtOffset(b);
a+=b;break}j+=f._model.getLineCount()-1-f._lineCount;a+=i-(f.end-f.start)}return c.getLineAtOffset(e-a)+j},getLineCount:function(){for(var e=this._projections,c=this._model.getLineCount(),b=0;b<e.length;b++){var a=e[b];c+=a._model.getLineCount()-1-a._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(e,c){if(e<0)return-1;for(var b=this._model,a=this._projections,j=0,d=0,f=0;f<a.length;f++){var i=a[f];if(i._lineIndex>e-j)break;var g=i._model.getLineCount()-
1;if(i._lineIndex+g>e-j)return i._model.getLineEnd(e-(i._lineIndex+j),c)+i.start+d;d+=i._model.getCharCount()-(i.end-i.start);j+=g-i._lineCount}return b.getLineEnd(e-j,c)+d},getLineStart:function(e){if(e<0)return-1;for(var c=this._model,b=this._projections,a=0,j=0,d=0;d<b.length;d++){var f=b[d];if(f._lineIndex>=e-a)break;var i=f._model.getLineCount()-1;if(f._lineIndex+i>=e-a)return f._model.getLineStart(e-(f._lineIndex+a))+f.start+j;j+=f._model.getCharCount()-(f.end-f.start);a+=i-f._lineCount}return c.getLineStart(e-
a)+j},getText:function(e,c){e===void 0&&(e=0);var b=this._model,a=this._projections,j=0,d=[],f,i,g;for(f=0;f<a.length;f++){i=a[f];if(i.start>e-j)break;g=i._model.getCharCount();if(i.start+g>e-j)if(c!==void 0&&i.start+g>c-j)return i._model.getText(e-(i.start+j),c-(i.start+j));else d.push(i._model.getText(e-(i.start+j))),e=i.end+j+g-(i.end-i.start);j+=g-(i.end-i.start)}var h=e-j;if(c!==void 0){for(;f<a.length;f++){i=a[f];if(i.start>c-j)break;d.push(b.getText(h,i.start));g=i._model.getCharCount();if(i.start+
g>c-j)return d.push(i._model.getText(0,c-(i.start+j))),d.join("");d.push(i._model.getText());h=i.end;j+=g-(i.end-i.start)}d.push(b.getText(h,c-j))}else{for(;f<a.length;f++)i=a[f],d.push(b.getText(h,i.start)),d.push(i._model.getText()),h=i.end;d.push(b.getText(h))}return d.join("")},_onChanging:function(e,c,b,a,j,d){for(var f=this._model,i=this._projections,g,h=0,m,k=c+b;g<i.length;g++){b=i[g];if(b.start>c)break;h+=b._model.getCharCount()-(b.end-b.start)}c+=h;for(var r=g;g<i.length;g++){b=i[g];if(b.start>
k)break;h+=b._model.getCharCount()-(b.end-b.start);m+=b._model.getLineCount()-1-b._lineCount}b=k+h;h=g;this.onChanging(c,b-c,a,j+m,d);i.splice(i,h-r);for(e=e.length-(b-c);g<i.length;g++)b=i[g],b.start+=e,b.end+=e,b._lineIndex=f.getLineAtOffset(b.start)},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},setText:function(e,c,b){e===void 0&&(e="");c===void 0&&(c=0);var a=c,j=b,d=this._model,
f=this._projections,i=0,g=0,h,m,k,r,p,q=0;for(h=0;h<f.length;h++){m=f[h];if(m.start>c-i)break;k=m._model.getCharCount();if(m.start+k>c-i)if(b!==void 0&&m.start+k>b-i){m._model.setText(e,c-(m.start+i),b-(m.start+i));return}else q=m._model.getLineCount()-1-m._model.getLineAtOffset(c-(m.start+i)),r={projection:m,start:c-(m.start+i)},c=m.end+i+k-(m.end-m.start);g+=m._model.getLineCount()-1-m._lineCount;i+=k-(m.end-m.start)}c-=i;var t=h,q=d.getLineAtOffset(c)+g-q;if(b!==void 0)for(;h<f.length;h++){m=f[h];
if(m.start>b-i)break;k=m._model.getCharCount();if(m.start+k>b-i){g+=m._model.getLineAtOffset(b-(m.start+i));k=b-(m.start+i);b=m.end+i;p={projection:m,end:k};break}g+=m._model.getLineCount()-1-m._lineCount;i+=k-(m.end-m.start)}else{for(;h<f.length;h++)m=f[h],g+=m._model.getLineCount()-1-m._lineCount,i+=m._model.getCharCount()-(m.end-m.start);b=j=d.getCharCount()+i}b-=i;m=d.getLineAtOffset(b)+g;j-=a;for(var g=m-q,q=e.length,n=k=m=i=0;;){m!==-1&&m<=n&&(m=e.indexOf("\r",n));k!==-1&&k<=n&&(k=e.indexOf("\n",
n));if(k===-1&&m===-1)break;n=m!==-1&&k!==-1?m+1===k?k+1:(m<k?m:k)+1:m!==-1?m+1:k+1;i++}this.onChanging({type:"Changing",text:e,start:a,removedCharCount:j,addedCharCount:q,removedLineCount:g,addedLineCount:i});d.setText(e,c,b);if(r)m=r.projection,m._model.setText("",r.start);if(p)m=p.projection,m._model.setText("",0,p.end),m.start=m.end,m._lineCount=0;f.splice(t,h-t);for(e=e.length-(b-c);h<f.length;h++)m=f[h],m.start+=e,m.end+=e,m._lineIndex=d.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:a,removedCharCount:j,addedCharCount:q,removedLineCount:g,addedLineCount:i})}};k.EventTarget.addMixin(g.prototype);return{ProjectionTextModel:g}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(h,k,g,e,c){function b(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}b.getTooltip=function(a){if(!a._tooltip)a._tooltip=new b(a);return a._tooltip};b.prototype={_create:function(a){if(!this._tooltipDiv){var b=this._tooltipDiv=c.createElement(a,"div");b.className=
"textviewTooltip";b.setAttribute("aria-live","assertive");b.setAttribute("aria-atomic","true");var d=this._tooltipContents=c.createElement(a,"div");b.appendChild(d);a.body.appendChild(b);this.hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);this._tooltipDiv=null}},hide:function(){if(this._contentsView)this._contentsView.destroy(),
this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";if(this._tooltipDiv)this._tooltipDiv.style.visibility="hidden";var a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,
b){if(this.target!==a&&(this._target=a,this.hide(),a)){var d=this;if(b===0)d.show(!0);else{var c=this._getWindow();d._showTimeout=c.setTimeout(function(){d.show(!0)},b?b:500)}}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var d=this._tooltipDiv,c=this._tooltipContents;d.style.left=d.style.right=d.style.width=d.style.height=c.style.width=c.style.height="auto";var i=b.contents;i instanceof Array&&(i=this._getAnnotationContents(i));if(typeof i==="string")c.innerHTML=i;
else if(this._isNode(i))c.appendChild(i);else if(i instanceof e.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=c;var m=h.themeClass;m?((m=m.replace("tooltip",""))&&(m=" "+m),m="tooltip"+m):m="tooltip";h.themeClass=m;h=this._contentsView=new k.TextView(h);h._clientDiv.contentEditable=!1;h.addEventListener("LineStyle",function(a){g.onLineStyle(a)});h.setModel(i);i=h.computeSize();c.style.width=i.width+"px";c.style.height=i.height+"px";h.resize()}else return;c=d.ownerDocument.documentElement;
b.anchor==="right"?(i=c.clientWidth-b.x,d.style.right=i+"px"):(i=parseInt(this._getNodeStyle(d,"padding-left","0"),10),i+=parseInt(this._getNodeStyle(d,"border-left-width","0"),10),i=b.x-i,d.style.left=i+"px");d.style.maxWidth=c.clientWidth-i-10+"px";i=parseInt(this._getNodeStyle(d,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(d,"border-top-width","0"),10);i=b.y-i;d.style.top=i+"px";d.style.maxHeight=c.clientHeight-i-10+"px";d.style.opacity="1";d.style.visibility="visible";if(a){var s=this,
r=this._getWindow();s._hideTimeout=r.setTimeout(function(){var a=parseFloat(s._getNodeStyle(d,"opacity","1"));s._fadeTimeout=r.setInterval(function(){d.style.visibility==="visible"&&a>0?(a-=0.1,d.style.opacity=a):s.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function b(a){var d=a.title;if(d==="")return null;var e="<div>";a.html&&(e+=a.html+"&nbsp;");if(!d)d=a.end,a=c.getLineStart(c.getLineAtOffset(a.start)),d=c.getLineEnd(c.getLineAtOffset(d),!0),d=c.getText(a,d);d=d.replace(/</g,"&lt;").replace(/>/g,
"&gt;");e+="<span style='vertical-align:middle;'>"+d+"</span><div>";return e}if(a.length===0)return null;var d=this._view.getModel(),c=d.getBaseModel?d.getBaseModel():d;if(a.length===1)if(d=a[0],d.title!==void 0)return b(d);else{var a=new e.ProjectionTextModel(c),i=c.getLineStart(c.getLineAtOffset(d.start)),g=c.getCharCount();d.end!==g&&a.addProjection({start:d.end,end:g});i>0&&a.addProjection({start:0,end:i});return a}else{i="<div><em>"+h.multipleAnnotations+"</em></div>";for(g=0;g<a.length;g++)d=
a[g],(d=b(d))&&(i+=d);return i}},_getNodeStyle:function(a,b,d){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||d},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:b}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(h,k){function g(a,b,d){this.start=a;this.end=b;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(){}function c(a,b){var d=a.lastIndexOf("."),d=a.substring(d+1),c={title:h[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};b?c.lineStyle={styleClass:"annotationLine "+
d}:c.rangeStyle={styleClass:"annotationRange "+d};e.registerType(a,c)}function b(){}function a(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function j(a,b){this._view=a;this._annotationModel=b;var d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}g.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,b=a.getBaseModel();this._projection=
{start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};e.ANNOTATION_ERROR="orion.annotation.error";e.ANNOTATION_WARNING="orion.annotation.warning";e.ANNOTATION_TASK="orion.annotation.task";e.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
e.ANNOTATION_BOOKMARK="orion.annotation.bookmark";e.ANNOTATION_FOLDING="orion.annotation.folding";e.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";e.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";e.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";e.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";e.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";e.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";e.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
e.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";e.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";e.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var d={};e.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(a,b,d){this.start=a;this.end=b;if(d!==void 0)this.title=d},c.prototype=b;c.prototype.type=a;d[a]=c;return a};e.createAnnotation=function(a,b,d,c){return new (this.getType(a))(b,d,c)};e.getType=function(a){return d[a]};
c(e.ANNOTATION_ERROR);c(e.ANNOTATION_WARNING);c(e.ANNOTATION_TASK);c(e.ANNOTATION_BREAKPOINT);c(e.ANNOTATION_BOOKMARK);c(e.ANNOTATION_CURRENT_BRACKET);c(e.ANNOTATION_MATCHING_BRACKET);c(e.ANNOTATION_CURRENT_SEARCH);c(e.ANNOTATION_MATCHING_SEARCH);c(e.ANNOTATION_READ_OCCURRENCE);c(e.ANNOTATION_WRITE_OCCURRENCE);c(e.ANNOTATION_SELECTED_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINKED_GROUP);c(e.ANNOTATION_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINE,!0);e.registerType(e.ANNOTATION_FOLDING,g);b.addMixin=function(a){var d=
b.prototype,c;for(c in d)d.hasOwnProperty(c)&&(a[c]=d[c])};b.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,d){a=a.getAnnotations(b,d);for(d=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&d.push(b);var c=
this;d.sort(function(a,b){return c.getAnnotationTypePriority(a.type)-c.getAnnotationTypePriority(b.type)});return d},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};a.prototype={addAnnotation:function(a){if(a){var b=this._annotations,d=this._binarySearch(b,a.start);b.splice(d,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var d=this._annotations,c,e=0,j=function(){for(;e<d.length;){var c=d[e++];if(a===c.start||(a>c.start?a<c.end:c.start<b))return c;if(c.start>=b)break}return null};c=j();return{next:function(){var a=c;a&&(c=j());return a},hasNext:function(){return c!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},
onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,d,c;if(a){d=[];for(c=b.length-1;c>=0;c--){var e=b[c];e.type===a&&b.splice(c,1);d.splice(0,0,e)}}else d=b;this.onChanged({type:"Changed",removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var d=this._annotations,c,e,
j,g=[];if(a)for(c=a.length-1;c>=0;c--)j=a[c],e=this._getAnnotationIndex(j),e<0||(d.splice(e,1),g.splice(0,0,j));b||(b=[]);for(c=0;c<b.length;c++)j=b[c],e=this._binarySearch(d,j.start),d.splice(e,0,j);this.onChanged({type:"Changed",removed:g,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var d=a.length,c=
-1,e;d-c>1;)e=Math.floor((d+c)/2),b<=a[e].start?d=e:c=e;return d},_getAnnotationIndex:function(a){for(var b=this._annotations,d=this._binarySearch(b,a.start);d<b.length&&b[d].start===a.start;){if(b[d]===a)return d;d++}return-1},_onChanged:function(a){var b=a.start,d=a.removedCharCount,c=this._annotations,e=b+d;if(0<c.length){for(var j={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-d,d=0;d<c.length;d++){var g=c[d];g.start>=e?(g.start+=a,g.end+=a,j.changed.push(g)):
g.end<=b||(g.start<b&&e<g.end?(g.end+=a,j.changed.push(g)):(c.splice(d,1),j.removed.push(g),d--))}if(j.added.length>0||j.removed.length>0||j.changed.length>0)this.onChanged(j)}}};k.EventTarget.addMixin(a.prototype);j.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,
b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var d;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(d in b.style)a.style[d]||(a.style[d]=b.style[d])}if(b.attributes){if(!a.attributes)a.attributes={};for(d in b.attributes)a.attributes[d]||(a.attributes[d]=b.attributes[d])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var d,c;for(c=0;c<a.length&&b;c++){var e=a[c];if(b.end<=
e.start)break;if(!(b.start>=e.end)){d=this._mergeStyle({},e.style);d=this._mergeStyle(d,b.style);var j=[];j.push(c,1);b.start<e.start&&j.push({start:b.start,end:e.start,style:b.style});b.start>e.start&&j.push({start:e.start,end:b.start,style:e.style});j.push({start:Math.max(e.start,b.start),end:Math.min(e.end,b.end),style:d});b.end<e.end&&j.push({start:b.end,end:e.end,style:e.style});b=b.end>e.end?{start:e.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,j)}}b&&(d=this._mergeStyle({},
b.style),a.splice(c,0,{start:b.start,end:b.end,style:d}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var f=0;f<a.length;f++)if(c.isAnnotationTypeVisible(a[f].type)){var i=a[f].start,j=a[f].end;e.getBaseModel&&(i=e.mapOffset(i,!0),j=e.mapOffset(j,!0));i!==-1&&j!==-1&&d.redrawRange(i,j)}}if(!a.textModelChangedEvent){var d=this._view;if(d){var c=this,e=d.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
d=a.textView.getModel(),c=b.getTextModel(),e=a.lineStart,j=a.lineStart+a.lineText.length;c!==d&&(e=d.mapOffset(e),j=d.mapOffset(j));for(b=b.getAnnotations(e,j);b.hasNext();)if(e=b.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var j=e.start,g=e.end;c!==d&&(j=d.mapOffset(j,!0),g=d.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:j,end:g,style:e.rangeStyle})}if(e.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};b.addMixin(j.prototype);
return{FoldingAnnotation:g,AnnotationType:e,AnnotationTypeList:b,AnnotationModel:a,AnnotationStyler:j}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/util".split(","),function(h,k,g,e,c,b){function a(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null}function j(a){var b=this,c=Array.prototype.slice.call(arguments,1);return c.length?function(){return arguments.length?b.apply(a,c.concat(Array.prototype.slice.call(arguments))):b.apply(a,
c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}a.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._textView.getKeyModes()},isDirty:function(){return this._dirty},setAnnotationRulerVisible:function(a){if(this._annotationRulerVisible!==
a&&(this._annotationRulerVisible=a,this._annotationRuler)){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler,100):b.removeRuler(this._foldingRuler))}},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(a){if(this._lineNumberRulerVisible!==
a&&(this._lineNumberRulerVisible=a,this._lineNumberRuler)){var b=this._textView;a?b.addRuler(this._lineNumberRuler,1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var c=this._textView.getModel();c.getBaseModel&&(a=c.mapOffset(a,b));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,b=a.getSelection(),a=a.getModel();if(a.getBaseModel)b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end);return b},getText:function(a,b){var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c.getText(a,b)},_expandOffset:function(a){var b=this._textView.getModel(),e=this._annotationModel;if(e&&b.getBaseModel)for(a=e.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===c.AnnotationType.ANNOTATION_FOLDING&&b.expand&&(b.expand(),e.modifyAnnotation(b))},
setCaretOffset:function(a,b,c){var e=this._textView,j=e.getModel();j.getBaseModel&&(this._expandOffset(a),a=j.mapOffset(a,!0));e.setCaretOffset(a,b,c)},setText:function(a,b,c){var e=this._textView,j=e.getModel();j.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=j.mapOffset(b,!0)),c!==void 0&&(this._expandOffset(c),c=j.mapOffset(c,!0)));e.setText(a,b,c)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,b,c,e){var j=this._textView,g=j.getModel();g.getBaseModel&&
(this._expandOffset(a),this._expandOffset(b),a=g.mapOffset(a,!0),b=g.mapOffset(b,!0));j.setSelection(a,b,c,e)},moveSelection:function(a,b,c,e){var j=this._textView;this.setSelection(a,b||a,1/3,function(){(e===void 0||e)&&j.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,b,c){this._statusReporter&&this._statusReporter(a,b,c)},_getTooltipInfo:function(a,b){var c=this._textView,e=this.getAnnotationModel();if(!e)return null;var j=this._annotationStyler;
if(!j)return null;var g=c.getOffsetAtLocation(a,b);if(g===-1)return null;g=this.mapOffset(g);j=j.getAnnotationsByType(e,g,g+1);e=[];for(g=0;g<j.length;g++)j[g].rangeStyle&&e.push(j[g]);if(e.length===0)return null;c=c.convert({x:a,y:b},"document","page");return{contents:e,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(a,b){var e=this._annotationModel;if(e){var j=this._textView.getModel(),g=b?j.getLineAtOffset(b.start):-1,h=j.getLineAtOffset(a.start),k=a.start===a.end,r=!b||b.start===
b.end,p=j.getLineStart(h),q=j.getLineEnd(h);j.getBaseModel&&(p=j.mapOffset(p),q=j.mapOffset(q));j=this._currentLineAnnotation;if(!(g===h&&r&&k&&j&&j.start===p&&j.end===q)){var g=j?[j]:null,t;k&&(j=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_CURRENT_LINE,p,q),t=[j]);this._currentLineAnnotation=j;e.replaceAnnotations(g,t)}}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=
this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();var a=this,b=this._textView,i=this;this._listener={onModelChanged:function(){i.checkDirty()},onMouseOver:function(a){i._listener.onMouseMove(a)},onMouseMove:function(a){var d=e.Tooltip.getTooltip(b);if(d&&!(i._listener.lastMouseX===a.event.clientX&&i._listener.lastMouseY===a.event.clientY))i._listener.lastMouseX=a.event.clientX,
i._listener.lastMouseY=a.event.clientY,d.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return i._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var d=e.Tooltip.getTooltip(b);if(d&&!(i._listener.lastMouseX===a.event.clientX&&i._listener.lastMouseY===a.event.clientY))i._listener.lastMouseX=a.event.clientX,i._listener.lastMouseY=a.event.clientY,d.setTarget(null)},onScroll:function(){var a=e.Tooltip.getTooltip(b);a&&a.setTarget(null)},onSelection:function(a){i._updateCursorStatus();i._highlightCurrentLine(a.newValue,
a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",this._listener.onScroll);this._keyBindingFactory&&(typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):
this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist));var j=function(b){if(b!==void 0&&b!==-1){for(var f=this.getView().getModel(),e=this.getAnnotationModel(),i=a.mapOffset(f.getLineStart(b)),b=a.mapOffset(f.getLineEnd(b)),f=e.getAnnotations(i,b),j=null;f.hasNext();){var g=f.next();if(g.type===c.AnnotationType.ANNOTATION_BOOKMARK){j=g;break}}j?e.removeAnnotation(j):(j=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_BOOKMARK,i,b),j.title=void 0,e.addAnnotation(j))}};
if(this._annotationFactory){var g=b.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),g.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),g.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),
g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),g.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(c.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(c.AnnotationType.ANNOTATION_LINKED_GROUP),g.addAnnotationType("orion.annotation.highlightError");
b.annotationModel=this._annotationModel;var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),h=this._annotationRuler=g.annotationRuler;if(h)h.onDblClick=j,h.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),h.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),h.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),h.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),h.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(h=this._overviewRuler=g.overviewRuler)h.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),h.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),h.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),h.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),h.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK),h.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),
h.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),h.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=j,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(c.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:b})},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this.dispatchEvent({type:"TextViewUninstalled",
textView:a})},_updateCursorStatus:function(){var a=this.getModel(),c=this.getCaretOffset(),e=a.getLineAtOffset(c),a=a.getLineStart(e);c-=a;for(var a=this.getKeyModes(),j=0;j<a.length;j++){var g=a[j];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(b.formatMessage(h.lineColumn,e+1,c+1))},showProblems:function(a){var b=this._annotationModel;if(b){for(var e=[],j=[],g=b.getTextModel(),h=b.getAnnotations(0,g.getCharCount()),k;h.hasNext();)k=h.next(),(k.type===c.AnnotationType.ANNOTATION_ERROR||
k.type===c.AnnotationType.ANNOTATION_WARNING)&&e.push(k);if(a)for(h=0;h<a.length;h++)if(k=a[h]){var r=k.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),p=g.getLineStart(k.line-1);k=c.AnnotationType.createAnnotation(k.severity==="error"?c.AnnotationType.ANNOTATION_ERROR:c.AnnotationType.ANNOTATION_WARNING,p+k.start-1,p+k.end,r);j.push(k)}b.replaceAnnotations(e,j)}},showOccurrences:function(a){var b=this._annotationModel;if(b){for(var e=[],j=[],g=b.getTextModel(),h=b.getAnnotations(0,g.getCharCount()),
k;h.hasNext();)k=h.next(),(k.type===c.AnnotationType.ANNOTATION_READ_OCCURRENCE||k.type===c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&e.push(k);if(a)for(h=0;h<a.length;h++)if(k=a[h]){var r=g.getLineStart(k.line-1);k=c.AnnotationType.createAnnotation(k.readAccess===!0?c.AnnotationType.ANNOTATION_READ_OCCURRENCE:c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,r+k.start-1,r+k.end,k.description);j.push(k)}b.replaceAnnotations(e,j)}},showSelection:function(a,b,c,e,j){typeof a==="number"?(typeof b!=="number"&&
(b=a),this.moveSelection(a,b)):typeof c==="number"&&(a=this.getModel().getLineStart(c-1),typeof e==="number"&&(a+=e),typeof j!=="number"&&(j=0),this.moveSelection(a,a+j))},setInput:function(a,b,c,e){this._title=a;this._textView&&(e?(this._undoStack.markClean(),this.checkDirty()):(b?this._textView.setText(b):c!==null&&c!==void 0&&(this._textView.setText(c),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),
this._textView.focus()));this.onInputChanged({type:"InputChanged",title:a,message:b,contents:c,contentsSaved:e})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,b,c,e){if(this._textView){var j=this.getModel(),a=Math.max(0,Math.min(a,j.getLineCount()-1)),g=j.getLineStart(a),h=0;c===void 0&&(c=0);typeof b==="string"?(a=j.getLine(a).indexOf(b),a!==-1&&(h=a,c=h+b.length)):(h=b,b=j.getLineEnd(a)-g,h=Math.min(h,b),c=Math.min(c,b));this.moveSelection(g+h,g+c,e)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
g.EventTarget.addMixin(a.prototype);if(!Function.prototype.bind)Function.prototype.bind=j;return{Editor:a}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/regex,orion/objects,orion/util".split(","),function(h,k,g,e,c,b,a){function j(a){var b=a.getTextView();g.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,f=b.getModel(),e=b.mapOffset(a.start),b=b.mapOffset(a.end),f=f.getText(e,b);if((f=d._prefix.match(RegExp("^"+c.escape(f),"i")))&&f.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 d(a,b,d){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 c=this;this._listeners={onEditorFocus:function(a){c._removeCurrentAnnotation(a)}};this.setOptions(d)}}var f={};j.prototype=new g.KeyMode;b.mixin(j.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 d=this._prefix;if(d.length===0)return!1;var c=this.editor,f=c.getModel(),f=a?this._success?b?this._start:c.getCaretOffset()+
1:0:this._success?b?this._start:c.getCaretOffset():f.getCharCount()-1;if(d=c.getModel().find({string:d,start:f,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next()){if(!b)this._start=f;this._ignoreSelection=this._success=!0;c.moveSelection(a?d.start:d.end,a?d.end:d.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 b;b=this._forward?this._success?h.incrementalFindStr:h.incrementalFindStrNotFound:this._success?h.incrementalFindReverseStr:h.incrementalFindReverseStrNotFound;b=a.formatMessage(b,this._prefix);this.editor.reportStatus(b,this._success?"":"error")}else this.editor.reportStatus("")}});
f.IncrementalFind=j;d.prototype={find:function(a,b,d){this.setOptions({reverse:!a});var c=this.getFindString(),f;if(b)c=b.findString||c,f=b.count;a=this.getOptions();this.setOptions(b);b=d?this._startOffset:this.getStartOffset();if((f=this._doFind(c,b,f))&&!d)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection();return this._editor.getText(a.start,a.end)||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1;
if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();this._editor.getTextView().removeEventListener("Focus",this._listeners.onEditorFocus);this._editor.getTextView().focus()},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,d=this.getReplaceString(),c=b.getSelection().start;if(b=b.getModel().find({string:a,start:c,reverse:!1,wrap:this._wrap,
regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),this._doReplace(b.start,b.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var b=this.getFindString();if(b){this._replacingAll=!0;var d=this._editor,c=d.getTextView();d.reportStatus(h.replaceAll);var f=this.getReplaceString(),e=this;window.setTimeout(function(){for(var j=0,g=0;;){var k=e._doFind(b,j);if(!k)break;g++;g===1&&(c.setRedraw(!1),
e.startUndo());e._doReplace(k.start,k.end,b,f);j=e.getStartOffset()}g>0&&(e.endUndo(),c.setRedraw(!0));j>0?d.reportStatus(a.formatMessage(h.replacedMatches,g)):d.reportStatus(h.nothingReplaced,"error");e._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(e.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===
!0||a.caseInsensitive===!1)this._caseInsensitive=a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===
!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&
b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,b,d){var d=d||1,c=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=c.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),f,b=0;b<d&&a.hasNext();b++)f=
a.next();if(!this._replacingAll){f?this._editor.reportStatus(""):this._editor.reportStatus(h.notFound,"error");if(this.isVisible()){d=e.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=c.getAnnotationModel())a.removeAnnotations(d),f&&a.addAnnotation(e.AnnotationType.createAnnotation(d,f.start,f.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var j=this;this._timer=window.setTimeout(function(){j._markAllOccurrences();j._timer=null},500)}}this._findCallback?this._findCallback(f):
f&&c.moveSelection(f.start,f.end,null,!1)}return f},_doReplace:function(a,b,d,c){var f=this._editor;if(this._regex&&(c=f.getText(a,b).replace(RegExp(d,this._caseInsensitive?"i":""),c),!c))return;f.setText(c,a,b);f.setSelection(a,a+c.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=e.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(0,a.getTextModel().getCharCount()),c=[],f;d.hasNext();){var j=d.next();j.type===b&&c.push(j)}if(this.isVisible()){d=
this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)j=d.next(),f.push(e.AnnotationType.createAnnotation(b,j.start,j.end))}a.replaceAnnotations(c,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};f.Find=d;return f});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(h,k,g,e,c,b){function a(a,b,d){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=d?d:new c.Find(a,b);this._lastEditLocation=null;this.init()}function j(a,b,d,c){this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedMode=c;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var d={};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:h.undo});a.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:h.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(h.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:h.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:h.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:h.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:h.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:h.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:h.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:h.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:h.moveLinesDown});
a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:h.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:h.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:h.deleteLines});a.setKeyBinding(new k.KeyBinding("l",
!b.isMac,!1,!1,b.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:h.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:h.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:h.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:h.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:h.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:h.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:h.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!b.isMac,!1,!1,b.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:h.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),e=b.getLineStart(c),
c=b.getLineEnd(d,!0),j=b.getLineCount(),g="",e=b.getText(e,c);d===j-1&&(e=(g=b.getLineDelimiter())+e);a.setText(e,c,c);a.setSelection(c+g.length,c+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),c=b.getLineStart(c),e=b.getLineEnd(d,!0),j=b.getLineCount(),g="",e=b.getText(c,e);d===j-1&&(e+=g=b.getLineDelimiter());a.setText(e,
c,c);a.setSelection(c,c+e.length-g.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=1;if(a&&a.count)d=a.count;var c=b.getSelection(),e=b.getModel(),j=e.getLineAtOffset(c.start),a=e.getLineStart(j),d=c.start!==c.end||d===1?e.getLineAtOffset(c.end>c.start?c.end-1:c.end):Math.min(j+d-1,e.getLineCount()-1),d=e.getLineEnd(d,!0);b.setText("",a,d);return!0},expandAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;
var c=b.getModel(),e=b.getCaretOffset(),j=c.getLineAtOffset(e),e=c.getLineStart(j),j=c.getLineEnd(j,!0);c.getBaseModel&&(e=c.mapOffset(e),j=c.mapOffset(j),c.getBaseModel());for(var h,c=d.getAnnotations(e,j);!h&&c.hasNext();)e=c.next(),e.type===g.AnnotationType.ANNOTATION_FOLDING&&(h=e);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()),d.modifyAnnotation(h));return!0},expandAnnotations:function(a){var b=this.editor,d=b.getTextView(),c=b.getAnnotationModel();if(!c)return!0;var b=
b.getModel(),e=c.getAnnotations(0,b.getCharCount());for(d.setRedraw(!1);e.hasNext();)b=e.next(),b.type===g.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),c.modifyAnnotation(b));d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var d=a.getModel(),c=a.getSelection(),e=d.getLineAtOffset(c.start),j=d.getLineAtOffset(c.end>c.start?c.end-1:c.end);if(e!==j){var g=[];g.push("");
for(var h=e;h<=j;h++)g.push(d.getLine(h,!0));h=d.getLineStart(e);d=d.getLineEnd(j,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(g.join(b),h,d);a.setSelection(h===c.start?c.start:c.start+b.length,c.end+(j-e+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(h.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(),d=a.getSelection(),c=b.getLineAtOffset(d.start),e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),j=b.getLineCount();if(e===j-1)return!0;var c=b.getLineStart(c),d=b.getLineEnd(e,!0),g=b.getLineEnd(e+1,!0)-(d-c),h=0;e!==j-2?b=b.getText(c,d):(e=b.getLineEnd(e),b=b.getText(e,d)+b.getText(c,e),h+=d-e);this.startUndo();
a.setText("",c,d);a.setText(b,g,g);a.setSelection(g+h,g+h+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start);if(c===0)return!0;var e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),j=b.getLineCount(),d=b.getLineStart(c-1),g=b.getLineStart(c),h=b.getLineEnd(e,!0),k=b.getText(g,h),t=0;e===j-1&&(e=b.getLineEnd(c-1),c=b.getLineEnd(c-1,!0),k+=b.getText(e,c),g=e,
t=c-e);this.startUndo();a.setText("",g,h);a.setText(k,d,d);a.setSelection(d,d+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;for(var c=b.getModel(),j=b.getCaretOffset(),d=d.getAnnotations(a?j:0,a?c.getCharCount():j),h=null;d.hasNext();){var k=d.next();if(a){if(k.start<=j)continue}else if(k.start>=j)continue;switch(k.type){case g.AnnotationType.ANNOTATION_ERROR:case g.AnnotationType.ANNOTATION_WARNING:case g.AnnotationType.ANNOTATION_TASK:case g.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}h=k;if(a)break}if(h){var p=b.getTextView(),q=c.getLineAtOffset(h.start),t=e.Tooltip.getTooltip(p);if(!t)return b.moveSelection(h.start),!0;b.moveSelection(h.start,h.start,function(){t.setTarget({getTooltipInfo:function(){var a=p.convert({x:p.getLocationAtOffset(h.start).x,y:p.getLocationAtOffset(c.getLineStart(q)).y},"document","page");return{contents:[h],x:a.x,y:a.y+Math.floor(p.getLineHeight(q)*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 d=a.getModel(),c=a.getSelection(),e=d.getLineAtOffset(c.start),j=d.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getOptions("tabSize"),h=Array(g+1).join(" "),k=[],t=b=0,n=e;n<=j;n++){var v=d.getLine(n,!0);if(d.getLineStart(n)!==d.getLineEnd(n))if(v.indexOf("\t")===0)v=v.substring(1),b++;else if(v.indexOf(h)===0)v=v.substring(g),b+=g;else return!0;n===e&&(t=b);k.push(v)}e=d.getLineStart(e);g=d.getLineEnd(j,!0);d=d.getLineStart(j);
a.setText(k.join(""),e,g);j=e===c.start?c.start:c.start-t;c=Math.max(j,c.end-b+(c.end===d+1&&c.start!==c.end?1:0));a.setSelection(j,c);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.TextActions=a;j.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(191,!0),"toggleLineComment");a.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:h.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!b.isMac,!1,b.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:h.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!b.isMac,!1,b.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:h.removeBlockComment})},autoIndent:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var d=a.getModel(),c=d.getLineAtOffset(b.start),e=d.getLine(c,!0),j=d.getLineStart(c),c=0,j=b.start-j,g;c<j&&((g=e.charCodeAt(c))===32||g===9);)c++;if(c>0){for(var h=e.substring(0,c),c=j;c<e.length&&((g=e.charCodeAt(c++))===32||g===9);)b.end++;a.setText(d.getLineDelimiter()+h,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=this._findEnclosingComment(b,d.start,d.end);if(c.commentStart!==void 0&&c.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;var c=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(e-c));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],d=0;d<a.positions.length;++d)b[d]={positions:[{offset:a.positions[d].offset,length:a.positions[d].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},_findEnclosingComment:function(a,b,d){var c=a.getLineAtOffset(b),e=a.getLineAtOffset(d),j,g,h,
k,t,n;for(j=c;j>=0;j--)if(g=a.getLine(j),h=j===c?b-a.getLineStart(c):g.length,k=g.lastIndexOf("/*",h),g=g.lastIndexOf("*/",h),g>k)break;else if(k!==-1){t=a.getLineStart(j)+k;break}for(j=e;j<a.getLineCount();j++)if(g=a.getLine(j),h=j===e?d-a.getLineStart(e):0,k=g.indexOf("/*",h),g=g.indexOf("*/",h),k!==-1&&k<g)break;else if(g!==-1){n=a.getLineStart(j)+g;break}return{commentStart:t,commentEnd:n}},lineStart:function(){for(var a=this.editor,b=a.getModel(),d=a.getCaretOffset(),c=b.getLineAtOffset(d),e=
b.getLineStart(c),b=b.getLine(c),c=0;c<b.length;c++){var j=b.charCodeAt(c);if(!(j===32||j===9))break}c+=e;return d!==c?(a.setSelection(c,c),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getText(d.start,d.end),e,j,g;for(g=0;g<c.length;g++)if(c.substring(g,g+2)==="/*"){e=d.start+g;break}for(;g<c.length;g++)if(c.substring(g,g+2)==="*/"){j=d.start+g;break}if(e!==void 0&&j!==void 0)a.setText(b.getText(e+
2,j),e,j+2),a.setSelection(e,j);else{c=this._findEnclosingComment(b,d.start,d.end);if(c.commentStart===void 0||c.commentEnd===void 0)return!0;b=b.getText(c.commentStart+2,c.commentEnd);a.setText(b,c.commentStart,c.commentEnd+2);a.setSelection(d.start-2,d.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),j=!0,g=[],h,
k,t=c;t<=e;t++)if(h=b.getLine(t,!0),g.push(h),!j||(k=h.indexOf("//"))===-1)j=!1;else if(k!==0){var n;for(n=0;n<k;n++)if(j=h.charCodeAt(n),!(j===32||j===9))break;j=n===k}t=b.getLineStart(c);n=b.getLineEnd(e,!0);if(j){for(j=0;j<g.length;j++)h=g[j],k=h.indexOf("//"),g[j]=h.substring(0,k)+h.substring(k+2);g=g.join("");h=b.getLineStart(e);b=t===d.start?d.start:d.start-2;d=d.end-2*(e-c+1)+(d.end===h+1?2:0)}else g.splice(0,0,""),g=g.join("//"),b=t===d.start?d.start:d.start+2,d=d.end+2*(e-c+1);a.setText(g,
t,n);a.setSelection(b,d);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.SourceCodeActions=j;return d});
define("orion/editor/undoStack",[],function(){function h(e,c,b){this.offset=e;this.text=c;this.previousText=b}function k(e){this.owner=e;this.changes=[]}function g(e,c){this.view=e;this.size=c!==void 0?c:100;this.reset();var b=e.getModel();b.getBaseModel&&(b=b.getBaseModel());this.model=b;var a=this;this._listener={onChanging:function(b){a._onChanging(b)},onDestroy:function(b){a._onDestroy(b)}};b.addEventListener("Changing",this._listener.onChanging);e.addEventListener("Destroy",this._listener.onDestroy)}
h.prototype={undo:function(e,c){this._doUndoRedo(this.offset,this.previousText,this.text,e,c);return!0},redo:function(e,c){this._doUndoRedo(this.offset,this.text,this.previousText,e,c);return!0},_doUndoRedo:function(e,c,b,a,j){var d=a.getModel();if(d.mapOffset&&a.annotationModel){var f=d.mapOffset(e,!0);if(f<0)for(var i=a.annotationModel.getAnnotations(e,e+1);i.hasNext();){var g=i.next();if(g.type==="orion.annotation.folding"){g.expand();f=d.mapOffset(e,!0);break}}if(f<0)return;e=f}d.setText(c,e,
e+b.length);j&&a.setSelection(e,e+c.length)}};k.prototype={add:function(e){this.changes.push(e)},end:function(e){this.endSelection=e.getSelection();this.endCaret=e.getCaretOffset();(e=this.owner)&&e.end&&e.end()},undo:function(e,c){this.changes.length>1&&e.setRedraw(!1);for(var b=this.changes.length-1;b>=0;b--)this.changes[b].undo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var b=this.startSelection.start,a=this.startSelection.end;e.setSelection(this.startCaret?b:a,this.startCaret?a:b)}(b=
this.owner)&&b.undo&&b.undo();return this.changes.length>0},redo:function(e,c){this.changes.length>1&&e.setRedraw(!1);for(var b=0;b<this.changes.length;b++)this.changes[b].redo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var b=this.endSelection.start,a=this.endSelection.end;e.setSelection(this.endCaret?b:a,this.endCaret?a:b)}(b=this.owner)&&b.redo&&b.redo();return this.changes.length>0},start:function(e){this.startSelection=e.getSelection();this.startCaret=e.getCaretOffset();(e=this.owner)&&
e.start&&e.start()}};g.prototype={add:function(e){this.compoundChange?this.compoundChange.add(e):(this.stack.splice(this.index,this.stack.length-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--,this.cleanIndex--))},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>
0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){var e=this.index,c=this.stack.length;this._undoStart!==void 0&&e++;return{undo:e,redo:c-e}},undo:function(){this._commitUndo();var e;e=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(e=e.undo(this.view,!0)));this._ignoreUndo=!1;return e},redo:function(){this._commitUndo();var e;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
e=this.stack[this.index++]}while(!e.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=void 0;this._undoText="";this._undoType=0;this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(e){this._commitUndo();e=new k(e);this.add(e);this.compoundChange=e;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){if(this._undoStart!==void 0)this._undoType===-1?this.add(new h(this._undoStart,
"",this._undoText)):this.add(new h(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0;this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(e){var c=e.text,b=e.start,a=e.removedCharCount,e=e.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(e===1&&a===0&&this._undoType===1&&b===this._undoStart+
this._undoText.length||e===0&&a===1&&this._undoType===-1&&(b+1===this._undoStart||b===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(e===1&&a===0){if(this._undoStart===void 0)this._undoStart=b;this._undoText+=c;this._undoType=1;return}else if(e===0&&a===1){c=this._undoText.length>0&&this._undoStart===b;this._undoStart=b;this._undoType=-1;c?this._undoText+=this.model.getText(b,b+a):this._undoText=this.model.getText(b,b+a)+this._undoText;return}this.add(new h(b,c,this.model.getText(b,
b+a)))}}};return{UndoStack:g}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(h,k,g,e){function c(a,b,d,c){this._location=b||"left";this._overview=d||"page";this._rulerStyle=c;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function b(a,b,d,e,j){c.call(this,a,b,"page",d);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=j||{style:{backgroundColor:"white"}};this._numOfDigits=0}function a(a,b,d){c.call(this,a,b,"page",d)}function j(a,b,d){c.call(this,a,b,"document",d)}function d(b,d,c){a.call(this,b,d,c)}c.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var c=this._view.getModel(),e=c.getLineStart(a),j=c.getLineEnd(b-1),g=c;c.getBaseModel&&(g=c.getBaseModel(),e=c.mapOffset(e),j=c.mapOffset(j));for(var h=[],d=this.getAnnotationsByType(d,e,j),e=0;e<d.length;e++)for(var j=
d[e],k=g.getLineAtOffset(j.start),t=g.getLineAtOffset(Math.max(j.start,j.end-1)),n=k;n<=t;n++){var v=n;if(c!==g){v=g.getLineStart(n);v=c.mapOffset(v,!0);if(v===-1)continue;v=c.getLineAtOffset(v)}if(a<=v&&v<b){var w=this._mergeAnnotation(h[v],j,n-k,t-k+1);w&&(h[v]=w)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var u in h)h[u]._multiple&&(h[u].html+=this._multiAnnotationOverlay.html);return h},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,d=b.getModel(),c=d,e=d.getLineStart(a),j=e,h=this._annotationModel;if(h){j=b.getSelection();b=Math.max(j.start,j.end);j=d.getLineEnd(a,!0);e<=b&&b<d.getLineEnd(a)&&(e=b+1);d.getBaseModel&&
(e=d.mapOffset(e),j=d.mapOffset(j),c=d.getBaseModel());for(var k,a=h.getAnnotations(e,j);!k&&a.hasNext();)j=a.next(),this.isAnnotationTypeVisible(j.type)&&(k=j);k&&c.getLineAtOffset(k.start)===c.getLineAtOffset(e)?(e=k.start,j=k.end):j=e;d.getBaseModel&&(e=d.mapOffset(e,!0),j=d.mapOffset(j,!0))}(d=g.Tooltip.getTooltip(this._view))&&d.setTarget(null);this._view.setSelection(j,e,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var d=g.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var c=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return c._getTooltipInfo(c._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=g.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var d=this._view,c=d.getModel(),e=this._annotationModel,j=[];if(e){var j=c.getLineStart(a),g=c.getLineEnd(a);c.getBaseModel&&(j=c.mapOffset(j),g=c.mapOffset(g));
j=this.getAnnotationsByType(e,j,g)}e=this._getTooltipContents(a,j);if(!e)return null;e={contents:e,anchor:this.getLocation()};j=d.getClientArea();j.y=this.getOverview()==="document"?d.convert({y:b},"view","document").y:d.getLocationAtOffset(c.getLineStart(a)).y;d.convert(j,"document","page");e.x=j.x;e.y=j.y;e.anchor==="right"&&(e.x+=j.width);return e}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var f=0;f<a.length;f++)if(e.isAnnotationTypeVisible(a[f].type)){var j=
a[f].start,i=a[f].end;c.getBaseModel&&(j=c.mapOffset(j,!0),i=c.mapOffset(i,!0));j!==-1&&i!==-1&&d.redrawLines(c.getLineAtOffset(j),c.getLineAtOffset(Math.max(j,i-1))+1,e)}}var d=this._view;if(d){var c=d.getModel(),e=this,j=c.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,c.getBaseModel&&(a=c.mapOffset(a,!0)),a=c.getLineAtOffset(a),d.redrawLines(a,j,e)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d){a||(a={});if(d===0)if(a.html&&b.html){if(b.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var d;if(b.style){if(!a.style)a.style={};for(d in b.style)a.style[d]||(a.style[d]=b.style[d])}if(b.attributes){if(!a.attributes)a.attributes={};for(d in b.attributes)a.attributes[d]||
(a.attributes[d]=b.attributes[d])}}return a}};k.AnnotationTypeList.addMixin(c.prototype);b.prototype=new c;b.prototype.getAnnotations=function(a,b){for(var d=c.prototype.getAnnotations.call(this,a,b),e=this._view.getModel(),j=a;j<b;j++){var g=j&1?this._oddStyle:this._evenStyle,h=j;e.getBaseModel&&(h=e.getLineStart(h),h=e.getBaseModel().getLineAtOffset(e.mapOffset(h)));d[j]||(d[j]={});d[j].html=h+1+"";if(!d[j].style)d[j].style=g}return d};b.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};b.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),d=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==d)this._numOfDigits=d,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};a.prototype=new c;j.prototype=new c;j.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};j.prototype._getTooltipContents=
function(a,b){if(b.length===0){var d=this._view.getModel(),j=a;d.getBaseModel&&(j=d.getLineStart(j),j=d.getBaseModel().getLineAtOffset(d.mapOffset(j)));return e.formatMessage(h.line,j+1)}return c.prototype._getTooltipContents.call(this,a,b)};j.prototype._mergeAnnotation=function(a,b,d,c){if(d===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*c+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};d.prototype=new a;d.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var d=this._view.getModel(),c=d.getLineStart(a),a=d.getLineEnd(a,!0);d.getBaseModel&&(c=d.mapOffset(c),a=d.mapOffset(a),d=d.getBaseModel());for(var e,b=b.getAnnotations(c,a);!e&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(e=a);e&&d.getLineAtOffset(e.start)===d.getLineAtOffset(c)&&((d=g.Tooltip.getTooltip(this._view))&&d.setTarget(null),e.expanded?e.collapse():e.expand(),this._annotationModel.modifyAnnotation(e))}}};d.prototype._getTooltipContents=function(b,d){return d.length===
1&&d[0].expanded?null:a.prototype._getTooltipContents.call(this,b,d)};d.prototype._onAnnotationModelChanged=function(b){function d(a){for(g=0;g<a.length;g++)if(j.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;e.getBaseModel&&(b=e.mapOffset(b,!0));b!==-1&&(k=Math.min(k,e.getLineAtOffset(b)))}}if(b.textModelChangedEvent)a.prototype._onAnnotationModelChanged.call(this,b);else{var c=this._view;if(c){var e=c.getModel(),j=this,g,h=e.getLineCount(),k=h;d(b.added);d(b.removed);d(b.changed);b=c.getRulers();
for(g=0;g<b.length;g++)c.redrawLines(k,h,b[g])}}};return{Ruler:c,AnnotationRuler:a,LineNumberRuler:b,OverviewRuler:j,FoldingRuler:d}});
define("orion/editor/textDND",[],function(){function h(h,g){this._view=h;this._undoStack=g;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var e=this;this._listener={onDragStart:function(c){e._onDragStart(c)},onDragEnd:function(c){e._onDragEnd(c)},onDragEnter:function(c){e._onDragEnter(c)},onDragOver:function(c){e._onDragOver(c)},onDrop:function(c){e._onDrop(c)},onDestroy:function(c){e._onDestroy(c)}};h.addEventListener("DragStart",this._listener.onDragStart);h.addEventListener("DragEnd",
this._listener.onDragEnd);h.addEventListener("DragEnter",this._listener.onDragEnter);h.addEventListener("DragOver",this._listener.onDragOver);h.addEventListener("Drop",this._listener.onDrop);h.addEventListener("Destroy",this._listener.onDestroy)}h.prototype={destroy:function(){var h=this._view;if(h)h.removeEventListener("DragStart",this._listener.onDragStart),h.removeEventListener("DragEnd",this._listener.onDragEnd),h.removeEventListener("DragEnter",this._listener.onDragEnter),h.removeEventListener("DragOver",
this._listener.onDragOver),h.removeEventListener("Drop",this._listener.onDrop),h.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(h){var g=this._view,e=g.getSelection(),g=g.getModel();if(g.getBaseModel)e.start=g.mapOffset(e.start),e.end=g.mapOffset(e.end),g=g.getBaseModel();if(g=g.getText(e.start,e.end))this._dragSelection=e,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",g)},_onDragEnd:function(h){var g=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(h=h.event.dataTransfer.dropEffect==="move")&&g.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var e=this._dropText,c=this._dropOffset;if(h)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;g.setText(e,c,c);g.setSelection(c,c+e.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(h){this._onDragOver(h)},_onDragOver:function(h){var g=h.event.dataTransfer.types;if(g){var e=!this._view.getOptions("readonly");e&&(e=g.contains?g.contains("text/plain"):g.indexOf("text/plain")!==-1);if(!e)h.event.dataTransfer.dropEffect="none"}},_onDrop:function(h){var g=this._view,e=h.event.dataTransfer.getData("Text");if(e)h=g.getOffsetAtLocation(h.x,h.y),this._dragSelection?(this._dropOffset=h,this._dropText=e):
(g.setText(e,h,h),g.setSelection(h,h+e.length))}};return{TextDND:h}});
define("orion/editor/templates",[],function(){function h(g,e,c){this.prefix=g;this.description=e;this.template=c;this._parse()}function k(g,e){this._keywords=g||[];this._templates=[];this.addTemplates(e||[])}h.prototype={getProposal:function(g,e,c){var g=e-g.length,e={},b,a=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(a+=c.indentation);for(var j=c.tab!==void 0?c.tab:"\t",d=0,f=this.variables,i=this.segments,c=[],h=0;h<i.length;h++){var k=i[h],m=f[k];if(m!==void 0)switch(k){case "${tab}":k=
j;break;case "${delimiter}":k=a;break;case "${cursor}":k="";b=d;break;default:var s=e[k];s||(s=e[k]={data:m.data,positions:[]});k=m.substitution;s.data&&s.data.values&&(k=s.data.values[0]);s.positions.push({offset:g+d,length:k.length})}c.push(k);d+=k.length}var a=[],r;for(r in e)e.hasOwnProperty(r)&&a.push(e[r]);c=c.join("");if(b===void 0)b=c.length;return{proposal:c,description:this.description,groups:a,escapePosition:g+b}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,e=[],c={},b,a=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(j,d,f){var i=j.substring(2,j.length-1),d=j,h=i,k=null,m=h.indexOf(":");m!==-1&&(h=h.substring(0,m),d="${"+h+"}",k=JSON.parse(i.substring(m+1).replace("\\}","}").trim()));(i=c[d])||(i=c[d]={});i.substitution=h;if(k)i.data=k;(b=g.substring(a,f))&&e.push(b);e.push(d);a=f+j.length;return h});(b=g.substring(a,g.length))&&e.push(b);this.segments=e;this.variables=c}};
k.prototype={addTemplates:function(g){for(var e=this.getTemplates(),c=0;c<g.length;c++)e.push(new h(g[c].prefix,g[c].description,g[c].template))},computeProposals:function(g,e,c){var b=this.getPrefix(g,e,c),a=[];if(!this.isValid(b,g,e,c))return a;a=a.concat(this.getTemplateProposals(b,e,c));return a=a.concat(this.getKeywordProposals(b))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var e=[],c=this.getKeywords();if(c)for(var b=0;b<c.length;b++)c[b].indexOf(g)===0&&
e.push({proposal:c[b].substring(g.length),description:c[b]});return e},getPrefix:function(g,e,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,e,c){for(var b=[],a=this.getTemplates(),j=0;j<a.length;j++){var d=a[j];d.match(g)&&(d=d.getProposal(g,e,c),this.removePrefix(g,d),b.push(d))}return b},removePrefix:function(g,e){if(!(e.overwrite=e.proposal.substring(0,g.length)!==g))e.proposal=e.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:h,
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(h,k,g,e,c,b){function a(a,b,c){var e=a.getTextView();g.KeyMode.call(this,e);this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,d,c;b;)if(d=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),c=d.position,c===void 0||c.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;c=a.addedCharCount-a.removedCharCount;d=d.positions;for(var e,f,j=0;j<d.length;++j){f=d[j];e=f.position;var i=e.offset<=a.start&&a.start<=e.offset+e.length;i&&!f.ansestor?(e.offset+=b,e.length+=c,b+=c):(e.offset+=b,f.ansestor&&i&&(e.length+=
c));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,d,c;b;)if(d=this._getPositionChanged(b,a.start,a.end),c=d.position,c===void 0||c.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var e=this._compoundChange;e?e.owner.model===b&&e.owner.group===c.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=c.group;var e=0,f=a.text.length-(a.end-
a.start);d=d.positions;for(var j,i,g=a.start-c.position.offset,h=a.end-c.position.offset,k=0;k<d.length;++k)if(i=d[k],j=i.position,i.oldOffset=j.offset,i.model===b&&i.group===c.group?(j.offset+=e,j.length+=f,e+=f):(j.offset+=e,i.ansestor&&(j.length+=c.count*f)),i.escape)i.model.escapePosition=j.offset;this.ignoreVerify=!0;e=this.editor.getTextView();for(k=d.length-1;k>=0;k--)i=d[k],i.model===b&&i.group===c.group&&e.setText(a.text,i.oldOffset+g,i.oldOffset+h);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(d)}}}.bind(this)}}
var j={};a.prototype=new g.KeyMode;b.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(h.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var c=this.editor.getTextView();c.removeKeyMode(this);c.removeEventListener("Verify",this.linkedModeListener.onVerify);c.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);
e.offset=void 0;this.editor.reportStatus(h.linkedModeExited,null,!0);a&&c.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(a){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=a;var a=b.groups[a],e=a.positions[0],j=this.editor.getTextView();j.setSelection(e.offset,e.offset+e.length);if(b=this.contentAssist)if(b.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=j.getSelection();return a.start===a.end&&(a=j.getCaretOffset(),e.offset<=a&&a<=e.offset+e.length)?j.getText(e.offset,
a):""},b.offset=e.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var e=b.groups,j=0;j<e.length;j++)for(var g=e[j].positions,h=0;h<g.length;h++){var k=g[h];c&&(k={offset:k.offset+c,length:k.length});k={index:h,group:j,count:g.length,model:b,position:k};a.push(k);if(b.nextModel&&b.nextModel.parentGroup===j)k.ansestor=!0,this._getModelPositions(a,b.nextModel,
(c||0)+g[h].offset-g[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 e,a=this._getSortedPositions(a),j=a.length-1;j>=0;j--){var g=a[j].position;
if(g.offset<=b&&c<=g.offset+g.length){e=a[j];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],j=[],g=b.getTextModel(),g=b.getAnnotations(0,g.getCharCount()),h;g.hasNext();)switch(h=g.next(),h.type){case e.AnnotationType.ANNOTATION_LINKED_GROUP:case e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(h)}if(g=this.linkedModeModel)for(var a=a||this._getSortedPositions(g),
k=0;k<a.length;k++)if(h=a[k],h.model===g){var r=e.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===g.selectedGroupIndex&&(r=h.index===0?e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=e.AnnotationType.createAnnotation(r,h.offset,h.offset+h.length,"");j.push(h)}b.replaceAnnotations(c,j)}}});j.LinkedMode=a;return j});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(h,k,g,e,c,b){function a(){}function j(){}function d(){}function f(){}function i(){}function l(){}var o={};a.prototype={createKeyBindings:function(a,d,c,e){var e=new h.TextActions(a,d,e),f=new b.LinkedMode(a,d,c),a=new h.SourceCodeActions(a,d,c,f);return{textActions:e,linkedMode:f,sourceCodeActions:a}}};o.KeyBindingsFactory=
a;j.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};o.UndoFactory=j;d.prototype={createLineNumberRuler:function(a){return new g.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};o.LineNumberRulerFactory=d;f.prototype={createFoldingRuler:function(a){return new g.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};o.FoldingRulerFactory=f;i.prototype={createAnnotationModel:function(a){return new e.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new e.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new g.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new g.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};o.AnnotationFactory=i;l.prototype={createTextDND:function(a,b){return new c.TextDND(a.getTextView(),b)}};o.TextDNDFactory=l;return o});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(h,k,g){var e={};e.KeyBindingsFactory=h.KeyBindingsFactory;e.UndoFactory=h.UndoFactory;e.LineNumberRulerFactory=h.LineNumberRulerFactory;e.FoldingRulerFactory=h.FoldingRulerFactory;e.AnnotationFactory=h.AnnotationFactory;e.TextDNDFactory=h.TextDNDFactory;e.TextActions=k.TextActions;e.SourceCodeActions=k.SourceCodeActions;e.LinkedMode=g.LinkedMode;return e});
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(h,k,g){var e=e||{};e.TwoWayCompareUIFactory=function(){function c(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}c.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=h.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=h.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=h.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=h.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=h.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=h.node("right_title_id");this._rightTitleDiv.id=
b+"right_title_id";this._leftStatusDiv=h.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=h.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=h.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=h.$(".split",this._topWidgetDiv);b.id=this._splitterId;var a=h.$(".leftPanelLayout",this._topWidgetDiv),c=h.$(".rightPanelLayout",this._topWidgetDiv);if(b&&a&&c)this._splitter=new k.Splitter({node:b,sidePanel:a,mainPanel:c})},buildUI:function(){h.node(this._parentDivID).innerHTML=
g;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return h.$(".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 c}();return e});
var JsDiff=function(){function h(a){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push(a[c]);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 g=function(a){this.ignoreWhitespace=a};g.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),c=b.length,e=a.length,g=c+e,h=[{newPos:-1,components:[]}],k=this.extractCommon(h[0],
b,a,0);if(h[0].newPos+1>=c&&k+1>=e)return h[0].components;for(var s=1;s<=g;s++)for(var r=-1*s;r<=s;r+=2){var p;p=h[r-1];var q=h[r+1],k=(q?q.newPos:0)-r;p&&(h[r-1]=void 0);var t=p&&p.newPos+1<c,n=q&&0<=k&&k<e;if(!t&&!n)h[r]=void 0;else if(!t||n&&p.newPos<q.newPos?(p={newPos:q.newPos,components:q.components.slice(0)},this.pushComponent(p.components,a[k],void 0,!0)):(p={newPos:p.newPos,components:p.components.slice(0)},p.newPos++,this.pushComponent(p.components,b[p.newPos],!0,void 0)),k=this.extractCommon(p,
b,a,r),p.newPos+1>=c&&k+1>=e)return p.components;else h[r]=p}},pushComponent:function(a,b,c,e){var g=a[a.length-1];g&&g.added===c&&g.removed===e?a[a.length-1]={value:this.join(g.value,b),added:c,removed:e}:a.push({value:b,added:c,removed:e})},extractCommon:function(a,b,c,e){for(var g=b.length,h=c.length,k=a.newPos,e=k-e;k+1<g&&e+1<h&&this.equals(b[k+1],c[e+1]);)k++,e++,this.pushComponent(a.components,b[k],void 0,void 0);a.newPos=k;return e},equals:function(a,b){var c=/\S/;return this.ignoreWhitespace&&
!c.test(a)&&!c.test(b)?!0:a==b},join:function(a,b){return a+b},tokenize:function(a){return a}};var e=new g,c=new g(!1);c.tokenize=function(a){return h(a.split(/(\s+|\b)/))};var b=new g(!0);b.tokenize=function(a){return h(a.split(/([{}:;,]|\s+)/))};var a=new g;a.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return e.diff(a,b)},diffWords:function(a,b){return c.diff(a,b)},diffLines:function(b,d){return a.diff(b,d)},diffCss:function(a,d){return b.diff(a,d)},createPatch:function(b,
d,c,e,g){var h=[];h.push("Index: "+b);h.push("===================================================================");h.push("--- "+b+"\t"+e);h.push("+++ "+b+"\t"+g);b=a.diff(d,c);b.push({value:"",lines:[]});for(var c=d=0,e=[],k=g=1,s=0;s<b.length;s++){var r=b[s],p=r.lines||r.value.replace(/\n$/,"").split("\n");r.lines=p;if(r.added||r.removed){if(!d){var q=b[s-1],d=g,c=k;q&&(e.push.apply(e,q.lines.slice(-4).map(function(a){return" "+a})),d-=4,c-=4)}e.push.apply(e,p.map(function(a){return(r.added?"+":
"-")+a}));r.added?k+=p.length:g+=p.length}else d&&(p.length<=8&&s<b.length-1?e.push.apply(e,p.map(function(a){return" "+a})):(q=Math.min(p.length,4),h.push("@@ -"+d+","+(g-d+q)+" +"+c+","+(k-c+q)+" @@"),h.push.apply(h,e),h.push.apply(h,p.slice(0,q).map(function(a){return" "+a})),c=d=0,e=[])),g+=p.length,k+=p.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];
e.added?b.push("<ins>"):e.removed&&b.push("<del>");b.push(k(e.value));e.added?b.push("</ins>"):e.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(h){var k=k||{};k.JSDiffAdapter=function(){function g(){}g.prototype={_specialLine:function(e,c,b){return c.value===e&&b!==e},adapt:function(e,c,b){b||(b="\n");for(var a=e.split(b),j=c.split(b),d=a[a.length-1]==="",j=j[j.length-1]==="",f=h.diffLines(e,c),e=[],c=[],i=0,g=0,k=-1,m=0,s=!0,r=b,p=0;p<f.length;p++){var q=f[p],t=q.lines||q.value.split(b),n=t.length,v=0;t.length>1&&t[t.length-1]===""&&n--;n>1&&!s&&t[0]===""&&(n--,v++);q.lines=t;
if(!q.added&&!q.removed){if(!this._specialLine(b,q,r)){if(i||g)e.push([i,g,k]),g=i=0,k=-1,m+=g;e.push([n,n,0]);m+=n}}else if(q.added){k===-1&&(k=c.length+1);i+=n;for(s=v;s<n+v;s++)c.push(q.lines[s])}else g+=n;s=!1;t.length>1&&t[t.length-1]===""&&(s=!0);r=q.value?q.value[q.value.length-1]:b}if(i||g)e.push([i,g,k]),m+=g;m<a.length&&a.length>1&&(b=e[e.length-1],b[2]===0?(b[0]+=1,b[1]+=1):b[2]===-1?e.push([1,1,0]):d===j?e.push([1,1,0]):(j&&(b[0]+=1),d&&(b[1]+=1)));return{mapper:e,changContents:{array:c,
index:0}}},adaptCharDiff:function(e,c,b){for(var e=b?h.diffWords(e,c):h.diffChars(e,c),c=[],a=b=0,j=0,d=0,f=0;f<e.length;f++){var i=e[f];if(!i.added&&!i.removed){if(j>0||d>0)c.push([a,a+j,b,b+d]),a+=j,b+=d,d=j=0;a+=i.value.length;b+=i.value.length}else i.added?j+=i.value.length:d+=i.value.length}(j>0||d>0)&&c.push([a,a+j,b,b+d]);return c}};return g}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(h,k,g,e){var c={},b,a,j,d,f,i,l,o,m,s,r,p,q,t,n,v;c.DiffTreeNavigator=function(){function c(a,b,d,e,f,j){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,e,f,j)}b="orion.annotation.diff.addedBlock";a="orion.annotation.diff.currentAddedBlock";j="orion.annotation.diff.deletedBlock";d="orion.annotation.diff.currentDeletedBlock";
f="orion.annotation.diff.blockTop";i="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";o="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";r="orion.annotation.diff.deletedWord";p="orion.annotation.diff.currentDeletedWord";q="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";n="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
g.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});g.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});g.AnnotationType.registerType(j,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});g.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});g.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
g.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});g.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});g.AnnotationType.registerType(o,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});g.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});g.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});g.AnnotationType.registerType(r,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});g.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});g.AnnotationType.registerType(q,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});g.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
g.AnnotationType.registerType(n,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});g.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});c.prototype={initAll:function(a,b,d,c,e,f,j){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:c},{editor:d,diffFeeder:e}];this._curveRuler=j;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].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 b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.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 d=new e.JSDiffAdapter;for(a=0;a<b.length;a++){var c=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(c);var f=this.generatePairWordAnnotations(c,a,d);if(f)c.children=f}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 h.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,d,c,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===d&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,c?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].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,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var d=this.iterator.cursor();d.type==="block"&&d.children&&d.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,d){if(d===this.editorWrapper[a].editor.getTextView()){for(var c=0;c<this._root.children.length;c++){var d=
this._root.children[c],e=a===0?d.oldA:d.newA;if(b>=e.start&&b<=e.end){c=d;if(d.children&&d.children.length>0)for(e=0;e<d.children.length;e++){var f=d.children[e],j=a===0?f.oldA:f.newA;if(b>=j.start&&b<=j.end){c=f;break}}return c}}return null}},gotoChange:function(a,b){for(var d=0;d<this.editorWrapper.length;d++){var c=this._hitDiffAnnotation(d,a,b);if(c)return this.iterator.setCursor(c),this.updateCurrentAnnotation(!1,b),!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 b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,d,c){if(b&&d&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];c&&e.hasNext();){var j=e.next();j.type===d&&f.push(j)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){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 d=this.iterator.cursor();if(d){var c,e,f={start:d.oldA.start,end:d.oldA.end},j={start:d.newA.start,end:d.newA.end};d.type===
"word"?(c=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(j,this.editorWrapper[1].editor.getTextView().getModel())):(c=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(d.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(d.index));c&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (g.AnnotationType.getType(c.current))(f.start,f.end)],c,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (g.AnnotationType.getType(e.current))(j.start,j.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(d.oldA.start,d.oldA.end,!0),this.editorWrapper[1].editor.setSelection(d.newA.start,d.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(d.oldA.start,d.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(d.newA.start,d.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var d=this.generateBlockDiffAnnotations(0,b),c=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:d,newA:c}},generatePairWordAnnotations:function(a,b,d){var c=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,j=0;if(c&&e&&c.text&&e.text&&c.text.length<=5E3&&e.text.length<=
5E3)b=d.adaptCharDiff(c.text,e.text,this._charOrWordDiff==="word"),j=e.start,f=c.start;else return null;d=[];c=[];this.generateWordDiffAnnotations(0,d,f,b,2,3);this.generateWordDiffAnnotations(1,c,j,b,0,1);b=[];for(f=0;f<d.length;f++)b.push({parent:a,index:f,type:"word",oldA:d[f],newA:c[f]});return b},getAnnoModelList:function(a,b,d){for(var c=0;c<this.editorWrapper[a].annoTypes.length;c++)if(this.editorWrapper[a].annoTypes[c].type===b&&this.editorWrapper[a].annoTypes[c].normal===d)return this.editorWrapper[a].annoTypes[c].list;
return null},generateBlockDiffAnnotations:function(a,b){var d=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),c=this.getAnnoModelList(a,"block",d.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),d=g.AnnotationType.createAnnotation(d.normal,e.start,e.end);c&&c.push(d);return d},generateWordDiffAnnotations:function(a,b,d,c,e,f){if(c)for(var j=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",j.normal),i=0;i<c.length;i++){var h=
g.AnnotationType.createAnnotation(j.normal,c[i][e]+d,c[i][f]+d);a.push(h);b.push(h)}},_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,b){var d=a.getLineHeight(),c=a.getClientArea(),d=Math.floor(c.height/d/3);a.setTopIndex(b-d>0?b-d:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[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,b){this.gotoChange(a,b)&&(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 c}();c.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:s,normal:m,list:[]}):a.push({type:"word",current:p,normal:r,list:[]});a.push({type:"word",current:q});a.push({type:"word",current:t});a.push({type:"word",current:n});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:m}:{current:this._repositionEmptyWord(a,b),normal:r}:this._mapperColumnIndex===0?{current:s,normal:m}:{current:p,normal:r}},_repositionEmptyWord:function(a,
b){var d=b.getLineAtOffset(a.start),c=b.getLineStart(d),e=b.getLineEnd(d);if(c!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?v:t;a.end++}else if(d>0&&(d--,c=b.getLineStart(d),e=b.getLineEnd(d),c!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:t;return this._mapperColumnIndex===0?n:q},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 b=this._diffBlocks[a][0],d=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(b);if(d<b)return{start:a,end:a};b=this._textModel.getLineEnd(d,!0);return{start:a,end:b}},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}();c.TwoWayDiffBlockFeeder=function(){function e(a,b,d){this._mapperColumnIndex=d;this.init(a,b)}e.prototype=new c.DiffBlockFeeder;e.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var d=0,c=0;c<this._mapper.length;c++)this._mapper[c][2]!==
0&&this._diffBlocks.push([d,c]),d+=this._mapper[c][this._mapperColumnIndex]}};e.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:j,current:d,list:[]});c.push({type:"block",normal:f,current:i,list:[]});c.push({type:"block",normal:l,current:o,list:[]})};e.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=c)return null;c=this._diffBlocks[c][1];
if(this._mapper[c][this._mapperColumnIndex]===0)return{normal:f,current:i};else if(k.isMapperConflict(this.getMapper(),c))return{normal:l,current:o};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:j,current:d,list:[]}};return e}();c.inlineDiffBlockFeeder=function(){function e(a,b){this._mapperColumnIndex=b;this.init(a)}e.prototype=new c.DiffBlockFeeder;e.prototype.setModel=function(a){this._textModel=a};e.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,d=0;d<this._mapper.length;d++){if(this._mapper[d][2]!==0){if(this._mapperColumnIndex===0){var c=a+this._mapper[d][1];this._diffBlocks.push([c,d]);this._gapBlocks.push([c,c+this._mapper[d][0],b])}else this._diffBlocks.push([a,d]),this._gapBlocks.push([a,a+this._mapper[d][1],b]);a+=this._mapper[d][0]+this._mapper[d][1]}else this._gapBlocks.push([a,a+this._mapper[d][this._mapperColumnIndex],b]),a+=this._mapper[d][this._mapperColumnIndex];
b+=this._mapper[d][this._mapperColumnIndex]}}};e.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:j,current:d,list:[]});c.push({type:"block",normal:l,current:o,list:[]})};e.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:s,normal:m};else if(k.isMapperConflict(this.getMapper(),
c))return{normal:l,current:o};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:j,current:d,list:[]}};e.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]};e.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-
this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return e}();return c});
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(h,k,g,e,c,b,a,j,d,f,i,l,o){var m={};m.CompareView=function(){function a(){this._diffParser=new e.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,d,c,e){var f=this._getLineDelim(a,d);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,d,c,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.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(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.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,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.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 e(a){this.setOptions(a,!0);this._diffNavigator=new o.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new f.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 c.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
e.prototype=new m.CompareView;e.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 c.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 h["There are unsaved changes."]}.bind(this)};e.prototype.getEditors=function(){return this._editors};e.prototype.gotoDiff=function(a,b,d){d=d?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(d.getModel().getLineStart(a)+b,d)};e.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};e.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
e.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};e.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};e.prototype._createEditor=function(c,e,f,j,i){var g=typeof j.readonly==="undefined"?!0:j.readonly,k=function(){var a=new d.TextView({parent:e,readonly:g,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var b=this.getSplitter();b&&b.addResizeListener(function(b){if(b){var d=
!1;(d=this._uiFactory.isLeftPane(b)?i:!i)&&a.resize()}}.bind(this));return a}.bind(this),l=j.keyBindingFactory;l||(l=new a.KeyBindingsFactory);var m=null;if(f)var o="",m=function(a,b){if(f)o=b?h["ERROR: "]+a:a,f.textContent=""+o};k=new b.Editor({textViewFactory:k,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:e});k.installTextView();k.setInput(null,null,j.Content?j.Content:c);k.setOverviewRulerVisible(!1);var z=k.getTextView();
z.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(z.getCaretOffset(),z)}.bind(this));z.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!i))this.options.mapper=null}.bind(this));i?z.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
z.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};e.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};e.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new c.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(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};e.prototype.refresh=function(a){var b=this.options.oldFile.Content,d=this.options.newFile.Content,c=this.options.diffContent;typeof d==="string"?c=this._generateMapper(b,d,c,this.options.hasConflicts):(c=this._generateMapper(b,d,c,this.options.hasConflicts),
d=c.output);var e=new o.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),c.mapper,1),f=new o.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),c.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(c.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),this._editors[0].setInput(this.options.oldFile.Name,
null,b));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((b=this._uiFactory.getTitleDiv(!1))&&a)g.empty(b),g.empty(a),b.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;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return e}();m.InlineCompareView=function(){function e(a){this.setOptions(a,
!0);this._diffNavigator=new o.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}e.prototype=new m.CompareView;e.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};e.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};e.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};e.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};e.prototype.initEditors=function(e){var f=g.node(this._editorDiv),j=function(){return new d.TextView({parent:f,readonly:!0,tabSize:4})}.bind(this);this._editor=
new b.Editor({textViewFactory:j,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,domNode:f});this._editor.installTextView();this._editor.setInput(null,null,e);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new c.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new c.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new c.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))};e.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],d=a.getLineHeight(),c=a.getClientArea(),d=Math.floor(c.height/d/3);a.setTopIndex(b-d>0?b-d:0)}};e.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 o.inlineDiffBlockFeeder(b.mapper,
1),d=new o.inlineDiffBlockFeeder(b.mapper,0);i.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};e.prototype.setConflicting=
function(a){this._conflcit=a};return e}();m.toggleableCompareView=function(){function a(b,d){if(d)d.toggler=this;this._widget=b==="inline"?new m.InlineCompareView(d):new m.TwoWayCompareView(d)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();g.empty(g.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(h,k){function g(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function e(){g.call(this,null,!0)}function c(a){g.call(this,null,a)}function b(){g.call(this,null,!1)}function a(a,i,h){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(i){case "java":k=d;break;case "js":k=j;break;case "css":k=f}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new g(k,this.whitespacesVisible);this._firstScanner=new b;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new e;if(i==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=h;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)}};i=a.getModel();i.getBaseModel&&(i=i.getBaseModel());i.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 j=k.JSKeywords,d=k.JAVAKeywords,f=k.CSSKeywords,i={styleClass:"token_singleline_comment"},
l={styleClass:"token_multiline_comment"},o={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},s={styleClass:"token_task_tag"},r={styleClass:"token_doc_tag"},p={styleClass:"token_string"},q={styleClass:"token_number"},t={styleClass:"token_keyword"},n={styleClass:"token_space"},v={styleClass:"token_tab"},w={styleClass:"line_caret"};g.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,d=this.offset-1;if(!b&&48<=a&&a<=57){var c=b=!1,e=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!c)b=c=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&f===48&&this.offset-d===2)b=c=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){d=this.text.substring(d,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===d)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};e.prototype=new g(null);e.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};c.prototype=new g(null);c.prototype.setType=function(a){this._type=a};c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};b.prototype=new g(null);b.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 b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);
a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,
b,d,c,e){var f;c===void 0&&(c=-1);if(e===void 0)e=a.length;for(;e-c>1;)if(f=Math.floor((e+c)/2),b<=a[f].start)e=f;else if(d&&b<a[f].end){e=f;break}else c=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(h.AnnotationType.ANNOTATION_FOLDING);for(var d=
[],c=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var j=e[f];(j=this._createFoldingAnnotation(a,c,j.start,j.end))&&d.push(j)}b.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,b,d,c){var e=b.getLineAtOffset(d),b=b.getLineAtOffset(c);return e===b?null:new (h.AnnotationType.getType(h.AnnotationType.ANNOTATION_FOLDING))(d,c,a)},_computeTasks:function(a,b,d){if(this.detectTasks){var c=this.annotationModel;if(c){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());
for(var j=c.getAnnotations(b,d),e=[],i=h.AnnotationType.ANNOTATION_TASK;j.hasNext();){var g=j.next();g.type===i&&e.push(g)}j=[];g=this._commentScanner;g.setText(f.getText(b,d));for(var k;k=g.nextToken();){var l=g.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,d-this.commentEnd.length)),j.push(h.AnnotationType.createAnnotation(i,l,k,f.getText(l,k))))}c.replaceAnnotations(e,j)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,d=b.getModel(),
b=b.getSelection();if(b.start===b.end&&d.getLineAtOffset(b.start)===a)return w}return null},_getStyles:function(a,b,d){a.getBaseModel&&(d=a.mapOffset(d));for(var c=d+b.length,e=[],f=d,j=this.comments,i=this._binarySearch(j,d,!0);i<j.length;i++){if(j[i].start>=c)break;var g=j[i].start,h=j[i].end;f<g&&this._parse(b.substring(f-d,g-d),f,e);var k=j[i].type,m;switch(k){case 8:m=o;break;case 7:m=l;break;case 5:m=p}f=Math.max(f,g);g=Math.min(c,h);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(f-d,g-d),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-d,g-d),f,e,p):e.push({start:f,end:g,style:m});f=h}f<c&&this._parse(b.substring(f-d,c-d),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)d=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+d;return e},_parse:function(a,b,d){var c=this._scanner;for(c.setText(a);a=c.nextToken();){var e=c.getStartOffset()+b,f=null;switch(a){case 2:f=t;break;case 3:f=q;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(c.getData(),
e,d,p);continue}else f=p;break;case 8:this._parseComment(c.getData(),e,d,o,a);continue;case 6:this._parseComment(c.getData(),e,d,i,a);continue;case 7:this._parseComment(c.getData(),e,d,l,a);continue;case 10:this.whitespacesVisible&&(f=v);break;case 11:this.whitespacesVisible&&(f=n)}d.push({start:e,end:c.getOffset()+b,style:f})}},_parseComment:function(a,b,d,c,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,j=c;switch(a){case 10:this.whitespacesVisible&&
(j=v);break;case 11:this.whitespacesVisible&&(j=n);break;case 12:j=m;break;case 13:j=r;break;case 14:j=s;break;default:this.detectHyperlinks&&(j=this._detectHyperlinks(f.getData(),e,d,j))}j&&d.push({start:e,end:f.getOffset()+b,style:j})}},_parseString:function(a,b,d,c){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,j=c;switch(a){case 10:this.whitespacesVisible&&(j=v);break;case 11:this.whitespacesVisible&&(j=n)}j&&d.push({start:f,end:e.getOffset()+b,style:j})}},
_detectHyperlinks:function(a,b,d,c){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,j=f;j>0;){f=e.charCodeAt(j-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;j--}if(j>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(j-1,j)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var i=f;f=this._clone(c);f.tagName="a";f.attributes={href:e.substring(j,i)};d.push({start:b,end:b+j,style:c});d.push({start:b+j,end:b+i,style:f});d.push({start:b+i,end:b+a.length,style:c});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(c),f.tagName="a",f.attributes={href:e},f):c},_clone:function(a){if(!a)return a;var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);return b},_findComments:function(a,b){var b=b||0,d=this._firstScanner,c;d.setText(a);for(var e=[];c=d.nextToken();)(c===7||c===8||c===5)&&e.push({start:d.getStartOffset()+b,end:d.getOffset()+b,type:c}),(c===
6||c===7||c===8)&&this._computeTasks(c,d.getStartOffset()+b,d.getOffset()+b);return e},_findMatchingBracket:function(a,b){var d="{}()[]<>",c=a.getText(b,b+1),e=d.indexOf(c,0);if(e===-1)return-1;var f;f=e&1?d.substring(e-1,e):d.substring(e+1,e+2);for(var j=a.getLineAtOffset(b),d=a.getLine(j),i=a.getLineStart(j),g=a.getLineEnd(j),d=this._findBrackets(c,f,d,i,i,g),g=0;g<d.length;g++)if(i=d[g]>=0?1:-1,d[g]*i-1===b){var h=1;if(e&1){for(g--;g>=0;g--)if(i=d[g]>=0?1:-1,h+=i,h===0)return d[g]*i-1;for(j-=1;j>=
0;){d=a.getLine(j);i=a.getLineStart(j);g=a.getLineEnd(j);d=this._findBrackets(c,f,d,i,i,g);for(e=d.length-1;e>=0;e--)if(i=d[e]>=0?1:-1,h+=i,h===0)return d[e]*i-1;j--}}else{for(g++;g<d.length;g++)if(i=d[g]>=0?1:-1,h+=i,h===0)return d[g]*i-1;j+=1;for(e=a.getLineCount();j<e;){d=a.getLine(j);i=a.getLineStart(j);g=a.getLineEnd(j);d=this._findBrackets(c,f,d,i,i,g);for(g=0;g<d.length;g++)if(i=d[g]>=0?1:-1,h+=i,h===0)return d[g]*i-1;j++}}break}return-1},_findBrackets:function(a,b,d,c,e,f){for(var j=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),i=e,g=this._scanner,h,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;h=k[l].start;var m=k[l].end;if(i<h)for(g.setText(d.substring(i-e,h-e));h=g.nextToken();)h===a?j.push(g.getStartOffset()+i-e+c+1):h===b&&j.push(-(g.getStartOffset()+i-e+c+1));i=m}if(i<f)for(g.setText(d.substring(i-e,f-e));h=g.nextToken();)h===a?j.push(g.getStartOffset()+i-e+c+1):h===b&&j.push(-(g.getStartOffset()+i-e+c+1));return j},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,d=a.newValue,c=this.view,a=c.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(d.start);var j=d.start===d.end,b=b.start===b.end;f===e&&b&&j||(b&&c.redrawLines(f,f+1),(f!==e||!b)&&j&&c.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
i,g;if(d.start===d.end&&(g=c.getCaretOffset())>0)g-=1,a.getBaseModel&&(g=a.mapOffset(g),a=a.getBaseModel()),a=this._findMatchingBracket(a,g),a!==-1&&(i=[h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_BRACKET,g,g+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,d=b.getModel(),c=b.getOffsetAtLocation(a.x,
a.y);if(c>0){var e=c-1,f=d;d.getBaseModel&&(e=d.mapOffset(e),f=d.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,d.getBaseModel&&(a=d.mapOffset(a,!0)),c>a&&(c--,a++),b.setSelection(a,c))}}},_onModelChanged:function(a){var b=a.start,d=a.removedCharCount,c=a.addedCharCount-d,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,d=b+d,j=f.getCharCount(),i=this.comments.length,g=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,g,!0),l=this._binarySearch(this.comments,
d,!1,k-1,i);k<i&&this.comments[k].start<=g&&g<this.comments[k].end?(g=this.comments[k].start,g>b&&(g+=c)):g=k===i&&i>0&&j-c===this.comments[i-1].end?this.comments[i-1].start:g;var m;l<i?(m=this.comments[l].end,m>b&&(m+=c),l+=1):(l=i,m=j);for(var n,j=this._findComments(f.getText(g,m),g),i=k;i<this.comments.length;i++)n=this.comments[i],n.start>b&&(n.start+=c),n.start>b&&(n.end+=c);var o=l-k!==j.length;if(!o)for(i=0;i<j.length;i++){n=this.comments[k+i];var q=j[i];if(n.start!==q.start||n.end!==q.end||
n.type!==q.type){o=!0;break}}i=[k,l-k].concat(j);Array.prototype.splice.apply(this.comments,i);o&&(i=g,n=m,a!==f&&(i=a.mapOffset(i,!0),n=a.mapOffset(n,!0)),e.redrawRange(i,n));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(g,m);g=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===h.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(i=0;i<j.length;i++)if(n.start===j[i].start&&n.end===j[i].end)break;i===j.length?(g.push(n),n.expand()):(i=n.start,l=n.end,i>
b&&(i-=c),l>b&&(l-=c),i<=b&&b<l&&i<=d&&d<l&&(i=f.getLineAtOffset(n.start),l=f.getLineAtOffset(n.end),i!==l?n.expanded||(n.expand(),e.modifyAnnotation(n)):e.removeAnnotation(n)))}b=[];for(i=0;i<j.length;i++){n=j[i];for(c=0;c<m.length;c++)if(m[c].start===n.start&&m[c].end===n.end)break;c===m.length&&(n=this._createFoldingAnnotation(a,f,n.start,n.end))&&b.push(n)}e.replaceAnnotations(g,b)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(h){function k(c){var b;if(c instanceof Array){b=Array(c.length);for(var a=0;a<c.length;a++)b[a]=k(c[a])}else for(a in b={},c)if(Object.prototype.hasOwnProperty.call(c,a)){var e=c[a];b[a]=typeof e==="object"&&e!==null?k(e):e}return b}function g(c,b,a){this.initialize(c);this.grammar=k(b);this.externalGrammars=a?k(a):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var e={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function b(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var a="",j,c=e.processGlobalFlag("x",c,function(a){for(var b="",d=!1,c=a.length,e=0;e<c;){var j=a.charAt(e);if(!d&&j==="#")for(;e<c&&j!=="\r"&&j!=="\n";)j=a.charAt(++e);
else if(!d&&/\s/.test(j))for(;e<c&&/\s/.test(j);)j=a.charAt(++e);else j==="\\"?(b+=j,/\s/.test(a.charAt(e+1))||(b+=a.charAt(e+1),e+=1)):(j==="["?d=!0:j==="]"&&(d=!1),b+=j),e+=1}return b}),c=e.processGlobalFlag("i",c,function(b){a+="i";return b});for(j=0;j<this.unsupported.length;j++){var d;(d=this.unsupported[j].regex.exec(c))&&b(this.unsupported[j].func(d),d)}return RegExp(c,a)},processGlobalFlag:function(c,b,a){function e(a,b){for(var d=0,c=a.length,j=-1,g=b;g<c&&j===-1;g++)switch(a.charAt(g)){case "\\":g++;
break;case "(":d++;break;case ")":d--,d===0&&(j=g)}return j}var d="(?"+c+")",c="(?"+c+":";if(b.substring(0,d.length)===d)return a(b.substring(d.length));else if(b.substring(0,c.length)===c){d=e(b,0);if(d<b.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+b);return a(b.substring(c.length,d))}return b},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,b,a){for(var a=typeof a==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
e=[],d=0;d<c.length;d++){var f=c[d],i=/\\(\d+)/.exec(f);i?(f=b[i[1]]||"",e.push(a?h.escape(f):f)):e.push(f)}return RegExp(e.join(""))},groupify:function(c,b){for(var a=c.source,e=a.length,d=[],f=0,i=[],g=1,h=1,k=[],s={},r={},p=0;p<e;p++){var q=d[d.length-1],t=a.charAt(p);switch(t){case "(":if(q===4)d.pop(),k.push(")"),i[i.length-1].end=p;var n=p+2<e?a.charAt(p+1)+""+a.charAt(p+2):null;if(n==="?:"||n==="?="||n==="?!"){var v;n==="?:"?v=1:(v=3,f++);d.push(v);i.push({start:p,end:-1,type:v});k.push(t);
k.push(n);p+=n.length}else d.push(2),i.push({start:p,end:-1,type:2,oldNum:g,num:h}),k.push(t),f===0&&(r[h]=null),s[g]=h,g++,h++;break;case ")":q=d.pop();q===3&&f--;i[i.length-1].end=p;k.push(t);break;case "*":case "+":case "?":case "}":var w=t,u=a.charAt(p-1),n=p-1;if(t==="}"){for(v=p-1;a.charAt(v)!=="{"&&v>=0;v--);u=a.charAt(v-1);n=v-1;w=a.substring(v,p+1)}v=i[i.length-1];if(u===")"&&(v.type===2||v.type===4)){k.splice(v.start,0,"(");k.push(w);k.push(")");t={start:v.start,end:k.length-1,type:4,num:v.num};
for(u=0;u<i.length;u++)if(q=i[u],(q.type===2||q.type===4)&&q.start>=v.start&&q.end<=n)if(q.start+=1,q.end+=1,q.num+=1,q.type===2)s[q.oldNum]=q.num;i.push(t);h++;break}default:t!=="|"&&q!==2&&q!==4&&f===0&&(d.push(4),i.push({start:p,end:-1,type:4,num:h}),k.push("("),r[h]=null,h++),k.push(t),t==="\\"&&(t=a.charAt(p+1),k.push(t),p+=1)}}for(;d.length;)d.pop(),k.push(")");var a=RegExp(k.join("")),e={},b=b||s,y;for(y in b)b.hasOwnProperty(y)&&(e[y]="\\"+b[y]);a=this.getSubstitutedRegex(a,e,!1);return[a,
s,r]},complexCaptures:function(c){if(!c)return!1;for(var b in c)if(c.hasOwnProperty(b)&&b!=="0")return!0;return!1}};g.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var b=this;this._listener={onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStorage:function(a){b.onStorage(a)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);
c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var b=
c.pop();if(!b._resolvedRule||!b._typedRule)if(b._resolvedRule=this._resolve(b),b._typedRule=this._createTypedRule(b),this.addStyles(b.name),this.addStyles(b.contentName),this.addStylesForCaptures(b.captures),this.addStylesForCaptures(b.beginCaptures),this.addStylesForCaptures(b.endCaptures),b._resolvedRule!==b&&c.push(b._resolvedRule),b.patterns)for(var a=0;a<b.patterns.length;a++)c.push(b.patterns[a])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var b=c.split("."),a=0;a<
b.length;a++)this._styles[c].push(b.slice(0,a+1).join("-"))}},addStylesForCaptures:function(c){for(var b in c)c.hasOwnProperty(b)&&this.addStyles(c[b].name)},ContainerRule:function(){function c(b){this.rule=b;this.subrules=b.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(b){this.rule=b;this.beginRegex=e.toRegExp(b.begin);this.endRegex=e.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=e.hasBackReference(this.endRegex);var a=e.complexCaptures(b.captures),
b=e.complexCaptures(b.beginCaptures)||e.complexCaptures(b.endCaptures);if(this.isComplex=a||b)a=e.groupify(this.beginRegex),this.beginRegex=a[0],this.beginOld2New=a[1],this.beginConsuming=a[2],a=e.groupify(this.endRegex,this.beginOld2New),this.endRegex=a[0],this.endOld2New=a[1],this.endConsuming=a[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(b){this.rule=b;this.matchRegex=e.toRegExp(b.match);if(this.isComplex=e.complexCaptures(b.captures))b=
e.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var b=c;if(c.include){if(c.begin||c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(b=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!b)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")b=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(b=this._allGrammars[c],!b)for(var a=0;a<this.externalGrammars.length;a++){var e=this.externalGrammars[a];if(e.scopeName===c){this.preprocess(e);b=this._allGrammars[c]=e;break}}}return b},ContainerNode:function(){function c(b,a){this.parent=b;this.rule=a;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(b){this.children.push(b)};c.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(b,a,c){this.parent=b;this.rule=a;this.children=[];this.setStart(c);this.endMatch=this.end=null;this.endRegexSubstituted=a.endRegexHasBackRef?e.getSubstitutedRegex(a.endRegex,c):null}c.prototype.addChild=function(b){this.children.push(b)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};c.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};c.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};c.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,b){if(b)for(var a=b.length;a>0;)c.push(b[--a])},exec:function(c,b,a){(b=c.exec(b))&&(b.index+=a);c.lastIndex=0;return b},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,b,a){if(c instanceof this.BeginEndNode){var e=c.rule,c=c.endRegexSubstituted||e.endRegex;return!c?null:this.exec(c,b,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(c){var b=c.addedCharCount,a=c.removedCharCount,c=c.start;if(this._tree){var e=this.textView.getModel(),d=e.getCharCount(),e=e.getLineEnd(e.getLineAtOffset(c)-1),f=this.getFirstDamaged(e,e),e=e===-1?0:e,b=f?this.parse(f,!0,e,c,b,a):d;this.textView.redrawRange(e,b)}else this.initialParse()},getFirstDamaged:function(c,b){if(c<0)return this._tree;for(var a=[this._tree],e=null;a.length;){var d=a.pop();if(!d.parent||this.isDamaged(d,c,b)){d instanceof this.BeginEndNode&&(e=
d);for(var f=0;f<d.children.length;f++)a.push(d.children[f])}}return e||this._tree},isDamaged:function(c,b,a){return c.start<=a&&c.end>b},parse:function(c,b,a,e,d,f){var i=this.textView.getModel(),g=i.getLineStart(i.getLineCount()-1),h=i.getCharCount(),k=this.getInitialExpected(c,a),s=-1;if(b)c.repaired=!0,c.endNeedsUpdate=!0,s=(s=c.children[c.children.length-1])?i.getLineEnd(i.getLineAtOffset(s.end+(d-f))):-1,e=i.getLineEnd(i.getLineAtOffset(e+f)),s=Math.max(s,e);for(var s=s===-1?h:s,e=k,r=c,p=!1,
q=a,t=-1;r&&(!b||q<s);){var n=this.getNextMatch(i,r,q);n||(q=q>=g?h:i.getLineStart(i.getLineAtOffset(q)+1));var v=n&&n.match,w=n&&n.rule,u=n&&n.isEnd;if(n&&n.isSub){if(q=this.afterMatch(v),w instanceof this.BeginEndRule)p=!0,b&&w===e.rule&&r===e.parent?(r=e,r.setStart(v),r.repaired=!0,r.endNeedsUpdate=!0,e=this.getNextExpected(e,"begin")):(b&&(this.prune(r,e),b=!1),v=new this.BeginEndNode(r,w,v),r.addChild(v),r=v)}else if(u||q===h){if(r instanceof this.BeginEndNode)v?(p=!0,t=Math.max(t,r.end),r.setEnd(v),
q=this.afterMatch(v),b&&r===e&&r.parent===e.parent?(r.repaired=!0,delete r.endNeedsUpdate,e=this.getNextExpected(e,"end")):b&&(this.prune(r,e),b=!1)):(r.setEnd(h),delete r.endNeedsUpdate);r=r.parent}b&&q>=s&&!p&&(this.prune(c,k),b=!1)}this.removeUnrepairedChildren(c,b,a);this.cleanup(b,c,a,s,h,d,f);return b?Math.max(t,q):q},removeUnrepairedChildren:function(c,b,a){if(b){for(var b=c.children,e=-1,d=0;d<b.length;d++){var f=b[d];if(!f.repaired&&this.isDamaged(f,a,Number.MAX_VALUE)){e=d;break}}if(e!==
-1)c.children.length=e}},cleanup:function(c,b,a,e,d,f,i){if(c){c=f-i;d=this.getIntersecting(e-c+1,d);b=this.getIntersecting(a,e);for(a=0;a<d.length;a++)e=d[a],!e.repaired&&e instanceof this.BeginEndNode&&(e.shiftEnd(c),e.shiftStart(c));for(a=0;a<b.length;a++)e=b[a],e.repaired&&e.endNeedsUpdate&&e.shiftEnd(c),delete e.endNeedsUpdate,delete e.repaired}else{b=this.getIntersecting(a,e);for(a=0;a<b.length;a++)delete b[a].repaired}},getNextMatch:function(c,b,a,e){var d=c.getLineAtOffset(a),d=c.getLineEnd(d),
f=c.getText(a,d),i=[],g=[],c=[],d=[];for(this.push(i,b.rule.subrules);i.length;){var h=i.length?i.pop():null,h=h&&h._resolvedRule._typedRule;if(h instanceof this.ContainerRule&&g.indexOf(h)===-1)g.push(h),this.push(i,h.subrules);else if(!h||!e||h.matchRegex){var k=h&&this.exec(h.matchRegex||h.beginRegex,f,a);k&&(c.push(k),d.push(h))}}i=Number.MAX_VALUE;g=-1;for(h=0;h<c.length;h++)if(k=c[h],k.index<i)i=k.index,g=h;if(!e&&(a=this.getEndMatch(b,f,a)))if(e=b.rule.applyEndPatternLast,g===-1||a.index<i||
!e&&a.index===i)return{isEnd:!0,rule:b.rule,match:a};return g===-1?null:{isSub:!0,rule:d[g],match:c[g]}},getInitialExpected:function(c,b){var a,e;if(c===this._tree)for(a=0;a<c.children.length;a++){if(e=c.children[a],e.start>=b)return e}else if(c instanceof this.BeginEndNode&&c.endMatch){var d=c.endMatch.index;for(a=0;a<c.children.length;a++)if(e=c.children[a],e.start>=b)break;if(e&&e.start<d)return e}return c},getNextExpected:function(c,b){if(b==="begin"){var a=c.children[0];return a?a:c}else if(b===
"end"&&(a=c.parent)){var e=a.children[a.children.indexOf(c)+1];return e?e:a}return null},prune:function(c,b){if(b.parent===c)c.children.length=b.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var b=c.lineStart,a=this.textView.getModel(),e=a.getLineEnd(c.lineIndex),d=a.getLineEnd(a.getLineAtOffset(b)-1),d=this.getFirstDamaged(d,d),b=this.getLineScope(a,
d,b,e);c.ranges=this.toStyleRanges(b);c.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(c,b,a,e){for(var d=a,f=this.getInitialExpected(b,a),i=[],g=[];b&&d<e;){var h=this.getNextMatch(c,b,d);if(!h)break;var k=h&&h.match,s=h&&h.rule,r=h&&h.isSub,h=h&&h.isEnd;k.index!==d&&g.push({start:d,end:k.index,node:b});if(r)d=this.afterMatch(k),s instanceof this.BeginEndRule?(this.addBeginScope(i,k,s),b=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(i,k,s);else if(h)d=this.afterMatch(k),
this.addEndScope(i,k,s),f=this.getNextExpected(f,"end"),b=b.parent}d<e&&g.push({start:d,end:e,node:b});c=this.getInheritedLineScope(g,a,e);return i.concat(c)},getInheritedLineScope:function(c){for(var b=[],a=0;a<c.length;a++)for(var e=c[a],d=e.node;d;){var f=d.rule.rule,i=f.name;if(f=f.contentName||i){this.addScopeRange(b,e.start,e.end,f);break}d=d.parent}return b},addBeginScope:function(c,b,a){var e=a.rule;this.addCapturesScope(c,b,e.beginCaptures||e.captures,a.isComplex,a.beginOld2New,a.beginConsuming)},
addEndScope:function(c,b,a){var e=a.rule;this.addCapturesScope(c,b,e.endCaptures||e.captures,a.isComplex,a.endOld2New,a.endConsuming)},addMatchScope:function(c,b,a){var e=a.rule,d=e.name;(e=e.captures)?this.addCapturesScope(c,b,e,a.isComplex,a.matchOld2New,a.matchConsuming):this.addScope(c,b,d)},addScope:function(c,b,a){a&&c.push({start:b.index,end:this.afterMatch(b),scope:a})},addScopeRange:function(c,b,a,e){e&&c.push({start:b,end:a,scope:e})},addCapturesScope:function(c,b,a,e,d,f){if(a)if(e){for(var e=
{1:0},i=0,g=1;b[g]!==void 0;g++)f[g]!==void 0&&(i+=b[g].length),b[g+1]!==void 0&&(e[g+1]=i);f=b.index;for(i=1;a[i];i++){var g=a[i].name,h=d[i],k=f+e[h];typeof b[h]!=="undefined"&&this.addScopeRange(c,k,k+b[h].length,g)}}else this.addScope(c,b,a[0]&&a[0].name)},getIntersecting:function(c,b){for(var a=[],e=this._tree?[this._tree]:[];e.length;){var d=e.pop(),f=!1;d instanceof this.ContainerNode?f=!0:this.isDamaged(d,c,b)&&(f=!0,a.push(d));if(f)for(var f=d.children.length,i=0;i<f;i++)e.push(d.children[i])}return a.reverse()},
toStyleRanges:function(c){for(var b=[],a=0;a<c.length;a++){var e=c[a],d=this._styles[e.scope];if(!d)throw Error("styles not found for "+e.scope);d=d.join(" ");b.push({start:e.start,end:e.end,style:{styleClass:d}})}return b}};return{RegexUtil:e,TextMateStyler:g}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(h,k){function g(a){return a.getProperty("objectClass").indexOf(c)!==-1&&a.getProperty("type")==="highlighter"}function e(a,b,d){this.initialize(a,b,d);this.lineStyles=[]}var c="orion.edit.highlighter",b=c+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:h.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
e.prototype={initialize:function(a,b,d){this.textView=a;this.serviceRegistry=b;this.annotationModel=d;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);b.addEventListener("registered",this.listener.onServiceAdded);b.addEventListener("unregistering",this.listener.onServiceRemoved);a=b.getServiceReferences(c);for(d=0;d<a.length;d++){var i=a[d];g(i)&&this.addServiceListener(b.getService(i))}},
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,c=this.textView.getModel(),e;for(e in b)b.hasOwnProperty(e)&&(this.lineStyles[e]=b[e],a=Math.min(a,e),d=Math.max(d,e));a=Math.max(a,0);d=Math.min(d,c.getLineCount());if(b=this.annotationModel){for(var g=b.getAnnotations(c.getLineStart(a),c.getLineEnd(d)),h=[];g.hasNext();){var m=g.next();m.type==="orion.annotation.highlightError"&&h.push(m)}g=[];for(m=a;m<=d;m++){e=m;var s=this.lineStyles[e],s=s&&s.errors;e=c.getLineStart(e);
if(s)for(var r=0;r<s.length;r++){var p=s[r];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",p.start+e,p.end+e))}}b.replaceAnnotations(h,g)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function b(a,d){for(var c=a.length,e=[],g=0;g<c;g++){var j=a[g];e.push({start:j.start+d,end:j.end+d,style:j.style})}return e}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){g(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 c=this.serviceRegistry.getService("orion.page.progress");c?c.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(b))},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(b))}};return e});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(h,k,g,e){function c(a,b,d,c,i,l,o){function m(a,c){var f=a.getProperty("contentType"),g=a.getProperty("fileTypes");if(f)return b.isSomeExtensionOf(d,f).then(function(b){return b?a:null});else if(c&&g&&g.indexOf(c)!==-1)return f=new e,f.resolve(a),f;return null}var s=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new h.TextStyler(c,"js",i);break;case "text/x-java-source":b=new h.TextStyler(c,"java",i);break;case "text/css":b=new h.TextStyler(c,"css",i)}return b}(d);if(s)return l=new e,l.resolve(s),l;for(var s=l&&l.split(".").pop().toLowerCase(),l=a.getServiceReferences("orion.edit.highlighter"),r=[],p=[],q=0;q<l.length;q++){var t=l[q];t.getProperty("type")==="grammar"&&r.push(t.getProperty("grammar"));(t=m(t,s))&&p.push(t)}return e.all(p,function(a){return{_error:a}}).then(function(b){for(var e,j=b.length-
1;j>=0;j--){var h=b[j];if(h&&!h._error&&(o||h.getProperty("type")!=="highlighter")){e=h;break}}var l;if(e)if(b=e.getProperty("type"),b==="highlighter")l=new g(c,a,i),l.setContentType(d);else if(b==="grammar"||typeof b==="undefined")e=e.getProperty("grammar"),l=new k.TextMateStyler(c,e,r);return l})}function b(a){this.serviceRegistry=a;this.styler=null}b.prototype={setup:function(a,b,d,e,g){g=typeof g==="undefined"?!0:g;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var h=
this;return c(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,b,d,e,g).then(function(a){return h.styler=a})},getStyler:function(){return this.styler}};return{createStyler:c,SyntaxHighlighter:b}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(h,k,g,e,c){function b(a,b,d,c){k.Find.call(this,a,d,c);this._commandService=b}b.prototype=new k.Find;e.mixin(b.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)},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(b){var d=document.createElement("input");d.type="text";d.name=h["Find:"];d.className="parameterInput";d.id="localSearchFindWith";d.placeholder=h["Find With"];d.oninput=function(b){return a._handleInput(b)};d.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(d);a._createButton("Next",b,function(){a.find(!0)});a._createButton("Previous",b,function(){a.find(!1)});
var c=a._editor.getTextView().getOptions("readonly");if(!c){var e=document.createElement("input");e.type="text";e.name=h["ReplaceWith:"];e.className="parameterInput";e.id="localSearchReplaceWith";e.placeholder=h["Replace With"];e.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(e);a._createButton(h.Replace,b,function(){a.replace()});a._createButton(h["Replace All"],b,function(){a.replaceAll()})}e=document.createElement("div");b.appendChild(e);e.classList.add("findOptionsDiv");var k=
g.createDropdownMenu(e,h.Options,null,"dismissButton",null,!0);k.menuButton.classList.add("parameterInlineButton");g.createCheckedMenuItem(k.menu,h["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,h["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});k.dropdown.close(!0);a.find(!0)});g.createCheckedMenuItem(k.menu,h["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});
k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,h["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,h["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});k.dropdown.close(!0);a.find(!0)});g.createCheckedMenuItem(k.menu,h["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});k.dropdown.close(!0);a.find(!0)});c||g.createCheckedMenuItem(k.menu,
h["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});k.dropdown.close(!0)});return d},function(){a.hide()})},_createButton:function(a,b,d){var e=document.createElement("button");e.addEventListener("click",d.bind(this),!1);var g=this;e.addEventListener("keydown",function(a){a.keyCode===c.KEY.ESCAPE&&g.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";b.appendChild(e)},_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:b}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",Save:"Save","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.","Reading metedata of":"Reading metedata of ${0}",Reading:"Reading ${0}","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.",
"Saving file {0}":"Saving file ${0}","Running {0}":"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",New:"New",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(h,k){var g={root:k};Object.keys(h).forEach(function(e){typeof g[e]==="undefined"&&(g[e]=h[e])});return g});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/undoStack,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/util".split(","),function(h,k,g,e,c,b,a,j,d,f,i,l,o,m,s,r,p){function q(a,b,d,c,e,f,g,i,h,j){this.serviceRegistry=a;this.commandService=
b;this.fileClient=d;this.inputManager=c;this.toolbarId=e;this.pageNavId=g;this.isReadOnly=f;this._localSearcher=i;this._searcher=h;this.editorSettings=j}var f={},t=null;q.prototype={generateEditorCommands:function(a){this._generateSearchFilesCommand(a);this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this.isReadOnly||this._generateEditCommands(a)},_generateUndoStackCommands:function(b){this.commandService.addCommand(new a.Command({name:h.Undo,
id:"orion.undo",callback:function(){b.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,b.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new a.Command({name:h.Redo,id:"orion.redo",callback:function(){b.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,b.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(b){var d=
this;if(d._searcher){var c=!1,f=new a.Command({name:h["Search Files"],tooltip:h["Search Files"],id:"orion.searchFiles",callback:function(){b.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new j.KeyBinding("h",!0));b.getTextView().setKeyBinding(new j.KeyBinding("h",!0),"searchFiles");b.getTextView().setAction("searchFiles",function(){if(!c){var a=b.getSelection(),a=b.getText(a.start,
a.end),f=d.serviceRegistry,i=f.getService("orion.page.progress"),f=f.getService("orion.core.favorite"),j=new e.OpenResourceDialog({searcher:d._searcher,progress:i,favoriteService:f,searchRenderer:d._searcher.defaultRenderer,nameSearch:!1,title:h["Search Files"],message:h["Enter search term:"],initialText:a,onHide:function(){c=!1;b&&b.getTextView()&&b.getTextView().focus()}});window.setTimeout(function(){c=!0;j.show(g.node(d.toolbarId))},0);return!0}},f)}},_generateSaveCommand:function(b){var d=this;
b.getTextView().setKeyBinding(new j.KeyBinding("s",!0),"save");b.getTextView().setAction("save",function(){if(d.inputManager.save)d.inputManager.save();else if(d.inputManager.onSave){var a=b.getText();d.inputManager.onSave(d.inputManager.getInput(),a,function(){b.setInput(d.inputManager.getInput(),null,a,!0);d.inputManager.afterSave&&d.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:h.Save});this.commandService.addCommand(new a.Command({name:h.Save,tooltip:h["Save this file"],id:"orion.save",
visibleWhen:function(){return!d.editorSettings||!d.editorSettings().autoSaveEnabled},callback:function(){b.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new j.KeyBinding("s",!0))},_generateGotoLineCommnand:function(b){var c=this,e=new d.ParametersDescription([new d.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new d.CommandParameter("line",
"number","Line:",a.toString())]}),e=new a.Command({name:h["Go to Line"],tooltip:h["Go to specified line number"],id:"orion.gotoLine",parameters:e,callback:function(a){var d=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=d.getLineAtOffset(b.getCaretOffset()),(a=prompt(h["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new j.KeyBinding("l",!p.isMac,!1,!1,p.isMac),new d.URLBinding("gotoLine","line"));b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},e)},_generateFindCommnand:function(b){var c=this,e=new d.ParametersDescription([new d.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=b.getSelection(),c="";a.end>a.start&&(c=b.getModel().getText(a.start,a.end));return[new d.CommandParameter("find",
"text","Find:",c)]}),e=new a.Command({name:h.Find,tooltip:h.Find,id:"orion.editor.find",parameters:e,callback:function(a){if(c._localSearcher){var d="",e=null,f=b.getSelection();f.end>f.start?d=b.getModel().getText(f.start,f.end):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),e=s.matchResourceParameters(),m.convertFindURLBinding(e));if(e){a={regex:e.regEx,caseInsensitive:!e.caseSensitive};if(e.atLine)a.start=b.getModel().getLineStart(e.atLine-1);c._localSearcher.show({findString:d,
replaceString:e.replaceWith});c._localSearcher.find(!0,a)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new j.KeyBinding("f",!0),new d.URLBinding("find","find"));b.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find");return!0},e)},_generateEditCommands:function(d){function e(a){var b=
new j.KeyBinding;j.KeyBinding.apply(b,a);return b}function f(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var d=m.serviceRegistry.getService("orion.page.message");d?d.setProgressResult(a):window.console.log(a)}var m=this,o=this.serviceRegistry.getServiceReferences("orion.edit.command"),q=this.inputManager,z=this.serviceRegistry.getService("orion.page.progress"),p=function(c,e,g){g.callback=function(){d=this;var a=d.getSelection(),g=d.getModel(),i=g.getText(),j=function(b){b&&b.text?(d.setText(b.text),
b.selection&&(d.setSelection(b.selection.start,b.selection.end),d.getTextView().focus())):typeof b==="string"&&(d.setText(b,a.start,a.end),d.setSelection(a.start,a.start+b.length),d.getTextView().focus())};z.showWhile(e.run(g.getText(a.start,a.end),i,a,q.getInput()),k.formatMessage(h["Running {0}"],c.name)).then(function(a){if(a&&a.uriTemplate){var d=new b(a.uriTemplate),e=q.getFileMetadata();e.OrionHome=e.OrionHome||r.getOrionHome();var d=window.decodeURIComponent(d.expand(e)),g=document.createElement("iframe");
g.id=c.id;g.name=c.id;g.type="text/html";g.sandbox="allow-scripts allow-same-origin";g.frameborder=1;g.src=d;g.className="delegatedUI";if(a.width)g.style.width=a.width;if(a.height)g.style.height=a.height;g.style.visibility="hidden";window.document.body.appendChild(g);g.style.left=(window.innerWidth-parseInt(g.clientWidth,10))/2+"px";g.style.top=(window.innerHeight-parseInt(g.clientHeight,10))/2+"px";g.style.visibility="";window.addEventListener("message",function H(a){if(a.source===g.contentWindow&&
typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===c.id)){if(!a.cancelled)if(a.result)j(a.result);else if(a.Status||a.status)f(a.Status||a.status);window.removeEventListener("message",H,!1);window.document.body.removeChild(g)}},!1)}else a.Status||a.status?f(a.Status||a.status):j(a)});return!0};g.callback=g.callback.bind(d);return new a.Command(g)};c.when(function(a){if(t)return t;var b=a.getService("orion.core.contenttypes");b||(b=new l.ContentTypeService(a),
b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return t=a})}(this.serviceRegistry),function(){var a=[],b=100;o.forEach(function(c){for(var f=m.serviceRegistry.getService(c),g={},h=c.getPropertyKeys(),j=0;j<h.length;j++)g[h[j]]=c.getProperty(h[j]);g.forceSingleItem=!0;c=i._createCommandOptions(g,c,m.serviceRegistry,t,!1,function(){return q.getFileMetadata()});a.push(c);c.then(function(a){a=p(g,f,a);m.commandService.addCommand(a);m.commandService.registerCommandContribution(m.toolbarId,
a.id,b);if(g.key){var c=d.getTextView();c.setKeyBinding(e(g.key),a.id);c.setAction(a.id,a.callback,a)}});b++});c.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=q.getFileMetadata()){var b=g.node("pageActions");b&&(m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,a,d,"button"));if(b=g.node("pageNavigationActions"))m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,d,d,"button")}})})}};f.EditorCommandFactory=q;return f});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function h(h,g,e){this.serviceRegistry=h;this.editor=g;this.contentType=e;this.contentTypeService=h.getService("orion.core.contenttypes");this.serviceReferences={};var c=this;this.listener={onServiceAdded:function(b){c._onServiceAdded(b.serviceReference)},onServiceRemoved:function(b){c._onServiceRemoved(b.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",
this.listener.onServiceRemoved);this._init()}h.prototype={_init:function(){var h=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){h._wire(h.serviceRegistry)})},_wire:function(h){for(var h=h.getServiceReferences("orion.edit.model"),g=0;g<h.length;g++)this._wireServiceReference(h[g])},_wireServiceReference:function(h){var g=h.getProperty("contentType");if(typeof g!==void 0&&g!==null){var e=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
g).then(function(c){c&&e._wireService(h,e.serviceRegistry.getService(h))})}},_wireService:function(h,g){var e=h.getProperty("types"),c=this.editor.getTextView();if(e){for(var b=0;b<e.length;b++){var a=e[b],j=g["on"+a];j&&this._wireServiceMethod(h,g,j,c,a)}this._initService(g,c)}},_wireServiceMethod:function(h,g,e,c,b){g=function(a){e(a).then()};h=h.getProperty("service.id");this.serviceReferences[h]=this.serviceReferences[h]||[];this.serviceReferences[h].push([c,b,g]);c.addEventListener(b,g)},_onServiceRemoved:function(h){var h=
h.getProperty("service.id"),g=this.serviceReferences[h];if(g){for(var e=0;e<g.length;e++){var c=g[e];c[0].removeEventListener(c[1],c[2])}delete this.serviceReferences[h]}},_onServiceAdded:function(h){h.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(h)},_initService:function(h,g){var e=h.onModelChanging;if(typeof e==="function"){var c=g.getModel(),b=c.getText(),c={type:"Changing",text:b,start:0,removedCharCount:0,addedCharCount:b.length,removedLineCount:0,addedLineCount:c.getLineCount()};
e.call(h,c)}}};return{Dispatcher:h}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(h){function k(b){return(b=b.getProperty("contentType"))?Array.isArray(b)?b:[b]:null}function g(b){var a=this.contentTypesMap={},g=new h(b,e),d=new h(b,c),f=this.notifySyntaxModelListeners.bind(this);g.addingService=function(d){var c=b.getService(d);(d=k(d))&&d.forEach(function(b){var d=a[b];d?d.push(c):a[b]=[c]})};g.removedService=function(b,d){var c=k(b);c&&c.forEach(function(b){var b=a.hasOwnProperty(b.id)?a[b.id]:null,c=b.indexOf(d);
c!==-1&&b.splice(c,1)})};d.addingService=function(a){var d=b.getService(a);k(a)&&(typeof d.addEventListener!=="function"?console.log(Error("A "+c+' service must provide an "addEventListener" method')):d.addEventListener("orion.edit.syntaxmodel.modelReady",f))};d.removedService=function(a,b){b&&typeof b.removeEventListener==="function"&&b.removeEventListener("orion.edit.syntaxmodel.modelReady",f)};g.open();d.open()}var e="orion.edit.syntaxmodel.listener",c="orion.edit.syntaxmodel.provider";g.prototype.notifySyntaxModelListeners=
function(b){var a=b.contentType,c=b.syntaxModel;typeof a!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(b=this.contentTypesMap.hasOwnProperty(a)?this.contentTypesMap[a]:null)&&b.forEach(function(a){a.setSyntaxModel(c)})};return g});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/globalCommands,orion/edit/dispatcher,orion/highlight,orion/edit/syntaxmodel,orion/PageUtil".split(","),function(h,k,g,e,c,b,a,j,d,f){function i(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),d=0;d<a.length;d++)this._document.addEventListener(a[d],
b,!0);e.attach(this)}function l(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:h["No response from server.  Check your internet connection and try again."]};else{var d=b.responseText;if(d)try{b=JSON.parse(d)}catch(c){b={Severity:"Error",Message:d}}}a.setProgressResult(b)}else window.console.log(b)}function o(a){this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeService=a.contentTypeService;this.selection=
a.selection;this.syntaxHighlighter=new j.SyntaxHighlighter(this.serviceRegistry);this.syntaxModelWirer=new d(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;e.attach(this)}i.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;if(this._timer)a.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},
onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=a;this._resetTimer()}};c.mixin(o.prototype,{load:function(){var a=this.getInput();if(a){var b=this.fileClient,d=this.progressService,c=this.getEditor();if(this._fileMetadata)d.progress(b.read(a,!0),k.formatMessage(h["Reading metedata of"],a)).then(function(e){if(this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!c.isDirty()||window.confirm(h.loadOutOfSync))&&d.progress(b.read(a),k.formatMessage(h.Reading,a)).then(function(b){c.setInput(a,
null,b)})}.bind(this));else{var e=window.setTimeout(function(){c.reportStatus(k.formatMessage(h.Fetching,a))},800);(new g.all([d.progress(b.read(a),k.formatMessage(h.Reading,a)),d.progress(b.read(a,!0),k.formatMessage(h["Reading metedata of"],a))],function(a){return{_error:a}})).then(function(b){e&&window.clearTimeout(e);var d=b[0],b=b[1];if(d._error||b._error){var f=this.serviceRegistry.getService("orion.page.message");l(f,d._error||b._error);this._setNoInput()}else this._setInputContents(this._parsedLocation,
a,d,b);c.reportStatus("")}.bind(this))}}},processParameters:function(a){for(var b=this.getEditor(),d=["start","end","line","offset","length"],c=0;c<d.length;c++){var e=d[c];a[e]&&(a[e]=parseInt(a[e],10))}b.showSelection(a.start,a.end,a.line,a.offset,a.length)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},save:function(){function a(b){j.getFileMetadata().ETag=
b.ETag;d.setInput(c,null,e,!0);d.reportStatus("");j.afterSave&&j.afterSave();j._saving=!1}function b(a){d.reportStatus("");l(i,a);j._saving=!1;j._errorSaving=!0}if(!this._saving){var d=this.getEditor();if(d.isDirty()){this._saving=!0;this._errorSaving=!1;var c=this.getInput();d.reportStatus(h["Saving..."]);var e=d.getText(),f={ETag:this.getFileMetadata().ETag},f=this.fileClient.write(c,e,f),g=this.progressService,i=this.serviceRegistry.getService("orion.page.message");g&&(f=g.progress(f,k.formatMessage(h["Saving file {0}"],
c)));var j=this;f.then(a,function(d){d.status===412?window.confirm(h["Resource is out of sync with the server. Do you want to save it anyway?"])?(d=j.fileClient.write(c,e),g&&(d=g.progress(d,k.formatMessage(h["Saving file {0}"],c))),d.then(a,b)):j._saving=!1:b(d)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;if(this._idle)this._idle.setTimeout(a);else{var b=this.getEditor(),d=b.getTextView(),c=function(){b.removeEventListener("TextViewInstalled",
c);var d={document:b.getTextView().getOptions("parent").ownerDocument,timeout:a};this._idle=new i(d);this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this));this._idle.setTimeout(a)}.bind(this);d?c():b.addEventListener("TextViewInstalled",c)}},setDirty:function(a){b.setDirtyIndicator(a)},setInput:function(a){if(!this._ignoreInput){if(!a)a=window.location.hash;if(typeof a==="string"){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var d=f.matchResourceParameters(a);
if(b.isDirty()&&(b=this._location,f.matchResourceParameters(b).resource!==d.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(h["There are unsaved changes.  Do you still want to navigate away?"])){window.location.hash=b;return}this._location=a;this._parsedLocation=d;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=d.resource)?a===this._input?this.processParameters(d):(this._input=a,this._fileMetadata=null,this.load()):this._setNoInput()}}},_setNoInput:function(){this._input=
this._title=this._contentType=null;this.editor.uninstallTextView();this.dispatchEvent({type:"InputChanged",input:null})},_setInputContents:function(b,d,c,e){var f;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this._contentType=this.contentTypeService.getFileContentType(e),f=e.Name):(this._fileMetadata=null,this.setTitle(d),this._contentType=this.contentTypeService.getFilenameContentType(this.getTitle()),f=this.getTitle());var g=this.getEditor();g.getTextView()||(g.installTextView(),
g.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)));this.dispatchEvent({type:"InputChanged",input:b,name:f,metadata:e,contents:c});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),d,!0).then(function(){var e=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(e&&e.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new a.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(d,null,c);h.processParameters(b)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:o}});
define("orion/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(h,k,g,e,c,b,a,j,d,f,i,l,o,m,s,r,p){function q(a){this._syntaxHighlither=
new j.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(d){this.serviceRegistry=d;this._diffProvider=new b.DiffProvider(d)}a.prototype={_resolveTwoFiles:function(a,b){var d=this;return g.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(c){if(Array.isArray(c)&&c.length===2&&c[0]&&c[1]){var e=c[0],c=c[1];return(new g).resolve({oldFile:{URL:a,Name:d._resolveFileName(a),Type:e},newFile:{URL:b,Name:d._resolveFileName(b),Type:c},diffContent:d._diffContent})}else return e=
a?d._resolveFileName(a):"",c=b?d._resolveFileName(b):"",(new g).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:b,Name:c,Type:null},diffContent:d._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contenttypes").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,d){this._hasConflicts=d;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var c=this;return c._diffProvider.getDiffContent(a).then(function(b){c._diffContent=c._hasConflicts?b.split("diff --git")[1]:b;return c._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();q.prototype={highlight:function(a,b,d){return this._syntaxHighlither.setup(b,d.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function b(c,g,i,j){this._registry=c;this._commandService=g;this._fileClient=new d.FileClient(c);this._fileClient=new d.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 q(c),new q(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 r.InputManager({serviceRegistry:c,fileClient:k._fileClient,progressService:k._progress});s.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){f.setDirtyIndicator(a)},
getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return k._compareView.getWidget().getEditors()[1]},setInput:function(a){k._progress.progress(k._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;if(k.options.savable){var b=e.node("pageActions");b&&(k._commandService.destroy(b),k._commandService.renderCommands(b.id,b,k._compareView.getWidget().getEditors()[1],k._compareView.getWidget().getEditors()[1],"button"))}a&&this.setTitle(a.Location,
a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){var d;if(b)d=b.Name;f.setPageTarget({task:h.Compare,name:d,target:b,serviceRegistry:c,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(f.setDirtyIndicator(!0),a.substring(1)):f.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,b,d,c){b=new o.TextSearcher(a,k._commandService,d);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);(new p.KeyBindingsFactory).createKeyBindings(a,
d,c,b)};this._compareView.getWidget().initEditors(h["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))}}b.prototype={_clearOptions:function(){this.options={}},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},
generateLink:function(a){a=a.getCurrentDiffPos();a=c.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(h["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return c.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 i.Command({tooltip:h["Generate link of the current diff"],name:h["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 i.Command({tooltip:h["Open the compare page"],name:h.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 b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return g.all(b,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(b){a.Content=b;return a}.bind(this),
function(b){if(b.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(b){a._compareView.getWidget().setOptions(b);var d=a._compareView.getWidget().options;d.oldFile.readonly=!0;if(a.options.readonly)d.newFile.readonly=!0;return a._getFilesContents(d.diffContent?[d.oldFile]:[d.oldFile,d.newFile]).then(function(){var b=
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(d.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new g).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return b}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages","orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib"],function(h,k,g,e){function c(a){for(var b=0;b<j.length;b++)if(a.type===j[b])return!0;return!1}function b(b){for(var c=0;c<a.length;c++)if(b.type===a[c])return!0;return!1}var a=["Missing","Modified","Untracked","Conflicting"],j=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:c,isUnstaged:b,isChange:function(a){return c(a)||
b(a)},hasStagedChanges:function(a){for(var b=0;b<j.length;b++)if(a[j[b]].length>0)return!0;return!1},hasUnstagedChanges:function(b){for(var c=0;c<a.length;c++)if(b[a[c]].length>0)return!0;return!1},createCompareWidget:function(a,b,c,h,j,m,s,r,p){var q=new g.DefaultDiffProvider(a),m=new k.CompareCommandFactory({commandService:b,commandSpanId:m,gridRenderer:r});(new g.ResourceComparer(a,b,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:h,diffProvider:q,resource:c,compareTo:p,editableInComparePage:s},
{parentDivId:j,commandProvider:m})).start().then(function(a){var b=420;a<b&&(b=a);e.node(j).style.height=b+"px"})}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(h){function k(g){this._prefix="/git/credentials";this._preferenceService=g.getService("orion.core.preference")}k.prototype={put:function(g,e){var c={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(e!==void 0){if(e.gitSshUsername!==void 0&&e.gitSshUsername!==null)c.gitSshUsername=e.gitSshUsername;if(e.gitSshPassword!==void 0&&e.gitSshPassword!==null)c.gitSshPassword=e.gitSshPassword;if(e.gitPrivateKey!==void 0&&
e.gitPrivateKey!==null)c.gitPrivateKey=e.gitPrivateKey;if(e.gitPassphrase!==void 0&&e.gitPassphrase!==null)c.gitPassphrase=e.gitPassphrase}var b=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(a){var e=a.get("settings");e===void 0?b.reject():e.enabled?(a.put(g,c),b.resolve()):b.reject()});return b},get:function(g){var e={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},c=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var a=
b.get("settings");a===void 0?c.reject():a.enabled?(b=b.get(g),b!==void 0?c.resolve(b):c.resolve(e)):c.reject()});return c},isEnabled:function(){var g=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e=e.get("settings");e===void 0?g.resolve(!1):g.resolve(e.enabled)});return g},enable:function(){var g=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e.put("settings",{enabled:!0});g.resolve()});return g},disable:function(){var g=new h;this._preferenceService.getPreferences(this._prefix,
2).then(function(e){e.put("settings",{enabled:!1});g.resolve()});return g},remove:function(g){var e=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(c){c.remove(g);e.resolve()});return e},getRepositories:function(){var g=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(e){for(var c=[],e=e.keys(),b=0;b<e.length;++b)e[b]!=="settings"&&c.push(e[b]);g.resolve(c)});return g}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(h){function k(g){this._prefix="/git/config";this._preferenceService=g.getService("orion.core.preference")}k.prototype={getConfig:function(){var g=new h;this._preferenceService.getPreferences(this._prefix).then(function(e){e=e.get("userInfo");g.resolve(e)});return g},setConfig:function(g){var e=new h;this._preferenceService.getPreferences(this._prefix).then(function(c){c.put("userInfo",g);e.resolve()});return e}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function g(e){this._init(e)}g.prototype=new k.Dialog;g.prototype.TEMPLATE='<div id="header"></div>';g.prototype._init=function(e){var c=this;this.title="Git Push";this.modal=!0;this.messages=h;this.location=e.location;this.dialog2=e.dialog;this.func=e.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c.dialog2.show()},text:"More"});this.buttons.push({callback:function(){c.destroy();c.func()},
text:"OK"});this._initialize()};g.prototype._bindToDom=function(){var e=this.$header;e.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));e.appendChild(document.createElement("br"));e.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};g.prototype.constructor=g;return{ConfirmPushDialog:g}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(h,k,g,e){function c(a,b){this.explorer=b;this._init(a)}function b(a){this._init(a)}var a=function(){function a(b,c,e,g){this.gitClient=b;this.rootPath=c;this.fetchItems=e;this.root=g?g:null}a.prototype=new g.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 e=0;e<c.Children.length;e++)c.Children[e].parent=a;b(c.Children)}):a.Type==="Remote"&&this.gitClient.getGitBranch(a.Location).then(function(c){a.children=c.Children;for(var e=0;e<c.Children.length;e++)c.Children[e].parent=a;b(c.Children)})};return a}();c.prototype=new g.SelectionRenderer;c.prototype.constructor=
c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=function(a,b,c){var e=document.createElement("td");c.appendChild(e);a=document.createElement("span");a.id=c.id+"navSpan";e.appendChild(a);a.className="mainNavColumn singleNavColumn";(b.children||b.Children||b.GroupNode||b.Type==="Remote"||b.BranchLocation&&b.RemoteLocation)&&this.getExpandImage(c,a);c=b.Name;b.Type==="RemoteTrackingBranch"&&!b.Id&&(c=b.Name+h[" [New branch]"]);a.appendChild(document.createTextNode(c))};
b.prototype=new k.Dialog;b.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>';b.prototype._init=function(a){var b=this;this.title=a.title||h["Choose a Folder"];this.modal=!0;this.messages=h;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"})};b.prototype._bindToDom=function(){var a=this;this.$newBranch.addEventListener("input",function(){a._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};b.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
b.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};b.prototype._loadRemoteChildren=function(){this._createTree(new a(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};b.prototype._createTree=function(a){var b=this,f=this.serviceRegistry.getService("orion.remotePrompter.selection");f||(f=new e.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var h=new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new g.Explorer(this.serviceRegistry,f,h);h.explorer=this.explorer;this.explorer.createTree("treeContentPane",a);f.addEventListener("selectionChanged",function(a){b.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;b._validate(a.selection)})};b.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))};b.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 c=b.CloneLocation.substring(b.CloneLocation.indexOf(b.CloneLocation.split("/")[3])),e={};e.parent=b;e.FullName="refs/remotes/"+b.Name+"/"+a.$newBranch.value;e.Name=b.Name+"/"+a.$newBranch.value;
e.Type="RemoteTrackingBranch";e.Location="/gitapi/remote/"+b.Name+"/"+encodeURIComponent(a.$newBranch.value)+"/"+c;a.func(null,b,e)}})};b.prototype.constructor=b;return{RemotePrompterDialog:b}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function g(e){this._init(e)}g.prototype=new k.Dialog;g.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>';g.prototype._init=
function(e){var c=this;this.title=e.title||h["Contribution Review Request"];this.modal=!0;this.messages=h;this.url=e.url;this.func=e.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c.func(c.$reviewerName.value)},text:"Submit"});this._initialize()};g.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};g.prototype.constructor=g;return{ReviewRequestDialog:g}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget".split(","),function(h,k,g,e,c,b,a,j){function d(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 f(a){j.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=a.fileClient;
this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=this.modelEventDispatcher=new j,c=this;"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,c.modelHandler[a].bind(c))});var d=this.renderer;
this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){d.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}d.prototype=new a.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.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};d.prototype.getChildren=function(a,b){var c=this;a.children?b(a.children):a.Directory!==void 0&&a.Directory===!1?b([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){b(c.processParent(a,
d))}):b([])};d.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};d.prototype.constructor=d;f.prototype=Object.create(a.Explorer.prototype);f.prototype.modelHandler={copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents[0]||b.treeRoot;c[a.Location]=a});Object.keys(c).forEach(function(a){b.changedItem(c[a],!0)})},create:function(a){this.changedItem(a.parent,!0,a.newValue)},"delete":function(){},
deleteMultiple:function(a){var a=a.items,b=this,c;if(a.some(function(a){return a.oldValue.Location===b.treeRoot.Location?(c=a.parent,!0):!1}))this.loadResourceList(c);else{var d={};a.forEach(function(a){a=a.parent;d[a.Location]=a});Object.keys(d).forEach(function(a){b.changedItem(d[a],!0)})}},"import":function(a){this.changedItem(a.target,!0)},move:function(a){var b=a.oldValue,c=a.newValue,a=a.parent,d=this,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);g.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)}};f.prototype._makeDropTarget=function(a,d,f){function g(a,d,e,f,j,i){d=d||"";if(a.isFile)b.isAtRoot(e.Location)?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):a.file(function(a){j(e,a,f,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(c.formatMessage(h["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var k=a.createReader(),l=function(b){k.readEntries(function(c){for(var e=0;e<c.length;e++)g(c[e],d+a.name+"/",b,f,j,i)})},o=f.registry.getService("orion.page.progress");b.isAtRoot(e.Location)?o.progress(i.createProject(e.ChildrenLocation,a.name),"Initializing project "+
a.name).then(function(a){f.loadResourceList(f.treeRoot.Path,!0);o.progress(i.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):o.progress(i.createFolder(e.Location,a.name),"Creating folder "+a.name).then(function(a){f.changedItem(e,!0);l(a)})}}if(this.dragAndDrop){var j=this,k=this.dragAndDrop,p=function(a){d.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(f)this._oldDragLeave&&d.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=
p;d.addEventListener("dragleave",p,!1);p=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";d.classList.add("dragOver");e.stop(a)};if(f)this._oldDragEnter&&d.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=p;d.addEventListener("dragenter",p,!1);p=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||
a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";e.stop(a)};if(f&&!this._oldDragOver)d.addEventListener("dragover",p,!1),this._oldDragOver=p;p=function(f){d.classList.remove("dragOver");if(f.dataTransfer.items&&f.dataTransfer.items.length>0)for(var o=0;o<f.dataTransfer.items.length;o++){var n=null;typeof f.dataTransfer.items[o].getAsEntry==="function"?n=f.dataTransfer.items[o].getAsEntry():typeof f.dataTransfer.items[o].webkitGetAsEntry==="function"&&(n=f.dataTransfer.items[o].webkitGetAsEntry());
n&&g(n,null,a,j,k,j.fileClient)}else if(f.dataTransfer.files&&f.dataTransfer.files.length>0)for(o=0;o<f.dataTransfer.files.length;o++)n=f.dataTransfer.files[o],!n.length&&(!n.type||n.type==="")?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:c.formatMessage(h["Did not drop ${0}.  Folder drop is not supported in this browser."],n.name)}):b.isAtRoot(a.Location)?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):
k(a,n,j,n.name.indexOf(".zip")===n.name.length-4&&window.confirm(c.formatMessage(h["Unzip ${0}?"],n.name)));e.stop(f)};if(f)this._oldDrop&&d.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=p;d.addEventListener("drop",p,!1)}};f.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this;return this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+
a.Name).then(function(d){d=c.model.processParent(a,d);c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,d,b);return(new g).resolve(d)})};f.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};f.prototype.getNameNode=function(a){if(a=this.model.getId(a))return e.node(a+"NameLink")};f.prototype.scopeUp=function(){};f.prototype.loadResourceList=function(a,c,d){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=b.makeRelative(a);if(!c&&a===
this._lastPath)return(new g).resolve(this.treeRoot);this._lastPath=a;var e=this;return c||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),"Loading "+a).then(function(){e.treeRoot.Path=a;typeof d==="function"&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new g).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new g).reject(a)}):(new g).resolve(e.treeRoot)};f.prototype.load=function(a,b,c){var f=
e.node(this.parentId),j=e.node("progress");if(!j)j=document.createElement("div"),j.id="progress",e.empty(f),f.appendChild(j);e.empty(j);var k=setTimeout(function(){e.empty(j);j.appendChild(document.createTextNode(b))},500),p=this;return g.when(a,function(a){p.treeRoot={};clearTimeout(k);for(var b in a)p.treeRoot[b]=a[b];p.model=new d(p.registry,p.treeRoot,p.fileClient,p.parentId,p.excludeFiles,p.excludeFolders);p.model.processParent(p.treeRoot,a.Children);if(p.dragAndDrop)p._hookedDrag?p._makeDropTarget(p.treeRoot,
f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),p._hookedDrag=!0,a?p._makeDropTarget(p.treeRoot,f,!0):(p.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));p.model.hasChildren()?p.createTree(p.parentId,p.model,{navHandlerFactory:p.navHandlerFactory,setFocus:typeof p.setFocus==="undefined"?!0:p.setFocus,selectionPolicy:p.renderer.selectionPolicy,onCollapse:function(a){if(p.getNavHandler())p.getNavHandler().onCollapse(a)}}):
(e.empty(f),a=document.createElement("div"),a.classList.add("noFile"),a.textContent=h.NoFile,b=document.createElement("span"),b.classList.add("core-sprite-addcontent"),b.classList.add("icon-inline"),b.classList.add("imageSprite"),e.processDOMNodes(a,[b]),f.appendChild(a));if(typeof c==="function")try{c()}catch(j){p.registry&&p.registry.getService("orion.page.message").setErrorMessage(j)}if(typeof p.onchange==="function")p.onchange(p.treeRoot);return(new g).resolve(p.treeRoot)},function(a){clearTimeout(k);
p.registry.getService("orion.page.message").setProgressResult(a);return(new g).reject(a)})};f.prototype.onchange=function(){};f.prototype.constructor=f;return{FileExplorer:f,FileModel:d}});
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(h,k,g,e,c,b,a,j){function d(a,b){this.explorer=b;this._init(a)}function f(a){this._init(a)}d.prototype=new a.SelectionRenderer;d.prototype.constructor=d;d.prototype.getLabelColumnIndex=function(){return 0};d.prototype.getCellElement=
function(a,b,c){a=document.createElement("td");c.appendChild(a);var d=document.createElement("span");d.id=c.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(c,d);d.appendChild(document.createTextNode(b.Name))};f.prototype=new g.Dialog;f.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
f.prototype._init=function(a){this.title=a.title||h["Choose a Folder"];this.modal=!0;this.buttons=[{text:h.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};f.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
f.prototype.loadFolderList=function(a){a=e.makeRelative(a);this.selection=new c.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new j.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new d({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};f.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};f.prototype.constructor=f;return{DirectoryPrompterDialog:f}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","require"],function(h,k,g,e){function c(b){this._init(b)}c.prototype=new g.Dialog;c.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>';c.prototype._init=
function(b){var a=this;this.title=b.title?b.title:h["Clone Git Repository"];this.modal=!0;this.messages=h;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){a.destroy();a._execute()},text:"OK"});this._initialize()};c.prototype._bindToDom=function(){var b=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){b.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){b._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){b._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){b._checkNewExisting()});this.$gitName.addEventListener("focus",function(){b._showNewProject()});this.$advancedLink.addEventListener("click",
function(){b._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){b._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};c.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)};c.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};c.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};c.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};c.prototype._showNewProject=function(){this.$isNewProject.checked=!0};c.prototype._openDirectoryPickerDialog=function(){function b(a){var b=document.createElement("a");
b.href=e.toUrl("navigate/table.html")+"#"+a.ChildrenLocation;b.textContent=a.Name;return b}var a=this;this.$isExistingProject.checked=!0;var c=new k.DirectoryPrompterDialog({title:h["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(c){if(c&&c.Location){for(a.$gitPath.value=c.Location;a.$shownGitPath.hasChildNodes();)a.$shownGitPath.removeChild(a.$shownGitPath.lastChild);for(a.$shownGitPath.appendChild(b(c));c.parent&&c.parent.Location!=="/";)a.$shownGitPath.insertBefore(document.createTextNode("/"),
a.$shownGitPath.firstChild),a.$shownGitPath.insertBefore(b(c.parent),a.$shownGitPath.firstChild),c=c.parent}}});this._addChildDialog(c);c.show()};c.prototype.constructor=c;return{CloneGitRepositoryDialog:c}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(h,k,g){function e(c){this._init(c)}e.prototype=new g.Dialog;e.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>';e.prototype._init=
function(c){var b=this;this.title=c.title||h["Git Credentials"];this.modal=!0;this.messages=h;this.options=c;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(c.serviceRegistry)this._sshService=c.serviceRegistry.getService("orion.net.ssh"),this._progressService=c.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){b.destroy();
b._execute()},text:"OK",isDefault:!0});this._initialize()};e.prototype._bindToDom=function(){var c=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(){c.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(b){if(!b)c.$gitSaveCredentials.style.display="none",c.$gitSaveCredentialsLabel.style.display="none",c.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){c.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(b){c.privateKeyFile=b.target.files[0]})};e.prototype._execute=function(){var c=this,b=this.$gitPrivateKey.value,
a=this.$url.textContent,e=function(a){if(c._sshService)c._sshService.getKnownHosts().then(function(b){if(c.options.func){var d=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;d!=="undefined"&&c._progressService.removeOperation(d);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$isSshPassword.checked?c.$gitSshPassword.value:"",gitPrivateKey:c.$isPrivateKey.checked?a:"",gitPassphrase:c.$isPrivateKey.checked?c.$gitPassphrase.value:
"",knownHosts:b})}});else if(c.options.func){var b=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;b!=="undefined"&&c._progressService.removeOperation(b);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:c.$gitPassphrase.value,knownHosts:c.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var d=new FileReader;d.onload=function(){return function(d){b=d.target.result;
d=new k(c.options.serviceRegistry);c.$gitSaveCredentials.checked?d.put(a,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){e(b)}):e(b)}}(this.privateKeyFile);d.readAsText(this.privateKeyFile)}else b.length>0?(d=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?d.put(a,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){e(b)}):e(b)):(d=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?d.put(a,{gitSshUsername:c.$gitSshUsername.value,
gitSshPassword:c.$gitSshPassword.value}).then(function(){e(b)}):e(b))};e.prototype.constructor=e;return{GitCredentialsDialog:e}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/webui/littlelib".split(","),function(h,k,g,e,c,b){function a(a){this._init(a)}a.prototype=new c.Dialog;a.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>';a.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()};a.prototype._bindToDom=function(){var a=this;this.$resourceName.addEventListener("input",function(){a.time=+new Date;
a.timeoutId&&clearTimeout(a.timeoutId);a.timeoutId=setTimeout(a._checkSearch.bind(a),0)},!1);this.$resourceName.addEventListener("keydown",function(c){if(c.keyCode===b.KEY.ENTER){var e=b.$("a",a.$results);e&&(b.stop(c),window.open(e.href),a.hide())}},!1);this.$resourceName.value=this.commitName};a.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)};a.prototype._findCommitLocation=function(a,b,c){var g=this;c||(c=new e);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){c.resolve(a.Children[0])},function(){g._findCommitLocation(a.slice(1),b,c)}):c.reject();return c};a.prototype._doSearch=function(){var a=this,c=this.$resourceName&&this.$resourceName.value;
if(c){var e=document.createElement("div");e.appendChild(document.createTextNode(k["Searching..."]));b.empty(this.$results);this.$results.appendChild(e);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,c).then(function(c){b.empty(a.$results);a._displayCommit(c,a.$results);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var c=document.createElement("div");c.appendChild(document.createTextNode("No commits found"));
b.empty(a.$results);a.$results.appendChild(c);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};a.prototype._displayCommit=function(a,c){var e=this,i=document.createElement("div");i.style.padding="10px";i.style.maxWidth="480px";b.empty(c);c.appendChild(i);var l=a.Message.split(/(\r?\n|$)/)[0],o=document.createElement("a");o.className="navlinkonpage";o.href=h.toUrl("git/git-commit.html#")+a.Location+"?page=1&pageSize=1";o.textContent=l;i.appendChild(o);o.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&e.hide()},!1);o.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&e.hide()},!1);l=document.createElement("div");l.style.paddingTop="15px";i.appendChild(l);if(a.AuthorImage)i=new Image,i.src=a.AuthorImage,i.name=a.AuthorName,i.className="git-author-icon",l.appendChild(i);i=document.createElement("div");i.textContent=g.formatMessage(k[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString());l.appendChild(i);
i=document.createElement("div");i.textContent=g.formatMessage(k["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);l.appendChild(i);i=document.createElement("div");i.style.paddingTop="15px";i.textContent=k["commit:"]+a.Name;l.appendChild(i);if(a.Parents&&a.Parents.length>0)c=document.createElement("div"),c.textContent=k["parent:"],i=document.createElement("a"),i.className="navlinkonpage",i.href=h.toUrl("git/git-commit.html#")+a.Parents[0].Location+"?page=1&pageSize=1",i.textContent=a.Parents[0].Name,
c.appendChild(i),i.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&e.hide()},!1),i.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&e.hide()},!1),l.appendChild(c)};a.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};a.prototype.constructor=a;return{OpenCommitDialog:a}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function g(e){this._init(e)}g.prototype=new k.Dialog;g.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>';
g.prototype._init=function(e){var c=this;this.title=h["Commit Changes"];this.modal=!0;this.messages=h;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};g.prototype._bindToDom=function(){var e=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){e._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(){e._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){e._validate()});this._validate()};g.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=h["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The commit message is required."])};g.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var e={};e.Message=this.$commitMessage.value;e.Amend=this.$amend.checked?!0:!1;e.CommitterName=this.$committerName.value;e.CommitterEmail=this.$committerEmail.value;e.AuthorName=this.$authorName.value;e.AuthorEmail=this.$authorEmail.value;this.options.func(e)}this.hide()}};
g.prototype.constructor=g;return{CommitDialog:g}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function g(e){this._init(e)}g.prototype=new k.Dialog;g.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>URL:<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>File:<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';g.prototype._init=
function(e){var c=this;this.title=h["Apply Patch"];this.modal=!0;this.messages=h;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._applyPatch()},text:"OK"});this._initialize()};g.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)};g.prototype._applyPatch=function(){var e=new FormData;
e.append("uploadedfile",this.$selectedFile.files[0]);e.append("url",this.$url.value);e.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(e)};g.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())};g.prototype.constructor=g;return{ApplyPatchDialog:g}});
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(h,
k,g,e,c,b,a,j,d,f,i,l,o,m,s,r,p,q,t,n,v,w){var u={};(function(){function n(a){var b;try{b=JSON.parse(a.responseText)}catch(c){b={Message:h["Problem while performing the action"]}}b.HttpCode=a.status;return b}var E=!1;u.updateNavTools=function(a,b,d,e,f,g,h){var j=c.node(e);if(j)b.destroy(j);else throw"could not find toolbar "+e;b.renderCommands(e,j,g,d,"button");if(h&&(e=c.node(h)))b.destroy(e),b.renderCommands(h,e,g,d,"button");if(f&&(g=c.node(f)))b.destroy(f),b.renderCommands(f,g,null,d,"button");
E||(E=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=c.node(f);e&&(b.destroy(e),b.renderCommands(f,e,a.selections,d,"button"))}))};u.handleKnownHostsError=function(a,b,c,d){if(confirm(e.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var f=a.getService("orion.net.ssh");f.addKnownHosts(b.Host+" "+b.KeyType+" "+b.HostKey).then(function(){f.getKnownHosts().then(function(b){c.knownHosts=
b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);d(c)})})}};u.handleSshAuthenticationError=function(a,b,c,d,e){var b=b?b.Url:void 0,g=function(){(new r.GitCredentialsDialog({title:e,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 f(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)};u.getDefaultSshOptions=function(a,b){var c=new g,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};u.handleProgressServiceResponse=function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=n(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;u.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=
a.failedOperation;u.handleKnownHostsError(c,a.JsonData,b,e);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)}};u.gatherSshCredentials=function(a,b,c){var d=new g,j;if(b.items.RemoteLocation!==void 0)j=b.items.RemoteLocation[0].GitUrl;else if(b.items.GitUrl!==void 0)j=b.items.GitUrl;else if(b.items.errorData!==void 0)j=b.items.errorData.Url;else if(b.items.toRef!==void 0)j=b.items.toRef.RemoteLocation[0].GitUrl;
var i=function(c){a.getService("orion.net.ssh").getKnownHosts().then(function(a){b.sshObject=c;d.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},k=b.errorData;if(k&&k.HostKey)return confirm(e.formatMessage(h["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 f(a)).get(j).then(function(a){i(a)},function(){i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),d;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"):"",e=b.parameters?b.parameters.valueFor("sshpassword"):"",g=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,h=new f(a);g?h.put(j,{gitSshUsername:d,gitSshPassword:e}).then(function(){i({gitSshUsername:d,gitSshPassword:e,gitPrivateKey:"",gitPassphrase:""})}):i({gitSshUsername:d,gitSshPassword:e,gitPrivateKey:"",gitPassphrase:""})}else(new r.GitCredentialsDialog({title:c,serviceRegistry:a,
func:i,errordata:k})).show()};b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?l():(new f(a)).get(j).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?i(a):l()},l);return d};u.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=n(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)}};u.createFileCommands=function(c,i,n){function p(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}var q=new a.ParametersDescription([new a.CommandParameter("name",
"text",h["Local Branch Name:"])]),q=new b.Command({name:h.Checkout,tooltip:h["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:q,callback:function(a){var b=a.items,d=function(a,b,d){c.getService("orion.page.progress").showWhile(c.getService("orion.git.provider").checkoutTag(a,b,d),e.formatMessage(h["Checking out tag ${0}"],d)).then(function(){n.changedItem()},p)},f=b.Repository?
b.Repository.Location:b.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(f,b.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});i.addCommand(q);q=new b.Command({name:h.Checkout,tooltip:h["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 b=a.items,d=c.getService("orion.git.provider"),f=c.getService("orion.page.message"),g=c.getService("orion.page.progress");f.setProgressMessage(b.Name?e.formatMessage(h["Checking out branch ${0}..."],b.Name):h["Checking out branch..."]);b.Type==="Branch"?g.progress(d.checkoutBranch(b.CloneLocation,b.Name),"Checking out branch "+b.Name).then(function(){f.setProgressResult(h["Branch checked out."]);n.changedItem(b.parent)},function(a){p(a)}):g.progress(d.addBranch(b.Repository?
b.Repository.BranchLocation:b.parent.parent.BranchLocation,null,b.Name),"Adding branch "+b.Name).then(function(a){g.progress(d.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+b.Name).then(function(){f.setProgressResult(h["Branch checked out."]);n.changedItem(b.Repository?b.Repository.BranchLocation:b.parent.parent.parent)},function(a){p(a)})},function(a){p(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});i.addCommand(q);q=new a.ParametersDescription([new a.CommandParameter("name",
"text","Name:")]);q=new b.Command({name:h["New Branch"],tooltip:h["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:q,callback:function(a){var b=a.items,d=c.getService("orion.page.progress"),e=function(a,e){d.progress(c.getService("orion.git.provider").addBranch(a,e),"Adding branch "+e).then(function(){n.changedItem(b)},p)},f;f=b.Type==="Clone"?b.BranchLocation:b.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"&&n.parentId==="artifacts"}});i.addCommand(q);q=new b.Command({name:h.Delete,tooltip:h["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var b=a.items,a=c.getService("orion.page.progress");confirm(e.formatMessage(h["Are you sure you want to delete branch ${0}?"],b.Name))&&a.progress(c.getService("orion.git.provider").removeBranch(b.Location),
"Removing branch "+b.Name).then(function(){n.changedItem?n.changedItem(b.parent):n.displayBranches&&n.displayBranches(b.ParentLocation,null)},p)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});i.addCommand(q);q=new b.Command({name:h.Delete,tooltip:h["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var b=a.items,d=c.getService("orion.page.progress");confirm(e.formatMessage(h["You're going to delete remote branch ${0} and push the change."],
b.Name)+"\n\n"+h["Are you sure?"])&&u.getDefaultSshOptions(c).then(function(a){var e=arguments.callee,f=c.getService("orion.git.provider"),g=c.getService("orion.page.message"),f=d.progress(f.doPush(b.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Removing remote branch: "]+b.Name);g.createProgressMonitor(f,h["Removing remote branch: "]+b.Name);f.then(function(d){u.handleProgressServiceResponse(d,a,c,function(a){a.Result.Severity=="Ok"&&n.changedItem(b.parent)},
e,h["Delete Remote Branch"])},function(d){u.handleProgressServiceResponse(d,a,c,function(){},e,h["Removing remote branch: "]+b.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});i.addCommand(q);q=new a.ParametersDescription([new a.CommandParameter("name","text","Name:"),new a.CommandParameter("url","url","Url:")]);q=new b.Command({name:h["New Remote"],tooltip:h["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:q,callback:function(a){var b=a.items,d=
c.getService("orion.page.progress"),e=function(a,e,f){d.progress(c.getService("orion.git.provider").addRemote(a,e,f),"Adding remote "+a).then(function(){n.changedItem(b)},p)},f;f=b.Type==="Clone"?b.RemoteLocation:b.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"&&n.parentId==="artifacts"}});i.addCommand(q);q=new b.Command({name:h.Delete,
tooltip:h["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var b=a.items;confirm(e.formatMessage(h["Are you sure you want to delete remote ${0}?"],b.Name))&&c.getService("orion.page.progress").progress(c.getService("orion.git.provider").removeRemote(b.Location),"Removing remote "+b.Name).then(function(){n.changedItem(b.parent)},p)},visibleWhen:function(a){return a.Type==="Remote"}});i.addCommand(q);q=new b.Command({name:h.Pull,
tooltip:h["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var b=a.items,d=b.Location,e=b.Name;u.getDefaultSshOptions(c).then(function(a){var f=arguments.callee,g=c.getService("orion.git.provider"),j=c.getService("orion.page.message"),g=c.getService("orion.page.progress").progress(g.doPull(d,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pulling: "]+e);j.createProgressMonitor(g,
h["Pulling: "]+e);var i;g.then(function(d){u.handleProgressServiceResponse(d,a,c,function(){b.Type==="Clone"&&n.changedItem(b)},f,"Pull Git Repository")},function(d){if(i)d.failedOperation=i;u.handleProgressServiceResponse(d,a,c,function(){n.changedItem(b)},f,h["Pull Git Repository"])},function(a){i=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});i.addCommand(q);q=new b.Command({name:h["Git Log"],tooltip:h["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){a=
a.items;return k.toUrl("git/git-log.html")+"#"+a.CommitLocation+"?page=1"},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});i.addCommand(q);q=new b.Command({name:h["Git Log"],tooltip:h["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.CommitLocation+"?page=1"},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?
!1:!0}});i.addCommand(q);q=new b.Command({name:h["Git Status"],tooltip:h["Open the status for the repository"],id:"eclipse.openGitStatus",hrefCallback:function(a){return k.toUrl(j.statusUILocation)+"#"+a.items.StatusLocation},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});i.addCommand(q);q=new b.Command({name:h["Show in Navigator"],tooltip:h["Show the repository folder in the file navigator"],id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl("navigate/table.html")+"#"+
a.items.ContentLocation+"?depth=1"},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});i.addCommand(q);q=new b.Command({name:h["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return c.getService("orion.page.progress").progress(c.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 d.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return n.isDirectory?
!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});i.addCommand(q);q=new b.Command({name:h["Compare With Working Tree"],id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return d.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!n.isDirectory}});i.addCommand(q);q=new b.Command({name:h.Open,id:"eclipse.openGitCommit",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},
visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!n.isDirectory}});i.addCommand(q);q=new b.Command({name:h.Fetch,tooltip:h["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(b){var d=b.items,e=d.Location,g=d.Name,j=function(b,d){b.JsonData.HostKey?(d.parameters=null,d.errorData=b.JsonData,d.errorData.failedOperation=b.failedOperation,i.collectParameters(d)):d.optionsRequested?(d.errorData=b.JsonData,
d.errorData.failedOperation=b.failedOperation,i.collectParameters(d)):(new f(c)).isEnabled().then(function(c){d.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"]),
new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});d.errorData=b.JsonData;d.errorData.failedOperation=b.failedOperation;
i.collectParameters(d)})},k=function(){b.parameters&&b.parameters.optionsRequested?(b.parameters=null,b.optionsRequested=!0,i.collectParameters(b)):(b.errorData&&b.errorData.failedOperation&&c.getService("orion.page.progress").removeOperation(b.errorData.failedOperation),u.gatherSshCredentials(c,b).then(function(a){var f=c.getService("orion.git.provider"),i=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(f.doFetch(e,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),h["Fetching remote: "]+g);i.createProgressMonitor(a,h["Fetching remote: "]+g);a.then(function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem(d)},function(a){j(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem(d)},function(a){j(a,b)})})}))};if(b.items.GitUrl)k();else{var l=c.getService("orion.git.provider"),m=c.getService("orion.page.progress");m.progress(l.getGitRemote(e),"Getting remote details "+g).then(function(a){m.progress(l.getGitClone(a.CloneLocation),
"Getting git repository information "+a.Name).then(function(a){b.items.GitUrl=a.Children[0].GitUrl;k()},p)},p)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});i.addCommand(q);q=new b.Command({name:h["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:h["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",
callback:function(b){if(confirm(h["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+h["Are you sure?"])){var d=b.items,e=d.Location,g=d.Name,j=function(b,d){b.JsonData.HostKey?(d.parameters=null,d.errorData=b.JsonData,d.errorData.failedOperation=b.failedOperation,i.collectParameters(d)):d.optionsRequested?(d.errorData=b.JsonData,i.collectParameters(d)):(new f(c)).isEnabled().then(function(c){d.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword",
"password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"])],
{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});d.errorData=b.JsonData;d.errorData.failedOperation=b.failedOperation;i.collectParameters(d)})},k=function(){b.parameters&&b.parameters.optionsRequested?(b.parameters=null,b.optionsRequested=!0,i.collectParameters(b)):(b.errorData&&b.errorData.failedOperation&&c.getService("orion.page.progress").removeOperation(b.errorData.failedOperation),
u.gatherSshCredentials(c,b).then(function(a){var f=c.getService("orion.git.provider"),i=c.getService("orion.page.progress"),k=c.getService("orion.page.message"),a=i.progress(f.doFetch(e,!0,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Fetching remote: "]+g);k.createProgressMonitor(a,h["Fetching remote: "]+g);a.then(function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem(d)},function(a){j(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem(d)},
function(a){j(a,b)})})}))};if(b.items.GitUrl)k();else{var l=c.getService("orion.git.provider");l.getGitRemote(e).then(function(a){l.getGitClone(a.CloneLocation).then(function(a){b.items.GitUrl=a.Children[0].GitUrl;k()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});i.addCommand(q);q=new b.Command({name:h.Merge,tooltip:h["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 b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),f=c.getService("orion.page.message");d.progress(a.doMerge(b.HeadLocation,b.Name,!1),"Merging "+b.Name).then(function(a){var c={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");
c.Severity="Warning";c.HTML=!0;c.Message="<span>"+a.Result;if(a.FailingPaths){var g="",i=!0,l;for(l in a.FailingPaths)i||(g+=", "),i=!1,g+=l;if(!i)c.Severity="Error",c.Message+=". "+e.formatMessage(h["Failing paths: ${0}"],g)}c.Message+=e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?
(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>";f.setProgressResult(c);n.changedItem(b)},function(a,d){var f=[],g=b.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+e.formatMessage(h[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+".</span>";c.getService("orion.page.message").setProgressResult(f);n.changedItem(b)})},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}});i.addCommand(q);q=new b.Command({name:h["Merge Squash"],tooltip:h["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 b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),f=c.getService("orion.page.message");d.progress(a.doMerge(b.HeadLocation,b.Name,!0),"Merging "+b.Name).then(function(a){var c=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");c.Severity="Warning";c.HTML=!0;c.Message=
"<span>"+a.Result+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>";f.setProgressResult(c);n.changedItem(b)},function(a,d){var f=[],g=b.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+".</span>";c.getService("orion.page.message").setProgressResult(f);n.changedItem(b)})},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}});i.addCommand(q);q=new b.Command({name:h.Rebase,tooltip:h["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 b=
a.items,a=c.getService("orion.page.message"),d=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRebase(b.HeadLocation,b.Name,"BEGIN"),b.Name?h["Rebase on top of "]+b.Name:h.Rebase);a.createProgressMonitor(d,b.Name?h["Rebase on top of "]+b.Name:h.Rebase);d.then(function(a){var d=[],f=b.HeadLocation.replace("commit/HEAD","status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):a.Result==="STOPPED"?(d.Severity=
"Warning",d.HTML=!0,d.Message="<span>"+a.Result+h[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+h[". Repository state is invalid (i.e. already during rebasing)"]+e.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(j.statusUILocation)+
"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+h[". Repository contains unmerged paths"]+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+h[". Repository contains pending changes. Please commit or stash them"]+e.formatMessage(h[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>");c.getService("orion.page.message").setProgressResult(d);n.changedItem(b)},p)},visibleWhen:function(a){this.tooltip=h["Rebase your commits by removing them from the active branch, "]+h["starting the active branch again based on the latest state of '"]+
a.Name+"' "+h["and applying each commit again to the updated active branch."];return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});i.addCommand(q);q=new b.Command({name:h["Push All"],tooltip:h["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(b){var d=b.targetBranch,e,j=b.items;if(j.toRef)j=j.toRef;j.CloneLocation.split("/");var k=function(b,d){b.JsonData.HostKey?
(d.parameters=null,d.errorData=b.JsonData,d.errorData.failedOperation=b.failedOperation,i.collectParameters(d)):d.optionsRequested?(d.errorData=b.JsonData,d.errorData.failedOperation=b.failedOperation,i.collectParameters(d)):(new f(c)).isEnabled().then(function(c){d.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):
new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword",
"password",h["SSH Password:"])],{hasOptionalParameters:!0});d.errorData=b.JsonData;d.errorData.failedOperation=b.failedOperation;i.collectParameters(d)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,i.collectParameters(b);else{var m=c.getService("orion.git.provider"),q=c.getService("orion.page.progress");b.errorData&&b.errorData.failedOperation&&q.removeOperation(b.errorData.failedOperation);var p=function(a,d,e,f,g){var j=c.getService("orion.page.message"),
a=q.progress(m.doPush(d,e,!0,g,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(a,h["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem()},function(a){k(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem()},function(a){k(a,b)})})};q.progress(m.getGitClone(j.CloneLocation),"Getting git repository details "+j.Name).then(function(a){var f=a.Children[0].RemoteLocation,
i=a.Children[0].ConfigLocation,k=function(a){u.handleProgressServiceResponse(a,{},c)};u.gatherSshCredentials(c,b).then(function(a){var n=new g;if(j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1)n=q.progress(m.getGitRemote(f),"Getting git remote details "+j.Name);else{var r={};r.Children=j.RemoteLocation;n.resolve(r)}n.then(function(f){d?p(a,d.Location,"HEAD",d.Name,!1):(f=new o.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:c,gitClient:m,treeRoot:{Children:f.Children},
hideNewBranch:!1,func:function(c,d,f){e=c===null?f:c;var g="branch."+j.Name+".remote";q.progress(m.addCloneConfigurationProperty(i,g,e.parent.Name),"Adding git configuration property "+j.Name).then(function(){b.targetBranch=e;p(a,e.Location,"HEAD",e.Name,!1)},function(c){c.status===409?m.getGitCloneConfig(i).then(function(c){if(c.Children)for(var d=0;d<c.Children.length;d++)if(c.Children[d].Key===g){q.progress(m.editCloneConfigurationProperty(c.Children[d].Location,e.parent.Name),"Updating configuration property "+
e.parent.Name).then(function(){b.targetBranch=e;p(a,e.Location,"HEAD",e.Name,!1)},k);break}},k):k(c)})}}),j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1&&(f=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:c,gitClient:m,dialog:f,location:j.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=j.RemoteLocation[0].Children[0];p(a,j.RemoteLocation[0].Children[0].Location,"HEAD",j.Name,!1)}})),f.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}});i.addCommand(q);q=new b.Command({name:h["Force Push All"],tooltip:h["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(b){var d=b.confirmedWarnings,e=b.targetBranch;if(!d)if(confirm(h["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+h["Are you sure?"]))d=b.confirmedWarnings=!0;else return;var j,k=b.items;if(k.toRef)k=k.toRef;var m=k.CloneLocation.split("/"),q=function(b,d){b.JsonData.HostKey?(d.parameters=null,d.errorData=b.JsonData,i.collectParameters(d)):d.optionsRequested?(d.errorData=b.JsonData,i.collectParameters(d)):(new f(c)).isEnabled().then(function(c){d.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser",
"text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});d.errorData=b.JsonData;i.collectParameters(d)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,i.collectParameters(b);else{var p=c.getService("orion.git.provider"),r=c.getService("orion.page.progress"),s=function(a,d,e,f,g){var j=c.getService("orion.page.message"),a=r.progress(p.doPush(d,e,!0,g,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(a,h["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem()},function(a){q(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){n.changedItem(k)},function(a){q(a,b)})})};r.progress(p.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(a){var d=a.Children[0].RemoteLocation,f=a.Children[0].ConfigLocation;u.gatherSshCredentials(c,b).then(function(a){var i=
new g;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)i=r.progress(p.getGitRemote(d),"Getting remote details "+k.Name);else{var n={};n.Children=k.RemoteLocation;i.resolve(n)}i.then(function(d){e?s(a,e.Location,"HEAD",e.Name,!0):(d=new o.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:c,gitClient:p,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(c,d,e){j=c===null?e:c;var g="/gitapi/config/branch."+k.Name+".remote/clone/file/"+m[4];r.progress(p.addCloneConfigurationProperty(f,
"branch."+k.Name+".remote",j.parent.Name),"Setting git configuration property "+k.Name).then(function(){b.targetBranch=j;s(a,j.Location,"HEAD",j.Name,!0)},function(c){c.status===409&&r.progres(p.editCloneConfigurationProperty(g,j.parent.Name),"Setting git configuration property "+j.parent.Name).then(function(){b.targetBranch=j;s(a,j.Location,"HEAD",j.Name,!0)})})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:c,
gitClient:p,dialog:d,location:k.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=k.RemoteLocation[0].Children[0];s(a,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Location,!0)}})),d.startup(),d.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});i.addCommand(q);q=new b.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",
hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});i.addCommand(q);q=new b.Command({name:h["Next Page >"],tooltip:h["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type===
"RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==void 0:!1}});i.addCommand(q);q=new b.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});i.addCommand(q);q=new b.Command({name:h["Next Page >"],tooltip:h["Show next page of git tags"],
id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});i.addCommand(q);q=new b.Command({name:h.Reset,tooltip:h["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 b=a.items;if(confirm(h["The content of your active branch will be replaced with "]+
b.Name+". "+h["All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?"])){var a=c.getService("orion.git.provider"),d=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(a.resetIndex(b.IndexLocation,b.Name),"Resetting git index for "+b.Name);d.createProgressMonitor(a,h["Resetting index..."]);a.then(function(){n.changedItem(b);d.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=
a.message;d.setProgressResult(b)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});i.addCommand(q);q=new a.ParametersDescription([new a.CommandParameter("name","text",h["Name:"])]);q=new b.Command({name:h.Tag,tooltip:h["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:q,callback:function(a){var b=a.items,d=function(a,d){c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doAddTag(a,
d),"Adding tag "+d).then(function(){n.changedItem(b)},p)},e=b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Commit"}});i.addCommand(q);q=new b.Command({name:h.Delete,tooltip:h["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var b=a.items;confirm(e.formatMessage(h["Are you sure you want to delete tag ${0}?"],b.Name))&&c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRemoveTag(b.Location),
"Removing tag "+b.Name).then(function(){n.changedItem(b.parent)},p)},visibleWhen:function(a){return a.Type==="Tag"}});i.addCommand(q);q=new a.ParametersDescription([new a.CommandParameter("reviewer","text",h["Reviewer name"])],{hasOptionalParameters:!0});q=new b.Command({name:h["Ask for review"],tooltip:h["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:q,callback:function(a){var b=c.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 f=a.items,g=f.Location.replace(f.Name,"HEAD"),h=f.AuthorName,j=f.Name,i=f.Message;b.progress(c.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(a){window.location.href.split("#");var k=v.getOrionHome(),a=d(a.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+a+"_"+f.Name;b.progress(c.getService("orion.git.provider").sendCommitReviewRequest(j,
g,e,k,h,i),"Sending review request for "+j).then(function(a){var b={Severity:"Ok",HTML:!1};b.Message=a.Result;c.getService("orion.page.message").setProgressResult(b)},p)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)e(a.parameters.valueFor("reviewer"));else{var f=a.items;b.progress(c.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting git details "+f.Name).then(function(a){window.location.href.split("#");var b=v.getOrionHome(),a=d(a.Children[0].GitUrl);
(new m.ReviewRequestDialog({title:h["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+f.Name,func:e})).show()},p)}},visibleWhen:function(a){return a.Type==="Commit"}});i.addCommand(q);q=new b.Command({name:h["Cherry-Pick"],tooltip:h["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 b=a.items,a=c.getService("orion.page.progress"),d=c.getService("orion.git.provider"),
f=b.Location.replace(b.Name,"HEAD");a.progress(d.doCherryPick(f,b.Name),"Cherry picking "+b.Name).then(function(a){var d=[],f=b.Location.replace("commit/"+b.Name,"status");if(a.Result==="OK")d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="<span>"+h["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+h[". Some conflicts occurred"]+ +e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){d.Severity="Error";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var g="",i=!0,l;for(l in a.FailingPaths)i||(g+=", "),i=!1,g+=l;i||(d.Message+=". "+e.formatMessage(h["Failing paths: ${0}"],g))}d.Message+=e.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;c.getService("orion.page.message").setProgressResult(d)},
p)},visibleWhen:function(a){return a.Type==="Commit"}});i.addCommand(q)};u.createGitClonesCommands=function(c,d,j,l,m,n){function q(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function o(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new a.ParametersDescription([new a.CommandParameter("key",
"text",h["Key:"]),new a.CommandParameter("value","text",h["Value:"])]);l=new b.Command({name:h["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(d.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),
"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){j.changedItem(b)},q)}});d.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("value","text",h["Value:"])]);l=new b.Command({name:h.Edit,tooltip:h["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("value")&&
e.progress(d.editCloneConfigurationProperty(b.Location,a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){j.changedItem(b)},q)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(l);l=new b.Command({name:h.Delete,tooltip:h["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");
confirm(e.formatMessage(h["Are you sure you want to delete ${0}?"],b.Key))&&d.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){j.changedItem(b)},q)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("url","url",h["Repository URL:"])],{hasOptionalParameters:!0});m=new b.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],
id:"eclipse.createGitProject",callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress"),f=function(a,f,g){u.getDefaultSshOptions(c).then(function(l){var m=arguments.callee,q=new i(c);c.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");q.getConfig().then(function(i){e.progress(d.cloneGitRepository(g,a,f,j.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,
i),"Cloning repository "+g).then(function(a){u.handleProgressServiceResponse(a,l,c,function(a){d.getGitClone(a.Location).then(function(a){var c="",d;for(d in b.projectDescription)c+=d+"="+b.projectDescription[d]+"\n";n.write(a.Children[0].ContentLocation+".git/.projectInfo",c).then(function(){var b=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new w(b)).expand({resource:"",params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})})})},m,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
l,c,function(){},m,h["Clone Git Repository"])})})})};b.url&&b.projectDescription.name&&(c.getService("orion.page.message").setProgressMessage("Looking for project "+b.projectDescription.name),n.loadWorkspace().then(function(a){for(var c=0;c<a.Children.length;++c){var e=a.Children[c];if(e.Name===b.projectDescription.name){e.Git?d.getGitClone(e.Git.CloneLocation).then(function(a){if(a.Children[0].GitUrl===b.url){var c=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new w(c)).expand({resource:"",
params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})}else console.info("Folder project is used")}):console.info("Folder project is used");return}}f(b.url,null,b.projectDescription.name)}))},visibleWhen:function(){return!0}});d.addCommand(m);l=new b.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,
e,f){u.getDefaultSshOptions(c).then(function(g){var k=arguments.callee;(new i(c)).getConfig().then(function(i){i=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,g.gitSshUsername,g.gitSshPassword,g.knownHosts,g.gitPrivateKey,g.gitPassphrase,i),"Cloning repository "+f);c.getService("orion.page.message").createProgressMonitor(i,h["Cloning repository: "]+a);i.then(function(a){u.handleProgressServiceResponse(a,g,c,function(){j.changedItem&&j.changedItem()},k,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
g,c,function(){},k,h["Clone Git Repository"])})})})};a.parameters.valueFor("url")&&!a.parameters.optionsRequested?e(a.parameters.valueFor("url")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:n,url:a.parameters.valueFor("url"),alwaysShowAdvanced:a.parameters.optionsRequested,func:e})).show()},visibleWhen:function(){return!0}});d.addCommand(l);l=new b.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",
callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");(new s.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:n,url:a.userData,alwaysShowAdvanced:!1,func:function(a,e,f){u.getDefaultSshOptions(c).then(function(g){var k=arguments.callee;(new i(c)).getConfig().then(function(i){i=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,g.gitSshUsername,g.gitSshPassword,g.knownHosts,g.gitPrivateKey,g.gitPassphrase,i),"Cloning git repository "+f);c.getService("orion.page.message").createProgressMonitor(i,
h["Cloning repository: "]+a);i.then(function(a){u.handleProgressServiceResponse(a,g,c,function(){j.changedItem&&j.changedItem()},k,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,g,c,function(){},k,h["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});d.addCommand(l);l=new b.Command({name:h["Add Remote"],tooltip:h["Add a new remote to the repository"],id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",
callback:function(b){if(b.parameters&&b.parameters.valueFor("remoteName"))b.remoteName=b.parameters.valueFor("remoteName");var e=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,d.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,d.collectParameters(e)):(new f(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser",
"text",h["SSH User Name:"]),new a.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;d.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,d.collectParameters(b);else{var g=function(a,d,f){var g=c.getService("orion.page.progress");g.progress(c.getService("orion.git.provider").addRemote(a,d,b.userData),"Adding git remote "+d).then(function(){u.gatherSshCredentials(c,b).then(function(a){c.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(i){for(var k,
l=0;l<i.Children.length;l++)i.Children[l].Name===d&&(k=i.Children[l]);var m=c.getService("orion.git.provider"),i=c.getService("orion.page.message"),l=g.progress(m.doFetch(k.Location,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),"Fetching remote "+d);i.createProgressMonitor(l,h["Fetching remote: "]+k.Location);l.then(function(a){u.handleGitServiceResponse(a,c,function(){g.progress(m.getGitRemote(k.Location),"Getting remote details "+d).then(function(){j.changedItem(f)},
q)},function(a){e(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){j.changedItem(f)},function(a){e(a,b)})})})})},q)};b.remoteName?g(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new a.ParametersDescription([new a.CommandParameter("remoteName","text",h["Remote Name:"])],{hasOptionalParameters:!1}),d.collectParameters(b))}},visibleWhen:function(){return!0}});d.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("folderName","text",h["New folder:"])],{hasOptionalParameters:!0});
l=new b.Command({name:h["Init Repository"],tooltip:h["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,e,f){u.getDefaultSshOptions(c).then(function(g){var k=arguments.callee;(new i(c)).getConfig().then(function(i){i=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,null,null,null,null,null,i),h["Initializing repository: "]+f);c.getService("orion.page.message").createProgressMonitor(i,
h["Initializing repository: "]+f);i.then(function(a){u.handleProgressServiceResponse(a,g,c,function(){j.changedItem&&j.changedItem()},k,h["Init Git Repository"])},function(a){u.handleProgressServiceResponse(a,g,c,function(){},k,h["Init Git Repository"])})})})};a.parameters.valueFor("folderName")&&!a.parameters.optionsRequested?e(null,null,a.parameters.valueFor("folderName")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,title:h["Init Git Repository"],fileClient:n,advancedOnly:!0,func:e})).show()},
visibleWhen:function(){return!0}});d.addCommand(l);l=new b.Command({name:h.Delete,tooltip:h["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(e.formatMessage(h["Are you sure you want do delete ${0} repositories?"],b.length)))for(var f=0,g=0;g<b.length;g++)d.progress(a.removeGitRepository(b[g].Location),
"Removing repository "+b.Name).then(function(){f++;f>=b.length&&j.changedItem&&j.changedItem()},q)}else confirm(e.formatMessage(h["Are you sure you want to delete ${0}?"],b.Name))&&d.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){j.changedItem&&j.changedItem()},q)}});d.addCommand(l);l=new b.Command({name:h["Apply Patch"],tooltip:h["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",
callback:function(a){var a=o(a.items),b=new g;(new t.ApplyPatchDialog({title:h["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var d=c.getService("orion.page.message");b.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(f){}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"}});d.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("commitName","text",h["Commit name:"])],{hasOptionalParameters:!0});l=new b.Command({name:h["Open Commit"],tooltip:h["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 b=c.getService("orion.page.progress"),e=function(d,f,j){j==null&&(j=new g);d.length>0?b.progress(c.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+d[0].ContentLocation+"?page=1&pageSize=1",null,null,h["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){j.resolve(a.Children[0].Location)},function(){e(d.slice(1),
f,j)}):j.reject();return j},f=function(b){a.parameters.optionsRequested?(new p.OpenCommitDialog({repositories:b,serviceRegistry:c,commitName:a.parameters.valueFor("commitName")})).show():(c.getService("orion.page.message").setProgressMessage(h["Looking for the commit"]),e(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl("git/git-commit.html#")+a+"?page=1&pageSize=1",window.open(a));c.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";
a.HTML=!1;a.Message=h["No commits found"];c.getService("orion.page.message").setProgressResult(a)}))};if(!a.parameters.optionsRequested&&!a.parameters.valueFor("commitName"))d.runCommand("eclipse.orion.git.openCommitCommand");else if(a.items.Type==="Clone"){var j=[a.items];f(j)}else a.items.CloneLocation?b.progress(c.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(j=a.items,f(j))},visibleWhen:function(a){return a.Type===
"Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});d.addCommand(l)};u.createGitStatusCommands=function(c,d,e){function f(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function g(a){Array.isArray(a)||(a=[a]);return a}function i(a,b){var d=c.getService("orion.page.message"),
g=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRebase(a,"",b),"Rebasing git repository");d.createProgressMonitor(g,b);g.then(function(a){if(a.Result==="OK"||a.Result==="ABORTED"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"){var b=[];b.Severity="Ok";b.HTML=!1;b.Message=a.Result;c.getService("orion.page.message").setProgressResult(b);e.changedItem({})}if(a.Result==="STOPPED")b=[],b.Severity="Warning",b.HTML=!1,b.Message=a.Result+h[". Repository still contains conflicts."],
c.getService("orion.page.message").setProgressResult(b),e.changedItem({});else if(a.Result==="FAILED_UNMERGED_PATHS")b=[],b.Severity="Error",b.HTML=!1,b.Message=a.Result+h[". Repository contains unmerged paths. Resolve conflicts first."],c.getService("orion.page.message").setProgressResult(b)},f)}var k=new b.Command({name:h.Stage,tooltip:h["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(a){var b=g(a.items),d=c.getService("orion.page.message"),
j=c.getService("orion.page.progress");if(b.length===1)a=j.progress(c.getService("orion.git.provider").stage(b[0].indexURI),h["Staging changes"]),d.createProgressMonitor(a,h["Staging changes"]);else{for(var i=[],k=0;k<b.length;k++)i[k]=b[k].name;a=j.progress(c.getService("orion.git.provider").stageMultipleFiles(a.userData.Clone.IndexLocation,i),h["Staging changes"]);d.createProgressMonitor(a,"Staging changes")}a.then(function(){e.changedItem(b)},f)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;
for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||j.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:h.Unstage,tooltip:h["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){var b=g(a.items),d=c.getService("orion.page.message"),j=c.getService("orion.page.progress");if(b.length===1)a=j.progress(c.getService("orion.git.provider").unstage(b[0].indexURI,b[0].name),"Unstaging changes");else{for(var i=
[],k=0;k<b.length;k++)i[k]=b[k].name;a=j.progress(c.getService("orion.git.provider").unstage(a.userData.Clone.IndexLocation,i),"Unstaging changes")}d.createProgressMonitor(a,h["Staging changes"]);a.then(function(){e.changedItem(b)},f)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||!j.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new a.ParametersDescription([new a.CommandParameter("name","text",h["Commit message:"],"",4),new a.CommandParameter("amend",
"boolean",h["Amend:"],!1)],{hasOptionalParameters:!0});k=new b.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(a){var b=a.items.status,d=function(a){var d=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").commitAll(b.Clone.HeadLocation,null,JSON.stringify(a)),h["Committing changes"]);d.createProgressMonitor(a,h["Committing changes"]);a.then(function(){e.changedItem(b)},f)},
g={};g.Message=a.parameters.valueFor("name");g.Amend=a.parameters.valueFor("amend");for(var j=b.Clone.Config,i=0;i<j.length;i++)if(j[i].Key==="user.name")g.CommitterName=j[i].Value,g.AuthorName=j[i].Value;else if(j[i].Key==="user.email")g.CommitterEmail=j[i].Value,g.AuthorEmail=j[i].Value;g.Message&&g.CommitterName&&g.CommitterEmail&&!a.parameters.optionsRequested?d(g):(new q.CommitDialog({body:g,func:d})).show()},visibleWhen:function(){return!0}});d.addCommand(k);k=new b.Command({name:h.Reset,tooltip:h["Reset the branch, discarding all staged and unstaged changes"],
imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(a){var b=a.items;c.getService("orion.page.dialog").confirm(h["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+h["Are you sure you want to continue?"],function(a){if(a){var a=c.getService("orion.page.message"),d=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").unstageAll(b.IndexLocation,"HARD"),h["Resetting local changes"]);
a.createProgressMonitor(d,h["Resetting local changes"]);d.then(function(){e.changedItem(b)},f)}})},visibleWhen:function(a){return j.hasStagedChanges(a)||j.hasUnstagedChanges(a)}});d.addCommand(k);k=new b.Command({name:h.Checkout,tooltip:h["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(a){var b=g(a.items);c.getService("orion.page.dialog").confirm(h["Your changes to the selected files will be discarded and cannot be recovered."]+
"\n"+h["Are you sure you want to continue?"],function(d){if(d){for(var d=c.getService("orion.page.message"),g=c.getService("orion.page.progress"),j=[],i=0;i<b.length;i++)j[i]=b[i].name;g=g.progress(c.getService("orion.git.provider").checkoutPath(a.userData.Clone.Location,j),h["Resetting local changes"]);d.createProgressMonitor(g,h["Resetting local changes"]);g.then(function(){e.changedItem(b)},f)}})},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||
j.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:h["Show Patch"],tooltip:h["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(j.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:h.Continue,tooltip:h["Contibue Rebase"],
id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k);k=new b.Command({name:h["Skip Patch"],tooltip:h["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k);k=new b.Command({name:h.Abort,
tooltip:h["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k)}})();return u});
define("orion/git/widgets/CommitTooltipDialog",["i18n!git/nls/gitmessages","require","orion/webui/littlelib","orion/i18nUtil","orion/webui/popupdialog"],function(h,k,g,e,c){function b(a){this._init(a)}b.prototype=new c.PopupDialog;b.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';b.prototype._init=function(a){this.commit=a.commit;this._initialize(a.triggerNode,null,null,"mouseover",1E3)};b.prototype._bindToDom=function(){this._displayCommit(this.commit)};b.prototype._displayCommit=
function(a){var b=this.$parentPane,c=a.Message.split(/(\r?\n|$)/)[0],f=document.createElement("a");f.className="navlinkonpage";f.href=k.toUrl("git/git-commit.html#")+a.Location+"?page=1&pageSize=1";f.textContent=c;b.appendChild(f);c=document.createElement("div");c.style.paddingTop="15px";b.appendChild(c);if(a.AuthorImage)b=new Image,b.src=a.AuthorImage,b.name=a.AuthorName,b.className="git-author-icon",c.appendChild(b);b=document.createElement("div");b.textContent=e.formatMessage(h[" authored by ${0} {${1}) on ${2}"],
a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString());c.appendChild(b);b=document.createElement("div");b.textContent=e.formatMessage(h["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);c.appendChild(b);b=document.createElement("div");b.style.paddingTop="15px";b.textContent=h["commit:"]+a.Name;c.appendChild(b);if(a.Parents&&a.Parents.length>0)b=document.createElement("div"),b.textContent=h["parent:"],f=document.createElement("a"),f.className="navlinkonpage",f.href=k.toUrl("git/git-commit.html#")+
a.Parents[0].Location+"?page=1&pageSize=1",f.textContent=a.Parents[0].Name,b.appendChild(f),c.appendChild(b);f=a.Tags&&a.Tags.length>0;if(a.Branches&&a.Branches.length>0){b=document.createElement("section");b.style.paddingTop="15px";b.textContent=h["branches: "];c.appendChild(b);var g=document.createElement("div");b.appendChild(g);for(b=0;b<a.Branches.length;++b){var l=document.createElement("span");l.style.paddingLeft="10px";l.textContent=a.Branches[b].FullName;g.appendChild(l)}}if(f){b=document.createElement("div");
b.style.paddingTop="15px";c.appendChild(b);b=document.createElement("section");c.appendChild(b);c=document.createElement("span");c.textContent=h["tags: "];b.appendChild(c);c=document.createElement("div");b.appendChild(c);for(b=0;b<a.Tags.length;++b)f=document.createElement("span"),f.style.paddingLeft="10px",f.textContent=a.Tags[b].Name,c.appendChild(f)}};b.prototype.constructor=b;return{CommitTooltipDialog:b}});
define("orion/git/gitStatusExplorer","require,i18n!git/nls/gitmessages,orion/explorers/explorer,orion/selection,orion/section,orion/PageUtil,orion/webui/littlelib,orion/i18nUtil,orion/globalCommands,orion/git/util,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog,orion/webui/tooltip".split(","),function(h,k,g,e,c,b,a,j,d,f,i,l,o,m){var l={},s=function(){function a(){this.selectedItem=this.selectedFileId=void 0;this.interestedUnstagedGroup=["Missing","Modified","Untracked",
"Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=[["Both","Modified","Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting";this.statusTypeMap={Missing:{imageClass:"gitImageSprite git-sprite-removal",tooltip:k["Unstaged removal"]},Removed:{imageClass:"gitImageSprite git-sprite-removal",tooltip:k["Staged removal"]},Modified:{imageClass:"gitImageSprite git-sprite-file",
tooltip:k["Unstaged change"]},Changed:{imageClass:"gitImageSprite git-sprite-file",tooltip:k["Staged change"]},Untracked:{imageClass:"gitImageSprite git-sprite-addition",tooltip:k["Unstaged addition"]},Added:{imageClass:"gitImageSprite git-sprite-addition",tooltip:k["Staged addition"]},Conflicting:{imageClass:"gitImageSprite git-sprite-conflict-file",tooltip:k.Conflicting}}}a.prototype={destroy:function(){},interestedCategory:function(){},init:function(a){this.items=a},getModelType:function(a,b){return b},
_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var c=0;c<b.length;c++)if(!b[c].Conflicting){for(var d=b[c].Location,e=[],f=2;f<a.length;f++){var g=this.getGroupData(a[f]);g&&(g=this._findSameFile(d,g))&&e.push(g)}if(e.length===a.length-2){b[c].Conflicting=a[0];for(d=0;d<e.length;d++)e[d].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var c=0;c<b.length;c++)if(!b[c].Conflicting&&a===b[c].Location)return b[c]},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=
0;b<this.interestedStagedGroup.length;b++)if(a===this.interestedStagedGroup[b])return!0;return!1},getClass:function(a){return this.statusTypeMap[a].imageClass},getTooltip:function(a){return this.statusTypeMap[a].tooltip}};return a}();l.GitStatusExplorer=function(){function l(a,b,c,d,e,f,h,i){this.parentId=e;this.registry=a;this.commandService=b;this.linkService=c;this.selection=d;this.parentId=e;this.toolbarId=f;this.selectionToolsId=h;this.checkbox=!1;this.actionScopeId=i;g.createExplorerCommands(b)}
l.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.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayCommit())};l.prototype.changedItem=function(){this.redisplay()};l.prototype.redisplay=function(){this.display(b.matchResourceParameters().resource)};l.prototype.display=function(b){var c=this,d=
this.registry.getService("orion.page.progress");d.progress(this.registry.getService("orion.git.provider").getGitStatus(b),k["Loading..."]).then(function(b){if(b.Type==="Status")c._model=new s,c._model.init(b),d.progress(c.registry.getService("orion.git.provider").getGitClone(b.CloneLocation),"Getting repository information").then(function(e){var f=e.Children;d.progress(c.registry.getService("orion.git.provider").getGitCloneConfig(f[0].ConfigLocation),"Getting repository configuration ",f[0].Name).then(function(d){d=
d.Children;b.Clone=f[0];b.Clone.Config=[];for(var e=0;e<d.length;e++)(d[e].Key==="user.name"||d[e].Key==="user.email")&&b.Clone.Config.push(d[e]);d=a.node("table");a.empty(d);c.initTitleBar(b,f[0]);c.displayUnstaged(b,f[0]);c.displayStaged(b,f[0]);c.displayCommits(f[0]);i.updateNavTools(c.registry,c.commandService,c,"pageActions","selectionTools",b)},function(a){c.handleError(a)})},function(a){c.handleError(a)})},function(a){c.handleError(a)})};l.prototype.initTitleBar=function(a,b){var c={};c.Name=
k.Status+(a.RepositoryState&&a.RepositoryState.indexOf("REBASING")!==-1?k[" (Rebase in Progress)"]:"");c.Parents=[];c.Parents[0]={};c.Parents[0].Name=b.Name;c.Parents[0].Location=b.Location;c.Parents[0].ChildrenLocation=b.Location;c.Parents[1]={};c.Parents[1].Name="Repositories";d.setPageTarget({task:k.Status,target:b,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href=h.toUrl("git/git-repository.html")+(b?"#"+b:"")},serviceRegistry:this.registry,commandService:this.commandService})};l.prototype._sortBlock=
function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=this._model.getGroupData(d);if(e)for(var f=0;f<e.length;f++){var g=this._model.getModelType(e[f],d);g&&b.push({name:e[f].Name,type:g,location:e[f].Location,path:e[f].Path,commitURI:e[f].Git.CommitLocation,indexURI:e[f].Git.IndexLocation,diffURI:e[f].Git.DiffLocation,CloneLocation:this._model.items.CloneLocation,conflicting:g==="Conflicting"})}}b.sort(function(a,b){var c=a.name&&a.name.toLowerCase(),d=b.name&&b.name.toLowerCase();return c<d?
-1:c>d?1:0});return b};l.prototype.displayUnstaged=function(b,d){var h=this,i=this._sortBlock(this._model.interestedUnstagedGroup),j=a.node("table"),l=new c.Section(j,{id:"unstagedSection",title:i.length>0?k.Unstaged:k["No Unstaged Changes"],content:'<div id="unstagedNode"></div>',canHide:!0,onExpandCollapse:function(a,b){h.commandService.destroy(b.selectionNode);a&&h.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,h,"button",{Clone:d})}});this.commandService.registerCommandContribution(l.actionsNode.id,
"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.showPatchCommand",100);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.stageCommand",200);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.checkoutCommand",300);if(!this.unstagedOnce){if(!this.unstagedSelection)this.unstagedSelection=
new e.Selection(this.registry,"orion.unstagedSection.selection"),this.commandService.registerSelectionService(l.selectionNode.id,this.unstagedSelection);this.registry.getService("orion.unstagedSection.selection").addEventListener("selectionChanged",function(b){var c=a.node(l.selectionNode.id);c&&(h.commandService.destroy(c),h.commandService.renderCommands(l.selectionNode.id,c,b.selections,h,"button",{Clone:d}))});this.unstagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper",
"eclipse.orion.git.stageCommand",100);var o=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(i)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(f.isChange(a)){if(!a.children)a.children=[],a.children.push({diffUri:a.diffURI,Type:"Diff",parent:a});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"unstagedRoot":f.isChange(a)?"unstaged"+a.name:"unstaged"+a.diffUri}};return a}(),r=function(){function a(b,c){this._init(b);
this.options=b;this.explorer=c;this.registry=b.registry}a.prototype=new g.SelectionRenderer;a.prototype.getCellElement=function(a,b,c){switch(a){case 0:if(f.isChange(b)){var a=document.createElement("td"),d=document.createElement("div");d.className="sectionTableItem";a.appendChild(d);this.getExpandImage(c,d);var c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null,e=document.createElement("span");e.id="unstaged"+b.name+"DiffActionWrapper";e.className="sectionExplorerActions";
d.appendChild(e);h.commandService.destroy(e);h.commandService.renderCommands("DefaultActionWrapper",e,b,h,"tool",null,c);c=document.createElement("span");c.className=h._model.getClass(b.type);c.commandTooltip=new m.Tooltip({node:c,text:h._model.getTooltip(b.type),position:["above","below","right","left"]});d.appendChild(c);c=document.createElement("span");c.textContent=b.name;d.appendChild(c)}else{a=document.createElement("td");a.colSpan=2;d=document.createElement("div");d.className="sectionTableItem";
a.appendChild(d);e=document.createElement("div");e.className="sectionExplorerActions";e.id="unstaged"+b.parent.name+"CompareWidgetActionWrapper";d.appendChild(e);var g=document.createElement("div");g.id="diffArea_"+b.diffUri;g.style.height="420px";g.style.border="1px solid lightgray";g.style.overflow="hidden";d.appendChild(g);c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null;f.createCompareWidget(h.registry,h.commandService,b.diffUri,b.parent.type==="Conflicting",
g,e.id,!0,{navGridHolder:c})}return a}};return a}(),j=new (function(){function a(b,c,d,e){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.renderer=new r({registry:this.registry,cachePrefix:"UnstagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new o,{setFocus:!0})}a.prototype=new g.Explorer;a.prototype.isRowSelectable=function(a){return f.isChange(a)};a.prototype.getItemCount=function(){return i.length};return a}())(this.registry,this.unstagedSelection,
"unstagedNode");this.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,j,j,"button")};l.prototype.displayStaged=function(b,d){var h=this,i=this._sortBlock(this._model.interestedStagedGroup),j=a.node("table"),l=new c.Section(j,{id:"stagedSection",title:i.length>0?k.Staged:k["No Staged Changes"],content:'<div id="stagedNode"></div>',slideout:!0,canHide:!0,onExpandCollapse:function(a,b){h.commandService.destroy(b.selectionNode);a&&h.commandService.renderCommands(b.selectionNode.id,b.selectionNode,
null,h,"button",{Clone:d})}});this.commandService.registerCommandContribution(l.actionsNode.id,"eclipse.orion.git.commitCommand",100);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.unstageCommand",100);if(!this.stagedOnce){if(!this.stagedSelection)this.stagedSelection=
new e.Selection(this.registry,"orion.stagedSection.selection"),this.commandService.registerSelectionService(l.selectionNode.id,this.stagedSelection);this.registry.getService("orion.stagedSection.selection").addEventListener("selectionChanged",function(b){var c=a.node(l.selectionNode.id);c&&(h.commandService.destroy(c),h.commandService.renderCommands(l.selectionNode.id,c,b.selections,h,"button",{Clone:d}))});this.stagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper",
"eclipse.orion.git.unstageCommand",100);var o=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(i)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(f.isChange(a)){if(!a.children)a.children=[],a.children.push({diffUri:a.diffURI,Type:"Diff",parent:a});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"stagedRoot":f.isChange(a)?"staged"+a.name:"staged"+a.diffUri}};return a}(),r=function(){function a(b,c){this._init(b);
this.options=b;this.explorer=c;this.registry=b.registry}a.prototype=new g.SelectionRenderer;a.prototype.getCellElement=function(a,b,c){switch(a){case 0:if(f.isChange(b)){var a=document.createElement("td"),d=document.createElement("div");d.className="sectionTableItem";a.appendChild(d);this.getExpandImage(c,d);var c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null,e=document.createElement("span");e.id="staged"+b.name+"DiffActionWrapper";e.className="sectionExplorerActions";
d.appendChild(e);h.commandService.destroy(e);h.commandService.renderCommands("DefaultActionWrapper",e,b,h,"tool",null,c);c=document.createElement("span");c.className=h._model.getClass(b.type);c.commandTooltip=new m.Tooltip({node:c,text:h._model.getTooltip(b.type),position:["above","below","right","left"]});d.appendChild(c);c=document.createElement("span");c.textContent=b.name;d.appendChild(c)}else{a=document.createElement("td");a.colSpan=2;d=document.createElement("div");d.className="sectionTableItem";
a.appendChild(d);e=document.createElement("div");e.className="sectionExplorerActions";e.id="staged"+b.parent.name+"CompareWidgetActionWrapper";d.appendChild(e);var g=document.createElement("div");g.id="diffArea_"+b.diffUri;g.style.height="420px";g.style.border="1px solid lightgray";g.style.overflow="hidden";d.appendChild(g);c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null;f.createCompareWidget(h.registry,h.commandService,b.diffUri,b.parent.type==="Conflicting",g,
e.id,!1,{navGridHolder:c})}return a}};return a}(),j=new (function(){function a(c,d,e,f){this.registry=c;this.checkbox=!1;this.parentId=e;this.status=b;this.selection=d;this.actionScopeId=f;this.renderer=new r({registry:this.registry,cachePrefix:"StagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new o)}a.prototype=new g.Explorer;a.prototype.isRowSelectable=function(a){return f.isChange(a)};a.prototype.getItemCount=function(){return i.length};return a}())(this.registry,this.stagedSelection,
"stagedNode");this.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,j,j,"button")};l.prototype.displayCommits=function(b){var d=this,e=a.node("table"),f=new c.Section(e,{id:"commitSection",title:k.Commits,content:'<div id="commitNode" class="mainPadding"></div>',slideout:!0,canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),g=f.createProgressMonitor();g.begin(k["Getting current branch"]);this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(b.BranchLocation),
"Getting current branch "+b.Name).then(function(a){for(var a=a.Children,b,c=0;c<a.length;c++)if(a[c].Current){b=a[c];break}b?(a=b.RemoteLocation.length===1&&b.RemoteLocation[0].Children.length===1,f.setTitle(j.formatMessage(k['Commits for "${0}" branch'],b.Name)),d.commandService.destroy(f.actionsNode.id),d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),d.commandService.renderCommands(f.actionsNode.id,f.actionsNode.id,{ViewAllLink:"git/git-log.html#"+
b.CommitLocation+"?page=1",ViewAllLabel:k["See Full Log"],ViewAllTooltip:k["See the full log"]},d,"button"),a&&(d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.fetch",100),d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.merge",100),d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.rebase",100),d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.resetIndex",100),d.commandService.renderCommands(f.actionsNode.id,
f.actionsNode.id,b.RemoteLocation[0].Children[0],d,"button")),d.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.push",100),d.commandService.renderCommands(f.actionsNode.id,f.actionsNode.id,b,d,"button"),b.RemoteLocation[0]===null?(g.done(),d.renderNoCommit()):(g.worked(j.formatMessage(k['Getting commits for "${0}" branch'],b.Name)),a&&b.RemoteLocation[0].Children[0].CommitLocation?d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getLog(b.RemoteLocation[0].Children[0].CommitLocation+
"?page=1&pageSize=20","HEAD"),j.formatMessage(k['Getting commits for "${0}" branch'],b.Name)).then(function(a){g.worked(k["Rendering commits"]);for(var c=a.Children.length,e=0;e<a.Children.length;e++)d.renderCommit(a.Children[e],!0,e);g.worked(k["Getting outgoing commits"]);d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getLog(b.CommitLocation+"?page=1&pageSize=20",b.RemoteLocation[0].Children[0].Id),k["Getting outgoing commits"]).then(function(a){g.worked(k["Rendering commits"]);
for(var b=0;b<a.Children.length;b++)d.renderCommit(a.Children[b],!1,b+c);c+=a.Children.length;c===0&&d.renderNoCommit();g.done()},function(a){g.done(a)})},function(a){g.done(a)}):d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").doGitLog(b.CommitLocation+"?page=1&pageSize=20"),j.formatMessage(k['Getting commits for "${0}" branch'],b.Name)).then(function(a){g.worked(k["Rendering commits"]);for(var b=0;b<a.Children.length;b++)d.renderCommit(a.Children[b],
!0,b);a.Children.length===0&&d.renderNoCommit();g.done()},function(a){g.done(a)}))):g.done()})};l.prototype.renderNoCommit=function(){var b=a.node("commitNode");b.innerHTML="";var c=document.createElement("div");c.className="sectionTableItem";b.appendChild(c);b=document.createElement("div");b.className="stretch";c.appendChild(b);c=document.createElement("div");c.appendChild(document.createTextNode(k["The branch is up to date."]));b.appendChild(c);c=document.createElement("div");c.appendChild(document.createTextNode(k["You have no outgoing or incoming commits."]));
b.appendChild(c)};l.prototype.renderCommit=function(b,c){var d=a.node("commitNode"),e=document.createElement("div");e.className="sectionTableItem lightTreeTableRow";d.appendChild(e);d=document.createElement("div");d.className="sectionTableItem";d.style.overflow="hidden";e.appendChild(d);var e=c?"git-sprite-outgoing_commit":"git-sprite-incoming_commit",f=document.createElement("span");f.className="sectionIcon gitImageSprite "+e;d.appendChild(f);if(b.AuthorImage)e=document.createElement("div"),e.style["float"]=
"left",f=new Image,f.src=b.AuthorImage,f.name=b.AuthorName,f.className="git-author-icon",e.appendChild(f),d.appendChild(e);e=document.createElement("div");e.className="stretch";d.appendChild(e);d=document.createElement("a");d.className="navlinkonpage";d.href=h.toUrl("git/git-commit.html#")+b.Location+"?page=1&pageSize=1";d.textContent=b.Message;e.appendChild(d);new o.CommitTooltipDialog({commit:b,triggerNode:d});d=document.createElement("div");d.textContent=" (SHA "+b.Name+") by "+b.AuthorName+" on "+
(new Date(b.Time)).toLocaleString();e.appendChild(d)};return l}();return l});
define("orion/operation",["orion/xhr","orion/Deferred"],function(h,k){function g(c,b,a,e){h("GET",c,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){d=d.response?JSON.parse(d.response):null;b.progress(d);!d.type||d.type==="loadstart"||d.type==="progress"?setTimeout(function(){g(c,b,a,e)},2E3):(d.type==="error"||d.type==="abort"?b.reject(e?e(d):d.Result):b.resolve(a?a(d):d.Result.JsonData),d.Location||h("DELETE",c,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var c=a;if(a.responseText!==
void 0){c=a.responseText;try{c=JSON.parse(a.responseText)}catch(e){}}c.Message!==void 0?(c.HttpCode=c.HttpCode===void 0?a.status:c.HttpCode,c.Severity=c.Severity===void 0?"Error":c.Severity,b.reject(c)):b.reject({Severity:"Error",Message:c,HttpCode:a.status})})}function e(c,b){b.then(null,function(a){a instanceof Error&&a.name==="Cancel"&&h("PUT",c,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(c,b,a){var h=new k;e(c,h);g(c,h,b,a);return h}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(h,k,g,e){var c=c||{};c.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,c,e,i,l,o,m,s,r){var p=this,q={};if(a)q.Name=a;if(c)q.Path=c;if(b)q.GitUrl=b;q.Location=e;if(i)q.GitSshUsername=i;if(l)q.GitSshPassword=
l;if(o)q.GitSshKnownHost=o;if(m)q.GitSshPrivateKey=m;if(s)q.GitSshPassphrase=s;if(r){if(r.GitMail)q.GitMail=r.GitMail;if(r.GitName)q.GitName=r.GitName}var a=h.toUrl("gitapi/clone/._"),a=a.substring(0,a.length-2),t=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(q)}).then(function(a){p._getGitServiceResponse(t,a)},function(a){p._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(a){var b=this,c=
new g;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitStatus:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},stage:function(a){var b=
this,c=new g;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},stageMultipleFiles:function(a,b){var c=this,e=new g;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,
a)});return e},unstageAll:function(a,b){var c=this,e=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:b})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},unstage:function(a,b){var c=this,e=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){c._getGitServiceResponse(e,
a)},function(a){c._handleGitServiceResponseError(e,a)});return e},checkoutPath:function(a,b){var c=this,e=new g;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){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},commitAll:function(a,b,c){var e=this,h=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:c}).then(function(a){e._getGitServiceResponse(h,a)},function(a){e._handleGitServiceResponseError(h,a)});return h},getGitClone:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitCloneConfig:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitBranch:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitRemote:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},checkoutBranch:function(a,b){var c=this,e=new g;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:b})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},resetIndex:function(a,b){var c=this,e=new g;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){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},addBranch:function(a,b,c){var e=this,h={};if(b)h.Name=b;if(c)h.Branch=c;var l=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(h)}).then(function(a){e._getGitServiceResponse(l,a)},function(a){e._handleGitServiceResponseError(l,
a)});return l},removeBranch:function(a){var b=this,c=new g;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},addRemote:function(a,b,c){var e=this,h=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:b,RemoteURI:c})}).then(function(a){e._getGitServiceResponse(h,
a)},function(a){e._handleGitServiceResponseError(h,a)});return h},removeRemote:function(a){var b=this,c=new g;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},doGitLog:function(a){var b=this,c=new g;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,
a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getDiff:function(a,b){var c=this,e=new g;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._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},doFetch:function(a,b,c,e,h,l,o){var m=this,s=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:b,GitSshUsername:c,GitSshPassword:e,GitSshKnownHost:h,GitSshPrivateKey:l,GitSshPassphrase:o})}).then(function(a){m._getGitServiceResponse(s,a)},function(a){m._handleGitServiceResponseError(s,a)});return s},doPull:function(a,b,c,e,h,l,o){var m=this,s=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:b,GitSshUsername:c,GitSshPassword:e,GitSshKnownHost:h,GitSshPrivateKey:l,
GitSshPassphrase:o})}).then(function(a){m._getGitServiceResponse(s,a)},function(a){m._handleGitServiceResponseError(s,a)});return s},doMerge:function(a,b,c){var e=this,h=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:b,Squash:c})}).then(function(a){e._getGitServiceResponse(h,a)},function(a){e._handleGitServiceResponseError(h,a)});return h},doCherryPick:function(a,b){var c=this,e=new g;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){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},doRebase:function(a,b,c){var e=this,h={};h.Rebase=b;if(c)h.Operation=c;var l=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(h)}).then(function(a){e._getGitServiceResponse(l,a)},function(a){e._handleGitServiceResponseError(l,
a)});return l},doPush:function(a,b,c,e,h,l,o,m,s){var r=this,p=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:b,PushTags:c,Force:e,GitSshUsername:h,GitSshPassword:l,GitSshKnownHost:o,GitSshPrivateKey:m,GitSshPassphrase:s})}).then(function(a){r._getGitServiceResponse(p,a)},function(a){r._handleGitServiceResponseError(p,a)});return p},getLog:function(a,b){var c=this,e=new g,h=new g;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){h.resolve(a.xhr.getResponseHeader("Location"))},function(a){c._handleGitServiceResponseError(e,a)});h.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)})});return e},getDefaultRemoteBranch:function(a){var b=this,c=new g,e=new g;
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(c,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(c,a)},function(a){b._handleGitServiceResponseError(c,a)})});return c},doAddTag:function(a,b){var c=this,e=new g;k("PUT",
a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:b})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},doRemoveTag:function(a){var b=this,c=new g;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},checkoutTag:function(a,
b,c){var e=this,h=new g;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:b,Branch:c})}).then(function(a){e._getGitServiceResponse(h,a)},function(a){e._handleGitServiceResponseError(h,a)});return h},addCloneConfigurationProperty:function(a,b,c){var e=this,h=new g;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:b,Value:c})}).then(function(a){e._getGitServiceResponse(h,
a)},function(a){e._handleGitServiceResponseError(h,a)});return h},editCloneConfigurationProperty:function(a,b){var c=this,e=new g;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:b})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},deleteCloneConfigurationProperty:function(a){var b=this,c=new g;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},sendCommitReviewRequest:function(a,b,c,e,h,l){var o=this,m=new g;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:a,ReviewReqUrl:e,ReviewReqNotifyLogin:c,ReviewReqAuthorName:h,ReviewMessage:l})}).then(function(a){o._getGitServiceResponse(m,a)},function(a){o._handleGitServiceResponseError(m,
a)});return m},_getGitServiceResponse:function(a,b){var c=b.response?JSON.parse(b.response):null;if(b.xhr&&b.xhr.status===202){var f=e.handle(c.Location);f.then(a.resolve,function(b){b.failedOperation=c.Location;a.reject(b)},a.progress);a.then(null,function(a){f.reject(a)})}else a.resolve(c)},_handleGitServiceResponseError:function(a,b){a.reject(b)}};return b}();return c});
define("orion/ssh/sshTools",[],function(){var h=h||{};h.SshService=function(){function h(g){if(g)this._serviceRegistry=g,this._serviceRegistration=g.registerService("orion.net.ssh",this)}h.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(g,e){e||(e="");var c=localStorage.getItem(e+this._KNOWN_HOSTS);c?c.indexOf(g)<0&&localStorage.setItem(e+this._KNOWN_HOSTS,c+"\n"+g):localStorage.setItem(e+this._KNOWN_HOSTS,g)},clearKnownhosts:function(g){g||(g="");localStorage.removeItem(g+this._KNOWN_HOSTS)},
getKnownHosts:function(g){g||(g="");return localStorage.getItem(g+this._KNOWN_HOSTS)}};return h}();return h});
define("orion/links",[],function(){function h(h){this._init(h)}h.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(h,g,e,c,b){var a=h.search(e);a>0&&(g.appendChild(document.createTextNode(h.substring(0,a))),h=h.substring(a));var e=h.replace(e,""),a=h.substring(0,h.length-e.length),j=a.split(" ",c);if(j.length===c){for(var h=document.createElement("a"),d=0;d<c;d++)b=b.replace("%"+
(d+1),j[d]);h.setAttribute("href",b);h.textContent=a;g.appendChild(h);h=e}return h},addLinks:function(h,g){var e=g||document.createElement("div"),c=this._registry.getServiceReferences("orion.core.linkScanner");if(c.length>0)for(var b=c[0],c=RegExp(b.getProperty("pattern"),"i"),a=b.getProperty("words"),b=b.getProperty("anchor"),j=h.search(c);j>=0;)h=this._replaceLink(h,e,c,a,b),j=h.search(c);h.length>0&&e.appendChild(document.createTextNode(h));return e}};h.prototype.constructor=h;return{TextLinkService:h}});
var eclipse;
define('built-git-status2.js',"i18n!git/nls/gitmessages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/git/gitStatusExplorer,orion/git/gitCommands,orion/git/gitClient,orion/ssh/sshTools,orion/links,orion/contentTypes,orion/PageUtil".split(","),function(h,
k,g,e,c,b,a,j,d,f,i,l,o,m,s,r,p,q,t,n,v,w,u){e.startup().then(function(e){var g=e.serviceRegistry,e=e.preferences;new d.DialogService(g);var z=new f.Selection(g);new n.SshService(g);var z=new a.CommandRegistry({selection:z}),B=new l.OperationsClient(g);new c.StatusReportingService(g,B,"statusPane","notifications","notificationArea");new b.ProgressService(g,B,z);(new s.ThemePreferences(e,new r.ThemeData)).apply();B=new v.TextLinkService({serviceRegistry:g});new t.GitService(g);var A=new i.FileClient(g);
new w.ContentTypeService(g);var F=new o.Searcher({serviceRegistry:g,commandService:z,fileService:A}),G=new p.GitStatusExplorer(g,z,B,null,"artifacts","pageActions",null,"itemLevelCommands");m.setPageCommandExclusions(["eclipse.git.status2","eclipse.git.status"]);m.generateBanner("orion-git-status",g,z,e,F,G);q.createFileCommands(g,z,G,"pageActions","selectionTools");q.createGitClonesCommands(g,z,G,"pageActions","selectionTools",A);q.createGitStatusCommands(g,z,G);z.addCommandGroup("pageActions","eclipse.gitGroup",
100);z.registerCommandContribution("pageActions","eclipse.orion.git.resetCommand",100,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.rebaseContinueCommand",200,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.rebaseSkipPatchCommand",300,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.rebaseAbortCommand",400,"eclipse.gitGroup");g=new j.Command({name:h["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}});z.addCommand(g);g=u.matchResourceParameters();G.display(g.resource);window.addEventListener("hashchange",function(){var a=u.matchResourceParameters();G.display(a.resource)},!1)})});