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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 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
*/
(function(){function h(d,c,b,j,e,a){c[d]&&(b.push(d),(c[d]===!0||c[d]===1)&&j.push(e+d+"/"+a))}function k(d,c,b,j,e){c=j+c+"/"+e;require._fileExists(d.toUrl(c+".js"))&&b.push(c)}function i(d,c,b){for(var j in c)c.hasOwnProperty(j)&&(!d.hasOwnProperty(j)||b)?d[j]=c[j]:typeof c[j]==="object"&&i(d[j],c[j],b)}var g=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var c=d.config?d.config():{};return{version:"2.0.1+",load:function(b,j,e,a){a=a||{};if(a.locale)c.locale=a.locale;
var f=g.exec(b),d=f[1],n=f[4],m=f[5],q=n.split("-"),s=[],p={},r,t="";if(f[5])d=f[1],b=d+m;else{m=f[4];n=c.locale;if(!n)n=c.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();q=n.split("-")}if(a.isBuild){s.push(b);k(j,"root",s,d,m);for(r=0;r<q.length;r++)a=q[r],t+=(t?"-":"")+a,k(j,t,s,d,m);j(s,function(){e()})}else j([b],function(a){var f=[],b;h("root",a,f,s,d,m);for(r=0;r<q.length;r++)b=q[r],t+=(t?"-":"")+b,h(t,a,f,s,d,m);j(s,function(){var b,
c,g;for(b=f.length-1;b>-1&&f[b];b--){g=f[b];c=a[g];if(c===!0||c===1)c=j(d+g+"/"+m);i(p,c)}e(p)})})}}})})();
define("orion/i18n",[],function(){return{load:function(h,k,i,g){var g=g||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,c=d.exec(h);if(c)if(k.defined(h))i(k(h));else if(g.isBuild||g.isTest)i({});else{var b=c[1],j=c[3]?c[2]:"",e=c[3]||c[2];k(["orion/bootstrap"],function(a){a.startup().then(function(a){var l=a.serviceRegistry,a=l.getServiceReferences("orion.i18n.message");if(j)a.some(function(a){return h===a.getProperty("name")?(l.getService(a).getMessageBundle().then(function(a){i(a)},function(){i({})}),
!0):!1})||i({});else{var n={},m;a.forEach(function(a){var f=a.getProperty("name");if((c=d.exec(f))&&b===c[1]&&e===(c[3]||c[2]))if(j=c[3]?c[2]:""){if((a=g.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.toLowerCase().indexOf(j.toLowerCase())===0)n[j]=!0,k.specified(f)||define(f,["orion/i18n!"+f],function(a){return a})}else m=a});k.specified(h)?i(n):m?l.getService(m).getMessageBundle().then(function(a){Object.keys(n).forEach(function(f){typeof a[f]==="undefined"&&
(a[f]=n[f])});define(h,[],a);i(a)},function(){define(h,[],n);i(n)}):(define(h,[],n),i(n))}})})}else i(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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/browserCompatibility",[],function(){function h(){for(var d=navigator.userAgent,c={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],j=0;j<b.length;j++){var e=b[j],a=d.match(e.regExp);if(a){c.browser=!0;c.version=a[1]>=e.minVersion;c.name=e.name;break}}return c}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(d){return!1}}function i(d){alert(d);throw"unsupported browser";}var g=h();if(g.browser)g.version||i("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+g.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()||i("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:i}});
(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 a;a=b.shift()||j.shift();)a();e=!1}function k(a,f){(f?j:b).push(a);e||(e=!0,f?setTimeout(h,0):h())}function i(a){return function(){a.apply(null,arguments)}}function g(){}function d(){var a=Error("Cancel");a.name="Cancel";return a}function c(){function a(){for(var a;a=b.shift();){var c=a.deferred,
j=e==="resolved"?"resolve":"reject";if(typeof a[j]==="function")try{var d=a[j](f);d&&typeof d.then==="function"?(c.cancel=d.cancel||g,d.then(i(c.resolve),i(c.reject),c.progress)):c.resolve(d)}catch(m){c.reject(m)}else c[j](f)}}var f,e,b=[],j=this;this.reject=function(c){e||(e="rejected",f=c,b.length&&k(a));return j.promise};this.resolve=function(c){e||(e="resolved",f=c,b.length&&k(a));return j.promise};this.progress=function(a){e||b.forEach(function(f){f.progress&&f.progress(a)});return j.promise};
this.cancel=function(){e||j.reject(d())};this.then=function(f,d,g){var f={resolve:f,reject:d,progress:g,deferred:new c},h=f.deferred,i=!1,o=function(){i||(i=!0,k(function(){var a=h.cancel===o?j.cancel:h.cancel;typeof a==="function"&&a()},!0))};h.cancel=o;b.push(f);e&&k(a,!0);return h.promise};this.promise=Object.create(Object.prototype,{then:{value:j.then},cancel:{get:function(){return j.cancel},set:function(a){j.cancel=a}}})}var b=[],j=[],e=!1;c.all=function(a,f){function e(a,f){g||(d[a]=f,--j===
0&&h.resolve(d))}function b(a,c){if(!g){if(f)try{e(a,f(c));return}catch(o){c=o}h.reject(c)}}var j=a.length,d=[],g=!1,h=new c;h.then(null,function(){g=!0;a.forEach(function(a){a.cancel&&a.cancel()})});j===0?h.resolve(d):a.forEach(function(a,f){a.then(e.bind(null,f),b.bind(null,f))});return h.promise};c.when=function(a,f,e,b){var j;if(!(a&&typeof a.then==="function"))j=new c,j.resolve(a),a=j.promise;return a.then(f,e,b)};return c});
define("orion/EventTarget",[],function(){function h(){this._namedListeners={}}h.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var i=this._namedListeners[h.type];i&&i.forEach(function(g){try{typeof g==="function"?g(h):g.handleEvent(h)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!h.defaultPrevented},addEventListener:function(h,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(i)},
removeEventListener:function(h,i){var g=this._namedListeners[h];if(g)for(var d=0;d<g.length;d++)if(g[d]===i){g.length===1?delete this._namedListeners[h]:g.splice(d,1);break}}};h.prototype.constructor=h;h.attach=function(k){var i=new h;k.dispatchEvent=i.dispatchEvent.bind(i);k.addEventListener=i.addEventListener.bind(i);k.removeEventListener=i.removeEventListener.bind(i)};return h});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(h,k){function i(b,e,a){this._properties=a||{};this._properties["service.id"]=b;this._properties.objectClass=e;this._properties["service.names"]=e}function g(b,e,a){this._serviceId=b;this._serviceReference=e;this._internalRegistry=a}function d(b,e){function a(a){return function(){var f;try{if(!e())throw Error("Service was unregistered");var c=b[a].apply(b,Array.prototype.slice.call(arguments));if(c&&typeof c.then==="function")return c;
else f=new h,f.resolve(c)}catch(d){f=new h,f.reject(d)}return f.promise}}for(var f in b)typeof b[f]==="function"&&(this[f]=a(f))}function c(b,e){this.type=b;this.serviceReference=e}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var b=this;this._internalRegistry={isRegistered:function(e){return b._entries[e]?!0:!1},unregisterService:function(e){var a=b._entries[e];if(!a)throw Error("already unregistered");var f=a.reference;b._serviceEventTarget.dispatchEvent(new c("unregistering",
f));b._entries[e]=null;f.getProperty("objectClass").forEach(function(a){for(var e=b._namedReferences[a],c=0;c<e.length;c++)if(e[c]===f){e.length===1?delete b._namedReferences[a]:e.splice(c,1);break}})},modifyService:function(e){e=b._entries[e];if(!e)throw Error("already unregistered");b._serviceEventTarget.dispatchEvent(new c("modified",e.reference))}}}i.prototype={getPropertyKeys:function(){var b=[],e;for(e in this._properties)this._properties.hasOwnProperty(e)&&b.push(e);return b},getProperty:function(b){return this._properties[b]}};
i.prototype.constructor=i;g.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(b){var e=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;b.objectClass=e.objectClass;b["service.names"]=e["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
g.prototype.constructor=g;b.prototype={getService:function(b){var e;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(a){e=this._entries[a.getProperty("service.id")].service;return!!e},this);else if(b=this._entries[b.getProperty("service.id")])e=b.service;return e||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:[];var e=[];this._entries.forEach(function(a){a&&e.push(a.reference)});return e},registerService:function(b,e,a){if(typeof e===
"undefined"||e===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var f=this._entries.length,l=new i(f,b,a),n=this._namedReferences;b.forEach(function(a){n[a]=n[a]||[];n[a].push(l)});b=new d(e,this._internalRegistry.isRegistered.bind(null,f));this._entries.push({reference:l,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new c("registered",l));return new g(f,l,b)},addEventListener:function(b,e){this._serviceEventTarget.addEventListener(b,
e)},removeEventListener:function(b,e){this._serviceEventTarget.removeEventListener(b,e)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(h){function k(h,g,d,c){var b=typeof d.response!=="undefined"?d.response:d.responseText,j;try{j=d.status}catch(e){j=0}h={args:g,response:b,responseText:typeof b==="string"?b:null,status:j,url:h,xhr:d};if(typeof c!=="undefined")h.error=c;return h}return function(i,g,d){var d=d||{},c=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new h,j=d.headers||{},e=d.log||!1,a;typeof j["X-Requested-With"]==="undefined"&&(j["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(i==="POST"||i==="PUT"))a=d.data;c.onprogress=function(a){a.xhr=c;b.progress(a)};c.onreadystatechange=function(){if(c.readyState===4){var a=k(g,d,c),f=c.status;200<=f&&f<400?b.resolve(a):(e&&typeof console!=="undefined"&&console.log(Error(c.statusText)),b.reject(a))}};try{c.open(i,g,!0);if(typeof d.responseType==="string")c.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof c.timeout==="number")c.timeout=d.timeout,c.addEventListener("timeout",function(){b.reject(k(g,
d,c,"Timeout exceeded"))});else{var f=setTimeout(function(){b.reject(k(g,d,c,"Timeout exceeded"))},d.timeout);b.then(clearTimeout.bind(null,f),clearTimeout.bind(null,f))}Object.keys(j).forEach(function(a){c.setRequestHeader(a,j[a])});c.send(a)}catch(l){b.reject(k(g,d,c,l))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(h,k,i){function g(a,f){this._name=a;this._providers=f;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function d(a,f){return{get:function(e,b){if(f===0)return null;var c=localStorage.getItem(a+e);if(c===null)return null;c=JSON.parse(c);return b||f===-1||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(e,b){if(f!==0){if(f!==-1)b._expires=(new Date).getTime()+1E3*f;
if(Object.keys(b).length===0)localStorage.removeItem(a+e);else{var c=JSON.stringify(b);localStorage.setItem(a+e,c);delete b._expires}}},remove:function(f){localStorage.removeItem(a+f)}}}function c(a){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var f=a.getServiceReferences("orion.core.preference.provider");if(f.length>0)this._service=a.getService(f[0])}return!!this._service}}function b(a){this._location=
a;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function j(){this._cache=new d("/orion/preferences/local",-1)}function e(a,f){this._userProvider=new c(a);this._localProvider=new j;f=f||"defaults.pref";f.indexOf("://")===-1&&(f=h.toUrl(f));this._defaultsProvider=new b(f);this._serviceRegistration=a.registerService("orion.core.preference",this)}g.prototype={_flush:function(){for(var a=[],f=0;f<this._stores.length;++f){var e=this._stores[f];this._dirty.indexOf(e)!==-1&&
a.push(this._providers[f].put(this._name,e))}this._dirty=[];return k.all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var f=this._stores[a],e;for(e in f)f.hasOwnProperty(e)&&typeof this._cached[e]==="undefined"&&(this._cached[e]=
f[e])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,f){if(this._stores.length!==0){var e=this._stores[0];if(e[a]!==f)e[a]=f,this._cached=null,this._scheduleFlush(e)}},remove:function(a){for(var f=0;f<this._stores.length;++f){var e=this._stores[f];if(e.hasOwnProperty(a))return delete e[a],this._cached=null,this._scheduleFlush(e),!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 f=this,e=[],b=0;b<this._providers.length;++b)e.push(this._providers[b].get(this._name,a).then(function(a){return function(e){f._stores[a]=e}}(b)));return k.all(e).then(function(){f._cached=null;f._getCached()})},flush:function(){this._flush()}};c.prototype={get:function(a,f){if(this._currentPromises[a])return this._currentPromises[a];var e=new k,b=null;
f?this._cache.remove(a):b=this._cache.get(a);if(b!==null)e.resolve(b);else{this._currentPromises[a]=e;var c=this;this._service.get(a).then(function(f){c._cache.set(a,f);delete c._currentPromises[a];e.resolve(f)},function(f){f.status===404?(f={},c._cache.set(a,f),delete c._currentPromises[a],e.resolve(f)):(delete c._currentPromises[a],e.resolve(c._cache.get(a,!0)||{}))})}return e},put:function(a,f){this._cache.set(a,f);return this._service.put(a,f)}};b.prototype={get:function(a,f){if(this._currentPromise)return this._currentPromise;
var e=new k,b=null;f?this._cache.remove(a):b=this._cache.get(a);if(b!==null)e.resolve(b);else{this._currentPromise=e;var c=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(f){f=JSON.parse(f.response);c._cache.set(a,f[a]||{});c._currentPromise=null;e.resolve(f[a]||{})},function(f){f.xhr.status===401||f.xhr.status===404?(c._cache.set(a,{}),c._currentPromise=null,e.resolve({})):(c._currentPromise=null,f=c._cache.get(a,!0),f!==null?e.resolve(f[a]||{}):e.resolve({}))})}return e},
put:function(){var a=new k;a.resolve();return a}};j.prototype={get:function(a){var f=new k,a=this._cache.get(a);a!==null?f.resolve(a):f.resolve({});return f},put:function(a,f){var e=new k;this._cache.set(a,f);e.resolve();return e}};e.DEFAULT_SCOPE=1;e.LOCAL_SCOPE=2;e.USER_SCOPE=4;e.prototype={listenForChangedSettings:function(a,f,b){if(!f||typeof f!=="number"||f>7||f<1)b=f,f=e.DEFAULT_SCOPE|e.LOCAL_SCOPE|e.USER_SCOPE;window.addEventListener("storage",b,!1);if((e.USER_SCOPE&f)!==0)return"/orion/preferences/user"+
a;else if((e.LOCAL_SCOPE&f)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,f){if(!f||typeof f!=="number"||f>7||f<1)f=e.DEFAULT_SCOPE|e.LOCAL_SCOPE|e.USER_SCOPE;var b=[];e.USER_SCOPE&f&&this._userProvider.available()&&b.push(this._userProvider);e.LOCAL_SCOPE&f&&b.push(this._localProvider);e.DEFAULT_SCOPE&f&&b.push(this._defaultsProvider);var c=new g(a,b);return c.sync().then(function(){return c})},getSetting:function(a,f,e){for(var b,c=0;c<a.length;c++)if(a[c].label===
f)for(var d=0;d<a[c].data.length;d++)if(a[c].data[d].label===e){b=a[c].data[d].value;break}return b}};return{PreferencesService:e}});
(function(){function h(a){if(typeof a!=="string")throw new TypeError;}function k(a){return a?a.split("&"):[]}function i(a){return a.length===0?"":a.join("&")}function g(a){var f=/([^=]*)(?:=?)(.*)/.exec(a),a=f[1]?decodeURIComponent(f[1]):"",f=f[2]?decodeURIComponent(f[2]):"";return[a,f]}function d(a){var f=encodeURIComponent(a[0]);a[1]&&(f+="="+encodeURIComponent(a[1]));return f}function c(a,f){var e="",o=[],b=0;return{next:function(){if(e!==a.query)e=a.query,o=k(e);if(b<o.length){var c=g(o[b++]);
switch(f){case "keys":return c[0];case "values":return c[1];case "keys+values":return[c[0],c[1]];default:throw new TypeError;}}throw u;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function j(a){var f=[];a.split("/").forEach(function(a){a===".."?f.pop():a!=="."&&f.push(a)});return f.join("/")}function e(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function a(a,f){if(typeof a!=="string")throw new TypeError;var a=e(a),o=n.exec(a);
if(!o)return null;var b={};b.scheme=o[1]||"";if(b.scheme&&!q.test(b.scheme))return null;var c=o[2];if(c&&(c=m.exec(c),b.userinfo=c[1],b.host=c[2],b.port=c[3],b.port&&!s.test(b.port)))return null;b.path=o[3];b.query=o[4];b.fragment=o[5];if(!b.scheme&&f&&(b.scheme=f.scheme,!b.host&&f.host))b.userinfo=f.userinfo,b.host=f.host,b.port=f.port,b.pathRelative=!0;if(b.pathRelative)if(b.path){if(b.path[0]!=="/")o=/^(.*\/)[^\/]*$/.exec(f.path)[1]||"/",b.path=o+b.path}else b.path=f.path;if(b.scheme)b.scheme=
b.scheme.toLowerCase();if(b.port)b.port=/[1-9]\d*$/.exec(b.port)[0];if(b.host&&b.path)b.path=j(b.path);return b}function f(f,e){var o;if(e){e=e.href||e;o=a(e);if(!o||!o.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:o})}o=a(f,o);if(!o)throw new SyntaxError;Object.defineProperty(this,"_input",{value:f,writable:!0});Object.defineProperty(this,"_url",{value:o,writable:!0});var c=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?c: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 n=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,m=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,q=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,o=/^([^\s]*)$/,v=/^\S*$/,x=/([^:]*):?(.*)/,u=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),w={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){h(a);var f;k(this._url.query).some(function(e){e=g(e);if(e[0]===a)return f=e[1],!0});return f},enumerable:!0},set:{value:function(a,f){h(a);h(f);var e=k(this._url.query);e.some(function(o,b){var c=g(o);if(c[0]===a)return c[1]=f,e[b]=d(c),!0})||e.push(d([a,f]));this._url.query=i(e)},enumerable:!0},has:{value:function(a){h(a);return k(this._url.query).some(function(f){if(g(f)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){h(a);var f=k(this._url.query),e=f.filter(function(f){return g(f)[0]!==a});return e.length!==f.length?(this._url.query=i(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,f){if(typeof a!=="function")throw new TypeError;var e=c(this._url,"keys+values");try{for(;;){var o=e.next();a.call(f,o[1],o[0],this)}}catch(b){if(b!==u)throw b;}},enumerable:!0},keys:{value:function(){return c(this._url,
"keys")},enumerable:!0},values:{value:function(){return c(this._url,"values")},enumerable:!0},items:{value:function(){return c(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(a){h(a);var f=[];k(this._url.query).forEach(function(e){e=g(e);e[0]===a&&f.push(e[1])});return f},enumerable:!0},append:{value:function(a,f){h(a);h(f);var e=k(this._url.query);e.push(d([a,f]));this._url.query=i(e)},enumerable:!0}});Object.defineProperties(f.prototype,
{href:{get:function(){var a;if(this._url){a=this._url;var f=a.scheme?a.scheme+":":"";a.host&&(f+="//",a.userinfo&&(f+=a.userinfo+"@"),f+=a.host,a.port&&(f+=":"+a.port));f+=a.path;a.query&&(f+="?"+a.query);a.fragment&&(f+="#"+a.fragment);a=f}else a=this._input;return a},set:function(f){h(f);this._input=f;this._url=a(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,q.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=x.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){h(a);if(this._url){var f=x.exec(this._userinfo),a=[encodeURIComponent(a||"")];
f[2]&&a.push(f[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){h(a);if(this._url){var f=[x.exec(this._userinfo)[1]||""];a&&f.push(encodeURIComponent(a));this._userinfo=f.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=r.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===w[this.protocol]&&(a="");return a},set:function(a){h(a);if(this._url&&s.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)),o.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(f,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(f,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=f})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(h,k){function i(e,a){var f=Object.keys(e),b=Object.keys(a);if(f.length!==b.length)return!1;f.sort();b.sort();for(var c=0,d=f.length;c<d;c++){var j=f[c];if(j!==b[c])return!1;var g=e[j],j=a[j];if(g!==j&&JSON.stringify(g)!==JSON.stringify(j))return!1}return!0}function g(e){if(e.indexOf("://")===-1)try{return(new URL(e,location.href)).href}catch(a){}return e}function d(e){var a=null;return{key:function(f){return(a=
a||Object.keys(e))[f]},getItem:function(a){return e[a]},setItem:function(f,b){e[f]=b;a=null},removeItem:function(f){delete e[f];a=null},clear:function(){(a=a||Object.keys(e)).forEach(function(a){delete e[a]}.bind(this));a=null}}}function c(e,a){return{type:e,plugin:a}}function b(e,a,f){function b(a,e,o){if(!E)return(new h).reject(Error("plugin not connected"));var c=G++,d=new h;d.then(null,function(a){w==="active"&&a instanceof Error&&a.name==="Cancel"&&f.postMessage({id:c,cancel:a.message||"Cancel"},
E)});L[String(c)]=d;f.postMessage({id:c,serviceId:a,method:e,params:o},E);return d.promise}function d(a){var f={};if(a.methods&&(a.methods.forEach(function(e){f[e]=function(){var f=Array.prototype.slice.call(arguments);return w==="active"?b(a.serviceId,e,f):r.start({"transient":!0}).then(function(){return b(a.serviceId,e,f)})}}),f.addEventListener&&f.removeEventListener)){var e=new k;f.dispatchEvent=e.dispatchEvent.bind(e);var o=f.addEventListener;f.addEventListener=function(a,f){e._namedListeners[a]||
o(a);e.addEventListener(a,f)};var c=f.removeEventListener;f.removeEventListener=function(a,f){e.removeEventListener(a,f);e._namedListeners[a]&&c(a)}}return f}function j(a){var f=JSON.parse(JSON.stringify(a.properties));f.__plugin__=e;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);f.objectClass=a;return f}function g(a){var e=d(a),o=j(a),o=f.registerService(a.names||a.type,e,o);A[a.serviceId]={registration:o,proxy:e}}function s(){f.persist(e,{created:t,headers:o,services:v,autostart:x,lastModified:u})}
function p(a){var e;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var o=a.params[0];H({headers:o.headers,services:o.services}).then(function(){z.resolve(r)})}else if("dispatchEvent"===a.method){var b=A[a.serviceId].proxy;b.dispatchEvent.apply(b,a.params)}else if("progress"===a.method)e=L[String(a.requestId)],e.progress.apply(e,a.params);else if("timeout"===a.method)z&&z.reject(a.error);else throw Error("Bad response method: "+a.method);else if(e=L[String(a.id)],delete L[String(a.id)],
a.error){var c=f.handleServiceError(r,a.error);e.reject(c)}else e.resolve(a.result)}catch(d){console.log("Plugin._responseHandler "+d)}}var r=this,a=a||{},t=a.created||(new Date).getTime(),o=a.headers||{},v=a.services||[],x=a.autostart,u=a.lastModified||0,w="installed",D,z,E,A={},G=0,L={},H;this._persist=s;this._resolve=function(){w="resolved";f.dispatchEvent(new c("resolved",r))};this._getAutostart=function(){return x};this._getCreated=function(){return t};this.getLocation=function(){return e};this.getHeaders=
function(){return JSON.parse(JSON.stringify(o))};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(f){a.push(A[f].registration.getReference())});return a};this.getState=function(){return w};this.start=function(a){if(w==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));
if(D)return D.promise.then(this.start.bind(this,a));if(w==="active")return(new h).resolve();if(!a||!a["transient"]){var o=a&&a.lazy?"lazy":"started";o!==x&&(x=o,s())}o=f.getState();if(o!=="starting"&&o!=="active")return a["transient"]?(new h).reject(Error("start transient error")):(new h).resolve();if(w==="installed")try{this._resolve()}catch(b){return(new h).reject(b)}w==="resolved"&&v.forEach(function(a){g(a)});if(a&&a.lazy)return w!=="starting"&&(w="starting",f.dispatchEvent(new c("lazy activation",
r))),(new h).resolve();var d=new h;D=d;w="starting";f.dispatchEvent(new c("starting",r));z=new h;E=f.connect(e,p);z.then(function(){z=null;w="active";f.dispatchEvent(new c("started",r));D=null;d.resolve()},function(){z=null;w="stopping";f.dispatchEvent(new c("stopping",r));Object.keys(A).forEach(function(a){A[a].registration.unregister();delete A[a]});f.disconnect(E);E=null;w="resolved";D=null;f.dispatchEvent(new c("stopped",r));d.reject(Error("plugin activation error"))});return d.promise};this.stop=
function(a){if(w==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(D)return D.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==x)x="stopped",s();if(w!=="active"&&w!=="starting")return(new h).resolve();D=a=new h;w="stopping";f.dispatchEvent(new c("stopping",r));Object.keys(A).forEach(function(a){A[a].registration.unregister();delete A[a]});E&&(f.disconnect(E),E=null);w="resolved";D=null;f.dispatchEvent(new c("stopped",r));a.resolve();return a.promise};
H=function(a){if(w==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(!a)return u===0&&(u=(new Date).getTime(),s()),f.loadManifest(e).then(H);var b=o,d=v,l=x;o=a.headers||{};v=a.services||{};x=a.autostart||x;a.lastModified?u=a.lastModified:(u=(new Date).getTime(),s());if(i(o,b)&&i(v,d)&&x===l)return(new h).resolve();if(w==="active"||w==="starting"){var n=[];Object.keys(v).forEach(function(a){var f=v[a];n.push(a);var e=A[a];if(e){if(i(f.methods,Object.keys(e.proxy))){var a=j(f),
o=e.registration.getReference(),b={};o.getPropertyKeys().forEach(function(a){b[a]=o.getProperty(a)});i(a,b)||e.registration.setProperties(a);return}e.registration.unregister();delete A[a]}g(f)});Object.keys(A).forEach(function(a){n.indexOf(a)===-1&&(A[a].registration.unregister(),delete A[a])})}w==="active"&&(f.disconnect(E),z=new h,E=f.connect(e,p),z.then(function(){z=null},function(){z=null;w="stopping";f.dispatchEvent(new c("stopping"),r);Object.keys(A).forEach(function(a){A[a].registration.unregister();
delete A[a]});f.disconnect(E);E=null;w="resolved";f.dispatchEvent(new c("stopped",r))}));return(new h).resolve()};this.update=function(a){return H(a).then(function(){f.dispatchEvent(new c("updated",r))})};this.uninstall=function(){if(w==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(w==="active"||w==="starting"||w==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));f.removePlugin(this);w="uninstalled";f.dispatchEvent(new c("uninstalled",
r));return(new h).resolve()}}var j=/^http[s]?/i;return{Plugin:b,PluginRegistry:function(e,a){function f(a){var f=a.source;q.some(function(e){if(f===e.target){if(typeof e.useStructuredClone==="undefined")e.useStructuredClone=typeof a.data!=="string";e.handler(e.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var a=a||{},l=a.storage||localStorage;l.getItem||(l=d(l));var n="installed",m=[],q=[],s=new k,i={},r={registerService:e.registerService.bind(e),connect:function(f,e,b){function c(a){a=
Error(a);a.name="timeout";e({method:"timeout",error:a})}var d={handler:e,url:f},j=setTimeout(c.bind(null,"Load timeout for: "+f),b||15E3),g=document.createElement("iframe");g.name=f+"_"+(new Date).getTime();if(!a.visible)g.style.display="none",g.style.visibility="hidden";g.src=f;g.onload=function(){clearTimeout(j);setTimeout(c.bind(null,"Plugin handshake timeout for: "+f),5E3)};g.sandbox="allow-scripts allow-same-origin";document.body.appendChild(g);d.target=g.contentWindow;d.close=function(){g&&
(document.body.removeChild(g),g=null)};q.push(d);return d},disconnect:function(a){for(var f=0;f<q.length;f++)if(a===q[f]){q.splice(f,1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var f=0;f<m.length;f++)if(a===m[f]){m.splice(f,1);break}l.removeItem("plugin."+a.getLocation())},persist:function(a,f){l.setItem("plugin."+a,JSON.stringify(f))},postMessage:function(a,f){f.target.postMessage(f.useStructuredClone?a:JSON.stringify(a),f.url)},dispatchEvent:function(a){try{s.dispatchEvent(a)}catch(f){console&&
console.log("PluginRegistry.dispatchEvent "+f)}},loadManifest:function(a){var f=new h,e=r.connect(a,function(a){e&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],r.disconnect(e),e=null,f.resolve(a)):"timeout"===a.method&&(r.disconnect(e),e=null,f.reject(a.error)))});return f.promise},getState:function(){return n},handleServiceError:function(a,f){if(f&&f.status===401){var e=a.getHeaders(),b=a.getName()||a.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+
b+"."));if(e.login)c.appendChild(document.createTextNode(" ")),b=document.createElement("a"),b.target="_blank",b.textContent="Login",b.href=e.login,j.test(b.href)?(c.appendChild(b),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+e.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(c)}}if(f.__isError){var d=f,f=Error(d.message);Object.keys(d).forEach(function(a){f[a]=d[a]});delete f.__isError}return f}};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=r.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",f,!1);for(var e=[],o=0,c=l.length;o<c;o++)e.push(l.key(o));e.forEach(function(a){if(a.indexOf("plugin.")===0){var f=a.substring(7),a=JSON.parse(l.getItem(a));a.created&&m.push(new b(f,a,r))}});
m.sort(function(a,f){return a._getCreated()<f._getCreated()?-1:1});a.plugins&&Object.keys(a.plugins).forEach(function(f){f=g(f);if(!this.getPlugin(f)){var e=a.plugins[f],e=typeof e==="object"||{};e.autostart=e.autostart||a.defaultAutostart||"lazy";m.push(new b(f,e,r))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new h).reject("Cannot start framework. Framework is already "+n+".");var a=[],f=(new Date).getTime();m.forEach(function(e){var b=
e._getAutostart();e.getLastModified()===0?a.push(e.update().then(function(){if("started"===b)return e.start({"transient":!0});if("lazy"===b)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===b?a.push(e.start({"transient":!0})):"lazy"===b?(a.push(e.start({lazy:!0,"transient":!0})),f>e.getLastModified()+864E5&&e.update()):e._resolve()});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new h).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var a=[];m.forEach(function(f){a.push(f.stop({"transient":!0}))});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",f);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new h).reject("Cannot uninstall registry")};this.installPlugin=function(a,f){var a=g(a),e=this.getPlugin(a);if(e)return(new h).resolve(e);if(i[a])return i[a];if(f)return e=new b(a,f,r),m.push(e),
e._persist(),r.dispatchEvent(new c("installed",e)),(new h).resolve(e);var d=r.loadManifest(a).then(function(f){e=new b(a,f,r);m.push(e);e._persist();delete i[a];r.dispatchEvent(new c("installed",e));return e},function(f){delete i[a];throw f;});return i[a]=d};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var f=null,a=g(a);m.some(function(e){if(a===e.getLocation())return f=e,!0});return f};this.addEventListener=s.addEventListener.bind(s);this.removeEventListener=s.removeEventListener.bind(s);
this.resolvePlugins=function(){var a=!0;m.forEach(function(f){a=a&&f._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function h(g,d){function c(a){var f=a.getProperty("service.id"),b=this.addingService(a);b&&(j[f]=a,e[f]=b)}function b(a){var f=a.getProperty("service.id"),b=e[f];delete j[f];delete e[f];this.removedService(a,b)}this.serviceRegistry=g;var j={},e={},a=k,f,l;this.close=function(){if(a!==i)throw"Already closed";a=k;g.removeEventListener("registered",f);g.removeEventListener("unregistering",l);l=f=null;var e=this;this.getServiceReferences().forEach(function(a){b.call(e,
a)});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(a!==k)throw"Already open";a=i;var e=this;f=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(d)!==-1&&(c.call(e,a.serviceReference),typeof e.onServiceAdded==="function"))return e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))};l=function(a){a.serviceReference.getProperty("objectClass").indexOf(d)!==
-1&&b.call(e,a.serviceReference)};g.addEventListener("registered",f);g.addEventListener("unregistering",l);g.getServiceReferences(d).forEach(function(a){c.call(e,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,i=1;h.prototype={addingService:function(g){return this.serviceRegistry.getService(g)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return h});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(h,k){var i,g,d,c,b,j="pid";i=function(a,f,e){function b(a,e,c){e.forEach(function(b,d){try{var j=a[d].getProperty("__plugin__"),g=j&&f.getPlugin(j);(!j||g&&g.getState()==="active")&&e[d].updated(c)}catch(l){typeof console!=="undefined"&&console.log(l)}})}k.call(this,a,"orion.cm.managedservice");var c={},d={},g=function(f){var b=[];f.plugin.getServiceReferences().forEach(function(f){if(f.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var o=f.getProperty(j),f=a.getService(f);o&&f&&(o=(o=e._find(o))&&o.getProperties(),b.push(f.updated(o)))}});return h.all(b)};this.addingService=function(f){var e=f.getProperty(j),b=a.getService(f);if(!e||!b)return null;c[e]||(c[e]=[]);d[e]||(d[e]=[]);c[e].push(f);d[e].push(b);return b};this.onServiceAdded=function(a,f){var c=a.getProperty(j),c=e._find(c);b([a],[f],c&&c.getProperties())};this.onOpen=function(){f.addEventListener("started",g)};this.onClose=function(){f.removeEventListener("started",
g)};this.notifyUpdated=function(a){var f=a.getPid();b(c[f]||[],d[f]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(c[a]||[],d[a]||[],null)};this.removedService=function(a,f){var e=a.getProperty(j),b=c[e],g=d[e];b.length>1?b.splice(b.indexOf(a),1):delete c[e];g.length>1?g.splice(g.indexOf(f),1):delete d[e]}};g=function(){function a(a,e,b){this.store=new d(this,b);this.configAdmin=new c(this,this.store);this.tracker=new i(a,e,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(e){a.tracker.open();return e})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();c=function(){function a(a,e){this.factory=a;this.store=e}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 e="/cm/configurations";
d=function(){function a(a,c){this.factory=a;this.prefsService=c;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(e).then(function(a){d.pref=a;a.keys().forEach(function(f){if(!d.configs[f]){var e=a.get(f);typeof e==="object"&&e!==null&&Object.keys(e).length>0&&(e[j]=f,d.configs[f]=new b(d.factory,d,e))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var e=this._find(a);
e||(e=new b(this.factory,this,a),this.configs[a]=e);return e},list:function(){var a=this,e=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&b.getProperties()!==null&&e.push(b)});return e},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,e){this.pref.put(a,e.getProperties(!0)||{})}};return a}();b=function(){function a(a){for(var f={},e=Object.keys(a),b=0;b<e.length;b++){var c=e[b],d=a[c];f[c]=d instanceof Array?d.slice():d}return f}function f(f,e,b){this.factory=
f;this.store=e;if(b!==null&&typeof b==="object")this.pid=b[j],f=a(b),delete f[j],this.properties=f;else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}f.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(f){this._checkRemoved();var e=null;if(this.properties&&(e=a(this.properties),!f))e[j]=this.pid;return e},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(f){this._checkRemoved();f=a(f);delete f[j];this.properties=f;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return f}();return{ConfigurationAdminFactory:g}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(h,k,i,g,d,c){var b;return{startup:function(){if(b)return b;b=new k;var j=new i.ServiceRegistry,e=new g.PreferencesService(j);return e.getPreferences("/plugins").then(function(a){var f={plugins:{}};a.keys().forEach(function(e){var b=h.toUrl(e);f.plugins[b]=a[e]});var g=new d.PluginRegistry(j,f);return g.start().then(function(){if(j.getServiceReferences("orion.core.preference.provider").length>
0)return e.getPreferences("/plugins",e.USER_SCOPE).then(function(a){var f=[];a.keys().forEach(function(a){a=h.toUrl(a);g.getPlugin(a)||f.push(g.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(f,function(a){console.log(a)})})}).then(function(){return(new c.ConfigurationAdminFactory(j,g,e)).getConfigurationAdmin().then(j.registerService.bind(j,"orion.cm.configadmin"))}).then(function(){var a=j.getService("orion.core.auth");
if(a){var f=a.getUser().then(function(f){if(f)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return f}}).then(function(){var a={serviceRegistry:j,preferences:e,pluginRegistry:g};b.resolve(a);return a})})}}});
define("orion/webui/littlelib",[],function(){function h(b,e){e||(e=document);return e.querySelectorAll(b)}function k(b,e){var a=b.compareDocumentPosition(e);return b===e||Boolean(a&16)}function i(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var e=0;e<b.childNodes.length;e++){var a=i(b.childNodes[e]);if(a)return a}return null}function g(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var e=b.childNodes.length-1;e>=0;e--){var a=g(b.childNodes[e]);if(a)return a}return null}function d(b,
e){if(b.nodeType===3){var a=c.exec(b.nodeValue);a&&a.length>1&&e(b,a)}if(b.hasChildNodes())for(a=0;a<b.childNodes.length;a++)d(b.childNodes[a],e)}var c=/\$\{([^\}]+)\}/,b=[];return{$:function(b,e){e||(e=document);return e.querySelector(b)},$$:h,$$array:function(b,e){return Array.prototype.slice.call(h(b,e))},node:function(b){var e=b;typeof b==="string"&&(e=document.getElementById(b));return e},contains:k,bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.body.scrollLeft,top:b.top+
document.body.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:i,lastTabbable:g,stop:function(b){window.document.all?b.keyCode=0:(b.preventDefault(),b.stopPropagation())},processTextNodes:function(b,e){d(b,function(a,f){a.parentNode.replaceChild(document.createTextNode(e[f[1]]||f[1]),a)})},processDOMNodes:function(b,e){d(b,function(a,f){var b=e[f[1]];if(b){var c=document.createRange(),d=f.index;c.setStart(a,d);c.setEnd(a,
d+f[0].length);c.deleteContents();c.insertNode(b)}})},addAutoDismiss:function(c,e){b.length===0&&document.addEventListener("click",function(a){for(var f=[],e=0;e<b.length;e++){var c=b[e].dismiss,d=!1,j;if(b[e].excludeNodes.every(function(f){return f&&(d=document.compareDocumentPosition(document,f)!==1)&&k(f,a.target)?(j=f,!1):!0})){try{c()}catch(g){typeof console!=="undefined"&&console&&console.error(g&&g.message)}d=document.compareDocumentPosition(document,j)!==1}d&&f.push(b[e])}b=f},!0);b.push({excludeNodes:c,
dismiss:e})},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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("text",["module"],function(h){var k,i,g=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,c=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,j=b&&location.protocol&&location.protocol.replace(/\:/,""),e=b&&location.hostname,a=b&&(location.port||void 0),f=[],l=h.config&&h.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(d,""),f=a.match(c);f&&(a=f[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,f,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(f=0;f<3;f+=1){e=g[f];try{a=new ActiveXObject(e)}catch(b){}if(a){g=[e];break}}return a},parseName:function(a){var f,
e,b=!1,c=a.indexOf(".");f=a.indexOf("./")===0||a.indexOf("../")===0;c!==-1&&(!f||c>1)?(f=a.substring(0,c),e=a.substring(c+1,a.length)):f=a;a=e||f;c=a.indexOf("!");c!==-1&&(b=a.substring(c+1)==="strip",a=a.substring(0,c),e?e=a:f=a);return{moduleName:f,ext:e,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,f,e,b){var c,d;c=k.xdRegExp.exec(a);if(!c)return!0;a=c[2];c=c[3];c=c.split(":");d=c[1];c=c[0];return(!a||a===f)&&(!c||c.toLowerCase()===e.toLowerCase())&&(!d&&!c||d===b)},finishLoad:function(a,
e,b,c){b=e?k.strip(b):b;l.isBuild&&(f[a]=b);c(b)},load:function(f,c,d,g){if(g.isBuild&&!g.inlineText)d();else{l.isBuild=g.isBuild;var h=k.parseName(f),g=h.moduleName+(h.ext?"."+h.ext:""),i=c.toUrl(g),t=l.useXhr||k.useXhr;!b||t(i,j,e,a)?k.get(i,function(a){k.finishLoad(f,h.strip,a,d)},function(a){d.error&&d.error(a)}):c([g],function(a){k.finishLoad(h.moduleName+"."+h.ext,h.strip,a,d)})}},write:function(a,e,b){if(f.hasOwnProperty(e)){var c=k.jsEscape(f[e]);b.asModule(a+"!"+e,"define(function () { return '"+
c+"';});\n")}},writeFile:function(a,f,e,b,c){var f=k.parseName(f),d=f.ext?"."+f.ext:"",j=f.moduleName+d,o=e.toUrl(f.moduleName+d)+".js";k.load(j,e,function(){var f=function(a){return b(o,a)};f.asModule=function(a,f){return b.asModule(a,o,f)};k.write(a,j,f,c)},c)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)i=require.nodeRequire("fs"),k.get=function(a,f){var e=i.readFileSync(a,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));f(e)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,f,e,b){var c=k.createXhr(),d;c.open("GET",a,!0);if(b)for(d in b)b.hasOwnProperty(d)&&c.setRequestHeader(d.toLowerCase(),b[d]);if(l.onXhr)l.onXhr(c,a);c.onreadystatechange=function(){var b;if(c.readyState===4)b=c.status,b>399&&b<600?(b=Error(a+" HTTP status: "+b),b.xhr=c,e(b)):f(c.responseText)};c.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,f){var e,b,c=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),
c=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(c),"utf-8")),j="";try{e=new java.lang.StringBuffer;(b=c.readLine())&&b.length()&&b.charAt(0)===65279&&(b=b.substring(1));for(e.append(b);(b=c.readLine())!==null;)e.append(d),e.append(b);j=String(e.toString())}finally{c.close()}f(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,i){return{slideoutHTMLFragment:function(g){var d=document.createElement("div");d.innerHTML=i;var c=k.$("#slideContainer",d);c.id=g+c.id;c=k.$("#pageCommandParameters",d);c.id=g+c.id;c=k.$("#pageCommandDismiss",d);c.id=g+c.id;return d.innerHTML}}});
define("orion/util",[],function(){var h=navigator.userAgent,k=parseFloat(h.split("MSIE")[1])||void 0,i=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,g=h.indexOf("Opera")!==-1,d=parseFloat(h.split("Chrome/")[1])||void 0,c=h.indexOf("Safari")!==-1&&!d,b=parseFloat(h.split("WebKit/")[1])||void 0,j=h.indexOf("Android")!==-1,e=h.indexOf("iPad")!==-1,h=h.indexOf("iPhone")!==-1,a=e||h,f=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var f=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return f[(e<<0)+1]})},createElement:function(a,f){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",f):a.createElement(f)},isIE:k,isFirefox:i,isOpera:g,isChrome:d,isSafari:c,isWebkit:b,isAndroid:j,isIPad:e,isIPhone:h,isIOS:a,isMac:f,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(h){function k(g,d,c,b,j,e){this.type=e||"keydown";this.keyCode=typeof g==="string"&&this.type==="keydown"?g.toUpperCase().charCodeAt(0):g;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=c!==void 0&&c!==null?c:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=j!==void 0&&j!==null?j:!1}function i(g){this.keys=g}k.prototype={getKeys:function(){return[this]},match:function(g,d){if(d!==void 0){if(d!==0)return!1}else if(g instanceof Array){if(g.length>1)return!1;
g=g[0]}return g.type!==this.type?!1:this.keyCode===g.keyCode||this.keyCode===String.fromCharCode(h.isOpera?g.which:g.charCode!==void 0?g.charCode:g.keyCode)?this.mod1!==(h.isMac?g.metaKey:g.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==g.shiftKey?!1:this.mod3!==g.altKey?!1:h.isMac&&this.mod4!==g.ctrlKey?!1:!0:!1},equals:function(g){return!g?!1:this.keyCode!==g.keyCode?!1:this.mod1!==g.mod1?!1:this.mod2!==g.mod2?!1:this.mod3!==g.mod3?!1:this.mod4!==g.mod4?!1:this.type!==g.type?!1:!0}};i.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(g,d){var c=this.keys;if(d!==void 0)return d>c.length?!1:c[d].match(g)?d===c.length-1?!0:d+1:!1;else{g instanceof Array||(g=[g]);if(g.length>c.length)return!1;var b;for(b=0;b<g.length;b++)if(!c[b].match(g[b]))return!1;return b===c.length?!0:b}},equals:function(g){if(!g.keys)return!1;if(g.keys.length!==this.keys.length)return!1;for(var d=0;d<g.keys.length;d++)if(!g.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:i}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(h,k){function i(g){this._init(g)}i.prototype={_init:function(g){this._dropdownNode=k.node(g.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=g.populate;var d=this;this._triggerNode.addEventListener("click",function(c){d.toggle()&&k.stop(c)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(c){if(c.keyCode===k.KEY.ENTER||c.keyCode===k.KEY.SPACE)d.toggle(),k.stop(c)},!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 g=this.getItems();if(g.length>0){if(!this._hookedAutoDismiss){var d=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(d)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();g[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var g=k.bounds(this._dropdownNode),d=k.bounds(this._boundingNode(this._triggerNode));if(g.left+g.width>d.left+d.width)this._dropdownNode.style.right=
0},_boundingNode:function(g){return g.style.right!==""||g.style.position==="absolute"||!g.parentNode||!g.parentNode.style?g:this._boundingNode(g.parentNode)},close:function(g){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");g&&this._triggerNode.focus();return!0},getItems:function(){var g=[],d=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(c){c.parentNode.parentNode===d._dropdownNode&&
g.push(c)});return g},empty:function(){var g=this;k.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===g._dropdownNode&&d.parentNode.removeChild(d)})},_dropdownKeyDown:function(g){if(g.keyCode===k.KEY.UP||g.keyCode===k.KEY.DOWN||g.keyCode===k.KEY.RIGHT||g.keyCode===k.KEY.ENTER||g.keyCode===k.KEY.LEFT){var d=this.getItems(),c=document.activeElement;if(d.length&&d.length>0&&c){var b=d.indexOf(c);b<0&&(b=d.indexOf(c.parentNode));b>=0&&(g.keyCode===k.KEY.UP&&b>0?(b--,d[b].focus()):g.keyCode===
k.KEY.DOWN&&b<d.length-1?(b++,d[b].focus()):g.keyCode===k.KEY.ENTER||g.keyCode===k.KEY.RIGHT?c.classList.contains("dropdownTrigger")&&c.dropdown&&c.dropdown.open():g.keyCode===k.KEY.LEFT&&c.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(g))}}else g.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(g))}};i.prototype.constructor=i;return{Dropdown:i}});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 i(g){this._init(g)}i.prototype={_init:function(g){this._node=k.node(g.node);if(!this._node)throw"no dom node for tooltip found";this._position=g.position||["right","above","below","left"];this._text=g.text;this._hideDelay=g.hideDelay===void 0?200:g.hideDelay;this._tailSize=g.tailSize||10;this._trigger=g.trigger||"mouseover";this._afterShowing=g.afterShowing;this._afterHiding=g.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(b){b.target===d._node&&(d.show(),k.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=g.showDelay===void 0?500:g.showDelay;g=["mouseout","click"];this._node.addEventListener("mouseover",function(b){k.contains(d._node,b.target)&&(d.show(),k.stop(b))},!1);for(var c=0;c<g.length;c++)this._node.addEventListener(g[c],function(b){k.contains(d._node,b.target)&&d.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 g=this;k.addAutoDismiss([this._tip,this._node],function(){g.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(g._timeout)window.clearTimeout(g._timeout),g._timeout=null;g._tip.addEventListener("mouseout",function(d){k.contains(g._tip,d.target)&&(g.hide(),k.stop(d))},!1)},!1)}return this._tip},_positionTip:function(g,d){this._makeTipNode();g==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var c=this._node,b;for(b=k.bounds(c);c&&!b.width&&!b.height;c=c.parentNode)b=
k.bounds(c);var c=k.bounds(this._tipInner),j;switch(g){case "above":j=b.top-c.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":j=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":j=b.top-this._tailSize/2;b=b.left-c.width-this._tailSize-1;break;default:j=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var e=k.bounds(document.documentElement);if(j+c.height>e.height)if(d)j=e.height-c.height-1;else return!1;if(b+c.width>e.width)if(d)b=e.width-c.width-
1;else return!1;if(b<0)if(d)b=4;else return!1;if(j<0)if(d)j=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+g),g==="above"||g==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),g==="left"))this._tail.style.left=c.width+"px";this._tip.style.top=j+"px";this._tip.style.left=b+"px";this._tip.style.width=c.width+"px";this._tip.style.height=c.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var g=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var d=!1,c=0;!d&&c<g._position.length;)d=g._positionTip(g._position[c]),c++;d||g._positionTip(g._position[0],!0);g._tip.classList.add("tooltipShowing");g._afterShowing&&g._afterShowing()},this._showDelay)}},hide:function(g){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(g===void 0)g=this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},g)}},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}};i.prototype.constructor=i;return{Tooltip:i}});
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,i,g,d,c,b,j){function e(a,f){for(var e in f)if(f[e]&&f[e].keyBinding&&f[e].command&&f[e].keyBinding.match(a)){var b=f[e],c=b.keyBinding;if(!c.domScope||i.contains(i.node(c.domScope),a.target)){var o=b.invocation;if(o){var d=b.command;if(d.hrefCallback){i.stop(a);
e=d.hrefCallback.call(o.handler||window,o);e.then?e.then(function(a){window.open(a)}):window.open(e);break}else if(d.onClick||d.callback){i.stop(a);window.setTimeout(function(){(d.onClick||d.callback).call(o.handler||window,o)},0);break}}}}}function a(a,f,e){f.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?f.classList.add(a.imageClass):(b=document.createElement("span"),f.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,
b.name=e,b.id=e,b.src=a.image,f.appendChild(b));return b}function f(a,f,e,b,c){this.commandRegistry=c;this.handler=a;this.items=f;this.userData=e;this.command=b;if(b.parameters)this.parameters=b.parameters.makeCopy();this.id=b.id}function l(a){this._init(a)}var n=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(n){var b,c,d;c=Object.keys(m);for(b=0;b<c.length;b++)d=c[b],f[d]=m[d];var o=n();c=Object.keys(o);for(b=0;b<c.length;b++)d=c[b],f[d]=o[d]}else f=m;e(a,f)},!1);f.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var e=new f(this.handler,this.items,this.userData,this.command,this.commandRegistry);e.domNode=this.domNode;e.domParent=this.domParent;if(a)e.parameters=a.makeCopy();else if(this.parameters)e.parameters=
this.parameters.makeCopy();return e}};f.prototype.constructor=f;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,
f,e,b,c){this.getChoices(f,e,b).forEach(function(e){if(e.name){var b=document.createElement("li");a.appendChild(b);var d=document.createElement("span");d.tabIndex=0;d.role="menuitem";d.classList.add("dropdownMenuItem");var j=document.createTextNode(e.name);d.appendChild(j);b.appendChild(d);d.choice=e;d.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,f)},!1);d.addEventListener("keydown",function(a){(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,f)},!1)}else c._generateMenuSeparator(a)})},getChoices:function(a,f,e){return this.choiceCallback?this.choiceCallback.call(f,a,e):null},makeChoiceCallback:function(a,f){return function(e){a.callback&&a.callback.call(a,f,e)}},hasImage:function(){return this.imageClass||this.image!==h.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:f,createDropdownMenu:function(f,e,b,c,j,o){f=i.node(f);if(!f)throw"no parent node was specified";
var l=document.createRange();l.selectNode(f);l=l.createContextualFragment(d);i.processTextNodes(l,{ButtonText:e});f.appendChild(l);f=f.lastChild;l=f.previousSibling;c?l.classList.add(c):(l.classList.add("orionButton"),l.classList.add("commandButton"));if(j){if(!o)l.textContent="",l.setAttribute("aria-label",e);a({spriteClass:"commandSprite",imageClass:j},l,e);l.classList.add("orionButton")}l.dropdown=new g.Dropdown({dropdown:f,populate:b});f.dropdown=l.dropdown;return{menuButton:l,menu:f,dropdown:l.dropdown}},
createCheckedMenuItem:function(a,f,e,c){a=i.node(a);if(!a)throw"no parent node was specified";var d=document.createRange();d.selectNode(a);d=d.createContextualFragment(b);i.processTextNodes(d,{ItemText:f});a.appendChild(d);a=i.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",c,!1)},createCommandItem:function(f,e,b,c,d,o,g){var l,o=o||!e.name&&e.hasImage();if(e.hrefCallback)l=document.createElement("a"),l.id=c,o&&e.hasImage()?a(e,l,c):(l.className="commandLink",l.appendChild(document.createTextNode(e.name))),
g=e.hrefCallback.call(b.handler,b),g.then?g.then(function(a){l.href=a}):l.href=g?g:"#";else{l=document.createElement("button");l.className="orionButton";o?e.hasImage()?(a(e,l,c),e.name&&l.setAttribute("aria-label",e.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(e.name))):(l.classList.add("commandButton"),c=document.createTextNode(e.name),l.appendChild(c));var u=g||e.callback;if(u)e.onClick=u,l.addEventListener("click",function(){u.call(b.handler,
b)},!1)}f.nodeName.toLowerCase()==="ul"?(g=document.createElement("li"),f.appendChild(g),f=g):l.classList.add("commandMargins");f.appendChild(l);if(e.tooltip)l.commandTooltip=new j.Tooltip({node:l,text:e.tooltip,position:["above","below","right","left"]});d&&(m[e.id]={keyBinding:d,command:e,invocation:b});return l},createCommandMenuItem:function(a,f,e,b,c){var o,d=a.dropdown;if(f.hrefCallback)o=document.createElement("a"),o.appendChild(document.createTextNode(f.name)),c=f.hrefCallback.call(e.handler,
e),c.then?c.then(function(a){o.href=a}):o.href=c?c:"#";else{o=document.createElement("span");o.tabIndex=0;o.appendChild(document.createTextNode(f.name));var g=c||f.callback;if(g)f.onClick=g,o.addEventListener("click",function(){d.close(!0);g.call(e.handler,e)},!1)}if(f.tooltip)o.commandTooltip=new j.Tooltip({node:o,text:f.tooltip,position:["right","left","above","below"]});o.className="dropdownMenuItem";o.role="menuitem";c=document.createElement("li");a.appendChild(c);c.appendChild(o);b&&(m[f.id]=
{keyBinding:b,command:f,invocation:e});return o},setKeyBindingProvider:function(a){n=a},localKeyBindings:m,_testMethodProcessKey:e}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function i(d){var c="",b=navigator.platform.indexOf("Mac")!==-1;d.mod1&&(c+=b?"Cmd+":"Ctrl+");d.mod2&&(c+="Shift+");d.mod3&&(c+="Alt+");d.mod4&&b&&(c+="Ctrl+");if(d.alphaKey)return c+d.alphaKey;if(d.type==="keypress")return c+d.keyCode;for(var j in k.KEY)if(typeof(k.KEY[j]==="number")&&k.KEY[j]===d.keyCode)return c+j;var e;switch(d.keyCode){case 59:e=d.mod2?":":";";break;case 61:e=d.mod2?"+":"=";break;case 188:e=
d.mod2?"<":",";break;case 190:e=d.mod2?">":".";break;case 191:e=d.mod2?"?":"/";break;case 192:e=d.mod2?"~":"`";break;case 219:e=d.mod2?"{":"[";break;case 220:e=d.mod2?"|":"\\";break;case 221:e=d.mod2?"}":"]";break;case 222:e=d.mod2?'"':"'"}return e?c+e:d.keyCode>=112&&d.keyCode<=123?c+"F"+(d.keyCode-111):c+String.fromCharCode(d.keyCode)}function g(d){var c=window.navigator.platform.indexOf("Mac")!==-1;return c&&d.metaKey||!c&&d.ctrlKey}return{getUserKeyString:function(d){for(var c="",d=d.getKeys(),
b=0;b<d.length;b++)b!==0&&(c+=" "),c+=i(d[b]);return c},getUserText:function(d,c,b,j,e,a,f,g,n){var m=!1,f=function(f){return function(g){if(!m){var l=k.node(d),h=l.value;if(l)if(f&&g.keyCode===k.KEY.ESCAPE){if(b)c.style.display="inline";m=!0;l.parentNode.removeChild(l);a&&a()}else if(!(f&&g.keyCode!==k.KEY.ENTER)){if(h.length===0||!n&&h===j){if(b)c.style.display="inline"}else e(h);m=!0;l.parentNode&&l.parentNode.removeChild(l);a&&a()}}}},h=document.createElement("input");h.id=d;h.value=j||"";c.parentNode.insertBefore(h,
c.nextSibling);h.classList.add("userEditBoxPrompt");if(b)c.style.display="none";h.addEventListener("keydown",f(!0),!1);h.addEventListener("blur",f(!1),!1);window.setTimeout(function(){h.focus();if(j){var a=k.node(d),f=g?j.indexOf(g):-1;if(f>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",f),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,f);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=f}else a.select()}},
0)},openInNewWindow:g,followLink:function(d,c){c&&g(c)?window.open(d):window.location=d},createButton:function(d,c){var b=document.createElement("button");b.className="orionButton commandButton commandMargins";b.addEventListener("click",function(b){c();k.stop(b)},!1);d&&b.appendChild(document.createTextNode(d));return b},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(i){var i=i||window.location.toString(),g={resource:""},d=i.indexOf("#");if(d!==-1&&(i=i.substring(d+1),i.length!==0)){i=i.split(",");Object.defineProperty(g,"resourceRaw",{value:i[0]});g.resource=decodeURIComponent(i[0]);if(!g.resource.match(h))g.resource=encodeURI(g.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(d=1;d<i.length;d++){var c=
/([^=]*)(=?)(.*)/.exec(i[d]),b=decodeURIComponent(c[1]||""),c=decodeURIComponent(c[3]||"");b!==""&&b!=="resource"&&(g[b]=c)}}return g},validateURLScheme:function(h,g){var d=h;if(h.indexOf("://")===-1){var c=document.createElement("a");c.href=h;d=c.href}c=!1;return(c=g?g.some(function(b){return RegExp("^"+b+":","i").test(d)}):k.test(d))?h:(console.log("Illegal URL Scheme: '"+h+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function h(h,g){if(!k&&h)h.push({domNode:g}),g.tabIndex=-1,g.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,g,d){i&&(i=i.getGridNavHolder(g,!0))&&h(i,d)},generateNavGrid:h,removeNavGrid:function(h,g){if(h)for(var d=0;d<h.length;d++)if(h[d].domNode===g){h.splice(d,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,i,g,d,c,b,j,e,a,f){function l(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function n(a,f){this.token=a;this.parameterName=f}function m(a,f,e,b,c){this.name=a;this.type=f;this.label=e;this.value=b;this.lines=c||1}function q(a,f,e){this._storeParameters(a);this._hasOptionalParameters=f&&f.hasOptionalParameters;this._options=f;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=f&&f.clientCollect}l.prototype={_init:function(a){this._selectionService=a.selection;var f=this;k.setKeyBindingProvider(function(){return f._activeBindings})},processURL:function(a){for(var f in this._urlBindings)if(this._urlBindings[f]&&
this._urlBindings[f].urlBinding&&this._urlBindings[f].command){var e=this._urlBindings[f].urlBinding.match(a);if(e){var b=this._urlBindings[f],c=b.command,d=b.invocation;if(d&&d.parameters&&c.callback){d.parameters.setValue(e.parameterName,e.parameterValue);var j=this;window.setTimeout(function(){j._invoke(d)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,f,e,b){f?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(f):1)&&a.callback&&this._invoke(new k.CommandInvocation(e,
f,null,a,this),b):(f=this._urlBindings[a])&&f.command&&f.command.callback&&this._invoke(f.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,f,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,f,e))},confirm:function(a,f,e,b,c,d){var j=!1;if(this._parameterCollector&&!c){var g=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,c){var o=document.createElement("span");o.classList.add("parameterPrompt");o.textContent=f;a.appendChild(o);o=document.createElement("button");o.addEventListener("click",function(){j=!0;g._parameterCollector.close()},!1);c.appendChild(o);o.appendChild(document.createTextNode(e));o.className="dismissButton";var d=document.createElement("button");d.addEventListener("click",function(){j=!1;g._parameterCollector.close()},!1);c.appendChild(d);d.appendChild(document.createTextNode(b));d.className=
"dismissButton";return o},function(){d(j)}))return}j=window.confirm(f);d(j)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,f){return this._collectAndInvoke(a.makeCopy(f),!1)},_collectAndInvoke:function(f,e){if(f)if(this._parameterCollector&&f.parameters&&f.parameters.hasParameters()&&(e||f.parameters.shouldCollectParameters())){var b=!1;f.parameters.updateParameters(f);
if(f.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(f),!b)){var c=new a.Tooltip({node:f.domNode,trigger:"click",position:["below","right","above","left"]}),b=c.contentContainer();b.classList.add("parameterPopup");var o=window.document.activeElement,d=this._parameterCollector.getFillFunction(f,function(){o&&o.focus();c.destroy()})(b);c.show();window.setTimeout(function(){d.focus();d.select()},0);b=!0}b||f.command.callback.call(f.handler||window,f)}else f.command.callback.call(f.handler||
window,f);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 f(a){var e=a.invocation;if(e)if(a=a.command,a.hrefCallback)e=a.hrefCallback.call(e.handler||window,e),e.then?e.then(function(a){window.open(a)}):window.open(e);else if(a.onClick||a.callback)(a.onClick||a.callback).call(e.handler||window,e)}function e(a){return function(){f(a)}}var b=
{},c,d,j=[],g;for(g in this._activeBindings)(d=this._activeBindings[g])&&d.keyBinding&&d.command&&j.push(d);j.sort(function(a,f){return a.command.name.localeCompare(f.command.name)});for(g=0;g<j.length;g++)d=j[g],d.keyBinding.scopeName?(b[d.keyBinding.scopeName]||(b[d.keyBinding.scopeName]=[]),b[d.keyBinding.scopeName].push(d)):(c=i.getUserKeyString(d.keyBinding),a.createItem(c,d.command.name,e(d)));for(var l in b)b[l].length&&b[l].length>0&&(a.createHeader(l),b[l].forEach(function(f){c=i.getUserKeyString(f.keyBinding);
a.createItem(c,f.command.name,e(f))}))},addCommand:function(a){this._commandList[a.id]=a;var f=this._pendingBindings[a.id];if(f){var e=this;f.forEach(function(f){e._addBinding(a,f.type,f.binding,f.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,f,e,b,c,d,j,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];c&&(a=this._createEntryForPath(a,c));if(a[f]){if(b)a[f].title=b;if(e)a[f].position=e;if(j)a[f].imageClass=
j;if(g)a[f].tooltip=g;a[f].emptyGroupMessage=d}else a[f]={title:b,position:e,emptyGroupMessage:d,imageClass:j,tooltip:g,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,f){f&&f.split("/").forEach(function(f){if(f.length>1)a[f]||(a[f]={position:0,children:{}}),a=a[f].children});return a},registerSelectionService:function(a,f){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=f},registerCommandContribution:function(a,
f,e,b,c,d,j){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[f]={position:e};d&&((e=this._commandList[f])?this._addBinding(e,"key",d,c):this._addPendingBinding(f,"key",d,c));j&&((e=this._commandList[f])?this._addBinding(e,"url",j,c):this._addPendingBinding(f,"url",j,c));a.sortedContributions=null},_addBinding:function(a,f,e,b){if(!a.id)throw Error("No command id: "+a);f==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:e,bindingOnly:b}:f==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:b})},_addPendingBinding:function(a,f,e,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:f,binding:e,bindingOnly:b})},_checkForTrailingSeparator:function(a,f,e){var b;if(f==="tool"||f==="button")if((b=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&b.classList.contains("commandSeparator"))return e?(a.removeChild(b),!1):!0;if(f===
"menu"&&(a=d.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(b=a[a.length-1],e)b.parentNode.parentNode.removeChild(b.parentNode);else return!0;return!1},renderCommands:function(a,f,e,b,c,j,g){if(typeof a!=="string")throw"a scope id for rendering must be specified";f=d.node(f);if(!f)throw"no parent";var l=this._contributionsByScopeId[a];if(!e&&l){var e=l.localSelectionService||this._selectionService,n=this;e&&e.getSelections(function(e){n.renderCommands(a,
f,e,b,c,j)})}else l&&(this._render(this._contributionsByScopeId[a],f,e,b,c||"button",j,g),this._checkForTrailingSeparator(f,c,!0))},destroy:function(a){a=d.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var f=a.firstChild;f.commandTooltip&&f.commandTooltip.destroy();f.emptyGroupTooltip&&f.emptyGroupTooltip.destroy();this.destroy(f);a.removeChild(f)}},_render:function(e,b,c,d,o,j,g){var l=e.sortedContributions;if(!l){var l=[],n=!1,m;for(m in e)if(!e.hasOwnProperty||e.hasOwnProperty(m)){var h=
e[m];if(h&&typeof h.position==="number")h.id=m,l.push(h),n=!0}if(n)l.sort(function(a,f){return a.position-f.position}),e.sortedContributions=l}var i=0,q=this;l.forEach(function(e){var l,u;if(!e.imageClass)e.imageClass=null;if(e.children&&Object.getOwnPropertyNames(e.children).length>0){l=e.children;var n;if(o==="tool"||o==="button")if(e.title)n=q._createDropdownMenu(b,e.title,null,null,e.imageClass,e.tooltip),g&&f.generateNavGrid(g,n.menuButton),window.setTimeout(function(){q._render(e.children,n.menu,
c,d,"menu",j,g);q._checkForTrailingSeparator(n.menu,"menu",!0);if(n.menu.childNodes.length===0)if(e.emptyGroupMessage){if(!n.menuButton.emptyGroupTooltip)n.menuButton.emptyGroupTooltip=new a.Tooltip({node:n.menuButton,text:e.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else g&&f.removeNavGrid(g,n.menuButton),n.menu.parentNode&&n.menu.parentNode.removeChild(n.menu),n.destroyButton&&n.destroyButton.parentNode&&n.destroyButton.parentNode.removeChild(n.destroyButton);
else n.menuButton.style.visibility="visible"},0);else{var m;b.childNodes.length>0&&!q._checkForTrailingSeparator(b,o)&&(m=q.generateSeparatorImage(b));q._render(l,b,c,d,o,j,g);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==m&&(m=q.generateSeparatorImage(b))}else if(e.title){if(m=q._createDropdownMenu(b,e.title,!0,null,null,e.imageClass))q._render(l,m.menu,c,d,"menu",j,g),m.menu.childNodes.length===0&&m.destroyButton&&b.removeChild(m.destroyButton)}else b.childNodes.length>0&&q._generateMenuSeparator(b),
q._render(l,b,c,d,o,j,g),q._generateMenuSeparator(b)}else{var h=q._commandList[e.id];l=h?!0:!1;var w=null,w=null;if(h){u=new k.CommandInvocation(d,c,j,h,q);u.domParent=b;m=l&&(h.visibleWhen?h.visibleWhen(c):!0);if(q._activeBindings[h.id]&&q._activeBindings[h.id].keyBinding)w=q._activeBindings[h.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);if(q._urlBindings[h.id]&&q._urlBindings[h.id].urlBinding)w=q._urlBindings[h.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);l=l&&m}if(l)h.choiceCallback?(o===
"tool"||o==="button"?(l=b,m=!1,b.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),b.appendChild(l))):(l=b,m=!0),q._createDropdownMenu(l,h.name,m,function(a){h.populateChoicesMenu(a,c,d,j,q)}.bind(h),h.imageClass,h.tooltip||h.title)):(u.handler=u.handler||this,u.domParent=b,m=function(){q._invoke(u)},o==="menu"?l=k.createCommandMenuItem(b,h,u,null,m):(l=o+h.id+i,l=k.createCommandItem(b,h,u,l,null,o==="tool",m)),f.generateNavGrid(g,l),u.domNode=l,i++)}})},_createDropdownMenu:function(f,
e,b,g,o,l){f=d.node(f);if(!f||!d.contains(document.body,f))return null;var n,u=f;if(b)l=document.createRange(),l.selectNode(f),l=l.createContextualFragment(j),d.processTextNodes(l,{ButtonText:e}),f.appendChild(l),n=f.lastChild,f=n.lastChild,e=f.previousSibling,e.dropdown=new c.Dropdown({dropdown:f,populate:g}),f.dropdown=e.dropdown;else if(f.nodeName.toLowerCase()==="ul"&&(u=document.createElement("li"),f.appendChild(u),n=u),f=null,o&&(f="dropdownButtonWithIcon",l=l||e),l=o?l||e:l,g=k.createDropdownMenu(u,
e,g,f,o),e=g.menuButton,f=g.menu,l)e.commandTooltip=new a.Tooltip({node:e,text:l,position:["above","below","right","left"]});return{menuButton:e,menu:f,dropdown:e.dropdown,destroyButton:n}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var f=document.createElement("li");f.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");f.appendChild(e);a.appendChild(f)}},generateSeparatorImage:function(a){var f;f=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(f);f.classList.add("core-sprite-sep");f.classList.add("imageSprite");f.classList.add("commandSeparator");return f}};l.prototype.constructor=l;n.prototype={match:function(a){a=g.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};n.prototype.constructor=n;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;q.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var f=this.parameterTable={};a.forEach(function(a){f[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,f){var e=this.parameterTable[a];if(e)e.value=f},forEach:function(a){for(var f in this.parameterTable)this.parameterTable[f].type&&this.parameterTable[f].name&&a(this.parameterTable[f])},makeCopy:function(){var a=[];this.forEach(function(f){f=new m(f.name,f.type,f.label,f.value,f.lines);a.push(f)});var f=new q(a,this._options,this.getParameters);f.clientCollect=this.clientCollect;return f},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=
q;return{CommandRegistry:l,URLBinding:n,ParametersDescription:q,CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(h,k,i){function g(d,c){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=c}g.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.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(d,c,b){typeof d==="string"&&(d=i.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var j=c(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!j)return!1;this._activeElements.focusNode=j;d=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(d.length===0){c=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=h.Close;c.appendChild(d);var e=this;d.addEventListener("click",function(){e.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(d,c){i.$$array("input",c).forEach(function(b){b.type==="checkbox"?d.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&d.parameters.setValue(b.parameterName,b.value.trim())});i.$$array("textArea",c).forEach(function(b){d.parameters.setValue(b.parameterName,b.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,c){var b=this;return function(j,e){var a=null,f=function(){c&&c();b.close()},g=function(a){a.keyCode===i.KEY.ENTER&&b._collectAndCall(d,j);if(a.keyCode===i.KEY.ESCAPE||a.keyCode===i.KEY.ENTER)f(),i.stop(a)};d.parameters.forEach(function(e){var b=null;if(e.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",e.name+
"parameterCollector"),b.textContent=e.label,j.appendChild(b);var c=e.name+"parameterCollector",d=b||j;if(e.type==="text"&&typeof e.lines==="number"&&e.lines>1)b=document.createElement("textarea"),b.rows=e.lines,b.type="textarea",b.id=c,d.appendChild(b),g=function(a){a.keyCode===i.KEY.ESCAPE&&(f(),i.stop(a))};else if(e.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=c,d.appendChild(b),e.value)b.checked=!0}else if(b=document.createElement("input"),b.type=e.type,b.id=c,
d.appendChild(b),e.value)b.value=e.value;b.classList.add("parameterInput");b.setAttribute("speech","speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=e.name;a||(a=b);b.addEventListener("keydown",g,!1)});var n=e;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",j.appendChild(n);var m=function(a,f){var e=document.createElement("button");f.appendChild(e);a&&e.appendChild(document.createTextNode(a));e.classList.add("dismissButton");return e};
if(d.parameters.hasOptionalParameters())d.parameters.optionsRequested=!1,m(h.More,n).addEventListener("click",function(){d.parameters.optionsRequested=!0;b._collectAndCall(d,j);f()},!1);m(h.Submit,n).addEventListener("click",function(){b._collectAndCall(d,j);f()},!1);n=m(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=h.Close;n.addEventListener("click",function(){f()},!1);return a}}};g.prototype.constructor=g;return{CommandParameterCollector:g}});
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(c,b){function d(a,f,e,b){var e=f.filename.indexOf(e)>=0,c=f.extension.indexOf(b)>=0;if(e||c)if(!a||e&&a.extension.indexOf(b)>=0)return f;return a}for(var e=c&&c.split(".").pop(),a=null,f=0;f<b.length;f++){var g=b[f];d(a,g,c,e)===g&&(a=g)}return a}function k(c){this.serviceRegistry=c;this.map=function(b){function c(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var b=b.getServiceReferences(g).concat(b.getServiceReferences(d)),
e={},a=0;a<b.length;a++)for(var f=c(b[a].getProperty("contentTypes")),l=0;l<f.length;l++){var n=f[l];e[n.id]||(e[n.id]={id:n.id,name:n.name,image:n.image,"extends":n["extends"],extension:c(n.extension),filename:c(n.filename)})}return e}(c);c.registerService(i,this)}var i="orion.core.contenttypes",g="orion.core.contenttype",d="orion.file.contenttype";k.prototype={getContentTypes:function(){var c=this.getContentTypesMap(),b=[],d;for(d in c)c.hasOwnProperty(d)&&b.push(c[d]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(c){return h(c.Name,this.getContentTypes())},getFilenameContentType:function(c){return h(c,this.getContentTypes())},getContentType:function(c){return this.map[c]||null},isExtensionOf:function(c,b){c=typeof c==="string"?this.getContentType(c):c;b=typeof b==="string"?this.getContentType(b):b;if(!c||!b)return!1;if(c.id===b.id)return!0;else for(var d=c,e={};d&&(d=this.getContentType(d["extends"]));){if(d.id===b.id)return!0;if(e[d.id])throw Error("Cycle: "+d.id);e[d.id]=!0}return!1},
isSomeExtensionOf:function(c,b){for(var d=0;d<b.length;d++)if(this.isExtensionOf(c,b[d]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:h}});
define("orion/URITemplate",[],function(){function h(e){this._text=e}function k(e,a){if(a==="U")return encodeURIComponent(e).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]");if(a==="U+R-,")return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function i(e,a,f){for(var b=[],c=0;c<e.length;c++)typeof e[c]!=="undefined"&&
b.push(k(e[c],a));return b.join(f)}function g(e,a,f,b){for(var c=Object.keys(e),d=[],j=0;j<c.length;j++)typeof e[c[j]]!=="undefined"&&d.push(k(c[j],a)+f+k(e[c[j]],a));return d.join(b)}function d(e){if(e.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=b[e[0]])?e=e.substring(1):this._operator=b.NUL;for(var a=[],f=e.split(","),c=0;c<f.length;c++){var d=f[c].match(j);if(d===null)throw Error("Bad VarSpec: "+e);a.push({name:d[1],explode:!!d[2],prefix:d[3]?parseInt(d[3],
10):-1})}this._varSpecList=a}function c(e){for(var a=[],f=0,b=e.indexOf("{",f);b!==-1;){a.push(new h(e.substring(f,b)));f=e.indexOf("}",b+1);if(f===-1)throw Error("Invalid template: "+e);a.push(new d(e.substring(b+1,f)));f+=1;b=e.indexOf("{",f)}a.push(new h(e.substring(f)));this._templateComponents=a}var b={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},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)}};d.prototype={expand:function(e){for(var a=[],f=
0;f<this._varSpecList.length;f++){var b=this._varSpecList[f],c=b.name,d=e[c],j=typeof d;if(j!=="undefined"&&d!==null){var h=a.length===0?this._operator.first:this._operator.sep;if(j==="string")this._operator.named&&(h+=k(c,"U+R"),h+=d.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<d.length&&(d=d.substring(0,b.prefix)),h+=k(d,this._operator.allow);else if(Array.isArray(d))b.explode?h+=i(d,this._operator.allow,this._operator.sep):(this._operator.named&&(h+=k(c,"U+R"),h+=d.length===0?this._operator.ifemp:
"="),h+=i(d,this._operator.allow,","));else if(j==="object")b.explode?h+=g(d,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(h+=k(c,"U+R"),h+=Object.keys(d).length===0?this._operator.ifemp:"="),h+=g(d,this._operator.allow,",",","));else throw Error("bad param type: "+c+" : "+j);a.push(h)}}return a.join("")}};c.prototype={expand:function(e){for(var a=[],f=0;f<this._templateComponents.length;f++)a.push(this._templateComponents[f].expand(e));return a.join("")}};return c});
define("orion/i18nUtil",["require","orion/Deferred"],function(h,k){function i(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var g={};return{getMessageBundle:function(d){function c(){h(["i18n!"+d],function(a){if(a){var f=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+f,JSON.stringify(a));delete a._expires}b.resolve(a)})}if(g[d])return g[d];var b=new k;g[d]=
b;var j=i(d);if(j)return b.resolve(j),b;try{h([d],c)}catch(e){h(["orion/i18n!"+d],c)}return b},formatMessage:function(d){var c=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(b,d){return c[(d<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(h,k,i,g,d){function c(){return(new URL(h.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function b(b,e){var a=b.getServiceReferences(e||"orion.page.link"),f=i.matchResourceParameters(window.location.href),l={OrionHome:c(),Location:f.resource},n=[];a.forEach(function(a){var f={};a.getPropertyKeys().forEach(function(e){f[e]=a.getProperty(e)});if(f.uriTemplate&&
f.nls&&(f.name||f.nameKey)){var e=new k;d.getMessageBundle(f.nls).then(function(a){var b=new g(f.uriTemplate),b=window.decodeURIComponent(b.expand(l)),b=i.validateURLScheme(b);f.href=b;f.textContent=f.nameKey?a[f.nameKey]:f.name;e.resolve(f)});n.push(e)}else if(f.uriTemplate&&f.name){var b=new g(f.uriTemplate),b=window.decodeURIComponent(b.expand(l)),b=i.validateURLScheme(b);f.href=b;f.textContent=f.name;n.push((new k).resolve(f))}});return k.all(n)}return{createPageLinks:function(c,e){return b(c,
e).then(function(a){a.sort(function(a,e){var b=a.textContent&&a.textContent.toLowerCase(),c=e.textContent&&e.textContent.toLowerCase();return b<c?-1:b>c?1:0});return a.map(function(a){var e=a.href,a=a.textContent,b=document.createElement("a");b.href=e;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})})},getPageLinksInfo:b,getOrionHome:c}});
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,i,g,d,c,b,j,e){var a={},f=e.getOrionHome();a._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var f=a.constructor(),e;for(e in a)e!=="children"&&e!=="Children"&&(f[e]=m(a[e]));return f};a._getOpenWithNavCommandExtensions=function(a){function f(a,e){for(var b=a.getServiceReferences("orion.navigate.openWith"),
c=[],d=0;d<b.length;d++){var o=b[d];o.getProperty("editor")===e.id&&(o=o.getProperty("contentType"),o instanceof Array?c=c.concat(o):o!==null&&typeof o!=="undefined"&&c.push(o))}return c}for(var e=function(){for(var f=a.getServiceReferences("orion.edit.editor"),e=[],b=0;b<f.length;b++){var c=f[b],d=c.getProperty("id");e.push({id:d,name:c.getProperty("name"),nameKey:c.getProperty("nameKey"),nls:c.getProperty("nls"),uriTemplate:c.getProperty("orionTemplate")||c.getProperty("uriTemplate")})}return e}(),
b=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),c=[],d=0;d<e.length;d++){var o=e[d],j=b&&b.editor===o.id,g=f(a,o);g.length&&c.push({properties:{name:o.name||o.id,nameKey:o.nameKey,id:"eclipse.openWithCommand."+o.id,tooltip:o.name,tooltipKey:o.nameKey,contentType:g,uriTemplate:o.uriTemplate,nls:o.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return c};a._makeValidator=function(a,
e,b,j){function g(a,f,e,b){var c=e.match,d;if(f.indexOf("|")>=0)return d=f.substring(0,f.indexOf("|")),f=f.substring(f.indexOf("|")+1),g(a,d,e,b)?!0:g(a,f,e,b);else if(f.indexOf(":")>=0)return d=f.substring(0,f.indexOf(":")),f=f.substring(f.indexOf(":")+1),a[d]?g(a[d],f,e,b):!1;else{a:{d=!1;var j;if(typeof a[f]!=="undefined"){if(typeof c==="undefined")j=a[f],d=!0;else if(typeof c==="string"){if(!typeof(a[f]==="string")){e=!1;break a}if(e.variableName){if(c=RegExp(c).exec(a[f]))d=c[0],j=e.variableMatchPosition===
"before"?a[f].substring(0,c.index):e.variableMatchPosition==="after"?a[f].substring(c.index+d.length):e.variableMatchPosition==="only"?d:a[f],d=!0}else{e=RegExp(c).test(a[f]);break a}}else a[f]===c&&(j=a[f],d=!0);if(d&&e.variableName&&(b[e.variableName]=j,b.itemCached=a,e.replacements))for(a=0;a<e.replacements.length;a++)f=!1,e.replacements[a].pattern?b[e.variableName]=b[e.variableName].replace(RegExp(e.replacements[a].pattern),e.replacements[a].replacement||""):f=!0,f&&window.console.log("Invalid replacements specified in validation property.  "+
e.replacements[a]);e=d}else e=!1}return e}}return{info:a,validationFunction:function(f){typeof j==="function"&&(f=j.call(this,f));if(f){if(Array.isArray(f)){if((this.info.forceSingleItem||this.info.uriTemplate)&&f.length!==1)return!1;if(f.length<1)return!1}else f=[f];for(var e=0;e<f.length;e++){var c;a:{var l=f[e],u=b;if(this.info.validationProperties)for(c=0;c<this.info.validationProperties.length;c++){var h=this.info.validationProperties[c];if(typeof h.source!=="undefined"){if(!g(l,h.source,h,this)){c=
!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");c=!1;break a}}if(this.info.contentType&&u){h=!1;if(l=d.getFilenameContentType(l.Name,u))for(c=0;c<this.info.contentType.length;c++)if(l.id===this.info.contentType[c]){h=!0;break}c=h}else c=!0}if(!c)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var e={},b;for(b in a)a.hasOwnProperty(b)&&(e[b]=a[b]);if(this.info.validationProperties)for(b=
0;b<this.info.validationProperties.length;b++){var d=this.info.validationProperties[b];d.source&&d.variableName&&(this.itemCached===a&&this[d.variableName]||g(a,d.source,d,this),a[d.variableName]?window.console.log("Variable name "+d.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):e[d.variableName]=this[d.variableName])}e.OrionHome=f;a=new c(this.info.uriTemplate);return window.decodeURIComponent(a.expand(e))}return null}}};a._createCommandOptions=
function(f,e,c,d,j,g){function o(b,o){var l=a._makeValidator(f,c,d,g);b.visibleWhen=l.validationFunction.bind(l);if(j)if(l.generatesURI.bind(l)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return l.getURI.bind(l)(a)};else{var v=f;b.callback=function(f){var d;if(v.forceSingleItem)f=Array.isArray(f.items)?f.items[0]:f.items,d=a._cloneItemWithoutChildren(f);else if(Array.isArray(f.items)){d=[];for(var o=0;o<f.items.length;o++)d.push(a._cloneItemWithoutChildren(f.items[o]))}else d=
a._cloneItemWithoutChildren(f.items);if(c)var j=c.getService("orion.page.progress");e.run?j?j.progress(e.run(d),"Running command: "+b.name):e.run(d):c&&(j?j.progress(c.getService(e).run(d),"Running command: "+b.name):c.getService(e).run(d))}}o.resolve(b)}var l=new k;f.nls?b.getMessageBundle(f.nls).then(function(a){o({name:f.nameKey?a[f.nameKey]:f.name,image:f.image,id:f.id||f.name,tooltip:f.tooltipKey?a[f.tooltipKey]:f.tooltip,isEditor:f.isEditor,showGlobally:f.showGlobally},l)}):o({name:f.name,image:f.image,
id:f.id||f.name,tooltip:f.tooltip,isEditor:f.isEditor,showGlobally:f.showGlobally},l);return l};a.getOpenWithCommands=function(a){var f=[],e;for(e in a._commandList){var b=a._commandList[e];b.isEditor&&f.push(b)}return f};var l;a.createAndPlaceFileCommandsExtension=function(f,e,b,c,d,j){var o=!!j;return a.createFileCommands(f,null,j?"all":void 0,o).then(function(a){e._addedOpenWithCommands=o;var f=!1,j=!1;a.forEach(function(a){e.addCommand(a);d&&!f&&(f=!0,e.addCommandGroup(b,"eclipse.fileCommandExtensions",
1E3,null,d));d&&!j&&(j=!0,e.addCommandGroup(b,"eclipse.openWith",1E3,"Open With",d+"/eclipse.fileCommandExtensions"));this.isEditor?e.registerCommandContribution(b,a.id,c+this.index,d?d+"/eclipse.fileCommandExtensions/eclipse.openWith":null):e.registerCommandContribution(b,a.id,c+this.index,d?d+"/eclipse.fileCommandExtensions":null)});return{}})};a.createFileCommands=function(f,e,b,c){var b=b===void 0?"global":b,c=c===void 0?!0:c,d=f.getServiceReferences("orion.navigate.command"),j=[];if(b==="all"||
b==="global")for(var o=0;o<d.length;o++)if(d[o].getProperty("id")!=="orion.navigateFromMetadata"){for(var g=f.getService(d[o]),h={},u=d[o].getPropertyKeys(),w=0;w<u.length;w++)h[u[w]]=d[o].getProperty(u[w]);(b==="all"||h.forceSingleItem&&h.showGlobally)&&j.push({properties:h,service:g})}return k.when(function(){var a=f.getService("orion.core.contenttypes")||e;return l||k.when(a.getContentTypes(),function(a){return l=a})}(),function(){j=c?j.concat(a._getOpenWithNavCommandExtensions(f,l)):j;var e=j.map(function(e){var b=
e.properties;return a._createCommandOptions(b,e.service,f,l,!0).then(function(a){a=new i.Command(a);if(b.isEditor)a.isEditor=b.isEditor;return a})});return k.all(e,function(a){return{_error:a}}).then(function(a){return a})})};a.createOpenWithCommands=function(f,e,b){return b&&b._addedOpenWithCommands?(new k).resolve(a.getOpenWithCommands(b)):a.createFileCommands(f,e,"none",!0)};return a});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(h,k){function i(g){this._init(g)}i.prototype={_init:function(g){var d=k.node(g.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=g.id||"eclipse.breadcrumbs";this._resource=g.resource||null;this._rootSegmentName=g.rootSegmentName;this._workspaceRootSegmentName=g.workspaceRootSegmentName;this._workspaceRootURL=g.workspaceRootURL;this._makeHref=g.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var g;if(this._resource&&this._resource.Parents){g=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(g,d):g.href=h.toUrl("navigate/table.html")+"#"+d}else g=document.createElement("span");k.empty(g);g.appendChild(document.createTextNode(this._workspaceRootSegmentName));return g}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(g){var d=document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(g));return d},addSegmentHref:function(g,d){this._makeHref?this._makeHref(g,d.Location,d):g.href=h.toUrl("navigate/table.html")+"#"+d.ChildrenLocation},buildSegments:function(g,d){if(this._resource.Parents){var c=this._resource.Parents.slice(0),b,j;c&&(c=c.slice(0),d==="reverse"&&(c=c.reverse().slice(0)),c.forEach(function(e){g?(j=g,g=null):j=e.Name;b=this.buildSegment(j);
this.path+=e.Name;this.addSegmentHref(b,e);b.include=!1;this.segments.push(b)}.bind(this)))}},addDivider:function(){var g=document.createElement("span");g.appendChild(document.createTextNode(" / "));this.path+="/";g.classList.add("breadcrumbSeparator");this.append(g)},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(g){this.crumbs.appendChild(g)},addTitle:function(g,d){var c=d||document.title;this.crumbs.childNodes.length===0&&(g=document.createElement("span"),g.appendChild(document.createTextNode(c)),g.classList.add("breadcrumb"),g.classList.add("currentLocation"),
this.append(g))},finalSegment:function(g,d){g=document.createElement("span");d?g.appendChild(document.createTextNode(d)):g.appendChild(document.createTextNode(this._resource.Name));g.classList.add("currentLocation");this.path+=this._resource.Name;this.append(g)},firstSegment:function(g){if(g)this.append(g),this._resource&&this._resource.Parents?(g.classList.add("breadcrumb"),this.addDivider()):(g.href="",g.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(g){g.include===
!0&&(this.append(g),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var g=this.segments.slice(0).reverse();g.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=g.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var g=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;
if(d)this.addTitle(g,d);else if(this.finalSegment(g,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(g)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var g=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(g,d):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(g),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(g,
d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(h,k){function i(g){this._init(g)}i.prototype={_init:function(g){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(g.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(g.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(g.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=g.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(g.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=g.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(g){this._resizeListeners.push(g)},_initializeFromStoredSettings:function(){var g=localStorage.getItem(this._prefix+"/toggleState");this._closed=g?g==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(g=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(g,10);else{if(this._closeByDefault)this._splitTop=150}else if(g=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(g,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(g){var d=k.bounds(this.$node),c=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(g||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);g=this._splitTop;this.$node.parentNode.style.position==="relative"&&(g=this._splitTop-c.top);this.$sideNode.style.height=g+"px";this.$sideNode.style.bottom=g-1+"px";this.$sideNode.style.display="block";this.$node.style.top=g+"px"}else{this._splitWidth=d.width;if(g||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);g=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(g=this._splitLeft-c.left);this.$sideNode.style.width=
g+"px";this.$sideNode.style.right=g-1+"px";this.$sideNode.style.display="block";this.$node.style.left=g+"px"}this._resize()},_resize:function(g){var g=g||0,d=k.bounds(this.$node.parentNode),c=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=d.height-(c.top-d.top+c.height)+"px":this.$mainNode.style.width=d.width-(c.left-d.left+c.width)+"px";var b=this;window.setTimeout(function(){b._notifyResizeListeners(b.$mainNode)},g);window.setTimeout(function(){b._notifyResizeListeners(b.$sideNode)},
g)},_notifyResizeListeners:function(g){for(var d=0;d<this._resizeListeners.length;d++)this._resizeListeners[d](g)},_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 g=this;window.setTimeout(function(){g.$sideNode.classList.remove("sidePanelLayoutAnimation");g.$mainNode.classList.remove("mainPanelLayoutAnimation");g.$node.classList.remove("splitLayoutAnimation");g._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(g){if(g.target===this._thumb)return k.stop(g),this._thumbDown(g);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(g)},_mouseMove:function(g){if(this._tracking){var d=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=g.clientY;if(this._splitTop<d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var c=this._splitTop;this.$node.parentNode.style.position==="relative"&&(c=this._splitTop-d.top);this.$node.style.top=c+"px"}else{this._splitLeft=g.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>d.left+d.width-
5)this._splitLeft=d.left+d.width-5;c=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(c=this._splitLeft-d.left);this.$node.style.left=c+"px"}this._adjustToSplitPosition(!0);k.stop(g)}},_mouseUp:function(g){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(g)}};i.prototype.constructor=i;return{Splitter:i}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(h){return{makeRelative:function(h){if(!h)return h;var i=window.location.protocol+"//"+window.location.host;return h.indexOf(i)===0?h.substring(i.length):h},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var i=new URL(h.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(i.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(h,k,i){function g(d){this._favorites=[];i.attach(this);this._init(d);this._initializeFavorites()}g.prototype={_init:function(d){this._registry=d.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(d){for(var d=Array.isArray(d)?
d:[d],c=0;c<d.length;c++){var b=d[c],j=b.ChildrenLocation?b.ChildrenLocation:b.Location,j=k.makeRelative(j);this.addFavorite(b.Name,j,b.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(d){this.addFavorite(d,d,!1,!0)},addFavorite:function(d,c,b){this._favorites.push({name:d,path:c,directory:b,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(d){for(var c in this._favorites)if(this._favorites[c].path===
d){this._favorites.splice(c,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(d,c){var b=!1,j;for(j in this._favorites)if(this._favorites[j].path===d){var e=this._favorites[j];if(e.name!==c)e.name=c,b=!0}b&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(d){for(var c in this._favorites)if(this._favorites[c].path===d)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(d){var c;
if(!d)return this._favorites;var b="";for(c=0;c<d.length;c++){var j=d.charAt(c);b+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}b+=".*";d=RegExp(b);b=[];for(c in this._favorites)this._favorites[c].name.search(d)===0&&b.push(this._favorites[c]);return b},_initializeFavorites:function(){var d=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var b,c=c.get("navigate");typeof c==="string"&&(c=JSON.parse(c));if(c)for(b in c)c[b].isFavorite=
!0,d._favorites.push(c[b]);d._favorites.sort(d._sorter);d._notifyListeners()})},_storeFavorites:function(){var d=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("navigate",d)})},_sorter:function(d,c){var b=d.name.toLowerCase(),j=c.name.toLowerCase();return b>j?1:b<j?-1:0},getFavorites:function(){return{navigator:this._favorites}}};g.prototype.constructor=g;return{FavoritesService:g}});
define("orion/widgets/themes/ThemePreferences",[],function(){function h(h,i){this._preferences=h;this._themeData=i;var g=i.getThemeStorageInfo(),d=h.listenForChangedSettings(g.storage,2,function(c){c.key===d&&this.apply()}.bind(this))}h.prototype={_initialize:function(h,i,g){var d=g.get(h.styleset);d||(d=i.getStyles(),g.put(h.styleset,JSON.stringify(d)));(i=g.get("selected"))&&(i=JSON.parse(i));if(!i||i[h.selectedKey]===void 0)i=i||{},i[h.selectedKey]=h.defaultTheme,g.put("selected",JSON.stringify(i))},
apply:function(){this.setTheme()},getTheme:function(h){var i=this._themeData,g=i.getThemeStorageInfo();this._preferences.getPreferences(g.storage,2).then(function(d){this._initialize(g,i,d);var c=JSON.parse(d.get("selected")),d=JSON.parse(d.get(g.styleset)),b;if(d)for(var j=0;j<d.length;j++)if(d[j].name===c[g.selectedKey]){b=d[j];break}h({style:b,styles:d})}.bind(this))},setTheme:function(h,i){var g=this._themeData,d=g.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,
g,c);var b=JSON.parse(c.get("selected"));h||(h=b[d.selectedKey]);b[d.selectedKey]=h;c.put("selected",JSON.stringify(b));i?c.put(d.styleset,JSON.stringify(i)):i=JSON.parse(c.get(d.styleset));for(c=0;c<i.length;c++)if(i[c].name===b[d.selectedKey]){g.processSettings(i[c]);break}}.bind(this))},setFontSize:function(h){var i=this._themeData,g=i.getThemeStorageInfo();this._preferences.getPreferences(g.storage,2).then(function(d){this._initialize(g,i,d);var c=JSON.parse(d.get("selected")),b=JSON.parse(d.get(g.styleset)),
j;if(b)for(var e=0;e<b.length;e++)b[e].fontSize=h,b[e].name===c[g.selectedKey]&&(j=b[e]);d.put(g.styleset,JSON.stringify(b));i.processSettings(j)}.bind(this))}};return{ThemePreferences:h}});
define("orion/editor/eventTarget",[],function(){function h(){}h.addMixin=function(k){var i=h.prototype,g;for(g in i)i.hasOwnProperty(g)&&(k[g]=i[g])};h.prototype={addEventListener:function(h,i,g){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[h];d||(d=this._eventTypes[h]={level:0,listeners:[]});d.listeners.push({listener:i,useCapture:g})},dispatchEvent:function(h){var i=h.type;this._dispatchEvent("pre"+i,h);this._dispatchEvent(i,h);this._dispatchEvent("post"+i,h)},_dispatchEvent:function(h,
i){var g=this._eventTypes?this._eventTypes[h]:null;if(g){var d=g.listeners;try{if(g.level++,d)for(var c=0,b=d.length;c<b;c++)if(d[c]){var j=d[c].listener;typeof j==="function"?j.call(this,i):j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(i)}}finally{if(g.level--,g.compact&&g.level===0){for(c=d.length-1;c>=0;c--)d[c]||d.splice(c,1);d.length===0&&delete this._eventTypes[h];g.compact=!1}}}},isListening:function(h){return!this._eventTypes?!1:this._eventTypes[h]!==void 0},removeEventListener:function(h,
i,g){if(this._eventTypes){var d=this._eventTypes[h];if(d){for(var c=d.listeners,b=0,j=c.length;b<j;b++){var e=c[b];if(e&&e.listener===i&&e.useCapture===g){d.level!==0?(c[b]=null,d.compact=!0):c.splice(b,1);break}}c.length===0&&delete this._eventTypes[h]}}}};return{EventTarget:h}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(h,k,i){function g(c){c=c||{};this._document=c.document||document}var d={};g.getTheme=function(c){var c=c||"default",b=d[c];b||(b=d[c]=new g);return b};g.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,b){var d=this,e=d._themeClass;d._themeClass=c;this._load(c,b,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:e,newValue:d.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,b){function d(a,f,b){f&&(e.push("."+c+" ."+a+" {"),e.push("\t"+(b?"background-color":"color")+": "+f+";"),e.push("}"))}var e=[];e.push("");e.push("."+c+" {");b.fontFamily&&e.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&e.push("\tfont-size: "+b.fontSize+";");b.fontSize&&e.push("\tcolor: "+b.text+";");e.push("}");e.push("."+c+".textview {");b.background&&e.push("\tbackground-color: "+b.background+";");e.push("}");d("ruler.annotations",b.annotationRuler,!0);d("ruler.lines",
b.annotationRuler,!0);d("ruler.folding",b.annotationRuler,!0);d("ruler.overview",b.overviewRuler,!0);d("rulerLines",b.lineNumber,!1);d("rulerLines.even",b.lineNumberEven,!1);d("rulerLines.odd",b.lineNumberOdd,!1);d("annotationLine.currentLine",b.currentLine,!0);d("entity-name-tag",b.keyword,!1);d("entity-other-attribute-name",b.attribute,!1);d("string-quoted",b.string,!1);d("line_caret",b.currentLine,!0);d("token_keyword",b.keyword,!1);d("token_string",b.string,!1);d("token_singleline_comment",b.comment,
!1);d("token_multiline_comment",b.comment,!1);d("token_doc_comment",b.comment,!1);d("token_doc_html_markup",b.comment,!1);return e.join("\n")},_createStyle:function(c,b,d,e){var a=this._document,c="orion-theme-"+c,f=a.getElementById(c);if(f){if(e||f.firstChild.data===b)return;f.removeChild(f.firstChild);f.appendChild(a.createTextNode(b))}else e?(f=i.createElement(a,"link"),f.rel="stylesheet",f.type="text/css",f.href=b,f.addEventListener("load",function(){d()})):(f=i.createElement(a,"style"),f.appendChild(a.createTextNode(b))),
f.id=c,(a.getElementsByTagName("head")[0]||a.documentElement).appendChild(f);e||d()},_load:function(c,b,d){if(c)if(typeof b==="string")this._createStyle(c,b,d);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!h.toUrl)this._createStyle(c,b,d,!0);else{var e=this;h(["text!"+b],function(a){e._createStyle(c,a,d,!1)})}else d()}};k.EventTarget.addMixin(g.prototype);return{TextTheme:g}});
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 i="",g=[],d=new h.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";g.push(d);d=new h.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="15px";d.style.padding="10px";d.style.paddingRight="3px";g.push(d);d=new h.ThemeClass("a");d.style.textDecoration="none";d.style.color=this.content;g.push(d);d=new h.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;g.push(d);d=new h.ThemeClass("primaryNav");
d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";g.push(d);d=new h.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign="baseline";d.style.textDecoration="none";g.push(d);d=new h.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";d.style.fontWeight="normal";g.push(d);for(var c in g)i+=
g[c].toString();return i};k.prototype.writeLocationStyle=function(){var i="",g=[],d=new h.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";g.push(d);d=new h.ThemeClass("breadcrumb");d.style.fontSize="8pt";d.style.textDecoration=
"none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";g.push(d);d=new h.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";g.push(d);d=new h.ThemeClass("breadcrumbSeparator");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2";d.style.fontWeight="bold";g.push(d);d=new h.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize="8pt";d.style.color="#f1f1f2";d.style.textDecoration=
"none";d.style.textWrap="normal";d.style.lineHeight="10pt";g.push(d);d=new h.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";g.push(d);d=new h.ThemeClass("navlinkonpage");d.style.color=this.content;g.push(d);d=new h.ThemeClass("progressPane_running");d.style.background="url(../images/progress_running_dark.gif) no-repeat center";d.style.width="16px";d.style.height="16px";g.push(d);
for(var c in g)i+=g[c].toString();return i};k.prototype.writeButtonStyle=function(){var i="",g=[],d=new h.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="baseline";d.style.cursor="pointer";d.style.display="inline-block";d.style.padding="5px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="8pt";d.style.userSelect="none";g.push(d);d=new h.ThemeClass("commandButton:over");
d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";g.push(d);d=new h.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";g.push(d);d=new h.ThemeClass("commandMenuItem");d.style.border="0";d.style.padding="0";d.style.margin="0";g.push(d);
for(var c in g)i+=g[c].toString();return i};k.prototype.writeMainStyle=function(){var i="",g=[],d=new h.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height="12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";d.style.borderRadius="10px";d.style.color="#999";d.style.padding=
"0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";g.push(d);d=new h.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline="none";g.push(d);d=new h.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";g.push(d);d=new h.ThemeClass("navbar-item-selected");d.style.background=this.selection;d.style.color=
this.content;g.push(d);d=new h.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";d.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";g.push(d);d=new h.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;g.push(d);d=new h.ThemeClass("mainToolbar");d.style.background=this.toolpanel;
d.style.height="34px";d.style.borderBottom="1px solid #ebebeb";d.style.paddingTop="2px";g.push(d);for(var c in g)i+=g[c].toString();return i};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(h){h.navbar.value?(this.navbar=h.navbar.value,this.button=h.button.value,this.location=h.location.value,this.selection=h.selection.value,this.sidepanel=
h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=h.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 i(){}function g(){this.styles=[];var c=new i;c.name="Orion";c.navbar="#333";c.button="#EFEFEF";c.location="#efefef";c.selection="FEC";c.sidepanel="#FBFBFB";c.mainpanel="white";c.toolpanel="white";c.navtext="#bfbfbf";c.content="#3087B3";c.search="#444";c.breadcrumb="#3087B3";c.separator="#333";this.styles.push(c);c=new i;c.name="Green Zone";c.navbar=
"seagreen";c.button="lavender";c.location="darkseagreen";c.selection="moccasin";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="darkgreen";c.search="darkgreen";c.breadcrumb="#3087B3";c.separator="seagreen";this.styles.push(c);c=new i;c.name="Pretty In Pink";c.navbar="plum";c.button="lavender";c.location="pink";c.selection="lavender";c.sidepanel="seashell";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="mediumorchid";c.search="violet";
c.breadcrumb="#3087B3";c.separator="plum";this.styles.push(c);c=new i;c.name="Blue Monday";c.navbar="cornflowerblue";c.button="lavender";c.location="skyblue";c.selection="lavender";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="royalblue";c.search="royalblue";c.breadcrumb="#3087B3";c.separator="cornflowerblue";this.styles.push(c);c=new i;c.name="Vanilla Skies";c.navbar="sandybrown";c.button="lemmonchiffon";c.location="cornsilk";c.selection="lemonchiffon";
c.sidepanel="white";c.mainpanel="white";c.toolpanel="white";c.navtext="lemonchiffon";c.content="chocolate";c.search="moccasin";c.breadcrumb="#3087B3";c.separator="sandybrown";this.styles.push(c);c=new i;c.name="Beetlejuice";c.navbar="indigo";c.button="slateblue";c.location="darkslateblue";c.selection="silver";c.sidepanel="lavender";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="mediumslateblue";c.search="#444";c.breadcrumb="#3087B3";c.separator="indigo";this.styles.push(c);
c=new i;c.name="Red";c.navbar="#CD2127";c.button="#777777";c.location="#D85F56";c.selection="lightcoral";c.sidepanel="#EFDAB2";c.mainpanel="#FDFADD";c.toolpanel="#FDFADD";c.navtext="#FBFBFB";c.content="darkred";c.search="#D85F56";c.breadcrumb="darkred";c.separator="#CD2127";this.styles.push(c)}function d(){return this.styles}i.prototype.name="Orion";i.prototype.navbar="#333";i.prototype.button="#EFEFEF";i.prototype.location="#333";i.prototype.breadcrumb="#3087B3";i.prototype.separator="#333";i.prototype.selection=
"FEC";i.prototype.sidepanel="#FBFBFB";i.prototype.mainpanel="white";i.prototype.toolpanel="white";i.prototype.navtext="#bfbfbf";i.prototype.content="#3087B3";i.prototype.search="#444";g.prototype.styles=[];g.prototype.getStyles=d;g.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};g.prototype.getViewData=function(){for(var c={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},b=0;b<3;b++)c.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)c.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)c.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+b*20,x2:165,y2:124+b*20,x3:160,y3:127+b*20,family:"navbar",fill:"#333"});
c.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return c};g.prototype.processSettings=function(c){var b=new k.ThemeSheetWriter;(new h.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(c))};return{ThemeData:g,getStyles:d}});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(h,k,i,g){function d(c){this._displaySignOut=!0;this._init(c)}d.prototype={_init:function(c){this._dropdownNode=i.node(c.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=c.dropdown;this._serviceRegistry=c.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=c.noSeparator;this._dropDownItemClass=
c.dropDownItemClass;this._keyAssistClass=c.keyAssistClass;if(c.signOut!==void 0)this._displaySignOut=c.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(c){var b=0,d;for(d in c)c.hasOwnProperty(d)&&b++;return b},_makeMenuItem:function(c,b){var d=document.createElement("span");d.role="menuitem";
d.tabIndex=0;var e=document.createTextNode(c);d.appendChild(e);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.addEventListener("click",b,!1);d.addEventListener("keydown",function(a){(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)&&b()},!1);return d},_renderAuthenticatedService:function(c){var b=this,d=this.authenticatedServices[c].authService;if(d&&d.logout&&this._displaySignOut){var e=document.createElement("li"),
a=this._makeMenuItem(h["Sign Out"],function(){d.logout().then(function(){b.addUserItem(c,d,b.authenticatedServices[c].label);localStorage.removeItem(c);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var e=localStorage.key(a);e&&e.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(e)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});e.appendChild(a);this._dropdownNode.appendChild(e)}},renderServices:function(){function c(e){d[e]||
(d[e]=b.createDocumentFragment());return d[e]}var b=document,d=[];g.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(e){this._dropdown?this._dropdown.empty():this._dropdownNode&&i.empty(this._dropdownNode);e.forEach(function(a){var f=c(typeof a.category==="number"?a.category:1),e=b.createElement("li"),d=b.createElement("a");d.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");
d.href=a.href;d.textContent=a.textContent;e.appendChild(d);f.appendChild(e)}.bind(this));if(this.keyAssistFunction){var e=document.createElement("li"),a=this._makeMenuItem(h["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&a.classList.add(this._keyAssistClass):a.classList.add("key-assist-menuitem");e.appendChild(a);c(0).appendChild(e)}var f=this;d.sort(function(a,f){return a-f}).forEach(function(a,e){if(e<d.length-1&&!this._noSeparator){var b=
document.createElement("li");b.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");b.appendChild(c);a.appendChild(b)}f._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var g in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(g)&&this._renderAuthenticatedService(g,0)}.bind(this))},setKeyAssist:function(c){this.keyAssistFunction=c;this.renderServices()},addUserItem:function(c,b,d,e){e?(this.unauthenticatedServices[c]&&
delete this.unauthenticatedServices[c],this.authenticatedServices[c]={authService:b,label:d,data:e}):(this.authenticatedServices[c]&&delete this.authenticatedServices[c],this.unauthenticatedServices[c]=this.unauthenticatedServices[c]?{authService:b,label:d,pending:this.unauthenticatedServices[c].pending}:{authService:b,label:d});this.renderServices()}};d.prototype.constructor=d;return{UserMenu:d}});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(h,k,i,g,d,c){function b(e,a,f){var b="";f&&(b="^");if(b=i.parse("/"+b+e.searchStr+"/"))f=b.pattern,b=b.flags,b.indexOf("i")===-1&&!a.caseSensitive&&(b+="i"),e.regExp={pattern:f,flags:b},e.wildCard=!0}var j={ALL_FILE_TYPE:"*.*"};j.doSearch=function(e,a,f,b){if(e){var c=!0;f==="*"&&(f="");f===""&&(c=b&&b.type!==j.ALL_FILE_TYPE);if(c){f!==""&&j.addRecentSearch(a,
f,b?b.regEx:!1);var e=e.createSearchParams(f,!1,!1,b),d=j.generateSearchHref(e);j.getOpenSearchPref(a,function(a){a?window.open(d):window.location=d})}}else window.alert(h["Can't search: no search service is available"])};j.generateSearchHelper=function(e,a){var f=e.keyword,c=f,d={};e.fileType&&e.fileType!==j.ALL_FILE_TYPE&&f===""&&(c="*."+e.fileType);if(e.regEx)d.searchStr=f,b(d,e,a);else{var g=f.indexOf("*")>-1,h=f.indexOf("?")>-1;g&&(f=f.split("*").join(".*"));h&&(f=f.split("?").join("."));!g&&
!h&&!e.nameSearch?(d.searchStr=e.caseSensitive?f.split("\\").join(""):f.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=e.caseSensitive?f:f.toLowerCase(),b(d,e,a),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:e,inFileQuery:d,displayedSearchTerm:c}};j.convertSearchParams=function(e){if(e.rows!==void 0)e.rows=parseInt(e.rows,10);if(e.start!==void 0)e.start=parseInt(e.start,10);if(typeof e.regEx==="string")e.regEx=e.regEx.toLowerCase()==="true";if(typeof e.caseSensitive===
"string")e.caseSensitive=e.caseSensitive.toLowerCase()==="true";if(typeof e.nameSearch==="string")e.nameSearch=e.nameSearch.toLowerCase()==="true"};j.copySearchParams=function(e,a){var f={},b;for(b in e)if(e[b]!==void 0&&e[b]!==null&&(a||b!=="replace"))f[b]=e[b];return f};j.generateSearchHref=function(e){var a=k.toUrl("search/search.html"),e=j.copySearchParams(e,!0),f=e.resource;e.resource=void 0;return(new c(a+"#{,resource,params*}")).expand({resource:f,params:e})};j.generateFindURLBinding=function(e,
a,f,b){e={find:a.searchStr,regEx:a.wildCard?!0:void 0,caseSensitive:e.caseSensitive?!0:void 0,replaceWith:typeof b==="string"?b:void 0,atLine:typeof f==="number"?f:void 0};return","+(new c("{,params*}")).expand({params:e})};j.convertFindURLBinding=function(e){if(typeof e.regEx==="string")e.regEx=e.regEx.toLowerCase()==="true";if(typeof e.caseSensitive==="string")e.caseSensitive=e.caseSensitive.toLowerCase()==="true";if(typeof e.atLine==="string")e.atLine=parseInt(e.atLine,10)};j.replaceRegEx=function(e,
a,f){return e.replace(RegExp(a.pattern,a.flags),f)};j.replaceStringLiteral=function(e,a,f){a=i.parse("/"+a+"/gim");return j.replaceRegEx(e,a,f)};j.searchOnelineLiteral=function(e,a,f){var b;b=0;for(var c=!1,d=[];;)if(b=a.indexOf(e.searchStr,b),b<0)break;else{d.push({startIndex:b,length:e.searchStrLength});c=!0;if(f)break;b+=e.searchStrLength}return c?d:null};j.findRegExp=function(e,a,f,b){if(!a)return null;f=f||"";f+=(f.indexOf("g")===-1?"g":"")+(f.indexOf("m")===-1?"m":"");var c=null;return(c=RegExp(a,
f).exec(e.substring(b)))&&{startIndex:c.index+b,length:c[0].length}};j.searchOnelineRegEx=function(e,a,f){for(var b=0,c=!1,d=[];;)if(b=j.findRegExp(a,e.regExp.pattern,e.regExp.flags,b)){d.push(b);c=!0;if(f)break;b=b.startIndex+b.length}else break;return c?d:null};j.generateNewContents=function(e,a,f,b,c,d){if(b&&a){if(!e)f.contents=[];for(var g=0;g<a.length;g++){for(var h=a[g],i=!1,k=!1,t=[],o,v=0,x=0;x<b.children.length;x++)if(b.children[x].lineNumber-1===g){v=x;for(i=0;i<b.children[x].matches.length;i++)b.children[x+
i].checked!==!1&&t.push(i);k=t.length>0;o=b.children[x].matches;i=!0;break}if(i){if(k){t=j.replaceCheckedMatches(h,c,o,t,d);h=t.replacedStr;for(i=0;i<b.children[v].matches.length;i++)b.children[v+i].newMatches=t.newMatches}else for(i=0;i<b.children[v].matches.length;i++)b.children[v+i].newMatches=b.children[v+i].matches;e?f.contents[g]=h:f.contents.push(h)}else e||f.contents.push(h)}}};j.generateMatchContext=function(e,a,f){var b=[],c=e*2+1,d;a.length<=c?(d=0,e=a.length-1):(d=f-e,d<0?(d=0,e=d+c-1):
(e=f+e,e>a.length-1&&(e=a.length-1,d=e-c+1)));for(c=d;c<=e;c++)b.push({context:a[c],current:c===f});return b};j.splitFile=function(e){for(var a=0,f=0,b=0,c=0,d=[];;){a!==-1&&a<=b&&(a=e.indexOf("\r",b));f!==-1&&f<=b&&(f=e.indexOf("\n",b));if(f===-1&&a===-1){d.push(e.substring(c));break}var g=1;a!==-1&&f!==-1?a+1===f?(g=2,b=f+1):b=(a<f?a:f)+1:b=a!==-1?a+1:f+1;d.push(e.substring(c,b-g));c=b}return d};j.searchWithinFile=function(e,a,f,b,c,d){f=j.splitFile(f);if(c)a.contents=f;if(a){a.children=[];for(var g=
b=0;g<f.length;g++){var h=f[g];if(h&&h.length>0){var i=d?h:h.toLowerCase();if(i=e.wildCard?j.searchOnelineRegEx(e,i):j.searchOnelineLiteral(e,i)){var k,t=g+1;if(c)for(var o=0;o<i.length;o++)k=o+1,k={parent:a,checked:a.checked,type:"detail",matches:i,lineNumber:t,matchNumber:k,name:h,location:a.location+"-"+t+"-"+k},a.children.push(k);else k={parent:a,context:j.generateMatchContext(2,f,g),checked:a.checked,type:"detail",matches:i,lineNumber:t,name:h,location:a.location+"-"+t},a.children.push(k);b+=
i.length}}}a.totalMatches=b}};j.replaceCheckedMatches=function(e,a,f,b,c){for(var d=0,g="",j=[],h=0;h<f.length;h++){d!==f[h].startIndex&&(g+=e.substring(d,f[h].startIndex));if(f[h].length)c=f[h].length;for(var d=!1,i=0;i<b.length;i++)if(b[i]===h){d=!0;break}d?(j.push({startIndex:g.length,length:a.length}),g+=a):(j.push({startIndex:g.length,length:c}),g+=e.substring(f[h].startIndex,f[h].startIndex+c));d=f[h].startIndex+c}d<e.length&&(g+=e.substring(d));return{replacedStr:g,newMatches:j}};j.fullPathNameByMeta=
function(e){var a=e.length,f="";if(a>0)for(a-=1;a>-1;a--)f=f+(f===""?"":"/")+e[a].Name;return f};j.path2FolderName=function(e,a,f){return e.substring(0,e.length-a.length-(f?0:1))};j._storeRecentSearch=function(e,a,f){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentSearch",a);f&&window.setTimeout(function(){f.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};j.addRecentSearch=function(e,a,f){typeof a==="string"&&a&&e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var c,
b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b){for(c in b)if(b[c].name===a)return;b.length>=20&&b.splice(19,b.length-20+1)}else b=[];b.splice(0,0,{name:a,regEx:f});j._storeRecentSearch(e,b)})};j.removeRecentSearch=function(e,a,f){typeof a==="string"&&a&&e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var c,b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b)for(c in b)if(b[c].name===a){b.splice(c,1);j._storeRecentSearch(e,
b,f);break}})};j.getSearches=function(e,a,f){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e=e.get(a);typeof e==="string"&&(e=JSON.parse(e));e&&f&&f(e)})};j.getMixedSearches=function(e,a,f,b){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var c=e.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));a&&(e=e.get("search"),typeof e==="string"&&(e=JSON.parse(e)),e&&e.forEach(function(a){if(f){var e=j.parseQueryStr(a.query);
c.some(function(a){return e.searchStrTitle===a.name})||c.push({name:e.searchStrTitle,label:a.name})}else c.push({name:null,label:a.name,value:a.query})}));c&&b&&b(c)})};j.getOpenSearchPref=function(e,a){e.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(f){f=f.get("nav.config");a(f&&f["links.newtab"]!=="undefined"?f["links.newtab"]?!0:!1:!1)})};j.setOpenSearchPref=function(e,a){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("openSearchPref",
{openInNewTab:a})})};return j});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(h,k,i,g,d,c){function b(b,e,a,f){this.registry=b;this.fileClient=e;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=f&&f.searchOnName;this._buildSkeletonOnly=f&&f.buildSkeletonOnly;this._fetchChildrenCallBack=f&&f.fetchChildrenCallBack;this._searchParams=a;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:g.generateSearchHelper(a);this._location=f&&f.location;this._childrenLocation=f&&f.childrenLocation?f.childrenLocation:this._location}b.prototype.search=function(b){var e=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=b;e.getContentTypes().then(function(a){this.contentTypesCache=a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};b.prototype.searchName=function(b,e){if(b)this.searchHelper=g.generateSearchHelper(b,!0);if(e)this.onSearchNameComplete=e;var a=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var f=0;f<this.fileSkeleton.length;f++){var c=this.fileSkeleton[f].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?g.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):g.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(a.push(this.fileSkeleton[f]),
a.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:a.length,docs:a}})}};b.prototype.buildSkeleton=function(b,e){this._buildingSkeleton=!0;var a=this.registry.getService("orion.core.contenttypes"),f=this;b();a.getContentTypes().then(function(a){f.contentTypesCache=a;f._visitRecursively(f._childrenLocation).then(function(){f._buildingSkeleton=!1;e();f.searchHelper&&!f._buildSkeletonOnly&&f.searchName()})})};b.prototype._searchCompleted=function(){console.log("Search Completed.")};
b.prototype._searchFiles=function(){var b=[],e;if(this.fileLocations.length>0){e=this;for(var a=0;a<e.fileLocations.length;a++)b.push(e._sniffSearch(e.fileLocations[a]))}return c.all(b)};b.prototype._sort=function(b){b.sort(function(e,a){var f=e.Name&&e.Name.toLowerCase(),b=a.Name&&a.Name.toLowerCase();return f<b?-1:f>b?1:0})};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===g.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};b.prototype._visitRecursively=function(b){var e=[],a=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var f=a.registry.getService("orion.page.progress");return(f?f.progress(a.fileClient.fetchChildren(b),"Crawling search for children of "+b):a.fileClient.fetchChildren(b)).then(function(f){for(var b=0;b<f.length;b++)if(f[b].Directory!==void 0&&f[b].Directory===!1)if(a._searchOnName)e.push(a._buildSingleSkeleton(f[b]));else if(a._buildSkeletonOnly)e.push(a._buildSingleSkeleton(f[b]));
else{var g=d.getFilenameContentType(f[b].Name,a.contentTypesCache);g&&(g["extends"]==="text/plain"||g.id==="text/plain")&&a._onFileType(g)&&e.push(a._sniffSearch(f[b]))}else f[b].Location&&e.push(a._visitRecursively(f[b].ChildrenLocation));return c.all(e)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?g.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):g.searchOnelineLiteral(this.searchHelper.inFileQuery,
b,!0)};b.prototype._reportSingleHit=function(b){b.LastModified=b.LocalTimeStamp;this.fileLocations.push(b);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};b.prototype._sniffSearch=function(b){this._totalCounter++;var e=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(h["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(e.fileClient.read(b.Location),"Reading file "+b.Location).then(function(a){e._hitOnceWithinFile(a)&&e._reportSingleHit(b);e.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(h["${0} files found out of ${1}"],e._hitCounter,e._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new c;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(h,k,i,g){function d(){}d.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 c=
document.body;this.$frameParent=c;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(c);b=b.createContextualFragment(this.CONTAINERTEMPLATE);c.appendChild(b);this.$frame=c.lastChild;this.title&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var d=this;this.$close.addEventListener("click",function(){d.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
c=b.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(c,this.messages);this.$parent.appendChild(c);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===i.KEY.ESCAPE?d.hide():b.keyCode===i.KEY.ENTER&&typeof d._defaultCallback==="function"&&d._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 c=this;this.buttons.forEach(function(b){var d=g.createButton(b.text,b.callback);if(b.id)d.id=b.id,c["$"+d.id]=d;if(b.isDefault)c._defaultCallback=b.callback,c._defaultButton=d;c.$buttonContainer.appendChild(d)})}},_makeModal:function(){var c=this;this.$frame.addEventListener("blur",function(a){c.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!i.contains(c.$frame,a.target);if(b)for(var e=0;e<
c.$$modalExclusions.length;e++)if(i.contains(c.$$modalExclusions[e],a.target)){b=!1;break}b&&(window.setTimeout(function(){(c.$lastFocusedElement||c.$parent).focus()},0),i.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,d=!1;this._addedBackdrop=[];for(var e=0;e<b.length;e++){for(var a=0;a<this.$$modalExclusions.length;a++)if(i.contains(this.$$modalExclusions[a],b[e])){d=
!0;break}!d&&b[e]!==c.$frame&&b[e].classList&&!b[e].classList.contains("tooltipContainer")&&(a=b[e],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(b=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===i.KEY.TAB){var b=c._getFirstFocusField();b&&b!==a.target&&b.focus();i.stop(a)}},!1)},_addChildDialog:function(c){this.$$modalExclusions.push(c.$frame||c.$parent)},_bindElements:function(c){for(var b=
0;b<c.childNodes.length;b++){var d=c.childNodes[b];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},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 c=this;this.keepAlive||window.setTimeout(function(){c.destroy()},
0)},show:function(c){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=i.bounds(this.$frame),d=i.bounds(document.documentElement),e;c?(e=i.bounds(c),c=e.top+e.height+4,e=e.left+4,c+b.height>d.height&&(c=Math.max(0,d.height-b.height-4)),e+b.width>d.width&&(e=Math.max(0,d.width-b.width-4))):(e=Math.max(0,(d.width-b.width)/2),c=Math.max(0,(d.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=c+"px";this.$frame.style.left=e+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return i.firstTabbable(this.$parent)||this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(c){c.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}};d.prototype.constructor=d;return{Dialog:d}});
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,i,g,d,c,b){function j(b){this._init(b)}j.prototype=new b.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="'+g.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(b){this.title=b.title||h["Find File Named"];this.modal=!0;this.messages=h;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;this._contentTypeService=new i.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=b.initialText;this._message=b.message;this._nameSearch=!0;if(b.nameSearch!==void 0)this._nameSearch=b.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(h["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(h["Missing required argument: searchRenderer"]);this._favService=b.favoriteService;if(!this._favService)throw Error(h["Missing required argument: favService"]);this._initialize()};j.prototype._bindToDom=function(b){var a=this;a.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",h.Search);this.$fileName.addEventListener("input",function(){a._time=+new Date;a._timeoutId&&clearTimeout(a._timeoutId);
a._timeoutId=setTimeout(a.checkSearch.bind(a),0)},!1);this.$fileName.addEventListener("keydown",function(f){if(f.keyCode===d.KEY.ENTER){var b=d.$("a",a.$results);b&&(d.stop(f),window.open(b.href),a.hide())}},!1);b.addEventListener("keydown",function(f){var b,e,c,g,j;if(f.keyCode===d.KEY.DOWN||f.keyCode===d.KEY.UP)e=d.$$array("a",a.$results),b=d.$$array("a",a.$favresults),c=document.activeElement,j=e.indexOf(c),g=b.indexOf(c),f.keyCode===d.KEY.DOWN?g>=0?(g<b.length-1?b[g+1]:e.length>0?e[0]:b[0]).focus():
j>=0?(j<e.length-1?e[j+1]:b.length>0?b[0]:e[0]).focus():(e.length>0||b.length>0)&&(-1<b.length-1?b[0]:e[0]).focus():g>=0?(c=a.$fileName,(g>0?b[g-1]:c).focus()):j>=0?(c=a.$fileName,(j>0?e[j-1]:b.length>0?b[b.length-1]:c).focus()):e.length>0?e[e.length-1].focus():b.length>0&&b[b.length-1].focus(),d.stop(f)});b.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(a._forceUseCrawler||!a._fileService.getService(a._searcher.getSearchLocation()).search){var b=
a._searchOnRoot?a._searcher.getSearchRootLocation():a._searcher.getChildrenLocation(),b=new k.SearchCrawler(a._searcher.registry,a._fileService,"",{searchOnName:!0,location:b});a._searcher.setCrawler(b);b.buildSkeleton(function(){a.$crawlingProgress.style.display="inline";a.$progress.appendChild(document.createTextNode(h["Building file skeleton..."]))},function(){a.$crawlingProgress.style.display="none";a.$progress.removeChild(a.$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 b=document.createElement("div");b.appendChild(document.createTextNode(h["Populating favorites&#x2026;"]));d.empty(this.$favresults);this.$favresults.appendChild(b);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 b=this;return function(a){if(a.navigator)a=a.navigator;b._searchRenderer.makeRenderFunction(b._contentTypeService,b.$favresults,!1,b.decorateResult.bind(b),b.showFavoritesImage)(a);if(a&&a.length>0)a=document.createElement("div"),a.style.borderBottom="1px dashed #BBBBBB",a.style.padding="5px",b.$favresults.appendChild(a)}};j.prototype.showFavoritesImage=function(b){var a=new Image;
a.classList.add("modelDecorationSprite");a.classList.add("core-sprite-favorite");a.src=g.toUrl("images/none.png");a.title=h.Favorite;b.appendChild(a);a.style.verticalAlign="middle"};j.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};j.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var a=this._searcher.createSearchParams(b,
this._nameSearch,this._searchOnRoot),f=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=f;var g=document.createElement("div");g.appendChild(document.createTextNode(this._nameSearch?h["Searching..."]:c.formatMessage(h["Searching for occurrences of"],b)));d.empty(this.$results);this.$results.appendChild(g);this._searcher.search(a,!1,function(){f===this.currentSearch&&f.apply(null,arguments)}.bind(this))}};j.prototype.decorateResult=
function(b){for(var a=this,b=d.$$array("a",b),f=0;f<b.length;f++){var c=b[f];c.addEventListener("mouseup",function(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&a.hide()},!1);c.addEventListener("keyup",function(b){b.keyCode===d.KEY.ENTER&&a.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 i=Object.keys(k),g=0;g<i.length;g++){var d=i[g];h[d]=k[d]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(h,k){function i(g,d,c){this.CLEAR_PANEL=c!==null?c:!0;this.OPEN="false";c="";g.nodeType?this.node=g:(c=g+"_",g=document.getElementById(g),this.node=g.nodeType?g:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=c+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=c+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=c+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(d.icon)this.node.className=this.node.className+" "+d.icon,this.node.onclick=this.click.bind(this);else{if(d.label)g=document.getElementById(this.navLabelId),g.textContent=d.label,g.onclick=this.click.bind(this);if(d.caret)document.getElementById(this.arrowId).className=d.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}h.mixin(i.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 g=document.getElementById(this.navDropDownId);g.style.display==="none"?this.updateContent(this.getContentNode(),function(){g.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,g],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(g){document.getElementById(this.navDropDownId).innerHTML=g},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(g,d){d()},toggleLabel:function(g){document.getElementById(this.navLabelId).style.display=g?"":"none";document.getElementById(this.arrowId).style.display=g?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var g=k.bounds(this._dropdownNode),d=k.bounds(this._boundingNode(this._triggerNode));if(g.left+g.width>d.left+d.width)this._dropdownNode.style.right=0},_boundingNode:function(g){return g.style.right!==""||g.style.position==="absolute"||!g.parentNode||
!g.parentNode.style?g:this._boundingNode(g.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return i});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(h,k,i){function g(b,c,e){if(!b[c])throw c+h[" is not supported in this file system"];return b[c].apply(b,e)}function d(b,c,e,a){if(!b.readBlob)throw h["source file service does not support binary read"];if(!e.writeBlob)throw h["target file service does not support binary write"];if(c[c.length-1]!=="/")return g(b,"readBlob",[c]).then(function(b){return g(e,"writeBlob",[a,b])});var f=a.substring(0,
a.length-1),l=decodeURIComponent(f.substring(f.lastIndexOf("/")+1)),f=f.substring(0,f.lastIndexOf("/")+1);return g(e,"createFolder",[f,l]).then(function(){},function(){}).then(function(){return g(b,"fetchChildren",[c]).then(function(f){for(var c=[],g=0;g<f.length;++g){var j=f[g].Location,l=j;f[g].Directory&&(l=j.substring(0,j.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=a+encodeURIComponent(l);f[g].Directory&&(l+="/");c[g]=d(b,j,e,l)}return k.all(c)})})}function c(b,c){function e(a){var b=
new k;b.reject(h["No Matching FileService for location:"]+a);return b}var a=b.getServiceReferences("orion.core.file"),f=a;if(c)for(var f=[],d=0;d<a.length;++d)c(a[d])&&f.push(a[d]);for(var g=[],m=[],q=[],s=[],p={fetchChildren:function(){var a=new k;a.resolve(s);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:s,ChildrenLocation:"/"})},100);return a},search:e,createProject:e,createFolder:e,createFile:e,deleteFile:e,moveFile:e,copyFile:e,read:e,write:e},a=0;a<f.length;++a)s[a]={Directory:!0,Length:0,LocalTimeStamp:0,Location:f[a].getProperty("top"),ChildrenLocation:f[a].getProperty("top"),Name:f[a].getProperty("Name")},d=f[a].getProperty("pattern")||".*",d[0]!=="^"&&(d="^"+d),g[a]=RegExp(d),m[a]=b.getService(f[a]),q[a]=f[a].getProperty("Name"),
f[a].getProperty("NameKey")&&f[a].getProperty("nls")&&i.getMessageBundle(f[a].getProperty("nls")).then(function(a,b){s[a].Name=b[f[a].getProperty("NameKey")];q[a]=b[f[a].getProperty("NameKey")]}.bind(this,a));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return m[0]?0:-1;for(var b=0;b<g.length;++b)if(g[b].test(a))return b;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:q[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?p.Location:s[a].Location}}c.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return g(this._getService(b),"fetchChildren",arguments)},createWorkspace:function(b){return g(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return g(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return g(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,c,e,a){return g(this._getService(b),"createProject",arguments)},createFolder:function(b,c){return g(this._getService(b),"createFolder",arguments)},createFile:function(b,c){return g(this._getService(b),"createFile",arguments)},deleteFile:function(b){return g(this._getService(b),"deleteFile",arguments)},
moveFile:function(b,c,e){var a=this._getService(b),f=this._getService(c);if(a===f)return g(a,"moveFile",arguments);var l=b[b.length-1]==="/",h=c;h[h.length-1]!=="/"&&(h+="/");if(e)h+=encodeURIComponent(e);else{var m=b;l&&(m=m.substring(0,m.length-1));h+=m.substring(m.lastIndexOf("/")+1)}l&&h[h.length-1]!=="/"&&(h+="/");return d(a,b,f,h).then(function(){return g(a,"deleteFile",[b])})},copyFile:function(b,c,e){var a=this._getService(b),f=this._getService(c);if(a===f)return g(a,"copyFile",arguments);
var l=b[b.length-1]==="/",h=c;h[h.length-1]!=="/"&&(h+="/");if(e)h+=encodeURIComponent(e);else{var m=b;l&&(m=m.substring(0,m.length-1));h+=m.substring(m.lastIndexOf("/")+1)}l&&h[h.length-1]!=="/"&&(h+="/");return d(a,b,f,h)},read:function(b,c){return g(this._getService(b),"read",arguments)},write:function(b,c,e){return g(this._getService(b),"write",arguments)},remoteImport:function(b,c){return g(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,c){return g(this._getService(b),
"remoteExport",arguments)},search:function(b){return g(this._getService(b.resource),"search",arguments)}};c.prototype.constructor=c;return{FileClient:c}});
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,i,g,d,c,b,j,e,a,f,l,n,m,q,s,p,r,t,o,v,x,u,w,D,z,E,A,G,L,H,J,O){function P(a,b){if(a.getLabel)return a.getLabel();else{var f=new x;f.resolve(b.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,b){var f=a.getServiceReferences("orion.core.auth");Q=[];for(var e=I.createMenuGenerator.apply(this,arguments),c=0;c<f.length;c++){var d=
f[c],o=a.getService(d);P(o,d).then(function(a){o.getKey().then(function(b){Q.push(b);o.getUser().then(function(f){e.addUserItem(b,o,a,f)},function(f,c){e.addUserItem(b,o,a,c)});window.addEventListener("storage",function(){M[b]!==localStorage.getItem(b)&&(M[b]=localStorage.getItem(b),o.getUser().then(function(f){e.addUserItem(b,o,a,f)},function(){e.addUserItem(b,o,a)}))},!1)})})}}function y(a,b,f,e,d){var o=arguments,g,l=a&&a.getServiceReferences("orion.page.link.related");l&&l.length!==0&&x.when(function(){if(g)return g;
var b=a.getService("orion.core.contenttypes");b||(b=new p.ContentTypeService(a),b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return g=a})}(),function(){var u;if(I.beforeGenerateRelatedLinks.apply(this,o)){for(var v=[],h=0;h<l.length;h++){var n={},m,i=l[h].getPropertyKeys();for(m=0;m<i.length;m++)n[i[m]]=l[h].getProperty(i[m]);if(n.id){var w=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(b)){var f=new c.CommandInvocation(b,b,null,a,e);I.addRelatedLinkCommand(a,
f)}else typeof d==="function"&&(u||(u=d()),x.when(u,function(f){f&&b===N&&(!a.visibleWhen||a.visibleWhen(f))&&I.addRelatedLinkCommand(a,new c.CommandInvocation(f,f,null,a,e))}))},q=null;m=null;if(f.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)m=j._createCommandOptions(n,l[h],a,g,!0),v.push(m),m.then(function(a){a=new c.Command(a);w(a)});else{if(!q&&(q=e.findCommand(n.id))){w(q);continue}if(!q){var k=a.getServiceReferences("orion.navigate.command");for(m=0;m<k.length;m++)if(k[m].getProperty("id")===
n.id){for(var n={},i=k[m].getPropertyKeys(),z=0;z<i.length;z++)n[i[z]]=k[m].getProperty(i[z]);m=j._createCommandOptions(n,k[m],a,g,!0);v.push(m);m.then(function(a){q=new c.Command(a);w(q)});break}}}}}x.all(v,function(a){return a}).then(function(){I.afterGenerateRelatedLinks.apply(this,o)})}})}function B(a){var b=l.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function C(a){var b={},f=null;typeof a==="string"&&(a=l.node(a));a||(a=l.node("pageActions"));for(var e=a;e&&
e.classList;){if(e.classList.contains("toolComposite")){f=e;break}e=e.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(f&&(b.slideContainer=l.$(".slideParameters",f),b.parameterArea=l.$(".parameters",f),b.dismissArea=l.$(".parametersDismiss",f),b.notifications=l.$("#notificationArea",f),f.parentNode&&(b.toolbarTarget=l.$(".toolbarTarget",f.parentNode),b.toolbarTarget)))a=l.bounds(f),b.toolbarTargetY=a.height+1;return b}function F(a){if(a.toolbarTarget&&a.toolbarTargetY){var b=
0,f;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(f=l.bounds(a.notifications),b+=f.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(f=l.bounds(a.slideContainer),b+=f.height);b>0&&(b+=8);a.toolbarTarget.style.top=a.toolbarTargetY+b+"px";a.toolbarTarget.style.bottom=0}}var d=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},I={createMenuGenerator:J.createMenuGenerator||
function(a,b){if(l.node("userMenu")){var f=l.node("userDropdown"),e=new m.Dropdown({dropdown:f}),f=new u.UserMenu({dropdownNode:f,dropdown:e,serviceRegistry:a}),e=l.node("userTrigger");new q.Tooltip({node:e,text:h.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),c=e.className;c+=" imageSprite core-sprite-silhouette";e.className=c;f.setKeyAssist(b);return f}},beforeGenerateRelatedLinks:J.beforeGenerateRelatedLinks||function(){var a=l.node("relatedLinks");l.empty(a);
return!0},addRelatedLinkCommand:J.addRelatedLinkCommand||function(a,b){var f=l.node("relatedLinks");c.createCommandMenuItem(f,a,b).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:J.afterGenerateRelatedLinks||function(){},afterSetPageTarget:J.afterSetPageTarget||function(){},generateNavigationMenu:J.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new q.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new G("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),b=new L;a.addContent(b.getContentPane())},afterGenerateBanner:J.afterGenerateBanner||function(){}},Q=[],N,S=[],K,R=null;return{addSettings:function(a){(new G("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(a,f,d,j,u,m,x){function q(){this.create();this._filterString=""}function G(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=l.$$array(".targetSelector"),f=0;f<b.length;f++)b[f].target=a}},{pid:"nav.config"})}(new o.ThemePreferences(j,new v.ThemeData)).apply();var p=l.node(a);if(!p)throw h["could not find banner parent, id was "]+a;var r=document.createRange();r.selectNode(p);r=r.createContextualFragment(z);l.processTextNodes(r,h);p.firstChild?p.insertBefore(r,p.firstChild):p.appendChild(r);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+i.slideoutHTMLFragment("mainToolbar");(p=l.node("closeNotifications"))&&p.setAttribute("aria-label",h["Close notification"]);if(p=l.node("footer"))p.innerHTML=E,l.processTextNodes(p,h);d.setParameterCollector(new b.CommandParameterCollector(C,F));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&(a=f.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);I.generateNavigationMenu.apply(this,arguments);var L=l.node("navigationlinks");L&&w.createPageLinks(f,"orion.page.link").then(function(a){a.forEach(function(a){var b=document.createElement("li");b.appendChild(a);L.appendChild(b)})});if(p=l.$(".split")){var r=l.$(".sidePanelLayout"),J=l.$(".mainPanelLayout");if(r&&J)R={side:r,main:J},R.splitter=new n.Splitter({node:p,sidePanel:r,mainPanel:J,toggle:!0,closeByDefault:p.style&&p.style.left==="0%"}),p=new c.Command({name:h["Toggle side panel"],
tooltip:h["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){R.splitter.toggleSidePanel()}}),d.addCommand(p),d.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new g.KeyBinding("o",!0)),x&&R.splitter.addResizeListener(function(a){x&&a===J&&(a=x.getTextView())&&a.resize()})}p=new c.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 b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=f.getService("orion.core.favorite"),e=f.getService("orion.page.progress"),c=function(a){return function(c){c?f.getService("orion.page.message").setMessage(a.Name+h[" is already a favorite."],2E3):e.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},d=0;d<a.length;d++){var o=a[d];e.progress(b.hasFavorite(o.ChildrenLocation||o.Location),
"Checking favorite "+o.Name).then(c(o))}}});d.addCommand(p);var P=!1,t=function(a,b,f){if(!P){var e=b.getService("orion.core.favorite"),c=b.getService("orion.page.progress");e||(e=new s.FavoritesService({serviceRegistry:b}),e=b.getService("orion.core.favorite"));var d=new D.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,favoriteService:e,onHide:function(){P=!1;f&&f.getTextView()&&f.getTextView().focus()}});window.setTimeout(function(){P=!0;d.show()},0)}},p=new c.Command({name:h["Find File Named..."],
tooltip:h["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){t(u,f,x)}});d.addCommand(p);d.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new g.KeyBinding("f",!0,!0));p=new c.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"),b=l.node("footer"),f=l.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",b.style.visibility="visible",f.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",f.classList.add("content-fixedHeight-maximized"));x&&x.getTextView()&&x.getTextView().resize();return!0}});d.addCommand(p);d.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new g.KeyBinding("m",!0,!0));p=new c.Command({name:h["System Configuration Details"],tooltip:h["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
d.addCommand(p);d.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new g.KeyBinding(112,!0,!0));p=new c.Command({name:h["Background Operations"],tooltip:h["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});d.addCommand(p);d.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new g.KeyBinding("o",!0,!0));q.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var b=this._keyAssistInput=document.createElement("input");b.classList.add("keyAssistInput");b.type="text";b.placeholder=h["Filter bindings"];a.appendChild(b);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(H.isIOS||H.isAndroid)f.style.overflowY="auto";a.appendChild(f);var e=this._keyAssistTable=document.createElement("table");
e.tabIndex=0;e.classList.add("keyAssistList");f.appendChild(e);document.body.appendChild(a);b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));e.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("input",function(){this.filterChanged()}.bind(this));f.addEventListener(H.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(x&&x.getTextView()){var a=x.getTextView(),b=a.getActions(!0).filter(function(b){return(b=a.getActionDescription(b))&&b.name});b.sort(function(b,f){return a.getActionDescription(b).name.localeCompare(a.getActionDescription(f).name)});this.createHeader(h.Editor);for(var f=function(b){return function(){a.focus();
return a.invokeAction(b)}},c={},o,g=0;g<b.length;g++)for(var j=b[g],u=a.getActionDescription(j),v=a.getKeyBindings(j),n=0;n<v.length;n++){o=v[n];var m=e.getUserKeyString(o);o.scopeName?(c[o.scopeName]||(c[o.scopeName]=[]),c[o.scopeName].push({bindingString:m,name:u.name,execute:f(j)})):this.createItem(m,u.name,f(j))}for(var i in c)if(c[i].length){this.createHeader(i);for(b=0;b<c[i].length;b++)o=c[i][b],this.createItem(o.bindingString,o.name,o.execute)}}this.createHeader(h.Global);d.showKeyBindings(this)},
createItem:function(a,b,f){if(this._filterString){var e=this._filterString.toLowerCase(),c;e!==this._filterString?(e=this._filterString,c=function(a){return a}):c=function(a){return a.toLowerCase()};if(c(b).indexOf(e)===-1&&c(a).indexOf(e)===-1&&c(this._lastHeader).indexOf(e)===-1)return}var d=this._keyAssistTable.insertRow(-1);d.id="keyAssist-keyBinding-"+this._idCount++;d.setAttribute("role","menuitem");d._execute=f;d.classList.add("keyAssistItem");d.addEventListener("click",function(a){this._selectedRow=
d;this.execute();a.preventDefault()}.bind(this));f=d.insertCell(-1);f.classList.add("keyAssistName");f.appendChild(document.createTextNode(b));f=d.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var b=this._keyAssistTable.insertRow(-1);b.classList.add("keyAssistSection");var b=b.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(a));b.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,b=this._keyAssistDiv,a=b===a||(b.compareDocumentPosition(a)&16)!==0;b.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var b=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(b.length===0)this._selectedIndex=-1;else{var f=this._selectedIndex;f+=a?1:-1;f%=b.length;f<0&&(f=b.length-1);if(this._selectedIndex!==-1)a=b[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=f;if(this._selectedIndex!==-1){this._selectedRow=
a=b[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var b=a.getBoundingClientRect(),e=this._keyAssistContents,c=e.getBoundingClientRect();a.offsetTop<e.scrollTop?f===0?e.scrollTop=0:a.scrollIntoView(!0):b.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 b=0,b=H.isIE||H.isOpera?-a.wheelDelta:H.isFirefox?a.detail*40:-a.wheelDeltaY,f=this._keyAssistContents,e=f.scrollTop;f.scrollTop+=b;if(e!==f.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var O=new q,y=new c.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}});d.addCommand(y);d.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new g.KeyBinding(191,!1,!0));p=function(){x.getTextView().setKeyBinding(new g.KeyBinding(191,!1,!0,!H.isMac,H.isMac),y.id);x.getTextView().setAction(y.id,y.callback,y)};x&&(x.getTextView()?
p():x.addEventListener("TextViewInstalled",p));B(d);U(f,y.callback);T(f);window.addEventListener("hashchange",function(){d.processURL(window.location.href)},!1);window.setTimeout(function(){G(f)},0);I.afterGenerateBanner.apply(this,arguments)},getToolbarElements:C,getMainSplitter:function(){return R},layoutToolbarElements:F,setPageTarget:function(a){var b,e,c=a.breadcrumbRootName,d=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(e=c?c+" ":"",e+=a.fileService.fileServiceName(a.target.Location),c=null),b=a.name||a.target.Name,N=a.target,y(d,a.target,S,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(c=c||a.task||a.name),b=a.name,y(d,{NoTarget:""},S,a.commandService,a.makeAlternate));(K=a.title)||(K=b?b+" - "+a.task:a.task);window.document.title=K;I.afterSetPageTarget.apply(this,arguments);if(b=l.node("location")){l.empty(b);var o=d&&new O.FileClient(d),d=a.breadcrumbTarget||a.target,o=o&&d&&d.Location?o.fileServiceRootURL(d.Location):
null;new f.BreadCrumbs({container:b,resource:d,rootSegmentName:c,workspaceRootSegmentName:e,workspaceRootURL:o,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(K)K.charAt(0)==="*"&&!a&&(K=K.substring(1)),a&&K.charAt(0)!=="*"&&(K="*"+K),window.document.title=K;var b=l.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){S=a},notifyAuthenticationSite:d}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(h){return{detectValidURL:function(k){for(var i=/\[([^\]]*)\]\(([^\)]+)\)/g,g=i.exec(k),d=[],c=0;g;){if(g.length===3&&g[2].length>0){var b=new URL(g[2]);b.protocol!==":"&&h.validateURLScheme(b.href)&&(g.index>c&&d.push({segmentStr:k.substring(c,g.index)}),d.push({segmentStr:g[1].length>0?g[1]:g[2],urlStr:g[2]}),c=g.index+g[0].length)}g=i.exec(k)}if(c===0)return null;c<k.length-1&&d.push({segmentStr:k.substring(c)});return d},processURLSegments:function(h,
i){i.forEach(function(g){if(g.urlStr){var d=document.createElement("a");d.href=g.urlStr;d.appendChild(document.createTextNode(g.segmentStr))}else d=document.createElement("span"),d.textContent=g.segmentStr;h.appendChild(d)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(h,k,i,g,d){function c(b,e,a,f,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=c;this.domId=a;this.progressDomId=f||a;this._hookedClose=!1;this._timer=null}var b;c.prototype={_init:function(){var b=k.node("closeNotifications");if(b&&!this._hookedClose)this._hookedClose=!0,
b.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,e,a){this._init();this.currentMessage=b;var f=k.node(this.domId);if(typeof a==="boolean"){var c=f.getAttribute("aria-live");f.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===
this.currentMessage&&(k.empty(f),f.appendChild(document.createTextNode(b)),window.setTimeout(function(){f.setAttribute("aria-live",c)},100))}.bind(this),100)}else k.empty(f),f.appendChild(document.createTextNode(b));typeof e==="number"&&window.setTimeout(function(){b===this.currentMessage&&(k.empty(f),f.appendChild(document.createTextNode("")))}.bind(this),e)},setErrorMessage:function(b){this.currentMessage=b;this._init();var e=b.responseText||b.message||b;if(typeof e==="string")try{e=JSON.parse(e)}catch(a){}var b=
e.Message||e,f="red";if(e.Severity)switch(e.Severity){case "Warning":f="#FFCC00";break;case "Error":f="red";break;case "Info":case "Ok":f="green"}e=document.createElement("span");e.style.color=f;e.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(e)},setProgressMessage:function(b){this._init();this.currentMessage=b;var e=document.createElement("span");e.classList.add("imageSprite");e.classList.add("progressIcon");e.classList.add("core-sprite-progress");var a=k.node(this.progressDomId);
k.empty(a);a.appendChild(e);a.appendChild(document.createTextNode(b));e=k.node(this.notificationContainerDomId);e.classList.remove("notificationHide");if(b&&b.length>0)e.classList.add("progressNormal"),e.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else e.classList.remove("notificationShow"),e.classList.add("notificationHide")},setProgressResult:function(b){this.currentMessage=b;var e=b.responseText||b;if(typeof e===
"string")try{e=JSON.parse(e)}catch(a){}this._init();var f=e.Message||e,c="core-sprite-information",g="progressInfo",h=document.createElement("span");h.classList.add("imageSprite");h.classList.add("progressIcon");b=[];if(e.Severity)switch(e.Severity){case "Warning":c="core-sprite-warning";g="progressWarning";b.push("progressInfo");b.push("progressError");b.push("progressNormal");break;case "Error":c="core-sprite-error";g="progressError";b.push("progressWarning");b.push("progressInfo");b.push("progressNormal");
break;default:b.push("progressWarning"),b.push("progressError"),b.push("progressNormal")}b.push("notificationHide");h.classList.add(c);var i=k.node(this.progressDomId),c=k.node(this.notificationContainerDomId);k.empty(i);i.appendChild(h);if(e.HTML)e=document.createElement("span"),e.innerHTML=f,i.appendChild(e);else{if(h=d.detectValidURL(f))f=document.createDocumentFragment(),d.processURLSegments(f,h),Array.prototype.forEach.call(k.$$("a",f),function(a){a.target="_blank"});else{if(e.Severity!=="Warning"&&
e.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);f=document.createTextNode(f)}i.appendChild(f)}if(g&&this.progressDomId!==this.domId){c.classList.add(g);for(g=0;g<b.length;g++)c.classList.remove(b[g])}c.classList.add("notificationShow")},showWhile:function(b,e){var a=this;if(e){a.setProgressMessage(e);var f=function(){e===a.currentMessage&&a.setProgressMessage("")};b.then(f,f)}return b},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(c,e){return new b(this,++this._lastProgressId,c,e)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",e=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(e||(b+=", "),b+=this._progressMonitors[a].status,e=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;
this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};c.prototype.constructor=c;b=function(b,e,a,f){this.statusService=b;this.progressId=e;if(a){this.deferred=a;this.begin(f);var c=this;a.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};
b.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};b.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};b.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};b.prototype.constructor=b;return{StatusReportingService:c,ProgressMonitor:b}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(h,k){var i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(h,k,i,g){function d(){}d.prototype={_initialize:function(c,b,d,e,a){this._tooltip=new g.Tooltip({node:c,hideDelay:a||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:d,trigger:e?e:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";c=document.createRange();c.selectNode(this.$parent);c=c.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(c,h);this.$parent.appendChild(c);var f=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&f.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var d=c.childNodes[b];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var b=
i.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(h,k,i,g){var d={};(function(){var c=!1;d.updateNavTools=function(b,d,e,a,f,g){var n=i.node(a);if(n)d.destroy(n);else throw h["could not find toolbar "]+a;d.renderCommands(a,n,g,e,"button");if(f&&(a=i.node(f)))d.destroy(a),d.renderCommands(f,a,null,e,"button");c||(c=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var b=i.node(f);
b&&(d.destroy(b),d.renderCommands(f,b,a.selections,e,"button"))}))};d.createOperationsCommands=function(b,c,e){function a(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var f=new g.Command({name:h["Remove Completed"],tooltip:h["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){e.removeCompletedOperations().then(function(){c.loadOperations.bind(c)()})},visibleWhen:function(){return!0}});b.addCommand(f);
f=new g.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],b=0;b<a.length;b++){var f=a[b];e.removeOperation.bind(e)(f.Location).then(function(){c.loadOperations.bind(c)()},function(){c.loadOperations.bind(c)()})}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return!a(b);for(var f in b)if(a(b[f]))return!1;return!0}});b.addCommand(f);
f=new g.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],b=0;b<a.length;b++){var f=a[b];f.deferred&&f.deferred.cancel()}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return a(b)&&(b.operation&&b.operation.cancelable?!0:!1);for(var f in b)if(!a(b[f])||!b[f].operation||!b[f].operation.cancelable)return!1;return!0}});b.addCommand(f)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(h,k,i,g,d){function c(b){this._options=b}c.prototype=new g.PopupDialog;c.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>';c.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};c.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};c.prototype.setOperations=function(b,c){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var e in b)this._myOperations.push(b[e]),this._operationsDeferreds.push(c[e]);this._renderOperations()};c.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(c){}var e={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==e.Message)e.DetailedMessage=b.DetailedMessage;return e};c.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};c.prototype._renderOperationsTable=function(b,c,e){i.empty(b);for(var a=0;a<c.length;a++){var f=c[a],d=document.createElement("tr"),g=document.createElement("td");g.style.paddingLeft="5px";g.style.paddingRight="5px";g.textContent=f.Name;d.appendChild(g);var m=document.createElement("div");g.appendChild(m);g=document.createElement("span");g.style.paddingRight="5px";g.classList.add("imageSprite");switch(f.type){case "Warning":g.classList.add("core-sprite-warning");g.setAttribute("aria-label",
h["Operation resulted in a warning."]);break;case "error":g.classList.add("core-sprite-error");g.setAttribute("aria-label",h["Operation resulted in an error."]);break;case "loadstart":case "progress":g.classList.add("core-sprite-start");g.setAttribute("aria-label",h["Operation is running."]);break;case "abort":g.classList.add("core-sprite-stop");g.setAttribute("aria-label",h["Operation is canceled."]);break;case "load":case "loadend":g.classList.add("core-sprite-ok"),g.setAttribute("aria-label","Operation ok.")}m.appendChild(g);
g=document.createElement("span");g.classList.add("operationStatus");g.textContent=f.Name;m.appendChild(g);if(f.error){var q=f.error.Message||f.error;f.error.DetailedMessage&&f.error.DetailedMessage!==""&&(q+=": "+f.error.DetailedMessage);g.textContent=q;g.classList.remove("operationStatus");g.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:f,deferred:e[a]},this,"tool");b.appendChild(d)}this._setOperationsVisibility()};c.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"};c.prototype.constructor=c;return{OperationsDialog:c}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(h,k,i,g,d){function c(b,e){if(!this._progressPane){this._progressPane=g.node(b);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:e});var a=this;this._progressPane.addEventListener("keydown",function(b){(b.charOrCode===" "||b.keyCode===g.KEY.ENTER)&&a._operationsDialog.show()})}}function b(b,e,a,f){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=a;this._operationsClient=e;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=f}c.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,e){var a=
{},f;for(f in b)b[f].progressMonitor||(a[f]=b[f]);if(this._isEmpty(a))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(f in a){var d=a[f];if(d.type&&(d.type==="loadstart"||d.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(a,e)},_isEmpty:function(b){for(var e in b)return!1;return!0}};
c.prototype.constructon=c;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new c(b,this._commandRegistry)},progress:function(b,e,a){var f=this,c=this._operationsIndex++;!a&&this._progressMonitorClass&&(a=new this._progressMonitorClass,a.begin(e));b.then(function(){if(f._operations[c]){var d=f._operations[c];if(e)d.Name=e;f._lastOperation=d;d.type="loadend";if(a)d.progressMonitor=a;f.writeOperation.bind(f)(c,d,b);d.Location||f._removeOperationFromTheList.bind(f)(c)}},
function(d){if(f._operations[c]){var g=f._operations[c];if(e)g.Name=e;if(a)g.progressMonitor=a;f._lastOperation=g;g.type=d.canceled?"abort":"error";g.error=d;f.writeOperation.bind(f)(c,g,b);g.Location||f._removeOperationFromTheList.bind(f)(c)}},function(d){if(e)d.Name=e;if(a)d.progressMonitor=a;f.writeOperation.bind(f)(c,d,b)});return b},removeOperation:function(b){for(var e in this._operations)if(this._operations[e].Location&&this._operations[e].Location===b){this._removeOperationFromTheList(e);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var e=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];e?e.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var e=this._operations[b];if(e.type&&e.type!=="loadstart"&&e.type!=="progress")(e=this._operations[b].progressMonitor)&&
e.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,e){e&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(e);var a=this;b.then(function(){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){a.setProgressResult.bind(a)(b);
return b});return this.progress(b,e)},writeOperation:function(b,e,a){this._operations[b]=e;this._operationDeferrds[b]=a;e.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(e.Location,{Name:e.Name,expires:e.expires})});e.progressMonitor?e.progressMonitor.progress(e.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/dialogs",[],function(){function h(h){this._serviceRegistry=h;this._serviceRegistration=h.registerService("orion.page.dialog",this)}h.prototype={confirm:function(h,i){i(window.confirm(h))},openFiles:function(){}};h.prototype.constructor=h;return{DialogService:h}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(h){function k(i,g){g||(g="orion.page.selection");this._serviceRegistry=i;h.attach(this);this._serviceRegistration=i.registerService(g,this);this._selections=null}k.prototype={getSelection:function(h){var g=this._getSingleSelection();typeof h==="function"&&h(g);return g},getSelections:function(h){var g=Array.isArray(this._selections)?this._selections.slice():[];typeof h==="function"&&h(g);return g},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(h){var g=this._selections;this._selections=Array.isArray(h)?h.length>0?h.slice():null:h?[h]:null;g!==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 i(b,c,e){return b[c].apply(b,e)}function g(b){this._location=b}function d(){var b=new k;b.reject(h["No Matching OperationService for location:"]+this._location);return b}function c(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var c=b.getServiceReferences("orion.core.operation"),
e=0;e<c.length;e++){var a=b.getService(c[e]);this._services[e]=a;a=c[e].getProperty("pattern")||".*";a[0]!=="^"&&(a="^"+a);this._patterns[e]=RegExp(a)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];return new g(a)}}g.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};g.prototype.constructor=g;c.prototype={getOperations:function(){var b=
new k;if(this._operations)return b.resolve(this._operations),b;var c=this;this._preferenceService.getPreferences("/operations").then(function(e){c._operations=e;b.resolve(c._operations)});return b},getOperation:function(b){return i(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],c=this,e=0;e<this._services.length;e++){var a=this._patterns[e],f=new k;b[e]=f.promise;i(this._services[e],"removeCompletedOperations").then(function(b){return function(f){Array.isArray(f)&&
c.getOperations.bind(c)().then(function(e){for(var c=e.keys(),d=0;d<c.length;d++){var g=c[d];a.test(g)&&f.indexOf(g)<0&&e.remove(g)}b.resolve()})}}(f),function(a){return function(b){a.reject(b)}}(f))}return k.all(b)},removeOperation:function(b){var c=this;return i(this._getService(b),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(e){e.remove(b)})},function(b){return b},function(b){return b})}};c.prototype.constructor=c;return{OperationsClient:c}});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function i(g){this._init(g)}i.prototype={_init:function(g){var d=g.parent,c=this,d=k.node(d);if(!d)throw h["no parent"];if(!g.model)throw h["no tree model"];if(!g.renderer)throw h["no renderer"];this._parent=d;this._treeModel=g.model;this._renderer=g.renderer;this._showRoot=g.showRoot===void 0?!1:g.showRoot;this._indent=g.indent===void 0?16:g.indent;this._onCollapse=g.onCollapse;this._labelColumnIndex=
g.labelColumnIndex===void 0?0:g.labelColumnIndex;this._id=g.id===void 0?"treetable":g.id;this._tableStyle=g.tableStyle;this._tableElement=g.tableElement||"table";this._tableBodyElement=g.tableBodyElement||"tbody";this._tableRowElement=g.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){c._showRoot?(b._depth=0,c._generate([b],0)):c._treeModel.getChildren(b,function(b){c._generate(b,0)})})},_generate:function(g,d){k.empty(this._parent);var c=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(c);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(g,d);b.appendChild(this._bodyElement);c.appendChild(b);
this._parent.appendChild(c);this._rowsChanged()},_generateChildren:function(g,d,c){for(var b=0;b<g.length;b++){var j=document.createElement(this._tableRowElement);j.id=this._treeModel.getId(g[b]);this._renderer.rowCallback&&this._renderer.rowCallback(j);j._depth=d;j._item=g[b];this._renderer.render(g[b],j);j.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*d+"px";c?(this._bodyElement.insertBefore(j,c.nextSibling),c&&(c=j)):this._bodyElement.appendChild(j)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(g,d,c){var b=this._treeModel.getId(g),j;if(b===this._id)this._removeChildRows(b),this._generateChildren(d,0),this._rowsChanged();else{var e=k.node(b);e?(e._item=g,e&&(c||e._expanded)?(e._expanded=!0,this._removeChildRows(b),this._renderer.updateExpandVisuals(e,!0),d?(this._generateChildren(d,e._depth+1,e),this._rowsChanged()):(j=this,d=this._treeModel.getChildren(e._item,function(a){j._generateChildren(a,
e._depth+1,e);j._rowsChanged()}))):this._renderer.updateExpandVisuals(e,!1)):console.log(h["could not find table row "]+b)}},getItem:function(g){var d=k.node(g);return d&&d._item?d._item:g},toggle:function(g){var d=k.node(g);d&&(d._expanded?(this.collapse(g),this._renderer.updateExpandVisuals(d,!1)):(this.expand(g),this._renderer.updateExpandVisuals(d,!0)))},isExpanded:function(g){return(g=k.node(g))?g._expanded:!1},expand:function(g,d,c){var g=typeof g==="string"?g:this._treeModel.getId(g),b=k.node(g);
if(b&&!b._expanded){b._expanded=!0;var j=this;this._renderer.updateExpandVisuals(b,!0);this._treeModel.getChildren(b._item,function(e){j._generateChildren(e,b._depth+1,b);j._rowsChanged();d&&d.apply(j,c)})}},_removeChildRows:function(g){for(var d=g===this._id,c=!1,b=-1,j=[],e=k.$$array(".treeTableRow",this._parent),a=0;a<e.length;a++){var f=e[a];if(c)break;if(d)f._depth>b?j.push(f):c=!0;else if(f.id===g)d=!0,b=f._depth}for(g=0;g<j.length;g++)d=j[g],d.parentNode.removeChild(d)},collapse:function(g){var g=
typeof g==="string"?g:this._treeModel.getId(g),d=k.node(g);if(d){if(!d._expanded)return;d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(g);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var h={};h.TreeModelIterator=function(){function h(i,g){this.firstLevelChildren=i;this.reset();this._init(g)}h.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var g=this._getChildren(h),g=g&&g.length>0;this.isExpanded&&g&&(g=this.isExpanded(h));return g},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(this._getChildren(h)[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var g=this._diveIn(this._cursor);
if(!g){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(c){c&&d.setCursor(c)})}(g=this._findSibling(this._cursor,!0))&&this.setCursor(g)}return g},_backward:function(h){if(!this._cursor)return null;var g=this._findSibling(this._cursor,!1);g&&g!==this._cursor.parent&&(g=this._drillToLast(g));if(h&&g&&this._expandable(g)&&this.forceExpandFunc&&g!==this._cursor.parent){var d=this;return this.forceExpandFunc(g,"last",function(c){c&&
d.setCursor(c)})}g&&this.setCursor(g);return g},_findSibling:function(h,g){for(var d=this.topLevel(h),c=this._getChildren(h.parent),c=d?this.firstLevelChildren:c,b=0;b<c.length;b++)if(c[b]===h)return b===0&&!g?d?null:h.parent:b===c.length-1&&g?d?null:this._findSibling(h.parent,g):g?c[b+1]:c[b-1];return null},_inParentChain:function(h,g){for(var d=h.parent;d;){if(d===g)return!0;d=d.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;
h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,g,d){this.setCursor(g);var c=[];for(c.push(g);;){if(this.iterate(h))c.push(this.cursor());else break;if(d===this.cursor())return c}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(h,g){var d=this.cursor(),
c=this._scan(!0,h,g);c||(c=this._scan(!1,h,g));this.setCursor(d);return c},iterate:function(h,g){return h?this._forward(g):this._backward(g)},iterateOnTop:function(h,g){var d=this._findSibling(this._getTopLevelParent(this.cursor()),h);d?this.setCursor(d):g&&this.firstLevelChildren.length>0&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){if(!this._cursor)return null;return this._inParentChain(this._cursor,h)?(this.setCursor(h),
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,i){var h={},g=navigator.userAgent.indexOf("iPad")!==-1,d=window.navigator.platform.indexOf("Mac")!==-1;h.ExplorerNavHandler=function(){function c(b,c,e){this.explorer=b;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;var a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var f=this;this._modelIterator=new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return f.explorer.renderer.isExpandable(a)}:function(a){return f.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,e){return f.explorer.forceExpandFunc(a,b,e)}:void 0});this._init(e);(!e||e.setFocus!==!1)&&a.focus();b=function(b){if(b.target===a){if(f.explorer.preventDefaultFunc&&f.explorer.preventDefaultFunc(b,
f._modelIterator.cursor()))return!0;if(b.keyCode===k.KEY.DOWN)return f.onDownArrow(b);else if(b.keyCode===k.KEY.UP)return f.onUpArrow(b);else if(b.keyCode===k.KEY.RIGHT)return f.onRightArrow(b);else if(b.keyCode===k.KEY.LEFT)return f.onLeftArrow(b);else if(b.keyCode===k.KEY.SPACE)return f.onSpace(b);else if(b.keyCode===k.KEY.ENTER)return f.onEnter(b)}};a.addEventListener("keydown",b,!1);this._listeners.push({type:"keydown",listener:b});b=function(){if(f.explorer.onFocus)f.explorer.onFocus(!1);else f.toggleCursor(null,
!1)};a.addEventListener("blur",b,!1);this._listeners.push({type:"blur",listener:b});b=function(){if(f.explorer.onFocus)f.explorer.onFocus(!0);else f.toggleCursor(null,!0)};a.addEventListener("focus",b,!1);this._listeners.push({type:"focus",listener:b});this._parentDiv=a}c.prototype={_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=
b.postDefaultFunc},_ctrlKeyOn:function(b){return d?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},
isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(e){c._clearSelection();for(var a=0;a<e.length;a++)c._selections.push(e[a]);c._selections.length>0&&c.cursorOn(c._selections[0],!0,!1,b)})},refreshModel:function(b,c,e,a){this._currentColumn=
0;this.topIterationNodes=[];this.model=c;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(e)this.topIterationNodes=e;this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var b=this.model.getId(b),c=0;c<this._selections.length;c++)if(b===this.model.getId(this._selections[c]))return c;
return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},setSelection:function(b,c){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){if(!c||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b;else{var e=this._inSelection(b);e>=0?(this._checkRow(b,
!0),this._selections.splice(e,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,c){b||(b=this.currentModel());var e=this._getGridChildren(b);if(e&&e.length>1||c===0&&e){c!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,f=!0;a+=c;a<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():f=!1),
a=f?e.length-1:this._currentColumn):a>=e.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():f=!1),a=f?0:this._currentColumn);this._currentColumn=a;c!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var c=
this._parentDiv,e;b&&b!==c&&(e=b.getAttribute("role"))!=="grid"&&e!=="tree"&&e!=="treegrid";)b=b.parentNode;return b===c?null:b},toggleCursor:function(b,c){var e=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(e&&(c?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),a.domNode&&(e=this.getAriaContainerElement(a.domNode),c?(a.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):
e&&(c?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,c,e,a){var e=e===void 0?!1:e,f,d;if(b||c){if(d===this._modelIterator.cursor())return;f=this._modelIterator.cursor();d=b;this._modelIterator.setCursor(d)}else f=this._modelIterator.prevCursor(),d=this._modelIterator.cursor();if(f!==d||c)if(this.toggleCursor(f,!1),!c||d)if(this.moveColumn(null,0),this.toggleCursor(d,
!0),(b=this.getRowDiv())&&!a&&!this._visible(b)&&b.scrollIntoView(!e),this.explorer.onCursorChanged)this.explorer.onCursorChanged(f,d)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],c=0;c<this._selections.length;c++)b.push(this.model.getId(this._selections[c]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),c=this._navDict.getValue(b);return c&&c.rowDomNode?c.rowDomNode:k.node(b)},iterate:function(b,
c,e){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,c)&&(this.cursorOn(null,!1,b),e&&this.setSelection(this.currentModel(),!0))},_checkRow:function(b,c){if(this.explorer.renderer._useCheckboxSelection){var e=this.getRowDiv(b);if(e){var a=k.node(this.explorer.renderer.getCheckBoxId(e.id)),f=c?!a.checked:!0;if(f!==a.checked)this.explorer.renderer.onCheck(e,a,f,!0)}}else this._select(b,c)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(b){return(b=k.node(b))?k.bounds(b).height:0},_visible:function(b){if(b.offsetWidth===0||b.offsetHeight===0)return!1;var c=0;c+=this._getToolBarHeight("staticBanner");c+=this._getToolBarHeight("titleArea");c+=this._getToolBarHeight("pageToolbar");var e=this._getEventListeningDiv(!0).getClientRects()[0],a=this._vpHeight();this._vpWidth();for(var c=e.top>c?e.top:
c,e=e.bottom<a?e.bottom:a,b=b.getClientRects(),a=0,f=b.length;a<f;a++){var d=b[a];if(d.top>=c&&d.top<=e&&d.bottom>=c&&d.bottom<=e)return!0}return!1},_select:function(b){b||(b=this._modelIterator.cursor());var c=this.getRowDiv(b);c&&(this._inSelection(b)<0?c.classList.add("checkedRow"):c.classList.remove("checkedRow"))},_onModelGrid:function(b,c){var e=this._getGridChildren(b);if(e)for(var a=0;a<e.length;a++)if(c.target===e[a].domNode)return!0;return!1},onClick:function(b,c){var e=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));
if(c.target!==e&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,c)))if(this.cursorOn(b,!0,!1,!0),g)this.setSelection(b,!0);else if(this._ctrlKeyOn(c))this.setSelection(b,!0);else if(c.shiftKey&&this._lastSelection){if(e=this._modelIterator.scan(this._lastSelection,b)){this._clearSelection(!0);for(var a=0;a<e.length;a++)this.setSelection(e[a],!0)}}else this.setSelection(b,!1)},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,
!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},_shouldMoveColumn:function(b){var c=this.currentModel(),e=this._getGridChildren(c);return e&&e.length>1?this.isExpandable(c)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,
-1),b.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&this.isExpanded(c))return this.explorer.myTree.collapse(c),b.preventDefault(),!0;this._modelIterator.topLevel(c)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(c.parent),this.setSelection(c.parent,!1))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var c=this._modelIterator.cursor();
if(!c)return!1;if(this.isExpandable(c)&&!this.isExpanded(c))return this.explorer.myTree.expand(c),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0);b.preventDefault()},onEnter:function(b){var c=this.getCurrentGrid(this._modelIterator.cursor());if(c)if(c.widget)if(typeof c.onClick==="function")c.onClick();else typeof c.widget.focus==="function"&&c.widget.focus();
else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);c.domNode.dispatchEvent(e)}else if(this.explorer.renderer.getRowActionElement&&(c=this._modelIterator.cursor()))if(c=this.explorer.renderer.getRowActionElement(this.model.getId(c)),c.href)this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.href}};return c}();h.ExplorerNavDict=function(){function c(b){this._dict={};this._model=b}c.prototype={addRow:function(b,
c){this._dict[this._model.getId(b)]={model:b,rowDomNode:c}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,c){if(!b)return null;var e=this._model.getId(b);if(this._dict[e]){if(!this._dict[e].gridChildren&&c)this._dict[e].gridChildren=[];return this._dict[e].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);if(this._dict[b])this._dict[b].gridChildren=null}};return c}();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,i,g,d,c){var b={};b.Explorer=function(){function b(e,a,f,c){this.registry=e;this.renderer=f;this.selection=a;this.commandService=c;this.myTree=null}b.prototype={changedItem:function(b,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,a,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},
makeNewItemPlaceHolder:function(b,a,f){b=this.getRow(b);if(f)return b=b.childNodes[f],b.appendChild(document.createElement("br")),f=document.createElement("span"),f.id=a+"placeHolderRow",b.appendChild(f),{tempNode:f,refNode:f};if(b){f=document.createElement("tr");f.id=a+"placeHolderRow";var c=document.createElement("td");c.id=a+"placeHolderCol";f.appendChild(c);b.appendChild(f);f=i.node(a+"placeHolderRow");b=i.node(a+"placeHolderCol");if(f&&b)return{tempNode:f,refNode:b}}return null},getRow:function(b){if(b=
this.model.getId(b))return i.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this.myTree.collapse(b[a])},expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this._expandRecursively(b[a])},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var a=this;this.myTree.expand(b,function(){a.model.getChildren(b,function(b){if(!(b===
void 0||b===null))for(var e=b.length,c=0;c<e;c++)a._expandRecursively(b[c])})})}},createTree:function(b,a,f){b=typeof b==="string"?b:b.id||b;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var c=b+"innerTree",j=i.node(c);j&&i.empty(j);if(a)a.rootId=c;this.model=a;this._parentId=b;this._treeOptions=f;if(!f||f&&!f.noSelection)this.selectionPolicy=f?f.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new g.TableTree({id:c,
model:a,parent:b,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:f?!!f.showRoot:!1,indent:f?f.indent:void 0,onCollapse:f?f.onCollapse:void 0,navHandlerFactory:f?f.navHandlerFactory:void 0,tableElement:f?f.tableElement:void 0,tableBodyElement:f?f.tableBodyElement:void 0,tableRowElement:f?f.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 b=this.getNavHandler(),a=[];if(b&&this.getNavDict())for(var f=b.getSelection(),c=0;c<f.length;c++){var d=b.getRowDiv(f[c]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(f[c])),d.model&&a.push(d.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var b=this._treeOptions;if(!b||b&&!b.noSelection){if(!this.getNavHandler())this._navHandler=
b&&b.navHandlerFactory&&typeof b.navHandlerFactory.createNavHandler==="function"?b.navHandlerFactory.createNavHandler(this,this._navDict,b):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var a=this;this.model.getRoot(function(f){f instanceof Array?a.getNavHandler().refreshModel(a.getNavDict(),a.model,f):f.children&&f.children instanceof Array&&a.getNavHandler().refreshModel(a.getNavDict(),a.model,
f.children);b&&b.setFocus&&a.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,e){function a(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?e?e(a):!0:!1:!1}var f=new c.Command({tooltip:h["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return a(b)},callback:function(a){a.items.expandAll()}}),d=new c.Command({tooltip:h["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return a(b)},callback:function(a){a.items.collapseAll()}});b.addCommand(f);b.addCommand(d)};b.ExplorerModel=function(){function b(e,a,f){this.rootPath=e;this.fetchItems=a;this.idPrefix=f||""}b.prototype={destroy:function(){},getRoot:function(b){var a=this;this.fetchItems(this.rootPath).then(function(f){a.root=f;b(f)})},getChildren:function(b,a){b.Children?a(b.Children):b.ChildrenLocation?
this.fetchItems(b.ChildrenLocation).then(function(f){b.Children=f;a(f)}):a([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),a=this.idPrefix,f=0;f<b.length;f++)a+=b[f].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(f):b[f];return a}};return b}();b.ExplorerFlatModel=function(){function c(b,a,f){this.rootPath=b;this.fetchItems=a;this.root=f}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(b){if(this.root)b(this.root);else{var a=
this;this.fetchItems(this.rootPath).then(function(f){a.root=f;b(f)})}};c.prototype.getChildren=function(b,a){b===this.root?a(this.root):a([])};return c}();b.ExplorerRenderer=function(){function b(c,a){this.explorer=a;this._init(c);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(b){if(b){this._useCheckboxSelection=b.checkbox===void 0?!1:b.checkbox;this.selectionPolicy=b.singleSelection?
"singleSelection":"";this._cachePrefix=b.cachePrefix;this.getCheckedFunc=b.getCheckedFunc;this.onCheckedFunc=b.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=b.treeTableClass||"treetable";if(b.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=b.actionScopeId;if(!this.commandService)this.commandService=b.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(b,a){this.tableTree=a;i.empty(b);this._treeTableClass&&
b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,a,f,c,d){var f=f||"tool",g=document.createElement("td");g.id=a.id+"actionswrapper";c&&g.classList.add(c);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,b,this.explorer,f,null,d&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!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(b,a){if(this._useCheckboxSelection){var f=document.createElement("td"),c=document.createElement("span");c.id=this.getCheckBoxId(a.id);c.classList.add("core-sprite-check");c.classList.add("selectionCheckmarkSprite");c.rowId=a.id;if(this.getCheckedFunc)c.checked=this.getCheckedFunc(b),c.checked?(this._highlightSelection&&a.classList.add("checkedRow"),c.classList.add("core-sprite-check_on")):
(this._highlightSelection&&a.classList.remove("checkedRow"),c.classList.remove("core-sprite-check_on"));f.appendChild(c);var d=this;c.addEventListener("click",function(b){d.onCheck(a,b.target,b.target.checked?!1:!0,!0)},!1);return f}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,a,f,c,d){(a.checked=f)?a.classList.add("core-sprite-check_on"):a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,f,c);this.explorer.getNavHandler()&&d&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){b=window.sessionStorage[b+"selection"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var a;if(b&&this.explorer.getNavDict()){var f=[];for(a=0;a<b.length;a++){var c=this.explorer.getNavDict().getValue(b[a]);if(c&&c.rowDomNode&&
c.model&&(f.push(c.model),this._highlightSelection&&c.rowDomNode.classList.add("checkedRow"),c=i.node(this.getCheckBoxId(c.rowDomNode.id))))c.checked=!0,c.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(f),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var a=!1,f=window.sessionStorage[b+
"expanded"];typeof f==="string"&&(f=f.length>0?JSON.parse(f):null);var c;if(f)for(c=0;c<f.length;c++)if(i.node(f[c])){this._expanded.push(f[c]);var d=this;this.tableTree.expand(f[c],function(){d._restoreSelections(b)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var b=this.explorer.getRootPath();if(this._cachePrefix&&b)return"/"+this._cachePrefix+"/"+b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(b){return b+"__expand"},updateExpandVisuals:function(b,
a){var f=i.node(this.expandCollapseImageId(b.id));f&&(f.classList.add(a?this._expandImageClass:this._collapseImageClass),f.classList.remove(a?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(b,a,f,c){var d=document.createElement("span");d.id=this.expandCollapseImageId(b.id);a.appendChild(d);d.classList.add(this._twistieSpriteClass);d.classList.add(this._collapseImageClass);if(f){var g=document.createElement("span");a.appendChild(g);g.classList.add(c||"imageSprite");g.classList.add(f)}var j=
this;d.onclick=function(){j.tableTree.toggle(b.id);if(j.tableTree.isExpanded(b.id))j._expanded.push(b.id);else for(var a in j._expanded)if(j._expanded[a]===b.id){j._expanded.splice(a,1);break}(a=j._getUIStatePreferencePath())&&window.sessionStorage&&j._storeExpansions(a)};return d},render:function(b,a){a.classList.add("navRow");this.renderRow(b,a)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var b=
i.$$array(".treeTableRow"),a=0;a<b.length;a++){var f=b[a],c=i.node(f.id+"actionswrapper");this.commandService.destroy(c);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,c,f._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};return b}();b.SelectionRenderer=function(){function c(b,a){this._init(b);this.explorer=a}c.prototype=new b.ExplorerRenderer;
c.prototype.renderTableHeader=function(b){var a=document.createElement("thead"),f=document.createElement("tr");a.classList.add("navTableHeading");this._useCheckboxSelection&&f.appendChild(this.initCheckboxColumn(b));for(var c=0,d=this.getCellHeaderElement(c);d;)d.innerHTML.length>0&&d.classList.add("navColumn"),f.appendChild(d),d=this.getCellHeaderElement(++c);a.appendChild(f);c>0&&b.appendChild(a)};c.prototype.renderRow=function(b,a){a.verticalAlign="baseline";a.classList.add("treeTableRow");var f=
this.explorer.getNavDict();if(f){f.addRow(b,a);var c=this;a.addEventListener("click",function(a){if(c.explorer.getNavHandler())c.explorer.getNavHandler().onClick(b,a)},!1)}if(f=this.getCheckboxColumn(b,a))f.classList.add("checkColumn"),a.appendChild(f);for(var f=0,d=this.getCellElement(f,b,a);d;)a.appendChild(d),f===0?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle()):d.classList.add("navColumn"):this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),
d=this.getCellElement(++f,b,a)};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();b.SimpleFlatModel=function(){function c(b,a,f){this.items=b;this.getKey=f;this.idPrefix=a;this.root={children:b}}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(b){b(this.root)};c.prototype.destroy=function(){};c.prototype.getId=function(b){for(var b=this.getKey(b).replace(/[\\\/]/g,""),a="",f=0;f<b.length;f++)a+=b[f].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(f):
b[f];return this.idPrefix+a};c.prototype.getChildren=function(b,a){b===this.root?a(this.items):a([])};return c}();return b});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(h,k,i,g,d,c){function b(b,a,f,d,g,j,h){var i;if(a.Directory)i=document.createElement("a"),i.className="navlinkonpage",i.href=b+"#"+a.ChildrenLocation,i.appendChild(document.createTextNode(a.Name));else{g||(g=c.getOpenWithCommands(f));if(!j)for(b=0;b<g.length;b++)g[b].isEditor===
"default"&&(j=g[b]);i=document.createElement("a");i.className="navlink targetSelector";h&&typeof h==="object"&&Object.keys(h).forEach(function(a){i[a]=h[a]});i.appendChild(document.createTextNode(a.Name));for(var p=a.Location,r=!1,b=0;b<g.length;b++)if(f=g[b],f.visibleWhen(a)){p=f.hrefCallback({items:a});r=!0;break}k.when(d.getFileContentType(a),function(b){var f;if(f=!r)if(f=j){a:{switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":f=
!0;break a}f=!1}f=!f}f&&(p=j.hrefCallback({items:a}));f=i;var c=a.Location,e;switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":e=document.createElement("img");e.src=c;e.classList.add("thumbnail");break;default:b&&b.image?(e=document.createElement("img"),e.src=b.image,e.classList.add("thumbnail")):(e=document.createElement("span"),e.className="core-sprite-file_model modelDecorationSprite")}f.firstChild?f.insertBefore(e,f.firstChild):
f.appendChild(e);i.href=p})}return i}function j(b,a,f,c){this.explorer=a;this.commandService=f;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=b.actionScopeId;this._init(b);this.target="_self"}j.prototype=new g.SelectionRenderer;j.prototype.wrapperCallback=function(b){b.setAttribute("role","tree")};j.prototype.tableCallback=function(b){b.setAttribute("aria-label",h.Navigator);b.setAttribute("role","presentation")};j.prototype.rowCallback=function(b){b.setAttribute("role","treeitem")};
j.prototype.getCellHeaderElement=function(b){if(this.oneColumn&&b!==0)return null;switch(b){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};j.prototype.setTarget=function(b){this.target=b};j.prototype.createFolderNode=function(c){var a;this.showFolderLinks?a=b(this.folderLink||"",c,this.commandService,this.contentTypeService):(a=document.createElement("span"),a.textContent=c.Name);return a};j.prototype.showFolderLinks=!0;j.prototype.getCellElement=function(e,a,f){switch(e){case 0:var e=
document.createElement("td"),g=document.createElement("span");g.id=f.id+"MainCol";g.setAttribute("role","presentation");e.appendChild(g);e.setAttribute("role","presentation");g.className="mainNavColumn";var j;if(a.Directory)this.getExpandImage(f,g),j=this.createFolderNode(a),g.appendChild(j),this.explorer._makeDropTarget(a,j),this.explorer._makeDropTarget(a,f);else{if(!this.openWithCommands){this.openWithCommands=c.getOpenWithCommands(this.commandService);for(j=0;j<this.openWithCommands.length;j++)if(this.openWithCommands[j].isEditor===
"default")this.defaultEditor=this.openWithCommands[j]}j=b("",a,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});g.appendChild(j)}if(j)j.id=f.id+"NameLink",j.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),a,j),j.setAttribute("role","link"),j.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,"tool",null,!0);return e;case 1:if(this.oneColumn)return null;f=document.createElement("td");
if(a.LocalTimeStamp)f.textContent=(new Date(a.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!a.Directory&&typeof a.Length==="number")a=parseInt(a.Length,10)/1024,f.textContent=Math.ceil(a).toLocaleString()+" KB";f.style.textAlign="right";return f}};j.prototype.constructor=j;return{NavigatorRenderer:j,createLink:b}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(h,k,i,g,d,c,b,j,e){function a(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function f(b){this.registry=b.serviceRegistry;this._commandService=b.commandService;this._fileService=b.fileService;this.defaultRenderer=new a(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}a.prototype.makeRenderFunction=function(a,f,c,d,s){var p=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||j.createOpenWithCommands(p,a,r);var t=this;return function(o,j,x){e.when(t.openWithCommands,function(e){if(x)i.empty(f),e=document.createElement("div"),e.appendChild(document.createTextNode(h["Search failed."])),f.appendChild(e),typeof d==="function"&&d(f);else{var w=
function(){function a(b,f){var c=f.folderName?f.folderName:f.path,e=document.createElement("span");e.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+c+" "));b.appendChild(e)}var b={};return function(f,c){var e=c.name;if(b.hasOwnProperty(e)){a(f,c);var d=b[e];typeof d==="function"&&(b[e]=null,d())}else b[e]=function(){a(f,c)}}}(),D=!1;i.empty(f);if(o&&o.length>0){var z=document.createElement("table");z.setAttribute("role","presentation");for(var E=0;E<o.length;E++){var A=
o[E],G;if(!D&&(D=!0,c))G=z.insertRow(0).insertCell(0),G.textContent=c;G=z.insertRow(-1).insertCell(0);G.colspan=2;s&&s(G);var p={Name:A.name,Directory:A.directory,Location:A.path||A.location},p=b.createLink(k.toUrl("navigate/table.html"),p,r,a,e,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+")"));G.appendChild(p);w(G,A)}f.appendChild(z);typeof d===
"function"&&d(f)}!D&&j&&(e=g.formatMessage(h["No matches found for ${0}"],j),i.empty(f),f.appendChild(document.createTextNode(e)),typeof d==="function"&&d(f))}})}};f.prototype={search:function(a,b,f){var e=function(a){for(var b=[],f=0;f<a.response.docs.length;f++){var c=a.response.docs[f];b.push({name:c.Name,path:c.Location,folderName:d.path2FolderName(c.Path?c.Path:c.Location,c.Name),directory:c.Directory,lineNumber:c.LineNumber})}return b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,
function(a){f(e(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);f(e(b),c)},function(a){f(null,null,a)})}catch(g){typeof g==="string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(a){f(e(a),null)}):typeof g==="string"&&g.indexOf("search")>-1&&!a.nameSearch?(new c.SearchCrawler(this.registry,this._fileService,
a,{childrenLocation:this.getChildrenLocation()})).search(function(a){f(e(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);i.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var f="",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),f=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),f=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;c=i.node("search");f||(f="");if(c&&c.placeholder){c.value="";var e=g.formatMessage(h["Search ${0}"],f);c.placeholder=e.length>30?e.substring(0,27)+"...":g.formatMessage(h["Search ${0}"],
f)}if(c&&c.title)c.title=h["Type a keyword or wild card to search in "]+f},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,f,c){f=f?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:f,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:f,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}}};f.prototype.constructor=f;return{Searcher:f}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(h,k){function i(d,c,b,g){h("GET",d,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=e.response?JSON.parse(e.response):null;c.progress(e);!e.type||e.type==="loadstart"||e.type==="progress"?setTimeout(function(){i(d,c,b,g)},2E3):(e.type==="error"||e.type==="abort"?c.reject(g?g(e):e.Result):c.resolve(b?b(e):e.Result.JsonData),e.Location||h("DELETE",d,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(b){var a=b;if(b.responseText!==
void 0){a=b.responseText;try{a=JSON.parse(b.responseText)}catch(f){}}a.Message!==void 0?(a.HttpCode=a.HttpCode===void 0?b.status:a.HttpCode,a.Severity=a.Severity===void 0?"Error":a.Severity,c.reject(a)):c.reject({Severity:"Error",Message:a,HttpCode:b.status})})}function g(d,c){c.then(null,function(b){b instanceof Error&&b.name==="Cancel"&&h("PUT",d,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(d,c,b){var j=new k;g(d,j);i(d,j,c,b);return j}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(h,k,i,g){var d=d||{};d.GitService=function(){function c(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this),this._sshService=b.getService("orion.net.ssh")}c.prototype={checkGitService:function(){},cloneGitRepository:function(b,c,e,a,f,d,g,m,q,s){var p=this,r={};if(b)r.Name=b;if(e)r.Path=e;if(c)r.GitUrl=c;r.Location=a;if(f)r.GitSshUsername=f;if(d)r.GitSshPassword=
d;if(g)r.GitSshKnownHost=g;if(m)r.GitSshPrivateKey=m;if(q)r.GitSshPassphrase=q;if(s){if(s.GitMail)r.GitMail=s.GitMail;if(s.GitName)r.GitName=s.GitName}var b=h.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),t=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(r)}).then(function(a){p._getGitServiceResponse(t,a)},function(a){p._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(b){var c=this,e=
new i;k("DELETE",b,{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},getGitStatus:function(b){var c=this,e=new i;k("GET",b,{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},stage:function(b){var c=
this,e=new i;k("PUT",b,{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},stageMultipleFiles:function(b,c){var e=this,a=new i;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,
b)});return a},unstageAll:function(b,c){var e=this,a=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},unstage:function(b,c){var e=this,a=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(b){e._getGitServiceResponse(a,
b)},function(b){e._handleGitServiceResponseError(a,b)});return a},checkoutPath:function(b,c){var e=this,a=new i;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c,RemoveUntracked:"true"})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},commitAll:function(b,c,e){var a=this,f=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:e}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},getGitClone:function(b){var c=this,e=new i;k("GET",b,{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},getGitCloneConfig:function(b){var c=this,e=new i;k("GET",b,{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},getGitBranch:function(b){var c=this,e=new i;k("GET",b,{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},getGitRemote:function(b){var c=this,e=new i;k("GET",b,{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},checkoutBranch:function(b,c){var e=this,a=new i;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},resetIndex:function(b,c){var e=this,a=new i;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:c,Reset:"HARD"})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},addBranch:function(b,c,e){var a=this,f={};if(c)f.Name=c;if(e)f.Branch=e;var d=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(b){a._getGitServiceResponse(d,b)},function(b){a._handleGitServiceResponseError(d,
b)});return d},removeBranch:function(b){var c=this,e=new i;k("DELETE",b,{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},addRemote:function(b,c,e){var a=this,f=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:c,RemoteURI:e})}).then(function(b){a._getGitServiceResponse(f,
b)},function(b){a._handleGitServiceResponseError(f,b)});return f},removeRemote:function(b){var c=this,e=new i;k("DELETE",b,{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},doGitLog:function(b){var c=this,e=new i;k("GET",b,{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},getDiff:function(b,c){var e=this,a=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},doFetch:function(b,c,e,a,f,d,g){var h=this,q=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:c,GitSshUsername:e,GitSshPassword:a,GitSshKnownHost:f,GitSshPrivateKey:d,GitSshPassphrase:g})}).then(function(a){h._getGitServiceResponse(q,a)},function(a){h._handleGitServiceResponseError(q,a)});return q},doPull:function(b,c,e,a,f,d,g){var h=this,q=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:c,GitSshUsername:e,GitSshPassword:a,GitSshKnownHost:f,GitSshPrivateKey:d,
GitSshPassphrase:g})}).then(function(a){h._getGitServiceResponse(q,a)},function(a){h._handleGitServiceResponseError(q,a)});return q},doMerge:function(b,c,e){var a=this,f=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:c,Squash:e})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},doCherryPick:function(b,c){var e=this,a=new i;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},doRebase:function(b,c,e){var a=this,f={};f.Rebase=c;if(e)f.Operation=e;var d=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(b){a._getGitServiceResponse(d,b)},function(b){a._handleGitServiceResponseError(d,
b)});return d},doPush:function(b,c,e,a,f,d,g,h,q){var s=this,p=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:c,PushTags:e,Force:a,GitSshUsername:f,GitSshPassword:d,GitSshKnownHost:g,GitSshPrivateKey:h,GitSshPassphrase:q})}).then(function(a){s._getGitServiceResponse(p,a)},function(a){s._handleGitServiceResponseError(p,a)});return p},getLog:function(b,c){var e=this,a=new i,f=new i;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(a){f.resolve(a.xhr.getResponseHeader("Location"))},function(b){e._handleGitServiceResponseError(a,b)});f.then(function(b){k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)})});return a},getDefaultRemoteBranch:function(b){var c=this,e=new i,a=new i;
k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(a,b)},function(a){c._handleGitServiceResponseError(e,a)});a.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){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)})});return e},doAddTag:function(b,c){var e=this,a=new i;k("PUT",
b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},doRemoveTag:function(b){var c=this,e=new i;k("DELETE",b,{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},checkoutTag:function(b,
c,e){var a=this,f=new i;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:c,Branch:e})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},addCloneConfigurationProperty:function(b,c,e){var a=this,f=new i;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:c,Value:e})}).then(function(b){a._getGitServiceResponse(f,
b)},function(b){a._handleGitServiceResponseError(f,b)});return f},editCloneConfigurationProperty:function(b,c){var e=this,a=new i;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:c})}).then(function(b){e._getGitServiceResponse(a,b)},function(b){e._handleGitServiceResponseError(a,b)});return a},deleteCloneConfigurationProperty:function(b){var c=this,e=new i;k("DELETE",b,{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},sendCommitReviewRequest:function(b,c,e,a,f,d){var g=this,h=new i;k("POST",c,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:a,ReviewReqNotifyLogin:e,ReviewReqAuthorName:f,ReviewMessage:d})}).then(function(a){g._getGitServiceResponse(h,a)},function(a){g._handleGitServiceResponseError(h,
a)});return h},_getGitServiceResponse:function(b,c){var e=c.response?JSON.parse(c.response):null;if(c.xhr&&c.xhr.status===202){var a=g.handle(e.Location);a.then(b.resolve,function(a){a.failedOperation=e.Location;b.reject(a)},b.progress);b.then(null,function(b){a.reject(b)})}else b.resolve(e)},_handleGitServiceResponseError:function(b,c){b.reject(c)}};return c}();return d});
define("orion/ssh/sshTools",[],function(){var h=h||{};h.SshService=function(){function h(i){if(i)this._serviceRegistry=i,this._serviceRegistration=i.registerService("orion.net.ssh",this)}h.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(h,g){g||(g="");var d=localStorage.getItem(g+this._KNOWN_HOSTS);d?d.indexOf(h)<0&&localStorage.setItem(g+this._KNOWN_HOSTS,d+"\n"+h):localStorage.setItem(g+this._KNOWN_HOSTS,h)},clearKnownhosts:function(h){h||(h="");localStorage.removeItem(h+this._KNOWN_HOSTS)},
getKnownHosts:function(h){h||(h="");return localStorage.getItem(h+this._KNOWN_HOSTS)}};return h}();return h});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(h,k,i,g){function d(b,c){var e=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!c.id)throw Error("Missing required argument: id");this.id=c.id;if(!c.title)throw Error("Missing required argument: title");var a=c.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");b.appendChild(this.domNode);for(var f=0;f<a.length;f++)this.domNode.classList.add(a[f]);this.domNode.id=c.id;if(c.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===e.titleNode||a.target===e.twistie)&&e._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===h.KEY.ENTER&&(a.target===e.domNode||a.target===e.titleNode||a.target===e.twistie)&&e._changeExpandedState()},!1);if(c.iconClass){var d=document.createElement("span");d.classList.add("sectionIcon");this.domNode.appendChild(d);(Array.isArray(c.iconClass)?c.iconClass:[c.iconClass]).forEach(function(a){d.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=c.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=c.title;if(typeof c.getItemCount==="function")a=document.createElement("div"),a.classList.add("layoutLeft"),a.classList.add("sectionItemCount"),this.domNode.appendChild(a),a.textContent=c.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
c.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);a=document.createElement("div");a.id=c.id+"FilterSearchBox";this.domNode.appendChild(a);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=c.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=c.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);c.slideout&&(a=g.slideoutHTMLFragment(c.id),f=document.createRange(),f.selectNode(this.domNode),a=f.createContextualFragment(a),this.domNode.appendChild(a));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);b.appendChild(this._contentParent);c.content&&this.setContent(c.content);
this.hidden=c.hidden;if(typeof c.onExpandCollapse==="function")this._onExpandCollapse=c.onExpandCollapse;this._preferenceService=c.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var n=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(n.id);if(a!==void 0)n.hidden=!a;if(!n.hidden)n._contentParent.style.display="block";n._updateExpandedState(!n.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=c.commandService;this._lastMonitor=0;this._loading={}}function c(b){this._section=b;this._id=++b._lastMonitor}d.prototype={setTitle:function(b){this.titleNode.textContent=b},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new c(this)},_setMonitorMessage:function(b,c){this._progressNode.style.visibility=
"visible";this._loading[b]=c;var e="",a;for(a in this._loading)e!==""&&(e+="\n"),e+=this._loading[a];this._progressNode.title=e},_monitorDone:function(b){delete this._loading[b];var b="",c;for(c in this._loading)b!==""&&(b+="\n"),b+=this._loading[c];this._progressNode.title=b;if(b==="")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(b,c){var e=this.twistie,a=this.id;e&&(e.classList.add(b?this._expandImageClass:this._collapseImageClass),e.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(a,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};d.prototype.constructor=d;c.prototype={begin:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},worked:function(b){this.status=
b;this._section._setMonitorMessage(this.id,b)},done:function(b){this.status=b;this._section._monitorDone(this.id)}};c.prototype.constructor=c;return{Section:d}});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(h,k,i,g){var d={};d.CompareCommandFactory=function(){function c(b){this.setOptions(b,!0)}c.prototype={setOptions:function(b,c){if(c)this.options={};if(!this.options)this.options={};b&&Object.keys(b).forEach(function(c){this.options[c]=b[c]}.bind(this))},getOptions:function(){return this.options},initCommands:function(b){var c=this.options.commandSpanId,e=
this.options.commandService;if(e&&c){var a=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 b.type==="twoWay"&&b.options.newFile&&!b.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),f=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 b.type==="twoWay"&&b.options.oldFile&&!b.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),d=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()}}),
g=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()}}),
q=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()}}),s=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)}});e.addCommand(a);e.addCommand(f);e.addCommand(g);e.addCommand(d);e.addCommand(m);e.addCommand(q);e.addCommand(s);e.addCommand(p);e.registerCommandContribution(c,"orion.compare.toggle2Inline",108);e.registerCommandContribution(c,"orion.compare.toggle2TwoWay",109);e.registerCommandContribution(c,"orion.compare.copyToLeft",110,null,!1,new i.KeyBinding(37,!0,!1,!0));
e.registerCommandContribution(c,"orion.compare.copyToRight",111,null,!1,new i.KeyBinding(39,!0,!1,!0));e.registerCommandContribution(c,"orion.compare.nextDiff",112,null,!1,new i.KeyBinding(40,!0));e.registerCommandContribution(c,"orion.compare.prevDiff",113,null,!1,new i.KeyBinding(38,!0));b.options.wordLevelNav?(e.registerCommandContribution(c,"orion.compare.nextChange",114,null,!1,new i.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!1,new i.KeyBinding(38,
!0,!0))):(e.registerCommandContribution(c,"orion.compare.nextChange",114,null,!0,new i.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!0,new i.KeyBinding(38,!0,!0)))}},renderCommands:function(b){var c=this.options.commandSpanId,e=this.options.commandService;e&&c&&(g.empty(g.node(c)),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),e.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):(e.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):e.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):e.renderCommands(c,c,b,b,"tool",null))}};return c}();return d});
define("orion/compare/compareUtils",["orion/URITemplate"],function(h){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(h,g,d){for(var c=0,b=0;b<h.length;b++){var j=h[b][g];j===0&&(j=1);if(d>=c&&d<c+j)return{mapperIndex:b,startFrom:c};if(b===h.length-1)break;c+=h[b][g]}return{mapperIndex:h.length-1,startFrom:c}};k.compareUtils.lookUpLineIndex=function(h,g,d){if(d===0)return 0;for(var c=0,b=0;b<d;b++)c+=h[b][g];return c};k.compareUtils.updateMapper=function(h,g,d,c,
b){if(c!==b&&(c>0||b>0)){var j=k.compareUtils.lookUpMapper(h,g,d);if(!(j.mapperIndex<0)){if(c>0)for(var e=d-j.startFrom,d=j.mapperIndex;d<h.length;d++){e=h[d][g]-e;if(c<=e){h[d][g]-=c;break}h[d][g]-=e;c-=e;e=0}b>0&&(h[j.mapperIndex][g]+=b)}}};k.compareUtils.overlapMapper=function(h,g,d,c,b){h=d+h[g]-1;h<d&&(h=d);b<c&&(b=c);return h<c||b<d?!1:!0};k.compareUtils.findFirstDiff=function(h,g,d,c){for(var b=0,j=null,e=0;e<h.length;e++){if(b>c)break;if(k.compareUtils.overlapMapper(h[e],g,b,d,c)&&(j={mapperIndex:e,
startFrom:b},h[e][2]!==0))break;b+=h[e][g]}return j};k.compareUtils.matchMapper=function(h,g,d,c){if(h.length===0)return d;var b=d+Math.round((c-d)/3),j=k.compareUtils.findFirstDiff(h,g,d,c),e=h[j.mapperIndex][g]===0?j.startFrom:j.startFrom+h[j.mapperIndex][g]-1,a=k.compareUtils.lookUpLineIndex(h,1-g,j.mapperIndex),f=j.startFrom-d;return h[j.mapperIndex][2]===0?a-f:b>=j.startFrom&&b<=e?a-Math.round((c-d)/3):b<j.startFrom?a-f:(h[j.mapperIndex][1-g]===0?a:a+h[j.mapperIndex][1-g]-1)-(e-d)};k.compareUtils.getMapperLineCount=
function(h){for(var g=0,d=0;d<h.length;d++)g+=Math.max(h[d][0],h[d][1]);return g};k.compareUtils.getAnnotationIndex=function(h,g){for(var d=0;d<h.length;d++)if(h[d][0]===g)return d;return-1};k.compareUtils.getAnnotationMapperIndex=function(h,g){return h[g][1]};k.compareUtils.getAnnotationIndexByMapper=function(h,g){for(var d=0;d<h.length;d++)if(h[d][1]===g)return{current:d,prev:d-1,next:d+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(h,g){return g<0?!1:!h[g][3]?!1:
h[g][3]===1};k.compareUtils.mergeDiffBlocks=function(h,g,d,c,b,j){for(var e=0;e<g.length;e++){var a=g[e][0],f=d[g[e][1]];if(f[0]>0){for(var l="",n=0;n<f[0];n++)l=l+c[f[2]-1+n].substring(b)+j;f=h.getLineCount();a>=f&&(a=f-1);a=h.getLineStart(a);h.setText(l,a,a)}}};k.compareUtils.generateCompareHref=function(i,g){var d=require.toUrl("compare/compare.html");if(!g.conflict)g.conflict=void 0;if(!g.readonly)g.readonly=void 0;return(new h(d+"#{,resource,params*}")).expand({resource:i,params:g})};k.compareUtils.generateCompareTreeHref=
function(i,g){var d=require.toUrl("compare-tree/compare-tree.html");return(new h(d+"#{,resource,params*}")).expand({resource:i,params:g})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(h,k){function i(d,c,b){var g=new k;d[c].apply(d,b).then(function(b){g.resolve(b)},function(b){g.reject(b)});return g}function g(d,c){var b=d.getServiceReferences("orion.core.diff"),g,e=b;if(c){e=[];for(g=0;g<b.length;++g)c(b[g])&&e.push(b[g])}var a=[],f=[];for(g=0;g<e.length;++g)a[g]=RegExp(e[g].getProperty("pattern")||".*"),f[g]=d.getService(e[g]);this._getService=function(b){if(b.indexOf("://")===-1){var c=
document.createElement("a");c.href=b;b=c.href}for(c=0;c<a.length;++c)if(a[c].test(b))return f[c];throw h["No Matching DiffService for location:"]+b;}}g.prototype={getDiffContent:function(d){return i(this._getService(d),"getDiffContent",arguments)},getDiffFileURI:function(d){return i(this._getService(d),"getDiffFileURI",arguments)}};return{DiffProvider:g}});
define("orion/compare/diffParser",[],function(){var h=h||{};h.DiffParser=function(){function h(g,d){this._lineDelimiter=g?g:i?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=!1}var i=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(g){this._diffLineDelimiter=this._lineDelimiter=g},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(g,d,c,b){this._init();if(d==="")return{outPutFile:g,mapper:[]};this._oFileContents=g===""?[]:g.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<d;h++){var e=this._parseHunkRange(h);e&&this._hunkRanges.push(e)}if(0===this._hunkRanges.length)return{outPutFile:g,
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(g=0;g<this._hunkRanges.length;g++)this._parseHunkBlock(g);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(c);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));b||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var g=0;g<this._deltaMap.length;g++)if(console.log(JSON.stringify(this._deltaMap[g])),
this._deltaMap[g][2]>0){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[g][0];d++)console.log("    "+this._diffContents[this._deltaMap[g][2]+d-1])}},_logNewFile:function(){for(var g=0;g<this._nFileContents.length;g++)console.log(this._nFileContents[g])},_createBlock:function(g,d,c,b){b===c&&g===" "||(c=[c,b-c,"s"],g==="-"?c[2]="r":g==="+"?c[2]="a":g==="c"&&(c[2]="c"),d.push(c))},_createMinusBlock:function(g,d,c){var b=this._oBlocks.length;b===0||g!==this._oBlocks[b-
1][0]?(this._oBlocks.push([g===0?1:g,c]),this._nBlocks.push([d,0,-2])):this._oBlocks[b-1][1]+=c},_createPlusBlock:function(g,d,c,b){var h=this._nBlocks.length;h===0||d!==this._nBlocks[h-1][0]?(this._oBlocks.push([g===0?1:g,0]),this._nBlocks.push([d,c,b])):(this._nBlocks[h-1][1]+=c,this._nBlocks[h-1][2]=b)},_parseHunkBlock:function(g){for(var d=" ",c=this._hunkRanges[g][0]+1,b=g===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[g+1][0],h=0,e=0,a=this._hunkRanges[g][1],f=this._hunkRanges[g][3],
l=c,n=c;n<b;n++)if(0!==this._diffContents[n].length){var m=this._diffContents[n][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[n].substring(0,this._diffContents[n].length-1)||"\\ No newline at end of file"===this._diffContents[n]))d==="-"?this._oNewLineAtEnd=!1:d===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,n>c&&this._diffContents[n-1][this._diffContents[n-1].length-1]==="\r"&&(this._diffContents[n-1]=this._diffContents[n-1].substring(0,this._diffContents[n-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(d!==m){m==="+"&&(l=n);switch(d){case " ":a=this._hunkRanges[g][1]+h;f=this._hunkRanges[g][3]+e;break;case "-":this._createMinusBlock(a,f,this._hunkRanges[g][1]+h-a);break;case "+":this._createPlusBlock(a,f,this._hunkRanges[g][3]+e-f,l)}d=m}switch(m){case "-":h++;break;case "+":e++;break;case " ":h++,e++}}}switch(d){case "-":this._createMinusBlock(a,f,this._hunkRanges[g][1]+h-a);break;case "+":this._createPlusBlock(a,
f,this._hunkRanges[g][3]+e-f,l)}},_detectConflictes:function(g,d){if(g<0)return!1;for(var c=g+d,b=g;b<c;b++){var h=this._diffContents[b];if(h.indexOf("<<<<<")>-1||h.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(g){var d=this._oBlocks.length,c=this._oFileContents.length,b=0,h;h=1;for(var e=0;e<d;e++)h=this._oBlocks[e][0]-h,h>0&&(this._deltaMap.push([h,h,0]),b+=h),g&&this._detectConflictes(this._nBlocks[e][2],this._nBlocks[e][1])?this._deltaMap.push([this._nBlocks[e][1],this._oBlocks[e][1],
this._nBlocks[e][2]+1,1]):this._deltaMap.push([this._nBlocks[e][1],this._oBlocks[e][1],this._nBlocks[e][2]+1]),b+=this._oBlocks[e][1],h=this._oBlocks[e][0]+this._oBlocks[e][1];0<c-h&&(this._deltaMap.push([c-h+1,c-h+1,0]),b+=c-h+1);b<c&&(h=c-b,g=this._deltaMap[this._deltaMap.length-1],g[2]===0?(g[0]+=h,g[1]+=h):g[2]===-1?this._deltaMap.push([h,h,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([h,h,0]):(this._nNewLineAtEnd&&(g[0]+=h),this._oNewLineAtEnd&&(g[1]+=h)))},_buildNewFile:function(){var g=
1,d=!1,c=this._deltaMap.length,b,h;for(b=0;b<c;b++){d=!1;if(this._deltaMap[b][2]===0){for(h=0;h<this._deltaMap[b][0];h++)this._nFileContents.push(this._oFileContents[g+h-1]);d=!0}else if(this._deltaMap[b][2]>0)for(h=0;h<this._deltaMap[b][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[b][2]+h-1].substring(1));g+=this._deltaMap[b][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},_parseHRangeBody:function(g,d){if(0<g.indexOf(",")){var c=g.split(","),b=parseInt(c[0],10),c=
parseInt(c[1],10);d.push(b>=0?b:1);d.push(c>=0?c:1)}else b=parseInt(g,10),d.push(b>=0?b:1),d.push(1)},_parseHunkRange:function(g){var d=this._diffContents[g];if(8>d.length)return null;if("@@"!==d.substring(0,2))return null;var d=d.substring(2),c=d.indexOf("@@");if(c<0)return null;var d=d.substring(0,c),c=d.indexOf("-"),b=d.indexOf("+");if(c<0||b<0)return null;g=[g];c<b?(d=d.substring(c+1).split("+"),this._parseHRangeBody(d[0],g),this._parseHRangeBody(d[1],g)):(d=d.substring(b+1).split("-"),this._parseHRangeBody(d[1],
g),this._parseHRangeBody(d[0],g));return g}};return h}();return h});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(h){var k=k||{};k.CompareRuler=function(){function h(g,d,c){this._location=g||"left";this._overview=d||"page";this._rulerStyle=c;this._editor=null;var b=this;this._listener={onModelChanged:function(c){b._onModelChanged(c)}}}h.prototype={setView:function(g){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=g;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(g,d){for(var c=[],b=g;b<d;b++){var h=this.getStyle(b);h&&(c[b]={html:this.getHTML(b),style:h})}return c},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return h}();k.LineNumberCompareRuler=function(){function h(g,d,c,b,j,e){k.CompareRuler.call(this,c,"page",b);this._diffNavigator=g;this._oddStyle=j||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}h.prototype=new k.CompareRuler;h.prototype.getStyle=function(g){return g===void 0?this._rulerStyle:this._evenStyle};h.prototype.getHTML=function(g){var d=this._editor.getModel(),
c=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!c?"":g===-1?d.getLineCount():c.getLineNumber?(g=c.getLineNumber(g),g===-1?"":g+1):g+1};h.prototype._onModelChanged=function(g){var g=g.start,d=this._editor.getModel(),c=d.getLineCount(),b=(c+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._editor.redrawLines(d.getLineAtOffset(g),c,this)};return h}();k.CompareOverviewRuler=function(){function i(g,d,c,b){this._diffNavigator=c;this._onClick=b;k.CompareRuler.call(this,g,
"document",d)}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(g){var d,c;if(g===void 0)d=this._rulerStyle||{},c=d.style||(d.style={}),c.lineHeight="1px",c.fontSize="1px",c.width="14px";else if(d=g!==-1?{styleClass:"annotationOverview breakpoint"}:{},c=d.style||(d.style={}),c.cursor="pointer",c.width="8px",c.left="2px",g>=0){var b;if(this._diffNavigator&&this._diffNavigator.getFeeder())b=this._diffNavigator.getFeeder().getDiffBlocks();else return null;g=h.getAnnotationIndex(b,g);if(g===
-1)return null;b=h.getAnnotationMapperIndex(b,g);var j;j=this._diffNavigator.getMapper();if(b=h.isMapperConflict(j,b))c.border="1px #FF0000 solid";if(g===this._diffNavigator.getCurrentBlockIndex())c.backgroundColor=b?"red":"blue";g=this._diffNavigator.getFeeder().getDiffBlockH(g);b=this._diffNavigator.getFeeder().getOverviewLineCount();if(g<0)return null;j=this._editor.getClientArea();g=Math.floor(j.height*g/b);g<2&&(g=2);c.height=g+"px"}else return null;return d};i.prototype.setDiffNavigator=function(g){this._diffNavigator=
g};i.prototype.getHTML=function(){return"&nbsp;"};i.prototype.onClick=function(g){g!==void 0&&this._onClick(g,this)};i.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return i}();k.CompareCurveRuler=function(){function i(g){this._canvasDiv=g;this._mapper=void 0}i.prototype={init:function(g,d,c,b){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=g;this._leftEditor=d;this._rightEditor=c;this._leftTextView=d.getTextView();
this._rightTextView=c.getTextView();this._diffNavigator=b;this.render()},matchPositionFrom:function(g){var d=g?this._leftTextView:this._rightTextView,c=g?this._rightTextView:this._leftTextView,b=d.getTopIndex(),d=d.getBottomIndex(),g=h.matchMapper(this._mapper,g?0:1,b,d);c.setTopIndex(g)},copyTo:function(g){if(this._diffNavigator.iterator){var d=this._diffNavigator.iterator.cursor();if(d){var c=g?this._rightTextView.getText(d.oldA.start,d.oldA.end):this._leftTextView.getText(d.newA.start,d.newA.end),
d=g?d.newA:d.oldA;(g?this._leftTextView:this._rightTextView).setText(c,d.start,d.end)}}},render:function(){if(this._mapper){var g=this._canvasDiv.getContext("2d");g.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);g.strokeStyle="#AAAAAA";g.lineWidth=1;g.beginPath();var d=this._leftTextView.getTopIndex(),c=this._leftTextView.getBottomIndex(),b=this._rightTextView.getTopIndex(),j=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var e=0,a=0,f=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(h.overlapMapper(this._mapper[l],0,e,d,c)||h.overlapMapper(this._mapper[l],1,a,b,j))this._renderCurve(l,e,a,this._canvasDiv,g,d,c,b,j),f=!0;else if(f)break;e+=this._mapper[l][0];a+=this._mapper[l][1]}g.stroke()}},_renderCurve:function(g,d,c,b,h){var e=this._mapper[g],d=this._leftTextView.getLinePixel(d+e[0]/2)+e[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),c=this._rightTextView.getLinePixel(c+e[1]/2)+e[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),b=b.parentNode.clientWidth;g===this._diffNavigator.getCurrentMapperIndex()?(h.stroke(),h.strokeStyle="#000",h.lineWidth=1,h.beginPath(),h.moveTo(0,d),h.bezierCurveTo(b/3,d,b*0.666,c,b,c),h.stroke(),h.strokeStyle="#AAAAAA",h.lineWidth=1,h.beginPath()):(h.moveTo(0,d),h.bezierCurveTo(b/3,d,b*0.666,c,b,c),h.stroke())},onChanged:function(g,d){var c=d?this._rightIniting:this._leftIniting;if(g.removedLineCount!==g.addedLineCount){var b=d?this._rightTextView:
this._leftTextView;c||h.updateMapper(this._mapper,d?1:0,b.getModel().getLineAtOffset(g.start),g.removedLineCount,g.addedLineCount);(g.removedLineCount>0||g.addedLineCount>0)&&this.render()}d?this._rightIniting=!1:this._leftIniting=!1;return c}};return i}();return k});define("orion/editor/i18n",{load:function(h,k,i){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+h],function(g){i(g)}):i({})}});
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 i={root:k},g;for(g in h)h.hasOwnProperty(g)&&typeof i[g]==="undefined"&&(i[g]=h[g]);return i});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(h,k){function i(g,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(g);this.setLineDelimiter(d)}i.prototype={find:function(g){if(this._text.length>1)this._text=[this._text.join("")];var d=g.string,c=d,b=g.caseInsensitive;!g.regex&&d&&(c=d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),b&&(c=c.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var h=null,e;if(c){var d=g.reverse,a=g.wrap,f=g.wholeWord,
l=g.start||0,g=g.end,n=g!==null&&g!==void 0,m="";m.indexOf("g")===-1&&(m+="g");b&&m.indexOf("i")===-1&&(m+="i");f&&(c="\\b"+c+"\\b");var i=this._text[0],k,p,r=0;n&&(b=l<g?l:g,i=i.substring(b,l<g?g:l),r=b);var t=RegExp(c,m);if(d)e=function(){var b=null;for(t.lastIndex=0;;){p=t.lastIndex;k=t.exec(i);if(p===t.lastIndex)return null;if(k){if(!(k.index+r<l)){if(!a||b)break;l=i.length+r}b={start:k.index+r,end:t.lastIndex+r}}else break}if(b)l=b.start;return b};else{if(!n)t.lastIndex=l;e=function(){for(;;){p=
t.lastIndex;k=t.exec(i);if(p===t.lastIndex)break;if(k)return{start:k.index+r,end:t.lastIndex+r};if(!(p!==0&&a))break}return null}}h=e()}return{next:function(){var a=h;a&&(h=e());return a},hasNext:function(){return h!==null}}},getCharCount:function(){for(var g=0,d=0;d<this._text.length;d++)g+=this._text[d].length;return g},getLine:function(g,d){var c=this.getLineCount();if(!(0<=g&&g<c))return null;var b=this._lineOffsets[g];if(g+1<c){c=this.getText(b,this._lineOffsets[g+1]);if(d)return c;for(var b=
c.length,h;(h=c.charCodeAt(b-1))===10||h===13;)b--;return c.substring(0,b)}else return this.getText(b)},getLineAtOffset:function(g){var d=this.getCharCount();if(!(0<=g&&g<=d))return-1;var c=this.getLineCount();if(g===d)return c-1;var b,h,e=this._lastLineIndex;if(0<=e&&e<c&&(b=this._lineOffsets[e],h=e+1<c?this._lineOffsets[e+1]:d,b<=g&&g<h))return e;for(var a=c,f=-1;a-f>1;)if(e=Math.floor((a+f)/2),b=this._lineOffsets[e],h=e+1<c?this._lineOffsets[e+1]:d,g<=b)a=e;else if(g<h){a=e;break}else f=e;return this._lastLineIndex=
a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(g,d){var c=this.getLineCount();if(!(0<=g&&g<c))return-1;if(g+1<c){c=this._lineOffsets[g+1];if(d)return c;for(var b=this.getText(Math.max(this._lineOffsets[g],c-2),c),h=b.length,e;(e=b.charCodeAt(h-1))===10||e===13;)h--;return c-(b.length-h)}else return this.getCharCount()},getLineStart:function(g){return!(0<=g&&g<this.getLineCount())?-1:this._lineOffsets[g]},getText:function(g,
d){g===void 0&&(g=0);d===void 0&&(d=this.getCharCount());if(g===d)return"";for(var c=0,b=0,h;b<this._text.length;){h=this._text[b].length;if(g<=c+h)break;c+=h;b++}for(var e=c,a=b;b<this._text.length;){h=this._text[b].length;if(d<=c+h)break;c+=h;b++}if(a===b)return this._text[a].substring(g-e,d-c);e=this._text[a].substring(g-e);c=this._text[b].substring(0,d-c);return e+this._text.slice(a+1,b).join("")+c},onChanging:function(g){return this.dispatchEvent(g)},onChanged:function(g){return this.dispatchEvent(g)},
setLineDelimiter:function(g,d){g==="auto"&&(g=void 0,this.getLineCount()>1&&(g=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=g?g:k.platformDelimiter;if(d){var c=this.getLineCount();if(c>1){for(var b=Array(c),h=0;h<c;h++)b[h]=this.getLine(h);this.setText(b.join(this._lineDelimiter))}}},setText:function(g,d,c){g===void 0&&(g="");d===void 0&&(d=0);c===void 0&&(c=this.getCharCount());if(!(d===c&&g==="")){for(var b=this.getLineAtOffset(d),h=this.getLineAtOffset(c),e=d,a=
c-d,f=h-b,l=g.length,n=0,m=this.getLineCount(),i=0,k=0,p=0,r=[];;){i!==-1&&i<=p&&(i=g.indexOf("\r",p));k!==-1&&k<=p&&(k=g.indexOf("\n",p));if(k===-1&&i===-1)break;p=i!==-1&&k!==-1?i+1===k?k+1:(i<k?i:k)+1:i!==-1?i+1:k+1;r.push(d+p);n++}this.onChanging({type:"Changing",text:g,start:e,removedCharCount:a,addedCharCount:l,removedLineCount:f,addedLineCount:n});r.length===0&&(p=this.getLineStart(b),h=h+1<m?this.getLineStart(h+1):this.getCharCount(),d!==p&&(g=this.getText(p,d)+g,d=p),c!==h&&(g+=this.getText(c,
h),c=h));p=l-a;for(h=b+f+1;h<m;h++)this._lineOffsets[h]+=p;if(r.length<5E4)b=[b+1,f].concat(r),Array.prototype.splice.apply(this._lineOffsets,b);else{p=b+1;this._lineOffsets.splice(p,f);for(m=0;m<r.length;m+=5E4)b=[p,0].concat(r.slice(m,Math.min(r.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,b),p+=5E4}for(p=m=0;p<this._text.length;){h=this._text[p].length;if(d<=m+h)break;m+=h;p++}b=m;for(r=p;p<this._text.length;){h=this._text[p].length;if(c<=m+h)break;m+=h;p++}h=this._text[p];d=
this._text[r].substring(0,d-b);c=h.substring(c-m);r=[r,p-r+1];d&&r.push(d);g&&r.push(g);c&&r.push(c);Array.prototype.splice.apply(this._text,r);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:e,removedCharCount:a,addedCharCount:l,removedLineCount:f,addedLineCount:n})}}};h.EventTarget.addMixin(i.prototype);return{TextModel:i}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(h,k){function i(d){if(d)this._view=d,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function g(d){i.call(this,d)}i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(d){for(var c=[],b=this._keyBindings,g=0;g<b.length;g++)b[g].actionID===d&&c.push(b[g].keyBinding);return c},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(d){switch(d.keyCode){case 16:case 17:case 18:case 91:return}for(var c=this._keyBindingIndex,b=this._matchingKeyBindings||this._keyBindings,g=[],e=0;e<b.length;e++){var a=b[e],f=a.keyBinding.match(d,c);if(f===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,a.actionID;else typeof f==="number"&&g.push(a)}if(g.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=g,"noop"},setKeyBinding:function(d,
c){for(var b=this._keyBindings,g=0;g<b.length;g++){var e=b[g];if(e.keyBinding.equals(d)){c?e.actionID=c:e.predefined?e.actionID="noop":b.splice(g,1);return}}c&&b.push({keyBinding:d,actionID:c})},setView:function(d){this._view=d}};g.prototype=new i;g.prototype.createKeyBindings=function(){var d=h.KeyBinding,c=[];c.push({actionID:"lineUp",keyBinding:new d(38),predefined:!0});c.push({actionID:"lineDown",keyBinding:new d(40),predefined:!0});c.push({actionID:"charPrevious",keyBinding:new d(37),predefined:!0});
c.push({actionID:"charNext",keyBinding:new d(39),predefined:!0});k.isMac?(c.push({actionID:"scrollPageUp",keyBinding:new d(33),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new d(34),predefined:!0}),c.push({actionID:"pageUp",keyBinding:new d(33,null,null,!0),predefined:!0}),c.push({actionID:"pageDown",keyBinding:new d(34,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new d(37,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new d(39,!0),predefined:!0}),
c.push({actionID:"wordPrevious",keyBinding:new d(37,null,null,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new d(39,null,null,!0),predefined:!0}),c.push({actionID:"scrollTextStart",keyBinding:new d(36),predefined:!0}),c.push({actionID:"scrollTextEnd",keyBinding:new d(35),predefined:!0}),c.push({actionID:"textStart",keyBinding:new d(38,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new d(40,!0),predefined:!0}),c.push({actionID:"scrollPageUp",keyBinding:new d(38,null,null,null,
!0),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new d(40,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new d(37,null,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new d(39,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new d(38,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new d(40,null,null,!0),predefined:!0})):(c.push({actionID:"pageUp",keyBinding:new d(33),predefined:!0}),c.push({actionID:"pageDown",
keyBinding:new d(34),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new d(36),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new d(35),predefined:!0}),c.push({actionID:"wordPrevious",keyBinding:new d(37,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new d(39,!0),predefined:!0}),c.push({actionID:"textStart",keyBinding:new d(36,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new d(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(c.push({actionID:"lineUp",keyBinding:new d(38,
!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new d(40,!0),predefined:!0}));k.isWindows&&(c.push({actionID:"scrollLineUp",keyBinding:new d(38,!0),predefined:!0}),c.push({actionID:"scrollLineDown",keyBinding:new d(40,!0),predefined:!0}));c.push({actionID:"selectLineUp",keyBinding:new d(38,null,!0),predefined:!0});c.push({actionID:"selectLineDown",keyBinding:new d(40,null,!0),predefined:!0});c.push({actionID:"selectCharPrevious",keyBinding:new d(37,null,!0),predefined:!0});c.push({actionID:"selectCharNext",
keyBinding:new d(39,null,!0),predefined:!0});c.push({actionID:"selectPageUp",keyBinding:new d(33,null,!0),predefined:!0});c.push({actionID:"selectPageDown",keyBinding:new d(34,null,!0),predefined:!0});k.isMac?(c.push({actionID:"selectLineStart",keyBinding:new d(37,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new d(39,!0,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new d(37,null,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new d(39,
null,!0,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new d(36,null,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new d(35,null,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new d(38,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new d(40,!0,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new d(37,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new d(39,null,!0,null,!0),predefined:!0}),
c.push({actionID:"selectLineStart",keyBinding:new d(38,null,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new d(40,null,!0,!0),predefined:!0})):(k.isLinux&&(c.push({actionID:"selectWholeLineUp",keyBinding:new d(38,!0,!0),predefined:!0}),c.push({actionID:"selectWholeLineDown",keyBinding:new d(40,!0,!0),predefined:!0})),c.push({actionID:"selectLineStart",keyBinding:new d(36,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new d(35,null,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",
keyBinding:new d(37,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new d(39,!0,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new d(36,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new d(35,!0,!0),predefined:!0}));c.push({actionID:"undo",keyBinding:new h.KeyBinding("z",!0),predefined:!0});k.isMac?c.push({actionID:"redo",keyBinding:new h.KeyBinding("z",!0,!0),predefined:!0}):c.push({actionID:"redo",keyBinding:new h.KeyBinding("y",!0),predefined:!0});
c.push({actionID:"deletePrevious",keyBinding:new d(8),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new d(8,null,!0),predefined:!0});c.push({actionID:"deleteNext",keyBinding:new d(46),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0,!0),predefined:!0});c.push({actionID:"deleteWordNext",keyBinding:new d(46,!0),predefined:!0});c.push({actionID:"tab",keyBinding:new d(9),predefined:!0});
c.push({actionID:"shiftTab",keyBinding:new d(9,null,!0),predefined:!0});c.push({actionID:"enter",keyBinding:new d(13),predefined:!0});c.push({actionID:"enter",keyBinding:new d(13,null,!0),predefined:!0});c.push({actionID:"selectAll",keyBinding:new d("a",!0),predefined:!0});c.push({actionID:"toggleTabMode",keyBinding:new d("m",!0),predefined:!0});k.isMac&&(c.push({actionID:"deleteNext",keyBinding:new d(46,null,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new d(8,null,null,!0),
predefined:!0}),c.push({actionID:"deleteWordNext",keyBinding:new d(46,null,null,!0),predefined:!0}));c.push({actionID:"toggleWrapMode",keyBinding:new h.KeyBinding("w",!0,!1,!0)});c.push({actionID:"toggleOverwriteMode",keyBinding:new h.KeyBinding(45)});if(!k.isFirefox){var b=k.isMac&&k.isChrome;c.push({actionID:"noop",keyBinding:new d("u",!b,!1,!1,b),predefined:!0});c.push({actionID:"noop",keyBinding:new d("i",!b,!1,!1,b),predefined:!0});c.push({actionID:"noop",keyBinding:new d("b",!b,!1,!1,b),predefined:!0})}k.isFirefox&&
(c.push({actionID:"copy",keyBinding:new d(45,!0),predefined:!0}),c.push({actionID:"paste",keyBinding:new d(45,null,!0),predefined:!0}),c.push({actionID:"cut",keyBinding:new d(46,null,!0),predefined:!0}));k.isMac&&(c.push({actionID:"lineStart",keyBinding:new d("a",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new d("e",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineUp",keyBinding:new d("p",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new d("n",!1,!1,
!1,!0),predefined:!0}),c.push({actionID:"charPrevious",keyBinding:new d("b",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charNext",keyBinding:new d("f",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deletePrevious",keyBinding:new d("h",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteNext",keyBinding:new d("d",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineEnd",keyBinding:new d("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(c.push({actionID:"scrollPageDown",keyBinding:new d("v",!1,
!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineStart",keyBinding:new d("u",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new d("w",!1,!1,!1,!0),predefined:!0})):(c.push({actionID:"pageDown",keyBinding:new d("v",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"centerLine",keyBinding:new d("l",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"enterNoCursor",keyBinding:new d("o",!1,!1,!1,!0),predefined:!0})));return c};return{KeyMode:i,DefaultKeyMode:g}});
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,i,g,d,c){function b(a,b,c,f){typeof a.addEventListener==="function"?a.addEventListener(b,c,f===!0):a.attachEvent("on"+b,c)}function j(a,b,f){if(f){b.className="";for(var f=b.attributes,e=f.length;e-- >0;)(!c.isIE||c.isIE>=9||c.isIE<9&&f[e].specified)&&b.removeAttribute(f[e].name)}if(a){if(a.styleClass)b.className=
a.styleClass;if(f=a.style)for(var d in f)f.hasOwnProperty(d)&&(b.style[d]=f[d]);if(a=a.attributes)for(var g in a)a.hasOwnProperty(g)&&b.setAttribute(g,a[g])}}function e(a){return a instanceof Array?a.slice(0):a}function a(a,b){if(!a)return b;if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&(a.hasOwnProperty(c)||(a[c]=b[c]));return a}function f(a,b){if(a===b)return!0;if(a&&!b||!a&&b)return!1;if(a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof
Array&&b instanceof Array))return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(!f(a[c],b[c]))return!1;return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(c in a)if(a.hasOwnProperty(c)){if(!b.hasOwnProperty(c))return!1;if(!f(a[c],b[c]))return!1}for(c in b)if(!a.hasOwnProperty(c))return!1;return!0}function l(a,b,c){for(var f=0,e=0,d=0,g=a.length;d<g;){f!==-1&&f<=d&&(f=a.indexOf("\r",d));e!==-1&&e<=d&&(e=a.indexOf("\n",d));var h=d,j;if(e===-1&&f===-1){b(a.substring(d));
break}f!==-1&&e!==-1?f+1===e?(j=f,d=e+1):(j=f<e?f:e,d=(f<e?f:e)+1):f!==-1?(j=f,d=f+1):(j=e,d=e+1);b(a.substring(h,j));c()}}function n(a){var b,c,f,e,d=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(d.getComputedStyle)a=d.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),c=a.getPropertyValue("padding-top"),f=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,f=a.currentStyle.paddingRight,
e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(f,10)||0,bottom:parseInt(e,10)||0}}function m(a){var b,c,f,e,d=a._trim;if(!d){var d=n(a),g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(g.getComputedStyle)e=g.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),c=e.getPropertyValue("border-top-width"),f=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
c=a.currentStyle.borderTopWidth,f=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;c=parseInt(c,10)||0;f=parseInt(f,10)||0;e=parseInt(e,10)||0;d.left+=b;d.top+=c;d.right+=f;d.bottom+=e;a._trim=d}return d}function q(a,b,c){this.start=a;this.end=b;this.caret=c}function s(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function p(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function r(a){this._init(a||{})}var t=function(){function a(b){this.options=
b}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},f=this.options.curve[0],e=this.options.curve[1],d=e-f,g=-1,o,h=this;this.interval=this.options.window.setInterval(function(){g=g===-1?(new Date).getTime():g;var j=((new Date).getTime()-g)/a;j<1?(j=b(j),o=f+j*d,c(o)):(c(e),h.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}();q.prototype={clone:function(){return new q(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}};s.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 c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=
this;return c}},_createLine:function(a,b,e){var d=this.view,g=d._model,h=g.getLine(e),l=g.getLineStart(e),m={type:"LineStyle",textView:d,lineIndex:e,lineText:h,lineStart:l};if(h.length<2E3)d.onLineStyle(m);g=b||c.createElement(a.ownerDocument,"div");if(!b||!f(b.viewStyle,m.style)){j(m.style,g,b);if(b)b._trim=null;g.viewStyle=m.style;g.setAttribute("role","presentation")}g.lineIndex=e;e=[];this._createRanges(m.ranges,h,0,h.length,l,{tabOffset:0,ranges:e});h=" ";!d._fullSelection&&c.isIE<9&&(h="\ufeff");
c.isWebkit&&(h="\u200c");m={text:h,style:d._metrics.largestFontStyle,ignoreChars:1};e.length===0||!e[e.length-1].style||e[e.length-1].style.tagName!=="div"?e.push(m):e.splice(e.length-1,0,m);var n,i,k,q,p,h=d=0,s,r;if(b){if(i=b.modelChangedEvent)i.removedLineCount===0&&i.addedLineCount===0?(r=i.start-l,s=i.addedCharCount-i.removedCharCount):r=-1,b.modelChangedEvent=void 0;i=b.firstChild}for(l=0;l<e.length;l++){m=e[l];q=m.text;d+=q.length;n=m.style;if(i)if(p=i.firstChild.data,k=i.viewStyle,p===q&&
f(n,k)){h+=p.length;i._rectsCache=void 0;n=i=i.nextSibling;continue}else for(;i;){if(r!==-1){k=d;k>=r&&(k-=s);p=(p=i.firstChild.data)?p.length:0;if(h+p>k)break;h+=p}k=i.nextSibling;g.removeChild(i);i=k}n=this._createSpan(g,q,n,m.ignoreChars);i?g.insertBefore(n,i):g.appendChild(n);if(b)b.lineWidth=void 0}if(b)for(a=n?n.nextSibling:null;a;)k=a.nextSibling,b.removeChild(a),a=k;else a.appendChild(g);return g},_createRanges:function(a,b,c,e,d,g){if(!(c>e)){if(a)for(var h=0;h<a.length;h++){var j=a[h];if(!(j.end<
d+c)){var l=Math.max(d+c,j.start)-d;if(l>e)break;var m=Math.min(d+e,j.end)-d;if(l<=m){l=Math.max(c,l);m=Math.min(e,m);for(c<l&&this._createRange(b,c,l,null,g);h+1<a.length&&a[h+1].start-d===m&&f(j.style,a[h+1].style);)j=a[h+1],m=Math.min(d+e,j.end)-d,h++;this._createRange(b,l,m,j.style,g);c=m}}}c<e&&this._createRange(b,c,e,null,g)}},_createRange:function(a,b,c,f,e){if(!(b>c)){var d=this.view._customTabSize;if(d&&d!==8)for(var g=a.indexOf("\t",b);g!==-1;){b<g&&(b={text:a.substring(b,g),style:f},e.ranges.push(b),
e.tabOffset+=b.text.length);b=d-e.tabOffset%d;if(b>0){for(var h="\u00a0",j=1;j<b;j++)h+=" ";b={text:h,style:f,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=g+1;if(b===c)return;g=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:f},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(a,f,e,d){var g=this.view,h="span";e&&e.tagName&&(h=e.tagName.toLowerCase());var l=h==="a";if(l)a.hasLink=!0;l&&!g._linksVisible&&(h="span");l=a.ownerDocument;a=c.createElement(a.ownerDocument,
h);e&&e.html?(a.innerHTML=e.html,a.ignore=!0):e&&e.node?(a.appendChild(e.node),a.ignore=!0):a.appendChild(l.createTextNode(e&&e.text?e.text:f));j(e,a);if(h==="a"){var m=g._getWindow();b(a,"click",function(a){return g._handleLinkClick(a?a:m.event)},!1)}a.viewStyle=e;if(d)a.ignoreChars=d;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var f=this._ensureCreated(),e=this.view;if(a===void 0)return this._getLineBoundingClientRect(f,
!0);var d=e._model,g=f.ownerDocument,h=this.lineIndex,j=null;if(a<d.getLineEnd(h)){d=d.getLineStart(h);for(h=f.firstChild;h;){if(!h.ignore){var l=h.firstChild,m=l.length;h.ignoreChars&&(m-=h.ignoreChars);if(d+m>a){j=a-d;if(e._isRangeRects)g=g.createRange(),g.setStart(l,j),g.setEnd(l,j+1),j=new s(g.getBoundingClientRect());else if(c.isIE)g=g.body.createTextRange(),g.moveToElementText(h),g.collapse(),g.moveEnd("character",j+1),g.moveStart("character",j),j=new s(g.getBoundingClientRect());else{var n=
l.data;h.removeChild(l);h.appendChild(g.createTextNode(n.substring(0,j)));var i=c.createElement(g,"span");i.appendChild(g.createTextNode(n.substring(j,j+1)));h.appendChild(i);h.appendChild(g.createTextNode(n.substring(j+1)));j=new s(i.getBoundingClientRect());h.innerHTML="";h.appendChild(l);this._createdDiv||(g=e._getSelection(),(d<=g.start&&g.start<d+m||d<=g.end&&g.end<d+m)&&e._updateDOMSelection())}c.isIE&&(g=f.ownerDocument.defaultView||f.ownerDocument.parentWindow,f=g.screen.logicalXDPI/g.screen.deviceXDPI,
g=g.screen.logicalYDPI/g.screen.deviceYDPI,j.left*=f,j.right*=f,j.top*=g,j.bottom*=g);break}d+=m}h=h.nextSibling}}f=this.getBoundingClientRect();if(!j)e._wrapMode?(e=this.getClientRects(),j=e[e.length-1],j.left=j.right,j.left+=f.left,j.top+=f.top,j.right+=f.left,j.bottom+=f.top):(j=new s(f),j.left=j.right);if(b||b===void 0)j.left-=f.left,j.top-=f.top,j.right-=f.left,j.bottom-=f.top;return j},_getClientRects:function(a,b){var c,f,e,d;if(!a._rectsCache){c=a.getClientRects();f=Array(c.length);for(d=
0;d<c.length;d++)e=f[d]=new s(c[d]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=f}c=a._rectsCache;f=[c.length];for(d=0;d<c.length;d++)f[d]=new s(c[d]);return f},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],f=b.firstChild,e,d=b.getBoundingClientRect();f;){if(!f.ignore)for(var g=this._getClientRects(f,d),b=0;b<g.length;b++){var h=g[b],j;if(h.top!==h.bottom){var l=h.top+(h.bottom-h.top)/2;for(j=
0;j<c.length;j++)if(e=c[j],e.top<=l&&l<e.bottom)break;if(j===c.length)c.push(h);else{if(h.left<e.left)e.left=h.left;if(h.top<e.top)e.top=h.top;if(h.right>e.right)e.right=h.right;if(h.bottom>e.bottom)e.bottom=h.bottom}}}f=f.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new s(a.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var f=a.lastChild;f&&f.ignoreChars===f.firstChild.length;)f=f.previousSibling;if(f)f=f.getBoundingClientRect(),c.right=
f.right+m(a).right}b&&(f=m(a),c.left+=f.left,c.right-=f.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,c=0;c<b.length;c++)if(b[c].top<=a&&a<b[c].bottom)return c;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();
return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(a,b){var f=this.view,e=f._model,d=this.lineIndex,g=e.getLineStart(d),h=e.getLineEnd(d);if(g===h)return g;var j=this._ensureCreated(),l=this.getBoundingClientRect(),m,n;if(f._wrapMode){m=this.getClientRects();if(b<m[0].top)b=m[0].top;for(var i=0;i<m.length;i++)if(n=m[i],n.top<=b&&b<n.bottom)break;if(a<n.left)a=n.left;a>n.right&&(a=n.right-1)}else a<0&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var k=j.ownerDocument,i=k.defaultView||
k.parentWindow,q=c.isIE?i.screen.logicalXDPI/i.screen.deviceXDPI:1,p=c.isIE?i.screen.logicalYDPI/i.screen.deviceYDPI:1,i=g,s=j.firstChild;a:for(;s;){if(!s.ignore){var r=s.firstChild,j=r.length;s.ignoreChars&&(j-=s.ignoreChars);var t,B,C;m=this._getClientRects(s,l);for(var F=0;F<m.length;F++)if(n=m[F],n.left<=a&&a<n.right&&(!f._wrapMode||n.top<=b&&b<n.bottom)){if(c.isIE||f._isRangeRects){for(var k=f._isRangeRects?k.createRange():k.body.createTextRange(),F=j,M=-1;F-M>1;){var I=Math.floor((F+M)/2);m=
M+1;n=I===j-1&&s.ignoreChars?r.length:I+1;f._isRangeRects?(k.setStart(r,m),k.setEnd(r,n)):(k.moveToElementText(s),k.move("character",m),k.moveEnd("character",n-m));m=k.getClientRects();for(var Q=!1,N=0;N<m.length;N++)if(n=m[N],t=n.left*q-l.left,C=n.right*q-l.left,B=n.top*p-l.top,n=n.bottom*p-l.top,t<=a&&a<C&&(!f._wrapMode||B<=b&&b<n)){Q=!0;break}Q?F=I:M=I}i+=F;m=F;n=F===j-1&&s.ignoreChars?r.length:Math.min(F+1,r.length);f._isRangeRects?(k.setStart(r,m),k.setEnd(r,n)):(k.moveToElementText(s),k.move("character",
m),k.moveEnd("character",n-m));n=k.getClientRects()[0];t=n.left*q-l.left;C=n.right*q-l.left;f=a>t+(C-t)/2;l=i-g;e=e.getLine(d);d=e.charCodeAt(l);55296<=d&&d<=56319&&f?l<e.length&&(d=e.charCodeAt(l+1),56320<=d&&d<=57343&&(i+=1)):56320<=d&&d<=57343&&!f&&l>0&&(d=e.charCodeAt(l-1),55296<=d&&d<=56319&&(i-=1));f&&i++}else{e=[];for(d=0;d<j;d++)e.push("<span>"),d===j-1?e.push(r.data.substring(d)):e.push(r.data.substring(d,d+1)),e.push("</span>");s.innerHTML=e.join("");for(e=s.firstChild;e;){n=e.getBoundingClientRect();
t=n.left-l.left;C=n.right-l.left;if(t<=a&&a<C){a>t+(C-t)/2&&i++;break}i++;e=e.nextSibling}if(!this._createdDiv)s.innerHTML="",s.appendChild(r),l=f._getSelection(),(i<=l.start&&l.start<i+j||i<=l.end&&l.end<i+j)&&f._updateDOMSelection()}break a}i+=j}s=s.nextSibling}return Math.min(h,Math.max(g,i))},getNextOffset:function(a,b){if(b.unit==="line"){var f=this.view._model,e=f.getLineAtOffset(a);if(b.count>0)return b.count--,f.getLineEnd(e);b.count++;return f.getLineStart(e)}return b.unit==="wordend"||b.unit===
"wordWS"||b.unit==="wordendWS"?this._getNextOffset_W3C(a,b):c.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,b)},_getNextOffset_W3C:function(a,b){function c(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function f(a){return a===32||a===9}var e=this.view._model,d=e.getLineAtOffset(a),g=e.getLine(d),h=e.getLineStart(d),e=e.getLineEnd(d),d=g.length,j=a-h,l,m=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var n,
i,k;b.count!==0;){if(b.count>0){if(j===d)return e;l=g.charCodeAt(j);n=c(l);i=!n&&!f(l);for(j++;j<d;){l=g.charCodeAt(j);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(l);if(b.unit==="wordend"){if(!k&&n)break}else if(k&&!n)break;l=!k&&!f(l)}else l=!f(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!l&&i)break}else if(l&&!i)break;i=l;n=k;j++}}else{if(j===0)return h;j--;l=g.charCodeAt(j);n=c(l);for(i=!n&&!f(l);0<j;){l=g.charCodeAt(j-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(l);if(b.unit===
"wordend"){if(k&&!n)break}else if(!k&&n)break;l=!k&&!f(l)}else l=!f(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(l&&!i)break}else if(!l&&i)break;i=l;n=k;j--}}b.count-=m}else for(;b.count!==0&&0<=j+m&&j+m<=d;)j+=m,l=g.charCodeAt(j),56320<=l&&l<=57343&&j>0&&(l=g.charCodeAt(j-1),55296<=l&&l<=56319&&(j+=m)),b.count-=m;return h+j},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),f=this.view._model,e=this.lineIndex,d=0,g;g=f.getLineStart(e);var h=c.ownerDocument,j=b.count<0?-1:1;if(a===
f.getLineEnd(e)){for(c=c.lastChild;c&&c.ignoreChars;)c=c.previousSibling;if(!c)return g;d=h.body.createTextRange();d.moveToElementText(c);g=d.text.length;d.moveEnd(b.unit,j);d=a+d.text.length-g}else if(a===g&&b.count<0)d=g;else for(c=c.firstChild;c;){f=c.firstChild.length;c.ignoreChars&&(f-=c.ignoreChars);if(g+f>a){d=h.body.createTextRange();a===g&&b.count<0?d.moveToElementText(c.previousSibling):(d.moveToElementText(c),d.collapse(),d.moveEnd("character",a-g));g=d.text.length;d.moveEnd(b.unit,j);
d=a+d.text.length-g;break}g=f+g;c=c.nextSibling}b.count-=j;return d},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};r.prototype={addKeyMode:function(a,b){var c=this._keyModes;b!==void 0?c.splice(b,0,a):c.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var c=this._rulers;if(b!==void 0){var f,e;for(f=0,e=0;f<c.length&&e<b;f++)a.getLocation()===c[f].getLocation()&&e++;c.splice(e,0,a);b=e}else c.push(a);this._createRuler(a,
b);this._update()},computeSize:function(){var a=0,b=0,f=this._model,e=this._clientDiv;if(!e)return{width:a,height:b};var d=e.style.width;if(c.isWebkit)e.style.width="0x7fffffffpx";for(var f=f.getLineCount(),g=0;g<f;g++){var h=this._getLine(g),j=h.getBoundingClientRect(),a=Math.max(a,j.right-j.left);b+=j.bottom-j.top;h.destroy()}if(c.isWebkit)e.style.width=d;e=this._getViewPadding();a+=e.right+e.left+this._metrics.scrollWidth;b+=e.bottom+e.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,
b,c){if(this._clientDiv){var f=this._getScroll(),e=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-f.x+d.left+e.left),a.y!==void 0&&(a.y+=-f.y+d.top+e.top));c==="document"&&(a.x!==void 0&&(a.x+=f.x-d.left-e.left),a.y!==void 0&&(a.y+=f.y-d.top-e.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=
this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),c.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],c=this._actions,f;for(f in c)c.hasOwnProperty(f)&&(a||!c[f].defaultHandler)&&b.push(f);return b},getBottomIndex:function(a){return!this._clientDiv?
0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],c=this._keyModes,
f=0;f<c.length;f++)b=b.concat(c[f].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),c=this._getLine(b),
a=c.getBoundingClientRect(a);c.destroy();c=a.left;b=this._getLinePixel(b)+a.top;return{x:c,y:b}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return e(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]=e(this["_"+c]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;
var c=this._getLineIndex(b),f=this._getLine(c),c=f.getOffset(a,b-this._getLinePixel(c));f.destroy();return c},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,c){if(this._clientDiv){if(a=this._actions[a]){if(!b&&
a.handler&&a.handler(c))return!0;if(a.defaultHandler)return typeof a.defaultHandler(c)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},
onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},
onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>
0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var c=this.getRulers(),f=0;f<c.length;f++)this.redrawLines(a,b,c[f])},redrawLines:function(a,b,c){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var f=this._clientDiv;if(f){if(c)for(f=(c.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;f;){if(f._ruler===c)break;f=f.nextSibling}c?f.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||c.getOverview()==="page")for(f=f.firstChild;f;){var e=f.lineIndex;if(a<=e&&e<b)f.lineChanged=!0;f=f.nextSibling}if(!c&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var c=this._model;a===void 0&&(a=0);b===void 0&&(b=c.getCharCount());var f=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(f,c)}},removeKeyMode:function(a){for(var b=this._keyModes,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,c){if(a){var f=this._actions,e=f[a];e||(e=f[a]={});e.handler=b;if(c!==void 0)e.actionDescription=
c}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var f=this._model.getCharCount(),a=Math.max(0,Math.min(a,f));this._setSelection(new q(a,a,!1),b===void 0||b,!0,c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);
this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),c=this._model.getCharCount(),f=a.getLineCount(),e=a.getCharCount(),d={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:f};this.onModelChanging(d);this._model=a;d={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:f};this.onModelChanged(d);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var b=this._defaultOptions(),c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!f(this["_"+c],d)){var g=b[c]?b[c].update:null;g?g.call(this,d):this["_"+c]=e(d)}}},setSelection:function(a,b,c,f){var e=a>b;if(e)var d=a,a=b,b=d;d=this._model.getCharCount();a=Math.max(0,Math.min(a,d));b=Math.max(0,Math.min(b,d));this._setSelection(new q(a,b,e),
c===void 0||c,!0,f)},setText:function(a,b,f){var e=b===void 0&&f===void 0;b===void 0&&(b=0);f===void 0&&(f=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:a,start:b,end:f,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new q(0,0,!1),!0),c.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(c.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var b=this._overlayDiv||this._clientDiv;if(c.isIE<9)b=this._viewDiv;for(var f=a.target?a.target:a.srcElement;f;){if(b===f)return;
f=f.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&c.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(c.isIE<9&&!this._getSelection().isEmpty()){var a=
this._rootDiv,b=c.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}if(this._cursorDiv)this._cursorDiv.style.display="none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),b=this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){b.rangeCount>0&&b.removeAllRanges();break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=
!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){c.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),b=b.defaultPrevented):c.isMac&&c.isFirefox&&
a.button===0&&(b=!0);if(b)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(c.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",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));c.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
a)));if(c.isWebkit||b)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(c.isWebkit||b){if(b)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;c.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 b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){if(c.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;b=!0;if(c.isSafari&&c.isMac&&
a.ctrlKey)b=!1,a.keyCode=129;b&&this._startIME()}else b||this._commitIME();if((c.isMac||c.isLinux)&&c.isFirefox<4||c.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(c.isMac&&c.isWebkit&&(63232<=
a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((c.isMac||c.isLinux)&&c.isFirefox<4||c.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=c.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),b.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;b=!1;if(c.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(c.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=c.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,b>31))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);
this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}(c.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(c.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),f=!0,e=b;if(c.isIE||c.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var d=this;b.setTimeout(function(){d.focus();d._ignoreFocus=
!1},0)}this._clickCount===1?(f=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!c.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return f},_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 b=a.which;b||(a.button===4&&(b=2),a.button===2&&(b=3),a.button===1&&(b=1));var f=b!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),e=f-this._lastMouseTime,d=Math.abs(this._lastMouseX-a.clientX),g=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=f;this._lastMouseButton=b;if(b===1)this._isMouseDown=!0,h&&e<=this._clickTime&&d<=this._clickDist&&g<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(f=this._createMouseEvent("MouseDown",a),this.onMouseDown(f),f.defaultPrevented)){a.preventDefault();return}if(b===1&&this._handleMouse(a)&&(c.isIE>=9||c.isOpera||c.isChrome||c.isSafari||c.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();c.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 b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var f=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(f&&!this._isMouseDown&&(c.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&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var b=a.clientX,a=a.clientY,e=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect(),g=this._getClientWidth(),h=this._getClientHeight(),f=d.left+e.left,j=d.top+e.top,g=d.left+e.left+g,e=d.top+e.top+h;a<j?this._doAutoScroll("up",
b,a-j):a>e?this._doAutoScroll("down",b,a-e):b<f&&!this._wrapMode?this._doAutoScroll("left",b-f,a):b>g&&!this._wrapMode?this._doAutoScroll("right",b-g,a):(this._endAutoScroll(),this._setSelectionTo(b,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 c=
this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible&&b&&this._isMouseDown){if(this._dragOffset!==-1)b=this._getSelection(),b.extend(this._dragOffset),b.collapse(),
this._setSelection(b,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);c.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var b=this._getLineHeight(),f=0,e=0;c.isIE||c.isOpera?e=-a.wheelDelta/40*b:c.isFirefox?(b=c.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?f=b:e=b):c.isMac?(e=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,f=a.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=
a.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,f=Math.ceil(-a.wheelDeltaX/f),-1<f&&f<0&&(f=-1),0<f&&f<1&&(f=1),e=Math.ceil(-a.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(f=-a.wheelDeltaX,e=-a.wheelDeltaY/120*8*b);if(c.isSafari){for(b=a.target;b&&b.lineIndex===void 0;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(f,e);f=this._getScroll();if(b.x!==f.x||b.y!==f.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&
this._doPaste(a)){if(c.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,b=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==b)this._parentWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=b,c.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,c=b.lineIndex;b&&!b._ruler;){if(c===void 0&&b.lineIndex!==void 0)c=b.lineIndex;b=b.parentNode}b=b?b._ruler:null;if(c===void 0&&b&&b.getOverview()==="document"){var c=this._getClientHeight(),f=this._model.getLineCount(),e=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-d.top-this._metrics.scrollWidth)*f/(c+e.top+e.bottom-2*this._metrics.scrollWidth));0<=c&&c<f||(c=void 0)}if(b)switch(a.type){case "click":if(b.onClick)b.onClick(c,
a);break;case "dblclick":if(b.onDblClick)b.onDblClick(c,a);break;case "mousemove":if(b.onMouseMove)b.onMouseMove(c,a);break;case "mouseover":if(b.onMouseOver)b.onMouseOver(c,a);break;case "mouseout":if(b.onMouseOut)b.onMouseOut(c,a)}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,c=this._vScroll;if(b!==a.x||c!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(c===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:c},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var c;c=a.tagName==="DIV"?a:a.parentNode.parentNode;var f=0,e=c.lineIndex;if(a.tagName!=="DIV")for(c=c.firstChild;c;){var d=c.firstChild;if(d===a){c.ignoreChars&&(f-=c.ignoreChars);f+=b;break}c.ignoreChars&&(f-=c.ignoreChars);f+=d.data.length;c=c.nextSibling}return Math.max(0,f)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new q(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(c.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var b=this;this._selTimer=a.setTimeout(function(){if(b._clientDiv)b._selTimer=null,b._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;if(c.isAndroid){for(var b=
this._getWindow().getSelection(),f=b.anchorNode;f;){if(f.lineIndex!==void 0)break;f=f.parentNode}if(f){var e=this._model,d=f.lineIndex,g=e.getLine(d),h=g,j=0,e=e.getLineStart(d);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),d=f.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(d),j=this._getDOMText(f,d),h=j.text,j=j.offset,d.parentNode.removeChild(d);f.lineRemoved=!0;for(f=0;g.charCodeAt(f)===h.charCodeAt(f)&&f<j;)f++;b=g.length-1;for(d=h.length-g.length;g.charCodeAt(b)===h.charCodeAt(b+
d)&&b+d>=j+a.data.length;)b--;b++;g=h.substring(f,b+d);f+=e;b+=e;this._modifyContent({text:g,start:f,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var f=a.touches;if(f.length===1){var f=f[0],e=f.clientX,d=f.clientY;this._touchStartX=
e;this._touchStartY=d;if(c.isAndroid&&(d<f.pageY-b.pageYOffset||e<f.pageX-b.pageXOffset))e=f.pageX-b.pageXOffset,d=f.pageY-b.pageYOffset;b=this.convert({x:e,y:d},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.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 c=this,f=this._getWindow();this._touchScrollTimer=f.setInterval(function(){var a=0,b=0;if(c._touching)a=c._touchStartX-c._touchCurrentX,b=c._touchStartY-c._touchCurrentY,c._touchSpeedX=a/10,c._touchSpeedY=b/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else if(Math.abs(c._touchSpeedX)<0.1&&Math.abs(c._touchSpeedY)<0.1){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";f.clearInterval(c._touchScrollTimer);
c._touchScrollTimer=null;return}else a=c._touchSpeedX*10,b=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,c,f=this._keyModes;for(c=f.length-1;c>=0;c--)if(b=f[c],typeof b.match==="function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var c=this._model,f=b.getCaret(),e=c.getLineAtOffset(f);
if(!a.count)a.count=1;for(;a.count!==0;){var d=c.getLineStart(e);if(a.count<0&&f===d)if(e>0)a.unit==="character"&&a.count++,e--,b.extend(c.getLineEnd(e));else break;else if(a.count>0&&f===c.getLineEnd(e))if(e+1<c.getLineCount())a.unit==="character"&&a.count--,e++,b.extend(c.getLineStart(e));else break;else{var g=!1;a.expandTab&&a.unit==="character"&&(f-d)%this._tabSize===0&&(g=!/[^ ]/.test(c.getText(d,f)));g?(b.extend(f-this._tabSize),a.count+=a.count<0?1:-1):(d=this._getLine(e),b.extend(d.getNextOffset(f,
a)),d.destroy())}f=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var c=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(b=0;b<c.length;b++){var f=c[b],e=f.toLowerCase(),f=e!==f?e:f.toUpperCase();a+=f}c=a;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var c=this._model,f=c.getLineAtOffset(b.end);b.end<c.getLineEnd(f)&&(c=this._getLine(f),b.extend(c.getNextOffset(b.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);
return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),c=this._model,f;if(a.ctrl)b.extend(c.getCharCount()),f=function(){};else{var e=b.getCaret(),d=c.getLineAtOffset(e);if(this._wrapMode){var g=this._getLine(d),
e=g.getLineIndex(e),e=e===g.getLineCount()-1?c.getLineEnd(d):g.getLineStart(e+1)-1;g.destroy()}else a.count&&a.count>0&&(d=Math.min(d+a.count-1,c.getLineCount()-1)),e=c.getLineEnd(d);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,f);return!0},_doEnter:function(a){var b=this._model,c=this._getSelection();this._doContent(b.getLineDelimiter());if(a&&a.noCursor)c.end=c.start,this._setSelection(c,!0);return!0},_doHome:function(a){var b=this._getSelection(),c=this._model,f;if(a.ctrl)b.extend(0),
f=function(){};else{var e=b.getCaret(),d=c.getLineAtOffset(e);this._wrapMode?(c=this._getLine(d),e=c.getLineIndex(e),e=c.getLineStart(e),c.destroy()):e=c.getLineStart(d);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,f);return!0},_doLineDown:function(a){var b=this._model,f=this._getSelection(),e=f.getCaret(),d=b.getLineAtOffset(e),g=this._getLine(d),h=this._columnX,j=1,l=!1;if(h===-1||a.wholeLine||a.select&&c.isIE)h=a.wholeLine?b.getLineEnd(d+1):e,h=g.getBoundingClientRect(h).left;
(e=g.getLineIndex(e))<g.getLineCount()-1?j=g.getClientRects(e+1).top+1:(e=b.getLineCount()-1,l=d===e,a.count&&a.count>0?d=Math.min(d+a.count,e):d++);e=!1;if(l){if(a.select||c.isMac||c.isLinux)f.extend(b.getCharCount()),e=!0}else g.lineIndex!==d&&(g.destroy(),g=this._getLine(d)),f.extend(g.getOffset(h,j)),e=!0;e&&(a.select||f.collapse(),this._setSelection(f,!0,!0));this._columnX=h;g.destroy();return!0},_doLineUp:function(a){var b=this._model,f=this._getSelection(),e=f.getCaret(),d=b.getLineAtOffset(e),
g=this._getLine(d),h=this._columnX,j=!1,l;if(h===-1||a.wholeLine||a.select&&c.isIE)h=a.wholeLine?b.getLineStart(d-1):e,h=g.getBoundingClientRect(h).left;(e=g.getLineIndex(e))>0?l=g.getClientRects(e-1).top+1:(j=d===0,j||(a.count&&a.count>0?d=Math.max(d-a.count,0):d--,l=this._getLineHeight(d)-1));e=!1;if(j){if(a.select||c.isMac||c.isLinux)f.extend(0),e=!0}else g.lineIndex!==d&&(g.destroy(),g=this._getLine(d)),f.extend(g.getOffset(h,l)),e=!0;e&&(a.select||f.collapse(),this._setSelection(f,!0,!0));this._columnX=
h;g.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,f=this._model,e=this._getSelection(),d=e.getCaret(),g=f.getLineAtOffset(d),h=f.getLineCount(),j=this._getScroll(),f=this._getClientHeight(),l,m;if(this._lineHeight){l=this._columnX;j=this._getBoundsAtOffset(d);if(l===-1||a.select&&c.isIE)l=j.left;d=this._getLineIndex(j.top+f);m=this._getLine(d);g=this._getLinePixel(d);d=m.getOffset(l,j.top+f-g);f=m.getBoundingClientRect(d);m.destroy();e.extend(d);a.select||e.collapse();
this._setSelection(e,!0,!0,function(){b._columnX=l},f.top+g-j.top);return!0}if(g<h-1){var n=this._getLineHeight(),i=Math.min(h-g-1,Math.floor(f/n)),i=Math.max(1,i);l=this._columnX;if(l===-1||a.select&&c.isIE)m=this._getLine(g),l=m.getBoundingClientRect(d).left,m.destroy();m=this._getLine(g+i);e.extend(m.getOffset(l,0));m.destroy();a.select||e.collapse();a=h*n;d=j.y+i*n;d+f>a&&(d=a-f);this._setSelection(e,!0,!0,function(){b._columnX=l},d-j.y)}return!0},_doPageUp:function(a){var b=this,f=this._model,
e=this._getSelection(),d=e.getCaret(),g=f.getLineAtOffset(d),h=this._getScroll(),j=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;h=this._getBoundsAtOffset(d);if(l===-1||a.select&&c.isIE)l=h.left;d=this._getLineIndex(h.bottom-j);f=this._getLine(d);g=this._getLinePixel(d);d=f.getOffset(l,h.bottom-j-g);j=f.getBoundingClientRect(d);f.destroy();e.extend(d);a.select||e.collapse();this._setSelection(e,!0,!0,function(){b._columnX=l},j.top+g-h.top);return!0}if(g>0){var m=this._getLineHeight(),
j=Math.max(1,Math.min(g,Math.floor(j/m)));l=this._columnX;if(l===-1||a.select&&c.isIE)f=this._getLine(g),l=f.getBoundingClientRect(d).left,f.destroy();f=this._getLine(g-j);e.extend(f.getOffset(l,this._getLineHeight(g-j)-1));f.destroy();a.select||e.collapse();a=Math.max(0,h.y-j*m);this._setSelection(e,!0,!0,function(){b._columnX=l},a-h.y)}return!0},_doPaste:function(a){var b=this;return this._getClipboardText(a,function(a){a&&(c.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<=
b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})!==null},_doScroll:function(a){var b=a.type,c=this._model,f=c.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();f*=e;var d=this._getScroll().y,g;switch(b){case "textStart":g=0;break;case "textEnd":g=f-a;break;case "pageDown":g=d+a;break;case "pageUp":g=d-a;break;case "lineDown":g=d+e;break;case "lineUp":g=d-e;break;case "centerLine":b=this._getSelection(),g=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-
g+1)*e,g=g*e-a/2+c/2}g!==void 0&&(g=Math.min(Math.max(0,g),f-a),this._scrollViewAnimated(0,g-d,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),c=b.getLineAtOffset(a),b=b.getLineStart(c),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);
return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=this._model,b=this._getSelection(),f=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=b.getCaret(),
d=a.getLineCount(),g=a.getLineAtOffset(e),h;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),h=Math.max(0,Math.min(d-1,g+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")h=this._getLineIndex(f.y),g=this._getLine(g),f.x+=g.getBoundingClientRect(e,!1).left,g.destroy();h===0&&(c.isMac||c.isLinux)?b.extend(0):h===d-1&&(c.isMac||c.isLinux)?b.extend(a.getCharCount()):(g=this._getLine(h),b.extend(g.getOffset(f.x,
f.y-this._getLinePixel(h))),g.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),c=0;if(a){for(var a=0,f=(new Date).getTime(),e=0;c<b;)if(this._lineHeight[c]||(a++,e||(e=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-
f>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(c!==b){var d=this;this._calculateLHTimer=a.setTimeout(function(){d._calculateLHTimer=null;d._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,b=a.ownerDocument,
f=c.createElement(b,"div");f.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);j(e.style,f);f.style.position="fixed";f.style.left="-1000px";var d=c.createElement(b,"span");d.appendChild(b.createTextNode(" "));f.appendChild(d);var g=c.createElement(b,"span");g.style.fontStyle="italic";g.appendChild(b.createTextNode(" "));f.appendChild(g);var h=c.createElement(b,"span");h.style.fontWeight="bold";h.appendChild(b.createTextNode(" "));
f.appendChild(h);e=c.createElement(b,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(b.createTextNode(" "));f.appendChild(e);a.appendChild(f);var l=f.getBoundingClientRect(),d=d.getBoundingClientRect(),g=g.getBoundingClientRect(),h=h.getBoundingClientRect(),e=e.getBoundingClientRect(),d=d.bottom-d.top,g=g.bottom-g.top,h=h.bottom-h.top,i=e.bottom-e.top,k=0,e=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);g>d&&(k=1);h>g&&(k=2);i>h&&(k=3);var q;if(k!==0){q={style:{}};if((k&
1)!==0)q.style.fontStyle="italic";if((k&2)!==0)q.style.fontWeight="bold"}d=m(f);a.removeChild(f);g=n(this._viewDiv);f=c.createElement(b,"div");f.style.position="fixed";f.style.left="-1000px";f.style.paddingLeft=g.left+"px";f.style.paddingTop=g.top+"px";f.style.paddingRight=g.right+"px";f.style.paddingBottom=g.bottom+"px";f.style.width="100px";f.style.height="100px";h=c.createElement(b,"div");h.style.width="100%";h.style.height="100%";f.appendChild(h);a.appendChild(f);b=f.getBoundingClientRect();g=
h.getBoundingClientRect();f.style.overflow="hidden";h.style.height="200px";h=f.clientWidth;f.style.overflow="scroll";i=f.clientWidth;a.removeChild(f);g={left:g.left-b.left,top:g.top-b.top,right:b.right-g.right,bottom:b.bottom-g.bottom};return{lineHeight:l,largestFontStyle:q,lineTrim:d,viewPadding:g,scrollWidth:h-i,invalid:e}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;a===
"next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),c=a.getLineStart(b),f=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),c=this._imeOffset-c,a=c+f.length-a.length;c!==a&&this._doContent(f.substring(c,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new i.DefaultKeyMode(this));var b=this;this._actions={noop:{defaultHandler:function(){return b._doNoop()}},
lineUp:{defaultHandler:function(c){return b._doLineUp(a(c,{select:!1}))},actionDescription:{name:h.lineUp}},lineDown:{defaultHandler:function(c){return b._doLineDown(a(c,{select:!1}))},actionDescription:{name:h.lineDown}},lineStart:{defaultHandler:function(c){return b._doHome(a(c,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineStart}},lineEnd:{defaultHandler:function(c){return b._doEnd(a(c,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineEnd}},charPrevious:{defaultHandler:function(c){return b._doCursorPrevious(a(c,
{select:!1,unit:"character"}))},actionDescription:{name:h.charPrevious}},charNext:{defaultHandler:function(c){return b._doCursorNext(a(c,{select:!1,unit:"character"}))},actionDescription:{name:h.charNext}},pageUp:{defaultHandler:function(c){return b._doPageUp(a(c,{select:!1}))},actionDescription:{name:h.pageUp}},pageDown:{defaultHandler:function(c){return b._doPageDown(a(c,{select:!1}))},actionDescription:{name:h.pageDown}},scrollPageUp:{defaultHandler:function(c){return b._doScroll(a(c,{type:"pageUp"}))},
actionDescription:{name:h.scrollPageUp}},scrollPageDown:{defaultHandler:function(c){return b._doScroll(a(c,{type:"pageDown"}))},actionDescription:{name:h.scrollPageDown}},scrollLineUp:{defaultHandler:function(c){return b._doScroll(a(c,{type:"lineUp"}))},actionDescription:{name:h.scrollLineUp}},scrollLineDown:{defaultHandler:function(c){return b._doScroll(a(c,{type:"lineDown"}))},actionDescription:{name:h.scrollLineDown}},wordPrevious:{defaultHandler:function(c){return b._doCursorPrevious(a(c,{select:!1,
unit:"word"}))},actionDescription:{name:h.wordPrevious}},wordNext:{defaultHandler:function(c){return b._doCursorNext(a(c,{select:!1,unit:"word"}))},actionDescription:{name:h.wordNext}},textStart:{defaultHandler:function(c){return b._doHome(a(c,{select:!1,ctrl:!0}))},actionDescription:{name:h.textStart}},textEnd:{defaultHandler:function(c){return b._doEnd(a(c,{select:!1,ctrl:!0}))},actionDescription:{name:h.textEnd}},scrollTextStart:{defaultHandler:function(c){return b._doScroll(a(c,{type:"textStart"}))},
actionDescription:{name:h.scrollTextStart}},scrollTextEnd:{defaultHandler:function(c){return b._doScroll(a(c,{type:"textEnd"}))},actionDescription:{name:h.scrollTextEnd}},centerLine:{defaultHandler:function(c){return b._doScroll(a(c,{type:"centerLine"}))},actionDescription:{name:h.centerLine}},selectLineUp:{defaultHandler:function(c){return b._doLineUp(a(c,{select:!0}))},actionDescription:{name:h.selectLineUp}},selectLineDown:{defaultHandler:function(c){return b._doLineDown(a(c,{select:!0}))},actionDescription:{name:h.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(c){return b._doLineUp(a(c,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(c){return b._doLineDown(a(c,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineDown}},selectLineStart:{defaultHandler:function(c){return b._doHome(a(c,{select:!0,ctrl:!1}))},actionDescription:{name:h.selectLineStart}},selectLineEnd:{defaultHandler:function(c){return b._doEnd(a(c,{select:!0,ctrl:!1}))},
actionDescription:{name:h.selectLineEnd}},selectCharPrevious:{defaultHandler:function(c){return b._doCursorPrevious(a(c,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharPrevious}},selectCharNext:{defaultHandler:function(c){return b._doCursorNext(a(c,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharNext}},selectPageUp:{defaultHandler:function(c){return b._doPageUp(a(c,{select:!0}))},actionDescription:{name:h.selectPageUp}},selectPageDown:{defaultHandler:function(c){return b._doPageDown(a(c,
{select:!0}))},actionDescription:{name:h.selectPageDown}},selectWordPrevious:{defaultHandler:function(c){return b._doCursorPrevious(a(c,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordPrevious}},selectWordNext:{defaultHandler:function(c){return b._doCursorNext(a(c,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordNext}},selectTextStart:{defaultHandler:function(c){return b._doHome(a(c,{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextStart}},selectTextEnd:{defaultHandler:function(c){return b._doEnd(a(c,
{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextEnd}},deletePrevious:{defaultHandler:function(c){return b._doBackspace(a(c,{unit:"character"}))},actionDescription:{name:h.deletePrevious}},deleteNext:{defaultHandler:function(c){return b._doDelete(a(c,{unit:"character"}))},actionDescription:{name:h.deleteNext}},deleteWordPrevious:{defaultHandler:function(c){return b._doBackspace(a(c,{unit:"word"}))},actionDescription:{name:h.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(c){return b._doDelete(a(c,
{unit:"word"}))},actionDescription:{name:h.deleteWordNext}},deleteLineStart:{defaultHandler:function(c){return b._doBackspace(a(c,{unit:"line"}))},actionDescription:{name:h.deleteLineStart}},deleteLineEnd:{defaultHandler:function(c){return b._doDelete(a(c,{unit:"line"}))},actionDescription:{name:h.deleteLineEnd}},tab:{defaultHandler:function(){return b._doTab()},actionDescription:{name:h.tab}},shiftTab:{defaultHandler:function(){return b._doShiftTab()},actionDescription:{name:h.shiftTab}},enter:{defaultHandler:function(){return b._doEnter()},
actionDescription:{name:h.enter}},enterNoCursor:{defaultHandler:function(c){return b._doEnter(a(c,{noCursor:!0}))},actionDescription:{name:h.enterNoCursor}},selectAll:{defaultHandler:function(){return b._doSelectAll()},actionDescription:{name:h.selectAll}},copy:{defaultHandler:function(){return b._doCopy()},actionDescription:{name:h.copy}},cut:{defaultHandler:function(){return b._doCut()},actionDescription:{name:h.cut}},paste:{defaultHandler:function(){return b._doPaste()},actionDescription:{name:h.paste}},
uppercase:{defaultHandler:function(c){return b._doCase(a(c,{type:"upper"}))},actionDescription:{name:h.uppercase}},lowercase:{defaultHandler:function(c){return b._doCase(a(c,{type:"lower"}))},actionDescription:{name:h.lowercase}},capitalize:{defaultHandler:function(c){return b._doCase(a(c,{unit:"word",type:"capitalize"}))},actionDescription:{name:h.capitalize}},reversecase:{defaultHandler:function(c){return b._doCase(a(c,{type:"reverse"}))},actionDescription:{name:h.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return b._doOverwriteMode()},
actionDescription:{name:h.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return b._doTabMode()},actionDescription:{name:h.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return b._doWrapMode()},actionDescription:{name:h.toggleWrapMode}}}},_createRuler:function(a,b){if(this._clientDiv){var f=a.getLocation()==="left"?this._leftDiv:this._rightDiv;f.style.display="block";var e=c.createElement(f.ownerDocument,"div");e._ruler=a;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat=
"left";e.style.styleFloat="left";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";if(b===void 0||b<0||b>=f.children.length)f.appendChild(e);else{for(var d=f.firstChild;d&&--b>0;)d=d.nextSibling;f.insertBefore(e,d)}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var b=a.ownerDocument,f=c.createElement(b,"div");this._rootDiv=f;f.tabIndex=-1;f.style.position="relative";f.style.overflow="hidden";
f.style.width="100%";f.style.height="100%";f.style.overflow="hidden";f.style.WebkitTextSizeAdjust="100%";f.setAttribute("role","application");a.appendChild(f);a=c.createElement(b,"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");f.appendChild(a);
a=c.createElement(b,"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(c.isMac&&c.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";f.appendChild(a);var e=c.createElement(b,"div");e.className="textviewRightRuler";this._rightDiv=e;e.tabIndex=-1;e.style.display="none";e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.right="0px";e.setAttribute("aria-hidden","true");f.appendChild(e);this._scrollDiv=e=c.createElement(b,"div");e.style.margin="0px";e.style.borderWidth="0px";e.style.padding="0px";a.appendChild(e);if(c.isFirefox)this._clipboardDiv=a=c.createElement(b,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",f.appendChild(a);
if(!c.isIE&&!c.isIOS)this._clipDiv=a=c.createElement(b,"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",f.appendChild(a),this._clipScrollDiv=e=c.createElement(b,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",a.appendChild(e);this._setFullSelection(this._fullSelection,!0);a=c.createElement(b,"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(c.isIOS||c.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||f).appendChild(a);if(c.isIOS||c.isAndroid)this._vScrollDiv=e=c.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",
e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",f.appendChild(e),this._hScrollDiv=e=c.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",
e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",f.appendChild(e);if(c.isFirefox&&!a.setCapture)this._overlayDiv=b=c.createElement(b,"div"),b.style.position=a.style.position,b.style.borderWidth=a.style.borderWidth,b.style.margin=a.style.margin,b.style.padding=a.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||f).appendChild(b);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();f=this._rulers;for(b=0;b<f.length;b++)this._createRuler(f[b]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,
update:this._setTabSize},expandTab:{value:!1,update:null},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:d.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(b)for(var c=b.firstChild;c;){if(c._ruler===a){c._ruler=
void 0;b.removeChild(c);if(b.children.length===0)b.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,c){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var c=this._model;c.getBaseModel&&(a=c.mapOffset(a),b=c.mapOffset(b),c=c.getBaseModel());return c.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();a.bottom>c.bottom&&(b=this._getLinePrevious(b)||
b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),c=this._getLinePixel(b.lineIndex);a.top+=c;a.bottom+=c;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var f=this._model.getLineDelimiter(),
e,d,g=this._getWindow();if(g.clipboardData)return e=[],d=g.clipboardData.getData("Text"),l(d,function(a){e.push(a)},function(){e.push(f)}),d=e.join(""),b&&b(d),d;if(c.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var j=this,m=function(){var a=j._getTextFromElement(h);h.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(f)});return e.join("")},n=!1;this._ignorePaste=!0;if(!c.isLinux||this._lastMouseButton!==2)try{n=
h.ownerDocument.execCommand("paste",!1,null)}catch(i){n=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!n)return a?(g.setTimeout(function(){j.focus();(d=m())&&b&&b(d);j._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(d=m())&&b&&b(d);return d}return a&&a.clipboardData?(e=[],d=a.clipboardData.getData("text/plain"),l(d,function(a){e.push(a)},function(){e.push(f)}),(d=e.join(""))&&b&&b(d),d):""},_getDOMText:function(a,
b){for(var c=a.firstChild,f="",e=0;c;){var d;if(!c.ignore)if(c.ignoreChars){d=c.lastChild;for(var g=0,h=[],j=-1;d;){for(var l=d.data,m=l.length-1;m>=0;m--){var n=l.substring(m,m+1);g<c.ignoreChars&&(n===" "||n==="\u200c"||n==="\ufeff")?g++:h.push(n==="\u00a0"?"\t":n)}if(b===d)j=h.length;d=d.previousSibling}h=h.reverse().join("");j!==-1&&(e=f.length+h.length-j);f+=h}else for(d=c.firstChild;d;){if(b===d)e=f.length;f+=d.data;d=d.nextSibling}c=c.nextSibling}return{text:f,offset:e}},_getTextFromElement:function(a){var b=
a.ownerDocument,c=b.defaultView;if(!c.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);var a=c.getSelection(),c=[],f;for(f=0;f<a.rangeCount;f++)c.push(a.getRangeAt(f));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(f=0;f<c.length;f++)a.addRange(c[f]);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 c=this._lineHeight[a];if(c)return c;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)c+=this._getLineHeight(b);else for(b-=1;b>=a;b--)c-=this._getLineHeight(b);return c}return this._getLineHeight()*a},_getLineIndex:function(a){var b,c=0,f=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),
e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<e&&c>0;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=e&&c<f-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(f-1,c))},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();a.top<f.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var f=this._handlers=[],e=this._clientDiv,d=this._viewDiv,g=this._rootDiv,h=this._overlayDiv||e,j=e.ownerDocument,l=this._getWindow(),m=c.isIE?j:l;f.push({target:l,type:"resize",handler:function(b){return a._handleResize(b?b:l.event)}});f.push({target:e,type:"blur",handler:function(b){return a._handleBlur(b?b:l.event)}});f.push({target:e,type:"focus",handler:function(b){return a._handleFocus(b?
b:l.event)}});f.push({target:d,type:"focus",handler:function(){e.focus()}});f.push({target:d,type:"scroll",handler:function(b){return a._handleScroll(b?b:l.event)}});f.push({target:e,type:"textInput",handler:function(b){return a._handleTextInput(b?b:l.event)}});f.push({target:e,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:l.event)}});f.push({target:e,type:"keypress",handler:function(b){return a._handleKeyPress(b?b:l.event)}});f.push({target:e,type:"keyup",handler:function(b){return a._handleKeyUp(b?
b:l.event)}});f.push({target:e,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:l.event)}});f.push({target:e,type:"copy",handler:function(b){return a._handleCopy(b?b:l.event)}});f.push({target:e,type:"cut",handler:function(b){return a._handleCut(b?b:l.event)}});f.push({target:e,type:"paste",handler:function(b){return a._handlePaste(b?b:l.event)}});if(c.isIOS||c.isAndroid)f.push({target:j,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:l.event)}}),
f.push({target:e,type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:l.event)}}),f.push({target:e,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:l.event)}}),f.push({target:e,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:l.event)}});else{f.push({target:e,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:l.event)}});f.push({target:e,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:l.event)}});f.push({target:e,
type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:l.event)}});f.push({target:e,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:l.event)}});f.push({target:m,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:l.event)}});f.push({target:m,type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:l.event)}});f.push({target:g,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:l.event)}});f.push({target:g,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?
b:l.event)}});f.push({target:h,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:l.event)}});f.push({target:h,type:"drag",handler:function(b){return a._handleDrag(b?b:l.event)}});f.push({target:h,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:l.event)}});f.push({target:h,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:l.event)}});f.push({target:h,type:"dragover",handler:function(b){return a._handleDragOver(b?b:l.event)}});f.push({target:h,type:"dragleave",
handler:function(b){return a._handleDragLeave(b?b:l.event)}});f.push({target:h,type:"drop",handler:function(b){return a._handleDrop(b?b:l.event)}});f.push({target:this._clientDiv,type:c.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:l.event)}});if(c.isFirefox&&(!c.isWindows||c.isFirefox>=15))(d=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new d(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):
f.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:l.event)}});this._overlayDiv&&(f.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:l.event)}}),f.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:l.event)}}),f.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:l.event)}}),f.push({target:this._overlayDiv,
type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:l.event)}}));this._isW3CEvents||f.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:l.event)}})}d=this._leftDiv;g=this._rightDiv;c.isIE&&f.push({target:d,type:"selectstart",handler:function(){return!1}});f.push({target:d,type:c.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:l.event)}});f.push({target:d,type:"click",handler:function(b){a._handleRulerEvent(b?
b:l.event)}});f.push({target:d,type:"dblclick",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:d,type:"mousemove",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:d,type:"mouseover",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:d,type:"mouseout",handler:function(b){a._handleRulerEvent(b?b:l.event)}});c.isIE&&f.push({target:g,type:"selectstart",handler:function(){return!1}});f.push({target:g,type:c.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(b){return a._handleMouseWheel(b?b:l.event)}});f.push({target:g,type:"click",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:g,type:"dblclick",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:g,type:"mousemove",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:g,type:"mouseover",handler:function(b){a._handleRulerEvent(b?b:l.event)}});f.push({target:g,type:"mouseout",handler:function(b){a._handleRulerEvent(b?b:l.event)}});
for(d=0;d<f.length;d++)g=f[d],b(g.target,g.type,g.handler,g.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 b=a.parent;typeof b==="string"&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new k.TextModel;var f=this._defaultOptions(),e;for(e in f)f.hasOwnProperty(e)&&
(this["_"+e]=a[e]!==void 0?a[e]:f[e].value);this._keyModes=[];this._rulers=[];this._selection=new q(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=(!c.isIE||c.isIE>=9)&&typeof b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=
50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var c=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;c.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(c=this._getSelection(),c.setCaret(a.start+a.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,c=a.addedCharCount,f=a.removedCharCount,e=a.addedLineCount,d=a.removedLineCount,g=this._getSelection();g.end>b&&(g.end>b&&g.start<b+f?g.setCaret(b+c):(g.start+=c-f,g.end+=c-f),this._setSelection(g,
!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;){f=c.lineIndex;if(b<=f&&f<=b+d)b===f&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(f>b+d)c.lineIndex=f+e-d,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(a=[b,d].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+d)this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var c=a;c<b;c++)this._lineHeight[c]=void 0;
else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new q(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var a=this._clientDiv;if(a){for(var b=a.firstChild;b;)b.lineRemoved=!0,b=b.nextSibling;if(c.isFirefox)this._ignoreFocus=!1,(b=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,b&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,c){if(c&&this._scrollAnimation){var f=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);f._scrollView(0,a);b-=a},onEnd:function(){f._animation=null;f._scrollView(a,
b);c&&c()}});this._animation.play()}else this._scrollView(a,b),c&&c()},_scrollView:function(a,b){this._ensureCaretVisible=!1;var c=this._viewDiv;a&&(c.scrollLeft+=a);b&&(c.scrollTop+=b)},_setClipboardText:function(a,b){var f,e=this._parent.ownerDocument,d=this._getWindow();if(d.clipboardData)return f=[],l(a,function(a){f.push(a)},function(){f.push(c.platformDelimiter)}),d.clipboardData.setData("Text",f.join(""));if(b&&b.clipboardData&&(f=[],l(a,function(a){f.push(a)},function(){f.push(c.platformDelimiter)}),
b.clipboardData.setData("text/plain",f.join(""))))return!0;var g=c.createElement(e,"pre");g.style.position="fixed";g.style.left="-1000px";l(a,function(a){g.appendChild(e.createTextNode(a))},function(){g.appendChild(c.createElement(e,"br"))});g.appendChild(e.createTextNode(" "));this._clientDiv.appendChild(g);var h=e.createRange();h.setStart(g.firstChild,0);h.setEndBefore(g.lastChild);var j=d.getSelection();j.rangeCount>0&&j.removeAllRanges();j.addRange(h);var m=this,h=function(){g&&g.parentNode===
m._clientDiv&&m._clientDiv.removeChild(g);m._updateDOMSelection()},j=!1;this._ignoreCopy=!0;try{j=e.execCommand("copy",!1,null)}catch(n){}this._ignoreCopy=!1;if(!j&&b)return d.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(a,b,f,e,d){for(var g,h,j,l,m=0,n=a.firstChild,i,k,q=this._model.getLine(a.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(m+k>b||m+k>=q){g=i;h=b-m;n.ignoreChars&&k>0&&h===k&&(h+=n.ignoreChars);break}m+=k}n=n.nextSibling}for(var m=
0,n=f.firstChild,p=this._model.getLine(f.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(k+m>e||m+k>=p){j=i;l=e-m;n.ignoreChars&&k>0&&l===k&&(l+=n.ignoreChars);break}m+=k}n=n.nextSibling}this._setDOMFullSelection(a,b,q,f,e,p);a=this._getWindow();b=this._parent.ownerDocument;if(a.getSelection){f=a.getSelection();a=b.createRange();a.setStart(g,h);a.setEnd(j,l);if(this._hasFocus&&(f.anchorNode!==g||f.anchorOffset!==h||f.focusNode!==j||f.focusOffset!==
l||f.anchorNode!==j||f.anchorOffset!==l||f.focusNode!==g||f.focusOffset!==h))this._ignoreSelect=!1,f.rangeCount>0&&f.removeAllRanges(),f.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=b.createRange(),d?(a.setStart(g,h),a.setEnd(g,h)):(a.setStart(j,l),a.setEnd(j,l)),j=a.getClientRects()[0],l=this._cursorDiv.parentNode,g=l.getBoundingClientRect(),j&&g))this._cursorDiv.style.top=j.top-g.top+l.scrollTop+"px",this._cursorDiv.style.left=j.left-g.left+l.scrollLeft+"px"}else if(b.selection&&this._hasFocus)d=
b.body,a=c.createElement(b,"div"),d.appendChild(a),d.removeChild(a),a=d.createTextRange(),a.moveToElementText(g.parentNode),a.moveStart("character",h),g=d.createTextRange(),g.moveToElementText(j.parentNode),g.moveStart("character",l),a.setEndPoint("EndToStart",g),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,c,f,e){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,
c.style.width="0px",c.style.height="0px",!(a===f&&b===e))){var d=this._model,g=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),j=this._viewDiv.getBoundingClientRect(),c=j.left+g.left,l=h.right,g=j.top+g.top,m=h.bottom,j=h=0;this._clipDiv?(j=this._clipDiv.getBoundingClientRect(),h=j.left-this._clipDiv.scrollLeft):(j=this._rootDiv.getBoundingClientRect(),h=j.left);j=j.top;this._ignoreDOMSelection=!0;var a=(new p(this,a.lineIndex,a)).getBoundingClientRect(d.getLineStart(a.lineIndex)+
b,!1),n=a.left,e=(new p(this,f.lineIndex,f)).getBoundingClientRect(d.getLineStart(f.lineIndex)+e,!1),b=e.left;this._ignoreDOMSelection=!1;var d=this._selDiv1,n=Math.min(l,Math.max(c,n)),i=Math.min(m,Math.max(g,a.top)),k=l,f=Math.min(m,Math.max(g,a.bottom));d.style.left=n-h+"px";d.style.top=i-j+"px";d.style.width=Math.max(0,k-n)+"px";d.style.height=Math.max(0,f-i)+"px";if(a.top===e.top)k=Math.min(b,l),d.style.width=Math.max(0,k-n)+"px";else if(a=Math.min(m,Math.max(g,e.top)),b=Math.min(l,Math.max(c,
b)),g=Math.min(m,Math.max(g,e.bottom)),m=this._selDiv3,m.style.left=c-h+"px",m.style.top=a-j+"px",m.style.width=Math.max(0,b-c)+"px",m.style.height=Math.max(0,g-a)+"px",a-f>0)g=this._selDiv2,g.style.left=c-h+"px",g.style.top=f-j+"px",g.style.width=Math.max(0,l-c)+"px",g.style.height=Math.max(0,a-f)+"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(c.isIE&&a)this._hadFocus=this._hasFocus;var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&!a&&b.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(b=a.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var f=b.nextSibling,e=b.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,b.firstChild.data,e),b);b=f}a=this._getLineNext(a)}this._updateDOMSelection()}},
_setSelection:function(a,b,c,f,e){if(a){this._columnX=-1;c===void 0&&(c=!0);var d=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,f,b,e);c&&this._updateDOMSelection();if(!d.equals(a))this.onSelection({type:"Selection",oldValue:{start:d.start,end:d.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,c,f){var e=this._model,d=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(b.x,
b.y-this._getLinePixel(a));e.destroy();if(f&&!c&&d.start<=a&&a<d.end)return this._dragOffset=a,!1;d.extend(a);c||d.collapse()}else(this._clickCount&1)===0?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,f=e.getNextOffset(a,{unit:"wordend",count:1})):(c=e.getNextOffset(a,{unit:"word",count:-1}),f=this._doubleClickSelection.end):(c=e.getNextOffset(a,{unit:"word",count:-1}),f=e.getNextOffset(c,
{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(f=e.getLineAtOffset(this._doubleClickSelection.start),a>=f?(c=e.getLineStart(f),f=e.getLineEnd(a)):(c=e.getLineStart(a),f=e.getLineEnd(f))):(c=e.getLineStart(a),f=e.getLineEnd(a)),d.setCaret(c),d.extend(f);this._setSelection(d,!0,!0);return!0},_setFullSelection:function(a,b){this._fullSelection=a;if(c.isWebkit)this._fullSelection=!0;var f=this._clipDiv||this._rootDiv;if(f)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!c.isIOS){var e=f.ownerDocument;this._highlightRGB=c.isWebkit?"transparent":"Highlight";var d=c.createElement(e,"div");this._selDiv1=d;d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";f.appendChild(d);var g=c.createElement(e,"div");this._selDiv2=g;g.style.position="absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding=
"0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";f.appendChild(g);this._selDiv3=e=c.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";f.appendChild(e);if(c.isFirefox&&c.isMac){f=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");
switch(f){case "rgb(119, 141, 168)":f="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":f="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":f="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":f="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":f="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":f="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":f="rgb(232, 184, 255)";break;default:f="rgb(180, 213, 255)"}this._highlightRGB=f;d.style.background=f;g.style.background=f;e.style.background=
f}b||this._updateDOMSelection()}}else{if(this._selDiv1)f.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)f.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)f.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=
c.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,
b){this._tabSize=a;this._customTabSize=void 0;var f=this._clientDiv;if(c.isOpera){if(f)f.style.OTabSize=this._tabSize+""}else if(c.isWebkit>=537.1){if(f)f.style.tabSize=this._tabSize+""}else if(c.isFirefox>=4){if(f)f.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var c="textview",f=this._theme.getThemeClass();f&&(c+=" "+f);this._themeClass&&f!==this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var c=this._clientDiv,f=this._viewDiv;a?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word",f.style.overflowX="hidden",f.style.overflowY="scroll"):
(c.style.whiteSpace="pre",c.style.wordWrap="normal",f.style.overflowX="auto",f.style.overflowY="auto");b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,f){if(this._clientDiv){var e=this._model,d=this._getSelection(),g=this._getScroll(),h=d.getCaret(),j=d.start,l=d.end,m=e.getLineAtOffset(l),n=Math.max(Math.max(j,e.getLineStart(m)),l-1),e=this._getClientWidth(),m=this._getClientHeight(),i=e/4,k=this._getBoundsAtOffset(h===j?j:n),q=k.left,p=k.right,s=k.top,
r=k.bottom;a&&!d.isEmpty()&&(k=this._getBoundsAtOffset(h===l?j:n),k.top===s?h===j?p=q+Math.min(k.right-q,e):q=p-Math.min(p-k.left,e):h===j?r=s+Math.min(k.bottom-s,m):s=r-Math.min(r-k.top,m));a=0;q<g.x&&(a=Math.min(q-g.x,-i));p>g.x+e&&(a=Math.max(p-g.x-e,i));d=0;s<g.y?d=s-g.y:r>g.y+m&&(d=r-g.y-m);f&&(f>0?d>0&&(d=Math.max(d,f)):d<0&&(d=Math.min(d,f)));if(a!==0||d!==0)return d!==0&&typeof c==="number"&&(c<0&&(c=0),c>1&&(c=1),d+=Math.floor(d>0?c*m:-c*m)),this._scrollViewAnimated(a,d,b),m!==this._getClientHeight()||
e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);
this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a],c=b.target,f=b.type,b=b.handler;typeof c.removeEventListener==="function"?c.removeEventListener(f,b,!1):c.detachEvent("on"+f,b)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,c=b.getLineAtOffset(a.start),f=b.getLineAtOffset(a.end),
e=this._getLineNext();if(e){var d=this._getLinePrevious(),g;c<e.lineIndex?(g=e,c=0):c>d.lineIndex?(g=d,c=0):(g=this._getLineNode(c),c=a.start-b.getLineStart(c));f<e.lineIndex?b=0:f>d.lineIndex?(e=d,b=0):(e=this._getLineNode(f),b=a.end-b.getLineStart(f));this._setDOMSelection(g,c,e,b,a.caret)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var b=this._clientDiv;if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var f=this._model,e=this._getScroll(!1),d=this._getViewPadding(),g=f.getLineCount(),h=this._getLineHeight(),j=this._getClientWidth();if(this._wrapMode)b.style.width=j+"px";var l,m,n,i,k=0,q=0;if(this._lineHeight){for(;q<g;){m=this._getLineHeight(q);if(k+m>e.y)break;k+=m;q++}l=q;m=Math.max(0,l-1);n=f=e.y-k;l>0&&(f+=this._getLineHeight(l-1))}else i=Math.max(0,e.y)/h,l=Math.floor(i),m=Math.max(0,l-1),f=Math.round((i-m)*h),n=Math.round((i-l)*h);this._topIndexY=
n;i=this._parent;var s=i.clientWidth,r=i.clientHeight;i=this._getClientHeight();if(a){h=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),h=l.right-l.left);l=j;for(this._wrapMode||(l=Math.max(this._maxLineWidth,l));q<g;)m=this._getLineHeight(q,!1),k+=m,q++;g=k}else{j=this._viewDiv;n=Math.min(l+Math.floor((i+n)/h),g-1);for(var e=Math.min(n+1,g-1),t,y=b.firstChild;y;){t=y.lineIndex;var B=y.nextSibling;if(!(m<=t&&t<=e)||y.lineRemoved||y.lineIndex===-1)this._mouseWheelLine===y?(y.style.display=
"none",y.lineIndex=-1):b.removeChild(y);y=B}var y=this._getLineNext(),B=j.ownerDocument,C=B.createDocumentFragment();for(t=m;t<=e;t++)if(!y||y.lineIndex>t)(new p(this,t)).create(C,null);else{C.firstChild&&(b.insertBefore(C,y),C=B.createDocumentFragment());if(y&&y.lineChanged)y=(new p(this,t)).create(C,y),y.lineChanged=!1;y=this._getLineNext(y)}C.firstChild&&b.insertBefore(C,y);if(c.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";y=this._getLineNext();t=i+f;for(C=!1;y;){m=y.lineWidth;if(m===
void 0)if(B=y._line.getBoundingClientRect(),m=y.lineWidth=Math.ceil(B.right-B.left),B=B.bottom-B.top,this._lineHeight)this._lineHeight[y.lineIndex]=B;else if(h!==0&&B!==0&&Math.ceil(h)!==Math.ceil(B))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=B;if(this._lineHeight&&!C&&(t-=this._lineHeight[y.lineIndex],t<0))n=y.lineIndex,C=!0;if(!this._wrapMode){if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=y.lineIndex;if(this._checkMaxLineIndex===y.lineIndex)this._checkMaxLineIndex=
-1}if(y.lineIndex===l)this._topChild=y;if(y.lineIndex===n)this._bottomChild=y;y=this._getLineNext(y)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<g)){h=new p(this,t);B=h.getBoundingClientRect();m=B.right-B.left;if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=t;h.destroy()}for(;q<g;)m=this._getLineHeight(q,q<=n),k+=m,q++;g=k;this._updateRuler(this._leftDiv,l,e,r);this._updateRuler(this._rightDiv,l,e,r);h=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),
h=l.right-l.left);e=0;this._rightDiv&&(e=this._rightDiv.getBoundingClientRect(),e=e.right-e.left);j.style.left=h+"px";j.style.right=e+"px";e=this._scrollDiv;e.style.height=g+"px";k=j=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));l=k;if((!c.isIE||c.isIE>=9)&&this._maxLineWidth>j)k+=d.right+d.left;e.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";e=this._getScroll(!1)}if(this._vScrollDiv)k=i-8,q=Math.max(15,Math.ceil(Math.min(1,k/(g+d.top+
d.bottom))*k)),this._vScrollDiv.style.left=h+j-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,e.y*k/g))+"px",this._vScrollDiv.style.height=q+"px";if(!this._wrapMode&&this._hScrollDiv)k=j-8,q=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+d.left+d.right))*k)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(e.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=i-9+"px",this._hScrollDiv.style.width=q+"px";y=e.x;m=this._clipDiv;k=this._overlayDiv;if(m){m.scrollLeft=
y;m.scrollTop=0;q=h+d.left;n=d.top;a=j;h=i;y=0;t=-f;if(e.x===0)q-=d.left,a+=d.left,y=d.left;e.x+j===l&&(a+=d.right);e.y===0&&(n-=d.top,h+=d.top,t+=d.top);e.y+i===g&&(h+=d.bottom);m.style.left=q+"px";m.style.top=n+"px";m.style.right=s-a-q+"px";m.style.bottom=r-h-n+"px";b.style.left=y+"px";b.style.top=t+"px";b.style.width=l+"px";b.style.height=i+f+"px";if(k)k.style.left=b.style.left,k.style.top=b.style.top,k.style.width=b.style.width,k.style.height=b.style.height}else{q=y;n=f;s=y+j;r=f+i;q===0&&(q-=
d.left);n===0&&(n-=d.top);s===l&&(s+=d.right);e.y+i===g&&(r+=d.bottom);b.style.clip="rect("+n+"px,"+s+"px,"+r+"px,"+q+"px)";b.style.left=-y+h+d.left+"px";b.style.width=(c.isWebkit?l:j+y)+"px";if(!a)b.style.top=-f+d.top+"px",b.style.height=i+f+"px";if(k&&(k.style.clip=b.style.clip,k.style.left=b.style.left,k.style.width=b.style.width,!a))k.style.top=b.style.top,k.style.height=b.style.height}this._updateDOMSelection();b=this._ensureCaretVisible;this._ensureCaretVisible=!1;i!==this._getClientHeight()&&
(this._update(),b&&this._showCaret())}}},_updateRuler:function(a,b,f,e){if(a)for(var d=this._parent.ownerDocument,g=this._getLineHeight(),h=this._getViewPadding(),a=a.firstChild;a;){var l=a._ruler,m=g,n=l.getOverview();n==="page"&&(m+=this._topIndexY);a.style.top=-m+"px";a.style.height=e+m+"px";a.rulerChanged&&j(l.getRulerStyle(),a);var i,k=a.firstChild;k?(i=k,k=k.nextSibling):(i=c.createElement(d,"div"),i.style.visibility="hidden",a.appendChild(i));var q;if(a.rulerChanged&&i){m=-1;if(q=l.getWidestAnnotation())if(j(q.style,
i),q.html)i.innerHTML=q.html;i.lineIndex=m;i.style.height=g+h.top+"px"}var p;if(n==="page"){for(l=l.getAnnotations(b,f+1);k;)m=k.lineIndex,q=k.nextSibling,(!(b<=m&&m<=f)||k.lineChanged)&&a.removeChild(k),k=q;k=a.firstChild.nextSibling;p=d.createDocumentFragment();for(m=b;m<=f;m++)if(!k||k.lineIndex>m){i=c.createElement(d,"div");if(q=l[m]){j(q.style,i);if(q.html)i.innerHTML=q.html;i.annotation=q}i.lineIndex=m;i.style.height=this._getLineHeight(m)+"px";p.appendChild(i)}else if(p.firstChild&&(a.insertBefore(p,
k),p=d.createDocumentFragment()),k)k=k.nextSibling;p.firstChild&&a.insertBefore(p,k)}else{q=this._getClientHeight();m=this._model.getLineCount();k=q+h.top+h.bottom-2*this._metrics.scrollWidth;n=g*m<k?g:k/m;if(a.rulerChanged){for(q=a.childNodes.length;q>1;)a.removeChild(a.lastChild),q--;l=l.getAnnotations(0,m);p=d.createDocumentFragment();for(var s in l)if(m=s>>>0,!(m<0)){i=c.createElement(d,"div");q=l[s];j(q.style,i);i.style.position="absolute";i.style.top=this._metrics.scrollWidth+g+Math.floor(m*
n)+"px";if(q.html)i.innerHTML=q.html;i.annotation=q;i.lineIndex=m;p.appendChild(i)}a.appendChild(p)}else if(a._oldTrackHeight!==k)for(i=a.firstChild?a.firstChild.nextSibling:null;i;)i.style.top=this._metrics.scrollWidth+g+Math.floor(i.lineIndex*n)+"px",i=i.nextSibling;a._oldTrackHeight=k}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";c.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");c.isFirefox&&c.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var b=document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(a));else{b=c.createElement(document,"style");b.id="_textviewStyle";var f=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(a));f.insertBefore(b,f.firstChild)}}},_updateStyle:function(a){if(!a&&c.isIE)this._rootDiv.style.lineHeight=
"normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=c.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};g.EventTarget.addMixin(r.prototype);return{TextView:r}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(h,k){function i(g){this._model=g;this._projections=[]}i.prototype={addProjection:function(g){if(g){var d=this._model,c=this._projections;g._lineIndex=d.getLineAtOffset(g.start);g._lineCount=d.getLineAtOffset(g.end)-g._lineIndex;var b=g.text;b||(b="");g._model=typeof b==="string"?new h.TextModel(b,d.getLineDelimiter()):b;var d=this.mapOffset(g.start,!0),b=g.end-g.start,j=g._lineCount,e=g._model.getCharCount(),
a=g._model.getLineCount()-1;this.onChanging({type:"Changing",text:g._model.getText(),start:d,removedCharCount:b,addedCharCount:e,removedLineCount:j,addedLineCount:a});var f=this._binarySearch(c,g.start);c.splice(f,0,g);this.onChanged({type:"Changed",start:d,removedCharCount:b,addedCharCount:e,removedLineCount:j,addedLineCount:a})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(g,d){var c=this._projections,b=0,h,e;if(d){for(h=
0;h<c.length;h++){e=c[h];if(e.start>g)break;if(e.end>g)return-1;b+=e._model.getCharCount()-(e.end-e.start)}return g+b}for(h=0;h<c.length;h++){e=c[h];if(e.start>g-b)break;var a=e._model.getCharCount();if(e.start+a>g-b)return-1;b+=a-(e.end-e.start)}return g-b},removeProjection:function(g){var d,c=0;for(d=0;d<this._projections.length;d++){var b=this._projections[d];if(b===g){g=b;break}c+=b._model.getCharCount()-(b.end-b.start)}if(d<this._projections.length){var b=this._model,c=g.start+c,h=g.end-g.start,
e=g._lineCount,a=g._model.getCharCount(),f=g._model.getLineCount()-1;this.onChanging({type:"Changing",text:b.getText(g.start,g.end),start:c,removedCharCount:a,addedCharCount:h,removedLineCount:f,addedLineCount:e});this._projections.splice(d,1);this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:h,removedLineCount:f,addedLineCount:e})}},_binarySearch:function(g,d){for(var c=g.length,b=-1,h;c-b>1;)h=Math.floor((c+b)/2),d<=g[h].start?c=h:b=h;return c},getCharCount:function(){for(var g=
this._model.getCharCount(),d=this._projections,c=0;c<d.length;c++){var b=d[c];g+=b._model.getCharCount()-(b.end-b.start)}return g},getLine:function(g,d){if(g<0)return null;var c=this._model,b=this._projections,h=0,e=[],a=0,f,l,n;for(f=0;f<b.length;f++){n=b[f];if(n._lineIndex>=g-h)break;l=n._model.getLineCount()-1;if(n._lineIndex+l>=g-h)if(a=g-(n._lineIndex+h),a<l)return n._model.getLine(a,d);else e.push(n._model.getLine(l));a=n.end;h+=l-n._lineCount}for(a=Math.max(a,c.getLineStart(g-h));f<b.length;f++){n=
b[f];if(n._lineIndex>g-h)break;e.push(c.getText(a,n.start));l=n._model.getLineCount()-1;if(n._lineIndex+l>g-h)return e.push(n._model.getLine(0,d)),e.join("");e.push(n._model.getText());a=n.end;h+=l-n._lineCount}b=c.getLineEnd(g-h,d);a<b&&e.push(c.getText(a,b));return e.join("")},getLineAtOffset:function(g){for(var d=this._model,c=this._projections,b=0,h=0,e=0;e<c.length;e++){var a=c[e];if(a.start>g-b)break;var f=a._model.getCharCount();if(a.start+f>g-b){c=g-(a.start+b);h+=a._model.getLineAtOffset(c);
b+=c;break}h+=a._model.getLineCount()-1-a._lineCount;b+=f-(a.end-a.start)}return d.getLineAtOffset(g-b)+h},getLineCount:function(){for(var g=this._projections,d=this._model.getLineCount(),c=0;c<g.length;c++){var b=g[c];d+=b._model.getLineCount()-1-b._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(g,d){if(g<0)return-1;for(var c=this._model,b=this._projections,h=0,e=0,a=0;a<b.length;a++){var f=b[a];if(f._lineIndex>g-h)break;var l=f._model.getLineCount()-
1;if(f._lineIndex+l>g-h)return f._model.getLineEnd(g-(f._lineIndex+h),d)+f.start+e;e+=f._model.getCharCount()-(f.end-f.start);h+=l-f._lineCount}return c.getLineEnd(g-h,d)+e},getLineStart:function(g){if(g<0)return-1;for(var d=this._model,c=this._projections,b=0,h=0,e=0;e<c.length;e++){var a=c[e];if(a._lineIndex>=g-b)break;var f=a._model.getLineCount()-1;if(a._lineIndex+f>=g-b)return a._model.getLineStart(g-(a._lineIndex+b))+a.start+h;h+=a._model.getCharCount()-(a.end-a.start);b+=f-a._lineCount}return d.getLineStart(g-
b)+h},getText:function(g,d){g===void 0&&(g=0);var c=this._model,b=this._projections,h=0,e=[],a,f,l;for(a=0;a<b.length;a++){f=b[a];if(f.start>g-h)break;l=f._model.getCharCount();if(f.start+l>g-h)if(d!==void 0&&f.start+l>d-h)return f._model.getText(g-(f.start+h),d-(f.start+h));else e.push(f._model.getText(g-(f.start+h))),g=f.end+h+l-(f.end-f.start);h+=l-(f.end-f.start)}var n=g-h;if(d!==void 0){for(;a<b.length;a++){f=b[a];if(f.start>d-h)break;e.push(c.getText(n,f.start));l=f._model.getCharCount();if(f.start+
l>d-h)return e.push(f._model.getText(0,d-(f.start+h))),e.join("");e.push(f._model.getText());n=f.end;h+=l-(f.end-f.start)}e.push(c.getText(n,d-h))}else{for(;a<b.length;a++)f=b[a],e.push(c.getText(n,f.start)),e.push(f._model.getText()),n=f.end;e.push(c.getText(n))}return e.join("")},_onChanging:function(g,d,c,b,h,e){for(var a=this._model,f=this._projections,l,n=0,m,i=d+c;l<f.length;l++){c=f[l];if(c.start>d)break;n+=c._model.getCharCount()-(c.end-c.start)}d+=n;for(var k=l;l<f.length;l++){c=f[l];if(c.start>
i)break;n+=c._model.getCharCount()-(c.end-c.start);m+=c._model.getLineCount()-1-c._lineCount}c=i+n;n=l;this.onChanging(d,c-d,b,h+m,e);f.splice(f,n-k);for(g=g.length-(c-d);l<f.length;l++)c=f[l],c.start+=g,c.end+=g,c._lineIndex=a.getLineAtOffset(c.start)},onChanging:function(g){return this.dispatchEvent(g)},onChanged:function(g){return this.dispatchEvent(g)},setLineDelimiter:function(g){this._model.setLineDelimiter(g)},setText:function(g,d,c){g===void 0&&(g="");d===void 0&&(d=0);var b=d,h=c,e=this._model,
a=this._projections,f=0,l=0,n,m,i,k,p,r=0;for(n=0;n<a.length;n++){m=a[n];if(m.start>d-f)break;i=m._model.getCharCount();if(m.start+i>d-f)if(c!==void 0&&m.start+i>c-f){m._model.setText(g,d-(m.start+f),c-(m.start+f));return}else r=m._model.getLineCount()-1-m._model.getLineAtOffset(d-(m.start+f)),k={projection:m,start:d-(m.start+f)},d=m.end+f+i-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;f+=i-(m.end-m.start)}d-=f;var t=n,r=e.getLineAtOffset(d)+l-r;if(c!==void 0)for(;n<a.length;n++){m=a[n];
if(m.start>c-f)break;i=m._model.getCharCount();if(m.start+i>c-f){l+=m._model.getLineAtOffset(c-(m.start+f));i=c-(m.start+f);c=m.end+f;p={projection:m,end:i};break}l+=m._model.getLineCount()-1-m._lineCount;f+=i-(m.end-m.start)}else{for(;n<a.length;n++)m=a[n],l+=m._model.getLineCount()-1-m._lineCount,f+=m._model.getCharCount()-(m.end-m.start);c=h=e.getCharCount()+f}c-=f;m=e.getLineAtOffset(c)+l;h-=b;for(var l=m-r,r=g.length,o=i=m=f=0;;){m!==-1&&m<=o&&(m=g.indexOf("\r",o));i!==-1&&i<=o&&(i=g.indexOf("\n",
o));if(i===-1&&m===-1)break;o=m!==-1&&i!==-1?m+1===i?i+1:(m<i?m:i)+1:m!==-1?m+1:i+1;f++}this.onChanging({type:"Changing",text:g,start:b,removedCharCount:h,addedCharCount:r,removedLineCount:l,addedLineCount:f});e.setText(g,d,c);if(k)m=k.projection,m._model.setText("",k.start);if(p)m=p.projection,m._model.setText("",0,p.end),m.start=m.end,m._lineCount=0;a.splice(t,n-t);for(g=g.length-(c-d);n<a.length;n++)m=a[n],m.start+=g,m.end+=g,m._lineIndex=e.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:b,removedCharCount:h,addedCharCount:r,removedLineCount:l,addedLineCount:f})}};k.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(h,k,i,g,d){function c(b){this._view=b;this._create(b.getOptions("parent").ownerDocument);b.addEventListener("Destroy",this,this.destroy)}c.getTooltip=function(b){if(!b._tooltip)b._tooltip=new c(b);return b._tooltip};c.prototype={_create:function(b){if(!this._tooltipDiv){var c=this._tooltipDiv=d.createElement(b,"div");c.className=
"textviewTooltip";c.setAttribute("aria-live","assertive");c.setAttribute("aria-atomic","true");var e=this._tooltipContents=d.createElement(b,"div");c.appendChild(e);b.body.appendChild(c);this.hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var b=this._tooltipDiv.parentNode;b&&b.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 b=this._getWindow();if(this._showTimeout)b.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)b.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)b.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(b,
c){if(this.target!==b&&(this._target=b,this.hide(),b)){var e=this;if(c===0)e.show(!0);else{var a=this._getWindow();e._showTimeout=a.setTimeout(function(){e.show(!0)},c?c:500)}}},show:function(b){if(this._target){var c=this._target.getTooltipInfo();if(c){var e=this._tooltipDiv,a=this._tooltipContents;e.style.left=e.style.right=e.style.width=e.style.height=a.style.width=a.style.height="auto";var f=c.contents;f instanceof Array&&(f=this._getAnnotationContents(f));if(typeof f==="string")a.innerHTML=f;
else if(this._isNode(f))a.appendChild(f);else if(f instanceof g.ProjectionTextModel){var d=this._view,h=d.getOptions();h.wrapMode=!1;h.parent=a;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){d.onLineStyle(a)});h.setModel(f);f=h.computeSize();a.style.width=f.width+"px";a.style.height=f.height+"px";h.resize()}else return;a=e.ownerDocument.documentElement;
c.anchor==="right"?(f=a.clientWidth-c.x,e.style.right=f+"px"):(f=parseInt(this._getNodeStyle(e,"padding-left","0"),10),f+=parseInt(this._getNodeStyle(e,"border-left-width","0"),10),f=c.x-f,e.style.left=f+"px");e.style.maxWidth=a.clientWidth-f-10+"px";f=parseInt(this._getNodeStyle(e,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(e,"border-top-width","0"),10);f=c.y-f;e.style.top=f+"px";e.style.maxHeight=a.clientHeight-f-10+"px";e.style.opacity="1";e.style.visibility="visible";if(b){var i=this,
s=this._getWindow();i._hideTimeout=s.setTimeout(function(){var a=parseFloat(i._getNodeStyle(e,"opacity","1"));i._fadeTimeout=s.setInterval(function(){e.style.visibility==="visible"&&a>0?(a-=0.1,e.style.opacity=a):i.hide()},50)},5E3)}}}},_getAnnotationContents:function(b){function c(b){var f=b.title;if(f==="")return null;var e="<div>";b.html&&(e+=b.html+"&nbsp;");if(!f)f=b.end,b=a.getLineStart(a.getLineAtOffset(b.start)),f=a.getLineEnd(a.getLineAtOffset(f),!0),f=a.getText(b,f);f=f.replace(/</g,"&lt;").replace(/>/g,
"&gt;");e+="<span style='vertical-align:middle;'>"+f+"</span><div>";return e}if(b.length===0)return null;var e=this._view.getModel(),a=e.getBaseModel?e.getBaseModel():e;if(b.length===1)if(e=b[0],e.title!==void 0)return c(e);else{var b=new g.ProjectionTextModel(a),f=a.getLineStart(a.getLineAtOffset(e.start)),d=a.getCharCount();e.end!==d&&b.addProjection({start:e.end,end:d});f>0&&b.addProjection({start:0,end:f});return b}else{f="<div><em>"+h.multipleAnnotations+"</em></div>";for(d=0;d<b.length;d++)e=
b[d],(e=c(e))&&(f+=e);return f}},_getNodeStyle:function(b,c,e){var a;if(b&&(a=b.style[c],!a))if(b.currentStyle){for(a=0;(a=c.indexOf("-",a))!==-1;)c=c.substring(0,a)+c.substring(a+1,a+2).toUpperCase()+c.substring(a+2);a=b.currentStyle[c]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(c):null;return a||e},_isNode:function(b){return typeof Node==="object"?b instanceof Node:b&&typeof b==="object"&&typeof b.nodeType==="number"&&typeof b.nodeName==="string"}};return{Tooltip:c}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(h,k){function i(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function g(){}function d(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),e={title:h[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};b?e.lineStyle={styleClass:"annotationLine "+
c}:e.rangeStyle={styleClass:"annotationRange "+c};g.registerType(a,e)}function c(){}function b(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 c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}i.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)}};g.ANNOTATION_ERROR="orion.annotation.error";g.ANNOTATION_WARNING="orion.annotation.warning";g.ANNOTATION_TASK="orion.annotation.task";g.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
g.ANNOTATION_BOOKMARK="orion.annotation.bookmark";g.ANNOTATION_FOLDING="orion.annotation.folding";g.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";g.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";g.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";g.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";g.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";g.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";g.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
g.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";g.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";g.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var e={};g.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(a,b,c){this.start=a;this.end=b;if(c!==void 0)this.title=c},c.prototype=b;c.prototype.type=a;e[a]=c;return a};g.createAnnotation=function(a,b,c,e){return new (this.getType(a))(b,c,e)};g.getType=function(a){return e[a]};
d(g.ANNOTATION_ERROR);d(g.ANNOTATION_WARNING);d(g.ANNOTATION_TASK);d(g.ANNOTATION_BREAKPOINT);d(g.ANNOTATION_BOOKMARK);d(g.ANNOTATION_CURRENT_BRACKET);d(g.ANNOTATION_MATCHING_BRACKET);d(g.ANNOTATION_CURRENT_SEARCH);d(g.ANNOTATION_MATCHING_SEARCH);d(g.ANNOTATION_READ_OCCURRENCE);d(g.ANNOTATION_WRITE_OCCURRENCE);d(g.ANNOTATION_SELECTED_LINKED_GROUP);d(g.ANNOTATION_CURRENT_LINKED_GROUP);d(g.ANNOTATION_LINKED_GROUP);d(g.ANNOTATION_CURRENT_LINE,!0);g.registerType(g.ANNOTATION_FOLDING,i);c.addMixin=function(a){var b=
c.prototype,e;for(e in b)b.hasOwnProperty(e)&&(a[e]=b[e])};c.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&c.push(b);var e=
this;c.sort(function(a,b){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};b.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=this._binarySearch(b,a.start);b.splice(c,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,e,d=0,g=function(){for(;d<c.length;){var e=c[d++];if(a===e.start||(a>e.start?a<e.end:e.start<b))return e;if(e.start>=b)break}return null};e=g();return{next:function(){var a=e;a&&(e=g());return a},hasNext:function(){return e!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},
onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,c,e;if(a){c=[];for(e=b.length-1;e>=0;e--){var d=b[e];d.type===a&&b.splice(e,1);c.splice(0,0,d)}}else c=b;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var c=this._annotations,e,d,
g,h=[];if(a)for(e=a.length-1;e>=0;e--)g=a[e],d=this._getAnnotationIndex(g),d<0||(c.splice(d,1),h.splice(0,0,g));b||(b=[]);for(e=0;e<b.length;e++)g=b[e],d=this._binarySearch(c,g.start),c.splice(d,0,g);this.onChanged({type:"Changed",removed:h,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var c=a.length,e=
-1,d;c-e>1;)d=Math.floor((c+e)/2),b<=a[d].start?c=d:e=d;return c},_getAnnotationIndex:function(a){for(var b=this._annotations,c=this._binarySearch(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.removedCharCount,e=this._annotations,d=b+c;if(0<e.length){for(var g={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-c,c=0;c<e.length;c++){var h=e[c];h.start>=d?(h.start+=a,h.end+=a,g.changed.push(h)):
h.end<=b||(h.start<b&&d<h.end?(h.end+=a,g.changed.push(h)):(e.splice(c,1),g.removed.push(h),c--))}if(g.added.length>0||g.removed.length>0||g.changed.length>0)this.onChanged(g)}}};k.EventTarget.addMixin(b.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 c;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||(a.attributes[c]=b.attributes[c])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var c,e;for(e=0;e<a.length&&b;e++){var d=a[e];if(b.end<=
d.start)break;if(!(b.start>=d.end)){c=this._mergeStyle({},d.style);c=this._mergeStyle(c,b.style);var g=[];g.push(e,1);b.start<d.start&&g.push({start:b.start,end:d.start,style:b.style});b.start>d.start&&g.push({start:d.start,end:b.start,style:d.style});g.push({start:Math.max(d.start,b.start),end:Math.min(d.end,b.end),style:c});b.end<d.end&&g.push({start:b.end,end:d.end,style:d.style});b=b.end>d.end?{start:d.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,g)}}b&&(c=this._mergeStyle({},
b.style),a.splice(e,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var f=0;f<a.length;f++)if(e.isAnnotationTypeVisible(a[f].type)){var g=a[f].start,h=a[f].end;d.getBaseModel&&(g=d.mapOffset(g,!0),h=d.mapOffset(h,!0));g!==-1&&h!==-1&&c.redrawRange(g,h)}}if(!a.textModelChangedEvent){var c=this._view;if(c){var e=this,d=c.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
c=a.textView.getModel(),e=b.getTextModel(),d=a.lineStart,g=a.lineStart+a.lineText.length;e!==c&&(d=c.mapOffset(d),g=c.mapOffset(g));for(b=b.getAnnotations(d,g);b.hasNext();)if(d=b.next(),this.isAnnotationTypeVisible(d.type)){if(d.rangeStyle){var g=d.start,h=d.end;e!==c&&(g=c.mapOffset(g,!0),h=c.mapOffset(h,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:g,end:h,style:d.rangeStyle})}if(d.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,d.lineStyle)}}};c.addMixin(j.prototype);
return{FoldingAnnotation:i,AnnotationType:g,AnnotationTypeList:c,AnnotationModel:b,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,i,g,d,c){function b(b){this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._textDNDFactory=b.textDNDFactory;this._annotationFactory=b.annotationFactory;this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=
b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._statusReporter=b.statusReporter;this._domNode=b.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null}function j(b){var a=this,c=Array.prototype.slice.call(arguments,1);return c.length?function(){return arguments.length?a.apply(b,c.concat(Array.prototype.slice.call(arguments))):a.apply(b,
c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}b.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b},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(b){if(this._annotationRulerVisible!==
b&&(this._annotationRulerVisible=b,this._annotationRuler)){var a=this._textView;b?a.addRuler(this._annotationRuler,0):a.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(b){if(this._foldingRulerVisible!==b&&(this._foldingRulerVisible=b,this._foldingRuler)){var a=this._textView;a.getModel().getBaseModel&&(b?a.addRuler(this._foldingRuler,100):a.removeRuler(this._foldingRuler))}},setDirty:function(b){if(this._dirty!==b)this._dirty=b,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(b){if(this._lineNumberRulerVisible!==
b&&(this._lineNumberRulerVisible=b,this._lineNumberRuler)){var a=this._textView;b?a.addRuler(this._lineNumberRuler,1):a.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(b){if(this._overviewRulerVisible!==b&&(this._overviewRulerVisible=b,this._overviewRuler)){var a=this._textView;b?a.addRuler(this._overviewRuler):a.removeRuler(this._overviewRuler)}},mapOffset:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(b=c.mapOffset(b,a));return b},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var b=this._textView,a=b.getSelection(),b=b.getModel();if(b.getBaseModel)a.start=b.mapOffset(a.start),a.end=b.mapOffset(a.end);return a},getText:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c.getText(b,a)},_expandOffset:function(b){var a=this._textView.getModel(),c=this._annotationModel;if(c&&a.getBaseModel)for(b=c.getAnnotations(b,b+1);b.hasNext();)a=b.next(),a.type===d.AnnotationType.ANNOTATION_FOLDING&&a.expand&&(a.expand(),c.modifyAnnotation(a))},
setCaretOffset:function(b,a,c){var d=this._textView,g=d.getModel();g.getBaseModel&&(this._expandOffset(b),b=g.mapOffset(b,!0));d.setCaretOffset(b,a,c)},setText:function(b,a,c){var d=this._textView,g=d.getModel();g.getBaseModel&&(a!==void 0&&(this._expandOffset(a),a=g.mapOffset(a,!0)),c!==void 0&&(this._expandOffset(c),c=g.mapOffset(c,!0)));d.setText(b,a,c)},setFoldingEnabled:function(b){this.setFoldingRulerVisible(b)},setSelection:function(b,a,c,d){var g=this._textView,h=g.getModel();h.getBaseModel&&
(this._expandOffset(b),this._expandOffset(a),b=h.mapOffset(b,!0),a=h.mapOffset(a,!0));g.setSelection(b,a,c,d)},moveSelection:function(b,a,c,d){var g=this._textView;this.setSelection(b,a||b,1/3,function(){(d===void 0||d)&&g.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(b,a,c){this._statusReporter&&this._statusReporter(b,a,c)},_getTooltipInfo:function(b,a){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var g=this._annotationStyler;
if(!g)return null;var h=c.getOffsetAtLocation(b,a);if(h===-1)return null;h=this.mapOffset(h);g=g.getAnnotationsByType(d,h,h+1);d=[];for(h=0;h<g.length;h++)g[h].rangeStyle&&d.push(g[h]);if(d.length===0)return null;c=c.convert({x:b,y:a},"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(b,a){var c=this._annotationModel;if(c){var g=this._textView.getModel(),h=a?g.getLineAtOffset(a.start):-1,j=g.getLineAtOffset(b.start),i=b.start===b.end,k=!a||a.start===
a.end,p=g.getLineStart(j),r=g.getLineEnd(j);g.getBaseModel&&(p=g.mapOffset(p),r=g.mapOffset(r));g=this._currentLineAnnotation;if(!(h===j&&k&&i&&g&&g.start===p&&g.end===r)){var h=g?[g]:null,t;i&&(g=d.AnnotationType.createAnnotation(d.AnnotationType.ANNOTATION_CURRENT_LINE,p,r),t=[g]);this._currentLineAnnotation=g;c.replaceAnnotations(h,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 b=this,a=this._textView,c=this;this._listener={onModelChanged:function(){c.checkDirty()},onMouseOver:function(a){c._listener.onMouseMove(a)},onMouseMove:function(b){var e=g.Tooltip.getTooltip(a);if(e&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,
c._listener.lastMouseY=b.event.clientY,e.setTarget({x:b.x,y:b.y,getTooltipInfo:function(){return c._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(b){var e=g.Tooltip.getTooltip(a);if(e&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,c._listener.lastMouseY=b.event.clientY,e.setTarget(null)},onScroll:function(){var b=g.Tooltip.getTooltip(a);b&&b.setTarget(null)},onSelection:function(a){c._updateCursorStatus();c._highlightCurrentLine(a.newValue,
a.oldValue)}};a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("MouseOver",this._listener.onMouseOver);a.addEventListener("MouseOut",this._listener.onMouseOut);a.addEventListener("MouseMove",this._listener.onMouseMove);a.addEventListener("Scroll",this._listener.onScroll);this._keyBindingFactory&&(typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):
this._keyBindingFactory.createKeyBindings(b,this._undoStack,this._contentAssist));var h=function(a){if(a!==void 0&&a!==-1){for(var c=this.getView().getModel(),f=this.getAnnotationModel(),g=b.mapOffset(c.getLineStart(a)),a=b.mapOffset(c.getLineEnd(a)),c=f.getAnnotations(g,a),h=null;c.hasNext();){var j=c.next();if(j.type===d.AnnotationType.ANNOTATION_BOOKMARK){h=j;break}}h?f.removeAnnotation(h):(h=d.AnnotationType.createAnnotation(d.AnnotationType.ANNOTATION_BOOKMARK,g,a),h.title=void 0,f.addAnnotation(h))}};
if(this._annotationFactory){var j=a.getModel();j.getBaseModel&&(j=j.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(j))if(j=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),j.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_BRACKET),
j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_BRACKET),j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINE),j.addAnnotationType(d.AnnotationType.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),j.addAnnotationType(d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),j.addAnnotationType(d.AnnotationType.ANNOTATION_LINKED_GROUP),j.addAnnotationType("orion.annotation.highlightError");
a.annotationModel=this._annotationModel;var j=this._annotationFactory.createAnnotationRulers(this._annotationModel),m=this._annotationRuler=j.annotationRuler;if(m)m.onDblClick=h,m.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),m.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(d.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(d.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(m=this._overviewRuler=j.overviewRuler)m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),m.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_SEARCH),m.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(d.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(d.AnnotationType.ANNOTATION_BOOKMARK),m.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_BRACKET),m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_BRACKET),
m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINE),m.addAnnotationType(d.AnnotationType.ANNOTATION_READ_OCCURRENCE),m.addAnnotationType(d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=h,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(d.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:a})},uninstallTextView:function(){var b=this._textView;if(b)b.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:b})},_updateCursorStatus:function(){var b=this.getModel(),a=this.getCaretOffset(),f=b.getLineAtOffset(a),b=b.getLineStart(f);a-=b;for(var b=this.getKeyModes(),d=0;d<b.length;d++){var g=b[d];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(c.formatMessage(h.lineColumn,f+1,a+1))},showProblems:function(b){var a=this._annotationModel;if(a){for(var c=[],g=[],h=a.getTextModel(),j=a.getAnnotations(0,h.getCharCount()),i;j.hasNext();)i=j.next(),(i.type===d.AnnotationType.ANNOTATION_ERROR||
i.type===d.AnnotationType.ANNOTATION_WARNING)&&c.push(i);if(b)for(j=0;j<b.length;j++)if(i=b[j]){var k=i.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),p=h.getLineStart(i.line-1);i=d.AnnotationType.createAnnotation(i.severity==="error"?d.AnnotationType.ANNOTATION_ERROR:d.AnnotationType.ANNOTATION_WARNING,p+i.start-1,p+i.end,k);g.push(i)}a.replaceAnnotations(c,g)}},showOccurrences:function(b){var a=this._annotationModel;if(a){for(var c=[],g=[],h=a.getTextModel(),j=a.getAnnotations(0,h.getCharCount()),
i;j.hasNext();)i=j.next(),(i.type===d.AnnotationType.ANNOTATION_READ_OCCURRENCE||i.type===d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&c.push(i);if(b)for(j=0;j<b.length;j++)if(i=b[j]){var k=h.getLineStart(i.line-1);i=d.AnnotationType.createAnnotation(i.readAccess===!0?d.AnnotationType.ANNOTATION_READ_OCCURRENCE:d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,k+i.start-1,k+i.end,i.description);g.push(i)}a.replaceAnnotations(c,g)}},showSelection:function(b,a,c,d,g){typeof b==="number"?(typeof a!=="number"&&
(a=b),this.moveSelection(b,a)):typeof c==="number"&&(b=this.getModel().getLineStart(c-1),typeof d==="number"&&(b+=d),typeof g!=="number"&&(g=0),this.moveSelection(b,b+g))},setInput:function(b,a,c,d){this._title=b;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(a?this._textView.setText(a):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:b,message:a,contents:c,contentsSaved:d})},onInputChanged:function(b){return this.dispatchEvent(b)},onGotoLine:function(b,a,c,d){if(this._textView){var g=this.getModel(),b=Math.max(0,Math.min(b,g.getLineCount()-1)),h=g.getLineStart(b),j=0;c===void 0&&(c=0);typeof a==="string"?(b=g.getLine(b).indexOf(a),b!==-1&&(j=b,c=j+a.length)):(j=a,a=g.getLineEnd(b)-h,j=Math.min(j,a),c=Math.min(c,a));this.moveSelection(h+j,h+c,d)}},onDirtyChanged:function(b){return this.dispatchEvent(b)}};
i.EventTarget.addMixin(b.prototype);if(!Function.prototype.bind)Function.prototype.bind=j;return{Editor:b}});
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,i,g,d,c,b){function j(a){var b=a.getTextView();i.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 c=this;this._listener={onVerify:function(a){var b=c.editor,f=b.getModel(),e=b.mapOffset(a.start),b=b.mapOffset(a.end),f=f.getText(e,b);if((f=c._prefix.match(RegExp("^"+d.escape(f),"i")))&&f.length>0)c._prefix+=a.text,c._success=!0,c._status(),c.find(c._forward,!0),a.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function e(a,b,c){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var e=this;this._listeners={onEditorFocus:function(a){e._removeCurrentAnnotation(a)}};this.setOptions(c)}}var a={};j.prototype=new i.KeyMode;c.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 c=this._prefix;if(c.length===0)return!1;var e=this.editor,d=e.getModel(),d=a?this._success?b?this._start:e.getCaretOffset()+
1:0:this._success?b?this._start:e.getCaretOffset():d.getCharCount()-1;if(c=e.getModel().find({string:c,start:d,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next()){if(!b)this._start=d;this._ignoreSelection=this._success=!0;e.moveSelection(a?c.start:c.end,a?c.end:c.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?h.incrementalFindStr:h.incrementalFindStrNotFound:this._success?h.incrementalFindReverseStr:h.incrementalFindReverseStrNotFound;a=b.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
a.IncrementalFind=j;e.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var e=this.getFindString(),d;if(b)e=b.findString||e,d=b.count;a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((d=this._doFind(e,b,d))&&!c)this._startOffset=d.start;this.setOptions(a);this._hideAfterFind&&this.hide();return d},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection();return this._editor.getText(a.start,a.end)||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1;
if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();this._editor.getTextView().removeEventListener("Focus",this._listeners.onEditorFocus);this._editor.getTextView().focus()},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this.getReplaceString(),e=b.getSelection().start;if(b=b.getModel().find({string:a,start:e,reverse:!1,wrap:this._wrap,
regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var c=this._editor,e=c.getTextView();c.reportStatus(h.replaceAll);var d=this.getReplaceString(),g=this;window.setTimeout(function(){for(var j=0,i=0;;){var k=g._doFind(a,j);if(!k)break;i++;i===1&&(e.setRedraw(!1),
g.startUndo());g._doReplace(k.start,k.end,a,d);j=g.getStartOffset()}i>0&&(g.endUndo(),e.setRedraw(!0));j>0?c.reportStatus(b.formatMessage(h.replacedMatches,i)):c.reportStatus(h.nothingReplaced,"error");g._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(g.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===
!0||a.caseInsensitive===!1)this._caseInsensitive=a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===
!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&
b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,b,c){var c=c||1,e=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=e.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),d,b=0;b<c&&a.hasNext();b++)d=
a.next();if(!this._replacingAll){d?this._editor.reportStatus(""):this._editor.reportStatus(h.notFound,"error");if(this.isVisible()){c=g.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=e.getAnnotationModel())a.removeAnnotations(c),d&&a.addAnnotation(g.AnnotationType.createAnnotation(c,d.start,d.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(d):
d&&e.moveSelection(d.start,d.end,null,!1)}return d},_doReplace:function(a,b,c,e){var d=this._editor;if(this._regex&&(e=d.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),e),!e))return;d.setText(e,a,b);d.setSelection(a,a+e.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=g.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(0,a.getTextModel().getCharCount()),e=[],d;c.hasNext();){var h=c.next();h.type===b&&e.push(h)}if(this.isVisible()){c=
this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(d=[];c.hasNext();)h=c.next(),d.push(g.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(e,d)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(g.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(g.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(g.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};a.Find=e;return a});
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,i,g,d,c){function b(a,b,c){this.editor=a;this.undoStack=b;this._incrementalFind=new d.IncrementalFind(a);this._find=c?c:new d.Find(a,b);this._lastEditLocation=null;this.init()}function j(a,b,c,e){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var e={};b.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",
!c.isMac,!1,!1,c.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",!c.isMac,!1,!1,c.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(),c=a.getSelection(),e=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),d=b.getLineStart(e),
e=b.getLineEnd(c,!0),g=b.getLineCount(),h="",d=b.getText(d,e);c===g-1&&(d=(h=b.getLineDelimiter())+d);a.setText(d,e,e);a.setSelection(e+h.length,e+d.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),e=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),e=b.getLineStart(e),d=b.getLineEnd(c,!0),g=b.getLineCount(),h="",d=b.getText(e,d);c===g-1&&(d+=h=b.getLineDelimiter());a.setText(d,
e,e);a.setSelection(e,e+d.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;if(a&&a.count)c=a.count;var e=b.getSelection(),d=b.getModel(),g=d.getLineAtOffset(e.start),a=d.getLineStart(g),c=e.start!==e.end||c===1?d.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(g+c-1,d.getLineCount()-1),c=d.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;
var e=b.getModel(),d=b.getCaretOffset(),g=e.getLineAtOffset(d),d=e.getLineStart(g),g=e.getLineEnd(g,!0);e.getBaseModel&&(d=e.mapOffset(d),g=e.mapOffset(g),e.getBaseModel());for(var h,e=c.getAnnotations(d,g);!h&&e.hasNext();)d=e.next(),d.type===i.AnnotationType.ANNOTATION_FOLDING&&(h=d);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()),c.modifyAnnotation(h));return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),e=b.getAnnotationModel();if(!e)return!0;var b=
b.getModel(),d=e.getAnnotations(0,b.getCharCount());for(c.setRedraw(!1);d.hasNext();)b=d.next(),b.type===i.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),e.modifyAnnotation(b));c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start),g=c.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(d!==g){var h=[];h.push("");
for(var j=d;j<=g;j++)h.push(c.getLine(j,!0));j=c.getLineStart(d);c=c.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),j,c);a.setSelection(j===e.start?e.start:e.start+b.length,e.end+(g-d+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(),c=a.getSelection(),e=b.getLineAtOffset(c.start),d=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount();if(d===g-1)return!0;var e=b.getLineStart(e),c=b.getLineEnd(d,!0),h=b.getLineEnd(d+1,!0)-(c-e),j=0;d!==g-2?b=b.getText(e,c):(d=b.getLineEnd(d),b=b.getText(d,c)+b.getText(e,d),j+=c-d);this.startUndo();
a.setText("",e,c);a.setText(b,h,h);a.setSelection(h+j,h+j+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),e=b.getLineAtOffset(c.start);if(e===0)return!0;var d=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount(),c=b.getLineStart(e-1),h=b.getLineStart(e),j=b.getLineEnd(d,!0),i=b.getText(h,j),k=0;d===g-1&&(d=b.getLineEnd(e-1),e=b.getLineEnd(e-1,!0),i+=b.getText(d,e),h=d,
k=e-d);this.startUndo();a.setText("",h,j);a.setText(i,c,c);a.setSelection(c,c+i.length-k);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;for(var e=b.getModel(),d=b.getCaretOffset(),c=c.getAnnotations(a?d:0,a?e.getCharCount():d),h=null;c.hasNext();){var j=c.next();if(a){if(j.start<=d)continue}else if(j.start>=d)continue;switch(j.type){case i.AnnotationType.ANNOTATION_ERROR:case i.AnnotationType.ANNOTATION_WARNING:case i.AnnotationType.ANNOTATION_TASK:case i.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}h=j;if(a)break}if(h){var k=b.getTextView(),r=e.getLineAtOffset(h.start),t=g.Tooltip.getTooltip(k);if(!t)return b.moveSelection(h.start),!0;b.moveSelection(h.start,h.start,function(){t.setTarget({getTooltipInfo:function(){var a=k.convert({x:k.getLocationAtOffset(h.start).x,y:k.getLocationAtOffset(e.getLineStart(r)).y},"document","page");return{contents:[h],x:a.x,y:a.y+Math.floor(k.getLineHeight(r)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();
if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start),g=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=b.getOptions("tabSize"),j=Array(h+1).join(" "),i=[],k=b=0,o=d;o<=g;o++){var v=c.getLine(o,!0);if(c.getLineStart(o)!==c.getLineEnd(o))if(v.indexOf("\t")===0)v=v.substring(1),b++;else if(v.indexOf(j)===0)v=v.substring(h),b+=h;else return!0;o===d&&(k=b);i.push(v)}d=c.getLineStart(d);h=c.getLineEnd(g,!0);c=c.getLineStart(g);
a.setText(i.join(""),d,h);g=d===e.start?e.start:e.start-k;e=Math.max(g,e.end-b+(e.end===c+1&&e.start!==e.end?1:0));a.setSelection(g,e);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};e.TextActions=b;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,!c.isMac,!1,c.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:h.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!c.isMac,!1,c.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 c=a.getModel(),e=c.getLineAtOffset(b.start),d=c.getLine(e,!0),g=c.getLineStart(e),e=0,g=b.start-g,h;e<g&&((h=d.charCodeAt(e))===32||h===9);)e++;if(e>0){for(var j=d.substring(0,e),e=g;e<d.length&&((h=d.charCodeAt(e++))===32||h===9);)b.end++;a.setText(c.getLineDelimiter()+j,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),e=this._findEnclosingComment(b,c.start,c.end);if(e.commentStart!==void 0&&e.commentEnd!==void 0)return!0;b=b.getText(c.start,c.end);if(b.length===0)return!0;var e=b.length,b=b.replace(/\/\*|\*\//g,""),d=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(d-e));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},_findEnclosingComment:function(a,b,c){var e=a.getLineAtOffset(b),d=a.getLineAtOffset(c),g,h,j,
i,k,o;for(g=e;g>=0;g--)if(h=a.getLine(g),j=g===e?b-a.getLineStart(e):h.length,i=h.lastIndexOf("/*",j),h=h.lastIndexOf("*/",j),h>i)break;else if(i!==-1){k=a.getLineStart(g)+i;break}for(g=d;g<a.getLineCount();g++)if(h=a.getLine(g),j=g===d?c-a.getLineStart(d):0,i=h.indexOf("/*",j),h=h.indexOf("*/",j),i!==-1&&i<h)break;else if(h!==-1){o=a.getLineStart(g)+h;break}return{commentStart:k,commentEnd:o}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),e=b.getLineAtOffset(c),d=
b.getLineStart(e),b=b.getLine(e),e=0;e<b.length;e++){var g=b.charCodeAt(e);if(!(g===32||g===9))break}e+=d;return c!==e?(a.setSelection(e,e),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),e=b.getText(c.start,c.end),d,g,h;for(h=0;h<e.length;h++)if(e.substring(h,h+2)==="/*"){d=c.start+h;break}for(;h<e.length;h++)if(e.substring(h,h+2)==="*/"){g=c.start+h;break}if(d!==void 0&&g!==void 0)a.setText(b.getText(d+
2,g),d,g+2),a.setSelection(d,g);else{e=this._findEnclosingComment(b,c.start,c.end);if(e.commentStart===void 0||e.commentEnd===void 0)return!0;b=b.getText(e.commentStart+2,e.commentEnd);a.setText(b,e.commentStart,e.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),c=a.getSelection(),e=b.getLineAtOffset(c.start),d=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=!0,h=[],j,
i,k=e;k<=d;k++)if(j=b.getLine(k,!0),h.push(j),!g||(i=j.indexOf("//"))===-1)g=!1;else if(i!==0){var o;for(o=0;o<i;o++)if(g=j.charCodeAt(o),!(g===32||g===9))break;g=o===i}k=b.getLineStart(e);o=b.getLineEnd(d,!0);if(g){for(g=0;g<h.length;g++)j=h[g],i=j.indexOf("//"),h[g]=j.substring(0,i)+j.substring(i+2);h=h.join("");j=b.getLineStart(d);b=k===c.start?c.start:c.start-2;c=c.end-2*(d-e+1)+(c.end===j+1?2:0)}else h.splice(0,0,""),h=h.join("//"),b=k===c.start?c.start:c.start+2,c=c.end+2*(d-e+1);a.setText(h,
k,o);a.setSelection(b,c);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};e.SourceCodeActions=j;return e});
define("orion/editor/undoStack",[],function(){function h(g,d,c){this.offset=g;this.text=d;this.previousText=c}function k(g){this.owner=g;this.changes=[]}function i(g,d){this.view=g;this.size=d!==void 0?d:100;this.reset();var c=g.getModel();c.getBaseModel&&(c=c.getBaseModel());this.model=c;var b=this;this._listener={onChanging:function(c){b._onChanging(c)},onDestroy:function(c){b._onDestroy(c)}};c.addEventListener("Changing",this._listener.onChanging);g.addEventListener("Destroy",this._listener.onDestroy)}
h.prototype={undo:function(g,d){this._doUndoRedo(this.offset,this.previousText,this.text,g,d);return!0},redo:function(g,d){this._doUndoRedo(this.offset,this.text,this.previousText,g,d);return!0},_doUndoRedo:function(g,d,c,b,h){var e=b.getModel();if(e.mapOffset&&b.annotationModel){var a=e.mapOffset(g,!0);if(a<0)for(var f=b.annotationModel.getAnnotations(g,g+1);f.hasNext();){var i=f.next();if(i.type==="orion.annotation.folding"){i.expand();a=e.mapOffset(g,!0);break}}if(a<0)return;g=a}e.setText(d,g,
g+c.length);h&&b.setSelection(g,g+d.length)}};k.prototype={add:function(g){this.changes.push(g)},end:function(g){this.endSelection=g.getSelection();this.endCaret=g.getCaretOffset();(g=this.owner)&&g.end&&g.end()},undo:function(g,d){this.changes.length>1&&g.setRedraw(!1);for(var c=this.changes.length-1;c>=0;c--)this.changes[c].undo(g,!1);this.changes.length>1&&g.setRedraw(!0);if(d){var c=this.startSelection.start,b=this.startSelection.end;g.setSelection(this.startCaret?c:b,this.startCaret?b:c)}(c=
this.owner)&&c.undo&&c.undo();return this.changes.length>0},redo:function(g,d){this.changes.length>1&&g.setRedraw(!1);for(var c=0;c<this.changes.length;c++)this.changes[c].redo(g,!1);this.changes.length>1&&g.setRedraw(!0);if(d){var c=this.endSelection.start,b=this.endSelection.end;g.setSelection(this.endCaret?c:b,this.endCaret?b:c)}(c=this.owner)&&c.redo&&c.redo();return this.changes.length>0},start:function(g){this.startSelection=g.getSelection();this.startCaret=g.getCaretOffset();(g=this.owner)&&
g.start&&g.start()}};i.prototype={add:function(g){this.compoundChange?this.compoundChange.add(g):(this.stack.splice(this.index,this.stack.length-this.index,g),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 g=this.index,d=this.stack.length;this._undoStart!==void 0&&g++;return{undo:g,redo:d-g}},undo:function(){this._commitUndo();var g;g=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;g=this.stack[--this.index]}while(!(g=g.undo(this.view,!0)));this._ignoreUndo=!1;return g},redo:function(){this._commitUndo();var g;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
g=this.stack[this.index++]}while(!g.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(g){this._commitUndo();g=new k(g);this.add(g);this.compoundChange=g;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(g){var d=g.text,c=g.start,b=g.removedCharCount,g=g.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(g===1&&b===0&&this._undoType===1&&c===this._undoStart+
this._undoText.length||g===0&&b===1&&this._undoType===-1&&(c+1===this._undoStart||c===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(g===1&&b===0){if(this._undoStart===void 0)this._undoStart=c;this._undoText+=d;this._undoType=1;return}else if(g===0&&b===1){d=this._undoText.length>0&&this._undoStart===c;this._undoStart=c;this._undoType=-1;d?this._undoText+=this.model.getText(c,c+b):this._undoText=this.model.getText(c,c+b)+this._undoText;return}this.add(new h(c,d,this.model.getText(c,
c+b)))}}};return{UndoStack:i}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(h,k,i,g){function d(a,b,c,e){this._location=b||"left";this._overview=c||"page";this._rulerStyle=e;this._view=null;var d=this;this._listener={onTextModelChanged:function(a){d._onTextModelChanged(a)},onAnnotationModelChanged:function(a){d._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function c(a,b,c,e,g){d.call(this,a,b,"page",c);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0}function b(a,b,c){d.call(this,a,b,"page",c)}function j(a,b,c){d.call(this,a,b,"document",c)}function e(a,c,e){b.call(this,a,c,e)}d.prototype={getAnnotations:function(a,b){var c=this._annotationModel;if(!c)return[];var e=this._view.getModel(),d=e.getLineStart(a),g=e.getLineEnd(b-1),h=e;e.getBaseModel&&(h=e.getBaseModel(),d=e.mapOffset(d),g=e.mapOffset(g));for(var j=[],c=this.getAnnotationsByType(c,d,g),d=0;d<c.length;d++)for(var g=
c[d],i=h.getLineAtOffset(g.start),k=h.getLineAtOffset(Math.max(g.start,g.end-1)),o=i;o<=k;o++){var v=o;if(e!==h){v=h.getLineStart(o);v=e.mapOffset(v,!0);if(v===-1)continue;v=e.getLineAtOffset(v)}if(a<=v&&v<b){var x=this._mergeAnnotation(j[v],g,o-i,k-i+1);x&&(j[v]=x)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var u in j)j[u]._multiple&&(j[u].html+=this._multiAnnotationOverlay.html);return j},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,c=b.getModel(),e=c,d=c.getLineStart(a),g=d,h=this._annotationModel;if(h){g=b.getSelection();b=Math.max(g.start,g.end);g=c.getLineEnd(a,!0);d<=b&&b<c.getLineEnd(a)&&(d=b+1);c.getBaseModel&&
(d=c.mapOffset(d),g=c.mapOffset(g),e=c.getBaseModel());for(var j,a=h.getAnnotations(d,g);!j&&a.hasNext();)g=a.next(),this.isAnnotationTypeVisible(g.type)&&(j=g);j&&e.getLineAtOffset(j.start)===e.getLineAtOffset(d)?(d=j.start,g=j.end):g=d;c.getBaseModel&&(d=c.mapOffset(d,!0),g=c.mapOffset(g,!0))}(c=i.Tooltip.getTooltip(this._view))&&c.setTarget(null);this._view.setSelection(g,d,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var c=i.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var e=this;c.setTarget({y:b.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=i.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var c=this._view,e=c.getModel(),d=this._annotationModel,g=[];if(d){var g=e.getLineStart(a),h=e.getLineEnd(a);e.getBaseModel&&(g=e.mapOffset(g),h=e.mapOffset(h));
g=this.getAnnotationsByType(d,g,h)}d=this._getTooltipContents(a,g);if(!d)return null;d={contents:d,anchor:this.getLocation()};g=c.getClientArea();g.y=this.getOverview()==="document"?c.convert({y:b},"view","document").y:c.getLocationAtOffset(e.getLineStart(a)).y;c.convert(g,"document","page");d.x=g.x;d.y=g.y;d.anchor==="right"&&(d.x+=g.width);return d}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var f=0;f<a.length;f++)if(d.isAnnotationTypeVisible(a[f].type)){var g=
a[f].start,h=a[f].end;e.getBaseModel&&(g=e.mapOffset(g,!0),h=e.mapOffset(h,!0));g!==-1&&h!==-1&&c.redrawLines(e.getLineAtOffset(g),e.getLineAtOffset(Math.max(g,h-1))+1,d)}}var c=this._view;if(c){var e=c.getModel(),d=this,g=e.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,e.getBaseModel&&(a=e.mapOffset(a,!0)),a=e.getLineAtOffset(a),c.redrawLines(a,g,d)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,c){a||(a={});if(c===0)if(a.html&&b.html){if(b.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||
(a.attributes[c]=b.attributes[c])}}return a}};k.AnnotationTypeList.addMixin(d.prototype);c.prototype=new d;c.prototype.getAnnotations=function(a,b){for(var c=d.prototype.getAnnotations.call(this,a,b),e=this._view.getModel(),g=a;g<b;g++){var h=g&1?this._oddStyle:this._evenStyle,j=g;e.getBaseModel&&(j=e.getLineStart(j),j=e.getBaseModel().getLineAtOffset(e.mapOffset(j)));c[g]||(c[g]={});c[g].html=j+1+"";if(!c[g].style)c[g].style=h}return c};c.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};c.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),c=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};b.prototype=new d;j.prototype=new d;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 c=this._view.getModel(),e=a;c.getBaseModel&&(e=c.getLineStart(e),e=c.getBaseModel().getLineAtOffset(c.mapOffset(e)));return g.formatMessage(h.line,e+1)}return d.prototype._getTooltipContents.call(this,a,b)};j.prototype._mergeAnnotation=function(a,b,c,e){if(c===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*e+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};e.prototype=new b;e.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var c=this._view.getModel(),e=c.getLineStart(a),a=c.getLineEnd(a,!0);c.getBaseModel&&(e=c.mapOffset(e),a=c.mapOffset(a),c=c.getBaseModel());for(var d,b=b.getAnnotations(e,a);!d&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(d=a);d&&c.getLineAtOffset(d.start)===c.getLineAtOffset(e)&&((c=i.Tooltip.getTooltip(this._view))&&c.setTarget(null),d.expanded?d.collapse():d.expand(),this._annotationModel.modifyAnnotation(d))}}};e.prototype._getTooltipContents=function(a,c){return c.length===
1&&c[0].expanded?null:b.prototype._getTooltipContents.call(this,a,c)};e.prototype._onAnnotationModelChanged=function(a){function c(a){for(h=0;h<a.length;h++)if(g.isAnnotationTypeVisible(a[h].type)){var b=a[h].start;d.getBaseModel&&(b=d.mapOffset(b,!0));b!==-1&&(i=Math.min(i,d.getLineAtOffset(b)))}}if(a.textModelChangedEvent)b.prototype._onAnnotationModelChanged.call(this,a);else{var e=this._view;if(e){var d=e.getModel(),g=this,h,j=d.getLineCount(),i=j;c(a.added);c(a.removed);c(a.changed);a=e.getRulers();
for(h=0;h<a.length;h++)e.redrawLines(i,j,a[h])}}};return{Ruler:d,AnnotationRuler:b,LineNumberRuler:c,OverviewRuler:j,FoldingRuler:e}});
define("orion/editor/textDND",[],function(){function h(h,i){this._view=h;this._undoStack=i;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var g=this;this._listener={onDragStart:function(d){g._onDragStart(d)},onDragEnd:function(d){g._onDragEnd(d)},onDragEnter:function(d){g._onDragEnter(d)},onDragOver:function(d){g._onDragOver(d)},onDrop:function(d){g._onDrop(d)},onDestroy:function(d){g._onDestroy(d)}};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 i=this._view,g=i.getSelection(),i=i.getModel();if(i.getBaseModel)g.start=i.mapOffset(g.start),g.end=i.mapOffset(g.end),i=i.getBaseModel();if(i=i.getText(g.start,g.end))this._dragSelection=g,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",i)},_onDragEnd:function(h){var i=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(h=h.event.dataTransfer.dropEffect==="move")&&i.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var g=this._dropText,d=this._dropOffset;if(h)if(d>=this._dragSelection.end)d-=this._dragSelection.end-this._dragSelection.start;else if(d>=this._dragSelection.start)d=this._dragSelection.start;i.setText(g,d,d);i.setSelection(d,d+g.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 i=h.event.dataTransfer.types;if(i){var g=!this._view.getOptions("readonly");g&&(g=i.contains?i.contains("text/plain"):i.indexOf("text/plain")!==-1);if(!g)h.event.dataTransfer.dropEffect="none"}},_onDrop:function(h){var i=this._view,g=h.event.dataTransfer.getData("Text");if(g)h=i.getOffsetAtLocation(h.x,h.y),this._dragSelection?(this._dropOffset=h,this._dropText=g):
(i.setText(g,h,h),i.setSelection(h,h+g.length))}};return{TextDND:h}});
define("orion/editor/templates",[],function(){function h(h,g,d){this.prefix=h;this.description=g;this.template=d;this._parse()}function k(h,g){this._keywords=h||[];this._templates=[];this.addTemplates(g||[])}h.prototype={getProposal:function(h,g,d){var h=g-h.length,g={},c,b=d.delimiter!==void 0?d.delimiter:"\n";d.indentation&&(b+=d.indentation);for(var j=d.tab!==void 0?d.tab:"\t",e=0,a=this.variables,f=this.segments,d=[],k=0;k<f.length;k++){var n=f[k],m=a[n];if(m!==void 0)switch(n){case "${tab}":n=
j;break;case "${delimiter}":n=b;break;case "${cursor}":n="";c=e;break;default:var q=g[n];q||(q=g[n]={data:m.data,positions:[]});n=m.substitution;q.data&&q.data.values&&(n=q.data.values[0]);q.positions.push({offset:h+e,length:n.length})}d.push(n);e+=n.length}var b=[],s;for(s in g)g.hasOwnProperty(s)&&b.push(g[s]);d=d.join("");if(c===void 0)c=d.length;return{proposal:d,description:this.description,groups:b,escapePosition:h+c}},match:function(h){return this.prefix.indexOf(h)===0},_parse:function(){var h=
this.template,g=[],d={},c,b=0,h=h.replace(/\n/g,"${delimiter}"),h=h.replace(/\t/g,"${tab}");h.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(j,e,a){var f=j.substring(2,j.length-1),e=j,k=f,n=null,m=k.indexOf(":");m!==-1&&(k=k.substring(0,m),e="${"+k+"}",n=JSON.parse(f.substring(m+1).replace("\\}","}").trim()));(f=d[e])||(f=d[e]={});f.substitution=k;if(n)f.data=n;(c=h.substring(b,a))&&g.push(c);g.push(e);b=a+j.length;return k});(c=h.substring(b,h.length))&&g.push(c);this.segments=g;this.variables=d}};
k.prototype={addTemplates:function(i){for(var g=this.getTemplates(),d=0;d<i.length;d++)g.push(new h(i[d].prefix,i[d].description,i[d].template))},computeProposals:function(h,g,d){var c=this.getPrefix(h,g,d),b=[];if(!this.isValid(c,h,g,d))return b;b=b.concat(this.getTemplateProposals(c,g,d));return b=b.concat(this.getKeywordProposals(c))},getKeywords:function(){return this._keywords},getKeywordProposals:function(h){var g=[],d=this.getKeywords();if(d)for(var c=0;c<d.length;c++)d[c].indexOf(h)===0&&
g.push({proposal:d[c].substring(h.length),description:d[c]});return g},getPrefix:function(h,g,d){return d.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(h,g,d){for(var c=[],b=this.getTemplates(),j=0;j<b.length;j++){var e=b[j];e.match(h)&&(e=e.getProposal(h,g,d),this.removePrefix(h,e),c.push(e))}return c},removePrefix:function(h,g){if(!(g.overwrite=g.proposal.substring(0,h.length)!==h))g.proposal=g.proposal.substring(h.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,i,g,d,c){function b(b,a,c){var d=b.getTextView();i.KeyMode.call(this,d);this.editor=b;this.undoStack=a;this.contentAssist=c;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,e;b;)if(c=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),e=c.position,e===void 0||e.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;e=a.addedCharCount-a.removedCharCount;c=c.positions;for(var d,f,g=0;g<c.length;++g){f=c[g];d=f.position;var h=d.offset<=a.start&&a.start<=d.offset+d.length;h&&!f.ansestor?(d.offset+=b,d.length+=e,b+=e):(d.offset+=b,f.ansestor&&h&&(d.length+=
e));if(f.escape)f.model.escapePosition=d.offset}this._updateAnnotations(c)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,e;b;)if(c=this._getPositionChanged(b,a.start,a.end),e=c.position,e===void 0||e.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var d=this._compoundChange;d?d.owner.model===b&&d.owner.group===e.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=e.group;var d=0,f=a.text.length-(a.end-
a.start);c=c.positions;for(var g,h,j=a.start-e.position.offset,i=a.end-e.position.offset,k=0;k<c.length;++k)if(h=c[k],g=h.position,h.oldOffset=g.offset,h.model===b&&h.group===e.group?(g.offset+=d,g.length+=f,d+=f):(g.offset+=d,h.ansestor&&(g.length+=e.count*f)),h.escape)h.model.escapePosition=g.offset;this.ignoreVerify=!0;d=this.editor.getTextView();for(k=c.length-1;k>=0;k--)h=c[k],h.model===b&&h.group===e.group&&d.setText(a.text,h.oldOffset+j,h.oldOffset+i);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var j={};b.prototype=new i.KeyMode;c.mixin(b.prototype,{createKeyBindings:function(){var b=k.KeyBinding,a=[];a.push({actionID:"linkedModeEnter",keyBinding:new b(13)});a.push({actionID:"linkedModeCancel",keyBinding:new b(27)});a.push({actionID:"linkedModeNextGroup",keyBinding:new b(9)});a.push({actionID:"linkedModePreviousGroup",keyBinding:new b(9,!1,!0)});return a},enterLinkedMode:function(b){if(!this.linkedModeModel){var a=this.editor.getTextView();a.addKeyMode(this);a.addEventListener("Verify",
this.linkedModeListener.onVerify);a.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)b.previousModel=this.linkedModeModel,b.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=b;this.linkedModeModel=b;this.selectLinkedGroup(0)},exitLinkedMode:function(b){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var a=this.linkedModeModel;this.linkedModeModel=a.previousModel;a.parentGroup=a.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var c=this.editor.getTextView();c.removeKeyMode(this);c.removeEventListener("Verify",this.linkedModeListener.onVerify);c.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);
d.offset=void 0;this.editor.reportStatus(h.linkedModeExited,null,!0);b&&c.setCaretOffset(a.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var b=this,a=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:a,group:a.selectedGroupIndex,end:function(){b._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(b){var a=this.linkedModeModel;if(a){a.selectedGroupIndex=b;var b=a.groups[b],c=b.positions[0],g=this.editor.getTextView();g.setSelection(c.offset,c.offset+c.length);if(a=this.contentAssist)if(a.offset=void 0,b.data&&b.data.type==="link"&&b.data.values)(this._groupContentAssistProvider=new d.TemplateContentAssist(b.data.values)).getPrefix=function(){var a=g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),c.offset<=a&&a<=c.offset+c.length)?g.getText(c.offset,
a):""},a.offset=c.offset,a.deactivate(),a.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,a.deactivate()}this._updateAnnotations()},_getModelPositions:function(b,a,c){for(var d=a.groups,g=0;g<d.length;g++)for(var h=d[g].positions,j=0;j<h.length;j++){var i=h[j];c&&(i={offset:i.offset+c,length:i.length});i={index:j,group:g,count:h.length,model:a,position:i};b.push(i);if(a.nextModel&&a.nextModel.parentGroup===g)i.ansestor=!0,this._getModelPositions(b,a.nextModel,
(c||0)+h[j].offset-h[0].offset)}},_getSortedPositions:function(b){var a=this._sortedPositions;if(!a){for(a=[];b.previousModel;)b=b.previousModel;for(this._getModelPositions(a,b);b;)b.escapePosition!==void 0&&a.push({escape:!0,model:b,position:{offset:b.escapePosition,length:0}}),b=b.nextModel;a.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=a}return a},_getPositionChanged:function(b,a,c){for(var d,b=this._getSortedPositions(b),g=b.length-1;g>=0;g--){var h=b[g].position;
if(h.offset<=a&&c<=h.offset+h.length){d=b[g];break}}return{position:d,positions:b}},_updateAnnotations:function(b){var a=this.editor.getAnnotationModel();if(a){for(var c=[],d=[],h=a.getTextModel(),h=a.getAnnotations(0,h.getCharCount()),j;h.hasNext();)switch(j=h.next(),j.type){case g.AnnotationType.ANNOTATION_LINKED_GROUP:case g.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case g.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(j)}if(h=this.linkedModeModel)for(var b=b||this._getSortedPositions(h),
i=0;i<b.length;i++)if(j=b[i],j.model===h){var k=g.AnnotationType.ANNOTATION_LINKED_GROUP;j.group===h.selectedGroupIndex&&(k=j.index===0?g.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:g.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);j=j.position;j=g.AnnotationType.createAnnotation(k,j.offset,j.offset+j.length,"");d.push(j)}a.replaceAnnotations(c,d)}}});j.LinkedMode=b;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,i,g,d,c){function b(){}function j(){}function e(){}function a(){}function f(){}function l(){}var n={};b.prototype={createKeyBindings:function(a,b,e,d){var d=new h.TextActions(a,b,d),f=new c.LinkedMode(a,b,e),a=new h.SourceCodeActions(a,b,e,f);return{textActions:d,linkedMode:f,sourceCodeActions:a}}};n.KeyBindingsFactory=
b;j.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=j;e.prototype={createLineNumberRuler:function(a){return new i.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=e;a.prototype={createFoldingRuler:function(a){return new i.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=a;f.prototype={createAnnotationModel:function(a){return new g.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new g.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new i.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new i.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};n.AnnotationFactory=f;l.prototype={createTextDND:function(a,b){return new d.TextDND(a.getTextView(),b)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(h,k,i){var g={};g.KeyBindingsFactory=h.KeyBindingsFactory;g.UndoFactory=h.UndoFactory;g.LineNumberRulerFactory=h.LineNumberRulerFactory;g.FoldingRulerFactory=h.FoldingRulerFactory;g.AnnotationFactory=h.AnnotationFactory;g.TextDNDFactory=h.TextDNDFactory;g.TextActions=k.TextActions;g.SourceCodeActions=k.SourceCodeActions;g.LinkedMode=i.LinkedMode;return g});
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,i){var g=g||{};g.TwoWayCompareUIFactory=function(){function d(c){this._parentDivID=c.parentDivID;this._commandSpanId=c.commandSpanId;this._showTitle=c.showTitle;this._leftTitle=c.leftTitle;this._rightTitle=c.rightTitle;this._showLineStatus=c.showLineStatus}d.prototype={_init:function(){var c=this._parentDivID+"_";this._topWidgetDiv=h.node("topWidget_id");
this._topWidgetDiv.id=c+"topWidget_id";this._leftEditorParentDiv=h.node("left_editor_id");this._leftEditorParentDiv.id=c+"left_editor_id";this._rightEditorParentDiv=h.node("right_editor_id");this._rightEditorParentDiv.id=c+"right_editor_id";this._rightEditorWrapperDiv=h.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=c+"right_editor_wrapper_id";this._leftTitleDiv=h.node("left_title_id");this._leftTitleDiv.id=c+"left_title_id";this._rightTitleDiv=h.node("right_title_id");this._rightTitleDiv.id=
c+"right_title_id";this._leftStatusDiv=h.node("left_status_id");this._leftStatusDiv.id=c+"left_status_id";this._rightStatusDiv=h.node("right_status_id");this._rightStatusDiv.id=c+"right_status_id";this._diffCanvasDiv=h.node("diff_canvas_id");this._diffCanvasDiv.id=c+"diff_canvas_id";this._splitterId=c+"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 c=h.$(".split",this._topWidgetDiv);c.id=this._splitterId;var b=h.$(".leftPanelLayout",this._topWidgetDiv),d=h.$(".rightPanelLayout",this._topWidgetDiv);if(c&&b&&d)this._splitter=new k.Splitter({node:c,sidePanel:b,mainPanel:d})},buildUI:function(){h.node(this._parentDivID).innerHTML=
i;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(c){return h.$(".leftPanelLayout",this._topWidgetDiv)===c},getEditorParentDiv:function(c){return c?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(c){return c?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(c){return c?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return d}();return g});
var JsDiff=function(){function h(b){for(var c=[],a=0;a<b.length;a++)b[a]&&c.push(b[a]);return c}function k(b){b=b.replace(/&/g,"&amp;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;");return b=b.replace(/"/g,"&quot;")}var i=function(b){this.ignoreWhitespace=b};i.prototype={diff:function(b,c){if(c==b)return[{value:c}];if(!c)return[{value:b,removed:!0}];if(!b)return[{value:c,added:!0}];var c=this.tokenize(c),b=this.tokenize(b),a=c.length,d=b.length,g=a+d,h=[{newPos:-1,components:[]}],i=this.extractCommon(h[0],
c,b,0);if(h[0].newPos+1>=a&&i+1>=d)return h[0].components;for(var k=1;k<=g;k++)for(var s=-1*k;s<=k;s+=2){var p;p=h[s-1];var r=h[s+1],i=(r?r.newPos:0)-s;p&&(h[s-1]=void 0);var t=p&&p.newPos+1<a,o=r&&0<=i&&i<d;if(!t&&!o)h[s]=void 0;else if(!t||o&&p.newPos<r.newPos?(p={newPos:r.newPos,components:r.components.slice(0)},this.pushComponent(p.components,b[i],void 0,!0)):(p={newPos:p.newPos,components:p.components.slice(0)},p.newPos++,this.pushComponent(p.components,c[p.newPos],!0,void 0)),i=this.extractCommon(p,
c,b,s),p.newPos+1>=a&&i+1>=d)return p.components;else h[s]=p}},pushComponent:function(b,c,a,d){var g=b[b.length-1];g&&g.added===a&&g.removed===d?b[b.length-1]={value:this.join(g.value,c),added:a,removed:d}:b.push({value:c,added:a,removed:d})},extractCommon:function(b,c,a,d){for(var g=c.length,h=a.length,i=b.newPos,d=i-d;i+1<g&&d+1<h&&this.equals(c[i+1],a[d+1]);)i++,d++,this.pushComponent(b.components,c[i],void 0,void 0);b.newPos=i;return d},equals:function(b,c){var a=/\S/;return this.ignoreWhitespace&&
!a.test(b)&&!a.test(c)?!0:b==c},join:function(b,c){return b+c},tokenize:function(b){return b}};var g=new i,d=new i(!1);d.tokenize=function(b){return h(b.split(/(\s+|\b)/))};var c=new i(!0);c.tokenize=function(b){return h(b.split(/([{}:;,]|\s+)/))};var b=new i;b.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,c){return g.diff(b,c)},diffWords:function(b,c){return d.diff(b,c)},diffLines:function(c,d){return b.diff(c,d)},diffCss:function(b,d){return c.diff(b,d)},createPatch:function(c,
d,a,f,g){var h=[];h.push("Index: "+c);h.push("===================================================================");h.push("--- "+c+"\t"+f);h.push("+++ "+c+"\t"+g);c=b.diff(d,a);c.push({value:"",lines:[]});for(var a=d=0,f=[],i=g=1,k=0;k<c.length;k++){var s=c[k],p=s.lines||s.value.replace(/\n$/,"").split("\n");s.lines=p;if(s.added||s.removed){if(!d){var r=c[k-1],d=g,a=i;r&&(f.push.apply(f,r.lines.slice(-4).map(function(a){return" "+a})),d-=4,a-=4)}f.push.apply(f,p.map(function(a){return(s.added?"+":
"-")+a}));s.added?i+=p.length:g+=p.length}else d&&(p.length<=8&&k<c.length-1?f.push.apply(f,p.map(function(a){return" "+a})):(r=Math.min(p.length,4),h.push("@@ -"+d+","+(g-d+r)+" +"+a+","+(i-a+r)+" @@"),h.push.apply(h,f),h.push.apply(h,p.slice(0,r).map(function(a){return" "+a})),a=d=0,f=[])),g+=p.length,i+=p.length}c.length>1&&!/\n$/.test(c[c.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(b){for(var c=[],a=0;a<b.length;a++){var d=b[a];
d.added?c.push("<ins>"):d.removed&&c.push("<del>");c.push(k(d.value));d.added?c.push("</ins>"):d.removed&&c.push("</del>")}return c.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 i(){}i.prototype={_specialLine:function(g,d,c){return d.value===g&&c!==g},adapt:function(g,d,c){c||(c="\n");for(var b=g.split(c),j=d.split(c),e=b[b.length-1]==="",j=j[j.length-1]==="",a=h.diffLines(g,d),g=[],d=[],f=0,i=0,k=-1,m=0,q=!0,s=c,p=0;p<a.length;p++){var r=a[p],t=r.lines||r.value.split(c),o=t.length,v=0;t.length>1&&t[t.length-1]===""&&o--;o>1&&!q&&t[0]===""&&(o--,v++);r.lines=t;
if(!r.added&&!r.removed){if(!this._specialLine(c,r,s)){if(f||i)g.push([f,i,k]),i=f=0,k=-1,m+=i;g.push([o,o,0]);m+=o}}else if(r.added){k===-1&&(k=d.length+1);f+=o;for(q=v;q<o+v;q++)d.push(r.lines[q])}else i+=o;q=!1;t.length>1&&t[t.length-1]===""&&(q=!0);s=r.value?r.value[r.value.length-1]:c}if(f||i)g.push([f,i,k]),m+=i;m<b.length&&b.length>1&&(c=g[g.length-1],c[2]===0?(c[0]+=1,c[1]+=1):c[2]===-1?g.push([1,1,0]):e===j?g.push([1,1,0]):(j&&(c[0]+=1),e&&(c[1]+=1)));return{mapper:g,changContents:{array:d,
index:0}}},adaptCharDiff:function(g,d,c){for(var g=c?h.diffWords(g,d):h.diffChars(g,d),d=[],b=c=0,j=0,e=0,a=0;a<g.length;a++){var f=g[a];if(!f.added&&!f.removed){if(j>0||e>0)d.push([b,b+j,c,c+e]),b+=j,c+=e,e=j=0;b+=f.value.length;c+=f.value.length}else f.added?j+=f.value.length:e+=f.value.length}(j>0||e>0)&&d.push([b,b+j,c,c+e]);return d}};return i}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(h,k,i,g){var d={},c,b,j,e,a,f,l,n,m,q,s,p,r,t,o,v;d.DiffTreeNavigator=function(){function d(a,b,c,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,c,e,f,g)}c="orion.annotation.diff.addedBlock";b="orion.annotation.diff.currentAddedBlock";j="orion.annotation.diff.deletedBlock";e="orion.annotation.diff.currentDeletedBlock";
a="orion.annotation.diff.blockTop";f="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";q="orion.annotation.diff.currentAddedWord";s="orion.annotation.diff.deletedWord";p="orion.annotation.diff.currentDeletedWord";r="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";o="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
i.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});i.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});i.AnnotationType.registerType(j,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});i.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});i.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
i.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});i.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});i.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});i.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});i.AnnotationType.registerType(q,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});i.AnnotationType.registerType(s,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});i.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});i.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});i.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
i.AnnotationType.registerType(o,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});i.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});d.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(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 c=new g.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var e=this.generatePairWordAnnotations(d,a,c);if(e)d.children=e}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,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?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 c=this.iterator.cursor();c.type==="block"&&c.children&&c.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,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),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,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}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 c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (i.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (i.AnnotationType.getType(e.current))(g.start,g.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=i.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<d.length;h++){var j=
i.AnnotationType.createAnnotation(g.normal,d[h][e]+c,d[h][f]+c);a.push(j);b.push(j)}},_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 c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c: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 d}();d.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:q,normal:m,list:[]}):a.push({type:"word",current:p,normal:s,list:[]});a.push({type:"word",current:r});a.push({type:"word",current:t});a.push({type:"word",current:o});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:s}:this._mapperColumnIndex===0?{current:q,normal:m}:{current:p,normal:s}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?v:t;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:t;return this._mapperColumnIndex===0?o:r},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],c=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(b);if(c<b)return{start:a,end:a};b=this._textModel.getLineEnd(c,!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}();d.TwoWayDiffBlockFeeder=function(){function g(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}g.prototype=new d.DiffBlockFeeder;g.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([c,d]),c+=this._mapper[d][this._mapperColumnIndex]}};g.prototype.getBlockAnnoTypes=function(d){this._mapperColumnIndex===0?d.push({type:"block",normal:c,current:b,list:[]}):d.push({type:"block",normal:j,current:e,list:[]});d.push({type:"block",normal:a,current:f,list:[]});d.push({type:"block",normal:l,current:n,list:[]})};g.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=d)return null;d=this._diffBlocks[d][1];
if(this._mapper[d][this._mapperColumnIndex]===0)return{normal:a,current:f};else if(k.isMapperConflict(this.getMapper(),d))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:c,current:b,list:[]};return{type:"block",normal:j,current:e,list:[]}};return g}();d.inlineDiffBlockFeeder=function(){function a(b,c){this._mapperColumnIndex=c;this.init(b)}a.prototype=new d.DiffBlockFeeder;a.prototype.setModel=function(a){this._textModel=a};a.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(this._mapper[c][2]!==0){if(this._mapperColumnIndex===0){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};a.prototype.getBlockAnnoTypes=function(a){this._mapperColumnIndex===0?a.push({type:"block",normal:c,current:b,list:[]}):a.push({type:"block",normal:j,current:e,list:[]});a.push({type:"block",normal:l,current:n,list:[]})};a.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this._diffBlocks[a][1];if(this._mapper[a][this._mapperColumnIndex]===0)return{current:q,normal:m};else if(k.isMapperConflict(this.getMapper(),
a))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:c,current:b,list:[]};return{type:"block",normal:j,current:e,list:[]}};a.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]};a.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 a}();return d});
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,i,g,d,c,b,j,e,a,f,l,n){var m={};m.CompareView=function(){function a(){this._diffParser=new g.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,d,e){var f=this._getLineDelim(a,c);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,c,d,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 f(b){this.setOptions(b,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new a.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 d.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
f.prototype=new m.CompareView;f.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 d.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)};f.prototype.getEditors=function(){return this._editors};f.prototype.gotoDiff=function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};f.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};f.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
f.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};f.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};f.prototype._createEditor=function(a,d,f,g,j){var i=typeof g.readonly==="undefined"?!0:g.readonly,k=function(){var a=new e.TextView({parent:d,readonly:i,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 c=
!1;(c=this._uiFactory.isLeftPane(b)?j:!j)&&a.resize()}}.bind(this));return a}.bind(this),l=g.keyBindingFactory;l||(l=new b.KeyBindingsFactory);var m=null;if(f)var n="",m=function(a,b){if(f)n=b?h["ERROR: "]+a:a,f.textContent=""+n};k=new c.Editor({textViewFactory:k,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:d});k.installTextView();k.setInput(null,null,g.Content?g.Content:a);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,!j))this.options.mapper=null}.bind(this));j?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};f.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};f.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new d.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}};f.prototype.refresh=function(a){var b=this.options.oldFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;typeof c==="string"?d=this._generateMapper(b,c,d,this.options.hasConflicts):(d=this._generateMapper(b,c,d,this.options.hasConflicts),
c=d.output);var e=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),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)i.empty(b),i.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 f}();m.InlineCompareView=function(){function a(b){this.setOptions(b,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}a.prototype=new m.CompareView;a.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};a.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};a.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};a.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};a.prototype.initEditors=function(a){var f=i.node(this._editorDiv),g=function(){return new e.TextView({parent:f,readonly:!0,tabSize:4})}.bind(this);this._editor=
new c.Editor({textViewFactory:g,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,domNode:f});this._editor.installTextView();this._editor.setInput(null,null,a);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new d.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new d.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new d.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))};a.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};a.prototype.refresh=function(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(b.mapper,
1),c=new n.inlineDiffBlockFeeder(b.mapper,0);f.mergeDiffBlocks(this._textView.getModel(),c.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());c.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,c,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};a.prototype.setConflicting=
function(a){this._conflcit=a};return a}();m.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new m.InlineCompareView(c):new m.TwoWayCompareView(c)}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();i.empty(i.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 i(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function g(){i.call(this,null,!0)}function d(a){i.call(this,null,a)}function c(){i.call(this,null,!1)}function b(b,f,h){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(f){case "java":k=e;break;case "js":k=j;break;case "css":k=a}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new i(k,this.whitespacesVisible);this._firstScanner=new c;this._commentScanner=new d(this.whitespacesVisible);this._whitespaceScanner=new g;if(f==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=b;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)}};f=b.getModel();f.getBaseModel&&(f=f.getBaseModel());f.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();b.redrawLines()}var j=k.JSKeywords,e=k.JAVAKeywords,a=k.CSSKeywords,f={styleClass:"token_singleline_comment"},
l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},q={styleClass:"token_task_tag"},s={styleClass:"token_doc_tag"},p={styleClass:"token_string"},r={styleClass:"token_number"},t={styleClass:"token_keyword"},o={styleClass:"token_space"},v={styleClass:"token_tab"},x={styleClass:"line_caret"};i.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};g.prototype=new i(null);g.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}}};d.prototype=new i(null);d.prototype.setType=function(a){this._type=a};d.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}}};c.prototype=new i(null);c.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};b.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);
a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,
b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(h.AnnotationType.ANNOTATION_FOLDING);for(var c=
[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (h.AnnotationType.getType(h.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());
for(var g=d.getAnnotations(b,c),e=[],j=h.AnnotationType.ANNOTATION_TASK;g.hasNext();){var i=g.next();i.type===j&&e.push(i)}g=[];i=this._commentScanner;i.setText(f.getText(b,c));for(var k;k=i.nextToken();){var l=i.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),g.push(h.AnnotationType.createAnnotation(j,l,k,f.getText(l,k))))}d.replaceAnnotations(e,g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),
b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return x}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=d)break;var j=g[h].start,i=g[h].end;f<j&&this._parse(b.substring(f-c,j-c),f,e);var k=g[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=p}f=Math.max(f,j);j=Math.min(d,i);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(f-c,j-c),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,j-c),f,e,p):e.push({start:f,end:j,style:m});f=i}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var e=d.getStartOffset()+b,g=null;switch(a){case 2:g=t;break;case 3:g=r;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),
e,c,p);continue}else g=p;break;case 8:this._parseComment(d.getData(),e,c,n,a);continue;case 6:this._parseComment(d.getData(),e,c,f,a);continue;case 7:this._parseComment(d.getData(),e,c,l,a);continue;case 10:this.whitespacesVisible&&(g=v);break;case 11:this.whitespacesVisible&&(g=o)}c.push({start:e,end:d.getOffset()+b,style:g})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&
(g=v);break;case 11:this.whitespacesVisible&&(g=o);break;case 12:g=m;break;case 13:g=s;break;case 14:g=q;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&(g=v);break;case 11:this.whitespacesVisible&&(g=o)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},
_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===
6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),j=a.getLineEnd(g),c=this._findBrackets(d,f,c,h,h,j),j=0;j<c.length;j++)if(h=c[j]>=0?1:-1,c[j]*h-1===b){var i=1;if(e&1){for(j--;j>=0;j--)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;for(g-=1;g>=
0;){c=a.getLine(g);h=a.getLineStart(g);j=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,j);for(e=c.length-1;e>=0;e--)if(h=c[e]>=0?1:-1,i+=h,i===0)return c[e]*h-1;g--}}else{for(j++;j<c.length;j++)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);j=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,j);for(j=0;j<c.length;j++)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var g=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),h=e,j=this._scanner,i,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;i=k[l].start;var m=k[l].end;if(h<i)for(j.setText(c.substring(h-e,i-e));i=j.nextToken();)i===a?g.push(j.getStartOffset()+h-e+d+1):i===b&&g.push(-(j.getStartOffset()+h-e+d+1));h=m}if(h<f)for(j.setText(c.substring(h-e,f-e));i=j.nextToken();)i===a?g.push(j.getStartOffset()+h-e+d+1):i===b&&g.push(-(j.getStartOffset()+h-e+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
j,i;if(c.start===c.end&&(i=d.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),a=this._findMatchingBracket(a,i),a!==-1&&(j=[h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=j;this.annotationModel.replaceAnnotations(b,j)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,g=f.getCharCount(),j=this.comments.length,i=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,i,!0),l=this._binarySearch(this.comments,
c,!1,k-1,j);k<j&&this.comments[k].start<=i&&i<this.comments[k].end?(i=this.comments[k].start,i>b&&(i+=d)):i=k===j&&j>0&&g-d===this.comments[j-1].end?this.comments[j-1].start:i;var m;l<j?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=j,m=g);for(var n,g=this._findComments(f.getText(i,m),i),j=k;j<this.comments.length;j++)n=this.comments[j],n.start>b&&(n.start+=d),n.start>b&&(n.end+=d);var o=l-k!==g.length;if(!o)for(j=0;j<g.length;j++){n=this.comments[k+j];var p=g[j];if(n.start!==p.start||n.end!==p.end||
n.type!==p.type){o=!0;break}}j=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,j);o&&(j=i,n=m,a!==f&&(j=a.mapOffset(j,!0),n=a.mapOffset(n,!0)),e.redrawRange(j,n));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(i,m);i=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===h.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(j=0;j<g.length;j++)if(n.start===g[j].start&&n.end===g[j].end)break;j===g.length?(i.push(n),n.expand()):(j=n.start,l=n.end,j>
b&&(j-=d),l>b&&(l-=d),j<=b&&b<l&&j<=c&&c<l&&(j=f.getLineAtOffset(n.start),l=f.getLineAtOffset(n.end),j!==l?n.expanded||(n.expand(),e.modifyAnnotation(n)):e.removeAnnotation(n)))}b=[];for(j=0;j<g.length;j++){n=g[j];for(d=0;d<m.length;d++)if(m[d].start===n.start&&m[d].end===n.end)break;d===m.length&&(n=this._createFoldingAnnotation(a,f,n.start,n.end))&&b.push(n)}e.replaceAnnotations(i,b)}}};return{TextStyler:b}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(h){function k(d){var c;if(d instanceof Array){c=Array(d.length);for(var b=0;b<d.length;b++)c[b]=k(d[b])}else for(b in c={},d)if(Object.prototype.hasOwnProperty.call(d,b)){var g=d[b];c[b]=typeof g==="object"&&g!==null?k(g):g}return c}function i(d,c,b){this.initialize(d);this.grammar=k(c);this.externalGrammars=b?k(b):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var g={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return d[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(d){function c(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var b="",h,d=g.processGlobalFlag("x",d,function(a){for(var b="",c=!1,d=a.length,e=0;e<d;){var g=a.charAt(e);if(!c&&g==="#")for(;e<d&&g!=="\r"&&g!=="\n";)g=a.charAt(++e);
else if(!c&&/\s/.test(g))for(;e<d&&/\s/.test(g);)g=a.charAt(++e);else g==="\\"?(b+=g,/\s/.test(a.charAt(e+1))||(b+=a.charAt(e+1),e+=1)):(g==="["?c=!0:g==="]"&&(c=!1),b+=g),e+=1}return b}),d=g.processGlobalFlag("i",d,function(a){b+="i";return a});for(h=0;h<this.unsupported.length;h++){var e;(e=this.unsupported[h].regex.exec(d))&&c(this.unsupported[h].func(e),e)}return RegExp(d,b)},processGlobalFlag:function(d,c,b){function g(a,b){for(var c=0,d=a.length,e=-1,h=b;h<d&&e===-1;h++)switch(a.charAt(h)){case "\\":h++;
break;case "(":c++;break;case ")":c--,c===0&&(e=h)}return e}var e="(?"+d+")",d="(?"+d+":";if(c.substring(0,e.length)===e)return b(c.substring(e.length));else if(c.substring(0,d.length)===d){e=g(c,0);if(e<c.length-1)throw Error("Only a "+d+") group that encloses the entire regex is supported in: "+c);return b(c.substring(d.length,e))}return c},hasBackReference:function(d){return/\\\d+/.test(d.source)},getSubstitutedRegex:function(d,c,b){for(var b=typeof b==="undefined"?!0:!1,d=d.source.split(/(\\\d+)/g),
g=[],e=0;e<d.length;e++){var a=d[e],f=/\\(\d+)/.exec(a);f?(a=c[f[1]]||"",g.push(b?h.escape(a):a)):g.push(a)}return RegExp(g.join(""))},groupify:function(d,c){for(var b=d.source,g=b.length,e=[],a=0,f=[],h=1,i=1,k=[],q={},s={},p=0;p<g;p++){var r=e[e.length-1],t=b.charAt(p);switch(t){case "(":if(r===4)e.pop(),k.push(")"),f[f.length-1].end=p;var o=p+2<g?b.charAt(p+1)+""+b.charAt(p+2):null;if(o==="?:"||o==="?="||o==="?!"){var v;o==="?:"?v=1:(v=3,a++);e.push(v);f.push({start:p,end:-1,type:v});k.push(t);
k.push(o);p+=o.length}else e.push(2),f.push({start:p,end:-1,type:2,oldNum:h,num:i}),k.push(t),a===0&&(s[i]=null),q[h]=i,h++,i++;break;case ")":r=e.pop();r===3&&a--;f[f.length-1].end=p;k.push(t);break;case "*":case "+":case "?":case "}":var x=t,u=b.charAt(p-1),o=p-1;if(t==="}"){for(v=p-1;b.charAt(v)!=="{"&&v>=0;v--);u=b.charAt(v-1);o=v-1;x=b.substring(v,p+1)}v=f[f.length-1];if(u===")"&&(v.type===2||v.type===4)){k.splice(v.start,0,"(");k.push(x);k.push(")");t={start:v.start,end:k.length-1,type:4,num:v.num};
for(u=0;u<f.length;u++)if(r=f[u],(r.type===2||r.type===4)&&r.start>=v.start&&r.end<=o)if(r.start+=1,r.end+=1,r.num+=1,r.type===2)q[r.oldNum]=r.num;f.push(t);i++;break}default:t!=="|"&&r!==2&&r!==4&&a===0&&(e.push(4),f.push({start:p,end:-1,type:4,num:i}),k.push("("),s[i]=null,i++),k.push(t),t==="\\"&&(t=b.charAt(p+1),k.push(t),p+=1)}}for(;e.length;)e.pop(),k.push(")");var b=RegExp(k.join("")),g={},c=c||q,w;for(w in c)c.hasOwnProperty(w)&&(g[w]="\\"+c[w]);b=this.getSubstitutedRegex(b,g,!1);return[b,
q,s]},complexCaptures:function(d){if(!d)return!1;for(var c in d)if(d.hasOwnProperty(c)&&c!=="0")return!0;return!1}};i.prototype={initialize:function(d){this.textView=d;this.textView.stylerOptions=this;var c=this;this._listener={onModelChanged:function(b){c.onModelChanged(b)},onDestroy:function(b){c.onDestroy(b)},onLineStyle:function(b){c.onLineStyle(b)},onStorage:function(b){c.onStorage(b)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Destroy",this._listener.onDestroy);
d.addEventListener("LineStyle",this._listener.onLineStyle);d.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(d){for(d=[d];d.length!==0;){var c=
d.pop();if(!c._resolvedRule||!c._typedRule)if(c._resolvedRule=this._resolve(c),c._typedRule=this._createTypedRule(c),this.addStyles(c.name),this.addStyles(c.contentName),this.addStylesForCaptures(c.captures),this.addStylesForCaptures(c.beginCaptures),this.addStylesForCaptures(c.endCaptures),c._resolvedRule!==c&&d.push(c._resolvedRule),c.patterns)for(var b=0;b<c.patterns.length;b++)d.push(c.patterns[b])}},addStyles:function(d){if(d&&!this._styles[d]){this._styles[d]=[];for(var c=d.split("."),b=0;b<
c.length;b++)this._styles[d].push(c.slice(0,b+1).join("-"))}},addStylesForCaptures:function(d){for(var c in d)d.hasOwnProperty(c)&&this.addStyles(d[c].name)},ContainerRule:function(){function d(c){this.rule=c;this.subrules=c.patterns}d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(c){this.rule=c;this.beginRegex=g.toRegExp(c.begin);this.endRegex=g.toRegExp(c.end);this.subrules=c.patterns||[];this.endRegexHasBackRef=g.hasBackReference(this.endRegex);var b=g.complexCaptures(c.captures),
c=g.complexCaptures(c.beginCaptures)||g.complexCaptures(c.endCaptures);if(this.isComplex=b||c)b=g.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=g.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(c){this.rule=c;this.matchRegex=g.toRegExp(c.match);if(this.isComplex=g.complexCaptures(c.captures))c=
g.groupify(this.matchRegex),this.matchRegex=c[0],this.matchOld2New=c[1],this.matchConsuming=c[2]}d.prototype.valueOf=function(){return this.matchRegex};return d}(),_createTypedRule:function(d){return d.match?new this.MatchRule(d):d.begin?new this.BeginEndRule(d):new this.ContainerRule(d)},_resolve:function(d){var c=d;if(d.include){if(d.begin||d.end||d.match)throw Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if(d.charAt(0)==="#"){if(c=this.grammar.repository&&this.grammar.repository[d.substring(1)],
!c)throw Error("Couldn't find included rule "+d+" in grammar repository");}else if(d==="$self")c=this.grammar;else if(d==="$base")throw Error('Include "$base" is not supported');else if(c=this._allGrammars[d],!c)for(var b=0;b<this.externalGrammars.length;b++){var g=this.externalGrammars[b];if(g.scopeName===d){this.preprocess(g);c=this._allGrammars[d]=g;break}}}return c},ContainerNode:function(){function d(c,b){this.parent=c;this.rule=b;this.children=[];this.end=this.start=null}d.prototype.addChild=
function(c){this.children.push(c)};d.prototype.valueOf=function(){var c=this.rule;return"ContainerNode { "+(c.include||"")+" "+(c.name||"")+(c.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(c,b,d){this.parent=c;this.rule=b;this.children=[];this.setStart(d);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?g.getSubstitutedRegex(b.endRegex,d):null}d.prototype.addChild=function(c){this.children.push(c)};d.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};d.prototype.setStart=function(c){this.start=c.index;this.beginMatch=c};d.prototype.setEnd=function(c){c&&typeof c==="object"?(this.endMatch=c,this.end=c.index+c[0].length):(this.endMatch=null,this.end=c)};d.prototype.shiftStart=function(c){this.start+=c;this.beginMatch.index+=c};d.prototype.shiftEnd=function(c){this.end+=c;this.endMatch&&(this.endMatch.index+=c)};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return d}(),push:function(d,c){if(c)for(var b=c.length;b>0;)d.push(c[--b])},exec:function(d,c,b){(c=d.exec(c))&&(c.index+=b);d.lastIndex=0;return c},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,c,b){if(d instanceof this.BeginEndNode){var g=d.rule,d=d.endRegexSubstituted||g.endRegex;return!d?null:this.exec(d,c,b)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(d){var c=d.addedCharCount,b=d.removedCharCount,d=d.start;if(this._tree){var g=this.textView.getModel(),e=g.getCharCount(),g=g.getLineEnd(g.getLineAtOffset(d)-1),a=this.getFirstDamaged(g,g),g=g===-1?0:g,c=a?this.parse(a,!0,g,d,c,b):e;this.textView.redrawRange(g,c)}else this.initialParse()},getFirstDamaged:function(d,c){if(d<0)return this._tree;for(var b=[this._tree],g=null;b.length;){var e=b.pop();if(!e.parent||this.isDamaged(e,d,c)){e instanceof this.BeginEndNode&&(g=
e);for(var a=0;a<e.children.length;a++)b.push(e.children[a])}}return g||this._tree},isDamaged:function(d,c,b){return d.start<=b&&d.end>c},parse:function(d,c,b,g,e,a){var f=this.textView.getModel(),h=f.getLineStart(f.getLineCount()-1),i=f.getCharCount(),k=this.getInitialExpected(d,b),q=-1;if(c)d.repaired=!0,d.endNeedsUpdate=!0,q=(q=d.children[d.children.length-1])?f.getLineEnd(f.getLineAtOffset(q.end+(e-a))):-1,g=f.getLineEnd(f.getLineAtOffset(g+a)),q=Math.max(q,g);for(var q=q===-1?i:q,g=k,s=d,p=!1,
r=b,t=-1;s&&(!c||r<q);){var o=this.getNextMatch(f,s,r);o||(r=r>=h?i:f.getLineStart(f.getLineAtOffset(r)+1));var v=o&&o.match,x=o&&o.rule,u=o&&o.isEnd;if(o&&o.isSub){if(r=this.afterMatch(v),x instanceof this.BeginEndRule)p=!0,c&&x===g.rule&&s===g.parent?(s=g,s.setStart(v),s.repaired=!0,s.endNeedsUpdate=!0,g=this.getNextExpected(g,"begin")):(c&&(this.prune(s,g),c=!1),v=new this.BeginEndNode(s,x,v),s.addChild(v),s=v)}else if(u||r===i){if(s instanceof this.BeginEndNode)v?(p=!0,t=Math.max(t,s.end),s.setEnd(v),
r=this.afterMatch(v),c&&s===g&&s.parent===g.parent?(s.repaired=!0,delete s.endNeedsUpdate,g=this.getNextExpected(g,"end")):c&&(this.prune(s,g),c=!1)):(s.setEnd(i),delete s.endNeedsUpdate);s=s.parent}c&&r>=q&&!p&&(this.prune(d,k),c=!1)}this.removeUnrepairedChildren(d,c,b);this.cleanup(c,d,b,q,i,e,a);return c?Math.max(t,r):r},removeUnrepairedChildren:function(d,c,b){if(c){for(var c=d.children,g=-1,e=0;e<c.length;e++){var a=c[e];if(!a.repaired&&this.isDamaged(a,b,Number.MAX_VALUE)){g=e;break}}if(g!==
-1)d.children.length=g}},cleanup:function(d,c,b,g,e,a,f){if(d){d=a-f;e=this.getIntersecting(g-d+1,e);c=this.getIntersecting(b,g);for(b=0;b<e.length;b++)g=e[b],!g.repaired&&g instanceof this.BeginEndNode&&(g.shiftEnd(d),g.shiftStart(d));for(b=0;b<c.length;b++)g=c[b],g.repaired&&g.endNeedsUpdate&&g.shiftEnd(d),delete g.endNeedsUpdate,delete g.repaired}else{c=this.getIntersecting(b,g);for(b=0;b<c.length;b++)delete c[b].repaired}},getNextMatch:function(d,c,b,g){var e=d.getLineAtOffset(b),e=d.getLineEnd(e),
a=d.getText(b,e),f=[],h=[],d=[],e=[];for(this.push(f,c.rule.subrules);f.length;){var i=f.length?f.pop():null,i=i&&i._resolvedRule._typedRule;if(i instanceof this.ContainerRule&&h.indexOf(i)===-1)h.push(i),this.push(f,i.subrules);else if(!i||!g||i.matchRegex){var k=i&&this.exec(i.matchRegex||i.beginRegex,a,b);k&&(d.push(k),e.push(i))}}f=Number.MAX_VALUE;h=-1;for(i=0;i<d.length;i++)if(k=d[i],k.index<f)f=k.index,h=i;if(!g&&(b=this.getEndMatch(c,a,b)))if(g=c.rule.applyEndPatternLast,h===-1||b.index<f||
!g&&b.index===f)return{isEnd:!0,rule:c.rule,match:b};return h===-1?null:{isSub:!0,rule:e[h],match:d[h]}},getInitialExpected:function(d,c){var b,g;if(d===this._tree)for(b=0;b<d.children.length;b++){if(g=d.children[b],g.start>=c)return g}else if(d instanceof this.BeginEndNode&&d.endMatch){var e=d.endMatch.index;for(b=0;b<d.children.length;b++)if(g=d.children[b],g.start>=c)break;if(g&&g.start<e)return g}return d},getNextExpected:function(d,c){if(c==="begin"){var b=d.children[0];return b?b:d}else if(c===
"end"&&(b=d.parent)){var g=b.children[b.children.indexOf(d)+1];return g?g:b}return null},prune:function(d,c){if(c.parent===d)d.children.length=c.getIndexInParent();else if(d instanceof this.BeginEndNode)d.endMatch=null,d.end=null;if(d.parent)d.parent.children.length=d.getIndexInParent()+1},onLineStyle:function(d){this._tree||this.initialParse();var c=d.lineStart,b=this.textView.getModel(),g=b.getLineEnd(d.lineIndex),e=b.getLineEnd(b.getLineAtOffset(c)-1),e=this.getFirstDamaged(e,e),c=this.getLineScope(b,
e,c,g);d.ranges=this.toStyleRanges(c);d.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(d,c,b,g){for(var e=b,a=this.getInitialExpected(c,b),f=[],h=[];c&&e<g;){var i=this.getNextMatch(d,c,e);if(!i)break;var k=i&&i.match,q=i&&i.rule,s=i&&i.isSub,i=i&&i.isEnd;k.index!==e&&h.push({start:e,end:k.index,node:c});if(s)e=this.afterMatch(k),q instanceof this.BeginEndRule?(this.addBeginScope(f,k,q),c=a,a=this.getNextExpected(a,"begin")):this.addMatchScope(f,k,q);else if(i)e=this.afterMatch(k),
this.addEndScope(f,k,q),a=this.getNextExpected(a,"end"),c=c.parent}e<g&&h.push({start:e,end:g,node:c});d=this.getInheritedLineScope(h,b,g);return f.concat(d)},getInheritedLineScope:function(d){for(var c=[],b=0;b<d.length;b++)for(var g=d[b],e=g.node;e;){var a=e.rule.rule,f=a.name;if(a=a.contentName||f){this.addScopeRange(c,g.start,g.end,a);break}e=e.parent}return c},addBeginScope:function(d,c,b){var g=b.rule;this.addCapturesScope(d,c,g.beginCaptures||g.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},
addEndScope:function(d,c,b){var g=b.rule;this.addCapturesScope(d,c,g.endCaptures||g.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(d,c,b){var g=b.rule,e=g.name;(g=g.captures)?this.addCapturesScope(d,c,g,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(d,c,e)},addScope:function(d,c,b){b&&d.push({start:c.index,end:this.afterMatch(c),scope:b})},addScopeRange:function(d,c,b,g){g&&d.push({start:c,end:b,scope:g})},addCapturesScope:function(d,c,b,g,e,a){if(b)if(g){for(var g=
{1:0},f=0,h=1;c[h]!==void 0;h++)a[h]!==void 0&&(f+=c[h].length),c[h+1]!==void 0&&(g[h+1]=f);a=c.index;for(f=1;b[f];f++){var h=b[f].name,i=e[f],k=a+g[i];typeof c[i]!=="undefined"&&this.addScopeRange(d,k,k+c[i].length,h)}}else this.addScope(d,c,b[0]&&b[0].name)},getIntersecting:function(d,c){for(var b=[],g=this._tree?[this._tree]:[];g.length;){var e=g.pop(),a=!1;e instanceof this.ContainerNode?a=!0:this.isDamaged(e,d,c)&&(a=!0,b.push(e));if(a)for(var a=e.children.length,f=0;f<a;f++)g.push(e.children[f])}return b.reverse()},
toStyleRanges:function(d){for(var c=[],b=0;b<d.length;b++){var g=d[b],e=this._styles[g.scope];if(!e)throw Error("styles not found for "+g.scope);e=e.join(" ");c.push({start:g.start,end:g.end,style:{styleClass:e}})}return c}};return{RegexUtil:g,TextMateStyler:i}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(h,k){function i(b){return b.getProperty("objectClass").indexOf(d)!==-1&&b.getProperty("type")==="highlighter"}function g(b,c,d){this.initialize(b,c,d);this.lineStyles=[]}var d="orion.edit.highlighter",c=d+" 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"}});
g.prototype={initialize:function(b,c,e){this.textView=b;this.serviceRegistry=c;this.annotationModel=e;this.services=[];var a=this;this.listener={onModelChanging:function(b){a.onModelChanging(b)},onModelChanged:function(b){a.onModelChanged(b)},onDestroy:function(b){a.onDestroy(b)},onLineStyle:function(b){a.onLineStyle(b)},onStyleReady:function(b){a.onStyleReady(b)},onServiceAdded:function(b){a.onServiceAdded(b.serviceReference,a.serviceRegistry.getService(b.serviceReference))},onServiceRemoved:function(b){a.onServiceRemoved(b.serviceReference,
a.serviceRegistry.getService(b.serviceReference))}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);c.addEventListener("registered",this.listener.onServiceAdded);c.addEventListener("unregistering",this.listener.onServiceRemoved);b=c.getServiceReferences(d);for(e=0;e<b.length;e++){var f=b[e];i(f)&&this.addServiceListener(c.getService(f))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(b){this.startLine=this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var c=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[c,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var c=b.lineStyles||b.style,b=Number.MAX_VALUE,d=-1,a=this.textView.getModel(),f;for(f in c)c.hasOwnProperty(f)&&(this.lineStyles[f]=c[f],b=Math.min(b,f),d=Math.max(d,f));b=Math.max(b,0);d=Math.min(d,a.getLineCount());if(c=this.annotationModel){for(var g=c.getAnnotations(a.getLineStart(b),a.getLineEnd(d)),h=[];g.hasNext();){var i=g.next();i.type==="orion.annotation.highlightError"&&h.push(i)}g=[];for(i=b;i<=d;i++){f=i;var q=this.lineStyles[f],q=q&&q.errors;f=a.getLineStart(f);
if(q)for(var s=0;s<q.length;s++){var p=q[s];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",p.start+f,p.end+f))}}c.replaceAnnotations(h,g)}this.textView.redrawLines(b,d+1)},onLineStyle:function(b){function c(a,b){for(var d=a.length,e=[],g=0;g<d;g++){var h=a[g];e.push({start:h.start+b,end:h.end+b,style:h.style})}return e}var d=this.lineStyles[b.lineIndex];if(d)if(d.ranges)b.ranges=c(d.ranges,b.lineStart);else if(d.style)b.style=d.style},_getEmptyStyle:function(b){for(var c=
[],d=0;d<b;d++)c.push(null);return c},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var c=this.services[b];if(c.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}},onServiceAdded:function(b,c){i(b)&&this.addServiceListener(c)},onServiceRemoved:function(b,
c){this.services.indexOf(c)!==-1&&this.removeServiceListener(c)},addServiceListener:function(b){if(typeof b.addEventListener==="function"){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){var 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)}}else typeof console!==
"undefined"&&console.log(Error(c))},removeServiceListener:function(b){typeof b.removeEventListener==="function"?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),b!==-1&&this.services.splice(b,1)):typeof console!=="undefined"&&console.log(Error(c))}};return g});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(h,k,i,g){function d(b,c,d,a,f,l,n){function m(a,b){var f=a.getProperty("contentType"),h=a.getProperty("fileTypes");if(f)return c.isSomeExtensionOf(d,f).then(function(b){return b?a:null});else if(b&&h&&h.indexOf(b)!==-1)return f=new g,f.resolve(a),f;return null}var q=function(b){var c=null;switch(b&&b.id){case "application/javascript":case "application/json":c=
new h.TextStyler(a,"js",f);break;case "text/x-java-source":c=new h.TextStyler(a,"java",f);break;case "text/css":c=new h.TextStyler(a,"css",f)}return c}(d);if(q)return l=new g,l.resolve(q),l;for(var q=l&&l.split(".").pop().toLowerCase(),l=b.getServiceReferences("orion.edit.highlighter"),s=[],p=[],r=0;r<l.length;r++){var t=l[r];t.getProperty("type")==="grammar"&&s.push(t.getProperty("grammar"));(t=m(t,q))&&p.push(t)}return g.all(p,function(a){return{_error:a}}).then(function(c){for(var g,h=c.length-
1;h>=0;h--){var j=c[h];if(j&&!j._error&&(n||j.getProperty("type")!=="highlighter")){g=j;break}}var l;if(g)if(c=g.getProperty("type"),c==="highlighter")l=new i(a,b,f),l.setContentType(d);else if(c==="grammar"||typeof c==="undefined")g=g.getProperty("grammar"),l=new k.TextMateStyler(a,g,s);return l})}function c(b){this.serviceRegistry=b;this.styler=null}c.prototype={setup:function(b,c,e,a,f){f=typeof f==="undefined"?!0:f;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var g=
this;return d(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),b,c,e,a,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:d,SyntaxHighlighter:c}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(h,k,i,g,d){function c(b,c,d,a){k.Find.call(this,b,d,a);this._commandService=c}c.prototype=new k.Find;g.mixin(c.prototype,{getFindString:function(){var b=document.getElementById("localSearchFindWith");return!b?k.Find.prototype.getFindString.call(this):b.value},getReplaceString:function(){var b=document.getElementById("localSearchReplaceWith");
return!b?k.Find.prototype.getReplaceString(this):b.value},hide:function(){var b=this.isVisible();k.Find.prototype.hide.call(this);b&&this._commandService.closeParameterCollector()},show:function(b){k.Find.prototype.show.call(this,b);var c=b.findString,b=b.replaceString,d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));if(c)d.value=c;if(b)document.getElementById("localSearchReplaceWith").value=b;window.setTimeout(function(){d.select();
d.focus()},10)},_createActionTable:function(){var b=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){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(a){return b._handleInput(a)};d.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(d);b._createButton("Next",c,function(){b.find(!0)});b._createButton("Previous",c,function(){b.find(!1)});
var a=b._editor.getTextView().getOptions("readonly");if(!a){var f=document.createElement("input");f.type="text";f.name=h["ReplaceWith:"];f.className="parameterInput";f.id="localSearchReplaceWith";f.placeholder=h["Replace With"];f.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(f);b._createButton(h.Replace,c,function(){b.replace()});b._createButton(h["Replace All"],c,function(){b.replaceAll()})}f=document.createElement("div");c.appendChild(f);f.classList.add("findOptionsDiv");var g=
i.createDropdownMenu(f,h.Options,null,"dismissButton",null,!0);g.menuButton.classList.add("parameterInlineButton");i.createCheckedMenuItem(g.menu,h["Show all"],b._showAll,function(a){b.setOptions({showAll:a.target.checked});g.dropdown.close(!0)});i.createCheckedMenuItem(g.menu,h["Case sensitive"],!b._caseInsensitive,function(a){b.setOptions({caseInsensitive:!a.target.checked});g.dropdown.close(!0);b.find(!0)});i.createCheckedMenuItem(g.menu,h["Wrap search"],b._wrap,function(a){b.setOptions({wrap:a.target.checked});
g.dropdown.close(!0)});i.createCheckedMenuItem(g.menu,h["Incremental search"],b._incremental,function(a){b.setOptions({incremental:a.target.checked});g.dropdown.close(!0)});i.createCheckedMenuItem(g.menu,h["Whole Word"],b._wholeWord,function(a){b.setOptions({wholeWord:a.target.checked});g.dropdown.close(!0);b.find(!0)});i.createCheckedMenuItem(g.menu,h["Regular expression"],b._regex,function(a){b.setOptions({regex:a.target.checked});g.dropdown.close(!0);b.find(!0)});a||i.createCheckedMenuItem(g.menu,
h["Find after replace"],b._findAfterReplace,function(a){b.setOptions({findAfterReplace:a.target.checked});g.dropdown.close(!0)});return d},function(){b.hide()})},_createButton:function(b,c,e){var a=document.createElement("button");a.addEventListener("click",e.bind(this),!1);var f=this;a.addEventListener("keydown",function(a){a.keyCode===d.KEY.ESCAPE&&f.hide()});a.appendChild(document.createTextNode(b));a.className="dismissButton parameterInlineButton";c.appendChild(a)},_handleInput:function(){this._incremental&&
this.find(!0,null,!0);return!0},_handleKeyDown:function(b){var c=(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&!b.shiftKey;if(c&&b.keyCode===70)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,!1;if((this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&b.keyCode===75||b.keyCode===13)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,b.keyCode===13?this.find(this._reverse?b.shiftKey:!b.shiftKey):this.find(!b.shiftKey),!1;if(c&&b.keyCode===82)return b.stopPropagation&&b.stopPropagation(),
b.cancelBubble=!0,this.replace(),!1;return b.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:c}});
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 i={root:k};Object.keys(h).forEach(function(g){typeof i[g]==="undefined"&&(i[g]=h[g])});return i});
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,i,g,d,c,b,j,e,a,f,l,n,m,q,s,p){function r(a,b,c,d,e,f,g,h,i,j){this.serviceRegistry=a;this.commandService=
b;this.fileClient=c;this.inputManager=d;this.toolbarId=e;this.pageNavId=g;this.isReadOnly=f;this._localSearcher=h;this._searcher=i;this.editorSettings=j}var a={},t=null;r.prototype={generateEditorCommands:function(a){this._generateSearchFilesCommand(a);this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this.isReadOnly||this._generateEditCommands(a)},_generateUndoStackCommands:function(a){this.commandService.addCommand(new b.Command({name:h.Undo,
id:"orion.undo",callback:function(){a.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new b.Command({name:h.Redo,id:"orion.redo",callback:function(){a.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,a.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(a){var c=
this;if(c._searcher){var d=!1,e=new b.Command({name:h["Search Files"],tooltip:h["Search Files"],id:"orion.searchFiles",callback:function(){a.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new j.KeyBinding("h",!0));a.getTextView().setKeyBinding(new j.KeyBinding("h",!0),"searchFiles");a.getTextView().setAction("searchFiles",function(){if(!d){var b=a.getSelection(),b=a.getText(b.start,
b.end),e=c.serviceRegistry,f=e.getService("orion.page.progress"),e=e.getService("orion.core.favorite"),j=new g.OpenResourceDialog({searcher:c._searcher,progress:f,favoriteService:e,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:h["Search Files"],message:h["Enter search term:"],initialText:b,onHide:function(){d=!1;a&&a.getTextView()&&a.getTextView().focus()}});window.setTimeout(function(){d=!0;j.show(i.node(c.toolbarId))},0);return!0}},e)}},_generateSaveCommand:function(a){var c=this;
a.getTextView().setKeyBinding(new j.KeyBinding("s",!0),"save");a.getTextView().setAction("save",function(){if(c.inputManager.save)c.inputManager.save();else if(c.inputManager.onSave){var b=a.getText();c.inputManager.onSave(c.inputManager.getInput(),b,function(){a.setInput(c.inputManager.getInput(),null,b,!0);c.inputManager.afterSave&&c.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:h.Save});this.commandService.addCommand(new b.Command({name:h.Save,tooltip:h["Save this file"],id:"orion.save",
visibleWhen:function(){return!c.editorSettings||!c.editorSettings().autoSaveEnabled},callback:function(){a.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new j.KeyBinding("s",!0))},_generateGotoLineCommnand:function(a){var c=this,d=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new e.CommandParameter("line",
"number","Line:",b.toString())]}),d=new b.Command({name:h["Go to Line"],tooltip:h["Go to specified line number"],id:"orion.gotoLine",parameters:d,callback:function(b){var c=a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(h["Go to line:"],b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new j.KeyBinding("l",!p.isMac,!1,!1,p.isMac),new e.URLBinding("gotoLine","line"));a.getTextView().setAction("gotoLine",function(b){if(b)return a.onGotoLine(b.line-1,0,void 0,b.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},d)},_generateFindCommnand:function(a){var c=this,d=new e.ParametersDescription([new e.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var b=a.getSelection(),c="";b.end>b.start&&(c=a.getModel().getText(b.start,b.end));return[new e.CommandParameter("find",
"text","Find:",c)]}),d=new b.Command({name:h.Find,tooltip:h.Find,id:"orion.editor.find",parameters:d,callback:function(b){if(c._localSearcher){var d="",e=null,f=a.getSelection();f.end>f.start?d=a.getModel().getText(f.start,f.end):b.parameters&&b.parameters.valueFor("find")&&(d=b.parameters.valueFor("find"),e=q.matchResourceParameters(),m.convertFindURLBinding(e));if(e){b={regex:e.regEx,caseInsensitive:!e.caseSensitive};if(e.atLine)b.start=a.getModel().getLineStart(e.atLine-1);c._localSearcher.show({findString:d,
replaceString:e.replaceWith});c._localSearcher.find(!0,b)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new j.KeyBinding("f",!0),new e.URLBinding("find","find"));a.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find");return!0},d)},_generateEditCommands:function(a){function e(a){var b=
new j.KeyBinding;j.KeyBinding.apply(b,a);return b}function g(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=m.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var m=this,n=this.serviceRegistry.getServiceReferences("orion.edit.command"),p=this.inputManager,q=this.serviceRegistry.getService("orion.page.progress"),r=function(d,e,f){f.callback=function(){a=this;var b=a.getSelection(),f=a.getModel(),i=f.getText(),j=function(c){c&&c.text?(a.setText(c.text),
c.selection&&(a.setSelection(c.selection.start,c.selection.end),a.getTextView().focus())):typeof c==="string"&&(a.setText(c,b.start,b.end),a.setSelection(b.start,b.start+c.length),a.getTextView().focus())};q.showWhile(e.run(f.getText(b.start,b.end),i,b,p.getInput()),k.formatMessage(h["Running {0}"],d.name)).then(function(a){if(a&&a.uriTemplate){var b=new c(a.uriTemplate),e=p.getFileMetadata();e.OrionHome=e.OrionHome||s.getOrionHome();var b=window.decodeURIComponent(b.expand(e)),f=document.createElement("iframe");
f.id=d.id;f.name=d.id;f.type="text/html";f.sandbox="allow-scripts allow-same-origin";f.frameborder=1;f.src=b;f.className="delegatedUI";if(a.width)f.style.width=a.width;if(a.height)f.style.height=a.height;f.style.visibility="hidden";window.document.body.appendChild(f);f.style.left=(window.innerWidth-parseInt(f.clientWidth,10))/2+"px";f.style.top=(window.innerHeight-parseInt(f.clientHeight,10))/2+"px";f.style.visibility="";window.addEventListener("message",function F(a){if(a.source===f.contentWindow&&
typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===d.id)){if(!a.cancelled)if(a.result)j(a.result);else if(a.Status||a.status)g(a.Status||a.status);window.removeEventListener("message",F,!1);window.document.body.removeChild(f)}},!1)}else a.Status||a.status?g(a.Status||a.status):j(a)});return!0};f.callback=f.callback.bind(a);return new b.Command(f)};d.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 b=[],c=100;n.forEach(function(d){for(var g=m.serviceRegistry.getService(d),h={},i=d.getPropertyKeys(),j=0;j<i.length;j++)h[i[j]]=d.getProperty(i[j]);h.forceSingleItem=!0;d=f._createCommandOptions(h,d,m.serviceRegistry,t,!1,function(){return p.getFileMetadata()});b.push(d);d.then(function(b){b=r(h,g,b);m.commandService.addCommand(b);m.commandService.registerCommandContribution(m.toolbarId,
b.id,c);if(h.key){var d=a.getTextView();d.setKeyBinding(e(h.key),b.id);d.setAction(b.id,b.callback,b)}});c++});d.all(b,function(a){return{_error:a}}).then(function(){var b;if(b=p.getFileMetadata()){var c=i.node("pageActions");c&&(m.commandService.destroy(c),m.commandService.renderCommands(c.id,c,b,a,"button"));if(c=i.node("pageNavigationActions"))m.commandService.destroy(c),m.commandService.renderCommands(c.id,c,a,a,"button")}})})}};a.EditorCommandFactory=r;return a});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function h(h,i,g){this.serviceRegistry=h;this.editor=i;this.contentType=g;this.contentTypeService=h.getService("orion.core.contenttypes");this.serviceReferences={};var d=this;this.listener={onServiceAdded:function(c){d._onServiceAdded(c.serviceReference)},onServiceRemoved:function(c){d._onServiceRemoved(c.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"),i=0;i<h.length;i++)this._wireServiceReference(h[i])},_wireServiceReference:function(h){var i=h.getProperty("contentType");if(typeof i!==void 0&&i!==null){var g=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
i).then(function(d){d&&g._wireService(h,g.serviceRegistry.getService(h))})}},_wireService:function(h,i){var g=h.getProperty("types"),d=this.editor.getTextView();if(g){for(var c=0;c<g.length;c++){var b=g[c],j=i["on"+b];j&&this._wireServiceMethod(h,i,j,d,b)}this._initService(i,d)}},_wireServiceMethod:function(h,i,g,d,c){i=function(b){g(b).then()};h=h.getProperty("service.id");this.serviceReferences[h]=this.serviceReferences[h]||[];this.serviceReferences[h].push([d,c,i]);d.addEventListener(c,i)},_onServiceRemoved:function(h){var h=
h.getProperty("service.id"),i=this.serviceReferences[h];if(i){for(var g=0;g<i.length;g++){var d=i[g];d[0].removeEventListener(d[1],d[2])}delete this.serviceReferences[h]}},_onServiceAdded:function(h){h.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(h)},_initService:function(h,i){var g=h.onModelChanging;if(typeof g==="function"){var d=i.getModel(),c=d.getText(),d={type:"Changing",text:c,start:0,removedCharCount:0,addedCharCount:c.length,removedLineCount:0,addedLineCount:d.getLineCount()};
g.call(h,d)}}};return{Dispatcher:h}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(h){function k(c){return(c=c.getProperty("contentType"))?Array.isArray(c)?c:[c]:null}function i(c){var b=this.contentTypesMap={},i=new h(c,g),e=new h(c,d),a=this.notifySyntaxModelListeners.bind(this);i.addingService=function(a){var d=c.getService(a);(a=k(a))&&a.forEach(function(a){var c=b[a];c?c.push(d):b[a]=[d]})};i.removedService=function(a,c){var d=k(a);d&&d.forEach(function(a){var a=b.hasOwnProperty(a.id)?b[a.id]:null,d=a.indexOf(c);
d!==-1&&a.splice(d,1)})};e.addingService=function(b){var e=c.getService(b);k(b)&&(typeof e.addEventListener!=="function"?console.log(Error("A "+d+' service must provide an "addEventListener" method')):e.addEventListener("orion.edit.syntaxmodel.modelReady",a))};e.removedService=function(b,c){c&&typeof c.removeEventListener==="function"&&c.removeEventListener("orion.edit.syntaxmodel.modelReady",a)};i.open();e.open()}var g="orion.edit.syntaxmodel.listener",d="orion.edit.syntaxmodel.provider";i.prototype.notifySyntaxModelListeners=
function(c){var b=c.contentType,d=c.syntaxModel;typeof b!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(c=this.contentTypesMap.hasOwnProperty(b)?this.contentTypesMap[b]:null)&&c.forEach(function(b){b.setSyntaxModel(d)})};return i});
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,i,g,d,c,b,j,e,a){function f(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],
b,!0);g.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 c=b.responseText;if(c)try{b=JSON.parse(c)}catch(d){b={Severity:"Error",Message:c}}}a.setProgressResult(b)}else window.console.log(b)}function n(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 e(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;g.attach(this)}f.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()}};d.mixin(n.prototype,{load:function(){var a=this.getInput();if(a){var b=this.fileClient,c=this.progressService,d=this.getEditor();if(this._fileMetadata)c.progress(b.read(a,!0),k.formatMessage(h["Reading metedata of"],a)).then(function(e){if(this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!d.isDirty()||window.confirm(h.loadOutOfSync))&&c.progress(b.read(a),k.formatMessage(h.Reading,a)).then(function(b){d.setInput(a,
null,b)})}.bind(this));else{var e=window.setTimeout(function(){d.reportStatus(k.formatMessage(h.Fetching,a))},800);(new i.all([c.progress(b.read(a),k.formatMessage(h.Reading,a)),c.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 c=b[0],b=b[1];if(c._error||b._error){var f=this.serviceRegistry.getService("orion.page.message");l(f,c._error||b._error);this._setNoInput()}else this._setInputContents(this._parsedLocation,
a,c,b);d.reportStatus("")}.bind(this))}}},processParameters:function(a){for(var b=this.getEditor(),c=["start","end","line","offset","length"],d=0;d<c.length;d++){var e=c[d];a[e]&&(a[e]=parseInt(a[e],10))}b.showSelection(a.start,a.end,a.line,a.offset,a.length)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},save:function(){function a(b){j.getFileMetadata().ETag=
b.ETag;c.setInput(d,null,e,!0);c.reportStatus("");j.afterSave&&j.afterSave();j._saving=!1}function b(a){c.reportStatus("");l(i,a);j._saving=!1;j._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()){this._saving=!0;this._errorSaving=!1;var d=this.getInput();c.reportStatus(h["Saving..."]);var e=c.getText(),f={ETag:this.getFileMetadata().ETag},f=this.fileClient.write(d,e,f),g=this.progressService,i=this.serviceRegistry.getService("orion.page.message");g&&(f=g.progress(f,k.formatMessage(h["Saving file {0}"],
d)));var j=this;f.then(a,function(c){c.status===412?window.confirm(h["Resource is out of sync with the server. Do you want to save it anyway?"])?(c=j.fileClient.write(d,e),g&&(c=g.progress(c,k.formatMessage(h["Saving file {0}"],d))),c.then(a,b)):j._saving=!1:b(c)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;if(this._idle)this._idle.setTimeout(a);else{var b=this.getEditor(),c=b.getTextView(),d=function(){b.removeEventListener("TextViewInstalled",
d);var c={document:b.getTextView().getOptions("parent").ownerDocument,timeout:a};this._idle=new f(c);this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this));this._idle.setTimeout(a)}.bind(this);c?d():b.addEventListener("TextViewInstalled",d)}},setDirty:function(a){c.setDirtyIndicator(a)},setInput:function(b){if(!this._ignoreInput){if(!b)b=window.location.hash;if(typeof b==="string"){var c=this.getEditor();b&&b[0]!=="#"&&(b="#"+b);var d=a.matchResourceParameters(b);
if(c.isDirty()&&(c=this._location,a.matchResourceParameters(c).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=c;return}this._location=b;this._parsedLocation=d;this._ignoreInput=!0;this.selection.setSelections(b);this._ignoreInput=!1;(b=d.resource)?b===this._input?this.processParameters(d):(this._input=b,this._fileMetadata=null,this.load()):this._setNoInput()}}},_setNoInput:function(){this._input=
this._title=this._contentType=null;this.editor.uninstallTextView();this.dispatchEvent({type:"InputChanged",input:null})},_setInputContents:function(a,c,d,e){var f;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this._contentType=this.contentTypeService.getFileContentType(e),f=e.Name):(this._fileMetadata=null,this.setTitle(c),this._contentType=this.contentTypeService.getFilenameContentType(this.getTitle()),f=this.getTitle());var g=this.getEditor();g.getTextView()||(g.installTextView(),
g.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)));this.dispatchEvent({type:"InputChanged",input:a,name:f,metadata:e,contents:d});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),c,!0).then(function(){var e=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(e&&e.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new b.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(c,null,d);h.processParameters(a)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:n}});
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,i,g,d,c,b,j,e,a,f,l,n,m,q,s,p){function r(a){this._syntaxHighlither=
new j.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new c.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return i.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&d.length===2&&d[0]&&d[1]){var e=d[0],d=d[1];return(new i).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:e},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}else return e=
a?c._resolveFileName(a):"",d=b?c._resolveFileName(b):"",(new i).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:b,Name:d,Type:null},diffContent:c._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,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(b){d._diffContent=d._hasConflicts?b.split("diff --git")[1]:b;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();r.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function c(d,f,i,j){this._registry=d;this._commandService=f;this._fileClient=new e.FileClient(d);this._fileClient=new e.FileClient(d);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 b.toggleableCompareView(i.type==="inline"?"inline":"twoWay",j):i.type==="inline"?new b.inlineCompareView(j):new b.TwoWayCompareView(j);this._compareView.getWidget().setOptions({extCmdHolder:this});
j.highlighters||this._compareView.getWidget().setOptions({highlighters:[new r(d),new r(d)]});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 s.InputManager({serviceRegistry:d,fileClient:k._fileClient,progressService:k._progress});q.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(b){a.setDirtyIndicator(b)},
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=g.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(b,c){var e;if(c)e=c.Name;a.setPageTarget({task:h.Compare,name:e,target:c,serviceRegistry:d,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});b.charAt(0)==="*"?(a.setDirtyIndicator(!0),b.substring(1)):a.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,c,d){b=new n.TextSearcher(a,k._commandService,c);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);(new p.KeyBindingsFactory).createKeyBindings(a,
c,d,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))}}c.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=d.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 d.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 f.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)}}),c=new f.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(c);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 i.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 c=a._compareView.getWidget().options;c.oldFile.readonly=!0;if(a.options.readonly)c.newFile.readonly=!0;return a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.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(c.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new i).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return c}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages","orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib"],function(h,k,i,g){function d(b){for(var a=0;a<j.length;a++)if(b.type===j[a])return!0;return!1}function c(c){for(var a=0;a<b.length;a++)if(c.type===b[a])return!0;return!1}var b=["Missing","Modified","Untracked","Conflicting"],j=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:d,isUnstaged:c,isChange:function(b){return d(b)||
c(b)},hasStagedChanges:function(b){for(var a=0;a<j.length;a++)if(b[j[a]].length>0)return!0;return!1},hasUnstagedChanges:function(c){for(var a=0;a<b.length;a++)if(c[b[a]].length>0)return!0;return!1},createCompareWidget:function(b,a,c,d,h,j,q,s,p){var r=new i.DefaultDiffProvider(b),j=new k.CompareCommandFactory({commandService:a,commandSpanId:j,gridRenderer:s});(new i.ResourceComparer(b,a,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:d,diffProvider:r,resource:c,compareTo:p,editableInComparePage:q},
{parentDivId:h,commandProvider:j})).start().then(function(a){var b=420;a<b&&(b=a);g.node(h).style.height=b+"px"})}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(h){function k(h){this._prefix="/git/credentials";this._preferenceService=h.getService("orion.core.preference")}k.prototype={put:function(i,g){var d={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(g!==void 0){if(g.gitSshUsername!==void 0&&g.gitSshUsername!==null)d.gitSshUsername=g.gitSshUsername;if(g.gitSshPassword!==void 0&&g.gitSshPassword!==null)d.gitSshPassword=g.gitSshPassword;if(g.gitPrivateKey!==void 0&&
g.gitPrivateKey!==null)d.gitPrivateKey=g.gitPrivateKey;if(g.gitPassphrase!==void 0&&g.gitPassphrase!==null)d.gitPassphrase=g.gitPassphrase}var c=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var g=b.get("settings");g===void 0?c.reject():g.enabled?(b.put(i,d),c.resolve()):c.reject()});return c},get:function(i){var g={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},d=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(c){var b=
c.get("settings");b===void 0?d.reject():b.enabled?(c=c.get(i),c!==void 0?d.resolve(c):d.resolve(g)):d.reject()});return d},isEnabled:function(){var i=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(g){g=g.get("settings");g===void 0?i.resolve(!1):i.resolve(g.enabled)});return i},enable:function(){var i=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(g){g.put("settings",{enabled:!0});i.resolve()});return i},disable:function(){var i=new h;this._preferenceService.getPreferences(this._prefix,
2).then(function(g){g.put("settings",{enabled:!1});i.resolve()});return i},remove:function(i){var g=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(d){d.remove(i);g.resolve()});return g},getRepositories:function(){var i=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(g){for(var d=[],g=g.keys(),c=0;c<g.length;++c)g[c]!=="settings"&&d.push(g[c]);i.resolve(d)});return i}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(h){function k(h){this._prefix="/git/config";this._preferenceService=h.getService("orion.core.preference")}k.prototype={getConfig:function(){var i=new h;this._preferenceService.getPreferences(this._prefix).then(function(g){g=g.get("userInfo");i.resolve(g)});return i},setConfig:function(i){var g=new h;this._preferenceService.getPreferences(this._prefix).then(function(d){d.put("userInfo",i);g.resolve()});return g}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function i(g){this._init(g)}i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div id="header"></div>';i.prototype._init=function(g){var d=this;this.title="Git Push";this.modal=!0;this.messages=h;this.location=g.location;this.dialog2=g.dialog;this.func=g.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d.dialog2.show()},text:"More"});this.buttons.push({callback:function(){d.destroy();d.func()},
text:"OK"});this._initialize()};i.prototype._bindToDom=function(){var g=this.$header;g.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));g.appendChild(document.createElement("br"));g.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};i.prototype.constructor=i;return{ConfirmPushDialog:i}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(h,k,i,g){function d(b,c){this.explorer=c;this._init(b)}function c(b){this._init(b)}var b=function(){function b(c,a,d,g){this.gitClient=c;this.rootPath=a;this.fetchItems=d;this.root=g?g:null}b.prototype=new i.ExplorerModel;b.prototype.getRoot=function(b){var a=this;this.root?b(this.root):this.fetchItems(this.rootPath).then(function(c){a.root=c;b(c)})};
b.prototype.getIdentity=function(b){b.Location?(b=b.Location,b=b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):b="ROOT";return b};b.prototype.getChildren=function(b,a){b.children=[];if(b.Children){for(var c=0;c<b.Children.length;c++)b.Children[c].parent=b,b.children[c]=b.Children[c];a(b.Children)}else b.BranchLocation&&b.RemoteLocation?(b.children=[{GroupNode:"true",Location:b.BranchLocation,Name:"Branches",parent:b},{GroupNode:"true",Location:b.RemoteLocation,BranchLocation:b.BranchLocation,Name:"Remotes",
parent:b},{GroupNode:"true",Location:b.TagLocation,Name:"Tags",parent:b}],a(b.children)):b.GroupNode?this.gitClient.getGitBranch(b.Location).then(function(c){b.children=c.Children;for(var d=0;d<c.Children.length;d++)c.Children[d].parent=b;a(c.Children)}):b.Type==="Remote"&&this.gitClient.getGitBranch(b.Location).then(function(c){b.children=c.Children;for(var d=0;d<c.Children.length;d++)c.Children[d].parent=b;a(c.Children)})};return b}();d.prototype=new i.SelectionRenderer;d.prototype.constructor=
d;d.prototype.getLabelColumnIndex=function(){return 0};d.prototype.getCellElement=function(b,c,a){var d=document.createElement("td");a.appendChild(d);b=document.createElement("span");b.id=a.id+"navSpan";d.appendChild(b);b.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(a,b);a=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(a=c.Name+h[" [New branch]"]);b.appendChild(document.createTextNode(a))};
c.prototype=new k.Dialog;c.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>';c.prototype._init=function(b){var c=this;this.title=b.title||h["Choose a Folder"];this.modal=!0;this.messages=h;this.func=b.func;this.treeRoot=b.treeRoot;this.gitClient=
b.gitClient;this.hideNewBranch=b.hideNewBranch;this.serviceRegistry=b.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){c.$remoteOk.classList.contains(this.DISABLED)||(c.destroy(),c._execute.bind(c)())},text:"OK",isDefault:!0,id:"remoteOk"})};c.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};c.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
c.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};c.prototype._loadRemoteChildren=function(){this._createTree(new b(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};c.prototype._createTree=function(b){var c=this,a=this.serviceRegistry.getService("orion.remotePrompter.selection");a||(a=new g.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var f=new d({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new i.Explorer(this.serviceRegistry,a,f);f.explorer=this.explorer;this.explorer.createTree("treeContentPane",b);a.addEventListener("selectionChanged",function(a){c.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;c._validate(a.selection)})};c.prototype._validate=function(b){var c=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)};
b?c.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(c.bind(this))};c.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(c){if(b.func)if(c.Type==="RemoteTrackingBranch")b.func(c,c.parent);else{var a=c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),d={};d.parent=c;d.FullName="refs/remotes/"+c.Name+"/"+b.$newBranch.value;d.Name=c.Name+"/"+b.$newBranch.value;
d.Type="RemoteTrackingBranch";d.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(b.$newBranch.value)+"/"+a;b.func(null,c,d)}})};c.prototype.constructor=c;return{RemotePrompterDialog:c}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function i(g){this._init(g)}i.prototype=new k.Dialog;i.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>';i.prototype._init=
function(g){var d=this;this.title=g.title||h["Contribution Review Request"];this.modal=!0;this.messages=h;this.url=g.url;this.func=g.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d.func(d.$reviewerName.value)},text:"Submit"});this._initialize()};i.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};i.prototype.constructor=i;return{ReviewRequestDialog:i}});
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,i,g,d,c,b,j){function e(a,b,c,d,e,g){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!g}function a(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"})}e.prototype=new b.ExplorerModel;e.prototype.getRoot=function(a){a(this.root)};e.prototype.processParent=function(a,b){if(this.excludeFiles||this.excludeFolders){var c=[],d;for(d in b)if(!(b[d].Directory?this.excludeFolders:this.excludeFiles))c.push(b[d]),b[d].parent=a;b=c}else for(c in b)b[c].parent=
a;a.children=b;a.children.sort(function(a,b){var c=a.Directory;if(c!==b.Directory)return c?-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0});return b};e.prototype.getChildren=function(a,b){var c=this;a.children?b(a.children):a.Directory!==void 0&&a.Directory===!1?b([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){b(c.processParent(a,
d))}):b([])};e.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};e.prototype.constructor=e;a.prototype=Object.create(b.Explorer.prototype);a.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 g=d.treeRoot,b=c.ChildrenLocation?
c:this.fileClient.read(c.ContentLocation,!0);i.when(b,function(a){d.dispatchEvent({type:"rootMoved",oldValue:g,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)}};a.prototype._makeDropTarget=function(a,b,e){function i(a,b,e,f,g,j){b=b||"";if(a.isFile)c.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){g(e,a,f,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(d.formatMessage(h["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var k=a.createReader(),l=function(c){k.readEntries(function(d){for(var e=0;e<d.length;e++)i(d[e],b+a.name+"/",c,f,g,j)})},n=f.registry.getService("orion.page.progress");c.isAtRoot(e.Location)?n.progress(j.createProject(e.ChildrenLocation,a.name),"Initializing project "+
a.name).then(function(a){f.loadResourceList(f.treeRoot.Path,!0);n.progress(j.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):n.progress(j.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){b.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(e)this._oldDragLeave&&b.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=
p;b.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";b.classList.add("dragOver");g.stop(a)};if(e)this._oldDragEnter&&b.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=p;b.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";g.stop(a)};if(e&&!this._oldDragOver)b.addEventListener("dragover",p,!1),this._oldDragOver=p;p=function(e){b.classList.remove("dragOver");if(e.dataTransfer.items&&e.dataTransfer.items.length>0)for(var n=0;n<e.dataTransfer.items.length;n++){var o=null;typeof e.dataTransfer.items[n].getAsEntry==="function"?o=e.dataTransfer.items[n].getAsEntry():typeof e.dataTransfer.items[n].webkitGetAsEntry==="function"&&(o=e.dataTransfer.items[n].webkitGetAsEntry());
o&&i(o,null,a,j,k,j.fileClient)}else if(e.dataTransfer.files&&e.dataTransfer.files.length>0)for(n=0;n<e.dataTransfer.files.length;n++)o=e.dataTransfer.files[n],!o.length&&(!o.type||o.type==="")?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:d.formatMessage(h["Did not drop ${0}.  Folder drop is not supported in this browser."],o.name)}):c.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,o,j,o.name.indexOf(".zip")===o.name.length-4&&window.confirm(d.formatMessage(h["Unzip ${0}?"],o.name)));g.stop(e)};if(e)this._oldDrop&&b.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=p;b.addEventListener("drop",p,!1)}};a.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 i).resolve(d)})};a.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};a.prototype.getNameNode=function(a){if(a=this.model.getId(a))return g.node(a+"NameLink")};a.prototype.scopeUp=function(){};a.prototype.loadResourceList=function(a,b,d){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=c.makeRelative(a);if(!b&&a===
this._lastPath)return(new i).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||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 i).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new i).reject(a)}):(new i).resolve(e.treeRoot)};a.prototype.load=function(a,b,c){var d=
g.node(this.parentId),j=g.node("progress");if(!j)j=document.createElement("div"),j.id="progress",g.empty(d),d.appendChild(j);g.empty(j);var k=setTimeout(function(){g.empty(j);j.appendChild(document.createTextNode(b))},500),p=this;return i.when(a,function(a){p.treeRoot={};clearTimeout(k);for(var b in a)p.treeRoot[b]=a[b];p.model=new e(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,
d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),p._hookedDrag=!0,a?p._makeDropTarget(p.treeRoot,d,!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)}}):
(g.empty(d),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"),g.processDOMNodes(a,[b]),d.appendChild(a));if(typeof c==="function")try{c()}catch(f){p.registry&&p.registry.getService("orion.page.message").setErrorMessage(f)}if(typeof p.onchange==="function")p.onchange(p.treeRoot);return(new i).resolve(p.treeRoot)},function(a){clearTimeout(k);
p.registry.getService("orion.page.message").setProgressResult(a);return(new i).reject(a)})};a.prototype.onchange=function(){};a.prototype.constructor=a;return{FileExplorer:a,FileModel:e}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(h,k,i,g,d,c,b,j){function e(a,b){this.explorer=b;this._init(a)}function a(a){this._init(a)}e.prototype=new b.SelectionRenderer;e.prototype.constructor=e;e.prototype.getLabelColumnIndex=function(){return 0};e.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))};a.prototype=new i.Dialog;a.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>';
a.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()};a.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
a.prototype.loadFolderList=function(a){a=g.makeRelative(a);this.selection=new d.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 e({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};a.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};a.prototype.constructor=a;return{DirectoryPrompterDialog:a}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","require"],function(h,k,i,g){function d(c){this._init(c)}d.prototype=new i.Dialog;d.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>';d.prototype._init=
function(c){var b=this;this.title=c.title?c.title:h["Clone Git Repository"];this.modal=!0;this.messages=h;this.advancedShown=!1;this.alwaysShowAdvanced=c.alwaysShowAdvanced;this.advancedOnly=c.advancedOnly;this.url=c.url;this.serviceRegistry=c.serviceRegistry;this.fileClient=c.fileClient;this.func=c.func;this.buttons=[];this.buttons.push({callback:function(){b.destroy();b._execute()},text:"OK"});this._initialize()};d.prototype._bindToDom=function(){var c=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){c.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){c._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){c._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){c._checkNewExisting()});this.$gitName.addEventListener("focus",function(){c._showNewProject()});this.$advancedLink.addEventListener("click",
function(){c._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){c._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};d.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)};d.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};d.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};d.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};d.prototype._showNewProject=function(){this.$isNewProject.checked=!0};d.prototype._openDirectoryPickerDialog=function(){function c(b){var a=document.createElement("a");
a.href=g.toUrl("navigate/table.html")+"#"+b.ChildrenLocation;a.textContent=b.Name;return a}var b=this;this.$isExistingProject.checked=!0;var d=new k.DirectoryPrompterDialog({title:h["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(d){if(d&&d.Location){for(b.$gitPath.value=d.Location;b.$shownGitPath.hasChildNodes();)b.$shownGitPath.removeChild(b.$shownGitPath.lastChild);for(b.$shownGitPath.appendChild(c(d));d.parent&&d.parent.Location!=="/";)b.$shownGitPath.insertBefore(document.createTextNode("/"),
b.$shownGitPath.firstChild),b.$shownGitPath.insertBefore(c(d.parent),b.$shownGitPath.firstChild),d=d.parent}}});this._addChildDialog(d);d.show()};d.prototype.constructor=d;return{CloneGitRepositoryDialog:d}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(h,k,i){function g(d){this._init(d)}g.prototype=new i.Dialog;g.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>';g.prototype._init=
function(d){var c=this;this.title=d.title||h["Git Credentials"];this.modal=!0;this.messages=h;this.options=d;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(d.serviceRegistry)this._sshService=d.serviceRegistry.getService("orion.net.ssh"),this._progressService=d.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){c.destroy();
c._execute()},text:"OK",isDefault:!0});this._initialize()};g.prototype._bindToDom=function(){var d=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(){d.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(c){if(!c)d.$gitSaveCredentials.style.display="none",d.$gitSaveCredentialsLabel.style.display="none",d.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){d.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(c){d.privateKeyFile=c.target.files[0]})};g.prototype._execute=function(){var d=this,c=this.$gitPrivateKey.value,
b=this.$url.textContent,g=function(a){if(d._sshService)d._sshService.getKnownHosts().then(function(b){if(d.options.func){var c=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation;c!=="undefined"&&d._progressService.removeOperation(c);d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$isSshPassword.checked?d.$gitSshPassword.value:"",gitPrivateKey:d.$isPrivateKey.checked?a:"",gitPassphrase:d.$isPrivateKey.checked?d.$gitPassphrase.value:
"",knownHosts:b})}});else if(d.options.func){var b=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation;b!=="undefined"&&d._progressService.removeOperation(b);d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:d.$gitPassphrase.value,knownHosts:d.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var e=new FileReader;e.onload=function(){return function(a){c=a.target.result;
a=new k(d.options.serviceRegistry);d.$gitSaveCredentials.checked?a.put(b,{gitPrivateKey:c,gitPassphrase:d.$gitPassphrase.value}).then(function(){g(c)}):g(c)}}(this.privateKeyFile);e.readAsText(this.privateKeyFile)}else c.length>0?(e=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?e.put(b,{gitPrivateKey:c,gitPassphrase:d.$gitPassphrase.value}).then(function(){g(c)}):g(c)):(e=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?e.put(b,{gitSshUsername:d.$gitSshUsername.value,
gitSshPassword:d.$gitSshPassword.value}).then(function(){g(c)}):g(c))};g.prototype.constructor=g;return{GitCredentialsDialog:g}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/webui/littlelib".split(","),function(h,k,i,g,d,c){function b(b){this._init(b)}b.prototype=new d.Dialog;b.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>';b.prototype._init=function(b){this.title=
b.title||k["Find Commit"];this.modal=!0;this.messages=k;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=b.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=b.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=b.commitName;this._initialize()};b.prototype._bindToDom=function(){var b=this;this.$resourceName.addEventListener("input",function(){b.time=+new Date;
b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(d){if(d.keyCode===c.KEY.ENTER){var a=c.$("a",b.$results);a&&(c.stop(d),window.open(a.href),b.hide())}},!1);this.$resourceName.value=this.commitName};b.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();b-this.time>this.SEARCH_DELAY?(this.time=b,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};b.prototype._findCommitLocation=function(b,c,a){var d=this;a||(a=new g);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(d.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+c+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+c).then(function(b){a.resolve(b.Children[0])},function(){d._findCommitLocation(b.slice(1),c,a)}):a.reject();return a};b.prototype._doSearch=function(){var b=this,d=this.$resourceName&&this.$resourceName.value;
if(d){var a=document.createElement("div");a.appendChild(document.createTextNode(k["Searching..."]));c.empty(this.$results);this.$results.appendChild(a);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,d).then(function(a){c.empty(b.$results);b._displayCommit(a,b.$results);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var a=document.createElement("div");a.appendChild(document.createTextNode("No commits found"));
c.empty(b.$results);b.$results.appendChild(a);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};b.prototype._displayCommit=function(b,d){var a=this,f=document.createElement("div");f.style.padding="10px";f.style.maxWidth="480px";c.empty(d);d.appendChild(f);var g=b.Message.split(/(\r?\n|$)/)[0],n=document.createElement("a");n.className="navlinkonpage";n.href=h.toUrl("git/git-commit.html#")+b.Location+"?page=1&pageSize=1";n.textContent=g;f.appendChild(n);n.addEventListener("mouseup",
function(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&a.hide()},!1);n.addEventListener("keyup",function(b){b.keyCode===c.KEY.ENTER&&a.hide()},!1);g=document.createElement("div");g.style.paddingTop="15px";f.appendChild(g);if(b.AuthorImage)f=new Image,f.src=b.AuthorImage,f.name=b.AuthorName,f.className="git-author-icon",g.appendChild(f);f=document.createElement("div");f.textContent=i.formatMessage(k[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());g.appendChild(f);
f=document.createElement("div");f.textContent=i.formatMessage(k["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);g.appendChild(f);f=document.createElement("div");f.style.paddingTop="15px";f.textContent=k["commit:"]+b.Name;g.appendChild(f);if(b.Parents&&b.Parents.length>0)d=document.createElement("div"),d.textContent=k["parent:"],f=document.createElement("a"),f.className="navlinkonpage",f.href=h.toUrl("git/git-commit.html#")+b.Parents[0].Location+"?page=1&pageSize=1",f.textContent=b.Parents[0].Name,
d.appendChild(f),f.addEventListener("mouseup",function(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&a.hide()},!1),f.addEventListener("keyup",function(b){b.keyCode===c.KEY.ENTER&&a.hide()},!1),g.appendChild(d)};b.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};b.prototype.constructor=b;return{OpenCommitDialog:b}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function i(g){this._init(g)}i.prototype=new k.Dialog;i.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>';
i.prototype._init=function(g){var d=this;this.title=h["Commit Changes"];this.modal=!0;this.messages=h;this.options=g;this.buttons=[];this.buttons.push({callback:function(){d._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};i.prototype._bindToDom=function(){var g=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){g._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(){g._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){g._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){g._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){g._validate()});this._validate()};i.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."])};i.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var g={};g.Message=this.$commitMessage.value;g.Amend=this.$amend.checked?!0:!1;g.CommitterName=this.$committerName.value;g.CommitterEmail=this.$committerEmail.value;g.AuthorName=this.$authorName.value;g.AuthorEmail=this.$authorEmail.value;this.options.func(g)}this.hide()}};
i.prototype.constructor=i;return{CommitDialog:i}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function i(g){this._init(g)}i.prototype=new k.Dialog;i.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>';i.prototype._init=
function(g){var d=this;this.title=h["Apply Patch"];this.modal=!0;this.messages=h;this.options=g;this.buttons=[];this.buttons.push({callback:function(){d._applyPatch()},text:"OK"});this._initialize()};i.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)};i.prototype._applyPatch=function(){var g=new FormData;
g.append("uploadedfile",this.$selectedFile.files[0]);g.append("url",this.$url.value);g.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(g)};i.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())};i.prototype.constructor=i;return{ApplyPatchDialog:i}});
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,i,g,d,c,b,j,e,a,f,l,n,m,q,s,p,r,t,o,v,x){var u={};(function(){function o(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 D=!1;u.updateNavTools=function(a,b,c,e,g,f,h){var i=d.node(e);if(i)b.destroy(i);else throw"could not find toolbar "+e;b.renderCommands(e,i,f,c,"button");if(h&&(e=d.node(h)))b.destroy(e),b.renderCommands(h,e,f,c,"button");if(g&&(f=d.node(g)))b.destroy(g),b.renderCommands(g,f,null,c,"button");
D||(D=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=d.node(g);e&&(b.destroy(e),b.renderCommands(g,e,a.selections,c,"button"))}))};u.handleKnownHostsError=function(a,b,c,d){if(confirm(g.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 e=a.getService("orion.net.ssh");e.addKnownHosts(b.Host+" "+b.KeyType+" "+b.HostKey).then(function(){e.getKnownHosts().then(function(b){c.knownHosts=
b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);d(c)})})}};u.handleSshAuthenticationError=function(b,c,d,e,g){var c=c?c.Url:void 0,f=function(){(new s.GitCredentialsDialog({title:g,serviceRegistry:b,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&d.gitSshUsername!==""||d.gitSshPassword&&d.gitSshPassword!==""||d.gitPrivateKey&&d.gitPrivateKey!==""?f():(new a(b)).get(c).then(function(a){a.gitPrivateKey!==
""||a.gitSshUsername!==""||a.gitSshPassword!==""?(typeof d.failedOperation!=="undefined"&&b.getService("orion.page.progress").removeOperation(d.failedOperation),e({knownHosts:d.knownHosts,gitSshUsername:a.gitSshUsername,gitSshPassword:a.gitSshPassword,gitPrivateKey:a.gitPrivateKey,gitPassphrase:a.gitPassphrase})):f()},f)};u.getDefaultSshOptions=function(a,b){var c=new i,d=a.getService("orion.net.ssh"),e=b&&!b.optionsRequested?b.valueFor("sshuser"):"",g=b&&!b.optionsRequested?b.valueFor("sshpassword"):
"";d.getKnownHosts().then(function(a){c.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})});return c};u.handleProgressServiceResponse=function(a,b,c,d,e,g){a&&a.status!==void 0&&(a=o(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,g);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(b,c,d){var e=new i,f;if(c.items.RemoteLocation!==void 0)f=c.items.RemoteLocation[0].GitUrl;else if(c.items.GitUrl!==void 0)f=c.items.GitUrl;else if(c.items.errorData!==void 0)f=c.items.errorData.Url;else if(c.items.toRef!==void 0)f=c.items.toRef.RemoteLocation[0].GitUrl;
var j=function(a){b.getService("orion.net.ssh").getKnownHosts().then(function(b){c.sshObject=a;e.resolve({knownHosts:b,gitSshUsername:a.gitSshUsername,gitSshPassword:a.gitSshPassword,gitPrivateKey:a.gitPrivateKey,gitPassphrase:a.gitPassphrase})})},k=c.errorData;if(k&&k.HostKey)return confirm(g.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))&&b.getService("orion.net.ssh").addKnownHosts(k.Host+" "+k.KeyType+
" "+k.HostKey).then(function(){c.sshObject&&(c.sshObject.gitSshUsername!==""||c.sshObject.gitSshPassword!==""||c.sshObject.gitPrivateKey!=="")?j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new a(b)).get(f).then(function(a){j(a)},function(){j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),e;var l=function(){if(!c.parameters&&!c.optionsRequested)j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(c.parameters&&
!c.optionsRequested){var e=c.parameters?c.parameters.valueFor("sshuser"):"",g=c.parameters?c.parameters.valueFor("sshpassword"):"",h=c.parameters&&c.parameters.valueFor("saveCredentials")?c.parameters.valueFor("saveCredentials"):!1,i=new a(b);h?i.put(f,{gitSshUsername:e,gitSshPassword:g}).then(function(){j({gitSshUsername:e,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}):j({gitSshUsername:e,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}else(new s.GitCredentialsDialog({title:d,serviceRegistry:b,
func:j,errordata:k})).show()};c.sshObject&&(c.sshObject.gitSshUsername!==""||c.sshObject.gitSshPassword!==""||c.sshObject.gitPrivateKey!=="")?l():(new a(b)).get(f).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?j(a):l()},l);return e};u.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=o(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(d,f,o){function p(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}d.getService("orion.page.message").setProgressResult(b)}var q=new b.ParametersDescription([new b.CommandParameter("name",
"text",h["Local Branch Name:"])]),q=new c.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,c=function(a,b,c){d.getService("orion.page.progress").showWhile(d.getService("orion.git.provider").checkoutTag(a,b,c),g.formatMessage(h["Checking out tag ${0}"],c)).then(function(){o.changedItem()},p)},e=b.Repository?
b.Repository.Location:b.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&c(e,b.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});f.addCommand(q);q=new c.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,c=d.getService("orion.git.provider"),e=d.getService("orion.page.message"),f=d.getService("orion.page.progress");e.setProgressMessage(b.Name?g.formatMessage(h["Checking out branch ${0}..."],b.Name):h["Checking out branch..."]);b.Type==="Branch"?f.progress(c.checkoutBranch(b.CloneLocation,b.Name),"Checking out branch "+b.Name).then(function(){e.setProgressResult(h["Branch checked out."]);o.changedItem(b.parent)},function(a){p(a)}):f.progress(c.addBranch(b.Repository?
b.Repository.BranchLocation:b.parent.parent.BranchLocation,null,b.Name),"Adding branch "+b.Name).then(function(a){f.progress(c.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+b.Name).then(function(){e.setProgressResult(h["Branch checked out."]);o.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"}});f.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name",
"text","Name:")]);q=new c.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,c=d.getService("orion.page.progress"),e=function(a,e){c.progress(d.getService("orion.git.provider").addBranch(a,e),"Adding branch "+e).then(function(){o.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"&&o.parentId==="artifacts"}});f.addCommand(q);q=new c.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=d.getService("orion.page.progress");confirm(g.formatMessage(h["Are you sure you want to delete branch ${0}?"],b.Name))&&a.progress(d.getService("orion.git.provider").removeBranch(b.Location),
"Removing branch "+b.Name).then(function(){o.changedItem?o.changedItem(b.parent):o.displayBranches&&o.displayBranches(b.ParentLocation,null)},p)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});f.addCommand(q);q=new c.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,c=d.getService("orion.page.progress");confirm(g.formatMessage(h["You're going to delete remote branch ${0} and push the change."],
b.Name)+"\n\n"+h["Are you sure?"])&&u.getDefaultSshOptions(d).then(function(a){var e=arguments.callee,f=d.getService("orion.git.provider"),g=d.getService("orion.page.message"),f=c.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(c){u.handleProgressServiceResponse(c,a,d,function(a){a.Result.Severity=="Ok"&&o.changedItem(b.parent)},
e,h["Delete Remote Branch"])},function(c){u.handleProgressServiceResponse(c,a,d,function(){},e,h["Removing remote branch: "]+b.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});f.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name","text","Name:"),new b.CommandParameter("url","url","Url:")]);q=new c.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,c=
d.getService("orion.page.progress"),e=function(a,e,f){c.progress(d.getService("orion.git.provider").addRemote(a,e,f),"Adding remote "+a).then(function(){o.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"&&o.parentId==="artifacts"}});f.addCommand(q);q=new c.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(g.formatMessage(h["Are you sure you want to delete remote ${0}?"],b.Name))&&d.getService("orion.page.progress").progress(d.getService("orion.git.provider").removeRemote(b.Location),"Removing remote "+b.Name).then(function(){o.changedItem(b.parent)},p)},visibleWhen:function(a){return a.Type==="Remote"}});f.addCommand(q);q=new c.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,c=b.Location,e=b.Name;u.getDefaultSshOptions(d).then(function(a){var f=arguments.callee,g=d.getService("orion.git.provider"),i=d.getService("orion.page.message"),g=d.getService("orion.page.progress").progress(g.doPull(c,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pulling: "]+e);i.createProgressMonitor(g,
h["Pulling: "]+e);var j;g.then(function(c){u.handleProgressServiceResponse(c,a,d,function(){b.Type==="Clone"&&o.changedItem(b)},f,"Pull Git Repository")},function(c){if(j)c.failedOperation=j;u.handleProgressServiceResponse(c,a,d,function(){o.changedItem(b)},f,h["Pull Git Repository"])},function(a){j=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});f.addCommand(q);q=new c.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"}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.Command({name:h["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return d.getService("orion.page.progress").progress(d.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 e.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return o.isDirectory?
!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});f.addCommand(q);q=new c.Command({name:h["Compare With Working Tree"],id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return e.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!o.isDirectory}});f.addCommand(q);q=new c.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&&!o.isDirectory}});f.addCommand(q);q=new c.Command({name:h.Fetch,tooltip:h["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(c){var e=c.items,g=e.Location,i=e.Name,j=function(c,e){c.JsonData.HostKey?(e.parameters=null,e.errorData=c.JsonData,e.errorData.failedOperation=c.failedOperation,f.collectParameters(e)):e.optionsRequested?(e.errorData=c.JsonData,
e.errorData.failedOperation=c.failedOperation,f.collectParameters(e)):(new a(d)).isEnabled().then(function(a){e.parameters=a?c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"]),
new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=c.JsonData;e.errorData.failedOperation=c.failedOperation;
f.collectParameters(e)})},k=function(){c.parameters&&c.parameters.optionsRequested?(c.parameters=null,c.optionsRequested=!0,f.collectParameters(c)):(c.errorData&&c.errorData.failedOperation&&d.getService("orion.page.progress").removeOperation(c.errorData.failedOperation),u.gatherSshCredentials(d,c).then(function(a){var b=d.getService("orion.git.provider"),f=d.getService("orion.page.message"),a=d.getService("orion.page.progress").progress(b.doFetch(g,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),h["Fetching remote: "]+i);f.createProgressMonitor(a,h["Fetching remote: "]+i);a.then(function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem(e)},function(a){j(a,c)})},function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem(e)},function(a){j(a,c)})})}))};if(c.items.GitUrl)k();else{var l=d.getService("orion.git.provider"),m=d.getService("orion.page.progress");m.progress(l.getGitRemote(g),"Getting remote details "+i).then(function(a){m.progress(l.getGitClone(a.CloneLocation),
"Getting git repository information "+a.Name).then(function(a){c.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}});f.addCommand(q);q=new c.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(c){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 e=c.items,g=e.Location,i=e.Name,j=function(c,e){c.JsonData.HostKey?(e.parameters=null,e.errorData=c.JsonData,e.errorData.failedOperation=c.failedOperation,f.collectParameters(e)):e.optionsRequested?(e.errorData=c.JsonData,f.collectParameters(e)):(new a(d)).isEnabled().then(function(a){e.parameters=a?c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword",
"password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"])],
{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=c.JsonData;e.errorData.failedOperation=c.failedOperation;f.collectParameters(e)})},k=function(){c.parameters&&c.parameters.optionsRequested?(c.parameters=null,c.optionsRequested=!0,f.collectParameters(c)):(c.errorData&&c.errorData.failedOperation&&d.getService("orion.page.progress").removeOperation(c.errorData.failedOperation),
u.gatherSshCredentials(d,c).then(function(a){var b=d.getService("orion.git.provider"),f=d.getService("orion.page.progress"),k=d.getService("orion.page.message"),a=f.progress(b.doFetch(g,!0,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Fetching remote: "]+i);k.createProgressMonitor(a,h["Fetching remote: "]+i);a.then(function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem(e)},function(a){j(a,c)})},function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem(e)},
function(a){j(a,c)})})}))};if(c.items.GitUrl)k();else{var l=d.getService("orion.git.provider");l.getGitRemote(g).then(function(a){l.getGitClone(a.CloneLocation).then(function(a){c.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}});f.addCommand(q);q=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=d.getService("orion.page.message");c.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 f="",i=!0,l;for(l in a.FailingPaths)i||(f+=", "),i=!1,f+=l;if(!i)c.Severity="Error",c.Message+=". "+g.formatMessage(h["Failing paths: ${0}"],f)}c.Message+=g.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+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>";e.setProgressResult(c);o.changedItem(b)},function(a,c){var e=[],f=b.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+g.formatMessage(h[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>";d.getService("orion.page.message").setProgressResult(e);o.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}});f.addCommand(q);q=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=d.getService("orion.page.message");c.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+g.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+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+d+'">'+h["Git Status page"]+"</a>")+"</span>";e.setProgressResult(c);o.changedItem(b)},function(a,c){var e=[],f=b.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>";d.getService("orion.page.message").setProgressResult(e);o.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}});f.addCommand(q);q=new c.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=d.getService("orion.page.message"),c=d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doRebase(b.HeadLocation,b.Name,"BEGIN"),b.Name?h["Rebase on top of "]+b.Name:h.Rebase);a.createProgressMonitor(c,b.Name?h["Rebase on top of "]+b.Name:h.Rebase);c.then(function(a){var c=[],e=b.HeadLocation.replace("commit/HEAD","status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(c.Severity="Ok",c.HTML=!1,c.Message=a.Result):a.Result==="STOPPED"?(c.Severity=
"Warning",c.HTML=!0,c.Message="<span>"+a.Result+h[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+h[". Repository state is invalid (i.e. already during rebasing)"]+g.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(j.statusUILocation)+
"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+h[". Repository contains unmerged paths"]+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+h[". Repository contains pending changes. Please commit or stash them"]+g.formatMessage(h[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">Git Status page</a>')+".</span>"):(c.Severity="Warning",c.HTML=!0,c.Message="<span>"+a.Result+g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>");d.getService("orion.page.message").setProgressResult(c);o.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}});f.addCommand(q);q=new c.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(c){var e=c.targetBranch,g,j=c.items;if(j.toRef)j=j.toRef;j.CloneLocation.split("/");var k=function(c,e){c.JsonData.HostKey?
(e.parameters=null,e.errorData=c.JsonData,e.errorData.failedOperation=c.failedOperation,f.collectParameters(e)):e.optionsRequested?(e.errorData=c.JsonData,e.errorData.failedOperation=c.failedOperation,f.collectParameters(e)):(new a(d)).isEnabled().then(function(a){e.parameters=a?c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):
new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword",
"password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=c.JsonData;e.errorData.failedOperation=c.failedOperation;f.collectParameters(e)})};if(c.parameters&&c.parameters.optionsRequested)c.parameters=null,c.optionsRequested=!0,f.collectParameters(c);else{var m=d.getService("orion.git.provider"),p=d.getService("orion.page.progress");c.errorData&&c.errorData.failedOperation&&p.removeOperation(c.errorData.failedOperation);var q=function(a,b,e,f,g){var i=d.getService("orion.page.message"),
a=p.progress(m.doPush(b,e,!0,g,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+f);i.createProgressMonitor(a,h["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem()},function(a){k(a,c)})},function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem()},function(a){k(a,c)})})};p.progress(m.getGitClone(j.CloneLocation),"Getting git repository details "+j.Name).then(function(a){var b=a.Children[0].RemoteLocation,
f=a.Children[0].ConfigLocation,k=function(a){u.handleProgressServiceResponse(a,{},d)};u.gatherSshCredentials(d,c).then(function(a){var o=new i;if(j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1)o=p.progress(m.getGitRemote(b),"Getting git remote details "+j.Name);else{var r={};r.Children=j.RemoteLocation;o.resolve(r)}o.then(function(b){e?q(a,e.Location,"HEAD",e.Name,!1):(b=new n.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:d,gitClient:m,treeRoot:{Children:b.Children},
hideNewBranch:!1,func:function(b,d,e){g=b===null?e:b;var h="branch."+j.Name+".remote";p.progress(m.addCloneConfigurationProperty(f,h,g.parent.Name),"Adding git configuration property "+j.Name).then(function(){c.targetBranch=g;q(a,g.Location,"HEAD",g.Name,!1)},function(b){b.status===409?m.getGitCloneConfig(f).then(function(b){if(b.Children)for(var d=0;d<b.Children.length;d++)if(b.Children[d].Key===h){p.progress(m.editCloneConfigurationProperty(b.Children[d].Location,g.parent.Name),"Updating configuration property "+
g.parent.Name).then(function(){c.targetBranch=g;q(a,g.Location,"HEAD",g.Name,!1)},k);break}},k):k(b)})}}),j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1&&(b=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:d,gitClient:m,dialog:b,location:j.RemoteLocation[0].Children[0].Name,func:function(){c.targetBranch=j.RemoteLocation[0].Children[0];q(a,j.RemoteLocation[0].Children[0].Location,"HEAD",j.Name,!1)}})),b.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}});f.addCommand(q);q=new c.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(c){var e=c.confirmedWarnings,g=c.targetBranch;if(!e)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?"]))e=c.confirmedWarnings=!0;else return;var j,k=c.items;if(k.toRef)k=k.toRef;var m=k.CloneLocation.split("/"),p=function(c,e){c.JsonData.HostKey?(e.parameters=null,e.errorData=c.JsonData,f.collectParameters(e)):e.optionsRequested?(e.errorData=c.JsonData,f.collectParameters(e)):(new a(d)).isEnabled().then(function(a){e.parameters=a?c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=c.JsonData;f.collectParameters(e)})};if(c.parameters&&c.parameters.optionsRequested)c.parameters=null,c.optionsRequested=!0,f.collectParameters(c);else{var q=d.getService("orion.git.provider"),r=d.getService("orion.page.progress"),s=function(a,b,e,f,g){var i=d.getService("orion.page.message"),a=r.progress(q.doPush(b,e,!0,g,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+f);i.createProgressMonitor(a,h["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem()},function(a){p(a,c)})},function(a){u.handleGitServiceResponse(a,d,function(){o.changedItem(k)},function(a){p(a,c)})})};r.progress(q.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(a){var b=a.Children[0].RemoteLocation,e=a.Children[0].ConfigLocation;u.gatherSshCredentials(d,c).then(function(a){var f=
new i;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)f=r.progress(q.getGitRemote(b),"Getting remote details "+k.Name);else{var o={};o.Children=k.RemoteLocation;f.resolve(o)}f.then(function(b){g?s(a,g.Location,"HEAD",g.Name,!0):(b=new n.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:d,gitClient:q,treeRoot:{Children:b.Children},hideNewBranch:!1,func:function(b,d,f){j=b===null?f:b;var g="/gitapi/config/branch."+k.Name+".remote/clone/file/"+m[4];r.progress(q.addCloneConfigurationProperty(e,
"branch."+k.Name+".remote",j.parent.Name),"Setting git configuration property "+k.Name).then(function(){c.targetBranch=j;s(a,j.Location,"HEAD",j.Name,!0)},function(b){b.status===409&&r.progres(q.editCloneConfigurationProperty(g,j.parent.Name),"Setting git configuration property "+j.parent.Name).then(function(){c.targetBranch=j;s(a,j.Location,"HEAD",j.Name,!0)})})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(b=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:d,
gitClient:q,dialog:b,location:k.RemoteLocation[0].Children[0].Name,func:function(){c.targetBranch=k.RemoteLocation[0].Children[0];s(a,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Location,!0)}})),b.startup(),b.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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}});f.addCommand(q);q=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.message"),a=d.getService("orion.page.progress").progress(a.resetIndex(b.IndexLocation,b.Name),"Resetting git index for "+b.Name);c.createProgressMonitor(a,h["Resetting index..."]);a.then(function(){o.changedItem(b);c.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=
a.message;c.setProgressResult(b)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});f.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name","text",h["Name:"])]);q=new c.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,c=function(a,c){d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doAddTag(a,
c),"Adding tag "+c).then(function(){o.changedItem(b)},p)},e=b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&c(e,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Commit"}});f.addCommand(q);q=new c.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(g.formatMessage(h["Are you sure you want to delete tag ${0}?"],b.Name))&&d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doRemoveTag(b.Location),
"Removing tag "+b.Name).then(function(){o.changedItem(b.parent)},p)},visibleWhen:function(a){return a.Type==="Tag"}});f.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("reviewer","text",h["Reviewer name"])],{hasOptionalParameters:!0});q=new c.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=d.getService("orion.page.progress"),c=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,i=f.Name,j=f.Message;b.progress(d.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(a){window.location.href.split("#");var k=v.getOrionHome(),a=c(a.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+a+"_"+f.Name;b.progress(d.getService("orion.git.provider").sendCommitReviewRequest(i,
g,e,k,h,j),"Sending review request for "+i).then(function(a){var b={Severity:"Ok",HTML:!1};b.Message=a.Result;d.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(d.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting git details "+f.Name).then(function(a){window.location.href.split("#");var b=v.getOrionHome(),a=c(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"}});f.addCommand(q);q=new c.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=d.getService("orion.page.progress"),c=d.getService("orion.git.provider"),
e=b.Location.replace(b.Name,"HEAD");a.progress(c.doCherryPick(e,b.Name),"Cherry picking "+b.Name).then(function(a){var c=[],e=b.Location.replace("commit/"+b.Name,"status");if(a.Result==="OK")c.Severity="Ok",a.HeadUpdated?(c.HTML=!1,c.Message=a.Result):(c.HTML=!0,c.Message="<span>"+h["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")c.Severity="Warning",c.HTML=!0,c.Message="<span>"+a.Result+h[". Some conflicts occurred"]+ +g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){c.Severity="Error";c.HTML=!0;c.Message="<span>"+a.Result;if(a.FailingPaths){var f="",i=!0,l;for(l in a.FailingPaths)i||(f+=", "),i=!1,f+=l;i||(c.Message+=". "+g.formatMessage(h["Failing paths: ${0}"],f))}c.Message+=g.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+h["Git Status page"]+"</a>")+".</span>"}else c.Severity="Warning",c.HTML=!1,c.Message=a.Result;d.getService("orion.page.message").setProgressResult(c)},
p)},visibleWhen:function(a){return a.Type==="Commit"}});f.addCommand(q)};u.createGitClonesCommands=function(d,e,j,l,m,n){function o(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}d.getService("orion.page.message").setProgressResult(b)}function r(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new b.ParametersDescription([new b.CommandParameter("key",
"text",h["Key:"]),new b.CommandParameter("value","text",h["Value:"])]);l=new c.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,c=d.getService("orion.git.provider"),e=d.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(c.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),
"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){j.changedItem(b)},o)}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("value","text",h["Value:"])]);l=new c.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,c=d.getService("orion.git.provider"),e=d.getService("orion.page.progress");a.parameters.valueFor("value")&&
e.progress(c.editCloneConfigurationProperty(b.Location,a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){j.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});e.addCommand(l);l=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress");
confirm(g.formatMessage(h["Are you sure you want to delete ${0}?"],b.Key))&&c.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){j.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("url","url",h["Repository URL:"])],{hasOptionalParameters:!0});m=new c.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,c=d.getService("orion.git.provider"),e=d.getService("orion.page.progress"),g=function(a,g,i){u.getDefaultSshOptions(d).then(function(l){var m=arguments.callee,o=new f(d);d.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");o.getConfig().then(function(f){e.progress(c.cloneGitRepository(i,a,g,j.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,
f),"Cloning repository "+i).then(function(a){u.handleProgressServiceResponse(a,l,d,function(a){c.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 x(b)).expand({resource:"",params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})})})},m,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
l,d,function(){},m,h["Clone Git Repository"])})})})};b.url&&b.projectDescription.name&&(d.getService("orion.page.message").setProgressMessage("Looking for project "+b.projectDescription.name),n.loadWorkspace().then(function(a){for(var d=0;d<a.Children.length;++d){var e=a.Children[d];if(e.Name===b.projectDescription.name){e.Git?c.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 x(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}}g(b.url,null,b.projectDescription.name)}))},visibleWhen:function(){return!0}});e.addCommand(m);l=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=function(a,
e,g){u.getDefaultSshOptions(d).then(function(i){var k=arguments.callee;(new f(d)).getConfig().then(function(f){f=c.progress(b.cloneGitRepository(g,a,e,j.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,i.gitPassphrase,f),"Cloning repository "+g);d.getService("orion.page.message").createProgressMonitor(f,h["Cloning repository: "]+a);f.then(function(a){u.handleProgressServiceResponse(a,i,d,function(){j.changedItem&&j.changedItem()},k,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
i,d,function(){},k,h["Clone Git Repository"])})})})};a.parameters.valueFor("url")&&!a.parameters.optionsRequested?e(a.parameters.valueFor("url")):(new q.CloneGitRepositoryDialog({serviceRegistry:d,fileClient:n,url:a.parameters.valueFor("url"),alwaysShowAdvanced:a.parameters.optionsRequested,func:e})).show()},visibleWhen:function(){return!0}});e.addCommand(l);l=new c.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",
callback:function(a){var b=d.getService("orion.git.provider"),c=d.getService("orion.page.progress");(new q.CloneGitRepositoryDialog({serviceRegistry:d,fileClient:n,url:a.userData,alwaysShowAdvanced:!1,func:function(a,e,g){u.getDefaultSshOptions(d).then(function(i){var k=arguments.callee;(new f(d)).getConfig().then(function(f){f=c.progress(b.cloneGitRepository(g,a,e,j.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,i.gitPassphrase,f),"Cloning git repository "+g);d.getService("orion.page.message").createProgressMonitor(f,
h["Cloning repository: "]+a);f.then(function(a){u.handleProgressServiceResponse(a,i,d,function(){j.changedItem&&j.changedItem()},k,h["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,i,d,function(){},k,h["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});e.addCommand(l);l=new c.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(c){if(c.parameters&&c.parameters.valueFor("remoteName"))c.remoteName=c.parameters.valueFor("remoteName");var f=function(c,f){c.JsonData.HostKey?(f.parameters=null,f.errorData=c.JsonData,e.collectParameters(f)):f.optionsRequested?(f.errorData=c.JsonData,e.collectParameters(f)):(new a(d)).isEnabled().then(function(a){f.parameters=a?c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):c.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",h["SSH User Name:"]),new b.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});f.errorData=c.JsonData;e.collectParameters(f)})};if(c.parameters&&c.parameters.optionsRequested)c.parameters=null,c.optionsRequested=!0,e.collectParameters(c);else{var g=function(a,b,e){var g=d.getService("orion.page.progress");g.progress(d.getService("orion.git.provider").addRemote(a,b,c.userData),"Adding git remote "+b).then(function(){u.gatherSshCredentials(d,c).then(function(a){d.getService("orion.git.provider").getGitRemote(e.RemoteLocation).then(function(i){for(var k,
l=0;l<i.Children.length;l++)i.Children[l].Name===b&&(k=i.Children[l]);var m=d.getService("orion.git.provider"),i=d.getService("orion.page.message"),l=g.progress(m.doFetch(k.Location,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),"Fetching remote "+b);i.createProgressMonitor(l,h["Fetching remote: "]+k.Location);l.then(function(a){u.handleGitServiceResponse(a,d,function(){g.progress(m.getGitRemote(k.Location),"Getting remote details "+b).then(function(){j.changedItem(e)},
o)},function(a){f(a,c)})},function(a){u.handleGitServiceResponse(a,d,function(){j.changedItem(e)},function(a){f(a,c)})})})})},o)};c.remoteName?g(c.items.RemoteLocation,c.remoteName,c.items):(c.parameters=new b.ParametersDescription([new b.CommandParameter("remoteName","text",h["Remote Name:"])],{hasOptionalParameters:!1}),e.collectParameters(c))}},visibleWhen:function(){return!0}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("folderName","text",h["New folder:"])],{hasOptionalParameters:!0});
l=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=function(a,e,g){u.getDefaultSshOptions(d).then(function(i){var k=arguments.callee;(new f(d)).getConfig().then(function(f){f=c.progress(b.cloneGitRepository(g,a,e,j.defaultPath,null,null,null,null,null,f),h["Initializing repository: "]+g);d.getService("orion.page.message").createProgressMonitor(f,
h["Initializing repository: "]+g);f.then(function(a){u.handleProgressServiceResponse(a,i,d,function(){j.changedItem&&j.changedItem()},k,h["Init Git Repository"])},function(a){u.handleProgressServiceResponse(a,i,d,function(){},k,h["Init Git Repository"])})})})};a.parameters.valueFor("folderName")&&!a.parameters.optionsRequested?e(null,null,a.parameters.valueFor("folderName")):(new q.CloneGitRepositoryDialog({serviceRegistry:d,title:h["Init Git Repository"],fileClient:n,advancedOnly:!0,func:e})).show()},
visibleWhen:function(){return!0}});e.addCommand(l);l=new c.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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(g.formatMessage(h["Are you sure you want do delete ${0} repositories?"],b.length)))for(var e=0,f=0;f<b.length;f++)c.progress(a.removeGitRepository(b[f].Location),
"Removing repository "+b.Name).then(function(){e++;e>=b.length&&j.changedItem&&j.changedItem()},o)}else confirm(g.formatMessage(h["Are you sure you want to delete ${0}?"],b.Name))&&c.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){j.changedItem&&j.changedItem()},o)}});e.addCommand(l);l=new c.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=r(a.items),b=new i;(new t.ApplyPatchDialog({title:h["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var c=d.getService("orion.page.message");b.then(function(a){var b;try{var d=JSON.parse(a);if(d.JsonData&&d.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<d.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=d.JsonData.modifiedFieles[e],a=!1;d=[];d.Severity="Info";d.HTML=!1;d.Message=b;c.setProgressResult(d);return}}catch(f){}c.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;c.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("commitName","text",h["Commit name:"])],{hasOptionalParameters:!0});l=new c.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=d.getService("orion.page.progress"),c=function(e,f,g){g==null&&(g=new i);e.length>0?b.progress(d.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+e[0].ContentLocation+"?page=1&pageSize=1",null,null,h["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){g.resolve(a.Children[0].Location)},function(){c(e.slice(1),
f,g)}):g.reject();return g},f=function(b){a.parameters.optionsRequested?(new p.OpenCommitDialog({repositories:b,serviceRegistry:d,commitName:a.parameters.valueFor("commitName")})).show():(d.getService("orion.page.message").setProgressMessage(h["Looking for the commit"]),c(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl("git/git-commit.html#")+a+"?page=1&pageSize=1",window.open(a));d.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";
a.HTML=!1;a.Message=h["No commits found"];d.getService("orion.page.message").setProgressResult(a)}))};if(!a.parameters.optionsRequested&&!a.parameters.valueFor("commitName"))e.runCommand("eclipse.orion.git.openCommitCommand");else if(a.items.Type==="Clone"){var g=[a.items];f(g)}else a.items.CloneLocation?b.progress(d.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(g=a.items,f(g))},visibleWhen:function(a){return a.Type===
"Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});e.addCommand(l)};u.createGitStatusCommands=function(a,d,e){function f(b){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(b.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){c.Message=h["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(c)}function g(a){Array.isArray(a)||(a=[a]);return a}function i(b,c){var d=a.getService("orion.page.message"),
g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,"",c),"Rebasing git repository");d.createProgressMonitor(g,c);g.then(function(b){if(b.Result==="OK"||b.Result==="ABORTED"||b.Result==="FAST_FORWARD"||b.Result==="UP_TO_DATE"){var c=[];c.Severity="Ok";c.HTML=!1;c.Message=b.Result;a.getService("orion.page.message").setProgressResult(c);e.changedItem({})}if(b.Result==="STOPPED")c=[],c.Severity="Warning",c.HTML=!1,c.Message=b.Result+h[". Repository still contains conflicts."],
a.getService("orion.page.message").setProgressResult(c),e.changedItem({});else if(b.Result==="FAILED_UNMERGED_PATHS")c=[],c.Severity="Error",c.HTML=!1,c.Message=b.Result+h[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(c)},f)}var k=new c.Command({name:h.Stage,tooltip:h["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var c=g(b.items),d=a.getService("orion.page.message"),
i=a.getService("orion.page.progress");if(c.length===1)b=i.progress(a.getService("orion.git.provider").stage(c[0].indexURI),h["Staging changes"]),d.createProgressMonitor(b,h["Staging changes"]);else{for(var j=[],k=0;k<c.length;k++)j[k]=c[k].name;b=i.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,j),h["Staging changes"]);d.createProgressMonitor(b,"Staging changes")}b.then(function(){e.changedItem(c)},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 c.Command({name:h.Unstage,tooltip:h["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(b){var c=g(b.items),d=a.getService("orion.page.message"),i=a.getService("orion.page.progress");if(c.length===1)b=i.progress(a.getService("orion.git.provider").unstage(c[0].indexURI,c[0].name),"Unstaging changes");else{for(var j=
[],k=0;k<c.length;k++)j[k]=c[k].name;b=i.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,j),"Unstaging changes")}d.createProgressMonitor(b,h["Staging changes"]);b.then(function(){e.changedItem(c)},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.ParametersDescription([new b.CommandParameter("name","text",h["Commit message:"],"",4),new b.CommandParameter("amend",
"boolean",h["Amend:"],!1)],{hasOptionalParameters:!0});k=new c.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(b){var c=b.items.status,d=function(b){var d=a.getService("orion.page.message"),b=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").commitAll(c.Clone.HeadLocation,null,JSON.stringify(b)),h["Committing changes"]);d.createProgressMonitor(b,h["Committing changes"]);b.then(function(){e.changedItem(c)},f)},
g={};g.Message=b.parameters.valueFor("name");g.Amend=b.parameters.valueFor("amend");for(var i=c.Clone.Config,j=0;j<i.length;j++)if(i[j].Key==="user.name")g.CommitterName=i[j].Value,g.AuthorName=i[j].Value;else if(i[j].Key==="user.email")g.CommitterEmail=i[j].Value,g.AuthorEmail=i[j].Value;g.Message&&g.CommitterName&&g.CommitterEmail&&!b.parameters.optionsRequested?d(g):(new r.CommitDialog({body:g,func:d})).show()},visibleWhen:function(){return!0}});d.addCommand(k);k=new c.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(b){var c=b.items;a.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(b){if(b){var b=a.getService("orion.page.message"),d=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(c.IndexLocation,"HARD"),h["Resetting local changes"]);
b.createProgressMonitor(d,h["Resetting local changes"]);d.then(function(){e.changedItem(c)},f)}})},visibleWhen:function(a){return j.hasStagedChanges(a)||j.hasUnstagedChanges(a)}});d.addCommand(k);k=new c.Command({name:h.Checkout,tooltip:h["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var c=g(b.items);a.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=a.getService("orion.page.message"),g=a.getService("orion.page.progress"),i=[],j=0;j<c.length;j++)i[j]=c[j].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,i),h["Resetting local changes"]);d.createProgressMonitor(g,h["Resetting local changes"]);g.then(function(){e.changedItem(c)},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 c.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 c.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 c.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 c.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,i,g,d){function c(b){this._init(b)}c.prototype=new d.PopupDialog;c.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';c.prototype._init=function(b){this.commit=b.commit;this._initialize(b.triggerNode,null,null,"mouseover",1E3)};c.prototype._bindToDom=function(){this._displayCommit(this.commit)};c.prototype._displayCommit=
function(b){var c=this.$parentPane,d=b.Message.split(/(\r?\n|$)/)[0],a=document.createElement("a");a.className="navlinkonpage";a.href=k.toUrl("git/git-commit.html#")+b.Location+"?page=1&pageSize=1";a.textContent=d;c.appendChild(a);d=document.createElement("div");d.style.paddingTop="15px";c.appendChild(d);if(b.AuthorImage)c=new Image,c.src=b.AuthorImage,c.name=b.AuthorName,c.className="git-author-icon",d.appendChild(c);c=document.createElement("div");c.textContent=g.formatMessage(h[" authored by ${0} {${1}) on ${2}"],
b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());d.appendChild(c);c=document.createElement("div");c.textContent=g.formatMessage(h["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);d.appendChild(c);c=document.createElement("div");c.style.paddingTop="15px";c.textContent=h["commit:"]+b.Name;d.appendChild(c);if(b.Parents&&b.Parents.length>0)c=document.createElement("div"),c.textContent=h["parent:"],a=document.createElement("a"),a.className="navlinkonpage",a.href=k.toUrl("git/git-commit.html#")+
b.Parents[0].Location+"?page=1&pageSize=1",a.textContent=b.Parents[0].Name,c.appendChild(a),d.appendChild(c);a=b.Tags&&b.Tags.length>0;if(b.Branches&&b.Branches.length>0){c=document.createElement("section");c.style.paddingTop="15px";c.textContent=h["branches: "];d.appendChild(c);var f=document.createElement("div");c.appendChild(f);for(c=0;c<b.Branches.length;++c){var i=document.createElement("span");i.style.paddingLeft="10px";i.textContent=b.Branches[c].FullName;f.appendChild(i)}}if(a){c=document.createElement("div");
c.style.paddingTop="15px";d.appendChild(c);c=document.createElement("section");d.appendChild(c);d=document.createElement("span");d.textContent=h["tags: "];c.appendChild(d);d=document.createElement("div");c.appendChild(d);for(c=0;c<b.Tags.length;++c)a=document.createElement("span"),a.style.paddingLeft="10px",a.textContent=b.Tags[c].Name,d.appendChild(a)}};c.prototype.constructor=c;return{CommitTooltipDialog:c}});
define("orion/git/gitLogExplorer","i18n!git/nls/gitmessages,require,orion/explorers/explorer,orion/PageUtil,orion/webui/littlelib,orion/section,orion/globalCommands,orion/git/gitCommands,orion/explorers/navigationUtils,orion/Deferred,orion/git/widgets/CommitTooltipDialog".split(","),function(h,k,i,g,d,c,b,j,e,a,f){c={};c.GitLogExplorer=function(){function c(a,b,d,e,f,g,h,i,j,k,l){this.registry=a;this.fileClient=b;this.commandService=d;this.selection=e;this.checkbox=f!==null?f.checkbox:!0;this.minimal=
f!==null?f.minimal:!1;this.parentId=g;this.pageTitleId=h;this.toolbarId=i;this.selectionToolsId=j;this.pageNavId=k;this.actionScopeId=l||f.actionScopeId;this.incomingCommits=[];this.outgoingCommits=[]}c.prototype.getCloneFileUri=function(){var a,b=g.matchResourceParameters().resource.split("gitapi/commit/");if(b.length===2&&(b=b[1].split("/"),b.length>1)){a="";for(var c=0;c<b.length-1;c++)a+="/"+b[c];a+="/"+b[b.length-1].split("?")[0]}return a};c.prototype.makeHref=function(a,b,c,d){c&&this.registry.getService("orion.page.progress").progress(a.read(c,
!0),"Getting git informatiob about "+c).then(function(a){if(d){var c=this.registry.getService("orion.git.provider");a.Git&&this.registry.getService("orion.page.progress").progress(c.getDefaultRemoteBranch(a.Git.RemoteLocation),"Getting default branch for "+a.Name).then(function(a){b.href=k.toUrl("git/git-log.html")+"#"+a.Location+"?page=1"})}else if(a.Git)b.href=k.toUrl("git/git-log.html")+"#"+a.Git.CommitLocation+"?page=1"},function(a){console.error("Error loading file metadata: "+a.message)})};
c.prototype.initTitleBar=function(c){var d=new a,e=c.toRef&&c.toRef.Type==="RemoteTrackingBranch",f=c.toRef&&c.toRef.Type==="Branch",g;e||f?(f=c.ContentLocation+c.RepositoryPath,g=c.toRef.Name):f=this.getCloneFileUri();var h=this;f?this.registry.getService("orion.page.progress").progress(this.fileClient.read(f,!0),"Getting metadata of "+f).then(function(a){this.isDirectory=a.Directory;var f=g?" ("+g+") ":"";b.setPageTarget({task:"Git Log",title:g?g+" on "+a.Name+" - Git Log":a.Name+" - Git Log",target:c,
breadcrumbTarget:a,breadcrumbRootName:a.Parents&&a.Parents.length>0?"Log"+f+a.Parents[a.Parents.length-1].Name:"Log"+f+a.Name,makeBreadcrumbLink:function(a,b){h.makeHref(h.fileClient,a,b,e)},serviceRegistry:h.registry,commandService:h.commandService});j.updateNavTools(h.registry,h.commandService,h,"pageActions","selectionTools",c);d.resolve()},function(a){d.reject(a)}):d.resolve();return d};c.prototype.redisplay=function(){this.display(g.matchResourceParameters().resourceRaw)};c.prototype.changedItem=
function(){this.redisplay()};c.prototype.getOutgoingIncomingChanges=function(b){var c=this,d=new a;this.registry.getService("orion.page.message").showWhile(d,h["Getting git incoming changes..."]);var e=function(a){var b=encodeURIComponent(a.FullName);c.toolbarId&&c.selectionToolsId&&j.updateNavTools(c.registry,c.commandService,c,c.toolbarId,c.selectionToolsId,a,c.pageNavId);var e=g.matchResourceParameters();c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getLog(a.HeadLocation,
b),"Getting log for "+a.Name).then(function(b){c.incomingCommits=b.Children;c.outgoingCommits=[];b=document.createElement("a");b.href=e.resource;c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").doGitLog(a.CommitLocation+b.search),"Getting incomming changes for "+a.Name).then(function(b){a.Children=b.Children;if(b.NextLocation){var c=document.createElement("a");c.href=b.NextLocation;a.NextLocation=a.Location+c.search}if(b.PreviousLocation)c=document.createElement("a"),
c.href=b.PreviousLocation,a.PreviousLocation=a.Location+c.search;d.resolve(a)})})};b.Type==="RemoteTrackingBranch"?e(b):b.Type==="Commit"&&b.toRef.Type==="RemoteTrackingBranch"?e(b.toRef):b.toRef?b.toRef.RemoteLocation&&b.toRef.RemoteLocation.length===1&&b.toRef.RemoteLocation[0].Children&&b.toRef.RemoteLocation[0].Children.length===1?c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getGitRemote(b.toRef.RemoteLocation[0].Children[0].Location),"Getting log for "+
b.Name).then(function(a){c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getLog(a.CommitLocation,"HEAD"),"Getting outgoing changes for "+b.Name).then(function(a){c.incomingCommits=[];c.outgoingCommits=a.Children;d.resolve(b)})}):d.resolve(b):d.resolve(b);return d};c.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)};
c.prototype.loadResource=function(b){var c=new a;this.registry.getService("orion.page.message").showWhile(c,h["Loading git log..."]);var d=this,e=this.registry.getService("orion.git.provider");this.registry.getService("orion.page.progress").progress(e.doGitLog(b),"Getting git log").then(function(a){d.registry.getService("orion.page.progress").progress(e.getGitClone(a.CloneLocation),"Getting repository details for "+a.Name).then(function(b){b=b.Children[0];a.Clone=b;a.ContentLocation=b.ContentLocation;
d.registry.getService("orion.page.progress").progress(e.getGitBranch(b.BranchLocation),"Getting default branch details for "+a.Name).then(function(b){for(var d=0;d<b.Children.length;d++){var e=b.Children[d];if(e.Current===!0)a.Clone.ActiveBranch=e.CommitLocation,c.resolve(a)}})})});return c};c.prototype.display=function(b){var c=this,d=this.registry.getService("orion.page.message"),e=new a;d.showWhile(e,h["Loading..."]);c.loadResource(b).then(function(a){e.resolve();c.initTitleBar(a).then(function(){c.getOutgoingIncomingChanges(a).then(function(a){c.toolbarId&&
c.selectionToolsId&&j.updateNavTools(c.registry,c.commandService,c,c.toolbarId,c.selectionToolsId,a,c.pageNavId);c.displayLog(a.Children)})})},function(a){e.resolve();c.handleError(a)})};c.prototype.displayLog=function(a){var b=this,c=d.node("table"),g=document.createElement("div");g.className="sectionTable";c.appendChild(g);g.innerHTML='<div id="logNode" class="mainPadding"></div>';var j=function(){function b(){}b.prototype={destroy:function(){},getRoot:function(b){b(a)},getChildren:function(a,b){a instanceof
Array&&a.length>0?b(a):b([])},getId:function(a){return a.Name}};return b}(),l=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.registry=b.registry}a.prototype=new i.SelectionRenderer;a.prototype.getCellElement=function(a,c,d){switch(a){case 0:var a=document.createElement("td"),g=document.createElement("div");g.className="sectionTableItem";a.appendChild(g);d=document.createElement("div");d.style.overflow="hidden";g.appendChild(d);for(var g=!1,i=0;i<b.incomingCommits.length;i++){var j=
b.incomingCommits[i];c.Name===j.Name&&(g=!0)}for(var l=!1,i=0;i<b.outgoingCommits.length;i++)j=b.outgoingCommits[i],c.Name===j.Name&&(l=!0);!g&&!l?g=document.createElement("span"):(i=l?"git-sprite-outgoing_commit":"git-sprite-incoming_commit",g=document.createElement("span"),g.className="sectionIcon gitImageSprite "+i);d.appendChild(g);if(c.AuthorImage)g=document.createElement("div"),g.style["float"]="left",i=new Image,i.src=c.AuthorImage,i.name=c.AuthorName,i.className="git-author-icon",g.appendChild(i),
d.appendChild(g);g=document.createElement("div");g.className="stretch";d.appendChild(g);d=document.createElement("a");d.className="navlinkonpage";d.href=k.toUrl("git/git-commit.html#")+c.Location+"?page=1&pageSize=1";d.textContent=c.Message;g.appendChild(d);e.addNavGrid(this.explorer.getNavDict(),c,d);new f.CommitTooltipDialog({commit:c,triggerNode:d});d=document.createElement("div");g.appendChild(d);d=document.createElement("span");d.textContent=h[" (SHA "]+c.Name+h[") by "]+c.AuthorName+" on "+
(new Date(c.Time)).toLocaleString();g.appendChild(d);return a;case 1:return this.getActionsColumn(c,d,null,null,!0)}};return a}();new (function(){function a(b,c,d,e,f){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.commandService=f;this.renderer=new l({registry:this.registry,commandService:this.commandService,actionScopeId:this.actionScopeId,cachePrefix:"LogNavigator",checkbox:!1},this);this.createTree(this.parentId,new j)}a.prototype=new i.Explorer;a.prototype.isRowSelectable=
function(){return!0};a.prototype.getItemCount=function(){return!1};return a}())(this.registry,this.selection,"logNode",this.actionScopeId,this.commandService)};return c}();return c});
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,i,g,d,c){var b=h.search(g);b>0&&(i.appendChild(document.createTextNode(h.substring(0,b))),h=h.substring(b));var g=h.replace(g,""),b=h.substring(0,h.length-g.length),j=b.split(" ",d);if(j.length===d){for(var h=document.createElement("a"),e=0;e<d;e++)c=c.replace("%"+
(e+1),j[e]);h.setAttribute("href",c);h.textContent=b;i.appendChild(h);h=g}return h},addLinks:function(h,i){var g=i||document.createElement("div"),d=this._registry.getServiceReferences("orion.core.linkScanner");if(d.length>0)for(var c=d[0],d=RegExp(c.getProperty("pattern"),"i"),b=c.getProperty("words"),c=c.getProperty("anchor"),j=h.search(d);j>=0;)h=this._replaceLink(h,g,d,b,c),j=h.search(d);h.length>0&&g.appendChild(document.createTextNode(h));return g}};h.prototype.constructor=h;return{TextLinkService:h}});
define('built-git-log.js',"i18n!git/nls/gitmessages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitClient,orion/ssh/sshTools,orion/git/gitLogExplorer,orion/git/gitCommands,orion/links,orion/PageUtil".split(","),function(h,k,i,g,d,c,b,j,e,a,f,l,n,m,q,s,p,r,t){g.startup().then(function(g){var i=g.serviceRegistry,g=g.preferences,k=
new f.OperationsClient(i);new d.StatusReportingService(i,k,"statusPane","notifications","notificationArea");new j.DialogService(i);var u=new e.Selection(i);new q.SshService(i);var w=new b.CommandRegistry({selection:u});new c.ProgressService(i,k,w);new r.TextLinkService({serviceRegistry:i});new m.GitService(i);var k=new a.FileClient(i),D=new l.Searcher({serviceRegistry:i,fileService:k,commandService:w}),z=new s.GitLogExplorer(i,k,w,u,null,"table","pageTitle","pageActions","selectionTools","pageNavigationActions",
"itemLevelCommands");n.setPageCommandExclusions(["eclipse.git.remote","eclipse.git.log"]);n.generateBanner("orion-gitlog",i,w,g,D,z);p.createFileCommands(i,w,z,"pageActions","selectionTools");w.addCommandGroup("itemLevelCommands","eclipse.gitGroup.nav",200,h.More);w.addCommandGroup("pageActions","eclipse.gitGroup.page",100);w.addCommandGroup("selectionTools","eclipse.selectionGroup",500,"More");w.registerCommandContribution("itemLevelCommands","eclipse.openGitCommit",1);w.registerCommandContribution("itemLevelCommands",
"eclipse.compareWithWorkingTree",2);w.registerCommandContribution("selectionTools","eclipse.compareGitCommits",1,"eclipse.selectionGroup");w.registerCommandContribution("pageActions","eclipse.orion.git.fetch",100,"eclipse.gitGroup.page");w.registerCommandContribution("pageActions","eclipse.orion.git.fetchForce",100,"eclipse.gitGroup.page");w.registerCommandContribution("pageActions","eclipse.orion.git.merge",100,"eclipse.gitGroup.page");w.registerCommandContribution("pageActions","eclipse.orion.git.push",
100,"eclipse.gitGroup.page");w.registerCommandContribution("pageActions","eclipse.orion.git.pushForce",100,"eclipse.gitGroup.page");w.registerCommandContribution("itemLevelCommands","eclipse.orion.git.addTag",3);w.registerCommandContribution("itemLevelCommands","eclipse.orion.git.cherryPick",3);w.registerCommandContribution("pageNavigationActions","eclipse.orion.git.previousLogPage",1);w.registerCommandContribution("pageNavigationActions","eclipse.orion.git.nextLogPage",2);i=t.matchResourceParameters();
z.display(i.resourceRaw);window.addEventListener("hashchange",function(){var a=t.matchResourceParameters();z.display(a.resourceRaw)},!1)})});