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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 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, 2014 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.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, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 *		Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584
 ******************************************************************************/

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

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

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

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

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

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

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

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

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

 /*global define document window */

/*

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: Anton McConville - 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


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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 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
*/
(function(){function g(c,e,b,f,h,d){e[c]&&(b.push(c),(e[c]===!0||e[c]===1)&&f.push(h+c+"/"+d))}function k(c,e,b,f,h){e=f+e+"/"+h;require._fileExists(c.toUrl(e+".js"))&&b.push(e)}function j(c,e,b){for(var f in e)e.hasOwnProperty(f)&&(!c.hasOwnProperty(f)||b)?c[f]=e[f]:typeof e[f]==="object"&&j(c[f],e[f],b)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var i=c.config?c.config():{};return{version:"2.0.1+",load:function(b,f,h,d){d=d||{};if(d.locale)i.locale=d.locale;
var a=e.exec(b),c=a[1],m=a[4],o=a[5],s=m.split("-"),r=[],v={},u,w="";if(a[5])c=a[1],b=c+o;else{o=a[4];m=i.locale;if(!m)m=i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();s=m.split("-")}if(d.isBuild){r.push(b);k(f,"root",r,c,o);for(u=0;u<s.length;u++)d=s[u],w+=(w?"-":"")+d,k(f,w,r,c,o);f(r,function(){h()})}else f([b],function(a){var d=[],b;g("root",a,d,r,c,o);for(u=0;u<s.length;u++)b=s[u],w+=(w?"-":"")+b,g(w,a,d,r,c,o);f(r,function(){var b,
n,e;for(b=d.length-1;b>-1&&d[b];b--){e=d[b];n=a[e];if(n===!0||n===1)n=f(c+e+"/"+o);j(v,n)}h(v)})})}}})})();
define("orion/i18n",[],function(){return{load:function(g,k,j,e){var e=e||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,i=c.exec(g);if(i){if(!k.defined||k.defined(g))try{j(k(g));return}catch(b){}if(e.isBuild||e.isTest)j({});else if(k.specified&&!k.specified("orion/bootstrap"))j({});else{var f=i[1],h=i[3]?i[2]:"",d=i[3]||i[2];k(["orion/bootstrap"],function(a){a.startup().then(function(a){var b=a.serviceRegistry,a=b.getServiceReferences("orion.i18n.message");if(h)a.some(function(a){return g===a.getProperty("name")?
(b.getService(a).getMessageBundle().then(function(a){j(a)},function(){j({})}),!0):!1})||j({});else{var o={},s;a.forEach(function(a){var b=a.getProperty("name");if((i=c.exec(b))&&f===i[1]&&d===(i[3]||i[2]))if(h=i[3]?i[2]:""){if((a=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.toLowerCase().indexOf(h.toLowerCase())===0)o[h]=!0,(!k.specified||!k.specified(b))&&define(b,["orion/i18n!"+b],function(a){return a})}else s=a});!k.specified||!k.specified(g)?s?
b.getService(s).getMessageBundle().then(function(a){Object.keys(o).forEach(function(d){typeof a[d]==="undefined"&&(a[d]=o[d])});define(g,[],a);j(a)},function(){define(g,[],o);j(o)}):(define(g,[],o),j(o)):j(o)}})})}}else j(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"All Git Repositories",Repo:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ",
"Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Open the Git Status page for the repository containing this file or folder.","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...",
"Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...",
"Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch",
"Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?",
"Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...","Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.",
"The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found",
"No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!",
"Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches","tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',
"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits","The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries",
"Unstaged addition":"Unstaged addition","Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository",
"Go to the git repository":"Open the Git Repository page for this file or folder.","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:","ChangeId:":"ChangeId:","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:","Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",
Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit","New Branch:":"New Branch:","No remote selected":"No remote selected","Enter a name...":"Enter a name...",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":"Open the remote Git Log page for this file or folder.","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":"Open the local Git Log page for this file or folder.","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository",
ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","Password:":"Password:","User Name:":"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",
"Push Branch":"Push Branch","Push commits without tags from your local branch into the remote branch":"Push commits without tags from your local branch into the remote branch","Push for Review":"Push for Review","Push commits to Gerrit Code Review":"Push commits to Gerrit Code Review","Force Push Branch":"Force Push Branch","Push commits without tags from your local branch into the remote branch overriding its current content":"Push commits without tags from your local branch into the remote branch overriding its current content",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository","Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick",
"Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch",
"Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository","Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ",
"Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?","Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:",
"Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Fetching previous commit message":"Fetching previous commit message","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes","Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",
Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch","Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch",
"See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:","Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub",
"Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org","Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name",
"Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...","The commit can be found in the following repositories":"The commit can be found in the following repositories",
"Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.",
"URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",". Could not revert into active branch":". Could not revert into active branch",Login:"Login","Authentication required for: ${0}. ${1} and re-try the request.":"Authentication required for: ${0}. ${1} and re-try the request."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
(function(g,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(g.orion=g.orion||{},g.orion.Deferred=k())})(this,function(){function g(){for(var b;b=c.shift();)b();i=!1}function k(b){c.push(b);i||(i=!0,setTimeout(g,0))}function j(b){return function(){b.apply(void 0,arguments)}}function e(){function b(){for(var d;d=m.shift();){var h=d.deferred,b=l==="fulfilled"?"resolve":"reject";if(typeof d[b]==="function")try{var f=(0,d[b])(a),e=f&&(typeof f===
"object"||typeof f==="function")&&f.then;if(typeof e==="function")if(f===h.promise)h.reject(new TypeError);else{var i=f.cancel;typeof i==="function"?h._protected(c).parentCancel=i.bind(f):delete h._protected(c).parentCancel;e.call(f,j(h.resolve),j(h.reject),j(h.progress))}else h.resolve(f)}catch(n){h.reject(n)}else h[b](a)}}function f(d){delete g.parentCancel;l="rejected";a=d;m.length&&k(b)}function h(d){function c(a){return function(d){j||(j=!0,a(d))}}var j=!1;delete g.parentCancel;try{var w=d&&
(typeof d==="object"||typeof d==="function")&&d.then;if(typeof w==="function")if(d===i)f(new TypeError);else{l="assumed";var t=d&&d.cancel;if(typeof t!=="function"){var x=new e,d=x.promise;try{w(x.resolve,x.reject,x.progress)}catch(n){x.reject(n)}t=d.cancel;w=d.then}a=d;w.call(d,c(h),c(f));g.parentCancel=t.bind(d)}else l="fulfilled",a=d,m.length&&k(b)}catch(p){c(f)(p)}}function d(){var a=g.parentCancel;if(a)delete g.parentCancel,a();else if(!l)a=Error("Cancel"),a.name="Cancel",f(a)}var a,l,m=[],i=
this,g={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==c)throw Error("protected");return g}});this.resolve=function(a){l||h(a);return i};this.reject=function(a){l||f(a);return i};this.progress=function(a){l||m.forEach(function(d){if(d.progress)try{d.progress(a)}catch(h){}});return i.promise};this.cancel=function(){g.parentCancel?setTimeout(d,0):d();return i};this.then=function(a,d,h){a={resolve:a,reject:d,progress:h,deferred:new e};m.push(a);a.deferred._protected(c).parentCancel=
i.promise.cancel.bind(i);(l==="fulfilled"||l==="rejected")&&k(b);return a.deferred.promise};this.promise={then:i.then,cancel:i.cancel}}var c=[],i=!1;e.all=function(b,f){function h(d,h){m||(c[d]=h,--a===0&&i.resolve(c))}function d(a,d){if(!m){if(f)try{h(a,f(d));return}catch(b){d=b}i.reject(d)}}var a=b.length,c=[],m=!1,i=new e;i.then(void 0,function(){m=!0;b.forEach(function(a){a.cancel&&a.cancel()})});a===0?i.resolve(c):b.forEach(function(a,b){a.then(h.bind(void 0,b),d.bind(void 0,b))});return i.promise};
e.when=function(b,f,h,d){var a;if(!(b&&typeof b.then==="function"))a=new e,a.resolve(b),b=a.promise;return b.then(f,h,d)};return e});
define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var j=this._namedListeners[g.type];j&&j.forEach(function(e){try{typeof e==="function"?e(g):e.handleEvent(g)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!g.defaultPrevented},addEventListener:function(g,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(j)},
removeEventListener:function(g,j){var e=this._namedListeners[g];if(e)for(var c=0;c<e.length;c++)if(e[c]===j){e.length===1?delete this._namedListeners[g]:e.splice(c,1);break}}};g.prototype.constructor=g;g.attach=function(k){var j=new g;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return g});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function j(b,h,d){this._properties=d||{};this._properties["service.id"]=b;this._properties.objectClass=h;this._properties["service.names"]=h}function e(b,h,d){this._serviceId=b;this._serviceReference=h;this._internalRegistry=d}function c(b,h){function d(a){return function(){var d;try{if(!h())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 d=new g,d.resolve(c)}catch(e){d=new g,d.reject(e)}return d.promise}}for(var a in b)typeof b[a]==="function"&&(this[a]=d(a))}function i(b,h){this.type=b;this.serviceReference=h}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var b=this;this._internalRegistry={isRegistered:function(h){return b._entries[h]?!0:!1},unregisterService:function(h){var d=b._entries[h];if(!d)throw Error("Service has already been unregistered: "+h);var a=d.reference;b._serviceEventTarget.dispatchEvent(new i("unregistering",
a));b._entries[h]=null;a.getProperty("objectClass").forEach(function(d){for(var h=b._namedReferences[d],c=0;c<h.length;c++)if(h[c]===a){h.length===1?delete b._namedReferences[d]:h.splice(c,1);break}})},modifyService:function(h){var d=b._entries[h];if(!d)throw Error("Service not found while trying to send modified event: "+h);b._serviceEventTarget.dispatchEvent(new i("modified",d.reference))}}}j.prototype={getPropertyKeys:function(){var b=[],h;for(h in this._properties)this._properties.hasOwnProperty(h)&&
b.push(h);return b},getProperty:function(b){return this._properties[b]}};j.prototype.constructor=j;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(b){var h=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;
b.objectClass=h.objectClass;b["service.names"]=h["service.names"];this._internalRegistry.modifyService(this._serviceId)}};e.prototype.constructor=e;b.prototype={getService:function(b){var h;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(d){h=this._entries[d.getProperty("service.id")].service;return!!h},this);else if(b=this._entries[b.getProperty("service.id")])h=b.service;return h||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var h=[];this._entries.forEach(function(d){d&&h.push(d.reference)});return h},registerService:function(b,h,d){if(typeof h==="undefined"||h===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var a=this._entries.length,l=new j(a,b,d),m=this._namedReferences;b.forEach(function(a){m[a]=m[a]||[];m[a].push(l)});b=new c(h,this._internalRegistry.isRegistered.bind(null,a));this._entries.push({reference:l,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new i("registered",
l));return new e(a,l,b)},addEventListener:function(b,h){this._serviceEventTarget.addEventListener(b,h)},removeEventListener:function(b,h){this._serviceEventTarget.removeEventListener(b,h)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(g){function k(g,e,c,i){var b=typeof c.response!=="undefined"?c.response:c.responseText,f;try{f=c.status}catch(h){f=0}g={args:e,response:b,responseText:typeof b==="string"?b:null,status:f,url:g,xhr:c};if(typeof i!=="undefined")g.error=i;return g}return function(j,e,c){var c=c||{},i=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new g,f=c.headers||{},h=c.log||!1,d;typeof f["X-Requested-With"]==="undefined"&&(f["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(j==="POST"||j==="PUT"))d=c.data;var a=!1,l=!1;b.promise.then(void 0,function(d){a=!0;!l&&d instanceof Error&&d.name==="Cancel"&&i.abort()});i.onabort=function(){l=!0;if(!a){var d=Error("Cancel");d.name="Cancel";b.reject(d)}};i.onload=function(){var a=k(e,c,i);200<=i.status&&i.status<400?b.resolve(a):(b.reject(a),h&&typeof console!=="undefined"&&console.log(Error(i.statusText)))};i.onerror=function(){var a=k(e,c,i);b.reject(a);h&&typeof console!=="undefined"&&console.log(Error(i.statusText))};
i.onprogress=function(a){a.xhr=i;b.progress(a)};try{i.open(j,e,!0);if(typeof c.responseType==="string")i.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof i.timeout==="number")i.timeout=c.timeout,i.addEventListener("timeout",function(){b.reject(k(e,c,i,"Timeout exceeded"))});else{var m=setTimeout(function(){b.reject(k(e,c,i,"Timeout exceeded"))},c.timeout);b.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(f).forEach(function(a){i.setRequestHeader(a,
f[a])});i.send(d||null)}catch(o){b.reject(k(e,c,i,o))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(g,k,j){function e(d,a){this._name=d;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function c(d,a){return{get:function(b,h){if(a===0)return null;var f=localStorage.getItem(d+b);if(f===null)return null;f=JSON.parse(f);return h||a===-1||f._expires&&f._expires>(new Date).getTime()?(delete f._expires,f):null},set:function(b,h){if(a!==0){if(a!==-1)h._expires=(new Date).getTime()+
1E3*a;if(Object.keys(h).length===0)localStorage.removeItem(d+b);else{var f=JSON.stringify(h);localStorage.setItem(d+b,f);delete h._expires}}},remove:function(a){localStorage.removeItem(d+a)}}}function i(d){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=d.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=d.getService(a[0])}return!!this._service}}function b(d){this._location=
d;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function f(){this._cache=new c("/orion/preferences/local",-1)}function h(d,a){this._userProvider=new i(d);this._localProvider=new f;a=a||"defaults.pref";a.indexOf("://")===-1&&(a=g.toUrl(a));this._defaultsProvider=new b(a);this._serviceRegistration=d.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var d=[],a=0;a<this._stores.length;++a){var b=this._stores[a];this._dirty.indexOf(b)!==-1&&
d.push(this._providers[a].put(this._name,b));if(this._pendingDeletes[a]&&this._pendingDeletes[a].length>0){for(b=0;b<this._pendingDeletes[a].length;b++)d.push(this._providers[a].remove(this._name,this._pendingDeletes[a][b]));delete this._pendingDeletes[a]}}this._dirty=[];return k.all(d)},_scheduleFlush:function(d){d&&this._dirty.indexOf(d)===-1&&this._dirty.push(d);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 d=0;d<this._stores.length;++d){var a=this._stores[d],b;for(b in a)a.hasOwnProperty(b)&&typeof this._cached[b]==="undefined"&&(this._cached[b]=a[b])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(d){return this._getCached()[d]},put:function(d,a){if(this._stores.length!==0){var b=this._stores[0];if(b[d]!==a)b[d]=a,this._cached=null,this._scheduleFlush(b)}},remove:function(d){for(var a=0;a<
this._stores.length;++a){var b=this._stores[a];if(b.hasOwnProperty(d))return delete b[d],this._pendingDeletes[a]||(this._pendingDeletes[a]=[]),this._pendingDeletes[a].push(d),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var d=0;d<this._stores.length;++d)this._stores[d]={},this._scheduleFlush(this._stores[d]);this._cached=null},sync:function(d){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,b=[],h=0;h<this._providers.length;++h)b.push(this._providers[h].get(this._name,
d).then(function(d){return function(b){a._stores[d]=b}}(h)));return k.all(b).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};i.prototype={get:function(d,a){if(this._currentPromises[d])return this._currentPromises[d];var b=new k,h=null;a?this._cache.remove(d):h=this._cache.get(d);if(h!==null)b.resolve(h);else{this._currentPromises[d]=b;var f=this;this._service.get(d).then(function(a){f._cache.set(d,a);delete f._currentPromises[d];b.resolve(a)},function(a){a.status===
404?(a={},f._cache.set(d,a),delete f._currentPromises[d],b.resolve(a)):(delete f._currentPromises[d],b.resolve(f._cache.get(d,!0)||{}))})}return b},put:function(d,a){this._cache.set(d,a);return this._service.put(d,a)},remove:function(d,a){var b=this._cache.get(d);delete b[a];this._cache.set(d,b);return this._service.remove(d,a)}};b.prototype={get:function(d,a){if(this._currentPromise)return this._currentPromise;var b=new k,h=null;a?this._cache.remove(d):h=this._cache.get(d);if(h!==null)b.resolve(h);
else{this._currentPromise=b;var f=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);f._cache.set(d,a[d]||{});f._currentPromise=null;b.resolve(a[d]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(f._cache.set(d,{}),f._currentPromise=null,b.resolve({})):(f._currentPromise=null,a=f._cache.get(d,!0),a!==null?b.resolve(a[d]||{}):b.resolve({}))})}return b},put:function(){var d=new k;d.resolve();return d},remove:function(d,a){var b=
this._cache.get(d);delete b[a];this.put(d,b)}};f.prototype={get:function(d){var a=new k,d=this._cache.get(d);d!==null?a.resolve(d):a.resolve({});return a},put:function(d,a){var b=new k;this._cache.set(d,a);b.resolve();return b},remove:function(d,a){var b=this._cache.get(d);delete b[a];this.put(d,b)}};h.DEFAULT_SCOPE=1;h.LOCAL_SCOPE=2;h.USER_SCOPE=4;h.prototype={listenForChangedSettings:function(d,a,b){if(!a||typeof a!=="number"||a>7||a<1)b=a,a=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;window.addEventListener("storage",
b,!1);if((h.USER_SCOPE&a)!==0)return"/orion/preferences/user"+d;else if((h.LOCAL_SCOPE&a)!==0)return"/orion/preferences/local"+d;return"/orion/preferences/default"+d},getPreferences:function(d,a){if(!a||typeof a!=="number"||a>7||a<1)a=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;var b=[];h.USER_SCOPE&a&&this._userProvider.available()&&b.push(this._userProvider);h.LOCAL_SCOPE&a&&b.push(this._localProvider);h.DEFAULT_SCOPE&a&&b.push(this._defaultsProvider);var f=new e(d,b);return f.sync().then(function(){return f})},
getSetting:function(d,a,b){for(var h,f=0;f<d.length;f++)if(d[f].label===a)for(var c=0;c<d[f].data.length;c++)if(d[f].data[c].label===b){h=d[f].data[c].value;break}return h}};return{PreferencesService:h}});
(function(){function g(a){if(typeof a!=="string")throw new TypeError;}function k(a){return a?a.split("&"):[]}function j(a){return a.length===0?"":a.join("&")}function e(a){var d=/([^=]*)(?:=?)(.*)/.exec(a),a=d[1]?decodeURIComponent(d[1]):"",d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function c(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="="+encodeURIComponent(a[1]));return d}function i(a,d){var b="",h=[],f=0;return{next:function(){if(b!==a.query)b=a.query,h=k(b);if(f<h.length){var n=e(h[f++]);
switch(d){case "keys":return n[0];case "values":return n[1];case "keys+values":return[n[0],n[1]];default:throw new TypeError;}}throw q;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function f(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function h(a){var d=[];a.split("/").forEach(function(a){a===".."?d.pop():a!=="."&&d.push(a)});return d.join("/")}function d(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function a(a,b){if(typeof a!==
"string")throw new TypeError;var a=d(a),n=s.exec(a);if(!n)return null;var c={};c.scheme=n[1]||"";if(c.scheme&&!v.test(c.scheme))return null;var p=n[2];if(p&&(p=r.exec(p),c.userinfo=p[1],c.host=p[2],c.port=p[3],c.port&&!u.test(c.port)))return null;c.path=n[3];c.query=n[4];c.fragment=n[5];if(!c.scheme&&b&&(c.scheme=b.scheme,!c.host&&b.host))c.userinfo=b.userinfo,c.host=b.host,c.port=b.port,c.pathRelative=!0;if(c.pathRelative)if(c.path){if(c.path[0]!=="/")n=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",c.path=
n+c.path}else c.path=b.path;if(c.scheme)c.scheme=c.scheme.toLowerCase();if(c.port)c.port=f(c.port);if(c.host&&c.path)c.path=h(c.path);return c}function l(d,h){var f;if(h){h=h.href||h;f=a(h);if(!f||!f.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:f})}f=a(d,f);if(!f)throw new SyntaxError;Object.defineProperty(this,"_input",{value:d,writable:!0});Object.defineProperty(this,"_url",{value:f,writable:!0});var n=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?
n:null},enumerable:!0})}try{var m;if(typeof window.URL==="function"&&window.URL.length!==0&&(m=new window.URL("http://www.w3.org?q")).protocol==="http:"&&m.query)return}catch(o){}var s=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,r=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,v=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,x=/^([^?#\s]*)$/,n=/^([^\s]*)$/,p=/^\S*$/,y=/([^:]*):?(.*)/,q=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),z={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){g(a);var d;k(this._url.query).some(function(b){b=e(b);if(b[0]===a)return d=b[1],!0});return d},enumerable:!0},set:{value:function(a,d){g(a);g(d);var b=k(this._url.query);b.some(function(h,f){var n=e(h);if(n[0]===a)return n[1]=d,b[f]=c(n),!0})||b.push(c([a,d]));this._url.query=j(b)},enumerable:!0},has:{value:function(a){g(a);
return k(this._url.query).some(function(d){if(e(d)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){g(a);var d=k(this._url.query),b=d.filter(function(d){return e(d)[0]!==a});return b.length!==d.length?(this._url.query=j(b),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if(typeof a!=="function")throw new TypeError;var b=i(this._url,"keys+values");try{for(;;){var h=b.next();a.call(d,h[1],h[0],this)}}catch(f){if(f!==q)throw f;
}},enumerable:!0},keys:{value:function(){return i(this._url,"keys")},enumerable:!0},values:{value:function(){return i(this._url,"values")},enumerable:!0},items:{value:function(){return i(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(a){g(a);var d=[];k(this._url.query).forEach(function(b){b=e(b);b[0]===a&&d.push(b[1])});return d},enumerable:!0},append:{value:function(a,d){g(a);g(d);var b=k(this._url.query);b.push(c([a,d]));this._url.query=
j(b)},enumerable:!0}});Object.defineProperties(l.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(d){g(d);this._input=d;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){g(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,a===""||v.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){g(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=y.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){g(a);if(this._url){var d=
y.exec(this._userinfo),a=[encodeURIComponent(a||"")];d[2]&&a.push(d[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=y.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){g(a);if(this._url){var d=[y.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){g(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=f(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){g(a);if(this._url&&w.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===z[this.protocol]&&(a="");return a},set:function(a){g(a);if(this._url&&u.exec(a))this._url.port=f(a)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){g(a);
if(this._url&&x.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?h(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){g(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),n.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){g(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),p.exec(a)))this._url.fragment=a},enumerable:!0}});
if((m=window.URL||window.webkitURL)&&m.createObjectURL)Object.defineProperty(l,"createObjectURL",{value:m.createObjectURL.bind(m),enumerable:!1}),Object.defineProperty(l,"revokeObjectURL",{value:m.revokeObjectURL.bind(m),enumerable:!1});window.URL=l})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(g,k){function j(a,d){var b=Object.keys(a),h=Object.keys(d);if(b.length!==h.length)return!1;b.sort();h.sort();for(var f=0,c=b.length;f<c;f++){var e=b[f];if(e!==h[f])return!1;var i=a[e],e=d[e];if(i!==e&&JSON.stringify(i)!==JSON.stringify(e))return!1}return!0}function e(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(d){}return a}function c(a){var d=null,b={key:function(b){return(d=
d||Object.keys(a))[b]},getItem:function(d){return a[d]},setItem:function(b,h){a[b]=h;d=null},removeItem:function(b){delete a[b];d=null},clear:function(){(d=d||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));d=null}};Object.defineProperty(b,"length",{get:function(){return(d=d||Object.keys(a)).length}});return b}function i(a,d){if(d&&d instanceof XMLHttpRequest){var b,h;try{b=d.status,h=d.statusText}catch(f){b=0,h=""}return{status:b||0,statusText:h}}return d}function b(a){var d=a?JSON.parse(JSON.stringify(a,
i)):a;if(a instanceof Error)d.__isError=!0,d.message=d.message||a.message,d.name=d.name||a.name;return d}function f(a,d){this.type=a;this.plugin=d}function h(a,d){this.__objectId=a;this.__methods=d}function d(a,d,c){function e(a){B&&c.postMessage(a,B)}function i(a){if(!B)return(new g).reject(Error("plugin not connected"));a.id=String(O++);var d=new g;S[a.id]=d;d.then(null,function(d){A==="active"&&d instanceof Error&&d.name==="Cancel"&&e({requestId:a.id,method:"cancel",params:d.message?[d.message]:
[]})});var b=Object.prototype.toString;a.params.forEach(function(f,n){if(b.call(f)==="[object Object]"&&!(f instanceof h)){var c,p;for(c in f)b.call(f[c])==="[object Function]"&&(p=p||[],p.push(c));if(p){var l=X++;T[l]=f;c=function(){delete T[l]};d.then(c,c);a.params[n]=new h(l,p)}}});c.postMessage(a,B);return d.promise}function v(a,d){a||a===0?e({id:a,result:null,error:d}):console.log(d)}function u(a,d,h,f){f.forEach(function(a,d){if(a&&typeof a.__objectId!=="undefined"){var b={};a.__methods.forEach(function(d){b[d]=
function(){return i({objectId:a.__objectId,method:d,params:Array.prototype.slice.call(arguments)})}});f[d]=b}});var c=typeof a===void 0?null:{id:a,result:null,error:null};try{var n=h.apply(d,f);if(c)n&&typeof n.then==="function"?(R[a]=n,n.then(function(d){delete R[a];c.result=d;e(c)},function(d){if(R[a])delete R[a],c.error=b(d),e(c)},function(){e({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(c.result=n,e(c))}catch(p){if(c)c.error=b(p),e(c)}}function w(a){try{if(a.method){var d=
a.method,b=a.params||[];if("serviceId"in a){var h=P[a.serviceId];h||v(a.id,"service not found");d in h?u(a.id,h,h[d],b):v(a.id,"method not found")}else if("objectId"in a){var f=T[a.objectId];f||v(a.id,"object not found");d in f?u(a.id,f,f[d],b):v(a.id,"method not found")}else if("requestId"in a){var n=R[a.requestId];n&&d==="cancel"&&n.cancel&&n.cancel.apply(n,b)}else if("responseId"in a){var p=S[a.responseId];p&&d==="progress"&&p.progress&&p.progress.apply(p,b)}else if("plugin"===a.method){var l=
a.params[0];J({headers:l.headers,services:l.services}).then(function(){D&&D.resolve(y)})}else if("timeout"===a.method)D&&D.reject(a.error);else throw Error("Bad method: "+a.method);}else{var e=S[String(a.id)];delete S[String(a.id)];if(a.error){var i=c.handleServiceError(y,a.error);e.reject(i)}else e.resolve(a.result)}}catch(m){console.log("Plugin._messageHandler "+m)}}function t(a){var d={};if(a.methods&&(a.methods.forEach(function(b){d[b]=function(){var d={serviceId:a.serviceId,method:b,params:Array.prototype.slice.call(arguments)};
return A==="active"?i(d):y.start({"transient":!0}).then(function(){return i(d)})}}),d.addEventListener&&d.removeEventListener)){var b=new k,f=X++;T[f]={handleEvent:b.dispatchEvent.bind(b)};var c=new h(f,["handleEvent"]),n=d.addEventListener;d.addEventListener=function(a,d){b._namedListeners[a]||n(a,c);b.addEventListener(a,d)};var p=d.removeEventListener;d.removeEventListener=function(a,d){b.removeEventListener(a,d);b._namedListeners[a]||p(a,c)}}return d}function x(d){var b=JSON.parse(JSON.stringify(d.properties));
b.__plugin__=a;d=d.names||d.type||[];Array.isArray(d)||(d=[d]);b.objectClass=d;return b}function n(a){var d=t(a),b=x(a),b=c.registerService(a.names||a.type,d,b);K[a.serviceId]={registration:b,proxy:d}}function p(){c.persist(a,{created:q,headers:z,services:C,autostart:H,lastModified:I})}var y=this,d=d||{},q=d.created||(new Date).getTime(),z=d.headers||{},C=d.services||[],H=d.autostart,I=d.lastModified||0,A="installed",E,D,B,M,K={},O=0,X=0,R={},S={},T={},P={},J;this._persist=p;this._resolve=function(){A=
"resolved";c.dispatchEvent(new f("resolved",y))};this._getAutostart=function(){return H};this._getCreated=function(){return q};this.getLocation=function(){return a};this.getHeaders=function(){return JSON.parse(JSON.stringify(z))};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 I};this.getServiceReferences=function(){var a=[];Object.keys(K).forEach(function(d){a.push(K[d].registration.getReference())});
return a};this.setParent=function(a){return M!==a?(M=a,y.stop({"transient":!0}).then(function(){if("started"===H)return y.start({"transient":!0});else if("lazy"===H)return y.start({lazy:!0,"transient":!0})})):(new g).resolve()};this.getState=function(){return A};this.start=function(d){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(E)return E.promise.then(this.start.bind(this,d));if(A==="active")return(new g).resolve();if(!d||!d.transient){var b=d&&d.lazy?"lazy":"started";
b!==H&&(H=b,p())}b=c.getState();if(b!=="starting"&&b!=="active")return d.transient?(new g).reject(Error("start transient error")):(new g).resolve();if(A==="installed")try{this._resolve()}catch(h){return(new g).reject(h)}A==="resolved"&&C.forEach(function(a){n(a)});if(d&&d.lazy)return A!=="starting"&&(A="starting",c.dispatchEvent(new f("lazy activation",y))),(new g).resolve();var e=new g;E=e;A="starting";c.dispatchEvent(new f("starting",y));D=new g;B=c.connect(a,w,M);D.then(function(){D=null;A="active";
c.dispatchEvent(new f("started",y));E=null;e.resolve()},function(){D=null;A="stopping";c.dispatchEvent(new f("stopping",y));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});c.disconnect(B);B=null;A="resolved";E=null;c.dispatchEvent(new f("stopped",y));e.reject(Error("plugin activation error"))});return e.promise};this.stop=function(a){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(E)return E.promise.then(this.stop.bind(this,a));if((!a||
!a.transient)&&"stopped"!==H)H="stopped",p();if(A!=="active"&&A!=="starting")return(new g).resolve();E=a=new g;A="stopping";c.dispatchEvent(new f("stopping",y));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});B&&(c.disconnect(B),B=null);A="resolved";E=null;c.dispatchEvent(new f("stopped",y));a.resolve();return a.promise};J=function(d){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!d)return I===0&&(I=(new Date).getTime(),p()),c.loadManifest(a).then(J);
var b=z,h=C,e=H;z=d.headers||{};C=d.services||{};H=d.autostart||H;d.lastModified?I=d.lastModified:(I=(new Date).getTime(),p());if(j(z,b)&&j(C,h)&&H===e)return(new g).resolve();if(A==="active"||A==="starting"){var i=[];Object.keys(C).forEach(function(a){var d=C[a];i.push(a);var b=K[a];if(b){if(j(d.methods,Object.keys(b.proxy))){var a=x(d),h=b.registration.getReference(),f={};h.getPropertyKeys().forEach(function(a){f[a]=h.getProperty(a)});j(a,f)||b.registration.setProperties(a);return}b.registration.unregister();
delete K[a]}n(d)});Object.keys(K).forEach(function(a){i.indexOf(a)===-1&&(K[a].registration.unregister(),delete K[a])})}A==="active"&&(c.disconnect(B),D=new g,B=c.connect(a,w,M),D.then(function(){D=null},function(){D=null;A="stopping";c.dispatchEvent(new f("stopping"),y);Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});c.disconnect(B);B=null;A="resolved";c.dispatchEvent(new f("stopped",y))}));return(new g).resolve()};this.update=function(a){return J(a).then(function(){c.dispatchEvent(new f("updated",
y))})};this.uninstall=function(){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(A==="active"||A==="starting"||A==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));c.removePlugin(this);A="uninstalled";c.dispatchEvent(new f("uninstalled",y));return(new g).resolve()}}var a=/^http[s]?/i;return{Plugin:d,PluginRegistry:function(b,h){function i(a){var d=a.source;w.some(function(b){if(d===b.target){try{var h;if(typeof b.useStructuredClone===
"undefined"){var f=typeof a.data!=="string";h=f?a.data:JSON.parse(a.data);b.useStructuredClone=f}else h=b.useStructuredClone?a.data:JSON.parse(a.data);b.handler(h)}catch(c){}return!0}})}var h=h||{},j=h.storage||localStorage;j.getItem||(j=c(j));var r="installed",v,u=[],w=[],t=new k,x={},n={registerService:b.registerService.bind(b),connect:function(a,d,b,h){function f(a){a=Error(a);a.name="timeout";d({method:"timeout",error:a})}var c={handler:d,url:a},n=setTimeout(f.bind(null,"Load timeout for: "+a),
h||15E3),l=document.createElement("iframe");l.name=a+"_"+(new Date).getTime();l.src=a;l.onload=function(){clearTimeout(n);n=setTimeout(f.bind(null,"Plugin handshake timeout for: "+a),5E3)};l.sandbox="allow-scripts allow-same-origin";l.style.width=l.style.height="100%";l.frameBorder=0;(b||v).appendChild(l);c.target=l.contentWindow;c.close=function(){clearTimeout(n);if(l){var a=l.parentNode;a&&a.removeChild(l);l=null}};w.push(c);return c},disconnect:function(a){for(var d=0;d<w.length;d++)if(a===w[d]){w.splice(d,
1);try{a.close()}catch(b){}break}},removePlugin:function(a){for(var d=0;d<u.length;d++)if(a===u[d]){u.splice(d,1);break}j.removeItem("plugin."+a.getLocation())},persist:function(a,d){j.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{t.dispatchEvent(a)}catch(d){console&&console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new g,b=n.connect(a,function(a){b&&
a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],n.disconnect(b),b=null,d.resolve(a)):"timeout"===a.method&&(n.disconnect(b),b=null,d.reject(a.error)))});return d.promise},getState:function(){return r},handleServiceError:function(d,b){if(b&&b.status===401){var h=d.getHeaders(),f=d.getName()||d.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+f+"."));if(h.login)c.appendChild(document.createTextNode(" ")),f=document.createElement("a"),
f.target="_blank",f.textContent="Login",f.href=h.login,a.test(f.href)?(c.appendChild(f),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+h.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(c)}}if(b.__isError){var n=b,b=Error(n.message);Object.keys(n).forEach(function(a){b[a]=n[a]});delete b.__isError}return b}};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=n.getState;this.init=function(){if(!(r==="starting"||r==="active"||r==="stopping")){addEventListener("message",i,!1);for(var a=[],b=0,f=j.length;b<f;b++)a.push(j.key(b));a.forEach(function(a){if(a.indexOf("plugin.")===0){var b=a.substring(7),a=JSON.parse(j.getItem(a));a.created&&u.push(new d(b,a,n))}});u.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});if(h.parent)v=h.parent;else{v=document.createElement("div");
if(!h.visible)v.style.display="none",v.style.visibility="hidden";document.body.appendChild(v)}h.plugins&&Object.keys(h.plugins).forEach(function(a){a=e(a);if(!this.getPlugin(a)){var b=h.plugins[a];typeof b!=="object"&&(b={});b.autostart=b.autostart||h.defaultAutostart||"lazy";u.push(new d(a,b,n))}}.bind(this));r="starting"}};this.start=function(){r!=="starting"&&this.init();if(r!=="starting")return(new g).reject("Cannot start framework. Framework is already "+r+".");var a=[],d=(new Date).getTime();
u.forEach(function(b){var h=b._getAutostart();b.getLastModified()===0?a.push(b.update().then(function(){if("started"===h)return b.start({"transient":!0});if("lazy"===h)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===h?a.push(b.start({"transient":!0})):"lazy"===h?(a.push(b.start({lazy:!0,"transient":!0})),d>b.getLastModified()+864E5&&b.update()):b._resolve()});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){r="active"})};this.stop=function(){if(r!==
"starting"&&r!=="active")return(new g).reject("Cannot stop registry. Registry is already "+r+".");r="stopping";var a=[];u.forEach(function(d){a.push(d.stop({"transient":!0}))});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!h.parent){var a=v.parentNode;a&&a.removeChild(v)}v=null;removeEventListener("message",i);r="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};
this.installPlugin=function(a,b){var a=e(a),h=this.getPlugin(a);if(h)return(new g).resolve(h);if(x[a])return x[a];if(b)return h=new d(a,b,n),u.push(h),h._persist(),n.dispatchEvent(new f("installed",h)),(new g).resolve(h);var c=n.loadManifest(a).then(function(b){h=new d(a,b,n);u.push(h);h._persist();delete x[a];n.dispatchEvent(new f("installed",h));return h},function(d){delete x[a];throw d;});return x[a]=c};this.getPlugins=function(){return u.slice()};this.getPlugin=function(a){var d=null,a=e(a);u.some(function(b){if(a===
b.getLocation())return d=b,!0});return d};this.addEventListener=t.addEventListener.bind(t);this.removeEventListener=t.removeEventListener.bind(t);this.resolvePlugins=function(){var a=!0;u.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function g(e,c){function i(a){var d=a.getProperty("service.id"),b=this.addingService(a);b&&(f[d]=a,h[d]=b)}function b(a){var d=a.getProperty("service.id"),b=h[d];delete f[d];delete h[d];this.removedService(a,b)}this.serviceRegistry=e;var f={},h={},d=k,a,l;this.close=function(){if(d!==j)throw"Already closed";d=k;e.removeEventListener("registered",a);e.removeEventListener("unregistering",l);l=a=null;var h=this;this.getServiceReferences().forEach(function(a){b.call(h,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var a=Object.keys(f);return!a.length?null:a.map(function(a){return f[a]})};this.open=function(){if(d!==k)throw"Already open";d=j;var h=this;a=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(i.call(h,a.serviceReference),typeof h.onServiceAdded==="function"))return h.onServiceAdded(a.serviceReference,h.serviceRegistry.getService(a.serviceReference))};l=function(a){a.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&b.call(h,a.serviceReference)};e.addEventListener("registered",a);e.addEventListener("unregistering",l);e.getServiceReferences(c).forEach(function(a){i.call(h,a);if(typeof h.onServiceAdded==="function")return h.onServiceAdded(a,e.getService(a))});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;g.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return g});
define("orion/objects",[],function(){function g(g){for(var j=1;j<arguments.length;j++){var e=arguments[j],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(g[c]=e[c])}return g}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var j=Object.create(Object.getPrototypeOf(k));g(j,k);return j},mixin:g,toArray:function(g){return Array.isArray(g)?g:[g]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(g,k,j){var e,c,i,b,f,h="pid";e=function(a,d,b){function f(a,b,h){b.forEach(function(f,c){try{var p=a[c].getProperty("__plugin__"),e=p&&d.getPlugin(p);(!p||e&&e.getState()==="active")&&b[c].updated(h)}catch(i){typeof console!=="undefined"&&console.log(i)}})}k.call(this,a,"orion.cm.managedservice");var c={},e={},i=function(d){var f=[];d.plugin.getServiceReferences().forEach(function(d){if(d.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var c=d.getProperty(h),d=a.getService(d);c&&d&&(c=(c=b._find(c))&&c.getProperties(),f.push(d.updated(c)))}});return g.all(f)};this.addingService=function(d){var b=d.getProperty(h),f=a.getService(d);if(!b||!f)return null;c[b]||(c[b]=[]);e[b]||(e[b]=[]);c[b].push(d);e[b].push(f);return f};this.onServiceAdded=function(a,d){var c=a.getProperty(h),c=b._find(c);f([a],[d],c&&c.getProperties())};this.onOpen=function(){d.addEventListener("started",i)};this.onClose=function(){d.removeEventListener("started",
i)};this.notifyUpdated=function(a){var d=a.getPid();f(c[d]||[],e[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();f(c[a]||[],e[a]||[],null)};this.removedService=function(a,d){var b=a.getProperty(h),f=c[b],n=e[b];f.length>1?f.splice(f.indexOf(a),1):delete c[b];n.length>1?n.splice(n.indexOf(d),1):delete e[b]}};c=function(){function a(a,d,h){this.store=new i(this,h);this.configAdmin=new b(this,this.store);this.tracker=new e(a,d,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(d){a.tracker.open();return d})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(a,d){this.factory=a;this.store=d}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var d="/cm/configurations";
i=function(){function a(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(d).then(function(a){c.pref=a;a.keys().forEach(function(d){if(!c.configs[d]){var b=a.get(d);typeof b==="object"&&b!==null&&Object.keys(b).length>0&&(b[h]=d,c.configs[d]=new f(c.factory,c,b))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var d=this._find(a);
d||(d=new f(this.factory,this,a),this.configs[a]=d);return d},list:function(){var a=this,d=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&b.getProperties()!==null&&d.push(b)});return d},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,d){this.pref.put(a,d.getProperties(!0)||{})}};return a}();f=function(){function a(a,d){d=j.clone(d);delete d[h];a.properties=d}function d(b,f,c){this.factory=b;this.store=f;if(c!==null&&typeof c==="object")this.pid=c[h],a(this,
c);else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}d.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var d=null;if(this.properties&&(d=j.clone(this.properties),!a))d[h]=this.pid;return d},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(d){this._checkRemoved();a(this,d);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return d}();return{ConfigurationAdminFactory:c}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,j,e,c,i){var b;return{startup:function(){if(b)return b;b=new k;var f=new j.ServiceRegistry,h=new e.PreferencesService(f);return h.getPreferences("/plugins").then(function(d){var a={plugins:{}};d.keys().forEach(function(b){var h=g.toUrl(b);a.plugins[h]=d[b]});var l=new c.PluginRegistry(f,a);return l.start().then(function(){if(f.getServiceReferences("orion.core.preference.provider").length>
0)return h.getPreferences("/plugins",h.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=g.toUrl(a);l.getPlugin(a)||d.push(l.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(d,function(a){console.log(a)})})}).then(function(){return(new i.ConfigurationAdminFactory(f,l,h)).getConfigurationAdmin().then(f.registerService.bind(f,"orion.cm.configadmin"))}).then(function(){var a=f.getService("orion.core.auth");
if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),b=localStorage.getItem("lastLogin");if(!b||b<(new Date).getTime()-9E5)return d}}).then(function(){var a={serviceRegistry:f,preferences:h,pluginRegistry:l};b.resolve(a);return a})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20140226-2325","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* = any string, ? = any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/util",[],function(){var g=navigator.userAgent,k=g.indexOf("MSIE")!==-1||g.indexOf("Trident")!==-1?document.documentMode:void 0,j=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,e=g.indexOf("Opera")!==-1?parseFloat(g.split("Version/")[1]):void 0,c=parseFloat(g.split("Chrome/")[1])||void 0,i=g.indexOf("Safari")!==-1&&!c,b=parseFloat(g.split("WebKit/")[1])||void 0,f=g.indexOf("Android")!==-1,h=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,d=h||g,a=navigator.platform.indexOf("Mac")!==
-1,l=navigator.platform.indexOf("Win")!==-1,m=navigator.platform.indexOf("Linux")!==-1,o="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return d[(b<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:k,isFirefox:j,isOpera:e,isChrome:c,isSafari:i,isWebkit:b,isAndroid:f,isIPad:h,isIPhone:g,isIOS:d,isMac:a,isWindows:l,
isLinux:m,isTouch:o,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(g){function k(b,d){d||(d=document);return d.querySelectorAll(b)}function j(b){var d=b.tabIndex;d===0&&g.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[b.nodeName.toLowerCase()]&&!b.attributes.tabIndex&&(d=-1);return d}function e(b){if(j(b)>=0)return b;if(b.hasChildNodes())for(var d=0;d<b.childNodes.length;d++){var a=e(b.childNodes[d]);if(a)return a}return null}function c(b){if(j(b)>=
0)return b;if(b.hasChildNodes())for(var d=b.childNodes.length-1;d>=0;d--){var a=c(b.childNodes[d]);if(a)return a}return null}function i(h,d){if(h.nodeType===3){var a=b.exec(h.nodeValue);a&&a.length>1&&d(h,a)}if(h.hasChildNodes())for(a=0;a<h.childNodes.length;a++)i(h.childNodes[a],d)}var b=/\$\{([^\}]+)\}/,f=null;return{$:function(b,d){d||(d=document);return d.querySelector(b)},$$:k,$$array:function(b,d){return Array.prototype.slice.call(k(b,d))},node:function(b){var d=b;typeof b==="string"&&(d=document.getElementById(b));
return d},contains:function(b,d){if(!b||!d)return!1;if(b===d)return!0;var a=b.compareDocumentPosition(d);return Boolean(a&16)},bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.documentElement.scrollLeft,top:b.top+document.documentElement.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:e,lastTabbable:c,stop:function(b){if(window.document.all)b.keyCode=0;b.preventDefault&&(b.preventDefault(),b.stopPropagation())},
processTextNodes:function(b,d){i(b,function(a,b){a.parentNode.replaceChild(document.createTextNode(d[b[1]]||b[1]),a)})},processDOMNodes:function(b,d){i(b,function(a,b){var h=d[b[1]];if(h){var f=document.createRange(),c=b.index;f.setStart(a,c);f.setEnd(a,c+b[0].length);f.deleteContents();f.insertNode(h)}})},addAutoDismiss:function(b,d){function a(a){f.forEach(function(d){var b=!1,h=d.excludeNodes.some(function(d){return document.body.contains(d)?(b=!0,d.contains(a.target)):!1});if(b&&!h)try{d.dismiss(a)}catch(f){typeof console!==
"undefined"&&console&&console.error(f&&f.message)}});f=f.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}f===null&&(f=[],document.addEventListener("click",a,!0),g.isIOS&&document.addEventListener("touchend",function(a){function d(){a.target.removeEventListener("click",d)}a.touches.length===0&&a.target.addEventListener("click",d)},!1));f.push({excludeNodes:b,dismiss:d})},setFramesEnabled:function(b){for(var d=document.getElementsByTagName("iframe"),a=
0;a<d.length;a++)d[a].parentNode.style.pointerEvents=b?"":"none"},removeAutoDismiss:function(b){f=f.filter(function(d){return b!==d.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(g){var k,j,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,f=b&&location.protocol&&location.protocol.replace(/\:/,""),h=b&&location.hostname,d=b&&(location.port||void 0),a=[],l=g.config&&g.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),d=a.match(i);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,d,b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(d=0;d<3;d+=1){b=e[d];try{a=new ActiveXObject(b)}catch(h){}if(a){e=[b];break}}return a},parseName:function(a){var d,
b,h=!1,f=a.indexOf(".");d=a.indexOf("./")===0||a.indexOf("../")===0;f!==-1&&(!d||f>1)?(d=a.substring(0,f),b=a.substring(f+1,a.length)):d=a;a=b||d;f=a.indexOf("!");f!==-1&&(h=a.substring(f+1)==="strip",a=a.substring(0,f),b?b=a:d=a);return{moduleName:d,ext:b,strip:h}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,b,h){var f,c;f=k.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");c=f[1];f=f[0];return(!a||a===d)&&(!f||f.toLowerCase()===b.toLowerCase())&&(!c&&!f||c===h)},finishLoad:function(d,
b,h,f){h=b?k.strip(h):h;l.isBuild&&(a[d]=h);f(h)},load:function(a,c,e,i){if(i.isBuild&&!i.inlineText)e();else{l.isBuild=i.isBuild;var g=k.parseName(a),i=g.moduleName+(g.ext?"."+g.ext:""),j=c.toUrl(i),w=l.useXhr||k.useXhr;!b||w(j,f,h,d)?k.get(j,function(d){k.finishLoad(a,g.strip,d,e)},function(a){e.error&&e.error(a)}):c([i],function(a){k.finishLoad(g.moduleName+"."+g.ext,g.strip,a,e)})}},write:function(d,b,h){if(a.hasOwnProperty(b)){var f=k.jsEscape(a[b]);h.asModule(d+"!"+b,"define(function () { return '"+
f+"';});\n")}},writeFile:function(a,d,b,h,f){var d=k.parseName(d),c=d.ext?"."+d.ext:"",l=d.moduleName+c,e=b.toUrl(d.moduleName+c)+".js";k.load(l,b,function(){var d=function(a){return h(e,a)};d.asModule=function(a,d){return h.asModule(a,e,d)};k.write(a,l,d,f)},f)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(a,d){var b=j.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));d(b)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,d,b,h){var f=k.createXhr(),c;f.open("GET",a,!0);if(h)for(c in h)h.hasOwnProperty(c)&&f.setRequestHeader(c.toLowerCase(),h[c]);if(l.onXhr)l.onXhr(f,a);f.onreadystatechange=function(){var h;if(f.readyState===4)h=f.status,h>399&&h<600?(h=Error(a+" HTTP status: "+h),h.xhr=f,b(h)):d(f.responseText)};f.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,d){var b,h,f=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),"utf-8")),l="";try{b=new java.lang.StringBuffer;(h=f.readLine())&&h.length()&&h.charAt(0)===65279&&(h=h.substring(1));for(h!==null&&b.append(h);(h=f.readLine())!==null;)b.append(c),b.append(h);l=String(b.toString())}finally{f.close()}d(l)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,k,j){return{slideoutHTMLFragment:function(e){var c=document.createElement("div");c.innerHTML=j;var i=k.$("#slideContainer",c);i.id=e+i.id;i=k.$("#pageCommandParameters",c);i.id=e+i.id;i=k.$("#pageCommandDismiss",c);i.id=e+i.id;return c.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(g){function k(e,c,i,b,f,h){this.type=h||"keydown";this.keyCode=typeof e==="string"&&this.type==="keydown"?e.toUpperCase().charCodeAt(0):e;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=i!==void 0&&i!==null?i:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=f!==void 0&&f!==null?f:!1}function j(e){this.keys=e}k.prototype={getKeys:function(){return[this]},match:function(e,c){if(c!==void 0){if(c!==0)return!1}else if(e instanceof Array){if(e.length>1)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(g.isOpera?e.which:e.charCode!==void 0?e.charCode:e.keyCode)?this.mod1!==(g.isMac?e.metaKey:e.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==e.shiftKey?!1:this.mod3!==e.altKey?!1:g.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e?!1:this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0}};j.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(e,c){var i=this.keys;if(c!==void 0)return c>i.length?!1:i[c].match(e)?c===i.length-1?!0:c+1:!1;else{e instanceof Array||(e=[e]);if(e.length>i.length)return!1;var b;for(b=0;b<e.length;b++)if(!i[b].match(e[b]))return!1;return b===i.length?!0:b}},equals:function(e){if(!e.keys)return!1;if(e.keys.length!==this.keys.length)return!1;for(var c=0;c<e.keys.length;c++)if(!e.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:j}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(g,k,j){function e(c){j.attach(this);this._init(c)}e.prototype={_init:function(c){this._dropdownNode=k.node(c.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=c.populate;this._selectionClass=c.selectionClass;this._parentDropdown=c.parentDropdown;this._positioningNode=c.positioningNode;if(!this._parentDropdown)for(var e=this._dropdownNode.parentNode;e&&document!==e;){if(e.classList&&
e.classList.contains("dropdownMenu")){this._parentDropdown=e.dropdown;break}e=e.parentNode}this._triggerNode=c.triggerNode?c.triggerNode:k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!c.skipTriggerEventListeners){var b=this;this._triggerNode.addEventListener("click",function(f){b.toggle(f)&&k.stop(f)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(f){if(f.keyCode===
k.KEY.ENTER||f.keyCode===k.KEY.SPACE)b.toggle(),k.stop(f)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(c){var e=this;c.addEventListener("click",function(b){e.toggle(b)&&k.stop(b)},!1)},toggle:function(c){return this.isVisible()?this.close():this.open(c)},isVisible:function(){return this._isVisible},open:function(c){var e=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:c});k.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var b=this.getItems();if(b.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?k.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),e=k.$$array(".dropdownSubMenu",this._dropdownNode),k.addAutoDismiss([this._triggerNode].concat(e),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(c);b[0].focus();e=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return e},_autoDismiss:function(c){if(this.close(!1)&&this._dropdownNode.contains(c.target))for(c=this._parentDropdown;c;)c.close(!1),c=c._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var c=k.bounds(this._dropdownNode),e=k.bounds(document.body);if(c.left+c.width>e.left+e.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-c.width+"px";else{var b=k.bounds(this._boundingNode(this._triggerNode)),f=k.bounds(this._triggerNode);this._dropdownNode.style.left=f.left-b.left-c.width+f.width+"px"}c=c.top+c.height-(e.top+e.height);if(0<c)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-c)+"px"}},_boundingNode:function(c){var e=
window.getComputedStyle(c,null);return e===null?c:e.getPropertyValue("position")==="absolute"||!c.parentNode||c===document.body?c:this._boundingNode(c.parentNode)},close:function(c){var e=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),k.setFramesEnabled(!0),c&&this._triggerNode.focus(),this._isVisible=!1,e=!0;return e},getItems:function(){var c=
[],e=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===e._dropdownNode&&c.push(b)});c.forEach(function(b){if(!b._hasDropdownMouseover)b.addEventListener("mouseover",function(f){b.dropdown?b.dropdown.open(f):(e._closeSelectedSubmenu(),k.stop(f))}),b._hasDropdownMouseover=!0});return c},empty:function(){var c=this;k.$$array("li",this._dropdownNode).forEach(function(e){e.parentNode===c._dropdownNode&&e.parentNode.removeChild(e)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(c){if(c.keyCode===k.KEY.UP||c.keyCode===k.KEY.DOWN||c.keyCode===k.KEY.RIGHT||c.keyCode===k.KEY.ENTER||c.keyCode===k.KEY.LEFT){var e=this.getItems(),b=document.activeElement;if(e.length&&e.length>0&&b){var f=e.indexOf(b);f<0&&(f=e.indexOf(b.parentNode));f>=0&&(c.keyCode===k.KEY.UP&&f>0?(f--,e[f].focus()):c.keyCode===k.KEY.DOWN&&f<e.length-1?(f++,e[f].focus()):c.keyCode===k.KEY.ENTER||c.keyCode===k.KEY.RIGHT?b.classList.contains("dropdownTrigger")&&
b.dropdown&&b.dropdown.open():c.keyCode===k.KEY.LEFT&&b.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(c))}}else c.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(c))},submenuOpen:function(c){if(c!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=c},_closeSelectedSubmenu:function(){for(var c=this._selectedSubmenu;c;)c.close(),c=c._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&k.removeAutoDismiss(this._boundAutoDismiss)}};
e.prototype.constructor=e;return{Dropdown:e}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></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"><span class="dropdownCommandName">${ButtonText}</span><span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){this._node=k.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=e.hideDelay===void 0?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===c._node&&(c.show(),k.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){k.contains(c._node,b.target)&&(c.show(),k.stop(b))},!1);this._leaveHandler=function(b){k.contains(c._node,b.target)&&c.hide()};for(var i=0;i<e.length;i++)this._node.addEventListener(e[i],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var e=this;k.addAutoDismiss([this._tip,this._node],function(){e.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(e._timeout)window.clearTimeout(e._timeout),e._timeout=null;e._tip.addEventListener("mouseout",function(c){k.contains(e._tip,c.target)&&(e.hide(),k.stop(c))},
!1)},!1)}return this._tip},_positionTip:function(e,c){this._makeTipNode();e==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var i=this._node,b;for(b=k.bounds(i);i&&!b.width&&!b.height;i=i.parentNode)b=k.bounds(i);var i=k.bounds(this._tipInner),f;switch(e){case "above":f=b.top-i.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":f=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":f=b.top-this._tailSize/2;b=b.left-i.width-
this._tailSize-1;break;default:f=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var h=k.bounds(document.documentElement);if(f+i.height>h.height)if(c)f=h.height-i.height-1;else return!1;if(b+i.width>h.width)if(c)b=h.width-i.width-1;else return!1;if(b<0)if(c)b=4;else return!1;if(f<0)if(c)f=4;else return!1;if(this._tail&&this._tail.previousPosition!==e)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
e);e==="above"||e==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(e==="left")this._tail.style.left=i.width+"px";this._tail.previousPosition=e}this._tip.style.top=f+"px";this._tip.style.left=b+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var e=!1,c=0;!e&&c<this._position.length;)e=this._positionTip(this._position[c]),c++;e||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(e){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(e===void 0)e=
this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},e)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var e=["mouseout","click"],c=0;c<e.length;c++)this._node.removeEventListener(e[c],this._leaveHandler,!1)}}};j.prototype.constructor=j;return{Tooltip:j}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(g,k,j,e,c,i,b,f){function h(a){var d=a.invocation;if(d){var b=a.command;if(b.hrefCallback)return a=b.hrefCallback.call(d.handler||window,d),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(d.commandRegistry)return d.commandRegistry._invoke(d),
!0;else if(b.onClick||b.callback)return window.setTimeout(function(){(b.onClick||b.callback).call(d.handler||window,d)},0),!0}return!1}function d(a,d){for(var b in d)if(d[b]&&d[b].keyBinding&&d[b].command&&d[b].keyBinding.match(a)){var f=d[b],c=f.keyBinding;if((!c.domScope||k.contains(k.node(c.domScope),a.target))&&h(f)){k.stop(a);break}}}function a(){var a={};if(w){var d,b,h;b=Object.keys(t);for(d=0;d<b.length;d++)h=b[d],a[h]=t[h];var f=w();b=Object.keys(f);for(d=0;d<b.length;d++)h=b[d],a[h]=f[h]}else a=
t;return a}function l(b){d(b,a())}function m(a,d){a=a||window.event;if(function(a){if(g.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;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=
a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var b=a.target.nodeName.toLowerCase();if(b==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(b==="textarea")return}d?d(a):l(a)}function o(){this._init()}
function s(a,d,b){d.classList.add("commandImage");var h;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(h=document.createElement("span"),d.appendChild(h),h.classList.add(a.spriteClass),h.classList.add(a.imageClass)):(h=new Image,h.alt=a.name,h.name=b,h.id=b,h.src=a.image,d.appendChild(h));return h}function r(a,d){var b=document.createElement("span");b.classList.add("dropdownKeyBinding");b.appendChild(document.createTextNode(d));a.appendChild(b)}function v(a,d,b,h,f){this.commandRegistry=
f;this.handler=a;this.items=d;this.userData=b;this.command=h;if(h.parameters)this.parameters=h.parameters.makeCopy();this.id=h.id}function u(a){this._init(a)}var w=null,t={};o.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(d){return m(d,function(d){var b=a.proxy,h=a.bindings;if(h&&b)for(var f=0;f<h.length;f++)h[f].match(d)&&(b.processKey({type:d.type,keyCode:d.keyCode,altKey:d.altKey,
ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey}),k.stop(d))})})}};window.document.addEventListener("keydown",m,!1);v.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new v(this.handler,this.items,this.userData,this.command,this.commandRegistry);d.domNode=this.domNode;d.domParent=this.domParent;if(a)d.parameters=a.makeCopy();else if(this.parameters)d.parameters=this.parameters.makeCopy();return d}};
v.prototype.constructor=v;u.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=
a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,d,b,h,f){var b=this.getChoices(d,b,h),c=b.some(function(a){return a.checked});b.forEach(function(b){if(b.name){var h=document.createElement("li");a.appendChild(h);var p=document.createElement("span");p.tabIndex=0;p.role="menuitem";p.classList.add("dropdownMenuItem");if(c){var e=document.createElement("span");e.classList.add("check");
e.appendChild(document.createTextNode(b.checked?"\u25cf":""));p.appendChild(e)}e=document.createTextNode(b.name);p.appendChild(e);h.appendChild(p);p.choice=b;p.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);p.addEventListener("keydown",function(a){(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else f._generateMenuSeparator(a)})},getChoices:function(a,d,b){return this.choiceCallback?
this.choiceCallback.call(d,a,b):null},makeChoiceCallback:function(a,d){return function(b){a.callback&&a.callback.call(a,d,b)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};u.prototype.constructor=u;return{Command:u,CommandInvocation:v,createDropdownMenu:function(a,d,b,h,f,l,i,m,g){a=k.node(a);if(!a)throw"no parent node was specified";
var o=document.createRange();o.selectNode(a);o=g?o.createContextualFragment(c):o.createContextualFragment(e);k.processTextNodes(o,{ButtonText:d});a.appendChild(o);var a=a.lastChild,r;g?(g=a.previousSibling,r=g.lastChild):g=a.previousSibling;h?g.classList.add(h):(g.classList.add("orionButton"),g.classList.add("commandButton"));if(f){if(!l)g.textContent="",g.setAttribute("aria-label",d);s({spriteClass:"commandSprite",imageClass:f},g,d);g.classList.add("orionButton")}g.dropdown=new j.Dropdown({dropdown:a,
populate:b,selectionClass:i,skipTriggerEventListeners:!!r,positioningNode:m});a.dropdown=g.dropdown;return{menuButton:g,menu:a,dropdown:g.dropdown,dropdownArrow:r}},createCheckedMenuItem:function(a,d,h,f){a=k.node(a);if(!a)throw"no parent node was specified";var c=document.createRange();c.selectNode(a);c=c.createContextualFragment(b);k.processTextNodes(c,{ItemText:d});a.appendChild(c);a=k.$(".checkedMenuItem",a.lastChild);a.checked=h;a.addEventListener("change",f,!1);return a},createCommandItem:function(a,
d,b,h,c,e,l){var i,e=e||!d.name&&d.hasImage();if(d.hrefCallback)i=document.createElement("a"),i.id=h,e&&d.hasImage()?s(d,i,h):(i.className="commandLink",i.appendChild(document.createTextNode(d.name))),l=d.hrefCallback.call(b.handler,b),l.then?l.then(function(a){i.href=a}):i.href=l?l:"#";else{i=document.createElement("button");i.className="orionButton";e?d.hasImage()?(s(d,i,h),d.name&&i.setAttribute("aria-label",d.name)):(i.classList.add("commandButton"),i.classList.add("commandMissingImageButton"),
i.appendChild(document.createTextNode(d.name))):(i.classList.add("commandButton"),h=document.createTextNode(d.name),i.appendChild(h));var m=l||d.callback;if(m)d.onClick=m,i.addEventListener("click",function(){m.call(b.handler,b)},!1)}a.nodeName.toLowerCase()==="ul"?(l=document.createElement("li"),a.appendChild(l),a=l):i.classList.add("commandMargins");a.appendChild(i);if(d.tooltip)i.commandTooltip=new f.Tooltip({node:i,text:d.tooltip,position:["above","below","right","left"]});c&&(t[d.id]={keyBinding:c,
command:d,invocation:b});return i},createCommandMenuItem:function(a,d,b,h,c,e){var l,i=a.dropdown;if(d.hrefCallback){l=document.createElement("a");var m=document.createElement("span");m.appendChild(document.createTextNode(d.name));m.classList.add("dropdownCommandName");l.appendChild(m);c=d.hrefCallback.call(b.handler,b);c.then?c.then(function(a){l.href=a}):l.href=c?c:"#";l.addEventListener("keydown",function(a){(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)&&l.click()},!1)}else{l=document.createElement("span");
l.tabIndex=0;m=document.createElement("span");m.appendChild(document.createTextNode(d.name));m.classList.add("dropdownCommandName");l.appendChild(m);var g=c||d.callback;if(g)d.onClick=g,l.addEventListener("click",function(){i.close(!0);g.call(b.handler,b)},!1),l.addEventListener("keydown",function(a){if(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)a.preventDefault(),l.click()},!1)}l.className="dropdownMenuItem";l.role="menuitem";if(d.tooltip)l.commandTooltip=new f.Tooltip({node:l,text:d.tooltip,
position:["above","below","right","left"]});e&&r(l,e);e=document.createElement("li");a.appendChild(e);e.appendChild(l);h&&(t[d.id]={keyBinding:h,command:d,invocation:b});return l},executeBinding:h,setKeyBindingProvider:function(a){w=a},localKeyBindings:t,CommandsProxy:o,getKeyBindings:a,processKey:l,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:d}});
define("orion/explorers/navigationUtils",[],function(){function g(g,e){if(!k&&g)g.push({domNode:e}),e.tabIndex=-1,e.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,e,c){j&&(j=j.getGridNavHolder(e,!0))&&g(j,c)},generateNavGrid:g,removeNavGrid:function(g,e){if(g)for(var c=0;c<g.length;c++)if(g[c].domNode===e){g.splice(c,1);break}}}});
define("orion/PageUtil",[],function(){var g=/^http[s]?/i;return{hash:function(){var g=window.location.href.split("#")[1];return g?"#"+g:""},matchResourceParameters:function(g){var g=g||window.location.toString(),j={resource:""},e=g.indexOf("#");if(e!==-1&&(g=g.substring(e+1),g.length!==0)){g=g.split(",");j.resource=decodeURIComponent(g[0]);for(e=1;e<g.length;e++){var c=/([^=]*)(=?)(.*)/.exec(g[e]),i=decodeURIComponent(c[1]||""),c=decodeURIComponent(c[3]||"");i!==""&&i!=="resource"&&(j[i]=c)}}return j},
validateURLScheme:function(k,j){var e=k;if(k.indexOf("://")===-1){var c=document.createElement("a");c.href=k;e=c.href}c=!1;return(c=j?j.some(function(c){return RegExp("^"+c+":","i").test(e)}):g.test(e))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(g){function k(e){var c="",i=navigator.platform.indexOf("Mac")!==-1;i?(e.mod4&&(c+="\u2303"),e.mod3&&(c+="\u2325"),e.mod2&&(c+="\u21e7"),e.mod1&&(c+="\u2318")):(e.mod1&&(c+="Ctrl+"),e.mod2&&(c+="Shift+"),e.mod3&&(c+="Alt+"));if(e.alphaKey)return c+e.alphaKey;if(e.type==="keypress")return c+e.keyCode;for(var b in g.KEY)if(typeof(g.KEY[b]==="number")&&g.KEY[b]===e.keyCode){if(i)switch(g.KEY[b]){case g.KEY.BKSPC:b="\u232b";break;case g.KEY.TAB:b=
"\u21e5";break;case g.KEY.ENTER:b="\u23ce";break;case g.KEY.ESCAPE:b="\u238b";break;case g.KEY.SPACE:b="\u2423";break;case g.KEY.PAGEUP:b="\u21de";break;case g.KEY.PAGEDOWN:b="\u21df";break;case g.KEY.END:b="\u21f2";break;case g.KEY.HOME:b="\u21f1";break;case g.KEY.DEL:b="\u2326"}switch(g.KEY[b]){case g.KEY.DOWN:b="\u2193";break;case g.KEY.UP:b="\u2191";break;case g.KEY.RIGHT:b="\u2192";break;case g.KEY.LEFT:b="\u2190"}return c+b}var f;switch(e.keyCode){case 59:f=e.mod2?":":";";break;case 61:f=e.mod2?
"+":"=";break;case 188:f=e.mod2?"<":",";break;case 190:f=e.mod2?">":".";break;case 191:f=e.mod2?"?":"/";break;case 192:f=e.mod2?"~":"`";break;case 219:f=e.mod2?"{":"[";break;case 220:f=e.mod2?"|":"\\";break;case 221:f=e.mod2?"}":"]";break;case 222:f=e.mod2?'"':"'"}return f?c+f:e.keyCode>=112&&e.keyCode<=123?c+"F"+(e.keyCode-111):c+String.fromCharCode(e.keyCode)}function j(e){var c=window.navigator.platform.indexOf("Mac")!==-1;return c&&e.metaKey||!c&&e.ctrlKey}return{getUserKeyString:function(e){for(var c=
"",e=e.getKeys(),i=0;i<e.length;i++)i!==0&&(c+=" "),c+=k(e[i]);return c},getUserText:function(e){var c=e.id,i=e.refNode,b=e.hideRefNode,f=e.initialText,h=e.onComplete,d=e.onEditDestroy,a=e.selectTo,l=e.isInitialValid,e=e.insertAsChild,m=!1,o=function(a){return function(e){if(!m){var o=g.node(c),j=o.value;if(o)if(a&&e.keyCode===g.KEY.ESCAPE){if(b)i.style.display="inline";m=!0;o.parentNode.removeChild(o);d&&d()}else if(!(a&&e.keyCode!==g.KEY.ENTER)){if(j.length===0||!l&&j===f){if(b)i.style.display=
"inline"}else if(h(j),b&&i.parentNode)i.style.display="inline";m=!0;o.parentNode&&o.parentNode.removeChild(o);d&&d()}}}},j=document.createElement("input");j.id=c;j.value=f||"";e?i.appendChild(j):i.parentNode.insertBefore(j,i.nextSibling);j.classList.add("userEditBoxPrompt");if(b)i.style.display="none";j.addEventListener("keydown",o(!0),!1);j.addEventListener("blur",o(!1),!1);window.setTimeout(function(){j.focus();if(f){var d=g.node(c),b=a?f.indexOf(a):-1;if(b>0)if(d.createTextRange)d=d.createTextRange(),
d.collapse(!0),d.moveStart("character",0),d.moveEnd("character",b),d.select();else if(d.setSelectionRange)d.setSelectionRange(0,b);else{if(d.selectionStart!==void 0)d.selectionStart=0,d.selectionEnd=b}else d.select()}},0)},openInNewWindow:j,followLink:function(e,c){c&&j(c)?window.open(e):window.location=e},createButton:function(e,c){var i=document.createElement("button");i.className="orionButton commandButton commandMargins";i.addEventListener("click",function(b){c();g.stop(b)},!1);e&&i.appendChild(document.createTextNode(e));
return i},createDropdownButton:function(){},isFormElement:function(e){switch(e.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(g,k,j,e,c,i,b,f,h,d){function a(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function l(a,d){this.token=a;this.parameterName=d}function m(a,d,b){this.event=a;this.handler=d;this.capture=b||!1}function o(a,d,b,h,f,c){this.name=a;this.type=d;this.label=b;this.value=h;this.lines=f||1;this.eventListeners=Array.isArray(c)?c:c?[c]:[]}function s(a,d,b){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=d&&d.clientCollect}a.prototype={_init:function(a){this._selectionService=
a.selection;var d=this;g.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var b=this._urlBindings[d].urlBinding.match(a);if(b){var h=this._urlBindings[d],f=h.command,c=h.invocation;if(c&&c.parameters&&f.callback){c.parameters.setValue(b.parameterName,b.parameterValue);var n=this;window.setTimeout(function(){n._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,d,b,h){d?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback&&this._invoke(new g.CommandInvocation(b,d,null,a,this),h):(d=this._urlBindings[a])&&d.command&&d.command.callback&&this._invoke(d.invocation,h)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,d,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
d,b))},confirm:function(a,d,b,h,f,c){var n=!1;if(this._parameterCollector&&!f){var e=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,f){var c=document.createElement("span");c.classList.add("parameterPrompt");c.textContent=d;a.appendChild(c);c=document.createElement("button");c.addEventListener("click",function(){n=!0;e._parameterCollector.close()},!1);f.appendChild(c);c.appendChild(document.createTextNode(b));c.className="dismissButton";var l=document.createElement("button");
l.addEventListener("click",function(){n=!1;e._parameterCollector.close()},!1);f.appendChild(l);l.appendChild(document.createTextNode(h));l.className="dismissButton";return c},function(){c(n)}))return}n=window.confirm(d);c(n)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,d){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){var h=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(h=this._parameterCollector.collectParameters(a),!h)){var f=new b.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),h=f.contentContainer();h.classList.add("parameterPopup");var c=window.document.activeElement,e=this._parameterCollector.getFillFunction(a,
function(){c&&c.focus();f.destroy()})(h);f.show();window.setTimeout(function(){e.focus();e.select()},0);h=!0}h||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function d(a){return function(){g.executeBinding(a)}}var b={},h,f,c=[],n;for(n in this._activeBindings)(f=
this._activeBindings[n])&&f.keyBinding&&f.command&&(f.command.name||f.command.tooltip)&&c.push(f);c.sort(function(a,d){return(a.command.name||a.command.tooltip).localeCompare(d.command.name||d.command.tooltip)});for(n=0;n<c.length;n++)f=c[n],f.keyBinding.scopeName?(b[f.keyBinding.scopeName]||(b[f.keyBinding.scopeName]=[]),b[f.keyBinding.scopeName].push(f)):(h=e.getUserKeyString(f.keyBinding),a.createItem(h,f.command.name||f.command.tooltip,d(f)));for(var l in b)b[l].length&&b[l].length>0&&(a.createHeader(l),
b[l].forEach(function(b){h=e.getUserKeyString(b.keyBinding);a.createItem(h,b.command.name||b.command.tooltip,d(b))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var b=this;d.forEach(function(d){b._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,d,b,h,f,c,n,e,l,i){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,
f));if(a[d]){if(h)a[d].title=h;if(b)a[d].position=b;if(n)a[d].imageClass=n;if(e)a[d].tooltip=e;if(l)a[d].selectionClass=l;i===!0?a[d].pretendDefaultActionId=!0:a[d].defaultActionId=i;a[d].emptyGroupMessage=c}else a[d]={title:h,position:b,emptyGroupMessage:c,imageClass:n,tooltip:e,selectionClass:l,defaultActionId:i===!0?null:i,pretendDefaultActionId:i===!0,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){if(d.length>1){if(!a[d])a[d]={position:0,
children:{}},a.sortedContributions=null;a=a[d].children}});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,d,b,h,f,c,n){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];h&&(a=this._createEntryForPath(a,h));a[d]={position:b};c&&((b=this._commandList[d])?this._addBinding(b,"key",c,
f):this._addPendingBinding(d,"key",c,f));n&&((b=this._commandList[d])?this._addBinding(b,"url",n,f):this._addPendingBinding(d,"url",n,f));a.sortedContributions=null},unregisterCommandContribution:function(a,d,b){if(this._contributionsByScopeId[a]){delete this._commandList[d];delete this._activeBindings[d];delete this._urlBindings[d];delete this._pendingBindings[d];var h=this._contributionsByScopeId[a];b&&b.split("/").forEach(function(a){if(a.length>1&&h[a])h=h[a].children});delete h[d];h.sortedContributions=
null}},_addBinding:function(a,d,b,h){if(!a.id)throw Error("No command id: "+a);d==="key"?this._activeBindings[a.id]={command:a,keyBinding:b,bindingOnly:h}:d==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:b,bindingOnly:h})},_addPendingBinding:function(a,d,b,h){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,binding:b,bindingOnly:h})},_checkForTrailingSeparator:function(a,d,b){var h;if(d==="tool"||d==="button")if((h=a.childNodes.length>0?a.childNodes[a.childNodes.length-
1]:null)&&h.classList.contains("commandSeparator"))return b?(a.removeChild(h),!1):!0;if(d==="menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(h=a[a.length-1],b)h.parentNode.parentNode.removeChild(h.parentNode);else return!0;return!1},renderCommands:function(a,d,b,h,f,e,n){if(typeof a!=="string")throw"a scope id for rendering must be specified";d=c.node(d);if(!d)throw"no parent";var l=this._contributionsByScopeId[a];if(!b&&l){var b=l.localSelectionService||
this._selectionService,i=this;b&&b.getSelections(function(b){i.renderCommands(a,d,b,h,f,e)})}else l&&(this._render(l,d,b,h,f||"button",e,n),this._checkForTrailingSeparator(d,f,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,d,h,f,c,l,n){var p=a.sortedContributions;if(!p){var p=[],i=!1,m;for(m in a)if(Object.prototype.hasOwnProperty.call(a,
m)){var o=a[m];if(o&&typeof o.position==="number")o.id=m,p.push(o),i=!0}if(i)p.sort(function(a,d){return a.position-d.position}),a.sortedContributions=p}var j=0,s=this;p.forEach(function(a){var p;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){var i=a.children;if(c==="tool"||c==="button")if(a.title){var m;if(a.defaultActionId)(i=s._commandList[a.defaultActionId])&&(i.visibleWhen?i.visibleWhen(h):1)?(m=new g.CommandInvocation(f,h,l,i,s),m.domParent=
d):a.pretendDefaultActionId=!0;i=s._createDropdownMenu(d,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,m,a.pretendDefaultActionId);n&&k.generateNavGrid(n,i.menuButton);if(i)if(s._render(a.children,i.menu,h,f,"menu",l,n),s._checkForTrailingSeparator(i.menu,"menu",!0),i.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!i.menuButton.emptyGroupTooltip)i.menuButton.emptyGroupTooltip=new b.Tooltip({node:i.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right",
"above","left"]})}else n&&k.removeNavGrid(n,i.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(i.menu),a(i.menuButton),a(i.destroyButton);else i.menuButton.style.visibility="visible"}else{var q;d.childNodes.length>0&&!s._checkForTrailingSeparator(d,c)&&(q=s.generateSeparatorImage(d));s._render(i,d,h,f,c,l,n);d.childNodes.length>0&&d.childNodes[d.childNodes.length-1]!==q&&(q=s.generateSeparatorImage(d))}else if(a.title){if(a=s._createDropdownMenu(d,a.title,!0,null,null,a.imageClass))s._render(i,
a.menu,h,f,"menu",l,n),s._checkForTrailingSeparator(a.menu,"menu",!0),a.menu.childNodes.length===0&&a.destroyButton&&d.removeChild(a.destroyButton)}else d.childNodes.length>0&&s._generateMenuSeparator(d),s._render(i,d,h,f,c,l,n),s._generateMenuSeparator(d)}else{var y=s._commandList[a.id],i=y?!0:!1;m=a=null;if(y){p=new g.CommandInvocation(f,h,l,y,s);p.domParent=d;q=i&&(y.visibleWhen?y.visibleWhen(h):!0);if(s._activeBindings[y.id]&&s._activeBindings[y.id].keyBinding)a=s._activeBindings[y.id],a.invocation=
q?p:null,a.bindingOnly&&(i=!1);if(s._urlBindings[y.id]&&s._urlBindings[y.id].urlBinding)m=s._urlBindings[y.id],m.invocation=q?p:null,m.bindingOnly&&(i=!1);i=i&&q}if(i)y.choiceCallback?(c==="tool"||c==="button"?(a=d,i=!1,d.nodeName.toLowerCase()==="ul"&&(a=document.createElement("li"),d.appendChild(a))):(a=d,i=!0),s._createDropdownMenu(a,y.name,i,function(a){y.populateChoicesMenu(a,h,f,l,s)}.bind(y),y.imageClass,y.tooltip||y.title,y.selectionClass,y.positioningNode)):(p.handler=p.handler||this,p.domParent=
d,i=function(){s._invoke(p)},c==="menu"?(m=null,a&&a.keyBinding&&(m=e.getUserKeyString(a.keyBinding)),a=g.createCommandMenuItem(d,y,p,null,i,m)):(a=c+y.id+j,a=g.createCommandItem(d,y,p,a,null,c==="tool",i)),k.generateNavGrid(n,a),p.domNode=a,j++)}})},_createDropdownMenu:function(a,h,f,l,e,m,n,p,y,q){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var o,j,s=a;if(f)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(d),c.processTextNodes(m,{ButtonText:h}),a.appendChild(m),
j=a.lastChild,e=j.lastChild,h=e.previousSibling,h.dropdown=new i.Dropdown({dropdown:e,populate:l,parentDropdown:a.dropdown}),e.dropdown=h.dropdown;else{a.nodeName.toLowerCase()==="ul"&&(s=document.createElement("li"),a.appendChild(s),j=s);a=null;e&&(a="dropdownButtonWithIcon",m=m||h);var m=e?m||h:m,k=g.createDropdownMenu(s,h,l,a,e,!1,n,p,y||q);o=k.dropdownArrow;h=k.menuButton;if(o){if(y)y.domNode=k.menuButton;var A=this;h.onclick=function(a){var d=c.bounds(o);a.clientX>=d.left&&k.dropdown?k.dropdown.toggle(a):
A._invoke(y)};if(k.dropdown)h.onkeydown=function(a){c.KEY.DOWN===a.keyCode&&(k.dropdown.toggle(a),c.stop(a))}}var e=k.menu,E;(l=y&&y.command&&(y.command.tooltip||y.command.name))?E=y.command.tooltip||y.command.name:l&&(E=m);if(E)h.commandTooltip=new b.Tooltip({node:h,text:E,position:["above","below","right","left"]})}return{menuButton:h,menu:e,dropdown:h.dropdown,destroyButton:j,dropdownArrow:o}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");
d.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");d.appendChild(b);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d=a.nodeName.toLowerCase()==="ul"?document.createElement("li"):document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};a.prototype.constructor=a;l.prototype={match:function(a){a=j.matchResourceParameters(a);return typeof a[this.token]!==
"undefined"?(this.parameterValue=a[this.token],this):null}};l.prototype.constructor=l;m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};o.prototype.constructor=o;s.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,d){var b=this.parameterTable[a];if(b)b.value=d},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new o(d.name,d.type,d.label,
d.value,d.lines,d.eventListeners);a.push(d)});var d=new s(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=s;return{CommandRegistry:a,URLBinding:l,ParametersDescription:s,CommandParameter:o,CommandEventListener:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,j){function e(c,e){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=e}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&j.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&j.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,e,b){typeof c==="string"&&(c=j.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var f=e(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!f)return!1;this._activeElements.focusNode=f;c=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){e=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=g.Close;e.appendChild(c);var h=this;c.addEventListener("click",function(){h.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(f)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){f.focus();f.select&&f.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,e){j.$$array("input",e).forEach(function(b){b.type==="checkbox"?c.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&c.parameters.setValue(b.parameterName,b.value.trim())});j.$$array("textArea",e).forEach(function(b){c.parameters.setValue(b.parameterName,b.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,e){var b=this;return function(f,h){var d=null,a=function(){e&&e();b.close()},l=function(d){d.keyCode===j.KEY.ENTER&&b._collectAndCall(c,f);if(d.keyCode===j.KEY.ESCAPE||d.keyCode===j.KEY.ENTER)a(),j.stop(d)};c.parameters.forEach(function(b){var h=null;if(b.label)h=document.createElement("label"),h.classList.add("parameterInput"),h.setAttribute("for",b.name+
"parameterCollector"),h.textContent=b.label,f.appendChild(h);var e=b.name+"parameterCollector",i,h=h||f;if(b.type==="text"&&typeof b.lines==="number"&&b.lines>1)i=document.createElement("textarea"),i.rows=b.lines,i.type="textarea",i.id=e,h.appendChild(i),l=function(d){d.keyCode===j.KEY.ESCAPE&&(a(),j.stop(d))};else if(b.type==="boolean"){if(i=document.createElement("input"),i.type="checkbox",i.id=e,h.appendChild(i),b.value)i.checked=!0}else if(i=document.createElement("input"),i.type=b.type,i.id=
e,h.appendChild(i),b.value)i.value=b.value;i.classList.add("parameterInput");i.setAttribute("speech","speech");i.setAttribute("x-webkit-speech","x-webkit-speech");i.parameterName=b.name;d||(d=i);b.eventListeners.length>0&&b.eventListeners.forEach(function(a){i.addEventListener(a.event,function(d){return a.handler(d,c)},a.capture)});i.addEventListener("keydown",l,!1)});var m=h;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),f.appendChild(m));
var o=function(a,d){var b=document.createElement("button");d.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,o(g.More,m).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,f);a()},!1);o(g.Submit,m).addEventListener("click",function(){b._collectAndCall(c,f);a()},!1);m=o(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");
m.title=g.Close;m.addEventListener("click",function(){a()},!1);return d}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});define("orion/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
define("orion/contentTypes",[],function(){function g(d,a){function b(a,d,h,f){var h=d.filename.indexOf(h)>=0,c;c=f.toLowerCase();c=d.extension.indexOf(c)!==-1;if(h||c){if(!(c=!a))h&&(f=f.toLowerCase(),h=a.extension.indexOf(f)!==-1),c=h;if(c)return d}return a}if(typeof d!=="string")return null;for(var h=d&&d.split(".").pop(),f=null,c=0;c<a.length;c++){var e=a[c];b(f,e,d,h)===e&&(f=e)}return f}function k(d){return d===null||typeof d==="undefined"?[]:Array.isArray(d)?d:[d]}function j(d){return k(d).map(function(a){return String.prototype.toLowerCase.call(a)})}
function e(d){return{id:d.id,name:d.name,image:d.image,imageClass:d.imageClass,"extends":d["extends"],extension:j(d.extension),filename:k(d.filename)}}function c(d){var a=Object.create(null);d.map(e).forEach(function(d){Object.prototype.hasOwnProperty.call(a,d.id)||(a[d.id]=d)});return a}function i(d){if(d&&d.registerService){this.serviceRegistry=d;for(var a=d.getServiceReferences(f).concat(d.getServiceReferences(h)),e=[],i=0;i<a.length;i++)for(var g=k(a[i].getProperty("contentTypes")),j=0;j<g.length;j++)e.push(g[j]);
this.map=c(e);d.registerService(b,this)}else if(Array.isArray(d))this.serviceRegistry=null,this.map=c(d);else throw Error("Invalid parameter");}var b="orion.core.contentTypeRegistry",f="orion.core.contenttype",h="orion.file.contenttype";i.prototype={getContentTypes:function(){var d=this.getContentTypesMap(),a=[],b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&a.push(d[b]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(d){return g(d.Name,this.getContentTypes())},
getFilenameContentType:function(d){return g(d,this.getContentTypes())},getContentType:function(d){return this.map[d]||null},isExtensionOf:function(d,a){d=typeof d==="string"?this.getContentType(d):d;a=typeof a==="string"?this.getContentType(a):a;if(!d||!a)return!1;if(d.id===a.id)return!0;else for(var b=d,h={};b&&(b=this.getContentType(b["extends"]));){if(b.id===a.id)return!0;if(h[b.id])throw Error("Cycle: "+b.id);h[b.id]=!0}return!1},isSomeExtensionOf:function(d,a){for(var b=0;b<a.length;b++)if(this.isExtensionOf(d,
a[b]))return!0;return!1}};return{ContentTypeRegistry:i,getFilenameContentType:g}});
define("orion/URITemplate",[],function(){function g(a){this._text=a}function k(a){return a.replace("%25","%")}function j(a,b){if(b==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(d,k);if(b==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function e(a,d,b){for(var h=
[],f=0;f<a.length;f++)typeof a[f]!=="undefined"&&h.push(j(a[f],d));return h.join(b)}function c(a,d,b,h){for(var f=Object.keys(a),c=[],e=0;e<f.length;e++)typeof a[f[e]]!=="undefined"&&c.push(j(f[e],d)+b+j(a[f[e]],d));return c.join(h)}function i(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=f[a[0]])?a=a.substring(1):this._operator=f.NUL;for(var d=[],b=a.split(","),c=0;c<b.length;c++){var e=b[c].match(h);if(e===null)throw Error("Bad VarSpec: "+a);d.push({name:e[1],
explode:!!e[2],prefix:e[3]?parseInt(e[3],10):-1})}this._varSpecList=d}function b(a){for(var d=[],b=0,h=a.indexOf("{",b);h!==-1;){d.push(new g(a.substring(b,h)));b=a.indexOf("}",h+1);if(b===-1)throw Error("Invalid template: "+a);d.push(new i(a.substring(h+1,b)));b+=1;h=a.indexOf("{",b)}d.push(new g(a.substring(b)));this._templateComponents=d}var f={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-,"}},h=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,d=/%25[0-9A-F][0-9A-F]/g;g.prototype={expand:function(){return encodeURI(this._text)}};
i.prototype={expand:function(a){for(var d=[],b=0;b<this._varSpecList.length;b++){var h=this._varSpecList[b],f=h.name,i=a[f],g=typeof i;if(g!=="undefined"&&i!==null){var k=d.length===0?this._operator.first:this._operator.sep;if(g==="string")this._operator.named&&(k+=j(f,"U+R"),k+=i.length===0?this._operator.ifemp:"="),h.prefix!==-1&&h.prefix<i.length&&(i=i.substring(0,h.prefix)),k+=j(i,this._operator.allow);else if(Array.isArray(i)){if(i.length===0)continue;h.explode?k+=e(i,this._operator.allow,this._operator.sep):
(h=e(i,this._operator.allow,","),this._operator.named&&(k+=j(f,"U+R"),k+=h.length===0?this._operator.ifemp:"="),k+=h)}else if(g==="object"){if(Object.keys(i).length===0)continue;h.explode?k+=c(i,this._operator.allow,"=",this._operator.sep):(h=c(i,this._operator.allow,",",","),this._operator.named&&(k+=j(f,"U+R"),k+=h.length===0?this._operator.ifemp:"="),k+=h)}else throw Error("bad param type: "+f+" : "+g);d.push(k)}}return d.join("")}};b.prototype={expand:function(a){for(var d=[],b=0;b<this._templateComponents.length;b++)d.push(this._templateComponents[b].expand(a));
return d.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(g,k){function j(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var e={};return{getMessageBundle:function(c){function i(a){a?g(["i18n!"+c],function(a){if(a){var d=c;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+d,JSON.stringify(a));delete a._expires}f.resolve(a)}):b(Error(c))}function b(a){f.reject(a)}
if(e[c])return e[c];var f=new k;e[c]=f;var h=j(c);if(h)return f.resolve(h),f;try{g([c],i,b)}catch(d){g(["orion/i18n!"+c],i,b)}return f},formatMessage:function(c){var e=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(b,f){return e[(f<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(g,k,j,e,c,i){function b(){return g.toUrl?(new URL(g.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function f(a){var d={};a.getPropertyKeys().forEach(function(b){b!=="objectClass"&&b!=="service.names"&&b!=="service.id"&&b!=="__plugin__"&&(d[b]=a.getProperty(b))});return d}function h(a){return c.getMessageBundle(a.nls).then(function(d){a.textContent=
a.nameKey?d[a.nameKey]:a.name;return a},function(){a.textContent=a.nameKey||a.name;return a})}function d(a,d){var c=a.getServiceReferences(d||"orion.page.link"),l=j.matchResourceParameters(window.location.href),i={OrionHome:b(),Location:l.resource},m=[];c.forEach(function(a){a=f(a);if(a.uriTemplate&&(a.nls||a.name)){var d=(new e(a.uriTemplate)).expand(i),d=j.validateURLScheme(d);a.href=d;a.nls?m.push(h(a)):(a.textContent=a.name,m.push((new k).resolve(a)))}});return k.all(m)}function a(a){var d=this.categories=
Object.create(null);a.forEach(function(a){d[a.id]=a})}function l(a){this.allPageLinks=a;this.allPageLinks.sort(m)}function m(a,d){var b=a.textContent&&a.textContent.toLowerCase(),h=d.textContent&&d.textContent.toLowerCase();return b<h?-1:b>h?1:0}var o;i.mixin(a.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});i.mixin(l.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var d=a.href,a=
a.textContent,b=document.createElement("a");b.href=d;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(d){var b;return!o?(b=[],d.getServiceReferences("orion.page.link.category").forEach(function(a){a=f(a);if(a.id&&(a.name||a.nameKey))a.nls?b.push(h(a)):(a.textContent=a.name,b.push((new k).resolve(a)))}),k.all(b).then(function(d){return o=new a(d)})):(new k).resolve(o)},getPageLinksInfo:function(a,
b){return d(a,b).then(function(a){return new l(a)})},getOrionHome:b}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks,i18n!orion/edit/nls/messages".split(","),function(g,k,j,e,c,i,b,f,h,d){function a(a){var d={};a.getPropertyKeys().forEach(function(b){d[b]=a.getProperty(b)});return d}var l={},m=h.getOrionHome();l._cloneItemWithoutChildren=function v(a){if(a===null||typeof a!=="object")return a;var d=a.constructor(),b;for(b in a)b!=="children"&&b!==
"Children"&&(d[b]=v(a[b]));return d};l._getOpenWithNavCommandExtensions=function(a){function d(a,b){for(var h=a.getServiceReferences("orion.navigate.openWith"),f=[],c=[],n=0;n<h.length;n++){var e=h[n];if(e.getProperty("editor")===b.id){var p=e.getProperty("contentType");p instanceof Array?f=f.concat(p):f.push(p||"*/*");e=e.getProperty("excludedContentTypes");e instanceof Array?c=c.concat(e):e!==null&&typeof e!=="undefined"&&c.push(e)}}0===f.length&&(f=null);0===c.length&&(c=null);return{contentTypes:f,
excludedContentTypes:c}}for(var b=function(){for(var d=a.getServiceReferences("orion.edit.editor"),b=[],h=0;h<d.length;h++){var f=d[h],c=f.getProperty("id");b.push({id:c,"default":f.getProperty("default")||!1,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate"),validationProperties:f.getProperty("validationProperties")||[]})}return b}(),h=[],f=0;f<b.length;f++){var c=b[f],e=d(a,c);h.push({properties:{name:c.name||
c.id,nameKey:c.nameKey,id:"eclipse.openWithCommand."+c.id,contentType:e.contentTypes,excludedContentTypes:e.excludedContentTypes,uriTemplate:c.uriTemplate,nls:c.nls,forceSingleItem:!0,isEditor:c["default"]?"default":"editor",validationProperties:c.validationProperties},service:{}})}return h};l._makeValidator=function(a,d,b,h){function f(a,d,b,h){var c=b.match,n,e;if((n=d.indexOf("["))>=0){if((e=d.indexOf("]"))<0)return!1;var l=d.substring(0,n),i;if(!(i=a[l])||!Array.isArray(i))return!1;n=d.substring(n+
1,e);n=parseInt(n,10);if(isNaN(n))return!1;n<0&&(n+=i.length);d=d.substring(e+1);d=l+":"+String(n)+d}if(d.indexOf("|")>=0)return n=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),f(a,n,b,h)?!0:f(a,d,b,h);else if(d.indexOf(":")>=0)return n=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[n]?f(a[n],d,b,h):!1;else{a:{var l=!1,m;if(d.charAt(0)==="!")b=typeof a[d.substring(1)]==="undefined";else if(typeof a[d]!=="undefined"){if(typeof c==="undefined")m=a[d],l=!0;else if(typeof c===
"string"){if(!typeof(a[d]==="string")){b=!1;break a}if(b.variableName){if(c=RegExp(c).exec(a[d]))m=c[0],m=b.variableMatchPosition==="before"?a[d].substring(0,c.index):b.variableMatchPosition==="after"?a[d].substring(c.index+m.length):b.variableMatchPosition==="only"?m:a[d],l=!0}else{b=RegExp(c).test(a[d]);break a}}else a[d]===c&&(m=a[d],l=!0);if(l&&b.variableName&&(h[b.variableName]=m,h.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)m=!1,b.replacements[a].pattern?h[b.variableName]=
h[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):m=!0,m&&window.console.log("Invalid replacements specified in validation property.  "+b.replacements[a]);b=l}else b=!1}return b}}function n(d,b,h){if(h.info.validationProperties)for(var n=0;n<h.info.validationProperties.length;n++){var e=h.info.validationProperties[n];if(typeof e.source!=="undefined"){if(!f(d,e.source,e,h))return!1}else return window.console.log("Invalid validationProperties in "+a.id+".  No source property specified."),
!1}var n=!0,l=b?c.getFilenameContentType(d.Name,b):null,l=l||{id:"application/octet-stream"};h.info.excludedContentTypes&&b&&(n=h.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==l.id.search(a)?!1:!0}));n&&h.info.contentType&&b&&(n=h.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==l.id.search(a)?!0:!1}));return n}return{info:a,validationFunction:function(a){typeof h==="function"&&(a=h.call(this,a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&a.length!==1)return!1;if(a.length<1)return!1}else a=[a];for(var d=0;d<a.length;d++)if(!n(a[d],b,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(d[b]=a[b]);if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var h=this.info.validationProperties[b];h.source&&h.variableName&&(this.itemCached===
a&&this[h.variableName]||f(a,h.source,h,this),a[h.variableName]?window.console.log("Variable name "+h.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[h.variableName]=this[h.variableName])}d.OrionHome=m;return(new i(this.info.uriTemplate)).expand(d)}return null}}};var o=d.UnnamedCommand;l._createCommandOptions=function(a,d,h,f,c,n){function e(b,p){var i=l._makeValidator(a,h,f,n);b.visibleWhen=i.validationFunction.bind(i);if(c)if(i.generatesURI.bind(i)())b.hrefCallback=
function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return i.getURI.bind(i)(a)};else{var m=a;b.callback=function(a){var f;if(m.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,f=l._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){f=[];for(var c=0;c<a.items.length;c++)f.push(l._cloneItemWithoutChildren(a.items[c]))}else f=l._cloneItemWithoutChildren(a.items);if(h)var n=h.getService("orion.page.progress");d.run?n?n.progress(d.run(f),"Running command: "+b.name):d.run(f):h&&
(n?n.progress(h.getService(d).run(f),"Running command: "+b.name):h.getService(d).run(f))}}p.resolve(b)}var i=new k;if(a.nls){var m=function(d){var b;d?(b=a.tooltipKey&&d[a.tooltipKey],d=a.nameKey&&d[a.nameKey]||a.name||o,b=b||a.tooltip||""):(d=a.name||a.nameKey||o,b=a.tooltip||a.tooltipKey||"");e({name:d,image:a.image,id:a.id||a.name,tooltip:b,isEditor:a.isEditor,showGlobally:a.showGlobally},i)};b.getMessageBundle(a.nls).then(m,m.bind(this,null))}else e({name:a.name,image:a.image,id:a.id||a.name,
tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},i);return i};l.getOpenWithCommand=function(a,d,b){for(var h,a=b||l.getOpenWithCommands(a),b=0;b<a.length;b++)if(a[b].visibleWhen(d)){var f=a[b].isEditor==="default";if(!h||f)if(h=a[b],f)break}return h};l.getOpenWithCommands=function(a){var d=[],b;for(b in a._commandList){var h=a._commandList[b];h.isEditor&&d.push(h)}return d};var s;l.createAndPlaceFileCommandsExtension=function(a,b,h,f,c,n){return l.createFileCommands(a,null,n?"all":
void 0,!!n,b).then(function(a){c&&0<a.length&&(b.addCommandGroup(h,"eclipse.openWith",1E3,d.OpenWith,c,null,null,null,"dropdownSelection"),b.addCommandGroup(h,"eclipse.fileCommandExtensions",1E3,d.OpenRelated,c));a.forEach(function(a){var d=null;c&&(d=a.isEditor?c+"/eclipse.openWith":c+"/eclipse.fileCommandExtensions");b.registerCommandContribution(h,a.id,f,d)});return{}})};l.createFileCommands=function(a,d,b,h,f){var b=b===void 0?"global":b,h=h===void 0?!0:h,c=[];l._cachedFileCommands||l._createCachedFileCommands(a);
(b==="all"||b==="global")&&l._cachedFileCommands.forEach(function(a){var d=a.properties;(b==="all"||d.forceSingleItem&&d.showGlobally)&&c.push(a)});return k.when(function(){var b=a.getService("orion.core.contentTypeRegistry")||d;return s||k.when(b.getContentTypes(),function(a){return s=a})}(),function(){if(h){if(!l._cachedOpenWithExtensions)l._cachedOpenWithExtensions=l._getOpenWithNavCommandExtensions(a,s);c=c.concat(l._cachedOpenWithExtensions);f._addedOpenWithCommands=h}var d=c.map(function(d){var b=
d.properties,d=d.service,h=f.findCommand(b.id||b.name);return h?(new k).resolve(h):l._createCommandOptions(b,d,a,s,!0).then(function(a){a=new j.Command(a);f.addCommand(a);return a})});return k.all(d,function(a){return{_error:a}}).then(function(a){return a})})};l._createCachedFileCommands=function(d){var b=d.getServiceReferences("orion.navigate.command");l._cachedFileCommands=[];for(var h=0;h<b.length;h++)if(b[h].getProperty("id")!=="orion.navigateFromMetadata"){var f=d.getService(b[h]),c=a(b[h]);
l._cachedFileCommands.push({properties:c,service:f})}};l.getFileCommandIds=function(){var a=[];if(l._cachedFileCommands)l._cachedFileCommands.length&&(a=l._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};l.createOpenWithCommands=function(a,d,b){return b&&b._addedOpenWithCommands?(new k).resolve(l.getOpenWithCommands(b)):l.createFileCommands(a,d,"none",!0,b)};return l});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){var c=k.node(e.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this._makeFinalHref=
e.makeFinalHref;this._maxLength=e.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents&&!this._resource.skip){e=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,c):e.href=g.toUrl("edit/edit.html")+"#"+c}else e=document.createElement("span");k.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(e){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(e));return c},addSegmentHref:function(e,c){this._makeHref?this._makeHref(e,c.Location,c):e.href=g.toUrl("edit/edit.html")+"#"+c.ChildrenLocation},buildSegments:function(e,c){if(this._resource.Parents){var i=this._resource.Parents.slice(0),b,f;i&&(i=i.slice(0),c==="reverse"&&(i=i.reverse().slice(0)),
i.forEach(function(h){if(!h.skip)e?(f=e,e=null):f=h.Name,b=this.buildSegment(f),this.path+=h.Name,this.addSegmentHref(b,h),b.include=!1,this.segments.push(b)}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(e){this.crumbs.appendChild(e)},addTitle:function(e,c){var i=c||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(i)),
e.classList.add("breadcrumb"),e.classList.add("currentLocation"),this.append(e))},finalSegment:function(e,c){if(!this._resource.skip){var i;i=c?c:this._resource.Name;this._makeFinalHref?(e=this.buildSegment(i),this.addSegmentHref(e,this._resource)):(e=document.createElement("span"),e.appendChild(document.createTextNode(i)));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)}},firstSegment:function(e){if(e)if(this.append(e),this._resource&&this._resource.Parents&&!this._resource.skip)e.classList.add("breadcrumb"),
this.addDivider();else{if(!this._resource.skip)e.href="";e.classList.add("currentLocation")}},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){e.include===!0&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=
!1}.bind(this));this.segments=e.reverse()}},measure:function(){var e=this._container;e.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:e.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;if(c)this.addTitle(e,c);else if(this.finalSegment(e,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(e)),this.crumbs.offsetWidth>=
this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(e,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(e),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(g,k,j){function e(c){k.attach(this);this._init(c)}e.prototype={_init:function(c){this._tracking=null;this._animationDelay=501;this._closeReversely=c.closeReversely;this.$node=j.node(c.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=j.node(c.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=j.node(c.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=c.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(c.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof c.closeByDefault!=="undefined")this._closeByDefault=c.closeByDefault;this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(c){this.addEventListener("resize",function(e){c(e.node)})},_initializeFromStoredSettings:function(){var c=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof c==="string"?c==="closed":this._closeByDefault;var c=j.bounds(this.$node.parentNode),e=j.bounds(this.$node),b;if(this._vertical)if(b=localStorage.getItem(this._prefix+"/yPosition")){if(this._splitTop=parseInt(b,10),this._splitTop>c.top+c.height-e.height)this._splitTop=c.top+c.height/
2}else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(b=localStorage.getItem(this._prefix+"/xPosition")){if(this._splitLeft=parseInt(b,10),this._splitLeft>c.left+c.width-e.width)this._splitLeft=c.left+c.width/2}else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var c=j.bounds(this.$node),e=j.bounds(this.$node.parentNode);return this.vertical?c.top-e.top:c.left-e.left},_adjustToSplitPosition:function(c){var e=
j.bounds(this.$node),b=j.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=e.height;if(c||!this._splitTop)this._splitTop=e.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);c=this._splitTop;this.$node.parentNode.style.position==="relative"&&(c=this._splitTop-b.top);this.$sideNode.style.height=c+"px";this.$sideNode.style.display="block";this.$node.style.top=c+"px"}else{this._splitWidth=e.width;if(c||!this._splitLeft)this._splitLeft=e.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);c=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(c=this._splitLeft-b.left);this.$sideNode.style.width=c+"px";this.$sideNode.style.display="block";this.$node.style.left=c+"px"}this._resize()},_resize:function(c,e,b){var c=c||0,f=j.bounds(this.$node.parentNode),h=j.bounds(this.$node);this._vertical?(b===void 0&&(b=h.top-f.top),b+=h.height,this.$mainNode.style.top=b+"px"):(e===void 0&&(e=h.left-f.left),e+=h.width,this.$mainNode.style.left=e+"px");var d=
this;window.setTimeout(function(){d._notifyResizeListeners(d.$mainNode);d._notifyResizeListeners(d.$sideNode)},c)},_notifyResizeListeners:function(c){this.dispatchEvent({type:"resize",node:c})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(c,e){c||this._addAnimation();var b=this._splitTop,f=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")b=f=this._initialSplit}else if(this._closed=
!0,this._closeReversely){var h=j.bounds(this.$node.parentNode),d=j.bounds(this.$node);this._vertical?b=h.height-d.height:f=h.width-d.width}else b=f=0;this._vertical?(this.$sideNode.style.height=b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=f+"px",this.$node.style.left=f+"px");this._resize(this._animationDelay,f,b);c||this._removeAnimation();e||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var a=this;window.setTimeout(function(){a._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var c=this;window.setTimeout(function(){c.$sideNode.classList.remove(c._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");c.$mainNode.classList.remove(c._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");c.$node.classList.remove(c._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(c){if(c.target===this._thumb)return j.stop(c),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),j.setFramesEnabled(!1),j.stop(c)},_mouseMove:function(c){if(this._tracking){var e=j.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=c.clientY;if(this._splitTop<e.top+5)this._splitTop=e.top+5;else if(this._splitTop>e.top+e.height-5)this._splitTop=e.top+e.height-5;var b=this._splitTop,b=this._splitTop-e.top;this.$node.style.top=b+"px"}else{this._splitLeft=c.clientX;if(this._splitLeft<e.left+5)this._splitLeft=e.left+5;else if(this._splitLeft>
e.left+e.width-5)this._splitLeft=e.left+e.width-5;b=this._splitLeft;b=this._splitLeft-2*e.left;this.$node.style.left=b+"px"}this._adjustToSplitPosition(!0);j.stop(c)}},_mouseUp:function(c){if(this._tracking)j.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),j.stop(c)}};e.prototype.constructor=e;return{Splitter:e}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(g,k,j){function e(c){this.commandRegistry=c.commandRegistry;this.create();this._filterString="";this._providers=[]}e.prototype={addProvider:function(c){this._providers.push(c)},create:function(){var c=this._keyAssistDiv=document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");c.setAttribute("role","menu");var e=this._keyAssistInput=document.createElement("input");
e.classList.add("keyAssistInput");e.type="text";e.placeholder=g["Filter bindings"];c.appendChild(e);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(j.isIOS||j.isAndroid)b.style.overflowY="auto";c.appendChild(b);var f=this._keyAssistTable=document.createElement("table");f.tabIndex=0;f.classList.add("keyAssistList");b.appendChild(f);document.body.appendChild(c);e.addEventListener("keydown",function(b){this._keyDown(b)}.bind(this));f.addEventListener("keydown",
function(b){this._keyDown(b)}.bind(this));e.addEventListener("input",function(){this.filterChanged()}.bind(this));b.addEventListener(j.isFirefox?"DOMMouseScroll":"mousewheel",function(b){this._scrollWheel(b)}.bind(this));document.addEventListener("keydown",function(b){b.keyCode===k.KEY.ESCAPE&&this.hide()}.bind(this));k.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){k.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var c=this._idCount=
this._keyAssistContents.scrollTop=0;c<this._providers.length;c++)this._providers[c].showKeyBindings(this);this.createHeader(g.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(c,e,b){if(this._filterString){var f=this._filterString.toLowerCase(),h;f!==this._filterString?(f=this._filterString,h=function(a){return a}):h=function(a){return a.toLowerCase()};if(h(e).indexOf(f)===-1&&h(c).indexOf(f)===-1&&h(this._lastHeader).indexOf(f)===-1)return}var d=this._keyAssistTable.insertRow(-1);
d.id="keyAssist-keyBinding-"+this._idCount++;d.setAttribute("role","menuitem");d._execute=b;d.classList.add("keyAssistItem");d.addEventListener("click",function(a){this._selectedRow=d;this.execute();a.preventDefault()}.bind(this));b=d.insertCell(-1);b.classList.add("keyAssistName");b.appendChild(document.createTextNode(e));b=d.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var e=this._keyAssistTable.insertRow(-1);
e.classList.add("keyAssistSection");var e=e.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(c));e.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();var c=this._selectedRow;this._selectedRow=null;c&&c._execute&&c._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var c=this._keyAssistInput.value;if(this._filterString!==c)this._filterString=
c,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var c=document.activeElement,e=this._keyAssistDiv,c=e===c||(e.compareDocumentPosition(c)&16)!==0;e.style.display="none";c&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},removeProvider:function(c){c=this._providers.indexOf(c);c!==-1&&this._providers.splice(c,
1)},select:function(c){var e=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(e.length===0)this._selectedIndex=-1;else{var b=this._selectedIndex;b+=c?1:-1;b%=e.length;b<0&&(b=e.length-1);if(this._selectedIndex!==-1)c=e[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=b;if(this._selectedIndex!==-1){this._selectedRow=c=e[this._selectedIndex];c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();
var e=c.getBoundingClientRect(),f=this._keyAssistContents,h=f.getBoundingClientRect();c.offsetTop<f.scrollTop?b===0?f.scrollTop=0:c.scrollIntoView(!0):e.bottom>h.bottom&&c.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select()},_keyDown:function(c){if(c.keyCode===40)this.select(!0);else if(c.keyCode===38)this.select(!1);else if(c.keyCode===13)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var e=0,e=j.isIE||j.isOpera?-c.wheelDelta:j.isFirefox?c.detail*40:-c.wheelDeltaY,b=this._keyAssistContents,f=b.scrollTop;b.scrollTop+=e;if(f!==b.scrollTop)return c.preventDefault&&c.preventDefault(),!1}};return{KeyAssistPanel:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,j){this._preferences=g;this._themeData=j;var e=j.getThemeStorageInfo();this._themeVersion=e.version;var c=g.listenForChangedSettings(e.storage,2,function(e){e.key===c&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,j,e){var c,i;this._themeVersion===void 0||e.get("version")===this._themeVersion?(c=e.get(g.styleset),(i=e.get("selected"))&&(i=JSON.parse(i))):i=c=null;c||(c=j.getStyles(),e.put(g.styleset,JSON.stringify(c)));
if(!i||i[g.selectedKey]===void 0)i=i||{},i[g.selectedKey]=g.defaultTheme,e.put("selected",JSON.stringify(i));e.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(g){var j=this._themeData,e=j.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,j,c);var i=JSON.parse(c.get("selected")),c=JSON.parse(c.get(e.styleset)),b;if(c)for(var f=0;f<c.length;f++)if(c[f].name===i[e.selectedKey]){b=c[f];break}g({style:b,styles:c})}.bind(this))},
setTheme:function(g,j){var e=this._themeData,c=e.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(i){this._initialize(c,e,i);var b=JSON.parse(i.get("selected"));g||(g=b[c.selectedKey]);b[c.selectedKey]=g;i.put("selected",JSON.stringify(b));j?i.put(c.styleset,JSON.stringify(j)):j=JSON.parse(i.get(c.styleset));for(var f=0;f<j.length;f++)if(j[f].name===b[c.selectedKey]){e.processSettings(j[f]);break}i.put("version",this._themeVersion)}.bind(this))},setFontSize:function(g){var j=
this._themeData,e=j.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,j,c);var i=JSON.parse(c.get("selected")),b=JSON.parse(c.get(e.styleset)),f;if(b)for(var h=0;h<b.length;h++)b[h].fontSize=g,b[h].name===i[e.selectedKey]&&(f=b[h]);c.put(e.styleset,JSON.stringify(b));j.processSettings(f)}.bind(this))}};return{ThemePreferences:g}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(k){var j=g.prototype,e;for(e in j)j.hasOwnProperty(e)&&(k[e]=j[e])};g.prototype={addEventListener:function(g,j,e){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[g];c||(c=this._eventTypes[g]={level:0,listeners:[]});c.listeners.push({listener:j,useCapture:e})},dispatchEvent:function(g){var j=g.type;this._dispatchEvent("pre"+j,g);this._dispatchEvent(j,g);this._dispatchEvent("post"+j,g)},_dispatchEvent:function(g,
j){var e=this._eventTypes?this._eventTypes[g]:null;if(e){var c=e.listeners;try{if(e.level++,c)for(var i=0,b=c.length;i<b;i++)if(c[i]){var f=c[i].listener;typeof f==="function"?f.call(this,j):f.handleEvent&&typeof f.handleEvent==="function"&&f.handleEvent(j)}}finally{if(e.level--,e.compact&&e.level===0){for(i=c.length-1;i>=0;i--)c[i]||c.splice(i,1);c.length===0&&delete this._eventTypes[g];e.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:this._eventTypes[g]!==void 0},removeEventListener:function(g,
j,e){if(this._eventTypes){var c=this._eventTypes[g];if(c){for(var i=c.listeners,b=0,f=i.length;b<f;b++){var h=i[b];if(h&&h.listener===j&&h.useCapture===e){c.level!==0?(i[b]=null,c.compact=!0):i.splice(b,1);break}}i.length===0&&delete this._eventTypes[g]}}}};return{EventTarget:g}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,k,j){function e(c){c=c||{};this._document=c.document||document}var c={};e.getTheme=function(i){var i=i||"default",b=c[i];b||(b=c[i]=new e);return b};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,b){var f=this,h=f._themeClass;f._themeClass=c;this._load(c,b,function(){f.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:f.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,b){function f(d,a,b){a&&(h.push("."+c+" ."+d+" {"),h.push("\t"+(b?"background-color":"color")+": "+a+";"),h.push("}"))}var h=[];h.push("");h.push("."+c+" {");b.fontFamily&&h.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&h.push("\tfont-size: "+b.fontSize+";");b.fontSize&&h.push("\tcolor: "+b.text+";");h.push("}");h.push("."+c+".textview {");b.background&&h.push("\tbackground-color: "+b.background+";");h.push("}");f("ruler.annotations",b.annotationRuler,!0);f("ruler.lines",
b.annotationRuler,!0);f("ruler.folding",b.annotationRuler,!0);f("ruler.overview",b.overviewRuler,!0);f("rulerLines",b.lineNumber,!1);f("rulerLines.even",b.lineNumberEven,!1);f("rulerLines.odd",b.lineNumberOdd,!1);f("annotationLine.currentLine",b.currentLine,!0);f("entity-name-tag",b.keyword,!1);f("entity-other-attribute-name",b.attribute,!1);f("string-quoted",b.string,!1);f("meta.annotation.currentLine",b.currentLine,!0);f("keyword",b.keyword,!1);f("string",b.string,!1);f("comment",b.comment,!1);
f("comment.block.documentation",b.comment,!1);f("keyword.other.documentation.markup",b.comment,!1);return h.join("\n")},_createStyle:function(c,b,f,h){var d=this._document,c="orion-theme-"+c,a=d.getElementById(c);if(a){if(h||a.firstChild.data===b)return;a.removeChild(a.firstChild);a.appendChild(d.createTextNode(b))}else h?(a=j.createElement(d,"link"),a.rel="stylesheet",a.type="text/css",a.href=b,a.addEventListener("load",function(){f()})):(a=j.createElement(d,"style"),a.appendChild(d.createTextNode(b))),
a.id=c,(d.getElementsByTagName("head")[0]||d.documentElement).appendChild(a);h||f()},_load:function(c,b,f){if(c)if(typeof b==="string")this._createStyle(c,b,f);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!g.toUrl)this._createStyle(c,b,f,!0);else{var h=this;g(["text!"+b],function(d){h._createStyle(c,d,f,!1)})}else f()}};k.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
define("orion/widgets/themes/ThemeClass",[],function(){function g(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}g.prototype.className=null;g.prototype.classString=void 0;g.prototype.style=void 0;g.prototype.closeString=" }\n";g.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:g}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(g){function k(){}k.prototype.navbar="white";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="#cedce7";k.prototype.sidepanel="#F7F7F7";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var j="",e=[],c=new g.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";e.push(c);c=new g.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="16px";c.style.padding="10px";c.style.paddingLeft="6px";c.style.paddingRight="2px";c.style.borderBottom="none";c.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";c.style.zIndex="100";e.push(c);c=new g.ThemeClass("a");c.style.textDecoration="none";c.style.color=
this.content;e.push(c);c=new g.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;c.style.verticalAlign="bottom";e.push(c);c=new g.ThemeClass("primaryNav");c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";e.push(c);c=new g.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign=
"baseline";c.style.textDecoration="none";e.push(c);c=new g.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";e.push(c);for(var i in e)j+=e[i].toString();return j};k.prototype.writeLocationStyle=function(){var j="",e=[],c=new g.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";e.push(c);c=new g.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";e.push(c);c=new g.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";e.push(c);c=new g.ThemeClass("breadcrumbSeparator");c.style.fontSize=
"8pt";c.style.textDecoration="none";c.style.color=this.separator;c.style.fontWeight="bold";e.push(c);c=new g.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color=this.breadcrumb;c.style.textDecoration="none";c.style.textWrap="normal";c.style.lineHeight="10pt";e.push(c);c=new g.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";e.push(c);c=new g.ThemeClass("navlinkonpage");
c.style.color=this.content;c.style.verticalAlign="middle";e.push(c);if(this.bannerProgress)c=new g.ThemeClass("topRowBanner .progressPane_running"),c.style.borderColor=this.bannerProgress,e.push(c);for(var i in e)j+=e[i].toString();return j};k.prototype.writeButtonStyle=function(){var j="",e=[],c=new g.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="middle";c.style.cursor="pointer";
c.style.display="inline-block";c.style.padding="4px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="9pt";c.style.userSelect="none";e.push(c);c=new g.ThemeClass("commandButton:over");c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";e.push(c);c=new g.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";
c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";e.push(c);c=new g.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";e.push(c);for(var i in e)j+=e[i].toString();return j};k.prototype.writeMainStyle=function(){var j="",e=[],c=new g.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height=
"12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding="0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(c);c=new g.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline=
"none";e.push(c);c=new g.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";e.push(c);c=new g.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=this.content;e.push(c);c=new g.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;e.push(c);c=new g.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;e.push(c);c=new g.ThemeClass("mainToolbar");c.style.background=this.toolpanel;e.push(c);
for(var i in e)j+=e[i].toString();return j};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=
g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value,this.bannerProgress=g.bannerProgress.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel,this.bannerProgress=g.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(g,k,j){function e(){}function c(){this.styles=[];var b=new e;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";b.bannerProgress="whitesmoke";
this.styles.push(b);b=new e;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new e;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel=
"white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name=
"Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";b.sidepanel="white";b.mainpanel="white";b.toolpanel=
"white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";b.bannerProgress="#F2F2F2";this.styles.push(b);
b=new e;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function i(){return this.styles}e.prototype.name="Orion";e.prototype.navbar="#404648";e.prototype.button="#EFEFEF";e.prototype.location="#333";e.prototype.breadcrumb="#3087B3";e.prototype.separator=
"#333";e.prototype.selection="FEC";e.prototype.sidepanel="#FBFBFB";e.prototype.mainpanel="white";e.prototype.toolpanel="white";e.prototype.navtext="#bfbfbf";e.prototype.content="#3087B3";e.prototype.search="#444";e.prototype.bannerProgress="white";c.prototype.styles=[];c.prototype.getStyles=i;c.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};c.prototype.getViewData=function(){var b={top:10,left:10,
width:350,height:350};b.shapes=[{type:"RECTANGLE",name:g["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:g["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:g["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:g["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:g["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:g.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:g["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:g.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:g.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:g.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:g["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:g.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:g["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:g["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:g["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:g["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:g["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:g["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:g["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var f=0;f<3;f++)b.shapes.push({type:"TEXT",name:g.Content,label:"org.eclipse.orion.content",x:170,y:127+20*f,fill:"#3087B3",family:"content"});for(f=0;f<3;f++)b.shapes.push({type:"TEXT",name:g.Content,label:"Item",x:25,y:115+20*f,fill:"#3087B3",family:"content"});for(f=0;f<3;f++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+f*20,x2:165,y2:124+f*20,x3:160,y3:127+f*20,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};c.prototype.processSettings=function(b){var f=new j.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",f.getSheet(b))};return{ThemeData:c,getStyles:i}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","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","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(g){function k(j,e,c){this.elements=c;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);e===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),g.addAutoDismiss([this.container],this.destroy.bind(this))):j.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}k.prototype.elementNode=null;k.prototype.switchesContainer=null;k.prototype.switches=null;k.prototype.radioButtons=null;k.prototype.chosenSwitch=null;k.prototype.addElement=
function(g){var e=document.createElement("span");e.className="UAContainer-icon";e.innerHTML='<span class="workingSpan"><img src="'+g.image+'" id="'+g.label+'ImageNode" alt="'+g.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+g.label+'LabelNode" >'+g.label+"</span></span>";e.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;document.getElementById(g.label+"LabelNode").className="UALabel-live";e.className="UAContainer-icon-live"};
e.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";e.className="UAContainer-icon"};var c=this;e.onclick=function(){c.showMedia(g)};this.elementNode.appendChild(e)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(g){this.clearElements();this.addElement(g);var e=document.createElement("span");e.className="UAContainer-media";e.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
g.media+'" alt="'+g.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(e);setTimeout(function(){e.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};k.prototype.createSwitch=function(g){var e;e=g?g.label+"switch":"indexSwitch";var c=document.createElement("span");c.className="workingSpan";c.innerHTML='<div class="circle" id ="'+e+'"></div>';var i=this;c.onclick=
g?function(){i.showMedia(g)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=c;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(c);return this.radioButtons[this.radioButtons.length]=c};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(g,k,j,e){function c(){}var i=null;c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var b=document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var f=document.createRange();f.selectNode(b);f=f.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(f);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var h=this;this.$close.addEventListener("click",function(){h.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);
f=document.createRange();f.selectNode(this.$parent);b=f.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(d){d.keyCode===j.KEY.ESCAPE?h.hide():d.keyCode===j.KEY.ENTER&&typeof h._defaultCallback==="function"&&h._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);
this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(f){var h=e.createButton(f.text,f.callback);if(f.id)h.id=f.id,b["$"+h.id]=h;if(f.isDefault)b._defaultCallback=f.callback,b._defaultButton=h;b.$buttonContainer.appendChild(h)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!j.contains(b.$frame,
a.target);if(d)for(var h=0;h<b.$$modalExclusions.length;h++)if(j.contains(b.$$modalExclusions[h],a.target)){d=!1;break}d&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var f=this.$frameParent.childNodes,h=!1;this._addedBackdrop=[];for(var d=0;d<f.length;d++){for(var a=0;a<this.$$modalExclusions.length;a++)if(j.contains(this.$$modalExclusions[a],
f[d])){h=!0;break}!h&&f[d]!==b.$frame&&f[d].classList&&!f[d].classList.contains("tooltipContainer")&&(a=f[d],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(f=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&f.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var d=b._getFirstFocusField();d&&d!==a.target&&d.focus();j.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},
_inModalExclusion:function(b){return this.$$modalExclusions.some(function(f){return b.$frame===f||b.$parent===f})},_bindElements:function(b){for(var f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];h.id&&(this["$"+h.id]=h);this._bindElements(h)}},hide:function(b){!b&&i===this&&(i=null);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");j.setFramesEnabled(!0);typeof this._afterHiding==="function"&&this._afterHiding();var f=this;this.keepAlive||window.setTimeout(function(){f.destroy()},0)},show:function(b){if(this.modal)if(i){if(!i._inModalExclusion(this)){this.hide(!0);return}}else i=this;typeof this._beforeShowing==="function"&&this._beforeShowing();j.setFramesEnabled(!1);var f=j.bounds(this.$frame),h=j.bounds(document.documentElement),d;b?(d=j.bounds(b),b=d.top+d.height+4,d=d.left+
4,b+f.height>h.height&&(b=Math.max(0,h.height-f.height-4)),d+f.width>h.width&&(d=Math.max(0,h.width-f.width-4))):(d=Math.max(0,(h.width-f.width)/2),b=Math.max(0,(h.height-f.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=d+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return j.firstTabbable(this.$parent)||
this._defaultButton||j.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){if(this.$frame)i===this&&(i=null),j.setFramesEnabled(!0),this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0}};c.prototype.constructor=
c;return{Dialog:c}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(g,k,j,e,c){function i(b){this._displaySignOut=!0;this._init(b)}i.prototype={_init:function(b){this._dropdownNode=j.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=b.noSeparator;this._dropDownItemClass=b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var f=0,h;for(h in b)b.hasOwnProperty(h)&&f++;return f},_makeMenuItem:function(b,
f){var h=document.createElement("span");h.role="menuitem";h.tabIndex=0;var d=document.createTextNode(b);h.appendChild(d);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.addEventListener("click",f,!1);h.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&f()},!1);return h},_renderAuthenticatedService:function(b){var f=this,h=this.authenticatedServices[b].authService;
if(h&&h.logout&&this._displaySignOut){var d=document.createElement("li"),a=this._makeMenuItem(g["Sign Out"],function(){h.logout().then(function(){f.addUserItem(b,h,f.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var d=localStorage.key(a);d&&d.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(d)}h.getAuthForm(window.location.href).then(function(a){window.location=a})})});d.appendChild(a);this._dropdownNode.appendChild(d)}},
renderServices:function(){function b(a){h[a]||(h[a]=f.createDocumentFragment());return h[a]}var f=document,h=[],d=this._serviceRegistry;e.getPageLinksInfo(d,"orion.page.link.user").then(function(a){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);a.getAllLinks().forEach(function(a){var d,h;if(a.category&&(h=/user\.(\d+)/.exec(a.category)))d=parseInt(h[1],10);if(typeof d!=="number"||isNaN(d))d=1;d=b(d);h=f.createElement("li");var c=f.createElement("a");c.role="menuitem";
typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");c.href=a.href;c.textContent=a.textContent;h.appendChild(c);d.appendChild(h);c.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&c.click()},!1)}.bind(this));if(this.keyAssistFunction){var a=document.createElement("li"),c=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass===
"string"?this._keyAssistClass!==""&&c.classList.add(this._keyAssistClass):c.classList.add("key-assist-menuitem");a.appendChild(c);b(0).appendChild(a)}if(a=d.getServiceReferences("orion.page.getstarted")[0])c=a.getProperty("data"),a=document.createElement("li"),c=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,c)),a.appendChild(c),b(0).appendChild(a);var e=this;h.sort(function(a,d){return a-d}).forEach(function(a,d){if(d<h.length-1&&!this._noSeparator){var b=document.createElement("li");
b.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");b.appendChild(f);a.appendChild(b)}e._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var i in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(i)&&this._renderAuthenticatedService(i,0)}.bind(this))},getStartedDialog:function(b){new c(null,!0,b)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,f,h,d){d?
(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:f,label:h,data:d}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:f,label:h,pending:this.unauthenticatedServices[b].pending}:{authService:f,label:h});this.renderServices()}};i.prototype.constructor=i;return{UserMenu:i}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(g,k,j,e,c,i){function b(b,d,a){var f="";a&&(f="^");if(f=j.parse("/"+f+b.searchStr+"/"))a=f.pattern,f=f.flags,f.indexOf("i")===-1&&!d.caseSensitive&&(f+="i"),b.regExp={pattern:a,flags:f},b.wildCard=!0}var f={ALL_FILE_TYPE:"*.*"};f.doSearch=function(b,d,a,c){if(b){var e=!0;a==="*"&&(a="");a===""&&(e=c&&c.type!==f.ALL_FILE_TYPE);if(e)a!==""&&f.addRecentSearch(d,
a,c?c.regEx:!1),b=b.createSearchParams(a,!1,!1,c),b=f.generateSearchHref(b),window.location=b}else window.alert(g["Can't search: no search service is available"])};f.generateSearchHelper=function(h,d){var a=h.keyword,c=a,e={};h.fileType&&h.fileType!==f.ALL_FILE_TYPE&&a===""&&(c="*."+h.fileType);if(h.regEx)e.searchStr=a,b(e,h,d);else{var i=a.indexOf("*")>-1,g=a.indexOf("?")>-1;i&&(a=a.split("*").join(".*"));g&&(a=a.split("?").join("."));!i&&!g&&!h.nameSearch?(e.searchStr=h.caseSensitive?a.split("\\").join(""):
a.split("\\").join("").toLowerCase(),e.wildCard=!1):(e.searchStr=h.caseSensitive?a:a.toLowerCase(),b(e,h,d),e.wildCard=!0)}e.searchStrLength=e.searchStr.length;return{params:h,inFileQuery:e,displayedSearchTerm:c}};f.convertSearchParams=function(b){if(b.rows!==void 0)b.rows=parseInt(b.rows,10);if(b.start!==void 0)b.start=parseInt(b.start,10);if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive==="string")b.caseSensitive=b.caseSensitive.toLowerCase()==="true";
if(typeof b.nameSearch==="string")b.nameSearch=b.nameSearch.toLowerCase()==="true"};f.copySearchParams=function(b,d){var a={},f;for(f in b)if(b[f]!==void 0&&b[f]!==null&&(d||f!=="replace"))a[f]=b[f];return a};f.generateSearchHref=function(b){var d=k.toUrl("search/search.html"),b=f.copySearchParams(b,!0),a=b.resource;b.resource=void 0;return typeof b.keyword!=="undefined"?(new i(d+"#{,resource,params*}")).expand({resource:a,params:b}):(new i(d+"#{,resource}")).expand({resource:a})};f.generateFindURLBinding=
function(b,d,a,f,c){b={find:d.searchStr,regEx:d.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:typeof f==="string"?f:void 0,atLine:typeof a==="number"?a:void 0};return c?b:","+(new i("{,params*}")).expand({params:b})};f.convertFindURLBinding=function(b){if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive==="string")b.caseSensitive=b.caseSensitive.toLowerCase()==="true";if(typeof b.atLine==="string")b.atLine=parseInt(b.atLine,10)};f.replaceRegEx=
function(b,d,a){return b.replace(RegExp(d.pattern,d.flags),a)};f.replaceStringLiteral=function(b,d,a){d=j.parse("/"+d+"/gim");return f.replaceRegEx(b,d,a)};f.searchOnelineLiteral=function(b,d,a){var f;f=0;for(var c=!1,e=[];;)if(f=d.indexOf(b.searchStr,f),f<0)break;else{e.push({startIndex:f,length:b.searchStrLength});c=!0;if(a)break;f+=b.searchStrLength}return c?e:null};f.findRegExp=function(b,d,a,f){if(!d)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");var c=null;
return(c=RegExp(d,a).exec(b.substring(f)))&&{startIndex:c.index+f,length:c[0].length}};f.searchOnelineRegEx=function(b,d,a){for(var c=0,e=!1,i=[];;)if(c=f.findRegExp(d,b.regExp.pattern,b.regExp.flags,c)){i.push(c);e=!0;if(a)break;c=c.startIndex+c.length}else break;return e?i:null};f.generateNewContents=function(b,d,a,c,e,i){if(c&&d){if(!b)a.contents=[];for(var g=0;g<d.length;g++){for(var j=d[g],k=!1,u=!1,w=[],t,x=0,n=0;n<c.children.length;n++)if(c.children[n].lineNumber-1===g){x=n;for(k=0;k<c.children[n].matches.length;k++)c.children[n+
k].checked!==!1&&w.push(k);u=w.length>0;t=c.children[n].matches;k=!0;break}if(k){if(u){w=f.replaceCheckedMatches(j,e,t,w,i);j=w.replacedStr;for(k=0;k<c.children[x].matches.length;k++)c.children[x+k].newMatches=w.newMatches}else for(k=0;k<c.children[x].matches.length;k++)c.children[x+k].newMatches=c.children[x+k].matches;b?a.contents[g]=j:a.contents.push(j)}else b||a.contents.push(j)}}};f.generateMatchContext=function(b,d,a){var f=[],c=b*2+1,e;d.length<=c?(e=0,b=d.length-1):(e=a-b,e<0?(e=0,b=e+c-1):
(b=a+b,b>d.length-1&&(b=d.length-1,e=b-c+1)));for(c=e;c<=b;c++)f.push({context:d[c],current:c===a});return f};f.splitFile=function(b){for(var d=0,a=0,f=0,c=0,e=[];;){d!==-1&&d<=f&&(d=b.indexOf("\r",f));a!==-1&&a<=f&&(a=b.indexOf("\n",f));if(a===-1&&d===-1){e.push(b.substring(c));break}var i=1;d!==-1&&a!==-1?d+1===a?(i=2,f=a+1):f=(d<a?d:a)+1:f=d!==-1?d+1:a+1;e.push(b.substring(c,f-i));c=f}return e};f.searchWithinFile=function(b,d,a,c,e,i){a=f.splitFile(a);if(e)d.contents=a;if(d){d.children=[];for(var g=
c=0;g<a.length;g++){var j=a[g];if(j&&j.length>0){var k=i?j:j.toLowerCase();if(k=b.wildCard?f.searchOnelineRegEx(b,k):f.searchOnelineLiteral(b,k)){var u,w=g+1;if(e)for(var t=0;t<k.length;t++)u=t+1,u={parent:d,checked:d.checked,type:"detail",matches:k,lineNumber:w,matchNumber:u,name:j,location:d.location+"-"+w+"-"+u},d.children.push(u);else u={parent:d,context:f.generateMatchContext(2,a,g),checked:d.checked,type:"detail",matches:k,lineNumber:w,name:j,location:d.location+"-"+w},d.children.push(u);c+=
k.length}}}d.totalMatches=c}};f.replaceCheckedMatches=function(b,d,a,f,c){for(var e=0,i="",g=[],j=0;j<a.length;j++){e!==a[j].startIndex&&(i+=b.substring(e,a[j].startIndex));if(a[j].length)c=a[j].length;for(var e=!1,k=0;k<f.length;k++)if(f[k]===j){e=!0;break}e?(g.push({startIndex:i.length,length:d.length}),i+=d):(g.push({startIndex:i.length,length:c}),i+=b.substring(a[j].startIndex,a[j].startIndex+c));e=a[j].startIndex+c}e<b.length&&(i+=b.substring(e));return{replacedStr:i,newMatches:g}};f.fullPathNameByMeta=
function(b){var d=b.length,a="";if(d>0)for(d-=1;d>-1;d--)a=a+(a===""?"":"/")+b[d].Name;return a};f.path2FolderName=function(b,d,a){return b.substring(0,b.length-d.length-(a?0:1))};f._storeRecentSearch=function(b,d,a,f){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("recentSearch",d);a&&window.setTimeout(function(){a.dispatchEvent({type:"inputDataListChanged",deleting:f})}.bind(this),20)})};f.addRecentSearch=function(b,d,a){typeof d==="string"&&d&&
b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c){for(e in c)if(c[e].name===d)return;c.length>=20&&c.splice(19,c.length-20+1)}else c=[];c.splice(0,0,{name:d,regEx:a});f._storeRecentSearch(b,c)})};f.removeRecentSearch=function(b,d,a){typeof d==="string"&&d&&b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,c=c.get("recentSearch");typeof c===
"string"&&(c=JSON.parse(c));if(c)for(e in c)if(c[e].name===d){c.splice(e,1);f._storeRecentSearch(b,c,a,!0);break}})};f.getSearches=function(b,d,a){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get(d);typeof b==="string"&&(b=JSON.parse(b));b&&a&&a(b)})};f.getMixedSearches=function(b,d,a,c){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var h=b.get("recentSearch");typeof h==="string"&&(h=JSON.parse(h));d&&(b=
b.get("search"),typeof b==="string"&&(b=JSON.parse(b)),b&&b.forEach(function(d){if(a){var b=f.parseQueryStr(d.query);h.some(function(a){return b.searchStrTitle===a.name})||h.push({name:b.searchStrTitle,label:d.name})}else h.push({name:null,label:d.name,value:d.query})}));h&&c&&c(h)})};f.getOpenSearchPref=function(b,d){b.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");d(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};
f.setOpenSearchPref=function(b,d){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:d})})};return f});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(g,k,j,e,c,i){function b(b,h,d,a){this.registry=b;this.fileClient=h;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=a&&a.searchOnName;this._buildSkeletonOnly=a&&a.buildSkeletonOnly;this._fetchChildrenCallBack=a&&a.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(d);this._location=a&&a.location;this._childrenLocation=a&&a.childrenLocation?a.childrenLocation:this._location;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var h=this.registry.getService("orion.core.contentTypeRegistry");
this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];h.getContentTypes().then(function(d){this.contentTypesCache=d;var a=this;this._visitRecursively(this._childrenLocation).then(function(){a._cancelled||a._reportResult()}.bind(a),function(d){a._reportResult();a._statusService&&d.name==="Cancel"&&(console.log("Crawling search cancelled. Deferred array length : "+a._deferredArray.length),a._statusService.setProgressResult({Message:g["Search cancelled by user"],Severity:"Warning"}))}.bind(a))}.bind(this))};
b.prototype.searchName=function(b,h){if(b)this._searchParams=b,this.searchHelper=e.generateSearchHelper(b,!0);if(h)this.onSearchNameComplete=h;var d=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var a=0;a<this.fileSkeleton.length;a++){var c=this.fileSkeleton[a].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(d.push(this.fileSkeleton[a]),
d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,docs:d}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};b.prototype.buildSkeleton=function(b,c){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var a=this;b();d.getContentTypes().then(function(d){a.contentTypesCache=d;a._visitRecursively(a._childrenLocation).then(function(){a._buildingSkeleton=!1;
c();a.searchHelper&&!a._buildSkeletonOnly&&a.searchName()})})};b.prototype._sort=function(b){b.sort(function(b,d){var a,c;if(this._searchParams.sort==="Path asc"){a=b.Location&&b.Location.toLowerCase();a=e.path2FolderName(a,b.Name&&b.Name.toLowerCase(),!0);c=d.Location&&d.Location.toLowerCase();c=e.path2FolderName(c,d.Name&&d.Name.toLowerCase(),!0);if(a<c)return-1;if(a>c)return 1}return this._sortOnNameSingle(b,d)}.bind(this))};b.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})};b.prototype._sortOnNameSingle=function(b,c){var d=b.Name&&b.Name.toLowerCase(),a=c.Name&&c.Name.toLowerCase();return d<a?-1:d>a?1:0};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};b.prototype._visitRecursively=function(b){var h=[],d=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(d._progressService?this._progressService.progress(d.fileClient.fetchChildren(b),
"Crawling search for children of "+b):d.fileClient.fetchChildren(b)).then(function(a){for(var b=0;b<a.length;b++)if(a[b].Directory!==void 0&&a[b].Directory===!1)if(d._searchOnName)h.push(d._buildSingleSkeleton(a[b]));else if(d._buildSkeletonOnly)h.push(d._buildSingleSkeleton(a[b]));else{if(!d._cancelled){var f=c.getFilenameContentType(a[b].Name,d.contentTypesCache);if(f&&(f["extends"]==="text/plain"||f.id==="text/plain")&&d._onFileType(f))f=d._sniffSearch(a[b]),h.push(f),d._deferredArray.push(f)}}else if(a[b].Location)if(d._cancelled)break;
else f=d._visitRecursively(a[b].ChildrenLocation),h.push(f),d._deferredArray.push(f);return i.all(h)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.prototype._reportSingleHit=function(b){if(!this._cancelled)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._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};b.prototype._sniffSearch=function(b){this._totalCounter++;var c=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return(c._progressService?c._progressService.progress(c.fileClient.read(b.Location),"Reading file "+b.Location):c.fileClient.read(b.Location)).then(function(d){c._hitOnceWithinFile(d)&&c._reportSingleHit(b);c._statusService&&c._statusService.setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)},g.Cancel)},function(d){d&&d.message&&d.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+
d.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new i;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(g,k,j,e,c,i,b){function f(b){this._init(b)}f.prototype=new b.Dialog;f.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+
e.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:250px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';f.prototype._init=function(b){this.title=b.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;this._contentTypeService=new j.ContentTypeRegistry(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(g["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(g["Missing required argument: searchRenderer"]);this._initialize()};f.prototype._bindToDom=function(b){var d=this;d.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",g["FileName FolderName"]):this.$fileName.setAttribute("placeholder",g.Search);this.$fileName.addEventListener("input",function(){d._time=+new Date;d._timeoutId&&clearTimeout(d._timeoutId);d._timeoutId=setTimeout(d.checkSearch.bind(d),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var b=c.$("a",d.$results);if(b)c.stop(a),(i.isMac?a.metaKey:a.ctrlKey)?window.open(b.href):(window.location.href=b.href,d.hide())}},!1);b.addEventListener("keydown",function(a){var b,h,f;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)b=c.$$array("a",d.$results),h=document.activeElement,f=b.indexOf(h),a.keyCode===c.KEY.DOWN?f>=0?(h.classList.remove("treeIterationCursor"),b=f<b.length-1?b[f+1]:b[0],b.focus(),
b.classList.add("treeIterationCursor")):b.length>0&&(b=-1<b.length-1?b[0]:b[0],b.focus(),b.classList.add("treeIterationCursor")):f>=0?(h.classList.remove("treeIterationCursor"),h=d.$fileName,b=f>0?b[f-1]:h,b.focus(),f>0&&b.classList.add("treeIterationCursor")):b.length>0&&(b[b.length-1].focus(),b[b.length-1].classList.add("treeIterationCursor")),c.stop(a)});b.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(d._forceUseCrawler||!d._fileService.getService(d._searcher.getSearchLocation()).search){var a=
d._searchOnRoot?d._searcher.getSearchRootLocation():d._searcher.getChildrenLocation(),a=new k.SearchCrawler(d._searcher.registry,d._fileService,"",{searchOnName:!0,location:a});d._searcher.setCrawler(a);a.buildSkeleton(function(){d.$crawlingProgress.style.display="inline";d.$progress.appendChild(document.createTextNode(g["Building file skeleton..."]))},function(){d.$crawlingProgress.style.display="none";d.$progress.removeChild(d.$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()};f.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)};f.prototype._detectFolderKeyword=function(b){var d,a=b,c=null;if(this._nameSearch&&(d=/(\S+)\s*(.*)/,(b=d.exec(b))&&b.length===3))b[1]&&
(a=b[1]),b[2]&&(c=b[2]);return{keyword:a,folderKeyword:c}};f.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var d=this._detectFolderKeyword(b),a=this._searcher.createSearchParams(d.keyword,this._nameSearch,this._searchOnRoot),f=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=f;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?g["Searching..."]:i.formatMessage(g["Searching for occurrences of"],
b)));c.empty(this.$results);this.$results.appendChild(e);this._searcher.search(a,d.folderKeyword,function(){f===this.currentSearch&&f.apply(null,arguments)}.bind(this))}};f.prototype.decorateResult=function(b){function d(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&a.hide()}for(var a=this,b=c.$$array("a",b),f=0;f<b.length;f++)b[f].addEventListener("click",d,!1)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype._afterHiding=function(){this._onHide&&this._onHide()};f.prototype.constructor=
f;return{OpenResourceDialog:f}});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\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<div id="centralNavigationArea" style="position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"></div>\n\n\t\t<\!-- Static "Home" link. TODO delete this --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\n\t\t<\!-- Left banner component: hamburger --\>\n\t\t<nav id="primaryNav" class="bannerLeftArea" style="z-index:2;" role="navigation">\n\t\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\n\t\t<\!-- Middle banner component: Breadcrumb bar --\>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\n\t\t<\!-- Right banner component: user identity --\>\n\t\t<div class="bannerRightArea" style="z-index:2;">\n\t\t\t<\!-- Global commands support. --\>\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\n\t\t\t<\!-- Search. TODO delete this --\>\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\n\t\t\t<\!-- User identity menu and Progress --\>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;line-height:16px;">\n\t\t\t\t<div style="position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"></div>\n\n\t\t\t\t<\!-- Progress indicator --\>\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\n\t\t\t\t<\!-- User identity menu --\>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger" style="z-index:2;">\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\n\t<\!-- IDE notification messages go in here --\>\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'<\!--\n<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\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="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=5.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>\n--\>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<ul class="layoutRight commandList pageActions" id="settingsActions"></ul>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(g,k){function j(e,c,i){if(e=k.node(e))this._parent=e;else throw Error("Parent node of dropdown menu not found");this.options=i=i||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=i.selectionClass;e=document.createElement("div");e.classList.add("dropDownContainer");e.id=this.navDropDownId;e.style.display="none";this._parent.appendChild(e);this._dropdownMenu=e;if(c=k.node(c))this._triggerNode=
c;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!i.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}g.mixin(j.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){k.setFramesEnabled(!1);this._dropdownMenu.style.display=
"";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",k.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(e){this._dropdownMenu.innerHTML=e},getContentNode:function(){return this._dropdownMenu},updateContent:function(e,c){c()},_positionDropdown:function(){this._dropdownMenu.style.right="";var e=k.bounds(this._dropdownMenu),c=k.bounds(document.body);if(e.left+e.width>c.left+c.width)e=k.bounds(this._boundingNode(this._triggerNode)),c=k.bounds(this._triggerNode),this._dropdownMenu.style.right=e.width-(c.left-e.left+c.width)+"px"},_boundingNode:function(e){var c=window.getComputedStyle(e,
null);return c===null?e:c.getPropertyValue("position")==="absolute"||!e.parentNode||e===document.body?e:this._boundingNode(e.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.setFramesEnabled(!0),k.empty(this._parent),this._parent=this.select=null}});return j});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"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":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","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","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",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"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} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,k,j){function e(b,c,h){if(!b[c])throw c+g[" is not supported in this file system"];return b[c].apply(b,h)}function c(b,f,h,d){if(!b.readBlob)throw g["source file service does not support binary read"];if(!h.writeBlob)throw g["target file service does not support binary write"];if(f[f.length-1]!=="/")return e(b,"readBlob",[f]).then(function(a){return e(h,"writeBlob",[d,a])});var a=d.substring(0,
d.length-1),i=decodeURIComponent(a.substring(a.lastIndexOf("/")+1)),a=a.substring(0,a.lastIndexOf("/")+1);return e(h,"createFolder",[a,i]).then(function(){},function(){}).then(function(){return e(b,"fetchChildren",[f]).then(function(a){for(var f=[],e=0;e<a.length;++e){var i=a[e].Location,l=i;a[e].Directory&&(l=i.substring(0,i.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=d+encodeURIComponent(l);a[e].Directory&&(l+="/");f[e]=c(b,i,h,l)}return k.all(f)})})}function i(b,c){function h(a){var b=
new k;b.reject(g["No Matching FileService for location:"]+a);return b}var d=b.getServiceReferences("orion.core.file"),a=d;if(c)for(var a=[],e=0;e<d.length;++e)c(d[e])&&a.push(d[e]);for(var i=[],o=[],s=[],r=[],v={fetchChildren:function(){var a=new k;a.resolve(r);return a},createWorkspace:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:r,ChildrenLocation:"/"})},100);return a},search:h,createProject:h,createFolder:h,createFile:h,deleteFile:h,moveFile:h,copyFile:h,read:h,write:h},d=0;d<a.length;++d)r[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:a[d].getProperty("top"),ChildrenLocation:a[d].getProperty("top"),Name:a[d].getProperty("Name")},e=a[d].getProperty("pattern")||a[d].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),e[0]!=="^"&&(e=
"^"+e),i[d]=RegExp(e),o[d]=b.getService(a[d]),s[d]=a[d].getProperty("Name"),a[d].getProperty("NameKey")&&a[d].getProperty("nls")&&j.getMessageBundle(a[d].getProperty("nls")).then(function(b,d){r[b].Name=d[a[b].getProperty("NameKey")];s[b]=d[a[b].getProperty("NameKey")]}.bind(this,d));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return o[0]?0:-1;for(var b=0;b<i.length;++b)if(i[b].test(a))return b;throw g["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return a===-1?v:o[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return a===-1?v.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?v.Location:r[a].Location}}i.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 e(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return e(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return e(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,c,h,d){return e(this._getService(b),"createProject",arguments)},createFolder:function(b,c){return e(this._getService(b),"createFolder",arguments)},createFile:function(b,c){return e(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return e(this._getService(b),"deleteFile",arguments)},moveFile:function(b,f,h){var d=this._getService(b),a=this._getService(f);if(d===a)return e(d,"moveFile",arguments);var i=b[b.length-1]==="/",g=f;g[g.length-1]!=="/"&&(g+="/");if(h)g+=encodeURIComponent(h);else{var o=b;i&&(o=o.substring(0,o.length-1));g+=o.substring(o.lastIndexOf("/")+1)}i&&g[g.length-1]!=="/"&&(g+="/");return c(d,b,a,g).then(function(){return e(d,"deleteFile",[b])})},copyFile:function(b,f,h){var d=
this._getService(b),a=this._getService(f);if(d===a)return e(d,"copyFile",arguments);var i=b[b.length-1]==="/",g=f;g[g.length-1]!=="/"&&(g+="/");if(h)g+=encodeURIComponent(h);else{var o=b;i&&(o=o.substring(0,o.length-1));g+=o.substring(o.lastIndexOf("/")+1)}i&&g[g.length-1]!=="/"&&(g+="/");return c(d,b,a,g)},read:function(b,c){return e(this._getService(b),"read",arguments)},readBlob:function(b){return e(this._getService(b),"readBlob",arguments)},write:function(b,c,h){return e(this._getService(b),"write",
arguments)},remoteImport:function(b,c){return e(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,c){return e(this._getService(b),"remoteExport",arguments)},search:function(b){return e(this._getService(b.resource),"search",arguments)}};i.prototype.constructor=i;return{FileClient:i}});
define("orion/webui/SideMenu","orion/commands,orion/objects,orion/webui/littlelib,orion/PageLinks,orion/PageUtil,orion/URITemplate,orion/URL-shim,orion/util".split(","),function(g,k,j,e,c,i,b,f){function h(a,b){this.parentNode=j.node(a);this.contentNode=j.node(b);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);j.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function d(a){return!a.isRelatedLink}function a(a,b){var d=a.order,c=b.order;if(d<c)return-1;else if(c<d)return 1;return 0}function l(a,b){var d=a.source.order,c=b.source.order,d=typeof d==="number"?d:100,c=typeof c==="number"?
c:100;return d===c?a.textContent.localeCompare(b.textContent):d<c?-1:1}var m=f.isTouch;k.mixin(h.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,b,d){var c=this.anchor,a=this.createListItem(a,b);d&&a.classList.add("sideMenuItemActive");c.appendChild(a);this.menuitems[b]=a},setSideMenu:function(){var a=this.getDisplayState(),b=this.parentNode;if(b){if(a===this.CLOSED_STATE){this.setPageContentLeft("0");
if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){b.style.display="none"},this.TRANSITION_DURATION_MS);b.classList.add("animating")}if(a===this.OPEN_STATE){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;b.classList.remove("animating");b.style.display="block";b.style.width=this.SIDE_MENU_OPEN_WIDTH;this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)}}},setPageContentLeft:function(a){var b=this.contentNode;if(b)b.style.left=
a},toggleSideMenu:function(){var a=this.getDisplayState(),b=this.contentNode;b&&b.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];j.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(b){return a[b]})},getMenuItem:function(a){return this.menuitems[a]},
getDisplayState:function(){var a=localStorage.getItem(this.LOCAL_STORAGE_NAME);if(!a)a=this.DEFAULT_STATE;return a},createListItem:function(a,b){var d=document.createElement("li");d.className=a;d.classList.add("sideMenuItem");d.categoryId=b;return d},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var b=this,d=a.createLinkElements();a.getAllLinks().forEach(function(a,c){var f=d[c];f.source=a;b._getLinksBin(a.category).push(f)});
this._renderLinks()},setRelatedLinks:function(a,b){this.relatedLinks=a;var c=this;Object.keys(this.links).forEach(function(a){var b=c._getLinksBin(a);c.links[a]=b.filter(d)});var f=document.createDocumentFragment();a.forEach(function(a){var b=a.relatedLink,d=c._getLinksBin(b.category),a=g.createCommandMenuItem(f,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=b;d.push(a)});this._renderLinks(b)},_getLinksBin:function(a){if(a){var b=this.links;b[a]=b[a]||[];
return b[a]}else return[]},_sort:function(){var a=this.links;Object.keys(a).forEach(function(b){a[b].sort(l)})},_renderCategories:function(){var b=this.categories,d=this,f=new URL(window.location.href),h=c.matchResourceParameters();h.OrionHome=e.getOrionHome();var l=!1;this.clearMenuItems();b.getCategoryIDs().map(function(a){return b.getCategory(a)}).sort(a).forEach(function(a){var b=d._getLinksBin(a.id);b.length&&(l?d.addMenuItem(a.imageClass,a.id,!1):(b=b.some(function(a){if(!a.source.uriTemplate)return!1;
a=new i(a.source.uriTemplate);a=new URL(a.expand(h),window.location);return a.protocol===f.protocol&&a.host===f.host&&a.hostname===f.hostname&&a.port===f.port&&a.pathname===f.pathname&&a.search===f.search?l=!0:!1}),d.addMenuItem(a.imageClass,a.id,b)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var b=this,d=window.location.href;Object.keys(this.menuitems).forEach(function(c){var f=b.getMenuItem(c);if(f){for(var h=b._getLinksBin(c).slice(),h=h.filter(function(b){var c=
b.source;return a.indexOf(c.id)>=0||!c.default&&!c.force&&b.href===d?!1:!0}),h=h.filter(function(a){a=a.source;return!(h.length>1&&a.default&&!a.force)}),e=h.length-1;e>0;e--)h[e].href===h[e-1].href&&h.splice(e,1);if(h.length){f.appendChild(b._createCategoryElement(c,f,h[0]));var i=document.createElement("ul");i.className="sideMenuSubMenu";h.forEach(function(a){var b=document.createElement("li");b.className="sideMenuSubMenuItem";var d=document.createElement("a");d.href=a;d.className="sideMenuSubMenuItemLink";
var c=document.createElement("span");c.innerHTML=a.innerHTML;c.className="sideMenuSubMenuItemSpan";d.appendChild(c);b.appendChild(d);i.appendChild(b)});f.appendChild(i)}}})},_createCategoryElement:function(a,b,d){var a=this.categories.getCategory(a),c;m?(c=document.createElement("button"),c.type="button"):(c=document.createElement("a"),c.href=d.href);c.className+=a.imageClass;c.classList.add("submenu-trigger");c.tabIndex="0";b.classList.remove(a.imageClass);return c},_handleEvent:function(a){var b=
a.target,a=a.type==="focus";if(b.tagName!=="A"||a)b.classList.contains("submenu-trigger")&&(m||a)&&this._expandMenu(j.$(".sideMenuSubMenu",b.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(b){b=j.$(".sideMenuSubMenu",b);a!==b&&b.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return h});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/EventTarget,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/keyAssist,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/util,orion/customGlobalCommands,orion/fileClient,orion/webui/SideMenu,orion/objects".split(","),function(g,
k,j,e,c,i,b,f,h,d,a,l,m,o,s,r,v,u,w,t,x,n,p,y,q,z,C,H,I,A,E,D,B,M,K){var O,X,R,S,T,P,J,G;function F(a,b){if(a.getLabel)return a.getLabel();else{var d=new p;d.resolve(b.properties.name);return d}}function L(a){m.node("progressPane").setAttribute("aria-label",g["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function U(a,b){var d=a.getServiceReferences("orion.core.auth");ea=[];var c=O.apply(this,arguments);if(c)for(var f=
0;f<d.length;f++){var h=d[f],e=a.getService(h);F(e,h).then(function(a){e.getKey().then(function(b){ea.push(b);e.getUser().then(function(d){c.addUserItem(b,e,a,d)},function(d,f){c.addUserItem(b,e,a,f)});window.addEventListener("storage",function(){da[b]!==localStorage.getItem(b)&&(da[b]=localStorage.getItem(b),e.getUser().then(function(d){c.addUserItem(b,e,a,d)},function(){c.addUserItem(b,e,a)}))},!1)})})}}function W(a){return a}function V(a,d,c,f,e){function n(a){for(var b={},d=a.getPropertyKeys(),
c,f=0;f<d.length;f++)c=d[f],b[c]=a.getProperty(c);return b}function i(a,b){var d=null;a.some(function(a){return b===a.getProperty("id")?!!(d=a):!1});return d}function l(a){var c=a.command;if(!c.visibleWhen||c.visibleWhen(d))return a.invocation=new b.CommandInvocation(d,d,null,c,f),(new p).resolve(a);else if(typeof e==="function")return m||(m=e()),p.when(m,function(h){if(h&&d===fa&&(!c.visibleWhen||c.visibleWhen(h)))return a.invocation=new b.CommandInvocation(h,h,null,c,f),a});return(new p).resolve()}
function g(a,d,c){return c?(new p).resolve({relatedLink:a,command:c}):d.then(function(d){return{relatedLink:a,command:new b.Command(d)}})}var q=arguments,y,m,j=a&&a.getServiceReferences("orion.page.link.related");if(j&&j.length!==0){var o=this;p.when(function(){if(y)return y;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new v.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return y=a})}(),function(){if(X.apply(o,q)){var b=
a.getServiceReferences("orion.navigate.command"),d=[];j.forEach(function(c){var e=n(c);if(e.id){var p;if((e.nls&&e.nameKey||e.name)&&e.uriTemplate)p=h._createCommandOptions(e,c,a,y,!0),d.push(g(e,p,null));else if(p=i(b,e.id)){var l=n(p),c={};K.mixin(c,l,e);(e=f.findCommand(e.id))?d.push(g(c,null,e)):(p=h._createCommandOptions(l,p,a,y,!0),d.push(g(c,p,null)))}}});p.all(d,W).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return p.all(a.map(l),W).then(function(b){var d=
[],b=b.filter(function(b,c){if(b)return!0;d.push(a[c]);return!1});R.call(o,f,b,d,c);S.apply(o,q)})})}})}}function ha(a){var b=m.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function aa(a){var b=window.getComputedStyle(a,null);return b===null?a:b.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:aa(a.parentNode)}function ba(a){var b={},d=null;typeof a==="string"&&(a=m.node(a));a||(a=m.node("pageActions"));for(var c=a;c&&c.classList;){if(c.classList.contains("toolComposite")){d=
c;break}c=c.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(d&&(b.slideContainer=m.$(".slideParameters",d),b.parameterArea=m.$(".parameters",d),b.dismissArea=m.$(".parametersDismiss",d),b.notifications=m.$("#notificationArea",d),d.parentNode&&(b.toolbarTarget=m.$(".toolbarTarget",d.parentNode),b.toolbarTarget)))a=m.bounds(b.toolbarTarget),c=m.bounds(aa(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-c.top,b.toolbar=d;return b}function ca(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var b=m.bounds(a),d=m.bounds(a.parentNode);a.style.left=(d.width-b.width)/2+"px";a.style.top="0"}}var i=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),da={},Q=null;O=D.createMenuGenerator||function(a,b){if(m.node("userMenu")){var d=m.node("userDropdown"),c=new s.Dropdown({dropdown:d}),d=new y.UserMenu({dropdownNode:d,dropdown:c,serviceRegistry:a}),c=m.node("userTrigger");
new r.Tooltip({node:c,text:g.Options,position:["below","left"]});var c=document.getElementById("userTrigger"),f=c.className;f+=" imageSprite core-sprite-silhouette";c.className=f;d.setKeyAssist(b);return d}};X=D.beforeGenerateRelatedLinks||function(){return!0};R=D.addRelatedLinkCommands||function(a,b,d,c){this.sideMenu&&this.sideMenu.setRelatedLinks(b,c)};S=D.afterGenerateRelatedLinks||function(){};T=D.afterSetPageTarget||function(){};P=D.generateNavigationMenu||function(){var a=m.node("sideMenu");
if(a){var b=m.node("centralNavigation");new r.Tooltip({node:b,text:g.CentralNavTooltip,position:["right"]});Q=this.sideMenu=new M(a,m.node("pageContent"));b.addEventListener("click",Q.toggleSideMenu.bind(Q));(a=m.node("sideMenuToggle"))&&a.addEventListener("click",Q.toggleSideMenu.bind(Q))}};J=D.afterGenerateNavigationMenu||function(){};G=D.afterGenerateBanner||function(){};var ea=[],fa,$=[],N,Z=null,Y=null,ga=new c;return{generateBanner:function(a,d,c,h,i,l,y,s){function r(a){a.registerService("orion.cm.managedservice",
{updated:function(a){for(var a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=m.$$array(".targetSelector"),d=0;d<b.length;d++)b[d].target=a}},{pid:"nav.config"})}(new x.ThemePreferences(h,new n.ThemeData)).apply();var t=m.node(a);if(!t)throw g["could not find banner parent, id was "]+a;var v=document.createRange();v.selectNode(t);v=v.createContextualFragment(C);m.processTextNodes(v,g);t.firstChild?t.insertBefore(v,t.firstChild):t.appendChild(v);t=m.node("home");t.href=
k.toUrl("edit/edit.html");t.setAttribute("aria-label",g["Orion Home"]);m.node("progressPane").src=b.NO_IMAGE;if(t=m.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=I+j.slideoutHTMLFragment("mainToolbar");(t=m.node("closeNotifications"))&&t.setAttribute("aria-label",g["Close notification"]);if(E.isFirefox<=17&&(t=m.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=m.node("footer"))t.innerHTML=H,m.processTextNodes(t,g);c.setParameterCollector(new f.CommandParameterCollector(ba,
ca));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&(a=d.getService("orion.page.message"))&&a.setProgressMessage("")},!1);P.apply(this,arguments);J.apply(this,arguments);t=q.getCategoriesInfo(d);v=q.getPageLinksInfo(d,"orion.page.link");p.all([t,v]).then(function(a){if(Q){var b=a[1];Q.setCategories(a[0]);Q.setPageLinks(b);Q.setSideMenu()}});if(t=m.$(".split")){var v=m.$(".sidePanelLayout"),u=m.$(".mainPanelLayout");if(v&&u)Z={side:v,main:u},Z.splitter=new o.Splitter({node:t,
sidePanel:v,mainPanel:u,toggle:!0,closeByDefault:s}),t=new b.Command({name:g["Toggle side panel"],tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Z.splitter.toggleSidePanel()}}),c.addCommand(t),c.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new e.KeyBinding("l",E.isMac?!1:!0,!0,!1,E.isMac?!0:!1))}var B=!1,A=function(a,b){if(!B){var d=b.getService("orion.page.progress"),c=new z.OpenResourceDialog({searcher:a,progress:d,searchRenderer:a.defaultRenderer,
onHide:function(){B=!1}});window.setTimeout(function(){B=!0;c.show()},0)}},t=new b.Command({name:g["Find File Named..."],tooltip:g["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(){A(i,d)}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));t=new b.Command({name:g["Toggle banner and footer"],tooltip:g["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=
m.node("banner"),b=m.node("footer"),d=m.node("sideMenu"),c=m.$(".content-fixedHeight"),f=a.style.visibility==="hidden";f?(a.style.visibility="visible",b.style.visibility="visible",c.classList.remove("content-fixedHeight-maximized"),d&&d.classList.remove("sideMenu-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",c.classList.add("content-fixedHeight-maximized"),d&&d.classList.add("sideMenu-maximized"));ga.dispatchEvent({type:"toggleTrim",maximized:!f});return!0}});c.addCommand(t);
c.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));t=new b.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new e.KeyBinding(112,!0,!0));t=new b.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],
id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));Y=new w.KeyAssistPanel({commandRegistry:c});t=new b.Command({name:g["Show Keys"],tooltip:g["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Y.isVisible()?Y.hide():Y.show();return!0}});c.addCommand(t);c.registerCommandContribution("globalActions",
"orion.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));ha(c);U(d,t.callback);L(d);window.addEventListener("hashchange",function(){c.processURL(window.location.href)},!1);window.setTimeout(function(){r(d)},0);G.apply(this,arguments)},getToolbarElements:ba,getMainSplitter:function(){return Z},getKeyAssist:function(){return Y},getGlobalEventTarget:function(){return ga},layoutToolbarElements:ca,setPageTarget:function(a){var b,d,c=a.breadcrumbRootName,f=a.serviceRegistry;a.target?(a.searchService&&
a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&(d=c?c+" ":"",d+=a.fileService.fileServiceName(a.target.Location),c=null),b=a.name||a.target.Name,fa=a.target,V.call(this,f,a.target,$,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(c=c||a.task||a.name),b=a.name,V.call(this,f,{NoTarget:""},$,a.commandService,a.makeAlternate));(N=a.title)||(N=b?b+" - "+a.task:a.task);window.document.title=N;T.apply(this,arguments);if(b=a.breadCrumbContainer?m.node(a.breadCrumbContainer):
m.node("location")){m.empty(b);var h=f&&new B.FileClient(f),f=a.breadcrumbTarget||a.target,h=h&&f&&f.Location?h.fileServiceRootURL(f.Location):null;new l.BreadCrumbs({container:b,resource:f,rootSegmentName:c,workspaceRootSegmentName:d,workspaceRootURL:h,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(N)N.charAt(0)==="*"&&!a&&(N=N.substring(1)),a&&N.charAt(0)!=="*"&&(N="*"+N),window.document.title=N;var b=m.node("dirty");if(b)b.textContent=
a?"*":""},setPageCommandExclusions:function(a){$=a},notifyAuthenticationSite:i}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(g){return{detectValidURL:function(k){for(var j=/\[([^\]]*)\]\(([^\)]+)\)/g,e=j.exec(k),c=[],i=0;e;){if(e.length===3&&e[2].length>0){var b=new URL(e[2]);b.protocol!==":"&&g.validateURLScheme(b.href)&&(e.index>i&&c.push({segmentStr:k.substring(i,e.index)}),c.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),i=e.index+e[0].length)}e=j.exec(k)}if(i===0)return null;i<k.length-1&&c.push({segmentStr:k.substring(i)});return c},processURLSegments:function(g,
j){j.forEach(function(e){if(e.urlStr){var c=document.createElement("a");c.href=e.urlStr;c.appendChild(document.createTextNode(e.segmentStr))}else c=document.createElement("span"),c.textContent=e.segmentStr;g.appendChild(c)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(g,k,j,e){function c(b,c,h,d,a){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=c;this.notificationContainerDomId=a;this.domId=h;this.progressDomId=d||h;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var i;c.prototype={_init:function(){var b=k.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var c=k.node(this.notificationContainerDomId);k.addAutoDismiss([c],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));c.addEventListener("click",function(b){b&&b.target&&b.target.nodeName.toLowerCase()==="a"&&(b=k.$$("a",c))&&b.length&&b.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=k.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&b?(b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,c,h){this._init();this.currentMessage=b;var d=k.node(this.domId);
if(typeof h==="boolean"){var a=d.getAttribute("aria-live");d.setAttribute("aria-live",h?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(k.empty(d),d.appendChild(document.createTextNode(b)),window.setTimeout(function(){d.setAttribute("aria-live",a)},100))}.bind(this),100)}else k.empty(d),d.appendChild(document.createTextNode(b));typeof c==="number"&&window.setTimeout(function(){b===this.currentMessage&&(k.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),c)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var c=b.responseText||b.message||b;if(typeof c==="string")try{c=JSON.parse(c)}catch(h){}var b=c.Message||c,d="red";if(c.Severity)switch(c.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}c=document.createElement("span");c.style.color=d;c.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(c)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var c=document.createElement("span");c.classList.add("progressIcon");var h=k.node(this.progressDomId);k.empty(h);h.appendChild(c);h.appendChild(document.createTextNode(b));c=k.node(this.notificationContainerDomId);c.classList.remove("notificationHide");if(b&&b.length>0)c.classList.add("progressNormal"),c.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else c.classList.remove("notificationShow"),c.classList.add("notificationHide")},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,c){this._clickToDisMiss=!1;this._cancelMsg=c;this.currentMessage=b;var h=b.responseText||b;if(typeof h==="string")try{h=JSON.parse(h)}catch(d){}this._init();var a=h.Message||h.toString(),i=g.UnknownError,m="core-sprite-information",j="progressNormal",s=document.createElement("span");s.classList.add("imageSprite");s.classList.add("progressIcon");var r=[];if(h.Severity)switch(h.Severity){case "Warning":i=g.UnknownWarning;
m="core-sprite-warning";j="progressWarning";r.push("progressInfo");r.push("progressError");r.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";j="progressError";r.push("progressWarning");r.push("progressInfo");r.push("progressNormal");this._clickToDisMiss=!0;break;default:j="progressNormal",r.push("progressWarning"),r.push("progressError"),r.push("progressNormal")}r.push("notificationHide");s.classList.add(m);var v=k.node(this.progressDomId),m=k.node(this.notificationContainerDomId);
k.empty(v);v.appendChild(s);a===Object.prototype.toString()&&(a=i);if(h.HTML)h=document.createElement("span"),h.innerHTML=a,v.appendChild(h);else{if(i=e.detectValidURL(a))a=document.createDocumentFragment(),e.processURLSegments(a,i),Array.prototype.forEach.call(k.$$("a",a),function(a){a.target="_blank"});else{if(h.Severity!=="Warning"&&h.Severity!=="Error"&&!c)this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),
5E3);a=document.createTextNode(a)}v.appendChild(a)}if(j&&this.progressDomId!==this.domId){m.classList.add(j);for(j=0;j<r.length;j++)m.classList.remove(r[j])}m.classList.add("notificationShow");if(r=k.node("closeNotifications"))this._cancelMsg?(r.classList.add("cancelButton"),r.classList.remove("dismissButton"),r.classList.remove("core-sprite-close"),r.classList.remove("imageSprite"),r.innerHTML=this._cancelMsg):(r.innerHTML="",r.classList.remove("cancelButton"),r.classList.add("dismissButton"),r.classList.add("core-sprite-close"),
r.classList.add("imageSprite"))},showWhile:function(b,c){var h=this;if(c){h.setProgressMessage(c);var d=function(){c===h.currentMessage&&h.setProgressMessage("")};b.then(d,d)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,c){return new i(this,++this._lastProgressId,b,c)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",c=!0,h;for(h in this._progressMonitors)this._progressMonitors[h].status&&(c||(b+=", "),b+=this._progressMonitors[h].status,
c=!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;i=function(b,c,h,d){this.statusService=b;this.progressId=c;if(h){this.deferred=h;this.begin(d);var a=this;h.then(function(){a.done.bind(a)()},function(){a.done.bind(a)()})}};i.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};i.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};i.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};i.prototype.constructor=i;return{StatusReportingService:c,
ProgressMonitor:i}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,j,e){function c(){}c.prototype={_initialize:function(c,b,f,h,d){this._tooltip=new e.Tooltip({node:c,hideDelay:d||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:f,trigger:h?h:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";c=document.createRange();c.selectNode(this.$parent);c=c.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(c,g);this.$parent.appendChild(c);var a=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===j.KEY.ESCAPE&&a.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 f=c.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var b=
j.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(g,k,j,e){var c={};(function(){var i=!1;c.updateNavTools=function(b,c,h,d,a,e){var m=j.node(d);if(m)c.destroy(m);else throw g["could not find toolbar "]+d;c.renderCommands(d,m,e,h,"button");if(a&&(d=j.node(a)))c.destroy(d),c.renderCommands(a,d,null,h,"button");i||(i=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var d=j.node(a);
d&&(c.destroy(d),c.renderCommands(a,d,b.selections,h,"button"))}))};c.createOperationsCommands=function(b,c,h){function d(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var a=new e.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){h.removeCompletedOperations().then(function(){c.loadOperations.bind(c)()})},visibleWhen:function(){return!0}});b.addCommand(a);
a=new e.Command({name:g.Remove,tooltip:g["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var d=a[b];h.removeOperation.bind(h)(d.Location).then(function(){c.loadOperations.bind(c)()},function(){c.loadOperations.bind(c)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!d(a);for(var b in a)if(d(a[b]))return!1;return!0}});b.addCommand(a);
a=new e.Command({name:g.Cancel,tooltip:g["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var d=a[b];d.deferred&&d.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return d(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!d(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(a)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(g,k,j,e,c){function i(b){this._options=b}i.prototype=new e.PopupDialog;i.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';i.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};i.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};i.prototype.setOperations=function(b,c){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var h in b)this._myOperations.push(b[h]),this._operationsDeferreds.push(c[h]);this._renderOperations()};i.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(c){}var h={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==h.Message)h.DetailedMessage=b.DetailedMessage;return h};i.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};i.prototype._renderOperationsTable=function(b,c,h){j.empty(b);for(var d=0;d<c.length;d++){var a=c[d],e=document.createElement("tr"),i=document.createElement("td");i.style.paddingLeft="5px";i.style.paddingRight="5px";i.textContent=a.Name;e.appendChild(i);var o=document.createElement("div");i.appendChild(o);i=document.createElement("span");i.style.paddingRight="5px";i.classList.add("imageSprite");switch(a.type){case "Warning":i.classList.add("core-sprite-warning");i.setAttribute("aria-label",
g["Operation resulted in a warning."]);break;case "error":i.classList.add("core-sprite-error");i.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":i.classList.add("core-sprite-start");i.setAttribute("aria-label",g["Operation is running."]);break;case "abort":i.classList.add("core-sprite-stop");i.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":i.classList.add("core-sprite-ok"),i.setAttribute("aria-label","Operation ok.")}o.appendChild(i);
i=document.createElement("span");i.classList.add("operationStatus");i.textContent=a.Name;o.appendChild(i);if(a.error){var s=a.error.Message||a.error;a.error.DetailedMessage&&a.error.DetailedMessage!==""&&(s+=": "+a.error.DetailedMessage);i.textContent=s;i.classList.remove("operationStatus");i.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",o,{operation:a,deferred:h[d]},this,"tool");b.appendChild(e)}this._setOperationsVisibility()};i.prototype._setOperationsVisibility=
function(){this.$myOperationsList.style.display=this._myOperations.length>0?"":"none";this.$myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.$operationsDontExist.style.display=this._myOperations.length>0?"none":"";this.$operationsExist.style.display=this._myOperations.length>0?"":"none"};i.prototype.constructor=i;return{OperationsDialog:i}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(g,k,j,e,c){function i(b,h){if(!this._progressPane){this._progressPane=e.node(b);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:h});var d=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===e.KEY.ENTER)&&d._operationsDialog.show()})}}function b(b,c,d,a){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=a}i.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,c){var d=
{},a;for(a in b)b[a].progressMonitor||(d[a]=b[a]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var e="";for(a in d){var i=d[a];if(i.type&&(i.type==="loadstart"||i.type==="progress")){e="running";break}}switch(e){case "running":this._progressPane.title=g["Operations running"];this._progressPane.alt=g["Operations running"];
this._progressPane.setAttribute("aria-valuetext",g["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=g["Some operations finished with warning"];this._progressPane.alt=g["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=g["Some operations finished with error"];this._progressPane.alt=
g["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(d,c)},_isEmpty:function(b){for(var c in b)return!1;return!0}};
i.prototype.constructon=i;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new i(b,this._commandRegistry)},progress:function(b,c,d){var a=this,e=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(c));b.then(function(){if(a._operations[e]){var i=a._operations[e];if(c)i.Name=c;a._lastOperation=i;i.type="loadend";if(d)i.progressMonitor=d;a.writeOperation.bind(a)(e,i,b);i.Location||a._removeOperationFromTheList.bind(a)(e)}},
function(i){if(a._operations[e]){var g=a._operations[e];if(c)g.Name=c;if(d)g.progressMonitor=d;a._lastOperation=g;g.type=i.canceled?"abort":"error";g.error=i;a.writeOperation.bind(a)(e,g,b);g.Location||a._removeOperationFromTheList.bind(a)(e)}},function(i){if(c)i.Name=c;if(d)i.progressMonitor=d;a.writeOperation.bind(a)(e,i,b)});return b},removeOperation:function(b){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===b){this._removeOperationFromTheList(c);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var c=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var c=this._operations[b];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[b].progressMonitor)&&
c.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,c,d){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var a=this;b.then(function(){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){d?a._serviceRegistry.getService("orion.page.message").setProgressMessage(""):
a.setProgressResult.bind(a)(b);return b});return this.progress(b,c)},writeOperation:function(b,c,d){this._operations[b]=c;this._operationDeferrds[b]=d;c.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/dialogs",[],function(){function g(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}g.prototype={confirm:function(g,j){j(window.confirm(g))},openFiles:function(){}};g.prototype.constructor=g;return{DialogService:g}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function k(j,e){e||(e="orion.page.selection");this._serviceRegistry=j;g.attach(this);this._serviceRegistration=j.registerService(e,this);this._selections=null}k.prototype={getSelection:function(g){var e=this._getSingleSelection();typeof g==="function"&&g(e);return e},getSelections:function(g){var e=Array.isArray(this._selections)?this._selections.slice():[];typeof g==="function"&&g(e);return e},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(g){var e=this._selections;this._selections=Array.isArray(g)?g.length>0?g.slice():null:g?[g]:null;e!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(g,k){function j(b,c,h){return b[c].apply(b,h)}function e(b){this._location=b}function c(){var b=new k;b.reject(g["No Matching OperationService for location:"]+this._location);return b}function i(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var c=b.getServiceReferences("orion.core.operation"),
h=0;h<c.length;h++){var d=b.getService(c[h]);this._services[h]=d;d=c[h].getProperty("pattern")||".*";d[0]!=="^"&&(d="^"+d);this._patterns[h]=RegExp(d)}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];this._operations.remove(a);return new e(a)}}e.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};e.prototype.constructor=e;i.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(h){c._operations=h;b.resolve(c._operations)});return b},getOperation:function(b){return j(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],c=this,h=0;h<this._services.length;h++){var d=this._patterns[h],a=new k;b[h]=a.promise;j(this._services[h],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
c.getOperations.bind(c)().then(function(c){for(var h=c.keys(),f=0;f<h.length;f++){var e=h[f];d.test(e)&&b.indexOf(e)<0&&c.remove(e)}a.resolve()})}}(a),function(a){return function(b){a.reject(b)}}(a))}return k.all(b)},removeOperation:function(b){var c=this;return j(this._getService(b),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(c){c.remove(b)})},function(b){return b},function(b){return b})}};i.prototype.constructor=i;return{OperationsClient:i}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","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 the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){var c=e.parent,i=this,c=k.node(c);if(!c)throw g["no parent"];if(!e.model)throw g["no tree model"];if(!e.renderer)throw g["no renderer"];this._parent=c;this._treeModel=e.model;this._onComplete=e.onComplete;this._renderer=e.renderer;this._showRoot=e.showRoot===void 0?!1:e.showRoot;this._indent=e.indent===void 0?16:e.indent;this._onCollapse=e.onCollapse;
this._labelColumnIndex=e.labelColumnIndex===void 0?0:e.labelColumnIndex;this._id=e.id===void 0?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){i._showRoot?(b._depth=0,i._generate([b],0)):i._treeModel.getChildren(b,function(b){i.destroyed||i._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(e,
c){k.empty(this._parent);var i=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(i);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";e.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(e,c);b.appendChild(this._bodyElement);i.appendChild(b);this._parent.appendChild(i);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(e,c,i){for(var b=0;b<e.length;b++){var f=document.createElement(this._tableRowElement);f.id=this._treeModel.getId(e[b]);f._depth=c;f._item=e[b];this._renderer.render(e[b],f);f.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*c+"px";this._renderer.rowCallback&&this._renderer.rowCallback(f,e[b]);i?(this._bodyElement.insertBefore(f,i.nextSibling),i&&(i=f)):this._bodyElement.appendChild(f)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,c,i){var b=this._treeModel.getId(e),f;if(b===this._id)this._removeChildRows(b),this._generateChildren(c,0),this._rowsChanged();else{var h=k.node(b);h?(h._item=e,
h&&(i||h._expanded)?(this._removeChildRows(b),c?(h._expanded=!0,this._renderer.updateExpandVisuals(h,!0),this._generateChildren(c,h._depth+1,h),this._rowsChanged()):(f=this,this._renderer.updateExpandVisuals(h,"progress"),c=this._treeModel.getChildren(h._item,function(b){if(!f.destroyed&&(f._renderer.updateExpandVisuals(h,!0),!h._expanded))h._expanded=!0,f._generateChildren(b,h._depth+1,h),f._rowsChanged()}))):this._renderer.updateExpandVisuals(h,!1)):console.log(g["could not find table row "]+b)}},
getItem:function(e){var c=k.node(e);return c&&c._item?c._item:e},toggle:function(e){var c=k.node(e);c&&(c._expanded?this.collapse(e):this.expand(e))},isExpanded:function(e){e=typeof e==="string"?e:this._treeModel.getId(e);return(e=k.node(e))?e._expanded:!1},expand:function(e,c,i){var e=typeof e==="string"?e:this._treeModel.getId(e),b=k.node(e);if(b)if(b._expanded)c&&c.apply(f,i);else{var f=this;this._renderer.updateExpandVisuals(b,"progress");this._treeModel.getChildren(b._item,function(h){if(!f.destroyed){f._renderer.updateExpandVisuals(b,
!0);if(!b._expanded)b._expanded=!0,f._generateChildren(h,b._depth+1,b),f._rowsChanged();c&&c.apply(f,i)}})}},_removeChildRows:function(e){for(var c=e===this._id,i=!1,b=-1,f=[],h=k.$$array(".treeTableRow",this._parent),d=0;d<h.length;d++){var a=h[d];if(i)break;if(c)a._depth>b?f.push(a):i=!0;else if(a.id===e)c=!0,b=a._depth}for(e=0;e<f.length;e++)c=f[e],c.parentNode.removeChild(c)},collapse:function(e){var e=typeof e==="string"?e:this._treeModel.getId(e),c=k.node(e);if(c){if(!c._expanded)return;c._expanded=
!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)},getIndent:function(){return this._indent}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var g={};g.TreeModelIterator=function(){function g(j,e){this.firstLevelChildren=j;this.reset();this._init(e)}g.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var e=this._getChildren(g),e=e&&e.length>0;this.isExpanded&&e&&(e=this.isExpanded(g));return e},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(e){e&&c.setCursor(e)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(g){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(g&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var c=this;return this.forceExpandFunc(e,"last",function(e){e&&
c.setCursor(e)})}e&&this.setCursor(e);return e},_findSibling:function(g,e){for(var c=this.topLevel(g),i=this._getChildren(g.parent),i=c?this.firstLevelChildren:i,b=0;b<i.length;b++)if(i[b]===g)return b===0&&!e?c?null:g.parent:b===i.length-1&&e?c?null:this._findSibling(g.parent,e):e?i[b+1]:i[b-1];return null},_inParentChain:function(g,e){for(var c=g.parent;c;){if(c===e)return!0;c=c.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,e,c){this.setCursor(e);var i=[];for(i.push(e);;){if(this.iterate(g))i.push(this.cursor());else break;if(c===this.cursor())return i}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,e){var c=this.cursor(),
i=this._scan(!0,g,e);i||(i=this._scan(!1,g,e));this.setCursor(c);return i},iterate:function(g,e){return g?this._forward(e):this._backward(e)},iterateOnTop:function(g,e){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):e&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return g}();return g});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(g,k,j){var e={},c=navigator.userAgent.indexOf("iPad")!==-1,i=window.navigator.platform.indexOf("Mac")!==-1;e.ExplorerNavHandler=function(){function b(b,c,d){this.explorer=b;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var a=this;this._modelIterator=
new k.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(b){return a.explorer.renderer.isExpandable(b)}:function(b){return a.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,d,c){return a.explorer.forceExpandFunc(b,d,c)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&b.focus();d=function(b){if(j.isFormElement(b.target))return!0;if(a.explorer.preventDefaultFunc&&a.explorer.preventDefaultFunc(b,
a._modelIterator.cursor()))return!0;if(b.keyCode===g.KEY.DOWN)return a.onDownArrow(b);else if(b.keyCode===g.KEY.UP)return a.onUpArrow(b);else if(b.keyCode===g.KEY.RIGHT)return a.onRightArrow(b);else if(b.keyCode===g.KEY.LEFT)return a.onLeftArrow(b);else if(b.keyCode===g.KEY.SPACE)return a.onSpace(b);else if(b.keyCode===g.KEY.ENTER)return a.onEnter(b)};b.addEventListener("keydown",d,!1);this._listeners.push({type:"keydown",listener:d});d=function(){if(a.explorer.onFocus)a.explorer.onFocus(!1);else a.toggleCursor(null,
!1)};b.addEventListener("blur",d,!1);this._listeners.push({type:"blur",listener:d});d=function(){if(a.explorer.onFocus)a.explorer.onFocus(!0);else a.toggleCursor(null,!0)};b.addEventListener("focus",d,!1);this._listeners.push({type:"focus",listener:d});this._parentDiv=b}b.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_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 i?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):g.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:g.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,c){var d=this;this.explorer.selection&&this.explorer.selection.getSelections(function(a){d._clearSelection(c);for(var e=0;e<a.length;e++)d._selections.push(a[e]);d._selections.length>0?
d.cursorOn(d._selections[0],!0,!1,b):d.cursorOn(null,!1,!1,b);if(!(d._shiftSelectionAnchor&&d._inSelection(d._shiftSelectionAnchor)>=0))d._shiftSelectionAnchor=null})},refreshModel:function(b,c,d,a){this._currentColumn=0;this.topIterationNodes=[];this.model=c;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),
!1),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=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){if(this._selectionPolicy!==
b)this._selectionPolicy=b,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(b,c,d){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){!c||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(c=this._inSelection(b),c>=0?(this._checkRow(b,!0),this._selections.splice(c,1)):(this._checkRow(b,
!1),this._selections.push(b),this._lastSelection=b));if(d)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,c){b||(b=this.currentModel());var d=this._getGridChildren(b);if(d&&d.length>1||c===0&&d){c!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,e=!0;a+=c;a<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),
a=e?d.length-1:this._currentColumn):a>=d.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),a=e?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,d;b&&b!==c&&(d=b.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)b=b.parentNode;return b===c?null:b},toggleCursor:function(b,c){var d=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(d&&(c?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),a.domNode&&(d=this.getAriaContainerElement(a.domNode),c?(a.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):
d&&(c?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,c,d,a){var e,i;if(b||c){if(i===this._modelIterator.cursor())return;e=this._modelIterator.cursor();i=b;this._modelIterator.setCursor(i)}else e=this._modelIterator.prevCursor(),i=this._modelIterator.cursor();if(e!==i||c)if(this.toggleCursor(e,!1),!c||i){this.moveColumn(null,0);this.toggleCursor(i,!0);if((b=this.getRowDiv())&&
!a){a=b.parentNode;for(c=document.documentElement;a&&a!==c;){var g=window.getComputedStyle(a,null);if(!g)break;g=g.getPropertyValue("overflow-y");if(g==="auto"||g==="scroll")break;a=a.parentNode}a&&(c=!0,b.offsetTop<=a.scrollTop?(c=!1,d===void 0&&(d=!1)):b.offsetTop+b.offsetHeight>=a.scrollTop+a.clientHeight&&(c=!1,d===void 0&&(d=!0)),c||b.scrollIntoView(!d))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,i)}},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:g.node(b)},iterate:function(b,c,d,a){var e=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(a){a=this.currentModel();for((e=this._modelIterator.iterate(b,c))&&this._setCursorOnItem(b,d);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(b,
c))&&this._setCursorOnItem(b,d);e||(this.cursorOn(a,!0,!1,!0),this._setCursorOnItem(b,d))}else(e=this._modelIterator.iterate(b,c))&&this._setCursorOnItem(b,d)},_setCursorOnItem:function(b,c){this.cursorOn(null,!1,b);if(c){var d=this._inSelection(this._modelIterator.prevCursor()),a=this._inSelection(this._modelIterator.cursor());d>=0&&a>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,c){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var d=this.getRowDiv(b);if(d){var a=g.node(this.explorer.renderer.getCheckBoxId(d.id)),e=c?!a.checked:!0;if(e!==a.checked)this.explorer.renderer.onCheck(d,a,e,!0)}}else this._select(b,c)},_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 d=this._getGridChildren(b);if(d)for(var a=0;a<d.length;a++)if(c.target===
d[a].domNode)return!0;return!1},onClick:function(b,h){if(this.isDisabled(this.getRowDiv(b)))g.stop(h);else{var d=g.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(h.target!==d&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,h)))if(this.cursorOn(b,!0,!1,!0),c)this.setSelection(b,!0);else if(this._ctrlKeyOn(h))this.setSelection(b,!0,!0);else if(h.shiftKey&&this._shiftSelectionAnchor){if(d=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);
for(var a=0;a<d.length;a++)this.setSelection(d[a],!0)}}else this.setSelection(b,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var c=
this.currentModel(),d=this._getGridChildren(c);return d&&d.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,!0))},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),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(c)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),
!0,!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 d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);c.domNode.dispatchEvent(d)}else if(c=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(d=this.explorer.renderer.getRowActionElement(this.model.getId(c)),
d.href))this._ctrlKeyOn(b)?window.open(d.href):window.location.href=d.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,c),b.preventDefault(),!1}},setIsNotSelectable:function(b,c){b.isNotSelectable=c},disableItem:function(b){var c=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(c.id));c.classList.remove("checkedRow");c.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},
isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var c=this.getRowDiv(b);c&&(c.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,!1))}};return b}();e.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.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 d=this._model.getId(b);if(this._dict[d]){if(!this._dict[d].gridChildren&&
c)this._dict[d].gridChildren=[];return this._dict[d].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 b}();return e});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(g,k,j,e,c,i){var b={};b.Explorer=function(){function b(c,d,a,e){this.registry=c;this.renderer=a;this.selection=d;this.commandService=e;if(this.renderer)this.renderer.explorer=this;this.myTree=null}b.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(b,d){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,d,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,d,a,c){b=this.getRow(b);if(a)return b=b.childNodes[a],b.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=d+"placeHolderRow",b.appendChild(c),{tempNode:c,refNode:c};if(b){var e=document.createElement("tr");
e.id=d+"placeHolderRow";a=document.createElement("td");a.id=d+"placeHolderCol";e.appendChild(a);c?(b.parentNode.insertBefore(e,b.nextSibling),b=parseInt(b.firstChild.style.paddingLeft),a.style.paddingLeft=this.myTree.getIndent()+b+"px"):b.appendChild(e);c=j.node(d+"placeHolderRow");b=j.node(d+"placeHolderCol");if(c&&b)return{tempNode:c,refNode:b}}return null},getRow:function(b){if(b=this.model.getId(b))return j.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),d=0;d<b.length;d++)this.myTree.collapse(b[d])},
expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),d=0;d<b.length;d++)this._expandRecursively(b[d])},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var d=this;this.myTree.expand(b,function(){d.model.getChildren(b,function(a){if(!(a===void 0||a===null))for(var b=a.length,c=0;c<b;c++)d._expandRecursively(a[c])})})}},createTree:function(b,d,a){b=typeof b==="string"?b:b.id||b;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=b+"innerTree",i=j.node(f);i&&j.empty(i);if(d)d.rootId=f;this.model=d;this._parentId=b;this._treeOptions=a;if(!a||a&&!a.noSelection)this.selectionPolicy=a?a.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:f,model:d,parent:b,onComplete:a?a.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:a?!!a.showRoot:
!1,indent:a?a.indent:void 0,onCollapse:a?a.onCollapse:void 0,navHandlerFactory:a?a.navHandlerFactory:void 0,tableElement:a?a.tableElement:void 0,tableBodyElement:a?a.tableBodyElement:void 0,tableRowElement:a?a.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(),d=[];
if(b&&this.getNavDict())for(var a=b.getSelection(),c=0;c<a.length;c++){var e=b.getRowDiv(a[c]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(a[c])),e.model&&d.push(e.model))}this.selection.setSelections(d)}},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 c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var d=this;this.model.getRoot(function(a){a instanceof Array?d.getNavHandler().refreshModel(d.getNavDict(),d.model,a):a.children&&a.children instanceof Array&&d.getNavHandler().refreshModel(d.getNavDict(),d.model,a.children);b&&b.setFocus&&d.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,c){function d(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var a=new i.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.expandAll()}}),e=new i.Command({tooltip:g["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",
groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(a);b.addCommand(e)};b.ExplorerModel=function(){function b(c,d,a){this.rootPath=c;this.fetchItems=d;this.idPrefix=a||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var d=this;this.fetchItems(this.rootPath).then(function(a){d.root=a;b(a)})},getChildren:function(b,d){b.Children?d(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(a){b.Children=
a;d(a)}):d([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),d=this.idPrefix,a=0;a<b.length;a++)d+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return d}};return b}();b.ExplorerFlatModel=function(){function c(b,d,a){this.rootPath=b;this.fetchItems=d;this.root=a}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(b){if(this.root)b(this.root);else{var d=this;this.fetchItems(this.rootPath).then(function(a){d.root=
a;b(a)})}};c.prototype.getChildren=function(b,d){b===this.root?d(this.root):d([])};return c}();b.ExplorerRenderer=function(){function b(c,d){this.explorer=d;this._init(c);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";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,d){this.tableTree=d;this.tableNode=
b;j.empty(b);this._treeTableClass&&b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,d,a,c,e){var a=a||"tool",f=document.createElement("td");f.id=d.id+"actionswrapper";c&&f.classList.add(c);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,a,null,e&&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 f},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,d){if(this._useCheckboxSelection){var a=document.createElement("td"),c=document.createElement("span");c.id=this.getCheckBoxId(d.id);c.classList.add("core-sprite-check");c.classList.add("selectionCheckmarkSprite");c.rowId=d.id;if(this.getCheckedFunc)c.checked=this.getCheckedFunc(b),c.checked?(this._highlightSelection&&d.classList.add("checkedRow"),c.classList.add("core-sprite-check_on")):
(this._highlightSelection&&d.classList.remove("checkedRow"),c.classList.remove("core-sprite-check_on"));a.appendChild(c);var e=this;c.addEventListener("click",function(a){e.onCheck(d,a.target,a.target.checked?!1:!0,!0)},!1);return a}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,d,a,c,e){(d.checked=a)?d.classList.add("core-sprite-check_on"):d.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(d.rowId,a,c);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),d=this._getUIStatePreferencePath();d&&window.sessionStorage&&(window.sessionStorage[d+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var d=this.explorer.getNavDict(),a=this.explorer.getNavHandler();if(a&&d&&a.getSelectionPolicy()!=="cursorOnly"&&(b=window.sessionStorage[b+"selection"],typeof b==="string"&&(b=b.length>0?JSON.parse(b):null),b)){for(var c=[],a=0;a<
b.length;a++){var e=d.getValue(b[a]);if(e&&e.rowDomNode&&e.model&&(c.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=j.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(c),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var d=
!1,a=window.sessionStorage[b+"expanded"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var c;if(a)for(c=0;c<a.length;c++)if(j.node(a[c])){this._expanded.push(a[c]);var e=this;this.tableTree.expand(a[c],function(){e._restoreSelections(b)});d=!0}return!d},_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,d){var a=j.node(this.expandCollapseImageId(b.id));a&&(a.classList.remove(this._expandImageClass),a.classList.remove(this._collapseImageClass),a.classList.remove(this._progressImageClass),a.classList.add(d==="progress"?this._progressImageClass:d?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(b,d,a,c){var e=document.createElement("span");e.id=this.expandCollapseImageId(b.id);d.appendChild(e);e.classList.add(this._twistieSpriteClass);
e.classList.add(this._collapseImageClass);if(a){var f=document.createElement("span");d.appendChild(f);f.classList.add(c||"imageSprite");f.classList.add(a)}var i=this;e.onclick=function(){if(!i.explorer.getNavHandler().isDisabled(b)){i.tableTree.toggle(b.id);if(i.tableTree.isExpanded(b.id))i._expanded.push(b.id),i.explorer.postUserExpand&&i.explorer.postUserExpand(b.id);else for(var a in i._expanded)if(i._expanded[a]===b.id){i._expanded.splice(a,1);break}(a=i._getUIStatePreferencePath())&&window.sessionStorage&&
i._storeExpansions(a)}};return e},render:function(b,d){d.classList.add("navRow");this.renderRow(b,d)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(j.$(".sectionTreeTable",this.tableNode.parentNode)||j.$(".treetable",this.tableNode.parentNode))&&j.$$array(".treeTableRow",this.tableNode).forEach(function(b,d){var a=!(d%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",c=a==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";b.classList.add(a);b.classList.remove(c)})},updateCommands:function(){if(this.commandService)for(var b=j.$$array(".treeTableRow"),d=0;d<b.length;d++){var a=b[d],c=j.node(a.id+"actionswrapper");this.commandService.destroy(c);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,c,a._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,d){this._init(b);this.explorer=d}c.prototype=new b.ExplorerRenderer;c.prototype.renderTableHeader=function(b){var d=document.createElement("thead"),a=document.createElement("tr");d.classList.add("navTableHeading");this._useCheckboxSelection&&a.appendChild(this.initCheckboxColumn(b));for(var c=0,e=this.getCellHeaderElement(c);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),a.appendChild(e),e=this.getCellHeaderElement(++c);d.appendChild(a);
c>0&&b.appendChild(d)};c.prototype.renderRow=function(b,d){d.verticalAlign="baseline";d.classList.add("treeTableRow");var a=this.explorer.getNavDict();if(a){a.addRow(b,d);var c=this;d.addEventListener("click",function(a){if(c.explorer.getNavHandler())c.explorer.getNavHandler().onClick(b,a)},!1)}if(a=this.getCheckboxColumn(b,d))a.classList.add("checkColumn"),d.appendChild(a);for(var a=0,e=this.getCellElement(a,b,d);e;)d.appendChild(e),a===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(b)):
e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++a,b,d)};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();b.SimpleFlatModel=function(){function c(b,d,a){this.items=b;this.getKey=a;this.idPrefix=d;this.root={children:b}}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(b){b(this.root)};c.prototype.getId=function(b){for(var b=
this.getKey(b).replace(/[\\\/]/g,""),d="",a=0;a<b.length;a++)d+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return this.idPrefix+d};c.prototype.getChildren=function(b,d){b===this.root?d(this.items):d([])};return c}();return b});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(g,k,j,e,c,i,b,f){function h(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function d(a,d,e,f,g,j,w,t,x){var d=i.clone(d),n;if(d.Directory)n=document.createElement("a"),
n.className="navlinkonpage",n.href=!a?l:(new b(a+"#{,resource,params*}")).expand({resource:d.ChildrenLocation}),d.Name&&n.appendChild(document.createTextNode(d.Name));else{g||(g=c.getOpenWithCommands(e));n=document.createElement("a");n.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){n[a]=j[a]});var p=null,y=null;if(p=t?t.holderDom:n)y=document.createElement("span"),y.className="core-sprite-file modelDecorationSprite thumbnail",p.appendChild(y);d.Name&&
n.appendChild(document.createTextNode(d.Name));var q=d.Location;if(w&&typeof w==="object")d.params={},i.mixin(d.params,w);(a=c.getOpenWithCommand(e,d,g))&&(q=a.hrefCallback({items:d}));k.when(f.getFileContentType(d),function(a){if(p){var b=p,c=y;if(a){var e,f=a.imageClass,i=a.image;if(f)e=document.createElement("span"),e.className+=f,e.classList.add("thumbnail");else if(i)e=document.createElement("img"),e.src=i,e.classList.add("thumbnail");e&&b.replaceChild(e,c)}}n.href=q;x&&typeof x.updateFileNode===
"function"&&x.updateFileNode(d,n,h(a))})}return n}function a(a,b,d,c){this.explorer=b;this.commandService=d;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var l=new b("#{,resource,params*}");a.prototype=new j.SelectionRenderer;a.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};a.prototype.tableCallback=function(a){a.setAttribute("aria-label",g.Navigator);a.setAttribute("role","presentation")};a.prototype.rowCallback=
function(a){a.setAttribute("role","treeitem")};a.prototype.emptyCallback=function(a){var b=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var c=document.createElement("div");c.classList.add("noFile");c.textContent=g.NoFile;var e=document.createElement("span");e.appendChild(document.createTextNode(g.File));f.processDOMNodes(c,[e]);d.appendChild(c);b.appendChild(d);a.appendChild(b)};a.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;
switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};a.prototype.setTarget=function(a){this.target=a};a.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};a.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=d(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):
(b=document.createElement("span"),b.textContent=a.Name);return b};a.prototype.updateFileNode=function(){};a.prototype.showFolderLinks=!0;a.prototype.getCellElement=function(a,b,f){switch(a){case 0:var a=document.createElement("td"),h=document.createElement("span");h.id=f.id+"MainCol";h.setAttribute("role","presentation");a.appendChild(h);a.setAttribute("role","presentation");h.className="mainNavColumn";var i;if(b.Directory)this.getExpandImage(f,h),i=this.createFolderNode(b),h.appendChild(i),this.explorer._makeDropTarget(b,
i),this.explorer._makeDropTarget(b,f);else{if(!this.openWithCommands)this.openWithCommands=c.getOpenWithCommands(this.commandService);i=d("",b,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this);h.appendChild(i)}if(i)i.id=f.id+"NameLink",i.nodeType===1&&(e.addNavGrid(this.explorer.getNavDict(),b,i),i.setAttribute("role","link"),i.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,h,b,this.explorer,
"tool",null,!0);return a;case 1:if(this.oneColumn)return null;f=document.createElement("td");if(b.LocalTimeStamp)f.textContent=(new Date(b.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!b.Directory&&typeof b.Length==="number")b=parseInt(b.Length,10)/1024,f.textContent=Math.ceil(b).toLocaleString()+" KB";f.style.textAlign="right";return f}};a.prototype.constructor=a;return{NavigatorRenderer:a,isImage:h,createLink:d}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(g,k,j,e,c,i,b,f,h){function d(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function a(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new d(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}d.prototype.makeRenderFunction=function(a,d,i,s,r){var v=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||f.createOpenWithCommands(v,a,u);var w=this;return function(f,v,n,p){h.when(w.openWithCommands,function(h){if(n)j.empty(d),h=document.createElement("div"),h.appendChild(document.createTextNode(g["Search failed."])),d.appendChild(h),typeof s==="function"&&s(d);else{var q=
function(){function a(b,d){var c=d.folderName?d.folderName:d.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(d,c){var e=c.name;if(b.hasOwnProperty(e)){a(d,c);var f=b[e];typeof f==="function"&&(b[e]=null,f())}else b[e]=function(){a(d,c)}}}(),z=!1;j.empty(d);if(f&&f.length>0){var C=document.createElement("table");C.setAttribute("role","presentation");for(var H=0;H<f.length;H++){var I=
f[H],w;if(!z&&(z=!0,i))w=C.insertRow(0).insertCell(0),w.textContent=i;w=C.insertRow(-1).insertCell(0);w.colspan=2;r&&r(w);var E={Name:I.name,Directory:I.directory,Location:I.path||I.location},D=null;if(typeof I.LineNumber==="number")D={},D.line=I.LineNumber;if(p&&p.keyword&&!p.nameSearch){var B=c.generateSearchHelper(p),D=D||{};D.find=B.inFileQuery.searchStr;D.regEx=B.inFileQuery.wildCard?!0:void 0}E=b.createLink(k.toUrl("edit/edit.html"),E,u,a,h,{"aria-describedby":(I.folderName?I.folderName:I.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},D);I.LineNumber&&E.appendChild(document.createTextNode(" (Line "+I.LineNumber+")"));w.appendChild(E);q(w,I)}d.appendChild(C);typeof s==="function"&&s(d)}!z&&v&&(h=e.formatMessage(g["No matches found for ${0}"],v),j.empty(d),d.appendChild(document.createTextNode(h)),typeof s==="function"&&s(d))}})}};a.prototype={search:function(a,b,d){var e=function(a){for(var d=[],e=0;e<a.response.docs.length;e++){var f=a.response.docs[e],h=f.Location,n=c.path2FolderName(f.Path?
f.Path:f.Location,f.Name),i=n?n:h;(b?i.indexOf(b)>=0:1)&&d.push({name:f.Name,path:h,folderName:n,directory:f.Directory,lineNumber:f.LineNumber})}return d};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){d(e(b),a.keyword,null,a)});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);d(e(b),c,null,a)},function(a){d(null,
null,a,null)})}catch(f){typeof f==="string"&&f.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(b){d(e(b),null,null,a)}):typeof f==="string"&&f.indexOf("search")>-1&&!a.nameSearch?(new i.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){d(e(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(f)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);j.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var d="",c=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>0?c=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(c=a);if(c)this.setLocationbyURL(c.Location),d=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),
d=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;c=j.node("search");d||(d="");if(c&&c.placeholder){c.value="";var f=e.formatMessage(g["Search ${0}"],d);c.placeholder=f.length>30?f.substring(0,27)+"...":e.formatMessage(g["Search ${0}"],d)}if(c&&c.title)c.title=g["Type a keyword or wild card to search in "]+d},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,d,c){d=d?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:d,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:d,sort:c&&c.sort?c.sort:"Path asc",rows:c&&c.rows?c.rows:40,start:0,caseSensitive:c?c.caseSensitive:void 0,regEx:c?c.regEx:void 0,fileType:c?c.fileType:void 0,keyword:a,replace:c?c.replace:void 0}}};a.prototype.constructor=a;return{Searcher:a}});
define("orion/section","orion/webui/littlelib,orion/selection,orion/commandRegistry,orion/commonHTMLFragments,orion/objects,orion/selection".split(","),function(g,k,j,e,c,i){function b(b,d){var a=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!d.id)throw Error("Missing required argument: id");this.id=d.id;if(!d.title)throw Error("Missing required argument: title");var c=d.useAuxStyle?["sectionWrapper",
"sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");b.appendChild(this.domNode);for(var f=0;f<c.length;f++)this.domNode.classList.add(c[f]);this.domNode.id=d.id;if(d.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=
0,this.domNode.addEventListener("click",function(b){(b.target===a.titleNode||b.target===a.twistie)&&a._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(b){b.keyCode===g.KEY.ENTER&&(b.target===a.domNode||b.target===a.titleNode||b.target===a.twistie)&&a._changeExpandedState()},!1);if(d.iconClass){var i=document.createElement("span");i.classList.add("sectionIcon");this.domNode.appendChild(i);c=Array.isArray(d.iconClass)?d.iconClass:[d.iconClass];c.forEach(function(a){i.classList.add(a)})}d.headerClass&&
(c=Array.isArray(d.headerClass)?d.headerClass:[d.headerClass],c.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleNode=document.createElement("div");this.titleNode.id=d.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=d.title;if(typeof d.getItemCount==="function")c=document.createElement("div"),c.classList.add("layoutLeft"),
c.classList.add("sectionItemCount"),this.domNode.appendChild(c),c.textContent=d.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=d.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);c=document.createElement("div");c.id=d.id+
"FilterSearchBox";this.domNode.appendChild(c);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=d.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");this.actionsNode.classList.add("sectionActions");
this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);d.slideout&&(c=e.slideoutHTMLFragment(d.id),f=document.createRange(),f.selectNode(this.domNode),c=f.createContextualFragment(c),this.domNode.appendChild(c));this._contentParent=
document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);b.appendChild(this._contentParent);d.content&&this.setContent(d.content);this.hidden=d.hidden;if(typeof d.onExpandCollapse==="function")this._onExpandCollapse=d.onExpandCollapse;this._preferenceService=d.preferenceService;this._contentParent.style.display="none";this.domNode.classList.add("sectionWrapperClosed");
if(this._preferenceService){var j=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(j.id);if(a!==void 0)j.hidden=!a;if(!j.hidden)j._contentParent.style.display="block",j.domNode.classList.remove("sectionWrapperClosed");j._updateExpandedState(!j.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed");this._updateExpandedState(!this.hidden,!1)}this._commandService=d.commandService;this._lastMonitor=
0;this._loading={}}function f(b){this._section=b;this._id=++b._lastMonitor}b.prototype={setTitle:function(b){this.titleNode.textContent=b},getHeaderElement:function(){return this.domNode},getTitleElement:function(){return this.titleNode},getActionElement:function(){return this._toolActionsNode},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},embedExplorer:function(b,
d,a){this._contentParent.innerHTML="";if(!b.parent)b.parent=d;this._contentParent.appendChild(b.parent);b.section=this;c.mixin(b,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!g.node(a)){var b=document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return this.section.actionsNode.style.visibility!=="hidden"},setCommandsVisible:function(a){this.section.actionsNode.style.visibility=
a?"":"hidden";var b=a?null:"cursorOnly";this.renderer.selectionPolicy=b;var d=this.getNavHandler();d&&d.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){g.node(a)&&this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&
this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var b=this;if(!this.selection&&!a)this.serviceRegistry||this.registry?(this.selection=new i.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(a){b.updateCommands(a.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry");var d=
this.registerCommands();!d||!d.then?b.updateCommands():d.then(function(){b.updateCommands()})}});if(b.renderer)b.renderer.section=this,c.mixin(b.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,a))&&this.section.setTitle(a.innerHTML);return null}})},createProgressMonitor:function(){return new f(this)},_setMonitorMessage:function(b,d){this._progressNode.style.visibility="visible";this._loading[b]=d;var a="",c;for(c in this._loading)a!==""&&(a+=
"\n"),a+=this._loading[c];this._progressNode.title=a},_monitorDone:function(b){delete this._loading[b];var b="",d;for(d in this._loading)b!==""&&(b+="\n"),b+=this._loading[d];this._progressNode.title=b;if(b==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed"),this.hidden=!1):(this._contentParent.style.display="none",this.domNode.classList.add("sectionWrapperClosed"),
this.hidden=!0);this._updateExpandedState(!this.hidden,!0)},_updateExpandedState:function(b,d){var a=this.twistie,c=this.id;a&&(a.classList.add(b?this._expandImageClass:this._collapseImageClass),a.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&d&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(c,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};b.prototype.constructor=b;f.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)}};f.prototype.constructor=f;return{Section:b}});
define("orion/git/util",["orion/URL-shim"],function(){function g(c){for(var i=0;i<e.length;i++)if(c.type===e[i])return!0;return!1}function k(c){for(var e=0;e<j.length;e++)if(c.type===j[e])return!0;return!1}var j=["Missing","Modified","Untracked","Conflicting"],e=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:g,isUnstaged:k,isChange:function(c){return g(c)||k(c)},hasStagedChanges:function(c){for(var i=0;i<e.length;i++)if(c[e[i]].length>0)return!0;return!1},hasUnstagedChanges:function(c){for(var e=
0;e<j.length;e++)if(c[j[e]].length>0)return!0;return!1},parseSshGitUrl:function(c){try{var e=new URL(c);return{host:e.hostname,port:e.port}}catch(b){try{var f=c.split(":")[0].split("@");return{host:f.length>1?f[1]:f[0],port:22}}catch(h){return{host:"",port:""}}}}}});
define("orion/compare/compareUtils",["orion/URITemplate"],function(g){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,e,c){for(var i=0,b=0;b<g.length;b++){var f=g[b][e];f===0&&(f=1);if(c>=i&&c<i+f)return{mapperIndex:b,startFrom:i};if(b===g.length-1)break;i+=g[b][e]}return{mapperIndex:g.length-1,startFrom:i}};k.compareUtils.lookUpLineIndex=function(g,e,c){if(c===0)return 0;for(var i=0,b=0;b<c;b++)i+=g[b][e];return i};k.compareUtils.updateMapper=function(g,e,c,i,
b){if(i!==b&&(i>0||b>0)){var f=k.compareUtils.lookUpMapper(g,e,c);if(!(f.mapperIndex<0)){if(i>0)for(var h=c-f.startFrom,c=f.mapperIndex;c<g.length;c++){h=g[c][e]-h;if(i<=h){g[c][e]-=i;break}g[c][e]-=h;i-=h;h=0}b>0&&(g[f.mapperIndex][e]+=b)}}};k.compareUtils.overlapMapper=function(g,e,c,i,b){g=c+g[e]-1;g<c&&(g=c);b<i&&(b=i);return g<i||b<c?!1:!0};k.compareUtils.findFirstDiff=function(g,e,c,i){for(var b=0,f=null,h=0;h<g.length;h++){if(b>i)break;if(k.compareUtils.overlapMapper(g[h],e,b,c,i)&&(f={mapperIndex:h,
startFrom:b},g[h][2]!==0))break;b+=g[h][e]}return f};k.compareUtils.matchMapper=function(g,e,c,i){if(g.length===0)return c;var b=c+Math.round((i-c)/3),f=k.compareUtils.findFirstDiff(g,e,c,i),h=g[f.mapperIndex][e]===0?f.startFrom:f.startFrom+g[f.mapperIndex][e]-1,d=k.compareUtils.lookUpLineIndex(g,1-e,f.mapperIndex),a=f.startFrom-c;return g[f.mapperIndex][2]===0?d-a:b>=f.startFrom&&b<=h?d-Math.round((i-c)/3):b<f.startFrom?d-a:(g[f.mapperIndex][1-e]===0?d:d+g[f.mapperIndex][1-e]-1)-(h-c)};k.compareUtils.getMapperLineCount=
function(g){for(var e=0,c=0;c<g.length;c++)e+=Math.max(g[c][0],g[c][1]);return e};k.compareUtils.getAnnotationIndex=function(g,e){for(var c=0;c<g.length;c++)if(g[c][0]===e)return c;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,e){return g[e][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,e){for(var c=0;c<g.length;c++)if(g[c][1]===e)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,e){return e<0?!1:!g[e][3]?!1:
g[e][3]===1};k.compareUtils.mergeDiffBlocks=function(g,e,c,i,b,f){for(var h=0;h<e.length;h++){var d=e[h][0],a=c[e[h][1]];if(a[0]>0){for(var l="",m=0;m<a[0];m++)l=l+i[a[2]-1+m].substring(b)+f;a=g.getLineCount();d>=a&&(d=g.getLineEnd(a-1),m=g.getLineEnd(a-1,!0),d===m?(g.setText(f,d,d),d=a):d=a-1);d=g.getLineStart(d);g.setText(l,d,d)}}};k.compareUtils.generateCompareHref=function(j,e){var c=require.toUrl("compare/compare.html");if(!e.conflict)e.conflict=void 0;if(!e.readonly)e.readonly=void 0;return(new g(c+
"#{,resource,params*}")).expand({resource:j,params:e})};k.compareUtils.generateCompareTreeHref=function(j,e){var c=require.toUrl("compare-tree/compare-tree.html");return(new g(c+"#{,resource,params*}")).expand({resource:j,params:e})};return k.compareUtils});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(g){function k(g){this._prefix="/git/credentials";this._preferenceService=g.getService("orion.core.preference")}k.prototype={put:function(j,e){var c={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(e!==void 0){if(e.gitSshUsername!==void 0&&e.gitSshUsername!==null)c.gitSshUsername=e.gitSshUsername;if(e.gitSshPassword!==void 0&&e.gitSshPassword!==null)c.gitSshPassword=e.gitSshPassword;if(e.gitPrivateKey!==void 0&&
e.gitPrivateKey!==null)c.gitPrivateKey=e.gitPrivateKey;if(e.gitPassphrase!==void 0&&e.gitPassphrase!==null)c.gitPassphrase=e.gitPassphrase}var i=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var e=b.get("settings");e===void 0?i.reject():e.enabled?(b.put(j,c),i.resolve()):i.reject()});return i},get:function(j){var e={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},c=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(i){var b=
i.get("settings");b===void 0?c.reject():b.enabled?(i=i.get(j),i!==void 0?c.resolve(i):c.resolve(e)):c.reject()});return c},isEnabled:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e=e.get("settings");e===void 0?j.resolve(!1):j.resolve(e.enabled)});return j},enable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,
2).then(function(e){e.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var e=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(c){c.remove(j);e.resolve()});return e},getRepositories:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){for(var c=[],e=e.keys(),i=0;i<e.length;++i)e[i]!=="settings"&&c.push(e[i]);j.resolve(c)});return j}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(g){function k(g){this._prefix="/git/config";this._preferenceService=g.getService("orion.core.preference")}k.prototype={getConfig:function(){var j=new g;this._preferenceService.getPreferences(this._prefix).then(function(e){e=e.get("userInfo");j.resolve(e)});return j},setConfig:function(j){var e=new g;this._preferenceService.getPreferences(this._prefix).then(function(c){c.put("userInfo",j);e.resolve()});return e}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(e){var c=this;this.title="Git Push";this.modal=!0;this.messages=g;this.location=e.location;this.dialog2=e.dialog;this.func=e.func;this.buttons=[];this.dialog2&&this.buttons.push({callback:function(){c.destroy();c.dialog2.show()},text:"More"});this.buttons.push({callback:function(){c.destroy();c.func()},
text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var e=this.$header;e.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));e.appendChild(document.createElement("br"));this.dialog2&&e.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};j.prototype.constructor=j;return{ConfirmPushDialog:j}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(g,k,j,e){function c(b,c){this.explorer=c;this._init(b)}function i(b){this._init(b)}var b=function(){function b(c,d,a,e){this.gitClient=c;this.rootPath=d;this.fetchItems=a;this.root=e?e:null}b.prototype=new j.ExplorerModel;b.prototype.getRoot=function(b){var d=this;this.root?b(this.root):this.fetchItems(this.rootPath).then(function(a){d.root=a;b(a)})};
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,d){b.children=[];if(b.Children){for(var a=0;a<b.Children.length;a++)b.Children[a].parent=b,b.children[a]=b.Children[a];d(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}],d(b.children)):b.GroupNode?this.gitClient.getGitBranch(b.Location).then(function(a){b.children=a.Children;for(var c=0;c<a.Children.length;c++)a.Children[c].parent=b;d(a.Children)}):b.Type==="Remote"&&this.gitClient.getGitBranch(b.Location).then(function(a){b.children=a.Children;for(var c=0;c<a.Children.length;c++)a.Children[c].parent=b;d(a.Children)})};return b}();c.prototype=new j.SelectionRenderer;c.prototype.constructor=
c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=function(b,c,d){var a=document.createElement("td");d.appendChild(a);b=document.createElement("span");b.id=d.id+"navSpan";a.appendChild(b);b.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(d,b);d=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(d=c.Name+g[" [New branch]"]);b.appendChild(document.createTextNode(d))};
i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';i.prototype._init=function(b){var c=this;this.title=b.title||g["Choose a Folder"];this.modal=!0;this.messages=g;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"})};i.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});this.$newBranch.placeholder=g["No remote selected"];if(this.hideNewBranch)this.$newBranchPane.style.display="none"};i.prototype._beforeShowing=
function(){this._initialize();this._loadRemoteChildren()};i.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};i.prototype._loadRemoteChildren=function(){this._createTree(new b(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};i.prototype._createTree=function(b){var h=this,d=this.serviceRegistry.getService("orion.remotePrompter.selection");d||(d=new e.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var a=new c({checkbox:!1,singleSelection:!0,
treeTableClass:"directoryPrompter"});this.explorer=new j.Explorer(this.serviceRegistry,d,a);a.explorer=this.explorer;this.explorer.createTree("treeContentPane",b);d.addEventListener("selectionChanged",function(a){a.selection&&a.selection.Type==="Remote"?(h.$newBranch.disabled=!1,h.$newBranch.placeholder=g["Enter a name..."]):(h.$newBranch.disabled=!0,h.$newBranch.placeholder=g["No remote selected"]);h._validate(a.selection)})};i.prototype._validate=function(b){var c=function(b){b&&b.Type==="RemoteTrackingBranch"?
this.$remoteOk.classList.remove(this.DISABLED):b&&b.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))};i.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 d=
c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),a={};a.parent=c;a.FullName="refs/remotes/"+c.Name+"/"+b.$newBranch.value;a.Name=c.Name+"/"+b.$newBranch.value;a.Type="RemoteTrackingBranch";a.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(encodeURIComponent(b.$newBranch.value))+"/"+d;b.func(null,c,a)}})};i.prototype.constructor=i;return{RemotePrompterDialog:i}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';
j.prototype._init=function(e){var c=this;this.title=e.title||g["Contribution Review Request"];this.modal=!0;this.messages=g;this.url=e.url;this.func=e.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c.func(c.$reviewerName.value)},text:g.Submit});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog:j}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(g){return{makeRelative:function(g){if(!g)return g;var j=window.location.protocol+"//"+window.location.host;return g.indexOf(j)===0?g.substring(j.length):g},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var j=new URL(g.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(j.href)===0}}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget,orion/objects,orion/util".split(","),function(g,k,j,e,c,i,b,f,h){function d(a,b,d,c,e,f){this.registry=a;this.root=b;this.fileClient=d;this.idPrefix=c||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function a(a){b.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 d=a.modelEventDispatcher?a.modelEventDispatcher:new b;this.modelEventDispatcher=d;var c=this;this._modelListeners={};"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){d.addEventListener(a,
c._modelListeners[a]=c.modelHandler[a].bind(c))});this._clickListener=function(a){if(a.target.tagName==="A"){for(a=a.target;a;){if(a._item)break;a=a.parentNode}if(a&&a._item)c.onLinkClick({type:"linkClick",item:a._item})}};(a=j.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&
e.setTarget(a)}},{pid:"nav.config"})}d.prototype=new i.ExplorerModel;f.mixin(d.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var d=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var c=[],e;for(e in b)if(!(b[e].Directory?this.excludeFolders:this.excludeFiles))if(c.push(b[e]),b[e].parent=a,!b[e].Parents)b[e].Parents=d;b=c}else for(c in b)if(b[c].parent=a,!b[c].Parents)b[c].Parents=d;a.children=b;a.children.sort(function(a,b){var d=a.Directory;
if(d!==b.Directory)return d?-1:1;var d=a.Name&&a.Name.toLowerCase(),c=b.Name&&b.Name.toLowerCase();return d<c?-1:d>c?1:0});return b},getChildren:function(a,b){var d=this;if(a.children)b(a.children);else if(a.Directory!==void 0&&a.Directory===!1)b([]);else if(a.Children)b(d.processParent(a,a.Children));else if(a.Location){var c=null;this.registry&&(c=this.registry.getService("orion.page.progress"));(c?c.progress(this.fileClient.fetchChildren(a.ChildrenLocation),g["Fetching children of "]+a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(c){d.destroyed||
b(d.processParent(a,c))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a}});d.prototype.constructor=d;var l,m;a.prototype=Object.create(i.Explorer.prototype);f.mixin(a.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=j.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);i.Explorer.prototype.destroy.call(this)},
onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){var n;n=(a=a.parent)||b.treeRoot,a=n;d[a.Location]=a});return k.all(Object.keys(d).map(function(a){return b.changedItem(d[a],!0)}))},onModelMove:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){var c=b.treeRoot;if((c.Location||c.ContentLocation)===a.oldValue.Location){var e=b.treeRoot,a=a.newValue,a=
a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return k.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:e,newValue:a});b.loadResourceList(a)})}c=(c=a.oldValue.parent)||b.treeRoot;d[c.Location]=c;c=(c=a.parent)||b.treeRoot;d[c.Location]=c;if(a.oldValue.Directory&&a.newValue&&b.isExpanded(a.oldValue))d[a.newValue.Location]=a.newValue});return k.all(Object.keys(d).map(function(a){return b.changedItem(d[a],!0)}))},onModelDelete:function(a){var a=a.items||[a],b=this,d=b.treeRoot,
c;if(a.some(function(a){if(a.oldValue.Location===(d.Location||d.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))c=a.parent;return!0}return!1}))return this.loadResourceList(c);else{var e={};a.forEach(function(a){a=a.parent;e[a.Location]=a});return k.all(Object.keys(e).map(function(a){return b.changedItem(e[a],!0)}))}},modelHandler:{copy:function(a){return a.count?void 0:this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},create:function(a){return this.onModelCreate(a)},
"delete":function(a){return a.count?void 0:this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){return a.count?void 0:this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},_makeDropTarget:function(a,b,d){if(this.dragAndDrop){var f=this,i=this.dragAndDrop,k=function(a){l=a.target};if(d)this._oldDragStart&&b.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=
k;b.addEventListener("dragstart",k,!1);k=function(){l=null};if(d)this._oldDragEnd&&b.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=k;b.addEventListener("dragend",k,!1);k=function(a){b.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(d)this._oldDragLeave&&b.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=k;b.addEventListener("dragleave",k,!1);k=function(a){if(l)m=a.dataTransfer.dropEffect=(h.isMac?a.altKey:a.ctrlKey)?"copy":"move";
else if(!h.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";b.classList.add("dragOver");j.stop(a)};if(d)this._oldDragEnter&&b.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=k;b.addEventListener("dragenter",k,!1);k=function(a){if(l)m=a.dataTransfer.dropEffect=(h.isMac?a.altKey:a.ctrlKey)?"copy":"move";else if(!h.isIE&&(a.dataTransfer.effectAllowed===
"all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";j.stop(a)};if(d&&!this._oldDragOver)b.addEventListener("dragover",k,!1),this._oldDragOver=k;var t=null;f.registry&&(t=f.registry.getService("orion.page.progress"));var x=function(a){t?t.setProgressResult(a):window.console.log(a)},n=function(b,d,f,h,i,l){if(!f.Location&&f.fileMetadata)f=f.fileMetadata;d=d||"";if(b.isFile)c.isAtRoot(f.Location)?h.registry&&h.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):b.file(function(a){i(f,a,h,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(e.formatMessage(g["Unzip ${0}?"],a.name)))});else if(b.isDirectory){var m=b.createReader(),j=function(a){m.readEntries(function(c){for(var e=0;e<c.length;e++)n(c[e],d+b.name+"/",a,h,i,l)})};c.isAtRoot(f.Location)?(t?t.progress(l.createProject(f.ChildrenLocation,b.name),e.formatMessage(g["Creating ${0}"],b.name)):l.createProject(f.ChildrenLocation,
b.name)).then(function(a){h.loadResourceList(h.treeRoot.Path,!0);(t?t.progress(l.read(a.ContentLocation,!0),g["Loading "]+a.name):l.read(a.ContentLocation,!0)).then(function(a){j(a)},x)},x):(t?t.progress(l.createFolder(f.Location,b.name),e.formatMessage(g["Creating ${0}"],b.name)):l.createFolder(f.Location,b.name)).then(function(b){h.modelEventDispatcher.dispatchEvent({type:"create",parent:a,newValue:b});j(b)},x)}},k=function(d){var h;b.classList.remove("dragOver");if(l){h=f.fileClient;for(var q=
l,z;q;){if(q._item){z=q._item;break}q=q.parentNode}if(!z)return;var k=m==="copy",q=k?h.copyFile:h.moveFile;(t?t.showWhile(q.apply(h,[z.Location,a.Location]),e.formatMessage(g[k?"Copying ${0}":"Moving ${0}"],z.Location)):q.apply(h,[z.Location,a.Location])).then(function(b){f.modelEventDispatcher.dispatchEvent({type:k?"copy":"move",oldValue:z,newValue:b,parent:a})},x)}else if(d.dataTransfer.items&&d.dataTransfer.items.length>0)for(h=0;h<d.dataTransfer.items.length;h++)q=null,typeof d.dataTransfer.items[h].getAsEntry===
"function"?q=d.dataTransfer.items[h].getAsEntry():typeof d.dataTransfer.items[h].webkitGetAsEntry==="function"&&(q=d.dataTransfer.items[h].webkitGetAsEntry()),q&&n(q,null,a,f,i,f.fileClient);else if(d.dataTransfer.files&&d.dataTransfer.files.length>0)for(h=0;h<d.dataTransfer.files.length;h++)q=d.dataTransfer.files[h],!q.size&&!q.type?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:e.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],
q.name)}):c.isAtRoot(a.Location)?f.registry&&f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):i(a,q,f,q.name.indexOf(".zip")===q.name.length-4&&window.confirm(e.formatMessage(g["Unzip ${0}?"],q.name)));j.stop(d)};if(d)this._oldDrop&&b.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=k;b.addEventListener("drop",k,!1)}},createModel:function(){return new d(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var d=this,c=new k;a.children=a.Children=null;this.model.getChildren(a,function(e){d.getNavHandler();d.myTree.refresh.bind(d.myTree)(a,e,b);c.resolve(e)});return c},showItem:function(a,b){var d=new k;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return d.reject();
var c=this.getRow(a);if(c)d.resolve(c._item||a);else return a.Parents&&a.Parents.length>0?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var d=this.getRow(a);return!d?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new k).reject()}.bind(this)):d._item||a}.bind(this))):b===void 0||b?this.reroot(a):d.reject();return d},expandItem:function(a,b){var d=new k;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?d.resolve(a):
this.myTree.expand(this.model.getId(a),function(){d.resolve(a)})}.bind(this),d.reject);return d},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(){return(new k).reject()},isExpanded:function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))},getNameNode:function(a){if(a=this.model.getId(a))return j.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(){},
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 k).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),g["Loading "]+a).then(function(){e.treeRoot.Path=a;typeof d==="function"&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new k).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new k).reject(a)}):(new k).resolve(e.treeRoot)},load:function(a,b,d){var c=j.node(this.parentId),e=j.node("progress");if(!e)e=document.createElement("div"),e.id="progress",j.empty(c),c.appendChild(e);j.empty(e);var f=setTimeout(function(){j.empty(e);e.appendChild(document.createTextNode(b))},500),h=this;return k.when(a,function(a){clearTimeout(f);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();if(h.dragAndDrop)h._hookedDrag?h._makeDropTarget(h.treeRoot,
c,!0):(a=(a=c&&("draggable"in c||"ondragstart"in c&&"ondrop"in c))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,c,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));var e=new k;h.createTree(h.parentId,h.model,{onComplete:function(a){e.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:typeof h.setFocus==="undefined"?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return e.then(function(){if(typeof d==="function")try{d()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if(typeof h.onchange==="function")h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(f);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new k).reject(a)})},onchange:function(){}});a.prototype.constructor=a;return{FileExplorer:a,FileModel:d}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(g,k,j,e,c,i,b,f){function h(a,b){this.explorer=b;this._init(a)}function d(a){this._init(a)}h.prototype=new b.SelectionRenderer;h.prototype.constructor=h;h.prototype.getLabelColumnIndex=function(){return 0};h.prototype.getCellElement=
function(a,b,d){a=document.createElement("td");d.appendChild(a);var c=document.createElement("span");c.id=d.id+"navSpan";a.appendChild(c);c.className="mainNavColumn singleNavColumn";this.getExpandImage(d,c);c.appendChild(document.createTextNode(b.Name))};d.prototype=new j.Dialog;d.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>';
d.prototype._init=function(a){this.title=a.title||g["Choose a Folder"];this.modal=!0;this.buttons=[{text:g.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};d.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
d.prototype.loadFolderList=function(a){a=e.makeRelative(a);this.selection=new c.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new f.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new h({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};d.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};d.prototype.constructor=d;return{DirectoryPrompterDialog:d}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(g,k,j,e,c){function i(b){this._init(b)}var b=new e("edit/edit.html#{,resource,params*}");i.prototype=new j.Dialog;i.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';i.prototype._init=
function(b){var c=this;this.title=b.title?b.title:g["Clone Git Repository"];this.modal=!0;this.messages=g;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c._execute()},text:"OK"});this._initialize()};i.prototype._bindToDom=function(){var b=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){b.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){b._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){b._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){b._checkNewExisting()});this.$gitName.addEventListener("focus",function(){b._showNewProject()});this.$advancedLink.addEventListener("click",
function(){b._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){b._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};i.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};i.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};i.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};i.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};i.prototype._showNewProject=function(){this.$isNewProject.checked=!0};i.prototype._openDirectoryPickerDialog=function(){function e(a){var d=document.createElement("a");
d.href=c.toUrl(b.expand({resource:a.ChildrenLocation}));d.textContent=a.Name;return d}var h=this;this.$isExistingProject.checked=!0;var d=new k.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(a){if(a&&a.Location){for(h.$gitPath.value=a.Location;h.$shownGitPath.hasChildNodes();)h.$shownGitPath.removeChild(h.$shownGitPath.lastChild);for(h.$shownGitPath.appendChild(e(a));a.parent&&a.parent.Location!=="/";)h.$shownGitPath.insertBefore(document.createTextNode("/"),
h.$shownGitPath.firstChild),h.$shownGitPath.insertBefore(e(a.parent),h.$shownGitPath.firstChild),a=a.parent}}});this._addChildDialog(d);d.show()};i.prototype.constructor=i;return{CloneGitRepositoryDialog:i}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog","orion/git/util"],function(g,k,j,e){function c(c){this._init(c)}c.prototype=new j.Dialog;c.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">${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>';c.prototype._init=
function(c){var b=this;this.title=c.title||g["Git Credentials"];this.modal=!0;this.messages=g;this.options=c;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(c.serviceRegistry)this._sshService=c.serviceRegistry.getService("orion.net.ssh"),this._progressService=c.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){b.destroy();
b._execute()},text:"OK",isDefault:!0});this._initialize()};c.prototype._bindToDom=function(){var c=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&this.options.errordata.Url)this.$gitCredentialsLabel.style.display=
"block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){c.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(b){if(!b)c.$gitSaveCredentials.style.display="none",c.$gitSaveCredentialsLabel.style.display="none",c.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){c.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(b){c.privateKeyFile=b.target.files[0]})};c.prototype._execute=function(){var c=this,b=this.$gitPrivateKey.value,
f=this.$url.textContent,h=function(a){if(c._sshService){var b=e.parseSshGitUrl(f);c._sshService.getKnownHostCredentials(b.host,b.port).then(function(b){if(c.options.func){var d=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;d!=="undefined"&&c._progressService.removeOperation(d);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$isSshPassword.checked?c.$gitSshPassword.value:"",gitPrivateKey:c.$isPrivateKey.checked?
a:"",gitPassphrase:c.$isPrivateKey.checked?c.$gitPassphrase.value:"",knownHosts:b})}})}else c.options.func&&(b=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation,b!=="undefined"&&c._progressService.removeOperation(b),c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:c.$gitPassphrase.value,knownHosts:c.$gitSshKnownHosts.value}))};if(this.privateKeyFile){var d=new FileReader;
d.onload=function(){return function(a){b=a.target.result;a=new k(c.options.serviceRegistry);c.$gitSaveCredentials.checked?a.put(f,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){h(b)}):h(b)}}(this.privateKeyFile);d.readAsText(this.privateKeyFile)}else b.length>0?(d=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?d.put(f,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){h(b)}):h(b)):(d=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?
d.put(f,{gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$gitSshPassword.value}).then(function(){h(b)}):h(b))};c.prototype.constructor=c;return{GitCredentialsDialog:c}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/URITemplate,orion/webui/littlelib".split(","),function(g,k,j,e,c,i,b){function f(b){this._init(b)}var h=new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");f.prototype=new c.Dialog;f.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>';
f.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()};f.prototype._bindToDom=function(){var d=this;this.$resourceName.addEventListener("input",
function(){d.time=+new Date;d.timeoutId&&clearTimeout(d.timeoutId);d.timeoutId=setTimeout(d._checkSearch.bind(d),0)},!1);this.$resourceName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var c=b.$("a",d.$results);c&&(b.stop(a),window.open(c.href),d.hide())}},!1);this.$resourceName.value=this.commitName};f.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)};f.prototype._findCommitLocation=function(b,a,c){var f=this;c||(c=new e);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(f.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+a).then(function(a){c.resolve(a.Children[0])},function(){f._findCommitLocation(b.slice(1),a,c)}):c.reject();return c};f.prototype._doSearch=function(){var d=this,a=this.$resourceName&&this.$resourceName.value;
if(a){var c=document.createElement("div");c.appendChild(document.createTextNode(k["Searching..."]));b.empty(this.$results);this.$results.appendChild(c);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,a).then(function(a){b.empty(d.$results);d._displayCommit(a,d.$results);d.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var a=document.createElement("div");a.appendChild(document.createTextNode("No commits found"));
b.empty(d.$results);d.$results.appendChild(a);d.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};f.prototype._displayCommit=function(d,a){var c=this,e=document.createElement("div");e.style.padding="10px";e.style.maxWidth="480px";b.empty(a);a.appendChild(e);var f=d.Message.split(/(\r?\n|$)/)[0],i=document.createElement("a");i.className="navlinkonpage";i.href=g.toUrl(h.expand({resource:d.Location}));i.textContent=f;e.appendChild(i);i.addEventListener("mouseup",function(a){a.button===
0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);i.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&c.hide()},!1);f=document.createElement("div");f.style.paddingTop="15px";e.appendChild(f);if(d.AuthorImage)e=new Image,e.src=d.AuthorImage,e.name=d.AuthorName,e.className="git-author-icon",f.appendChild(e);e=document.createElement("div");e.textContent=j.formatMessage(k[" authored by ${0} {${1}) on ${2}"],d.AuthorName,d.AuthorEmail,(new Date(d.Time)).toLocaleString());f.appendChild(e);e=document.createElement("div");
e.textContent=j.formatMessage(k["committed by 0 (1)"],d.CommitterName,d.CommitterEmail);f.appendChild(e);e=document.createElement("div");e.style.paddingTop="15px";e.textContent=k["commit:"]+d.Name;f.appendChild(e);if(d.Parents&&d.Parents.length>0)a=document.createElement("div"),a.textContent=k["parent:"],e=document.createElement("a"),e.className="navlinkonpage",e.href=g.toUrl(h.expand({resource:d.Parents[0].Location})),e.textContent=d.Parents[0].Name,a.appendChild(e),e.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1),e.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&c.hide()},!1),f.appendChild(a)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype.constructor=f;return{OpenCommitDialog:f}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="changeIdLabel" for="changeId">${ChangeId:}</label><input id="changeId" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';j.prototype._init=
function(e){var c=this;this.title=g["Commit Changes"];this.modal=!0;this.messages=g;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var e=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){e._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.ChangeId)this.$changeId.checked=
!0;if(this.options.body.CommitterName)this.$committerName.value=this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){e._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=
this.options.body.AuthorEmail;this.$authorEmail.addEventListener("keyup",function(){e._validate()});this._validate()};j.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=
g["The author mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer name is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var e={};e.Message=this.$commitMessage.value;e.Amend=this.$amend.checked?!0:!1;e.ChangeId=this.$changeId.checked?!0:!1;e.CommitterName=this.$committerName.value;e.CommitterEmail=this.$committerEmail.value;e.AuthorName=
this.$authorName.value;e.AuthorEmail=this.$authorEmail.value;this.options.func(e)}this.hide()}};j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>'+g["URL:"]+'<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>'+g["File:"]+'<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';
j.prototype._init=function(e){var c=this;this.title=g["Apply Patch"];this.modal=!0;this.messages=g;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._applyPatch()},text:g.OK});this._initialize()};j.prototype._bindToDom=function(){this.$selectedFile.onchange=function(){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=function(){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};j.prototype._applyPatch=function(){var e=
new FormData;e.append("uploadedfile",this.$selectedFile.files[0]);e.append("url",this.$url.value);e.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(e)};j.prototype.handleReadyState=function(){this.req.readyState===4&&(this.req.status===200?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):
this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};j.prototype.constructor=j;return{ApplyPatchDialog:j}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/commandRegistry,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/gitConfigPreference,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim,orion/PageLinks,orion/URITemplate".split(","),function(g,
k,j,e,c,i,b,f,h,d,a,l,m,o,s,r,v,u,w,t,x,n){var p={};(function(){function y(a){return k.toUrl(E.expand({resource:a}))}function q(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:g["Problem while performing the action"]}}b.HttpCode=a.status;return b}var z=!1,C=new n("git/git-repository.html#{,resource,params*}"),H=new n("git/git-log.html#{,resource,params*}?page=1"),t=new n("git/git-log.html#{,resource,params*}"),A=new n("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),E=new n(f.statusUILocation+
"#{,resource,params*}"),D=new n("edit/edit.html#{,resource,params*}");p.updateNavTools=function(a,b,d,e,f,h,n){var i=c.node(e);if(i)b.destroy(i);else throw"could not find toolbar "+e;b.renderCommands(e,i,h,d,"button");if(n&&(e=c.node(n)))b.destroy(e),b.renderCommands(n,e,h,d,"button");if(f&&(h=c.node(f)))b.destroy(f),b.renderCommands(f,h,null,d,"button");z||(z=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=c.node(f);e&&(b.destroy(e),b.renderCommands(f,
e,a.selections,d,"button"))}))};p.handleKnownHostsError=function(a,b,d,c){if(confirm(e.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var h=f.parseSshGitUrl(b.Url),b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:h.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){d.knownHosts=b;typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation);
c(d)})}};p.handleSshAuthenticationError=function(a,b,c,e,f){var b=b?b.Url:void 0,h=function(){(new r.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:c.errordata,failedOperation:c.failedOperation})).show()};c.gitSshUsername&&c.gitSshUsername!==""||c.gitSshPassword&&c.gitSshPassword!==""||c.gitPrivateKey&&c.gitPrivateKey!==""?h():(new d(a)).get(b).then(function(b){b.gitPrivateKey!==""||b.gitSshUsername!==""||b.gitSshPassword!==""?(typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation),
e({knownHosts:c.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):h()},h)};p.getDefaultSshOptions=function(a,b,d){var c=new j,a=a.getService("orion.net.ssh"),e=d&&!d.optionsRequested?d.valueFor("sshuser"):"",h=d&&!d.optionsRequested?d.valueFor("sshpassword"):"",n;if(b.GitUrl!==void 0)n=b.GitUrl;else if(b.errorData!==void 0)n=b.errorData.Url;else if(b.toRef!==void 0)n=b.toRef.RemoteLocation[0].GitUrl;else if(b.RemoteLocation!==
void 0)n=b.RemoteLocation[0].GitUrl;if(!n)return c.resolve({knownHosts:"",gitSshUsername:e,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""}),c;b=f.parseSshGitUrl(n);a.getKnownHostCredentials(b.host,b.port).then(function(a){c.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})});return c};p.handleProgressServiceResponse=function(a,b,d,c,e,f){a&&a.status!==void 0&&(a=q(a));if(!a||a.HttpCode===void 0)c&&c(a);else switch(a.HttpCode){case 401:if(a.JsonData)b.errordata=
a.JsonData;if(a.failedOperation)b.failedOperation=a.failedOperation;p.handleSshAuthenticationError(d,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=a.failedOperation;p.handleKnownHostsError(d,a.JsonData,b,e);break}else if(a.JsonData&&a.JsonData.Host){if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=a.failedOperation;p.handleSshAuthenticationError(d,a.JsonData,b,e,f);break}default:b=[],b.Severity="Error",b.HTML=
!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,d.getService("orion.page.message").setProgressResult(b),c&&c(a)}};p.gatherSshCredentials=function(a,b,c){var h=new j,n;if(b.items.RemoteLocation!==void 0)n=b.items.RemoteLocation[0].GitUrl;else if(b.items.GitUrl!==void 0)n=b.items.GitUrl;else if(b.items.errorData!==void 0)n=b.items.errorData.Url;else if(b.items.toRef!==void 0)n=b.items.toRef.RemoteLocation[0].GitUrl;var i=a.getService("orion.net.ssh"),p=f.parseSshGitUrl(n),q=function(d){a.getService("orion.net.ssh").getKnownHostCredentials(p.host,
p.port).then(function(a){b.sshObject=d;h.resolve({knownHosts:a,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})})},y=b.errorData;if(y&&y.HostKey){if(confirm(e.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],y.KeyType,y.Host,y.HostFingerprint))){var l=f.parseSshGitUrl(y.Url);i.addKnownHost({host:y.Host,keyType:y.KeyType,hostKey:y.HostKey,port:l.port}).then(function(){b.sshObject&&
(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new d(a)).get(n).then(function(a){q(a)},function(){q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}return h}var m=function(){if(!b.parameters&&!b.optionsRequested)q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var e=b.parameters&&
b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,f=b.parameters?b.parameters.valueFor("sshpassword"):"",h=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,i=new d(a);h?i.put(n,{gitSshUsername:e,gitSshPassword:f}).then(function(){q({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):q({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new r.GitCredentialsDialog({title:c,
serviceRegistry:a,func:q,errordata:y})).show()};b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?m():(new d(a)).get(n).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?q(a):m()},m);return h};p.handleGitServiceResponse=function(a,b,d,c){a&&a.status!==void 0&&(a=q(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:c(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){c(a);break}default:c=
[],c.Severity="Error",c.HTML=!1,c.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(c),d&&d(a)}};p.createFileCommands=function(a,c,f){function n(b){var d={Severity:"Error",HTML:!1};try{var c=JSON.parse(b.responseText);b.status===401?(d.HTML=!0,d.Message="<span>",d.Message+=e.formatMessage(g["Authentication required for: ${0}. ${1} and re-try the request."],c.label,'<a target="_blank" href="'+c.SignInLocation+'">'+g.Login+"</a>")+"</span>"):
d.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:g["Problem while performing the action"]}catch(f){d.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(d)}var q=new b.ParametersDescription([new b.CommandParameter("name","text",g["Local Branch Name:"])]),q=new i.Command({name:g.Checkout,tooltip:g["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(b){var d=b.items,c=function(b,d,c){a.getService("orion.page.progress").showWhile(a.getService("orion.git.provider").checkoutTag(b,d,c),e.formatMessage(g["Checking out tag ${0}"],c)).then(function(){f.changedItem()},n)},h=d.Repository?d.Repository.Location:d.CloneLocation;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&c(h,d.Name,b.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});c.addCommand(q);q=
new i.Command({name:g.Checkout,tooltip:g["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(b){var d=b.items,c=a.getService("orion.git.provider"),h=a.getService("orion.page.message"),i=a.getService("orion.page.progress");h.setProgressMessage(d.Name?e.formatMessage(g["Checking out branch ${0}..."],
d.Name):g["Checking out branch..."]);d.Type==="Branch"?i.progress(c.checkoutBranch(d.CloneLocation,d.Name),"Checking out branch "+d.Name).then(function(){h.setProgressResult(g["Branch checked out."]);f.changedItem(d.parent)},function(a){n(a)}):i.progress(c.addBranch(d.Repository?d.Repository.BranchLocation:d.parent.parent.BranchLocation,null,d.Name),"Adding branch "+d.Name).then(function(a){i.progress(c.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+d.Name).then(function(){h.setProgressResult(g["Branch checked out."]);
f.changedItem(d.Repository?d.Repository.BranchLocation:d.parent.parent.parent)},function(a){n(a)})},function(a){n(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name","text","Name:")]);q=new i.Command({name:g["New Branch"],tooltip:g["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:q,callback:function(b){var d=b.items,c=a.getService("orion.page.progress"),
e=function(b,e){c.progress(a.getService("orion.git.provider").addBranch(b,e),"Adding branch "+e).then(function(){f.changedItem(d)},n)},h;h=d.Type==="Clone"?d.BranchLocation:d.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&e(h,b.parameters.valueFor("name"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&f.parentId==="artifacts"}});c.addCommand(q);q=new i.Command({name:g.Delete,tooltip:g["Delete the local branch from the repository"],imageClass:"core-sprite-delete",
id:"eclipse.removeBranch",callback:function(b){var d=b.items,b=a.getService("orion.page.progress");confirm(e.formatMessage(g["Are you sure you want to delete branch ${0}?"],d.Name))&&b.progress(a.getService("orion.git.provider").removeBranch(d.Location),"Removing branch "+d.Name).then(function(){f.changedItem?f.changedItem(d.parent):f.displayBranches&&f.displayBranches(d.ParentLocation,null)},n)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});c.addCommand(q);q=new i.Command({name:g.Delete,
tooltip:g["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(b){var d=b.items,c=a.getService("orion.page.progress");confirm(e.formatMessage(g["You're going to delete remote branch ${0} and push the change."],d.Name)+"\n\n"+g["Are you sure?"])&&p.getDefaultSshOptions(a,d).then(function(b){var e=arguments.callee,h=a.getService("orion.git.provider"),n=a.getService("orion.page.message"),h=c.progress(h.doPush(d.Location,
"",!1,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Removing remote branch: "]+d.Name);n.createProgressMonitor(h,g["Removing remote branch: "]+d.Name);h.then(function(c){p.handleProgressServiceResponse(c,b,a,function(a){a.Result.Severity=="Ok"&&f.changedItem(d.parent)},e,g["Delete Remote Branch"])},function(c){p.handleProgressServiceResponse(c,b,a,function(){},e,g["Removing remote branch: "]+d.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});
c.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name","text","Name:"),new b.CommandParameter("url","url","Url:")]);q=new i.Command({name:g["New Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:q,callback:function(b){var d=b.items,c=a.getService("orion.page.progress"),e=function(b,e,h){c.progress(a.getService("orion.git.provider").addRemote(b,e,h),"Adding remote "+b).then(function(){f.changedItem(d)},n)},h;h=d.Type==="Clone"?d.RemoteLocation:
d.Location;b.parameters.valueFor("name")&&b.parameters.valueFor("url")&&e(h,b.parameters.valueFor("name"),b.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&f.parentId==="artifacts"}});c.addCommand(q);q=new i.Command({name:g.Delete,tooltip:g["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(b){var d=b.items;confirm(e.formatMessage(g["Are you sure you want to delete remote ${0}?"],
d.Name))&&a.getService("orion.page.progress").progress(a.getService("orion.git.provider").removeRemote(d.Location),"Removing remote "+d.Name).then(function(){f.changedItem(d.parent)},n)},visibleWhen:function(a){return a.Type==="Remote"}});c.addCommand(q);q=new i.Command({name:g.Pull,tooltip:g["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(b){var d=b.items,c=d.Location,e=d.Name;p.getDefaultSshOptions(a,d).then(function(b){var h=
arguments.callee,n=a.getService("orion.git.provider"),i=a.getService("orion.page.message"),n=a.getService("orion.page.progress").progress(n.doPull(c,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Pulling: "]+e);i.createProgressMonitor(n,g["Pulling: "]+e);var q;n.then(function(c){p.handleProgressServiceResponse(c,b,a,function(){d.Type==="Clone"&&f.changedItem(d)},h,"Pull Git Repository")},function(c){if(q)c.failedOperation=q;p.handleProgressServiceResponse(c,
b,a,function(){f.changedItem(d)},h,g["Pull Git Repository"])},function(a){q=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});c.addCommand(q);q=new i.Command({name:g["Git Log"],tooltip:g["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return k.toUrl(H.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(q);q=new i.Command({name:g["Git Log"],tooltip:g["Open the log for the repository"],
id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(H.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});c.addCommand(q);q=new i.Command({name:g["Git Status"],tooltip:g["Open the status for the repository"],id:"eclipse.openGitStatus",hrefCallback:function(a){return y(a.items.StatusLocation)},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});c.addCommand(q);
q=new i.Command({name:g.ShowInEditor,tooltip:g.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl(D.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});c.addCommand(q);q=new i.Command({name:g["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(b){b=b.items;return a.getService("orion.page.progress").progress(a.getService("orion.git.provider").getDiff(b[1].DiffLocation,b[0].Name),"Generating Diff for "+
b[0].Name+" and "+b[1].Name).then(function(a){return h.generateCompareHref(a.Location,{readonly:!0})})},visibleWhen:function(a){return f.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});c.addCommand(q);q=new i.Command({name:g["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return h.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type===
"Commit"&&a.ContentLocation!==null&&!f.isDirectory}});c.addCommand(q);q=new i.Command({name:g.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(D.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!f.isDirectory}});c.addCommand(q);q=new i.Command({name:g.Fetch,tooltip:g["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.fetch",callback:function(e){var h=e.items,i=h.Location,q=h.Name,y=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),
new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):
new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})},l=function(){e.parameters&&e.parameters.optionsRequested?(e.parameters=null,e.optionsRequested=!0,c.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),
p.gatherSshCredentials(a,e).then(function(b){var d=a.getService("orion.git.provider"),c=a.getService("orion.page.message"),b=a.getService("orion.page.progress").progress(d.doFetch(i,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+q);c.createProgressMonitor(b,g["Fetching remote: "]+q);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){y(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},
function(a){y(a,e)})})}))};if(e.items.GitUrl)l();else{var m=a.getService("orion.git.provider"),j=a.getService("orion.page.progress");j.progress(m.getGitRemote(i),"Getting remote details "+q).then(function(a){j.progress(m.getGitClone(a.CloneLocation),"Getting git repository information "+a.Name).then(function(a){e.items.GitUrl=a.Children[0].GitUrl;l()},n)},n)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?
!0:!1}});c.addCommand(q);q=new i.Command({name:g["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:g["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",callback:function(e){if(confirm(g["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+g["Are you sure?"])){var h=e.items,n=h.Location,i=h.Name,q=function(e,f){e.JsonData.HostKey?
(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});
f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})},y=function(){e.parameters&&e.parameters.optionsRequested?(e.parameters=null,e.optionsRequested=!0,c.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),p.gatherSshCredentials(a,e).then(function(b){var d=a.getService("orion.git.provider"),c=a.getService("orion.page.progress"),y=a.getService("orion.page.message"),
b=c.progress(d.doFetch(n,!0,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+i);y.createProgressMonitor(b,g["Fetching remote: "]+i);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){q(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){q(a,e)})})}))};if(e.items.GitUrl)y();else{var l=a.getService("orion.git.provider");l.getGitRemote(n).then(function(a){l.getGitClone(a.CloneLocation).then(function(a){e.items.GitUrl=
a.Children[0].GitUrl;y()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(q);q=new i.Command({name:g.Merge,tooltip:g["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(b){var d=b.items,b=a.getService("orion.git.provider"),c=a.getService("orion.page.progress"),
h=a.getService("orion.page.message");c.progress(b.doMerge(d.HeadLocation,d.Name,!1),"Merging "+d.Name).then(function(a){var b={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var c=d.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result;if(a.FailingPaths){var n="",i=!0,p;for(p in a.FailingPaths)i||(n+=", "),i=!1,n+=p;if(!i)b.Severity="Error",b.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],
n)}b.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+y(c)+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)c=d.HeadLocation.replace("commit/HEAD","status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(c)+'">'+g["Git Status page"]+"</a>")+"</span>";
h.setProgressResult(b);f.changedItem(d)},function(b,c){var h=[],n=d.HeadLocation.replace("commit/HEAD","status");h.Severity="Error";h.HTML=!0;h.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(n)+'">'+g["Git Status page"]+"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(h);f.changedItem(d)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&
a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(q);q=new i.Command({name:g["Merge Squash"],tooltip:g["Squash the content of the branch to the index"],imageClass:"git-sprite-merge-squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(b){var d=b.items,b=a.getService("orion.git.provider"),c=a.getService("orion.page.progress"),h=a.getService("orion.page.message");c.progress(b.doMerge(d.HeadLocation,d.Name,!0),"Merging "+d.Name).then(function(a){var b=
[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var c=d.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(c)+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)c=d.HeadLocation.replace("commit/HEAD","status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),
b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(c)+'">'+g["Git Status page"]+"</a>")+"</span>";h.setProgressResult(b);f.changedItem(d)},function(b,c){var h=[],n=d.HeadLocation.replace("commit/HEAD","status");h.Severity="Error";h.HTML=!0;h.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(n)+'">'+g["Git Status page"]+
"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(h);f.changedItem(d)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(q);q=new i.Command({name:g.Rebase,tooltip:g["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(b){var d=b.items,b=a.getService("orion.page.message"),c=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(d.HeadLocation,d.Name,"BEGIN"),d.Name?g["Rebase on top of "]+d.Name:g.Rebase);b.createProgressMonitor(c,d.Name?g["Rebase on top of "]+d.Name:g.Rebase);c.then(function(b){var c=[],h=d.HeadLocation.replace("commit/HEAD","status");b.Result==="OK"||b.Result===
"FAST_FORWARD"||b.Result==="UP_TO_DATE"?(c.Severity="Ok",c.HTML=!1,c.Message=b.Result):b.Result==="STOPPED"?(c.Severity="Warning",c.HTML=!0,c.Message="<span>"+b.Result+g[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_WRONG_REPOSITORY_STATE"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+b.Result+g[". Repository state is invalid (i.e. already during rebasing)"]+
e.formatMessage(". Go to ${0}.",'<a href="'+y(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_UNMERGED_PATHS"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+b.Result+g[". Repository contains unmerged paths"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_PENDING_CHANGES"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+b.Result+g[". Repository contains pending changes. Please commit or stash them"]+e.formatMessage(g[". Go to ${0}."],
'<a href="'+y(h)+'">Git Status page</a>')+".</span>"):(c.Severity="Warning",c.HTML=!0,c.Message="<span>"+b.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+y(h)+'">'+g["Git Status page"]+"</a>")+".</span>");a.getService("orion.page.message").setProgressResult(c);f.changedItem(d)},n)},visibleWhen:function(a){this.tooltip=g["Rebase your commits by removing them from the active branch, "]+g["starting the active branch again based on the latest state of '"]+a.Name+"' "+g["and applying each commit again to the updated active branch."];
return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});c.addCommand(q);q=new i.Command({name:g["Push All"],tooltip:g["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(e){var h=e.targetBranch,n,i=e.items;if(i.toRef)i=i.toRef;i.CloneLocation.split("/");var q=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=
e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),
new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=
e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var y=a.getService("orion.git.provider"),z=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&z.removeOperation(e.errorData.failedOperation);var k=function(b,d,c,h,n){var i=a.getService("orion.page.message"),b=z.progress(y.doPush(d,c,!0,n,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);i.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){q(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){q(a,e)})})};z.progress(y.getGitClone(i.CloneLocation),"Getting git repository details "+i.Name).then(function(b){var d=b.Children[0].RemoteLocation,c=b.Children[0].ConfigLocation,f=function(b){p.handleProgressServiceResponse(b,
{},a)};p.gatherSshCredentials(a,e).then(function(b){var p=new j;if(i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1)p=z.progress(y.getGitRemote(d),"Getting git remote details "+i.Name);else{var q={};q.Children=i.RemoteLocation;p.resolve(q)}p.then(function(d){h?k(b,h.Location,"HEAD",h.Name,!1):(d=new m.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:y,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,h){n=a===null?h:a;var p="branch."+i.Name+
".remote";z.progress(y.addCloneConfigurationProperty(c,p,n.parent.Name),"Adding git configuration property "+i.Name).then(function(){e.targetBranch=n;k(b,n.Location,"HEAD",n.Name,!1)},function(a){a.status===409?y.getGitCloneConfig(c).then(function(a){if(a.Children)for(var d=0;d<a.Children.length;d++)if(a.Children[d].Key===p){z.progress(y.editCloneConfigurationProperty(a.Children[d].Location,n.parent.Name),"Updating configuration property "+n.parent.Name).then(function(){e.targetBranch=n;k(b,n.Location,
"HEAD",n.Name,!1)},f);break}},f):f(a)})}}),i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:y,dialog:d,location:i.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=i.RemoteLocation[0].Children[0];k(b,i.RemoteLocation[0].Children[0].Location,"HEAD",i.Name,!1)}})),d.show())})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&
a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});c.addCommand(q);q=new i.Command({name:g["Push Branch"],tooltip:g["Push commits without tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushBranch",callback:function(e){var h=e.targetBranch,n,i=e.items;if(i.toRef)i=i.toRef;i.CloneLocation.split("/");var q=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=
e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),
new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=
e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var y=a.getService("orion.git.provider"),z=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&z.removeOperation(e.errorData.failedOperation);var k=function(b,d,c,h,n){var i=a.getService("orion.page.message"),b=z.progress(y.doPush(d,c,!1,n,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);i.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){q(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){q(a,e)})})};z.progress(y.getGitClone(i.CloneLocation),"Getting git repository details "+i.Name).then(function(b){var d=b.Children[0].RemoteLocation,c=b.Children[0].ConfigLocation,f=function(b){p.handleProgressServiceResponse(b,
{},a)};p.gatherSshCredentials(a,e).then(function(b){var p=new j;if(i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1)p=z.progress(y.getGitRemote(d),"Getting git remote details "+i.Name);else{var q={};q.Children=i.RemoteLocation;p.resolve(q)}p.then(function(d){h?k(b,h.Location,"HEAD",h.Name,!1):(d=new m.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:y,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,h){n=a===null?h:a;var p="branch."+i.Name+
".remote";z.progress(y.addCloneConfigurationProperty(c,p,n.parent.Name),"Adding git configuration property "+i.Name).then(function(){e.targetBranch=n;k(b,n.Location,"HEAD",n.Name,!1)},function(a){a.status===409?y.getGitCloneConfig(c).then(function(a){if(a.Children)for(var d=0;d<a.Children.length;d++)if(a.Children[d].Key===p){z.progress(y.editCloneConfigurationProperty(a.Children[d].Location,n.parent.Name),"Updating configuration property "+n.parent.Name).then(function(){e.targetBranch=n;k(b,n.Location,
"HEAD",n.Name,!1)},f);break}},f):f(a)})}}),i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:y,dialog:d,location:i.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=i.RemoteLocation[0].Children[0];k(b,i.RemoteLocation[0].Children[0].Location,"HEAD",i.Name,!1)}})),d.show())})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&
a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});c.addCommand(q);q=new i.Command({name:g["Push for Review"],tooltip:g["Push commits to Gerrit Code Review"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushToGerrit",callback:function(e){var h=e.targetBranch,n=e.items;if(n.toRef)n=n.toRef;n.CloneLocation.split("/");var i=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,
c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword",
"password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=
e.failedOperation;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var q=a.getService("orion.git.provider"),y=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&y.removeOperation(e.errorData.failedOperation);var m=function(b,d,c,h,n){var l=a.getService("orion.page.message"),b=y.progress(q.doPush(d,c,!1,n,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),
g["Pushing remote: "]+h);l.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){i(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){i(a,e)})})};y.progress(q.getGitClone(n.CloneLocation),"Getting git repository details "+n.Name).then(function(b){var d=b.Children[0].RemoteLocation;p.gatherSshCredentials(a,e).then(function(b){var c=new j;if(n.RemoteLocation.length===1&&n.RemoteLocation[0].Children.length===
1)c=y.progress(q.getGitRemote(d),"Getting git remote details "+n.Name);else{var f={};f.Children=n.RemoteLocation;c.resolve(f)}c.then(function(){if(h)m(b,h.Location,"HEAD",h.Name,!1);else{e.targetBranch=n.RemoteLocation[0].Children[0];var d=n.RemoteLocation[0].Children[0].Location.split("/");d[4]=encodeURIComponent(encodeURIComponent("refs/for/master"));var c=d.join("/");e.targetBranch.Location=c;e.targetBranch.Name="refs/for/master";dialog=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,
gitClient:q,dialog:null,location:"refs/for/master",func:function(){m(b,c,"HEAD","refs/for/master",!1)}});dialog.show()}})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation&&a.toRef.RemoteLocation[0].IsGerrit:a.Type==="Branch"&&a.Current&&a.RemoteLocation&&a.RemoteLocation[0].IsGerrit}});c.addCommand(q);q=new i.Command({name:g["Force Push All"],tooltip:g["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(e){var h=e.confirmedWarnings,n=e.targetBranch;if(!h)if(confirm(g["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+g["Are you sure?"]))h=e.confirmedWarnings=!0;else return;var i,q=e.items;if(q.toRef)q=q.toRef;var y=q.CloneLocation.split("/"),z=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,c.collectParameters(f)):
f.optionsRequested?(f.errorData=e.JsonData,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=
!0,c.collectParameters(e);else{var k=a.getService("orion.git.provider"),o=a.getService("orion.page.progress"),C=function(b,d,c,h,n){var i=a.getService("orion.page.message"),b=o.progress(k.doPush(d,c,!0,n,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);i.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){z(a,e)})},function(b){p.handleGitServiceResponse(b,
a,function(){f.changedItem(q)},function(a){z(a,e)})})};o.progress(k.getGitClone(q.CloneLocation),"Getting git repository details "+q.Name).then(function(b){var d=b.Children[0].RemoteLocation,c=b.Children[0].ConfigLocation;p.gatherSshCredentials(a,e).then(function(b){var f=new j;if(q.RemoteLocation.length===1&&q.RemoteLocation[0].Children.length===1)f=o.progress(k.getGitRemote(d),"Getting remote details "+q.Name);else{var h={};h.Children=q.RemoteLocation;f.resolve(h)}f.then(function(d){n?C(b,n.Location,
"HEAD",n.Name,!0):(d=new m.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:k,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,f){i=a===null?f:a;var h="/gitapi/config/branch."+q.Name+".remote/clone/file/"+y[4];o.progress(k.addCloneConfigurationProperty(c,"branch."+q.Name+".remote",i.parent.Name),"Setting git configuration property "+q.Name).then(function(){e.targetBranch=i;C(b,i.Location,"HEAD",i.Name,!0)},function(a){a.status===409&&o.progres(k.editCloneConfigurationProperty(h,
i.parent.Name),"Setting git configuration property "+i.parent.Name).then(function(){e.targetBranch=i;C(b,i.Location,"HEAD",i.Name,!0)})})}}),q.RemoteLocation.length===1&&q.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:k,dialog:d,location:q.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=q.RemoteLocation[0].Children[0];C(b,q.RemoteLocation[0].Children[0].Location,"HEAD",q.Location,!0)}})),d.show())})})})}},
visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});c.addCommand(q);q=new i.Command({name:g["Force Push Branch"],tooltip:g["Push commits without tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForceBranch",callback:function(e){var h=e.confirmedWarnings,n=e.targetBranch;if(!h)if(confirm(g["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+g["Are you sure?"]))h=e.confirmedWarnings=!0;else return;var i,q=e.items;if(q.toRef)q=q.toRef;var y=q.CloneLocation.split("/"),z=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var k=a.getService("orion.git.provider"),o=a.getService("orion.page.progress"),C=function(b,d,c,h,n){var i=a.getService("orion.page.message"),b=o.progress(k.doPush(d,c,!1,n,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);i.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){z(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(q)},function(a){z(a,e)})})};o.progress(k.getGitClone(q.CloneLocation),"Getting git repository details "+q.Name).then(function(b){var d=b.Children[0].RemoteLocation,c=b.Children[0].ConfigLocation;p.gatherSshCredentials(a,e).then(function(b){var f=
new j;if(q.RemoteLocation.length===1&&q.RemoteLocation[0].Children.length===1)f=o.progress(k.getGitRemote(d),"Getting remote details "+q.Name);else{var h={};h.Children=q.RemoteLocation;f.resolve(h)}f.then(function(d){n?C(b,n.Location,"HEAD",n.Name,!0):(d=new m.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:k,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,f){i=a===null?f:a;var h="/gitapi/config/branch."+q.Name+".remote/clone/file/"+y[4];o.progress(k.addCloneConfigurationProperty(c,
"branch."+q.Name+".remote",i.parent.Name),"Setting git configuration property "+q.Name).then(function(){e.targetBranch=i;C(b,i.Location,"HEAD",i.Name,!0)},function(a){a.status===409&&o.progres(k.editCloneConfigurationProperty(h,i.parent.Name),"Setting git configuration property "+i.parent.Name).then(function(){e.targetBranch=i;C(b,i.Location,"HEAD",i.Name,!0)})})}}),q.RemoteLocation.length===1&&q.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,
gitClient:k,dialog:d,location:q.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=q.RemoteLocation[0].Children[0];C(b,q.RemoteLocation[0].Children[0].Location,"HEAD",q.Location,!0)}})),d.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});c.addCommand(q);q=new i.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl(t.expand({resource:a.items.PreviousLocation}))},
visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});c.addCommand(q);q=new i.Command({name:g["Next Page >"],tooltip:g["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl(t.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==
void 0:!1}});c.addCommand(q);q=new i.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl(C.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});c.addCommand(q);q=new i.Command({name:g["Next Page >"],tooltip:g["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl(C.expand({resource:a.items.NextLocation}))},
visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});c.addCommand(q);q=new i.Command({name:g.Reset,tooltip:g["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(b){var d=b.items;if(confirm(e.formatMessage(g.GitResetIndexConfirm,d.Name))){var b=a.getService("orion.git.provider"),c=a.getService("orion.page.message"),
b=a.getService("orion.page.progress").progress(b.resetIndex(d.IndexLocation,d.Name),"Resetting git index for "+d.Name);c.createProgressMonitor(b,g["Resetting index..."]);b.then(function(){f.changedItem(d);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"}});c.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("name",
"text",g["Name:"])]);q=new i.Command({name:g.Tag,tooltip:g["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:q,callback:function(b){var d=b.items,c=function(b,c){a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doAddTag(b,c),"Adding tag "+c).then(function(){f.changedItem(d)},n)},e=d.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&c(e,b.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(q);q=new i.Command({name:g.Delete,tooltip:g["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(b){var d=b.items;confirm(e.formatMessage(g["Are you sure you want to delete tag ${0}?"],d.Name))&&a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRemoveTag(d.Location),"Removing tag "+d.Name).then(function(){f.changedItem(d.parent)},n)},visibleWhen:function(a){return a.Type===
"Tag"}});c.addCommand(q);q=new b.ParametersDescription([new b.CommandParameter("reviewer","text",g["Reviewer name"])],{hasOptionalParameters:!0});q=new i.Command({name:g["Ask for review"],tooltip:g["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:q,callback:function(b){var d=a.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=b.items,h=f.Location.replace(f.Name,"HEAD"),i=f.AuthorName,p=f.Name,g=f.Message;d.progress(a.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(b){window.location.href.split("#");var q=x.getOrionHome(),b=c(b.Children[0].GitUrl),q=q+"/git/reviewRequest.html#"+b+"_"+f.Name;d.progress(a.getService("orion.git.provider").sendCommitReviewRequest(p,h,e,q,i,g),"Sending review request for "+p).then(function(b){var d=
{Severity:"Ok",HTML:!1};d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d)},n)})};if(b.parameters.valueFor("reviewer")&&!b.parameters.optionsRequested)e(b.parameters.valueFor("reviewer"));else{var f=b.items;d.progress(a.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting git details "+f.Name).then(function(a){window.location.href.split("#");var b=x.getOrionHome(),a=c(a.Children[0].GitUrl);(new o.ReviewRequestDialog({title:g["Contribution Review Request"],
url:b+"/git/reviewRequest.html#"+a+"_"+f.Name,func:e})).show()},n)}},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(q);q=new i.Command({name:g["Cherry-Pick"],tooltip:g["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(b){var d=b.items,b=a.getService("orion.page.progress"),c=a.getService("orion.git.provider"),f=d.Location.replace(d.Name,"HEAD");b.progress(c.doCherryPick(f,
d.Name),"Cherry picking "+d.Name).then(function(b){var c=[],f=d.Location.replace("commit/"+d.Name,"status");if(b.Result==="OK")c.Severity="Ok",b.HeadUpdated?(c.HTML=!1,c.Message=b.Result):(c.HTML=!0,c.Message="<span>"+g["Nothing changed."]+"</span>");else if(b.Result==="CONFLICTING")c.Severity="Warning",c.HTML=!0,f=e.formatMessage(g[". Go to ${0}."],'<a href="'+y(f)+'">'+g["Git Status page"]+"</a>")+"</span>",c.Message="<span>"+b.Result+g[". Some conflicts occurred"]+f;else if(b.Result==="FAILED"){c.Severity=
"Error";c.HTML=!0;c.Message="<span>"+b.Result;if(b.FailingPaths){var h="",n=!0,i;for(i in b.FailingPaths)n||(h+=", "),n=!1,h+=i;n||(c.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],h))}c.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+y(f)+'">'+g["Git Status page"]+"</a>")+"</span>"}else c.Severity="Warning",c.HTML=!1,c.Message=b.Result;a.getService("orion.page.message").setProgressResult(c)},n)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(q);q=new i.Command({name:g.Revert,
tooltip:g["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(b){var d=b.items,b=a.getService("orion.page.progress"),c=a.getService("orion.git.provider"),f=d.Location.replace(d.Name,"HEAD");b.progress(c.doRevert(f,d.Name),"Reverting "+d.Name).then(function(b){var c=[],f=d.Location.replace("commit/"+d.Name,"status");b.Result==="OK"?(c.Severity="Ok",c.HTML=!1,c.Message=b.Result):
b.Result==="FAILURE"?(f=e.formatMessage(g[". Go to ${0}."],'<a href="'+y(f)+'">'+g["Git Status page"]+"</a>")+"</span>",c.Severity="Warning",c.HTML=!0,c.Message="<span>"+b.Result+g[". Could not revert into active branch"]+f):(c.Severity="Warning",c.HTML=!1,c.Message=b.Result);a.getService("orion.page.message").setProgressResult(c)},n)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(q)};p.createGitClonesCommands=function(c,f,h,n,q,y){function l(a){var b={Severity:"Error",HTML:!1};
try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function m(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}n=new b.ParametersDescription([new b.CommandParameter("key","text",g["Key:"]),new b.CommandParameter("value","text",g["Value:"])]);n=new i.Command({name:g["New Configuration Entry"],
tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:n,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(d.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){h.changedItem(b)},
l)}});f.addCommand(n);n=new b.ParametersDescription([],null,function(a){var a=a.items,d;if(a)d=a.Value;return[new b.CommandParameter("value","text",g["Value:"],d)]});n=new i.Command({name:g.Edit,tooltip:g["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:n,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("value")&&e.progress(d.editCloneConfigurationProperty(b.Location,
a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){h.changedItem(b)},l)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(n);n=new i.Command({name:g.Delete,tooltip:g["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");confirm(e.formatMessage(g["Are you sure you want to delete ${0}?"],
b.Key))&&d.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){h.changedItem(b)},l)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(n);n=new b.ParametersDescription([new b.CommandParameter("url","url",g["Repository URL:"])],{hasOptionalParameters:!0});q=new i.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(b){var d=b.items,
e=c.getService("orion.git.provider"),f=c.getService("orion.page.progress"),n=function(b,n,i){d.GitUrl=b;p.getDefaultSshOptions(c,d).then(function(q){var l=arguments.callee,m=new a(c);c.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");m.getConfig().then(function(a){f.progress(e.cloneGitRepository(i,b,n,h.defaultPath,q.gitSshUsername,q.gitSshPassword,q.knownHosts,q.gitPrivateKey,q.gitPassphrase,a,!0),"Cloning repository "+i).then(function(a){p.handleProgressServiceResponse(a,
q,c,function(a){e.getGitClone(a.Location).then(function(a){var b="",c;for(c in d.projectDescription)b+=c+"="+d.projectDescription[c]+"\n";y.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=k.toUrl(D.expand({resource:a.Children[0].ContentLocation}));window.location=b})})},l,g["Clone Git Repository"])},function(a){p.handleProgressServiceResponse(a,q,c,function(){},l,g["Clone Git Repository"])})})})};d.url&&d.projectDescription.name&&(c.getService("orion.page.message").setProgressMessage("Looking for project "+
d.projectDescription.name),y.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var c=a.Children[b];if(c.Name===d.projectDescription.name){c.Git?e.getGitClone(c.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===d.url?window.location=k.toUrl(D.expand({resource:a.Children[0].ContentLocation})):console.info("Folder project is used")}):console.info("Folder project is used");return}}n(d.url,null,d.projectDescription.name)}))},visibleWhen:function(){return!0}});f.addCommand(q);
n=new i.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:n,callback:function(b){var d=b.items,e=c.getService("orion.git.provider"),f=c.getService("orion.page.progress"),n=function(b,n,i){d.GitUrl=b;p.getDefaultSshOptions(c,d).then(function(d){var q=arguments.callee;(new a(c)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(i,b,n,h.defaultPath,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,
d.gitPassphrase,a),"Cloning repository "+i);c.getService("orion.page.message").createProgressMonitor(a,g["Cloning repository: "]+b);a.then(function(a){p.handleProgressServiceResponse(a,d,c,function(){h.changedItem&&h.changedItem()},q,g["Clone Git Repository"])},function(a){p.handleProgressServiceResponse(a,d,c,function(){},q,g["Clone Git Repository"])})})})};b.parameters.valueFor("url")&&!b.parameters.optionsRequested?n(b.parameters.valueFor("url")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,
fileClient:y,url:b.parameters.valueFor("url"),alwaysShowAdvanced:b.parameters.optionsRequested,func:n})).show()},visibleWhen:function(){return!0}});f.addCommand(n);n=new i.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(b){var d=b.items,e=c.getService("orion.git.provider"),f=c.getService("orion.page.progress");(new s.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:y,url:b.userData,alwaysShowAdvanced:!1,
func:function(b,n,i){d.GitUrl=b;p.getDefaultSshOptions(c,d).then(function(d){var q=arguments.callee;(new a(c)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(i,b,n,h.defaultPath,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase,a),"Cloning git repository "+i);c.getService("orion.page.message").createProgressMonitor(a,g["Cloning repository: "]+b);a.then(function(a){p.handleProgressServiceResponse(a,d,c,function(){h.changedItem&&h.changedItem()},q,g["Clone Git Repository"])},
function(a){p.handleProgressServiceResponse(a,d,c,function(){},q,g["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});f.addCommand(n);n=new i.Command({name:g["Add Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(a){if(a.parameters&&a.parameters.valueFor("remoteName"))a.remoteName=a.parameters.valueFor("remoteName");var e=function(a,e){a.JsonData.HostKey?
(e.parameters=null,e.errorData=a.JsonData,f.collectParameters(e)):e.optionsRequested?(e.errorData=a.JsonData,f.collectParameters(e)):(new d(c)).isEnabled().then(function(d){e.parameters=d?a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword",
"password",g["Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["User Name:"]),new b.CommandParameter("sshpassword","password",g["Password:"])],{hasOptionalParameters:!0});e.errorData=a.JsonData;f.collectParameters(e)})};
if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,f.collectParameters(a);else{var n=function(b,d,f){var n=c.getService("orion.page.progress");n.progress(c.getService("orion.git.provider").addRemote(b,d,a.userData),"Adding git remote "+d).then(function(){p.gatherSshCredentials(c,a).then(function(b){c.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(i){for(var q,y=0;y<i.Children.length;y++)i.Children[y].Name===d&&(q=i.Children[y]);var m=
c.getService("orion.git.provider"),i=c.getService("orion.page.message"),y=n.progress(m.doFetch(q.Location,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),"Fetching remote "+d);i.createProgressMonitor(y,g["Fetching remote: "]+q.Location);y.then(function(b){p.handleGitServiceResponse(b,c,function(){n.progress(m.getGitRemote(q.Location),"Getting remote details "+d).then(function(){h.changedItem(f)},l)},function(b){e(b,a)})},function(b){p.handleGitServiceResponse(b,
c,function(){h.changedItem(f)},function(b){e(b,a)})})})})},l)};a.remoteName?n(a.items.RemoteLocation,a.remoteName,a.items):(a.parameters=new b.ParametersDescription([new b.CommandParameter("remoteName","text",g["Remote Name:"])],{hasOptionalParameters:!1}),f.collectParameters(a))}},visibleWhen:function(){return!0}});f.addCommand(n);n=new b.ParametersDescription([new b.CommandParameter("folderName","text",g["New folder:"])],{hasOptionalParameters:!0});n=new i.Command({name:g["Init Repository"],tooltip:g["Create a new Git repository in a new folder"],
id:"eclipse.initGitRepository",parameters:n,callback:function(b){var d=b.items,e=c.getService("orion.git.provider"),f=c.getService("orion.page.progress"),n=function(b,n,i){d.GitUrl=b;p.getDefaultSshOptions(c,d).then(function(d){var q=arguments.callee;(new a(c)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(i,b,n,h.defaultPath,null,null,null,null,null,a),g["Initializing repository: "]+i);c.getService("orion.page.message").createProgressMonitor(a,g["Initializing repository: "]+i);a.then(function(a){p.handleProgressServiceResponse(a,
d,c,function(){h.changedItem&&h.changedItem()},q,g["Init Git Repository"])},function(a){p.handleProgressServiceResponse(a,d,c,function(){},q,g["Init Git Repository"])})})})};b.parameters.valueFor("folderName")&&!b.parameters.optionsRequested?n(null,null,b.parameters.valueFor("folderName")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,title:g["Init Git Repository"],fileClient:y,advancedOnly:!0,func:n})).show()},visibleWhen:function(){return!0}});f.addCommand(n);n=new i.Command({name:g.Delete,
tooltip:g["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(e.formatMessage(g["Are you sure you want do delete ${0} repositories?"],b.length)))for(var f=0,n=0;n<b.length;n++)d.progress(a.removeGitRepository(b[n].Location),"Removing repository "+b.Name).then(function(){f++;f>=
b.length&&h.changedItem&&h.changedItem()},l)}else confirm(e.formatMessage(g["Are you sure you want to delete ${0}?"],b.Name))&&d.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){if(h.changedItem)window.location=k.toUrl(C.expand({})),h.changedItem()},l)}});f.addCommand(n);n=new i.Command({name:g["Apply Patch"],tooltip:g["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",
callback:function(a){var a=m(a.items),b=new j;(new w.ApplyPatchDialog({title:g["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var d=c.getService("orion.page.message");b.then(function(a){var b;try{var c=JSON.parse(a);if(c.JsonData&&c.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<c.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=c.JsonData.modifiedFieles[e],a=!1;c=[];c.Severity="Info";c.HTML=!1;c.Message=b;d.setProgressResult(c);return}}catch(f){}d.setMessage("Patch applied")},
function(a){var b=JSON.parse(a),a="Apply patch failed.";b.DetailedMessage?(a+=" ",a+=b.DetailedMessage):b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";b.HTML=!1;b.Message=a;d.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});f.addCommand(n);n=new b.ParametersDescription([new b.CommandParameter("commitName","text",g["Commit name:"])],{hasOptionalParameters:!0});n=new i.Command({name:g["Open Commit"],tooltip:g["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",
imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",parameters:n,callback:function(a){var b=c.getService("orion.page.progress"),d=function(e,f,n){n==null&&(n=new j);e.length>0?b.progress(c.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+e[0].ContentLocation+"?page=1&pageSize=1",null,null,g["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){n.resolve(a.Children[0].Location)},function(){d(e.slice(1),
f,n)}):n.reject();return n},e=function(b){a.parameters.optionsRequested?(new v.OpenCommitDialog({repositories:b,serviceRegistry:c,commitName:a.parameters.valueFor("commitName")})).show():(c.getService("orion.page.message").setProgressMessage(g["Looking for the commit"]),d(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl(A.expand({resource:a})),window.open(a));c.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";a.HTML=!1;a.Message=
g["No commits found"];c.getService("orion.page.message").setProgressResult(a)}))};if(a.items.Type==="Clone"){var f=[a.items];e(f)}else a.items.CloneLocation?b.progress(c.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){e(a.Children)}):(f=a.items,e(f))},visibleWhen:function(a){return a.Type==="Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});f.addCommand(n)};p.createGitStatusCommands=function(a,d,c){function e(b){var d=
{Severity:"Error",HTML:!1};try{var c=JSON.parse(b.responseText);d.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:g["Problem while performing the action"]}catch(f){d.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(d)}function n(a){Array.isArray(a)||(a=[a]);return a}function h(b,d){var f=a.getService("orion.page.message"),n=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,"",d),"Rebasing git repository");
f.createProgressMonitor(n,d);n.then(function(b){if(b.Result==="OK"||b.Result==="ABORTED"||b.Result==="FAST_FORWARD"||b.Result==="UP_TO_DATE"){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d);c.changedItem({})}if(b.Result==="STOPPED")d=[],d.Severity="Warning",d.HTML=!1,d.Message=b.Result+g[". Repository still contains conflicts."],a.getService("orion.page.message").setProgressResult(d),c.changedItem({});else if(b.Result==="FAILED_UNMERGED_PATHS")d=
[],d.Severity="Error",d.HTML=!1,d.Message=b.Result+g[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d)},e)}var p=new i.Command({name:g.Stage,tooltip:g["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var d=n(b.items),f=a.getService("orion.page.message"),h=a.getService("orion.page.progress");if(d.length===1)b=h.progress(a.getService("orion.git.provider").stage(d[0].indexURI),
g["Staging changes"]),f.createProgressMonitor(b,g["Staging changes"]);else{for(var i=[],p=0;p<d.length;p++)i[p]=d[p].name;b=h.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,i),g["Staging changes"]);f.createProgressMonitor(b,"Staging changes")}b.then(function(){c.changedItem(d)},e)},visibleWhen:function(a){a=n(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||f.isStaged(a[b]))return!1;return!0}});d.addCommand(p);p=new i.Command({name:g.Unstage,
tooltip:g["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(b){var d=n(b.items),f=a.getService("orion.page.message"),h=a.getService("orion.page.progress");if(d.length===1)b=h.progress(a.getService("orion.git.provider").unstage(d[0].indexURI,d[0].name),"Unstaging changes");else{for(var i=[],p=0;p<d.length;p++)i[p]=d[p].name;b=h.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,
i),"Unstaging changes")}f.createProgressMonitor(b,g["Staging changes"]);b.then(function(){c.changedItem(d)},e)},visibleWhen:function(a){a=n(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||!f.isStaged(a[b]))return!1;return!0}});d.addCommand(p);p=new b.CommandEventListener("change",function(b,d){var c=b.target,e=d.items.status,f=document.getElementById("nameparameterCollector");c.checked?(c=a.getService("orion.page.message"),e=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doGitLog(e.CommitLocation+
"?page=1&pageSize=1"),g["Fetching previous commit message"]),c.createProgressMonitor(e,g["Fetching previous commit message"],e.then(function(a){f.value=a.Children[0].Message}),function(){f.value=""})):f.value=""});p=new b.ParametersDescription([new b.CommandParameter("name","text",g["Commit message:"],"",4),new b.CommandParameter("amend","boolean",g["Amend:"],!1,null,p),new b.CommandParameter("changeId","boolean",g["ChangeId:"],!1)],{hasOptionalParameters:!0});p=new i.Command({name:g.Commit,tooltip:g.Commit,
id:"eclipse.orion.git.commitCommand",parameters:p,callback:function(b){var d=b.items.status,f=function(b){var f=a.getService("orion.page.message"),b=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").commitAll(d.Clone.HeadLocation,null,JSON.stringify(b)),g["Committing changes"]);f.createProgressMonitor(b,g["Committing changes"]);b.then(function(){c.changedItem(d)},e)},n=function(a,d){for(var c=0;c<d.length;c++)if(d[c].Key==="user.name")a.CommitterName=d[c].Value,a.AuthorName=
d[c].Value;else if(d[c].Key==="user.email")a.CommitterEmail=d[c].Value,a.AuthorEmail=d[c].Value;a.Message&&a.CommitterName&&a.CommitterEmail&&!b.parameters.optionsRequested?f(a):(new u.CommitDialog({body:a,func:f})).show()},h={};h.Message=b.parameters.valueFor("name");h.Amend=b.parameters.valueFor("amend");h.ChangeId=b.parameters.valueFor("changeId");var i=d.Clone.Config;if(h.Amend&&!h.Message){var p=a.getService("orion.page.message"),q=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doGitLog(d.CommitLocation+
"?page=1&pageSize=1"),g["Committing changes"]);p.createProgressMonitor(q,g["Committing changes"]);q.then(function(a){h.Message=a.Children[0].Message;n(h,i)},function(){n(h,i)})}else n(h,i)},visibleWhen:function(){return!0}});d.addCommand(p);p=new i.Command({name:g.Reset,tooltip:g["Reset the branch, discarding all staged and unstaged changes"],imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(b){var d=b.items;a.getService("orion.page.dialog").confirm(g["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+
"\n"+g["Are you sure you want to continue?"],function(b){if(b){var b=a.getService("orion.page.message"),f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(d.IndexLocation,"HARD"),g["Resetting local changes"]);b.createProgressMonitor(f,g["Resetting local changes"]);f.then(function(){c.changedItem(d)},e)}})},visibleWhen:function(a){return f.hasStagedChanges(a)||f.hasUnstagedChanges(a)}});d.addCommand(p);p=new i.Command({name:g.Checkout,tooltip:g["Checkout all the selected files, discarding all changes"],
imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var d=n(b.items);a.getService("orion.page.dialog").confirm(g["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+g["Are you sure you want to continue?"],function(f){if(f){for(var f=a.getService("orion.page.message"),n=a.getService("orion.page.progress"),h=[],i=0;i<d.length;i++)h[i]=d[i].name;n=n.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,
h),g["Resetting local changes"]);f.createProgressMonitor(n,g["Resetting local changes"]);n.then(function(){c.changedItem(d)},e)}})},visibleWhen:function(a){a=n(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||f.isStaged(a[b]))return!1;return!0}});d.addCommand(p);p=new i.Command({name:g["Show Patch"],tooltip:g["Show workspace changes as a patch"],id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var b=n(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",
d=0;d<b.length;d++)a+="&Path=",a+=b[d].name;return a},visibleWhen:function(a){a=n(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(f.isStaged(a[b]))return!1;return!0}});d.addCommand(p);p=new i.Command({name:g.Continue,tooltip:g["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(p);p=new i.Command({name:g["Skip Patch"],
tooltip:g["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(p);p=new i.Command({name:g.Abort,tooltip:g["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(p)}})();return p});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(g,k,j,e){var c={};c.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 d=new k.Command({name:g["Copy current change from right to left"],tooltip:g["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.getImageMode()&&b.options.newFile&&!b.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),a=new k.Command({name:g["Copy current change from left to right"],tooltip:g["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.getImageMode()&&b.options.oldFile&&!b.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),i=new k.Command({tooltip:g["Switch to unified diff"],name:g.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()}}),
m=new k.Command({tooltip:g["Switch to side by side diff"],name:g["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()}}),o=new k.Command({name:g["Next diff block"],tooltip:g["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},
callback:function(a){a.items.nextDiff()}}),s=new k.Command({name:g["Previous diff block"],tooltip:g["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},callback:function(a){a.items.prevDiff()}}),r=new k.Command({name:g["Next diff change"],tooltip:g["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},
callback:function(a){a.items.nextChange()}}),v=new k.Command({name:g["Previous diff change"],tooltip:g["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},callback:function(a){a.items.prevChange(a)}});e.addCommand(d);e.addCommand(a);e.addCommand(m);e.addCommand(i);e.addCommand(o);e.addCommand(s);e.addCommand(r);e.addCommand(v);e.registerCommandContribution(c,"orion.compare.toggle2Inline",
108);e.registerCommandContribution(c,"orion.compare.toggle2TwoWay",109);e.registerCommandContribution(c,"orion.compare.copyToLeft",110,null,!1,new j.KeyBinding(37,!0,!1,!0));e.registerCommandContribution(c,"orion.compare.copyToRight",111,null,!1,new j.KeyBinding(39,!0,!1,!0));e.registerCommandContribution(c,"orion.compare.nextDiff",112,null,!1,new j.KeyBinding(40,!0));e.registerCommandContribution(c,"orion.compare.prevDiff",113,null,!1,new j.KeyBinding(38,!0));b.options.wordLevelNav?(e.registerCommandContribution(c,
"orion.compare.nextChange",114,null,!1,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!1,new j.KeyBinding(38,!0,!0))):(e.registerCommandContribution(c,"orion.compare.nextChange",114,null,!0,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!0,new j.KeyBinding(38,!0,!0)))}},renderCommands:function(b){var c=this.options.commandSpanId,h=this.options.commandService;h&&c&&(e.empty(e.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),h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):(h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):h.renderCommands(c,c,b,b,"tool",null))}};return c}();return c});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(g,k){function j(c,e,b){var f=new k;c[e].apply(c,b).then(function(b){f.resolve(b)},function(b){f.reject(b)});return f}function e(c,e){var b=c.getServiceReferences("orion.core.diff"),f,h=b;if(e){h=[];for(f=0;f<b.length;++f)e(b[f])&&h.push(b[f])}var d=[],a=[];for(f=0;f<h.length;++f)d[f]=RegExp(h[f].getProperty("pattern")||".*"),a[f]=c.getService(h[f]);this._getService=function(b){if(b.indexOf("://")===-1){var c=
document.createElement("a");c.href=b;b=c.href}for(c=0;c<d.length;++c)if(d[c].test(b))return a[c];throw g["No Matching DiffService for location:"]+b;}}e.prototype={getDiffContent:function(c){return j(this._getService(c),"getDiffContent",arguments)},getDiffFileURI:function(c){return j(this._getService(c),"getDiffFileURI",arguments)}};return{DiffProvider:e}});
define("orion/compare/diffParser",[],function(){var g=g||{};g.DiffParser=function(){function g(e,c){this._lineDelimiter=e?e:j?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=!1}var j=window.navigator.platform.indexOf("Win")!==-1;g.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(e){this._diffLineDelimiter=this._lineDelimiter=e},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(e,c,i,b){this._init();if(c==="")return{outPutFile:e,mapper:[]};this._oFileContents=e===""?[]:e.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var f=0;f<c;f++){var h=this._parseHunkRange(f);h&&this._hunkRanges.push(h)}if(0===this._hunkRanges.length)return{outPutFile:e,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(b){console.log(b)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(e=0;e<this._hunkRanges.length;e++)this._parseHunkBlock(e);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(i);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));b||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var e=0;e<this._deltaMap.length;e++)if(console.log(JSON.stringify(this._deltaMap[e])),
this._deltaMap[e][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[e][0];c++)console.log("    "+this._diffContents[this._deltaMap[e][2]+c-1])}},_logNewFile:function(){for(var e=0;e<this._nFileContents.length;e++)console.log(this._nFileContents[e])},_createBlock:function(e,c,i,b){b===i&&e===" "||(i=[i,b-i,"s"],e==="-"?i[2]="r":e==="+"?i[2]="a":e==="c"&&(i[2]="c"),c.push(i))},_createMinusBlock:function(e,c,i){var b=this._oBlocks.length;b===0||e!==this._oBlocks[b-
1][0]?(this._oBlocks.push([e===0?1:e,i]),this._nBlocks.push([c,0,-2])):this._oBlocks[b-1][1]+=i},_createPlusBlock:function(e,c,i,b){var f=this._nBlocks.length;f===0||c!==this._nBlocks[f-1][0]?(this._oBlocks.push([e===0?1:e,0]),this._nBlocks.push([c,i,b])):(this._nBlocks[f-1][1]+=i,this._nBlocks[f-1][2]=b)},_parseHunkBlock:function(e){for(var c=" ",i=this._hunkRanges[e][0]+1,b=e===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[e+1][0],f=0,h=0,d=this._hunkRanges[e][1],a=this._hunkRanges[e][3],
g=i,m=i;m<b;m++)if(0!==this._diffContents[m].length){var j=this._diffContents[m][0];if(j==="\\"&&("\\ No newline at end of file"===this._diffContents[m].substring(0,this._diffContents[m].length-1)||"\\ No newline at end of file"===this._diffContents[m]))c==="-"?this._oNewLineAtEnd=!1:c===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,m>i&&this._diffContents[m-1][this._diffContents[m-1].length-1]==="\r"&&(this._diffContents[m-1]=this._diffContents[m-1].substring(0,this._diffContents[m-
1].length-1));else{switch(j){case "-":case "+":case " ":break;default:continue}if(c!==j){j==="+"&&(g=m);switch(c){case " ":d=this._hunkRanges[e][1]+f;a=this._hunkRanges[e][3]+h;break;case "-":this._createMinusBlock(d,a,this._hunkRanges[e][1]+f-d);break;case "+":this._createPlusBlock(d,a,this._hunkRanges[e][3]+h-a,g)}c=j}switch(j){case "-":f++;break;case "+":h++;break;case " ":f++,h++}}}switch(c){case "-":this._createMinusBlock(d,a,this._hunkRanges[e][1]+f-d);break;case "+":this._createPlusBlock(d,
a,this._hunkRanges[e][3]+h-a,g)}},_detectConflictes:function(e,c){if(e<0)return!1;for(var i=e+c,b=e;b<i;b++){var f=this._diffContents[b];if(f.indexOf("<<<<<")>-1||f.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){var c=this._oBlocks.length,i=this._oFileContents.length,b=0,f;f=1;for(var h=0;h<c;h++)f=this._oBlocks[h][0]-f,f>0&&(this._deltaMap.push([f,f,0]),b+=f),e&&this._detectConflictes(this._nBlocks[h][2],this._nBlocks[h][1])?this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],
this._nBlocks[h][2]+1,1]):this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],this._nBlocks[h][2]+1]),b+=this._oBlocks[h][1],f=this._oBlocks[h][0]+this._oBlocks[h][1];0<i-f&&(this._deltaMap.push([i-f+1,i-f+1,0]),b+=i-f+1);b<i&&(f=i-b,e=this._deltaMap[this._deltaMap.length-1],e[2]===0?(e[0]+=f,e[1]+=f):e[2]===-1?this._deltaMap.push([f,f,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([f,f,0]):(this._nNewLineAtEnd&&(e[0]+=f),this._oNewLineAtEnd&&(e[1]+=f)))},_buildNewFile:function(){var e=
1,c=!1,i=this._deltaMap.length,b,f;for(b=0;b<i;b++){c=!1;if(this._deltaMap[b][2]===0){for(f=0;f<this._deltaMap[b][0];f++)this._nFileContents.push(this._oFileContents[e+f-1]);c=!0}else if(this._deltaMap[b][2]>0)for(f=0;f<this._deltaMap[b][0];f++)this._nFileContents.push(this._diffContents[this._deltaMap[b][2]+f-1].substring(1));e+=this._deltaMap[b][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},_converHRangeBody:function(e,c){if(e){var i=parseInt(e,10);c.push(i>=0?i:1)}else c.push(1)},_parseHunkRange:function(e){var c=
this._diffContents[e],i=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,b=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(c),f=null;if(b&&b.length===5)f=[e],this._converHRangeBody(b[1],f),this._converHRangeBody(b[2],f),this._converHRangeBody(b[3],f),this._converHRangeBody(b[4],f);else if((b=i.exec(c))&&b.length===5)f=[e],this._converHRangeBody(b[3],f),this._converHRangeBody(b[4],f),this._converHRangeBody(b[1],f),this._converHRangeBody(b[2],
f);return f}};return g}();return g});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(g){var k=k||{};k.CompareRuler=function(){function g(e,c,i){this._location=e||"left";this._overview=c||"page";this._rulerStyle=i;this._editor=null;var b=this;this._listener={onModelChanged:function(c){b._onModelChanged(c)}}}g.prototype={setView:function(e){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=e;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(e,c){for(var i=[],b=e;b<c;b++){var f=this.getStyle(b);f&&(i[b]={html:this.getHTML(b),style:f})}return i},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return g}();k.LineNumberCompareRuler=function(){function g(e,c,i,b,f,h){k.CompareRuler.call(this,i,"page",b);this._diffNavigator=e;this._oddStyle=f||{style:{backgroundColor:"white"}};this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(e){return e===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(e){var c=this._editor.getModel(),
i=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!i?"":e===-1?c.getLineCount():i.getLineNumber?(e=i.getLineNumber(e),e===-1?"":e+1):e+1};g.prototype._onModelChanged=function(e){var e=e.start,c=this._editor.getModel(),i=c.getLineCount(),b=(i+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._editor.redrawLines(c.getLineAtOffset(e),i,this)};return g}();k.CompareOverviewRuler=function(){function j(e,c,i,b){this._diffNavigator=i;this._onClick=b;k.CompareRuler.call(this,e,
"document",c)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(e){var c,i;if(e===void 0)c=this._rulerStyle||{},i=c.style||(c.style={}),i.lineHeight="1px",i.fontSize="1px",i.width="14px";else if(c=e!==-1?{styleClass:"annotationOverview breakpoint"}:{},i=c.style||(c.style={}),i.cursor="pointer",i.width="8px",i.left="2px",e>=0){var b;if(this._diffNavigator&&this._diffNavigator.getFeeder())b=this._diffNavigator.getFeeder().getDiffBlocks();else return null;e=g.getAnnotationIndex(b,e);if(e===
-1)return null;b=g.getAnnotationMapperIndex(b,e);var f;f=this._diffNavigator.getMapper();if(b=g.isMapperConflict(f,b))i.border="1px #FF0000 solid";if(e===this._diffNavigator.getCurrentBlockIndex())i.backgroundColor=b?"red":"blue";e=this._diffNavigator.getFeeder().getDiffBlockH(e);b=this._diffNavigator.getFeeder().getOverviewLineCount();if(e<0)return null;f=this._editor.getClientArea();e=Math.floor(f.height*e/b);e<2&&(e=2);i.height=e+"px"}else return null;return c};j.prototype.setDiffNavigator=function(e){this._diffNavigator=
e};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(e){e!==void 0&&this._onClick(e,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(e){this._canvasDiv=e;this._mapper=void 0}j.prototype={init:function(e,c,i,b){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=e;this._leftEditor=c;this._rightEditor=i;this._leftTextView=c.getTextView();
this._rightTextView=i.getTextView();this._diffNavigator=b;this.render()},matchPositionFrom:function(e){var c=e?this._leftTextView:this._rightTextView,i=e?this._rightTextView:this._leftTextView,b=c.getTopIndex(),c=c.getBottomIndex(),e=g.matchMapper(this._mapper,e?0:1,b,c);i.setTopIndex(e)},copyTo:function(e){if(this._diffNavigator.iterator){var c=this._diffNavigator.iterator.cursor();if(c&&(c.type==="word"?!c.copied&&!c.parent.copied:!c.copied)){var i=e?this._rightTextView.getText(c.oldA.start,c.oldA.end):
this._leftTextView.getText(c.newA.start,c.newA.end),b=e?c.newA:c.oldA;(e?this._leftTextView:this._rightTextView).setText(i,b.start,b.end);c.copied=!0}}},render:function(){if(this._mapper){var e=this._canvasDiv.getContext("2d");e.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);e.strokeStyle="#AAAAAA";e.lineWidth=1;e.beginPath();var c=this._leftTextView.getTopIndex(),i=this._leftTextView.getBottomIndex(),b=this._rightTextView.getTopIndex(),f=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var h=0,d=0,a=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(g.overlapMapper(this._mapper[l],0,h,c,i)||g.overlapMapper(this._mapper[l],1,d,b,f))this._renderCurve(l,h,d,this._canvasDiv,e,c,i,b,f),a=!0;else if(a)break;h+=this._mapper[l][0];d+=this._mapper[l][1]}e.stroke()}},_renderCurve:function(e,c,i,b,f){var h=this._mapper[e],c=this._leftTextView.getLinePixel(c+h[0]/2)+h[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),i=this._rightTextView.getLinePixel(i+h[1]/2)+h[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),b=b.parentNode.clientWidth;e===this._diffNavigator.getCurrentMapperIndex()?(f.stroke(),f.strokeStyle="#000",f.lineWidth=1,f.beginPath(),f.moveTo(0,c),f.bezierCurveTo(b/3,c,b*0.666,i,b,i),f.stroke(),f.strokeStyle="#AAAAAA",f.lineWidth=1,f.beginPath()):(f.moveTo(0,c),f.bezierCurveTo(b/3,c,b*0.666,i,b,i),f.stroke())},onChanged:function(e,c){var i=c?this._rightIniting:
this._leftIniting;if(e.removedLineCount!==e.addedLineCount){var b=c?this._rightTextView:this._leftTextView;i||g.updateMapper(this._mapper,c?1:0,b.getModel().getLineAtOffset(e.start),e.removedLineCount,e.addedLineCount);(e.removedLineCount>0||e.addedLineCount>0)&&this.render()}c?this._rightIniting=!1:this._leftIniting=!1;return i}};return j}();return k});define("orion/editor/i18n",{load:function(g,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+g],function(e){j(e)}):j({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",
setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",
findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",
collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",
viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});
define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,k){var j={root:k},e;for(e in g)g.hasOwnProperty(e)&&typeof j[e]==="undefined"&&(j[e]=g[e]);return j});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(g,k,j){function e(c,e){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(c);this.setLineDelimiter(e)}e.prototype={destroy:function(){},find:function(c){if(this._text.length>1)this._text=[this._text.join("")];var e=c.string,b=c.regex,f=e,h="",d=c.caseInsensitive;if(f)if(b){if(e=k.parse(f))f=e.pattern,h=e.flags}else f=e.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),d&&(f=f.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var a=null,g;if(f){var e=c.reverse,m=c.wrap,b=c.wholeWord,j=c.start||0,c=c.end,s=c!==null&&c!==void 0;h.indexOf("g")===-1&&(h+="g");h.indexOf("m")===-1&&(h+="m");d&&h.indexOf("i")===-1&&(h+="i");b&&(f="\\b"+f+"\\b");var r=this._text[0],v,u,w=0;s&&(d=j<c?j:c,r=r.substring(d,j<c?c:j),w=d);var t=RegExp(f,h);if(e)g=function(){var a=null;for(t.lastIndex=0;;){u=t.lastIndex;v=t.exec(r);if(u===t.lastIndex)return null;if(v){if(!(v.index+w<j)){if(!m||a)break;j=r.length+w}a={start:v.index+
w,end:t.lastIndex+w}}else break}if(a)j=a.start;return a};else{if(!s)t.lastIndex=j;g=function(){for(;;){u=t.lastIndex;v=t.exec(r);if(u===t.lastIndex)break;if(v)return{start:v.index+w,end:t.lastIndex+w};if(!(u!==0&&m))break}return null}}a=g()}return{next:function(){var b=a;b&&(a=g());return b},hasNext:function(){return a!==null}}},getCharCount:function(){for(var c=0,e=0;e<this._text.length;e++)c+=this._text[e].length;return c},getLine:function(c,e){var b=this.getLineCount();if(!(0<=c&&c<b))return null;
var f=this._lineOffsets[c];if(c+1<b){b=this.getText(f,this._lineOffsets[c+1]);if(e)return b;for(var f=b.length,h;(h=b.charCodeAt(f-1))===10||h===13;)f--;return b.substring(0,f)}else return this.getText(f)},getLineAtOffset:function(c){var e=this.getCharCount();if(!(0<=c&&c<=e))return-1;var b=this.getLineCount();if(c===e)return b-1;var f,h,d=this._lastLineIndex;if(0<=d&&d<b&&(f=this._lineOffsets[d],h=d+1<b?this._lineOffsets[d+1]:e,f<=c&&c<h))return d;for(var a=b,g=-1;a-g>1;)if(d=Math.floor((a+g)/2),
f=this._lineOffsets[d],h=d+1<b?this._lineOffsets[d+1]:e,c<=f)a=d;else if(c<h){a=d;break}else g=d;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(c,e){var b=this.getLineCount();if(!(0<=c&&c<b))return-1;if(c+1<b){b=this._lineOffsets[c+1];if(e)return b;for(var f=this.getText(Math.max(this._lineOffsets[c],b-2),b),h=f.length,d;(d=f.charCodeAt(h-1))===10||d===13;)h--;return b-(f.length-h)}else return this.getCharCount()},
getLineStart:function(c){return!(0<=c&&c<this.getLineCount())?-1:this._lineOffsets[c]},getText:function(c,e){c===void 0&&(c=0);e===void 0&&(e=this.getCharCount());if(c===e)return"";for(var b=0,f=0,h;f<this._text.length;){h=this._text[f].length;if(c<=b+h)break;b+=h;f++}for(var d=b,a=f;f<this._text.length;){h=this._text[f].length;if(e<=b+h)break;b+=h;f++}if(a===f)return this._text[a].substring(c-d,e-b);d=this._text[a].substring(c-d);b=this._text[f].substring(0,e-b);return d+this._text.slice(a+1,f).join("")+
b},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){return this.dispatchEvent(c)},setLineDelimiter:function(c,e){c==="auto"&&(c=void 0,this.getLineCount()>1&&(c=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=c?c:j.platformDelimiter;if(e){var b=this.getLineCount();if(b>1){for(var f=Array(b),h=0;h<b;h++)f[h]=this.getLine(h);this.setText(f.join(this._lineDelimiter))}}},setText:function(c,e,b){c===void 0&&(c="");e===void 0&&(e=0);b===void 0&&(b=
this.getCharCount());if(!(e===b&&c==="")){for(var f=this.getLineAtOffset(e),h=this.getLineAtOffset(b),d=e,a=b-e,g=h-f,m=c.length,j=0,k=this.getLineCount(),r=0,v=0,u=0,w=[];;){r!==-1&&r<=u&&(r=c.indexOf("\r",u));v!==-1&&v<=u&&(v=c.indexOf("\n",u));if(v===-1&&r===-1)break;u=r!==-1&&v!==-1?r+1===v?v+1:(r<v?r:v)+1:r!==-1?r+1:v+1;w.push(e+u);j++}this.onChanging({type:"Changing",text:c,start:d,removedCharCount:a,addedCharCount:m,removedLineCount:g,addedLineCount:j});w.length===0&&(u=this.getLineStart(f),
h=h+1<k?this.getLineStart(h+1):this.getCharCount(),e!==u&&(c=this.getText(u,e)+c,e=u),b!==h&&(c+=this.getText(b,h),b=h));u=m-a;for(h=f+g+1;h<k;h++)this._lineOffsets[h]+=u;if(w.length<5E4)f=[f+1,g].concat(w),Array.prototype.splice.apply(this._lineOffsets,f);else{u=f+1;this._lineOffsets.splice(u,g);for(k=0;k<w.length;k+=5E4)f=[u,0].concat(w.slice(k,Math.min(w.length,k+5E4))),Array.prototype.splice.apply(this._lineOffsets,f),u+=5E4}for(u=k=0;u<this._text.length;){h=this._text[u].length;if(e<=k+h)break;
k+=h;u++}f=k;for(w=u;u<this._text.length;){h=this._text[u].length;if(b<=k+h)break;k+=h;u++}h=this._text[u];e=this._text[w].substring(0,e-f);b=h.substring(b-k);w=[w,u-w+1];e&&w.push(e);c&&w.push(c);b&&w.push(b);Array.prototype.splice.apply(this._text,w);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:d,removedCharCount:a,addedCharCount:m,removedLineCount:g,addedLineCount:j})}}};g.EventTarget.addMixin(e.prototype);return{TextModel:e}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,k){function j(c){if(c)this._view=c,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function e(c){j.call(this,c)}j.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(c){for(var e=[],b=this._keyBindings,f=0;f<b.length;f++)b[f].actionID===c&&e.push(b[f].keyBinding);return e},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){if(c.type==="keydown")switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var e=this._keyBindingIndex,b=this._matchingKeyBindings||this._keyBindings,f=[],h=0;h<b.length;h++){var d=b[h],a=d.keyBinding.match(c,e);if(a===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,d.actionID;else typeof a==="number"&&f.push(d)}if(f.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=f,"noop"},setKeyBinding:function(c,
e){for(var b=this._keyBindings,f=0;f<b.length;f++){var h=b[f];if(h.keyBinding.equals(c)){e?h.actionID=e:h.predefined?h.actionID="noop":b.splice(f,1);return}}e&&b.push({keyBinding:c,actionID:e})},setView:function(c){this._view=c}};e.prototype=new j;e.prototype.createKeyBindings=function(){var c=g.KeyBinding,e=[];e.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});e.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});e.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
e.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(e.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),e.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),e.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
e.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),e.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),e.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),e.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),e.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(e.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),e.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),e.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),e.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(e.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(e.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),e.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));e.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});e.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});e.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});e.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});e.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});e.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(e.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),e.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
e.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(e.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),e.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),e.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));e.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});k.isMac?e.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):e.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
e.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});e.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});e.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});e.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});e.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
e.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});e.push({actionID:"enter",keyBinding:new c(13),predefined:!0});e.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});e.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});e.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(e.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),e.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));e.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});e.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!k.isFirefox){var b=k.isMac&&k.isChrome;e.push({actionID:"noop",keyBinding:new c("u",!b,!1,!1,b),predefined:!0});e.push({actionID:"noop",keyBinding:new c("i",!b,!1,!1,b),predefined:!0});e.push({actionID:"noop",keyBinding:new c("b",!b,!1,!1,b),predefined:!0})}k.isFirefox&&
(e.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),e.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),e.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(e.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),e.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(e.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(e.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return e};return{KeyMode:j,DefaultKeyMode:e}});
define("orion/editor/util",[],function(){return{contains:function(g,k){if(!k)return!1;if(!g.compareDocumentPosition){for(var j=k;j;){if(g===j)return!0;j=j.parentNode}return!1}return g===k||(g.compareDocumentPosition(k)&16)!==0},addEventListener:function(g,k,j,e){typeof g.addEventListener==="function"?g.addEventListener(k,j,e===!0):g.attachEvent("on"+k,j)},removeEventListener:function(g,k,j,e){typeof g.removeEventListener==="function"?g.removeEventListener(k,j,e===!0):g.detachEvent("on"+k,j)}}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/editor/util,orion/util".split(","),function(g,k,j,e,c,i,b){function f(a,d,c){if(c){d.className="";for(var c=d.attributes,e=c.length;e-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&c[e].specified)&&d.removeAttribute(c[e].name)}if(a){if(a.styleClass)d.className=a.styleClass;if(c=a.style)for(var f in c)c.hasOwnProperty(f)&&(d.style[f]=c[f]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&
d.setAttribute(h,a[h])}}function h(a){return a instanceof Array?a.slice(0):a}function d(a,b){if(!a)return b;if(!b)return a;for(var d in b)b.hasOwnProperty(d)&&(a.hasOwnProperty(d)||(a[d]=b[d]));return a}function a(b,d){if(b===d)return!0;if(b&&!d||!b&&d)return!1;if(b&&b.constructor===String||d&&d.constructor===String)return!1;if(b instanceof Array||d instanceof Array){if(!(b instanceof Array&&d instanceof Array))return!1;if(b.length!==d.length)return!1;for(var c=0;c<b.length;c++)if(!a(b[c],d[c]))return!1;
return!0}if(!(b instanceof Object)||!(d instanceof Object))return!1;for(c in b)if(b.hasOwnProperty(c)){if(!d.hasOwnProperty(c))return!1;if(!a(b[c],d[c]))return!1}for(c in d)if(!b.hasOwnProperty(c))return!1;return!0}function l(a,b,d){for(var c=0,e=0,f=0,h=a.length;f<h;){c!==-1&&c<=f&&(c=a.indexOf("\r",f));e!==-1&&e<=f&&(e=a.indexOf("\n",f));var i=f,g;if(e===-1&&c===-1){b(a.substring(f));break}c!==-1&&e!==-1?c+1===e?(g=c,f=e+1):(g=c<e?c:e,f=(c<e?c:e)+1):c!==-1?(g=c,f=c+1):(g=e,f=e+1);b(a.substring(i,
g));d()}}function m(a){var b,d,c,e,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),d=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,d=a.currentStyle.paddingTop,c=a.currentStyle.paddingRight,e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(d,10)||0,right:parseInt(c,
10)||0,bottom:parseInt(e,10)||0}}function o(a){var b,d,c,e,f=a._trim;if(!f){var f=m(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)e=h.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),d=e.getPropertyValue("border-top-width"),c=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,d=a.currentStyle.borderTopWidth,c=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;
b=parseInt(b,10)||0;d=parseInt(d,10)||0;c=parseInt(c,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=d;f.right+=c;f.bottom+=e;a._trim=f}return f}function s(a,b,d){this.start=a;this.end=b;this.caret=d}function r(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function v(a,b,d){this.view=a;this.lineIndex=b;this._lineDiv=d}function u(a){this._init(a||{})}var w=i.addEventListener,t=i.removeEventListener,x=function(){function a(b){this.options=b}a.prototype.play=function(){var a=
typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,d=this.options.onAnimate||function(){},c=this.options.curve[0],e=this.options.curve[1],f=e-c,h=-1,n,i=this;this.interval=this.options.window.setInterval(function(){h=h===-1?(new Date).getTime():h;var g=((new Date).getTime()-h)/a;g<1?(g=b(g),n=c+g*f,d(n)):(d(e),i.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();s.prototype={clone:function(){return new s(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;if(this.start>this.end)a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};r.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};v.prototype={create:function(a,b){if(!this._lineDiv){var d=this._lineDiv=this._createLine(a,b,this.lineIndex);d._line=
this;return d}},_createLine:function(d,c,e){var h=this.view,i=h._model,g=i.getLine(e),l=i.getLineStart(e),m={type:"LineStyle",textView:h,lineIndex:e,lineText:g,lineStart:l};if(g.length<2E3)h.onLineStyle(m);i=c||b.createElement(d.ownerDocument,"div");if(!c||!a(c.viewStyle,m.style)){f(m.style,i,c);if(c)c._trim=null;i.viewStyle=m.style;i.setAttribute("role","presentation")}i.lineIndex=e;e=[];this._createRanges(m.ranges,g,0,g.length,l,{tabOffset:0,ranges:e});g=" ";!h._fullSelection&&b.isIE<9&&(g="\ufeff");
m={text:g,style:h._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 j,k,o,t,s,g=h=0,r,v;if(c){if(k=c.modelChangedEvent)k.removedLineCount===0&&k.addedLineCount===0?(v=k.start-l,r=k.addedCharCount-k.removedCharCount):v=-1,c.modelChangedEvent=void 0;k=c.firstChild}for(l=0;l<e.length;l++){m=e[l];t=m.text;h+=t.length;j=m.style;if(k)if(s=k.firstChild.data,o=k.viewStyle,s===t&&a(j,o)){g+=s.length;k._rectsCache=
void 0;j=k=k.nextSibling;continue}else for(;k;){if(v!==-1){o=h;o>=v&&(o-=r);s=(s=k.firstChild.data)?s.length:0;if(g+s>o)break;g+=s}o=k.nextSibling;i.removeChild(k);k=o}j=this._createSpan(i,t,j,m.ignoreChars);k?i.insertBefore(j,k):i.appendChild(j);if(c)c.lineWidth=void 0}if(c)for(d=j?j.nextSibling:null;d;)o=d.nextSibling,c.removeChild(d),d=o;else d.appendChild(i);return i},_createRanges:function(b,d,c,e,f,h){if(!(c>e)){if(b)for(var i=0;i<b.length;i++){var g=b[i];if(!(g.end<f+c)){var l=Math.max(f+c,
g.start)-f;if(l>e)break;var m=Math.min(f+e,g.end)-f;if(l<=m){l=Math.max(c,l);m=Math.min(e,m);c<l&&this._createRange(d,c,l,null,h);if(!g.style||!g.style.unmergeable)for(;i+1<b.length&&b[i+1].start-f===m&&a(g.style,b[i+1].style);)g=b[i+1],m=Math.min(f+e,g.end)-f,i++;this._createRange(d,l,m,g.style,h);c=m}}}c<e&&this._createRange(d,c,e,null,h)}},_createRange:function(a,b,d,c,e){if(!(b>d)){var f=this.view._customTabSize;if(f&&f!==8)for(var h=a.indexOf("\t",b);h!==-1&&h<d;){b<h&&(b={text:a.substring(b,
h),style:c},e.ranges.push(b),e.tabOffset+=b.text.length);b=f-e.tabOffset%f;if(b>0){for(var i="\u00a0",g=1;g<b;g++)i+=" ";b={text:i,style:c,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=h+1;if(b===d)return;h=a.indexOf("\t",b)}b<=d&&(b={text:a.substring(b,d),style:c},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(a,d,c,e){var h=this.view,i="span";c&&c.tagName&&(i=c.tagName.toLowerCase());var g=i==="a";if(g)a.hasLink=!0;g&&!h._linksVisible&&(i="span");g=a.ownerDocument;
a=b.createElement(a.ownerDocument,i);c&&c.html?(a.innerHTML=c.html,a.ignore=!0):c&&c.node?(a.appendChild(c.node),a.ignore=!0):a.appendChild(g.createTextNode(c&&c.text?c.text:d));f(c,a);if(i==="a"){var l=h._getWindow();w(a,"click",function(a){return h._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=c;if(e)a.ignoreChars=e;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,d){var c=this._ensureCreated(),
e=this.view;if(a===void 0)return this._getLineBoundingClientRect(c,!0);var f=e._model,h=c.ownerDocument,i=this.lineIndex,g=null;if(a<f.getLineEnd(i)){i=f.getLineStart(i);for(f=c.firstChild;f;){if(!f.ignore){var l=f.firstChild,m=l.length;f.ignoreChars&&(m-=f.ignoreChars);if(i+m>a){g=a-i;if(l.length===1)g=new r(f.getBoundingClientRect());else if(e._isRangeRects)h=h.createRange(),h.setStart(l,g),h.setEnd(l,g+1),g=new r(h.getBoundingClientRect());else if(b.isIE){if(h=h.body.createTextRange(),h.moveToElementText(f),
h.collapse(),(i=g===0&&b.isIE===8)&&(g=1),h.moveEnd("character",g+1),h.moveStart("character",g),g=new r(h.getBoundingClientRect()),i)g.left=f.getClientRects()[0].left}else{var j=l.data;f.removeChild(l);f.appendChild(h.createTextNode(j.substring(0,g)));var k=b.createElement(h,"span");k.appendChild(h.createTextNode(j.substring(g,g+1)));f.appendChild(k);f.appendChild(h.createTextNode(j.substring(g+1)));g=new r(k.getBoundingClientRect());f.innerHTML="";f.appendChild(l);this._createdDiv||(h=e._getSelection(),
(i<=h.start&&h.start<i+m||i<=h.end&&h.end<i+m)&&e._updateDOMSelection())}b.isIE&&(h=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,c=h.screen.logicalXDPI/h.screen.deviceXDPI,h=h.screen.logicalYDPI/h.screen.deviceYDPI,g.left*=c,g.right*=c,g.top*=h,g.bottom*=h);break}i+=m}f=f.nextSibling}}c=this.getBoundingClientRect();if(!g)e._wrapMode?(e=this.getClientRects(),g=e[e.length-1],g.left=g.right,g.left+=c.left,g.top+=c.top,g.right+=c.left,g.bottom+=c.top):(g=new r(c),g.left=g.right);if(d||d===
void 0)g.left-=c.left,g.top-=c.top,g.right-=c.left,g.bottom-=c.top;return g},_getClientRects:function(a,b){var d,c,e,f;if(!a._rectsCache){d=a.getClientRects();c=Array(d.length);for(f=0;f<d.length;f++)e=c[f]=new r(d[f]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=c}d=a._rectsCache;c=[d.length];for(f=0;f<d.length;f++)c[f]=new r(d[f]);return c},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),d=[],c=
b.firstChild,e,f=b.getBoundingClientRect();c;){if(!c.ignore)for(var h=this._getClientRects(c,f),b=0;b<h.length;b++){var g=h[b],i;if(g.top!==g.bottom){var l=g.top+(g.bottom-g.top)/2;for(i=0;i<d.length;i++)if(e=d[i],e.top<=l&&l<e.bottom)break;if(i===d.length)d.push(g);else{if(g.left<e.left)e.left=g.left;if(g.top<e.top)e.top=g.top;if(g.right>e.right)e.right=g.right;if(g.bottom>e.bottom)e.bottom=g.bottom}}}c=c.nextSibling}return a!==void 0?d[a]:d},_getLineBoundingClientRect:function(a,b){var d=new r(a.getBoundingClientRect());
if(!this.view._wrapMode){d.right=d.left;for(var c=a.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(c)c=c.getBoundingClientRect(),d.right=c.right+o(a).right}b&&(c=o(a),d.left+=c.left,d.right-=c.right);return d},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,d=0;d<b.length;d++)if(b[d].top<=a&&
a<b[d].bottom)return d;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(a,d){var c=this.view,e=c._model,f=this.lineIndex,h=e.getLineStart(f),g=e.getLineEnd(f);if(h===g)return h;var i=this._ensureCreated(),l=this.getBoundingClientRect(),m,j;if(c._wrapMode){m=this.getClientRects();if(d<m[0].top)d=m[0].top;for(var k=0;k<m.length;k++)if(j=m[k],
j.top<=d&&d<j.bottom)break;if(a<j.left)a=j.left;a>j.right&&(a=j.right-1)}else a<0&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var o=i.ownerDocument,k=o.defaultView||o.parentWindow,t=b.isIE?k.screen.logicalXDPI/k.screen.deviceXDPI:1,s=b.isIE?k.screen.logicalYDPI/k.screen.deviceYDPI:1,k=h,r=i.firstChild;a:for(;r;){if(!r.ignore){var v=r.firstChild,i=v.length;r.ignoreChars&&(i-=r.ignoreChars);var u,w,x;m=this._getClientRects(r,l);for(var J=0;J<m.length;J++)if(j=m[J],j.left<=a&&a<j.right&&(!c._wrapMode||
j.top<=d&&d<j.bottom)){var J=j.left+l.left,G;if(b.isIE||c._isRangeRects){for(var o=c._isRangeRects?o.createRange():o.body.createTextRange(),F=i,L=-1;F-L>1;){var U=Math.floor((F+L)/2);m=L+1;j=U===i-1&&r.ignoreChars?v.length:U+1;G=m===0&&b.isIE===8;c._isRangeRects?(o.setStart(v,m),o.setEnd(v,j)):(G&&(m=1),o.moveToElementText(r),o.move("character",m),o.moveEnd("character",j-m));m=o.getClientRects();for(var W=!1,V=0;V<m.length;V++)if(j=m[V],u=(G?J:j.left)*t-l.left,x=j.right*t-l.left,w=j.top*s-l.top,j=
j.bottom*s-l.top,u<=a&&a<x&&(!c._wrapMode||w<=d&&d<j)){W=!0;break}W?F=U:L=U}k+=F;m=F;j=F===i-1&&r.ignoreChars?v.length:Math.min(F+1,v.length);c._isRangeRects?(o.setStart(v,m),o.setEnd(v,j)):(o.moveToElementText(r),o.move("character",m),o.moveEnd("character",j-m));m=o.getClientRects();c=!1;m.length>0&&(j=m[0],u=(G?J:j.left)*t-l.left,x=j.right*t-l.left,c=a>u+(x-u)/2);l=k-h;e=e.getLine(f);f=e.charCodeAt(l);55296<=f&&f<=56319&&c?l<e.length&&(f=e.charCodeAt(l+1),56320<=f&&f<=57343&&(k+=1)):56320<=f&&f<=
57343&&!c&&l>0&&(f=e.charCodeAt(l-1),55296<=f&&f<=56319&&(k-=1));c&&k++}else{e=[];for(f=0;f<i;f++)e.push("<span>"),f===i-1?e.push(v.data.substring(f)):e.push(v.data.substring(f,f+1)),e.push("</span>");r.innerHTML=e.join("");for(e=r.firstChild;e;){j=e.getBoundingClientRect();u=j.left-l.left;x=j.right-l.left;if(u<=a&&a<x){a>u+(x-u)/2&&k++;break}k++;e=e.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(v),l=c._getSelection(),(k<=l.start&&l.start<k+i||k<=l.end&&l.end<k+i)&&c._updateDOMSelection()}break a}k+=
i}r=r.nextSibling}return Math.min(g,Math.max(h,k))},getNextOffset:function(a,d){if(d.unit==="line"){var c=this.view._model,e=c.getLineAtOffset(a);if(d.count>0)return d.count--,c.getLineEnd(e);d.count++;return c.getLineStart(e)}return d.unit==="wordend"||d.unit==="wordWS"||d.unit==="wordendWS"?this._getNextOffset_W3C(a,d):b.isIE?this._getNextOffset_IE(a,d):this._getNextOffset_W3C(a,d)},_getNextOffset_W3C:function(a,b){function d(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=
126}function c(a){return a===32||a===9}var e=this.view._model,f=e.getLineAtOffset(a),h=e.getLine(f),g=e.getLineStart(f),e=e.getLineEnd(f),f=h.length,i=a-g,l,m=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var j,k,o;b.count!==0;){if(b.count>0){if(i===f)return e;l=h.charCodeAt(i);j=d(l);k=!j&&!c(l);for(i++;i<f;){l=h.charCodeAt(i);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){o=d(l);if(b.unit==="wordend"){if(!o&&j)break}else if(o&&!j)break;l=!o&&!c(l)}else l=
!c(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!l&&k)break}else if(l&&!k)break;k=l;j=o;i++}}else{if(i===0)return g;i--;l=h.charCodeAt(i);j=d(l);for(k=!j&&!c(l);0<i;){l=h.charCodeAt(i-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){o=d(l);if(b.unit==="wordend"){if(o&&!j)break}else if(!o&&j)break;l=!o&&!c(l)}else l=!c(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(l&&!k)break}else if(!l&&k)break;k=l;j=o;i--}}b.count-=m}else for(;b.count!==0&&0<=i+m&&i+m<=f;)i+=m,l=h.charCodeAt(i),56320<=l&&
l<=57343&&i>0&&(l=h.charCodeAt(i-1),55296<=l&&l<=56319&&(i+=m)),b.count-=m;return g+i},_getNextOffset_IE:function(a,b){var d=this._ensureCreated(),c=this.view._model,e=this.lineIndex,f=0,h;h=c.getLineStart(e);var i=d.ownerDocument,g=b.count<0?-1:1;if(a===c.getLineEnd(e)){for(d=d.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(!d)return h;f=i.body.createTextRange();f.moveToElementText(d);h=f.text.length;f.moveEnd(b.unit,g);f=a+f.text.length-h}else if(a===h&&b.count<0)f=h;else for(d=
d.firstChild;d;){c=d.firstChild.length;d.ignoreChars&&(c-=d.ignoreChars);if(h+c>a){f=i.body.createTextRange();if(a===h&&b.count<0){for(h=d.previousSibling;h;){if(h.firstChild&&h.firstChild.length)break;h=h.previousSibling}f.moveToElementText(h?h:d.previousSibling)}else f.moveToElementText(d),f.collapse(),f.moveEnd("character",a-h);h=f.text.length;f.moveEnd(b.unit,g);f=a+f.text.length-h;break}h=c+h;d=d.nextSibling}b.count-=g;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),
this._createdDiv=null}};u.prototype={addKeyMode:function(a,b){var d=this._keyModes;b!==void 0?d.splice(b,0,a):d.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var d=this._rulers;if(b!==void 0){var c,e;for(c=0,e=0;c<d.length&&e<b;c++)a.getLocation()===d[c].getLocation()&&e++;d.splice(e,0,a);b=e}else d.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,d=0,c=this._model,e=this._clientDiv;if(!e)return{width:a,height:d};var f=e.style.width;if(b.isWebkit)e.style.width=
"0x7fffffffpx";for(var c=c.getLineCount(),h=0;h<c;h++){var i=this._getLine(h),g=i.getBoundingClientRect(),a=Math.max(a,g.right-g.left);d+=g.bottom-g.top;i.destroy()}if(b.isWebkit)e.style.width=f;e=this._getViewPadding();a+=e.right+e.left+this._metrics.scrollWidth;d+=e.bottom+e.top+this._metrics.scrollWidth;return{width:a,height:d}},convert:function(a,b,d){if(this._clientDiv){var c=this._getScroll(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=
-c.x+f.left+e.left),a.y!==void 0&&(a.y+=-c.y+f.top+e.top));d==="document"&&(a.x!==void 0&&(a.x+=c.x-f.left-e.left),a.y!==void 0&&(a.y+=c.y-f.top-e.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&
(this._updateDOMSelection(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],d=this._actions,c;for(c in d)d.hasOwnProperty(c)&&(a||!d[c].defaultHandler)&&b.push(c);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},
getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],d=this._keyModes,c=0;c<d.length;c++)b=b.concat(d[c].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},
getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),d=this._getLine(b),a=d.getBoundingClientRect(a);d.destroy();d=a.left;b=this._getLinePixel(b)+a.top;return{x:d,y:b}},getNextOffset:function(a,
b){var d=new s(a,a,!1);this._doMove(b,d);return d.getCaret()},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return h(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var d in a)a.hasOwnProperty(d)&&(a[d]=h(this["_"+d]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var d=this._getLineIndex(b),
c=this._getLine(d),d=c.getOffset(a,b-this._getLinePixel(d));c.destroy();return d},getLineAtOffset:function(a){this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?
0:this._getScroll().y},invokeAction:function(a,b,d){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(d))return!0;if(a.defaultHandler)return typeof a.defaultHandler(d)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},
onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},
onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},
onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var d=this.getRulers(),c=0;c<d.length;c++)this.redrawLines(a,b,d[c])},redrawLines:function(a,b,d){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var c=this._clientDiv;if(c){if(d)for(c=this._getRulerParent(d).firstChild;c;){if(c._ruler===
d)break;c=c.nextSibling}d?c.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,b);if(!d||d.getOverview()==="page")for(c=c.firstChild;c;){var e=c.lineIndex;if(a<=e&&e<b)c.lineChanged=!0;c=c.nextSibling}if(!d&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var d=this._model;a===void 0&&(a=0);b===void 0&&(b=d.getCharCount());
var c=d.getLineAtOffset(a),d=d.getLineAtOffset(Math.max(a,b-1))+1;this.redrawLines(c,d)}},removeKeyMode:function(a){for(var b=this._keyModes,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,d){if(a){var c=this._actions,e=c[a];
e||(e=c[a]={});e.handler=b;if(d!==void 0)e.actionDescription=d}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,d){var c=this._model.getCharCount(),a=Math.max(0,Math.min(a,c));this._setSelection(new s(a,a,!1),b===void 0||b,!0,d)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==
this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),d=this._model.getCharCount(),c=a.getLineCount(),e=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,addedLineCount:c};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,
addedLineCount:c};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(b){var d=this._defaultOptions(),c;for(c in b)if(b.hasOwnProperty(c)){var e=b[c];if(!a(this["_"+c],e)){var f=d[c]?d[c].update:null;f?f.call(this,e):this["_"+c]=h(e)}}},setSelection:function(a,b,d,c){var e=a>b;if(e)var f=a,a=b,b=f;f=this._model.getCharCount();a=
Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));this._setSelection(new s(a,b,e),d===void 0||d,!0,c)},setText:function(a,d,c){var e=d===void 0&&c===void 0;d===void 0&&(d=0);c===void 0&&(c=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:a,start:d,end:c,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new s(0,0,!1),!0),b.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},
setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&(a&&this._updateStyle(),b===void 0||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(!this._ignoreEvent(a)){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var d=this._overlayDiv||this._clientDiv;if(b.isIE<9)d=
this._viewDiv;for(var c=a.target?a.target:a.srcElement;c;){if(d===c)return;c=c.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=
!1;if(b.isIE<9&&!this._getSelection().isEmpty()){var a=this._rootDiv,d=b.createElement(a.ownerDocument,"div");a.appendChild(d);a.removeChild(d)}if(this._cursorDiv)this._cursorDiv.style.display="none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),d=this._selDiv1.ownerDocument,a.getSelection){d=a.getSelection();for(a=d.anchorNode;a;){if(a===this._clientDiv){d.rangeCount>0&&d.removeAllRanges();
break}a=a.parentNode}}else if(d.selection){this._ignoreSelect=!1;for(a=d.selection.createRange().parentElement();a;){if(a===this._clientDiv){d.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var d=!1;this.isListening("ContextMenu")?(d=this._createMouseEvent("ContextMenu",a),d.screenX=a.screenX,d.screenY=a.screenY,this.onContextMenu(d),
d=d.defaultPrevented):b.isMac&&b.isFirefox&&a.button===0&&(d=!0);if(d)return a.preventDefault&&a.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){if(!this._ignoreEvent(a)&&(this._lastMouseTime=
a.timeStamp?a.timeStamp:(new Date).getTime(),this._clickCount!==2))this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(b.isFirefox){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.contentEditable=!0;d._clientDiv.draggable=!1;d._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),
!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var d=!0;this._dropTarget=
!0;this.isListening("DragEnter")&&(d=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(b.isWebkit||d)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var d=!0;this.isListening("DragOver")&&(d=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||d){if(d)a.dataTransfer.dropEffect="none";a.preventDefault&&a.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",
a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;b.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var a=this._highlightRGB;this._selDiv1.style.background=
a;this._selDiv2.style.background=a;this._selDiv3.style.background=a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var d=this._createKeyEvent("KeyDown",a);this.onKeyDown(d);if(d.defaultPrevented){if(b.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}d=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:d=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&
a.preventDefault(),!1;d=!0;if(b.isSafari&&b.isMac&&a.ctrlKey)d=!1,a.keyCode=129;d&&this._startIME()}else d||this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera<12.16)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=
void 0;else{if(b.isMac&&b.isWebkit&&(63232<=a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera<12.16)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var d=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&d)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(d=this._createKeyEvent("KeyPress",a),this.onKeyPress(d),d.defaultPrevented)){a.preventDefault();
return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;d=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)d=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)d=!0}else a.ctrlKey^a.altKey&&(d=!0);if(!d&&(d=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,d>31))return this._doContent(String.fromCharCode(d)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!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}}this._handleDocKeyUp(a);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var d=this._getWindow(),c=!0,e=d;if(b.isIE||b.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=
!0;var f=this;d.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}this._clickCount===1?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!b.isOpera||b.isOpera>=12.16)&&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 c},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if((a.target||
a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var d=a.which;d||(a.button===4&&(d=2),a.button===2&&(d=3),a.button===1&&(d=1));var c=d!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),e=c-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),h=Math.abs(this._lastMouseY-a.clientY),i=this._lastMouseButton===d;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=c;this._lastMouseButton=d;if(d===1)this._isMouseDown=!0,i&&e<=this._clickTime&&
f<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(c=this._createMouseEvent("MouseDown",a),this.onMouseDown(c),c.defaultPrevented)){a.preventDefault();return}if(d===1&&this._handleMouse(a)&&(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var d=this._isClientDiv(a);if(this.isListening("MouseMove")&&d)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(c&&!this._isMouseDown&&(b.isMac?a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&d)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var d=a.clientX,a=a.clientY,e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),
h=this._getClientWidth(),i=this._getClientHeight(),c=f.left+e.left,g=f.top+e.top,h=f.left+e.left+h,e=f.top+e.top+i;a<g?this._doAutoScroll("up",d,a-g):a>e?this._doAutoScroll("down",d,a-e):d<c&&!this._wrapMode?this._doAutoScroll("left",d-c,a):d>h&&!this._wrapMode?this._doAutoScroll("right",d-h,a):(this._endAutoScroll(),this._setSelectionTo(d,a,!0))}}}},_isClientDiv:function(a){for(var b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},
_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var d=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:d.x,y:d.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var d=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||d&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible&&d&&this._isMouseDown){if(this._dragOffset!==-1)d=this._getSelection(),d.extend(this._dragOffset),d.collapse(),this._setSelection(d,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var d=this._getLineHeight(),c=0,e=0;b.isIE||b.isOpera?e=-a.wheelDelta/40*d:b.isFirefox?a.type==="wheel"?a.deltaMode?(c=Math.max(-256,Math.min(256,a.deltaX))*d,e=Math.max(-256,
Math.min(256,a.deltaY))*d):(c=a.deltaX,e=a.deltaY):(d=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*d,a.axis===a.HORIZONTAL_AXIS?c=d:e=d):b.isMac?(e=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=a.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=a.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,c=Math.ceil(-a.wheelDeltaX/c),-1<c&&c<0&&(c=-1),0<c&&c<1&&(c=1),e=Math.ceil(-a.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(c=-a.wheelDeltaX,e=-a.wheelDeltaY/120*8*d);if(b.isSafari||
b.isChrome&&b.isMac){for(d=a.target;d&&d.lineIndex===void 0;)d=d.parentNode;this._mouseWheelLine=d}d=this._getScroll();this._scrollView(c,e);c=this._getScroll();if(d.x!==c.x||d.y!==c.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(b.isIE){var d=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){d._updateDOMSelection();d._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var d=
this._rootDiv.clientWidth,c=this._rootDiv.clientHeight;if(this._rootWidth!==d||this._rootHeight!==c){this._rootWidth!==d&&this._wrapMode&&this._resetLineHeight();this._rootWidth=d;this._rootHeight=c;d=b.isIE<9;c=this._calculateMetrics();if(!a(c,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=!1,this._resetLineHeight();this._metrics=c;d=!0}d?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var b=a.target?a.target:a.srcElement,d=b.lineIndex;b&&!b._ruler;){if(d===
void 0&&b.lineIndex!==void 0)d=b.lineIndex;b=b.parentNode}var c=b?b._ruler:null;if(d===void 0&&c&&c.getOverview()==="document"){var d=this._getClientHeight(),e=this._model.getLineCount(),f=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),d=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*e/(d+f.top+f.bottom-2*this._metrics.scrollWidth));0<=d&&d<e||(d=void 0)}if(c)switch(a.type){case "click":if(c.onClick)c.onClick(d,a);break;case "dblclick":if(c.onDblClick)c.onDblClick(d,a);break;
case "mousemove":if(c.onMouseMove)c.onMouseMove(d,a);break;case "mouseover":if(c.onMouseOver)c.onMouseOver(d,a);break;case "mouseout":if(c.onMouseOut){for(e=a.relatedTarget;e&&e!==this._rootDiv;){if(e===b)return;e=e.parentNode}c.onMouseOut(d,a)}}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,d=this._vScroll;if(b!==a.x||d!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(d===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:d},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var d;d=a.tagName==="DIV"?a:a.parentNode.parentNode;var c=0,e=d.lineIndex;if(a.tagName!=="DIV")for(d=d.firstChild;d;){var f=d.firstChild;if(f===a){d.ignoreChars&&(c-=d.ignoreChars);c+=b;break}d.ignoreChars&&(c-=d.ignoreChars);c+=f.data.length;d=d.nextSibling}return Math.max(0,c)+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 s(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var d=this;this._selTimer=a.setTimeout(function(){if(d._clientDiv)d._selTimer=null,d._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();
if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var d=b.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var c=this._model,e=d.lineIndex,f=c.getLine(e),h=f,i=0,c=c.getLineStart(e);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),e=d.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(e),i=this._getDOMText(d,e),h=i.text,i=i.offset,e.parentNode.removeChild(e);d.lineRemoved=!0;
for(d=0;f.charCodeAt(d)===h.charCodeAt(d)&&d<i;)d++;b=f.length-1;for(e=h.length-f.length;f.charCodeAt(b)===h.charCodeAt(b+e)&&b+e>=i+a.data.length;)b--;b++;f=h.substring(d,b+e);d+=c;b+=c;this._modifyContent({text:f,start:d,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var d=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",d.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null;var c=a.touches;if(c.length===1){var c=c[0],e=c.clientX,f=c.clientY;this._touchStartX=e;this._touchStartY=f;if(b.isAndroid&&(f<c.pageY-d.pageYOffset||e<c.pageX-d.pageXOffset))e=c.pageX-d.pageXOffset,f=c.pageY-d.pageYOffset;d=this.convert({x:e,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(d.x,d.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;
this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var d=this,c=this._getWindow();this._touchScrollTimer=c.setInterval(function(){var a=0,b=0;if(d._touching)a=d._touchStartX-d._touchCurrentX,b=d._touchStartY-d._touchCurrentY,d._touchSpeedX=a/10,d._touchSpeedY=b/10,d._touchStartX=d._touchCurrentX,d._touchStartY=d._touchCurrentY;else if(Math.abs(d._touchSpeedX)<
0.1&&Math.abs(d._touchSpeedY)<0.1){d._vScrollDiv.style.display="none";d._hScrollDiv.style.display="none";c.clearInterval(d._touchScrollTimer);d._touchScrollTimer=null;return}else a=d._touchSpeedX*10,b=d._touchSpeedY*10,d._touchSpeedX*=0.95,d._touchSpeedY*=0.95;d._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,d,c=this._keyModes;for(d=c.length-1;d>=0;d--)if(b=c[d],typeof b.match===
"function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var d=this._model,c=b.getCaret(),e=d.getLineAtOffset(c);if(!a.count)a.count=1;for(;a.count!==0;){var f=d.getLineStart(e);if(a.count<0&&c===f)if(e>0)a.unit==="character"&&a.count++,e--,b.extend(d.getLineEnd(e));else break;else if(a.count>0&&c===d.getLineEnd(e))if(e+1<d.getLineCount())a.unit==="character"&&a.count--,e++,b.extend(d.getLineStart(e));else break;else{var h=!1;a.expandTab&&a.unit==="character"&&
(c-f)%this._tabSize===0&&(h=!/[^ ]/.test(d.getText(f,c)));h?(b.extend(c-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(e),b.extend(f.getNextOffset(c,a)),f.destroy())}c=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var d=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":d=d.toLowerCase();break;case "capitalize":d=d.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<d.length;b++){var c=d[b],e=c.toLowerCase(),c=e!==c?e:c.toUpperCase();a+=c}d=a;break;default:d=d.toUpperCase()}this._doContent(d);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var d=this._model,c=d.getLineAtOffset(b.end);b.end<d.getLineEnd(c)&&(d=this._getLine(c),
b.extend(d.getNextOffset(b.getCaret(),{unit:"character",count:1})),d.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();
if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),
d=this._model,c;if(a.ctrl)b.extend(d.getCharCount()),c=function(){};else{var e=b.getCaret(),f=d.getLineAtOffset(e);if(this._wrapMode){var h=this._getLine(f),e=h.getLineIndex(e),e=e===h.getLineCount()-1?d.getLineEnd(f):h.getLineStart(e+1)-1;h.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,d.getLineCount()-1)),e=d.getLineEnd(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doEnter:function(a){var b=this._model,d=this._getSelection();this._doContent(b.getLineDelimiter());
if(a&&a.noCursor)d.end=d.start,this._setSelection(d,!0);return!0},_doHome:function(a){var b=this._getSelection(),d=this._model,c;if(a.ctrl)b.extend(0),c=function(){};else{var e=b.getCaret(),f=d.getLineAtOffset(e);this._wrapMode?(d=this._getLine(f),e=d.getLineIndex(e),e=d.getLineStart(e),d.destroy()):e=d.getLineStart(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doLineDown:function(a){var d=this._model,c=this._getSelection(),e=c.getCaret(),f=d.getLineAtOffset(e),h=
this._getLine(f),i=this._columnX,g=1,l=!1;if(i===-1||a.wholeLine||a.select&&b.isIE)i=a.wholeLine?d.getLineEnd(f+1):e,i=h.getBoundingClientRect(i).left;(e=h.getLineIndex(e))<h.getLineCount()-1?g=h.getClientRects(e+1).top+1:(e=d.getLineCount()-1,l=f===e,a.count&&a.count>0?f=Math.min(f+a.count,e):f++);e=!1;if(l){if(a.select||b.isMac||b.isLinux)c.extend(d.getCharCount()),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),c.extend(h.getOffset(i,g)),e=!0;e&&(a.select||c.collapse(),this._setSelection(c,
!0,!0));this._columnX=i;h.destroy();return!0},_doLineUp:function(a){var d=this._model,c=this._getSelection(),e=c.getCaret(),f=d.getLineAtOffset(e),h=this._getLine(f),i=this._columnX,g=!1,l;if(i===-1||a.wholeLine||a.select&&b.isIE)i=a.wholeLine?d.getLineStart(f-1):e,i=h.getBoundingClientRect(i).left;(e=h.getLineIndex(e))>0?l=h.getClientRects(e-1).top+1:(g=f===0,g||(a.count&&a.count>0?f=Math.max(f-a.count,0):f--,l=this._getLineHeight(f)-1));e=!1;if(g){if(a.select||b.isMac||b.isLinux)c.extend(0),e=!0}else h.lineIndex!==
f&&(h.destroy(),h=this._getLine(f)),c.extend(h.getOffset(i,l)),e=!0;e&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=i;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var d=this,c=this._model,e=this._getSelection(),f=e.getCaret(),h=c.getLineAtOffset(f),i=c.getLineCount(),g=this._getScroll(),c=this._getClientHeight(),l,m;if(this._lineHeight){l=this._columnX;g=this._getBoundsAtOffset(f);if(l===-1||a.select&&b.isIE)l=g.left;f=this._getLineIndex(g.top+c);
m=this._getLine(f);h=this._getLinePixel(f);f=m.getOffset(l,g.top+c-h);c=m.getBoundingClientRect(f);m.destroy();e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){d._columnX=l},c.top+h-g.top);return!0}if(h<i-1){var j=this._getLineHeight(),k=Math.min(i-h-1,Math.floor(c/j)),k=Math.max(1,k);l=this._columnX;if(l===-1||a.select&&b.isIE)m=this._getLine(h),l=m.getBoundingClientRect(f).left,m.destroy();m=this._getLine(h+k);e.extend(m.getOffset(l,0));m.destroy();a.select||e.collapse();
a=i*j;f=g.y+k*j;f+c>a&&(f=a-c);this._setSelection(e,!0,!0,function(){d._columnX=l},f-g.y)}return!0},_doPageUp:function(a){var d=this,c=this._model,e=this._getSelection(),f=e.getCaret(),h=c.getLineAtOffset(f),i=this._getScroll(),g=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;i=this._getBoundsAtOffset(f);if(l===-1||a.select&&b.isIE)l=i.left;f=this._getLineIndex(i.bottom-g);c=this._getLine(f);h=this._getLinePixel(f);f=c.getOffset(l,i.bottom-g-h);g=c.getBoundingClientRect(f);c.destroy();
e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){d._columnX=l},g.top+h-i.top);return!0}if(h>0){var m=this._getLineHeight(),g=Math.max(1,Math.min(h,Math.floor(g/m)));l=this._columnX;if(l===-1||a.select&&b.isIE)c=this._getLine(h),l=c.getBoundingClientRect(f).left,c.destroy();c=this._getLine(h-g);e.extend(c.getOffset(l,this._getLineHeight(h-g)-1));c.destroy();a.select||e.collapse();a=Math.max(0,i.y-g*m);this._setSelection(e,!0,!0,function(){d._columnX=l},a-i.y)}return!0},_doPaste:function(a){var d=
this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&d._lastMouseButton===2&&(new Date).getTime()-d._lastMouseTime<=d._clickTime&&d._setSelectionTo(d._lastMouseX,d._lastMouseY),d._doContent(a))})!==null},_doScroll:function(a){var b=a.type,d=this._model,c=d.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();c*=e;var f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=c-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=
f+e;break;case "lineUp":h=f-e;break;case "centerLine":b=this._getSelection(),h=d.getLineAtOffset(b.start),d=(d.getLineAtOffset(b.end)-h+1)*e,h=h*e-a/2+d/2}h!==void 0&&(h=Math.min(Math.max(0,h),c-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),
d=b.getLineAtOffset(a),b=b.getLineStart(d),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,d=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=d.getCaret(),f=a.getLineCount(),h=a.getLineAtOffset(e),i;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),i=Math.max(0,Math.min(f-1,h+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")i=this._getLineIndex(c.y),h=this._getLine(h),c.x+=h.getBoundingClientRect(e,!1).left,h.destroy();
i===0&&(b.isMac||b.isLinux)?d.extend(0):i===f-1&&(b.isMac||b.isLinux)?d.extend(a.getCharCount()):(h=this._getLine(i),d.extend(h.getOffset(c.x,c.y-this._getLinePixel(i))),h.destroy());this._setSelection(d,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),d=0;if(a){for(var a=
0,c=(new Date).getTime(),e=0;d<b;)if(this._lineHeight[d]||(a++,e||(e=d),this._lineHeight[d]=this._calculateLineHeight(d)),d++,(new Date).getTime()-c>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(d!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),
b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,d=a.ownerDocument,c=b.createElement(d,"div");c.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);f(e.style,c);c.style.position="fixed";c.style.left="-1000px";var h=b.createElement(d,"span");h.appendChild(d.createTextNode(" "));c.appendChild(h);var i=b.createElement(d,"span");i.style.fontStyle=
"italic";i.appendChild(d.createTextNode(" "));c.appendChild(i);var g=b.createElement(d,"span");g.style.fontWeight="bold";g.appendChild(d.createTextNode(" "));c.appendChild(g);e=b.createElement(d,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(d.createTextNode(" "));c.appendChild(e);a.appendChild(c);var l=c.getBoundingClientRect(),h=h.getBoundingClientRect(),i=i.getBoundingClientRect(),g=g.getBoundingClientRect(),e=e.getBoundingClientRect(),h=h.bottom-h.top,i=i.bottom-i.top,
g=g.bottom-g.top,j=e.bottom-e.top,k=0,e=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);i>h&&(k=1);g>i&&(k=2);j>g&&(k=3);var t;if(k!==0){t={style:{}};if((k&1)!==0)t.style.fontStyle="italic";if((k&2)!==0)t.style.fontWeight="bold"}h=o(c);a.removeChild(c);j=m(this._viewDiv);c=b.createElement(d,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=j.left+"px";c.style.paddingTop=j.top+"px";c.style.paddingRight=j.right+"px";c.style.paddingBottom=j.bottom+"px";c.style.width="100px";c.style.height=
"100px";j=b.createElement(d,"div");j.style.width="100%";j.style.height="100%";c.appendChild(j);a.appendChild(c);k=c.getBoundingClientRect();i=j.getBoundingClientRect();g=0;if(!this._singleMode)c.style.overflow="hidden",j.style.height="200px",g=c.clientWidth,c.style.overflow="scroll",g-=c.clientWidth;a.removeChild(c);j={left:i.left-k.left,top:i.top-k.top,right:k.right-i.right,bottom:k.bottom-i.bottom};i=k=0;if(!e&&(this._wrapOffset||this._marginOffset))c=b.createElement(d,"div"),c.style.position="fixed",
c.style.left="-1000px",c.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(c),k=c.getBoundingClientRect(),k=Math.ceil(k.right-k.left),c.innerHTML=Array(this._marginOffset+1).join(" "),i=c.getBoundingClientRect(),i=Math.ceil(i.right-i.left),a.removeChild(c);return{lineHeight:l,largestFontStyle:t,lineTrim:h,viewPadding:j,scrollWidth:g,wrapWidth:k,marginWidth: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),d=a.getLineStart(b),c=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),d=this._imeOffset-d,a=d+c.length-a.length;d!==a&&this._doContent(c.substring(d,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new j.DefaultKeyMode(this));
var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},
charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(d(b,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(d(b,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(d(b,
{type:"pageUp"}))},actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(d(b,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(d(b,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(d(b,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,
{select:!1,unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(d(b,{type:"textStart"}))},
actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(d(b,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(d(b,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!0}))},actionDescription:{name:g.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!0,ctrl:!1}))},
actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(d(b,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(d(b,
{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(d(b,
{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(d(b,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(d(b,
{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(d(b,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(d(b,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:g.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(d(b,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(d(b,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(d(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(d(b,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRulerParent:function(a){var d=b.createElement(document,"div");d.className=a;d.tabIndex=-1;d.style.overflow="hidden";d.style.MozUserSelect="none";d.style.WebkitUserSelect="none";d.style.position="absolute";d.style.top="0px";d.style.bottom=
"0px";d.style.cursor="default";d.style.display="none";d.setAttribute("aria-hidden","true");this._rootDiv.appendChild(d);return d},_createRuler:function(a,d){if(this._clientDiv){var c=this._getRulerParent(a);if(c){if(c!==this._marginDiv||this._marginOffset)c.style.display="block";var e=b.createElement(c.ownerDocument,"div");e._ruler=a;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat="left";e.style.styleFloat="left";e.style.outline="none";if(d===void 0||d<0||d>=c.children.length)c.appendChild(e);
else{for(var f=c.firstChild;f&&d-- >0;)f=f.nextSibling;c.insertBefore(e,f)}}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var d=a.ownerDocument,c=b.createElement(d,"div");this._rootDiv=c;c.tabIndex=-1;c.style.position="relative";c.style.overflow="hidden";c.style.width="100%";c.style.height="100%";c.style.overflow="hidden";c.style.WebkitTextSizeAdjust="100%";c.setAttribute("role","application");a.appendChild(c);this._leftDiv=this._createRulerParent("textviewLeftRuler");
a=b.createElement(d,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";a.style.background="transparent";if(b.isMac&&b.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";c.appendChild(a);var e=this._createRulerParent("textviewRightRuler");this._rightDiv=e;e.style.right="0px";this._scrollDiv=e=b.createElement(d,"div");e.style.margin="0px";e.style.borderWidth=
"0px";e.style.padding="0px";a.appendChild(e);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(d,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",c.appendChild(a),this._clipScrollDiv=e=b.createElement(d,"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=b.createElement(d,"div");a.className="textviewContent";this._clientDiv=a;a.tabIndex=0;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||c).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=
e=b.createElement(d,"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",c.appendChild(e),this._hScrollDiv=e=b.createElement(d,"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",c.appendChild(e);if(b.isFirefox&&!a.setCapture)this._overlayDiv=d=b.createElement(d,"div"),d.style.position=a.style.position,d.style.borderWidth=a.style.borderWidth,d.style.margin=a.style.margin,d.style.padding=a.style.padding,d.style.cursor="text",d.style.zIndex="2",(this._clipDiv||
c).appendChild(d);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();c=this._rulers;for(d=0;d<c.length;d++)this._createRuler(c[d]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},
scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:c.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var d=b.firstChild;d;){if(d._ruler===a){d._ruler=void 0;b.removeChild(d);if(b.children.length===0&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}d=d.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=
this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,d){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=d;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,b){var d=this._model;d.getBaseModel&&(a=d.mapOffset(a),b=d.mapOffset(b),d=d.getBaseModel());return d.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._clientDiv.getBoundingClientRect();a.bottom>d.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),
d=this._getLinePixel(b.lineIndex);a.top+=d;a.bottom+=d;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,d){var c=this._model.getLineDelimiter(),e,f,h=this._getWindow(),i=h.clipboardData;if(!i&&a)i=a.clipboardData;if(i)return e=[],f=i.getData(b.isIE?"Text":"text/plain"),
l(f,function(a){e.push(a)},function(){e.push(c)}),f=e.join(""),d&&d(f),f;if(b.isFirefox){this._ignoreFocus=!0;var g=this._clipboardDiv,i=this._rootDiv.ownerDocument;if(!g)this._clipboardDiv=g=b.createElement(i,"div"),g.style.position="fixed",g.style.whiteSpace="pre",g.style.left="-1000px",this._rootDiv.appendChild(g);g.innerHTML="<pre contenteditable=''></pre>";g.firstChild.focus();var m=this,j=function(){var a=m._getTextFromElement(g);g.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(c)});
return e.join("")},k=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{k=i.execCommand("paste",!1,null)}catch(o){k=g.childNodes.length>1||g.firstChild&&g.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!k)return a?(h.setTimeout(function(){m.focus();(f=j())&&d&&d(f);m._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=j())&&d&&d(f);return f}return""},_getDOMText:function(a,b){for(var d=a.firstChild,c="",e=0;d;){var f;if(!d.ignore)if(d.ignoreChars){f=
d.lastChild;for(var h=0,i=[],g=-1;f;){var l=f.data;if(l)for(var m=l.length-1;m>=0;m--){var j=l.substring(m,m+1);h<d.ignoreChars&&(j===" "||j==="\u200b"||j==="\ufeff")?h++:i.push(j==="\u00a0"?"\t":j)}if(b===f)g=i.length;f=f.previousSibling}i=i.reverse().join("");g!==-1&&(e=c.length+i.length-g);c+=i}else for(f=d.firstChild;f;){if(b===f)e=c.length;c+=f.data;f=f.nextSibling}d=d.nextSibling}return{text:c,offset:e}},_getTextFromElement:function(a){var b=a.ownerDocument,d=b.defaultView;if(!d.getSelection)return a.innerText||
a.textContent;b=b.createRange();b.selectNode(a);var a=d.getSelection(),d=[],c;for(c=0;c<a.rangeCount;c++)d.push(a.getRangeAt(c));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(c=0;c<d.length;c++)a.addRange(d[c]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new v(this,a)},_getLineHeight:function(a,b){if(a!==
void 0&&this._lineHeight){var d=this._lineHeight[a];if(d)return d;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===
-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),d=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)d+=this._getLineHeight(b);else for(b-=1;b>=a;b--)d-=this._getLineHeight(b);return d}return this._getLineHeight()*a},_getLineIndex:function(a){var b,d=0,c=this._model.getLineCount();if(this._lineHeight){var d=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<
e&&d>0;)a+=this._getLineHeight(--d);else for(b=this._getLineHeight(d);a-b>=e&&d<c-1;)a-=b,b=this._getLineHeight(++d)}else b=this._getLineHeight(),d=Math.floor(a/b);return Math.max(0,Math.min(c-1,d))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},
_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect();a.top<c.top+d.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var 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 d=this._handlers=[],c=this._clientDiv,e=this._viewDiv,f=this._rootDiv,h=this._overlayDiv||c,i=c.ownerDocument,g=this._getWindow(),l=b.isIE?i:g;d.push({target:g,type:"resize",handler:function(b){return a._handleResize(b?b:g.event)}});d.push({target:c,type:"blur",handler:function(b){return a._handleBlur(b?b:g.event)}});
d.push({target:c,type:"focus",handler:function(b){return a._handleFocus(b?b:g.event)}});d.push({target:e,type:"focus",handler:function(){c.focus()}});d.push({target:e,type:"scroll",handler:function(b){return a._handleScroll(b?b:g.event)}});d.push({target:c,type:"textInput",handler:function(b){return a._handleTextInput(b?b:g.event)}});d.push({target:c,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:g.event)}});d.push({target:c,type:"keypress",handler:function(b){return a._handleKeyPress(b?
b:g.event)}});d.push({target:c,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:g.event)}});b.isIE&&d.push({target:i,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?b:g.event)}});d.push({target:c,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:g.event)}});d.push({target:c,type:"copy",handler:function(b){return a._handleCopy(b?b:g.event)}});d.push({target:c,type:"cut",handler:function(b){return a._handleCut(b?b:g.event)}});d.push({target:c,type:"paste",
handler:function(b){return a._handlePaste(b?b:g.event)}});if(b.isIOS||b.isAndroid)d.push({target:i,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:g.event)}}),d.push({target:c,type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:g.event)}}),d.push({target:c,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:g.event)}}),d.push({target:c,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:g.event)}});else{d.push({target:c,type:"selectstart",
handler:function(b){return a._handleSelectStart(b?b:g.event)}});d.push({target:c,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:g.event)}});d.push({target:c,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:g.event)}});d.push({target:c,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:g.event)}});d.push({target:l,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:g.event)}});d.push({target:l,type:"mousemove",handler:function(b){return a._handleMouseMove(b?
b:g.event)}});d.push({target:f,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:g.event)}});d.push({target:f,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?b:g.event)}});d.push({target:h,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:g.event)}});d.push({target:h,type:"drag",handler:function(b){return a._handleDrag(b?b:g.event)}});d.push({target:h,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:g.event)}});d.push({target:h,
type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:g.event)}});d.push({target:h,type:"dragover",handler:function(b){return a._handleDragOver(b?b:g.event)}});d.push({target:h,type:"dragleave",handler:function(b){return a._handleDragLeave(b?b:g.event)}});d.push({target:h,type:"drop",handler:function(b){return a._handleDrop(b?b:g.event)}});d.push({target:this._clientDiv,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?
b:g.event)}});this._clipDiv&&d.push({target:this._clipDiv,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:g.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(e=g.MutationObserver||g.MozMutationObserver)?(this._mutationObserver=new e(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(c,{subtree:!0,characterData:!0})):d.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?
b:g.event)}});this._overlayDiv&&(d.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:g.event)}}),d.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:g.event)}}),d.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:g.event)}}),d.push({target:this._overlayDiv,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:g.event)}}));this._isW3CEvents||d.push({target:this._clientDiv,
type:"dblclick",handler:function(b){return a._handleDblclick(b?b:g.event)}})}this._hookRulerEvents(this._leftDiv,d);this._hookRulerEvents(this._rightDiv,d);this._hookRulerEvents(this._marginDiv,d);for(e=0;e<d.length;e++)f=d[e],w(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,d){if(a){var c=this,e=this._getWindow();b.isIE&&d.push({target:a,type:"selectstart",handler:function(){return!1}});d.push({target:a,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?
a:e.event)}});d.push({target:a,type:"click",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:e.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var d=a.parent;typeof d==="string"&&(d=(a.document||document).getElementById(d));if(!d)throw"no parent";a.parent=d;a.model=a.model||new k.TextModel;var c=this._defaultOptions(),e;for(e in c)c.hasOwnProperty(e)&&(this["_"+e]=a[e]!==void 0?a[e]:c[e].value);this._keyModes=[];this._rulers=[];this._selection=new s(0,0,!1);this._linksVisible=
!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!b.isIE||b.isIE>=9)&&typeof d.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=d.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=
this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var d=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;d.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(d=
this._getSelection(),d.setCaret(a.start+a.text.length),this._setSelection(d,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,d=a.addedCharCount,c=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+c?h.setCaret(b+d):(h.start+=d-c,h.end+=d-c),this._setSelection(h,!1,!1));b=this._model.getLineAtOffset(b);for(d=this._getLineNext();d;){c=d.lineIndex;if(b<=
c&&c<=b+f)b===c&&!d.modelChangedEvent&&!d.lineRemoved?(d.modelChangedEvent=a,d.lineChanged=!0):(d.lineRemoved=!0,d.lineChanged=!1,d.modelChangedEvent=null);if(c>b+f)d.lineIndex=c+e-f,d._line.lineIndex=d.lineIndex;d=this._getLineNext(d)}this._lineHeight&&(a=[b,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type=
"ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var d=a;d<b;d++)this._lineHeight[d]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},
_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new s(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var a=this._clientDiv;if(a){for(var d=a.firstChild;d;)d.lineRemoved=!0,d=d.nextSibling;if(b.isFirefox)this._ignoreFocus=
!1,(d=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,d&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,d){var c=this._getWindow();if(d&&this._scrollAnimation){var e=this;this._animation=new x({window:c,duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);e._scrollView(0,a);b-=a},onEnd:function(){e._animation=null;e._scrollView(a,b);d&&c.setTimeout(d,0)}});this._animation.play()}else this._scrollView(a,b),d&&c.setTimeout(d,0)},_scrollView:function(a,
b){this._ensureCaretVisible=!1;var d=this._viewDiv;a&&(d.scrollLeft+=a);b&&(d.scrollTop+=b)},_setClipboardText:function(a,d){var c,e=this._getWindow(),f=e.clipboardData;if(!f&&d)f=d.clipboardData;if(f&&(c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),f.setData(b.isIE?"Text":"text/plain",c.join(""))))return!0;var h=this._parent.ownerDocument,g=b.createElement(h,"pre");g.style.position="fixed";g.style.left="-1000px";l(a,function(a){g.appendChild(h.createTextNode(a))},function(){g.appendChild(b.createElement(h,
"br"))});g.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(g);f=h.createRange();f.setStart(g.firstChild,0);f.setEndBefore(g.lastChild);var i=e.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(f);var m=this,f=function(){g&&g.parentNode===m._clientDiv&&m._clientDiv.removeChild(g);m._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=h.execCommand("copy",!1,null)}catch(j){}this._ignoreCopy=!1;if(!i&&d)return e.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,
d,c,e,f){for(var h,g,i,l,m=0,j=a.firstChild,k,o,t=this._model.getLine(a.lineIndex).length;j;){if(!j.ignore){k=j.firstChild;o=k.length;j.ignoreChars&&(o-=j.ignoreChars);if(m+o>d||m+o>=t){h=k;g=d-m;j.ignoreChars&&o>0&&g===o&&(g+=j.ignoreChars);break}m+=o}j=j.nextSibling}for(var m=0,j=c.firstChild,s=this._model.getLine(c.lineIndex).length;j;){if(!j.ignore){k=j.firstChild;o=k.length;j.ignoreChars&&(o-=j.ignoreChars);if(o+m>e||m+o>=s){i=k;l=e-m;j.ignoreChars&&o>0&&l===o&&(l+=j.ignoreChars);break}m+=o}j=
j.nextSibling}this._setDOMFullSelection(a,d,t,c,e,s);a=this._getWindow();d=this._parent.ownerDocument;if(a.getSelection){c=a.getSelection();a=d.createRange();a.setStart(h,g);a.setEnd(i,l);if(this._hasFocus&&(c.anchorNode!==h||c.anchorOffset!==g||c.focusNode!==i||c.focusOffset!==l||c.anchorNode!==i||c.anchorOffset!==l||c.focusNode!==h||c.focusOffset!==g))this._anchorNode=h,this._anchorOffset=g,this._focusNode=i,this._focusOffset=l,this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),
this._ignoreSelect=!0;if(this._cursorDiv&&(a=d.createRange(),f?(a.setStart(h,g),a.setEnd(h,g)):(a.setStart(i,l),a.setEnd(i,l)),i=a.getClientRects()[0],l=this._cursorDiv.parentNode,h=l.getBoundingClientRect(),i&&h))this._cursorDiv.style.top=i.top-h.top+l.scrollTop+"px",this._cursorDiv.style.left=i.left-h.left+l.scrollLeft+"px"}else if(d.selection&&this._hasFocus)f=d.body,a=b.createElement(d,"div"),f.appendChild(a),f.removeChild(a),a=f.createTextRange(),a.moveToElementText(h.parentNode),a.moveStart("character",
g),h=f.createTextRange(),h.moveToElementText(i.parentNode),h.moveStart("character",l),a.setEndPoint("EndToStart",h),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,d,c,e){if(this._selDiv1&&(d=this._selDiv1,d.style.width="0px",d.style.height="0px",d=this._selDiv2,d.style.width="0px",d.style.height="0px",d=this._selDiv3,d.style.width="0px",d.style.height="0px",!(a===c&&b===e))){var f=this._model,h=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),
i=this._viewDiv.getBoundingClientRect(),d=i.left+h.left,l=g.right,h=i.top+h.top,m=g.bottom,i=g=0;this._clipDiv?(i=this._clipDiv.getBoundingClientRect(),g=i.left-this._clipDiv.scrollLeft):(i=this._rootDiv.getBoundingClientRect(),g=i.left);i=i.top;this._ignoreDOMSelection=!0;var j=(new v(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+b,!1),k=j.left,b=(new v(this,c.lineIndex,c)).getBoundingClientRect(f.getLineStart(c.lineIndex)+e,!1),f=b.left;this._ignoreDOMSelection=!1;var o=
this._selDiv1,k=Math.min(l,Math.max(d,k)),t=Math.min(m,Math.max(h,j.top)),s=l,e=Math.min(m,Math.max(h,j.bottom));o.style.left=k-g+"px";o.style.top=t-i+"px";o.style.width=Math.max(0,s-k)+"px";o.style.height=Math.max(0,e-t)+"px";if(a.lineIndex===c.lineIndex)s=Math.min(f,l),o.style.width=Math.max(0,s-k)+"px";else if(j=Math.min(m,Math.max(h,b.top)),f=Math.min(l,Math.max(d,f)),h=Math.min(m,Math.max(h,b.bottom)),m=this._selDiv3,m.style.left=d-g+"px",m.style.top=j-i+"px",m.style.width=Math.max(0,f-d)+"px",
m.style.height=Math.max(0,h-j)+"px",Math.abs(a.lineIndex-c.lineIndex)>1)a=this._selDiv2,a.style.left=d-g+"px",a.style.top=e-i+"px",a.style.width=Math.max(0,l-d)+"px",a.style.height=Math.max(0,j-e)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=
this._hasFocus;var d=this._clientDiv;d.contentEditable=!a;this._hadFocus&&!a&&d.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(d=a.firstChild;d;)if(d.ignore)d=d.nextSibling;else{var c=d.nextSibling,e=d.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,d.firstChild.data,e),d);d=c}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,b,d,c,e){if(a){this._columnX=-1;d===
void 0&&(d=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,c,b,e);d&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,d,c){var e=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(b.x,b.y-this._getLinePixel(a));e.destroy();if(c&&!d&&f.start<=
a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);d||f.collapse()}else(this._clickCount&1)===0?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(d=this._doubleClickSelection.start,c=e.getNextOffset(a,{unit:"wordend",count:1})):(d=e.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(d=e.getNextOffset(a,{unit:"word",count:-1}),c=e.getNextOffset(d,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?
(c=e.getLineAtOffset(this._doubleClickSelection.start),a>=c?(d=e.getLineStart(c),c=e.getLineEnd(a)):(d=e.getLineStart(a),c=e.getLineEnd(c))):(d=e.getLineStart(a),c=e.getLineEnd(a)),f.setCaret(d),f.extend(c);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,d){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!b.isIOS){var e=c.ownerDocument;this._highlightRGB=b.isWebkit?
"transparent":"Highlight";var f=b.createElement(e,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";c.appendChild(f);var h=b.createElement(e,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding="0px";h.style.outline="none";h.style.background=this._highlightRGB;
h.style.width="0px";h.style.height="0px";h.style.zIndex="0";c.appendChild(h);this._selDiv3=e=b.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";c.appendChild(e);if(b.isFirefox&&b.isMac){c=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");switch(c){case "rgb(119, 141, 168)":c="rgb(199, 208, 218)";
break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;f.style.background=c;h.style.background=c;e.style.background=c}d||this._updateDOMSelection()}}else{if(this._selDiv1)c.removeChild(this._selDiv1),
this._selDiv1=null;if(this._selDiv2)c.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)c.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=b.createElement(document,"div");a.className="textviewBlockCursor";
this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,
b){this._wrapOffset=a;if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,d){this._tabSize=a;this._customTabSize=void 0;var c=this._clientDiv;if(b.isOpera){if(c)c.style.OTabSize=this._tabSize+""}else if(b.isWebkit>=537.1){if(c)c.style.tabSize=this._tabSize+""}else if(b.isFirefox>=
4){if(c)c.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;d||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var d="textview",c=this._theme.getThemeClass();c&&(d+=" "+
c);this._themeClass&&c!==this._themeClass&&(d+=" "+this._themeClass);this._rootDiv.className=d;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var d=this._clientDiv;this._wrapMode?(d.style.whiteSpace="pre-wrap",d.style.wordWrap="break-word"):(d.style.whiteSpace="pre",d.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,d,c){if(this._clientDiv){var e=this._model,f=this._getSelection(),
h=this._getScroll(),g=f.getCaret(),i=f.start,l=f.end,m=e.getLineAtOffset(l),j=Math.max(Math.max(i,e.getLineStart(m)),l-1),e=this._getClientWidth(),m=this._getClientHeight(),k=e/4,o=this._getBoundsAtOffset(g===i?i:j),t=o.left,s=o.right,r=o.top,v=o.bottom;a&&!f.isEmpty()&&(o=this._getBoundsAtOffset(g===l?i:j),o.top===r?g===i?s=t+Math.min(o.right-t,e):t=s-Math.min(s-o.left,e):g===i?v=r+Math.min(o.bottom-r,m):r=v-Math.min(v-o.top,m));a=0;t<h.x&&(a=Math.min(t-h.x,-k));s>h.x+e&&(a=Math.max(s-h.x-e,k));
f=0;r<h.y?f=r-h.y:v>h.y+m&&(f=v-h.y-m);c&&(c>0?f>0&&(f=Math.max(f,c)):f<0&&(f=Math.min(f,c)));if(a!==0||f!==0)return f!==0&&typeof d==="number"&&(d<0&&(d=0),d>1&&(d=1),f+=Math.floor(f>0?d*m:-d*m)),this._scrollViewAnimated(a,f,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];t(b.target,b.type,b.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=
null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,d=b.getLineAtOffset(a.start),c=b.getLineAtOffset(a.end),e=this._getLineNext();if(e){var f=this._getLinePrevious(),h;d<e.lineIndex?(h=e,d=0):d>f.lineIndex?(h=f,d=0):(h=this._getLineNode(d),d=a.start-b.getLineStart(d));c<e.lineIndex?b=0:c>f.lineIndex?(e=f,b=0):(e=this._getLineNode(c),b=a.end-b.getLineStart(c));this._setDOMSelection(h,d,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 d=this._clientDiv,c=this._viewDiv;if(d){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,f=this._getScroll(!1),h=this._getViewPadding(),g=e.getLineCount(),i=this._getLineHeight(),l=!1,m=!1,j=!1,k=this._metrics.scrollWidth;if(this._wrapMode)d.style.width=(this._metrics.wrapWidth||this._getClientWidth())+
"px";var o,t,s,r,u=0,w=0,x;if(this._lineHeight){for(;w<g;){x=this._getLineHeight(w);if(u+x>f.y)break;u+=x;w++}o=w;t=Math.max(0,o-1);s=e=f.y-u;o>0&&(e+=this._getLineHeight(o-1))}else r=Math.max(0,f.y)/i,o=Math.floor(r),t=Math.max(0,o-1),e=Math.round((r-t)*i),s=Math.round((r-o)*i);this._topIndexY=s;r=this._rootDiv;var P=r.clientWidth,J=r.clientHeight;if(a){i=0;this._leftDiv&&(o=this._leftDiv.getBoundingClientRect(),i=o.right-o.left);o=this._getClientWidth();r=this._getClientHeight();m=o;if(this._wrapMode){if(this._metrics.wrapWidth)m=
this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,m);for(;w<g;)x=this._getLineHeight(w,!1),u+=x,w++;g=u}else{r=this._getClientHeight();s=Math.min(o+Math.floor((r+s)/i),g-1);var f=Math.min(s+1,g-1),G;for(x=d.firstChild;x;){G=x.lineIndex;var F=x.nextSibling;if(!(t<=G&&G<=f)||x.lineRemoved||x.lineIndex===-1)this._mouseWheelLine===x?(x.style.display="none",x.lineIndex=-1):d.removeChild(x);x=F}x=this._getLineNext();var F=c.ownerDocument,L=F.createDocumentFragment();for(G=t;G<=f;G++)if(!x||x.lineIndex>
G)(new v(this,G)).create(L,null);else{L.firstChild&&(d.insertBefore(L,x),L=F.createDocumentFragment());if(x&&x.lineChanged)x=(new v(this,G)).create(L,x),x.lineChanged=!1;x=this._getLineNext(x)}L.firstChild&&d.insertBefore(L,x);if(b.isWebkit&&!this._wrapMode)d.style.width="0x7fffffffpx";x=this._getLineNext();G=r+e;for(L=!1;x;){t=x.lineWidth;if(t===void 0)if(F=x._line.getBoundingClientRect(),t=x.lineWidth=Math.ceil(F.right-F.left),F=F.bottom-F.top,this._lineHeight)this._lineHeight[x.lineIndex]=F;else if(i!==
0&&F!==0&&Math.ceil(i)!==Math.ceil(F))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[x.lineIndex]=F;if(this._lineHeight&&!L&&(G-=this._lineHeight[x.lineIndex],G<0))s=x.lineIndex,L=!0;if(!this._wrapMode){if(t>=this._maxLineWidth)this._maxLineWidth=t,this._maxLineIndex=x.lineIndex;if(this._checkMaxLineIndex===x.lineIndex)this._checkMaxLineIndex=-1}if(x.lineIndex===o)this._topChild=x;if(x.lineIndex===s)this._bottomChild=x;x=this._getLineNext(x)}if(this._checkMaxLineIndex!==-1&&(G=this._checkMaxLineIndex,
this._checkMaxLineIndex=-1,0<=G&&G<g)){i=new v(this,G);F=i.getBoundingClientRect();t=F.right-F.left;if(t>=this._maxLineWidth)this._maxLineWidth=t,this._maxLineIndex=G;i.destroy()}for(;w<g;)x=this._getLineHeight(w,w<=s),u+=x,w++;g=u;this._updateRuler(this._leftDiv,o,f,J);this._updateRuler(this._rightDiv,o,f,J);this._updateRuler(this._marginDiv,o,f,J);i=0;this._leftDiv&&(o=this._leftDiv.getBoundingClientRect(),i=o.right-o.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-
f.left);c.style.left=i+"px";c.style.right=f+"px";f=this._scrollDiv;f.style.height=g+"px";o=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){u=l=r;(w=c.style.overflowX==="scroll")?l+=k:u-=k;x=s=o;(t=c.style.overflowY==="scroll")?s+=k:x-=k;r=l;o=s;g>r&&(j=!0,o=x);this._maxLineWidth>o&&(m=!0,r=u,g>r&&(j=!0,o=x));if(w!==m)c.style.overflowX=m?"scroll":"hidden";if(t!==j)c.style.overflowY=j?"scroll":"hidden";l=w!==m||t!==j}j=o;if(this._wrapMode){if(this._metrics.wrapWidth)j=this._metrics.wrapWidth}else j=
Math.max(this._maxLineWidth,j);m=j;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>o)j+=h.right+h.left;f.style.width=j+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=j+"px";f=this._getScroll(!1)}if(this._vScrollDiv)j=r-8,u=Math.max(15,Math.ceil(Math.min(1,j/(g+h.top+h.bottom))*j)),this._vScrollDiv.style.left=i+o-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*j/g))+"px",this._vScrollDiv.style.height=u+"px";if(!this._wrapMode&&this._hScrollDiv)j=o-8,u=Math.max(15,Math.ceil(Math.min(1,
j/(this._maxLineWidth+h.left+h.right))*j)),this._hScrollDiv.style.left=i+Math.floor(Math.max(0,Math.floor(f.x*j/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=r-9+"px",this._hScrollDiv.style.width=u+"px";w=f.x;u=this._clipDiv;j=this._overlayDiv;if(s=this._marginDiv)s.style.left=-w+i+this._metrics.marginWidth+h.left+"px",s.style.bottom=(c.style.overflowX==="scroll"?k:0)+"px";if(u){u.scrollLeft=w;u.scrollTop=0;c=i+h.left;k=h.top;a=o;i=r;w=0;s=-e;if(f.x===0)c-=h.left,a+=h.left,w=h.left;f.x+o===
m&&(a+=h.right);f.y===0&&(k-=h.top,i+=h.top,s+=h.top);f.y+r===g&&(i+=h.bottom);u.style.left=c+"px";u.style.top=k+"px";u.style.right=P-a-c+"px";u.style.bottom=J-i-k+"px";d.style.left=w+"px";d.style.top=s+"px";d.style.width=m+"px";d.style.height=r+e+"px";if(j)j.style.left=d.style.left,j.style.top=d.style.top,j.style.width=d.style.width,j.style.height=d.style.height}else{c=w;k=e;P=w+o;J=e+r;c===0&&(c-=h.left);k===0&&(k-=h.top);P===m&&(P+=h.right);f.y+r===g&&(J+=h.bottom);d.style.clip="rect("+k+"px,"+
P+"px,"+J+"px,"+c+"px)";d.style.left=-w+i+h.left+"px";d.style.width=(this._wrapMode||b.isWebkit?m:o+w)+"px";if(!a)d.style.top=-e+h.top+"px",d.style.height=r+e+"px";if(j&&(j.style.clip=d.style.clip,j.style.left=d.style.left,j.style.width=d.style.width,!a))j.style.top=d.style.top,j.style.height=d.style.height}this._updateDOMSelection();if(l)d=this._ensureCaretVisible,this._ensureCaretVisible=!1,d&&this._showCaret(),this._queueUpdate()}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?
(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,d,c,e){if(a)for(var h=this._parent.ownerDocument,g=this._getLineHeight(),i=this._getViewPadding(),a=a.firstChild;a;){var l=a._ruler,m=g,j=l.getOverview();j==="page"&&(m+=this._topIndexY);a.style.top=-m+"px";a.style.height=e+m+"px";a.rulerChanged&&f(l.getRulerStyle(),a);var k,o=a.firstChild;o?(k=o,o=o.nextSibling):(k=b.createElement(h,"div"),k.style.visibility="hidden",a.appendChild(k));var t;
if(a.rulerChanged&&k){m=-1;if(t=l.getWidestAnnotation())if(f(t.style,k),t.html)k.innerHTML=t.html;k.lineIndex=m;k.style.height=g+i.top+"px"}var s;if(j==="page"){for(l=l.getAnnotations(d,c+1);o;)m=o.lineIndex,t=o.nextSibling,(!(d<=m&&m<=c)||o.lineChanged)&&a.removeChild(o),o=t;o=a.firstChild.nextSibling;s=h.createDocumentFragment();for(m=d;m<=c;m++)if(!o||o.lineIndex>m){k=b.createElement(h,"div");if(t=l[m]){f(t.style,k);if(t.html)k.innerHTML=t.html;k.annotation=t}k.lineIndex=m;k.style.height=this._getLineHeight(m)+
"px";s.appendChild(k)}else if(s.firstChild&&(a.insertBefore(s,o),s=h.createDocumentFragment()),o)o=o.nextSibling;s.firstChild&&a.insertBefore(s,o)}else{t=this._getClientHeight();m=this._model.getLineCount();o=t+i.top+i.bottom-2*this._metrics.scrollWidth;j=g*m<o?g:o/m;if(a.rulerChanged){for(t=a.childNodes.length;t>1;)a.removeChild(a.lastChild),t--;l=l.getAnnotations(0,m);s=h.createDocumentFragment();for(var r in l)if(m=r>>>0,!(m<0)){k=b.createElement(h,"div");t=l[r];f(t.style,k);k.style.position="absolute";
k.style.top=this._metrics.scrollWidth+g+Math.floor(m*j)+"px";if(t.html)k.innerHTML=t.html;k.annotation=t;k.lineIndex=m;s.appendChild(k)}a.appendChild(s)}else if(a._oldTrackHeight!==o)for(k=a.firstChild?a.firstChild.nextSibling:null;k;)k.style.top=this._metrics.scrollWidth+g+Math.floor(k.lineIndex*j)+"px",k=k.nextSibling;a._oldTrackHeight=o}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";b.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");
b.isFirefox&&b.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var d=document.getElementById("_textviewStyle");if(d)d.removeChild(d.firstChild),d.appendChild(document.createTextNode(a));else{d=b.createElement(document,"style");d.id="_textviewStyle";var c=document.getElementsByTagName("head")[0]||document.documentElement;d.appendChild(document.createTextNode(a));c.insertBefore(d,c.firstChild)}}},_updateStyle:function(a){if(!a&&
b.isIE)this._rootDiv.style.lineHeight="normal";var d=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?d.lineHeight-(d.lineTrim.top+d.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};e.EventTarget.addMixin(u.prototype);return{TextView:u}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,k){function j(e){this._model=e;this._projections=[];var c=this;this._listener={onChanged:function(e){c._onChanged(e)},onChanging:function(e){c._onChanging(e)}};e.addEventListener("postChanged",this._listener.onChanged);e.addEventListener("preChanging",this._listener.onChanging)}j.prototype={destroy:function(){if(this._model)this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null},addProjection:function(e){if(e){var c=this._model,i=this._projections;e._lineIndex=c.getLineAtOffset(e.start);e._lineCount=c.getLineAtOffset(e.end)-e._lineIndex;var b=e.text;b||(b="");e._model=typeof b==="string"?new g.TextModel(b,c.getLineDelimiter()):b;var c=this.mapOffset(e.start,!0),b=e.end-e.start,f=e._lineCount,h=e._model.getCharCount(),d=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:e._model.getText(),
start:c,removedCharCount:b,addedCharCount:h,removedLineCount:f,addedLineCount:d});var a=this._binarySearch(i,e.start);i.splice(a,0,e);this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:h,removedLineCount:f,addedLineCount:d})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,c){var g=this._projections,b=0,f,h;if(c){for(f=0;f<g.length;f++){h=g[f];if(h.start>e)break;if(h.end>e)return-1;b+=h._model.getCharCount()-
(h.end-h.start)}return e+b}for(f=0;f<g.length;f++){h=g[f];if(h.start>e-b)break;var d=h._model.getCharCount();if(h.start+d>e-b)return-1;b+=d-(h.end-h.start)}return e-b},removeProjection:function(e){var c,g=0;for(c=0;c<this._projections.length;c++){var b=this._projections[c];if(b===e){e=b;break}g+=b._model.getCharCount()-(b.end-b.start)}if(c<this._projections.length){var b=this._model,g=e.start+g,f=e.end-e.start,h=e._lineCount,d=e._model.getCharCount(),a=e._model.getLineCount()-1;this.onChanging({type:"Changing",
text:b.getText(e.start,e.end),start:g,removedCharCount:d,addedCharCount:f,removedLineCount:a,addedLineCount:h});this._projections.splice(c,1);this.onChanged({type:"Changed",start:g,removedCharCount:d,addedCharCount:f,removedLineCount:a,addedLineCount:h})}},_binarySearch:function(e,c){for(var g=e.length,b=-1,f;g-b>1;)f=Math.floor((g+b)/2),c<=e[f].start?g=f:b=f;return g},getCharCount:function(){for(var e=this._model.getCharCount(),c=this._projections,g=0;g<c.length;g++){var b=c[g];e+=b._model.getCharCount()-
(b.end-b.start)}return e},getLine:function(e,c){if(e<0)return null;var g=this._model,b=this._projections,f=0,h=[],d=0,a,l,m;for(a=0;a<b.length;a++){m=b[a];if(m._lineIndex>=e-f)break;l=m._model.getLineCount()-1;if(m._lineIndex+l>=e-f)if(d=e-(m._lineIndex+f),d<l)return m._model.getLine(d,c);else h.push(m._model.getLine(l));d=m.end;f+=l-m._lineCount}for(d=Math.max(d,g.getLineStart(e-f));a<b.length;a++){m=b[a];if(m._lineIndex>e-f)break;h.push(g.getText(d,m.start));l=m._model.getLineCount()-1;if(m._lineIndex+
l>e-f)return h.push(m._model.getLine(0,c)),h.join("");h.push(m._model.getText());d=m.end;f+=l-m._lineCount}b=g.getLineEnd(e-f,c);d<b&&h.push(g.getText(d,b));return h.join("")},getLineAtOffset:function(e){for(var c=this._model,g=this._projections,b=0,f=0,h=0;h<g.length;h++){var d=g[h];if(d.start>e-b)break;var a=d._model.getCharCount();if(d.start+a>e-b){g=e-(d.start+b);f+=d._model.getLineAtOffset(g);b+=g;break}f+=d._model.getLineCount()-1-d._lineCount;b+=a-(d.end-d.start)}return c.getLineAtOffset(e-
b)+f},getLineCount:function(){for(var e=this._projections,c=this._model.getLineCount(),g=0;g<e.length;g++){var b=e[g];c+=b._model.getLineCount()-1-b._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(e,c){if(e<0)return-1;for(var g=this._model,b=this._projections,f=0,h=0,d=0;d<b.length;d++){var a=b[d];if(a._lineIndex>e-f)break;var l=a._model.getLineCount()-1;if(a._lineIndex+l>e-f)return a._model.getLineEnd(e-(a._lineIndex+f),c)+a.start+h;h+=
a._model.getCharCount()-(a.end-a.start);f+=l-a._lineCount}return g.getLineEnd(e-f,c)+h},getLineStart:function(e){if(e<0)return-1;for(var c=this._model,g=this._projections,b=0,f=0,h=0;h<g.length;h++){var d=g[h];if(d._lineIndex>=e-b)break;var a=d._model.getLineCount()-1;if(d._lineIndex+a>=e-b)return d._model.getLineStart(e-(d._lineIndex+b))+d.start+f;f+=d._model.getCharCount()-(d.end-d.start);b+=a-d._lineCount}return c.getLineStart(e-b)+f},getText:function(e,c){e===void 0&&(e=0);var g=this._model,b=
this._projections,f=0,h=[],d,a,l;for(d=0;d<b.length;d++){a=b[d];if(a.start>e-f)break;l=a._model.getCharCount();if(a.start+l>e-f)if(c!==void 0&&a.start+l>c-f)return a._model.getText(e-(a.start+f),c-(a.start+f));else h.push(a._model.getText(e-(a.start+f))),e=a.end+f+l-(a.end-a.start);f+=l-(a.end-a.start)}var m=e-f;if(c!==void 0){for(;d<b.length;d++){a=b[d];if(a.start>c-f)break;h.push(g.getText(m,a.start));l=a._model.getCharCount();if(a.start+l>c-f)return h.push(a._model.getText(0,c-(a.start+f))),h.join("");
h.push(a._model.getText());m=a.end;f+=l-(a.end-a.start)}h.push(g.getText(m,c-f))}else{for(;d<b.length;d++)a=b[d],h.push(g.getText(m,a.start)),h.push(a._model.getText()),m=a.end;h.push(g.getText(m))}return h.join("")},_onChanged:function(){var e=this._change,c=e.baseStart,g=e.baseEnd,b,f,h=this._projections;for(b=0;b<h.length;b++)if(f=h[b],f.end>c)break;var d=b;for(b=0;b<h.length;b++)if(f=h[b],f.start>=g)break;var a=b,l=this._model,c=e.baseText.length-(g-c);for(b=a;b<h.length;b++)f=h[b],f.start+=c,
f.end+=c,f._lineIndex=l.getLineAtOffset(f.start);f=h.splice(d,a-d);for(b=0;b<f.length;b++)f[b].annotation&&f[b].annotation._expand();this.onChanged({type:"Changed",start:e.start,removedCharCount:e.removedCharCount,addedCharCount:e.addedCharCount,removedLineCount:e.removedLineCount,addedLineCount:e.addedLineCount});this._change=void 0},_onChanging:function(e){var c=!!this._change,g=this._change||{},b=e.start,f=b+e.removedCharCount;g.baseStart=b;g.baseEnd=f;g.baseText=e.text;g.addedLineCount=e.addedLineCount;
if(!c){this._change=g;g.text=e.text;var h=this._projections,d,a,l,e=function(b){for(a=0,d=0;a<h.length;a++){l=h[a];if(l.start>b)break;if(l.end>b)return-1;d+=l._model.getCharCount()-(l.end-l.start)}return b+d};g.start=e(b);if(g.start===-1)g.text=this._model.getText(l.start,b)+g.text,g.addedLineCount+=this._model.getLineAtOffset(b)-this._model.getLineAtOffset(l.start),g.start=l.start+d;g.end=e(f);if(g.end===-1)g.text+=this._model.getText(f,l.end),g.addedLineCount+=this._model.getLineAtOffset(l.end)-
this._model.getLineAtOffset(f),g.end=l.start+d}g.addedCharCount=g.text.length;g.removedCharCount=g.end-g.start;g.removedLineCount=this.getLineAtOffset(g.end)-this.getLineAtOffset(g.start);this.onChanging({type:"Changing",text:g.text,start:g.start,removedCharCount:g.removedCharCount,addedCharCount:g.addedCharCount,removedLineCount:g.removedLineCount,addedLineCount:g.addedLineCount})},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},
setText:function(e,c,g){function b(b){for(d=0,h=0;d<f.length;d++){a=f[d];if(a.start>b-h)break;var c=a._model.getCharCount();if(a.start+c>b-h)return-1;h+=c-(a.end-a.start)}return b-h}this._change={text:e||"",start:c||0,end:g===void 0?this.getCharCount():g};var f=this._projections,h,d,a,l,m,e=b(this._change.start);if(e===-1)l={projection:a,start:this._change.start-(a.start+h)},e=a.end;c=b(this._change.end);if(c===-1)m={projection:a,end:this._change.end-(a.start+h)},c=a.start;if(l&&m&&l.projection===
m.projection)a._model.setText(this._change.text,l.start,m.end);else{this._model.setText(this._change.text,e,c);if(l)a=l.projection,a._model.setText("",l.start);if(m)a=m.projection,a._model.setText("",0,m.end),a.start=a.end,a._lineCount=0}this._change=void 0}};k.EventTarget.addMixin(j.prototype);return{ProjectionTextModel:j}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages,orion/editor/textView,orion/editor/textModel,orion/editor/projectionTextModel,orion/editor/util,orion/util".split(","),function(g,k,j,e,c,i){function b(b){this._view=b;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(b.getOptions("parent").ownerDocument)}b.getTooltip=function(c){if(!c._tooltip)c._tooltip=new b(c);return c._tooltip};b.prototype={_create:function(b){if(!this._tooltipDiv){var e=
this._tooltipDiv=i.createElement(b,"div");e.tabIndex=0;e.className="textviewTooltip";e.setAttribute("aria-live","assertive");e.setAttribute("aria-atomic","true");var d=this._tooltipContents=i.createElement(b,"div");e.appendChild(d);b.body.appendChild(e);var a=this;c.addEventListener(e,"mouseover",function(){if(a._hideDelay){var b=a._getWindow();if(a._delayedHideTimeout)b.clearTimeout(a._delayedHideTimeout),a._delayedHideTimeout=null;if(a._hideTimeout)b.clearTimeout(a._hideTimeout),a._hideTimeout=
null;a._nextTarget=null}},!1);c.addEventListener(e,"mouseout",function(b){b=b.relatedTarget||b.toElement;b===e||a._hasFocus()||(!b||!c.contains(e,b))&&a._hide()},!1);c.addEventListener(e,"keydown",function(b){b.keyCode===27&&a._hide()},!1);c.addEventListener(b,"mousedown",this._mouseDownHandler=function(b){a.isVisible()&&(c.contains(e,b.target||b.srcElement)||a._hide())},!0);this._view.addEventListener("Destroy",function(){a.destroy()});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);c.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var b=this._tooltipDiv;return!b?!1:c.contains(b,b.ownerDocument.activeElement)},hide:function(b){if(b===void 0)b=this._hideDelay;var c=this._getWindow();if(this._delayedHideTimeout)c.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var d=this;b?d._delayedHideTimeout=c.setTimeout(function(){d._delayedHideTimeout=null;d._hide();d.setTarget(d._nextTarget,0)},b):(d._hide(),d.setTarget(d._nextTarget,0))},_hide:function(){var b=this._tooltipDiv;if(b){this._hasFocus()&&this._view.focus();if(this._contentsView)this._contentsView.destroy(),this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";b.style.visibility="hidden";b=this._getWindow();if(this._showTimeout)b.clearTimeout(this._showTimeout),
this._showTimeout=null;if(this._delayedHideTimeout)b.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=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,d){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=b,this.hide(d)}else if(this._target=b){var a=
this,b=a._getWindow();if(a._showTimeout)b.clearTimeout(a._showTimeout),a._showTimeout=null;c===0?a.show(!0):a._showTimeout=b.setTimeout(function(){a._showTimeout=null;a.show(!0)},c?c:a._showDelay)}},show:function(b){if(this._target){var c=this._target.getTooltipInfo();if(c){var d=this._tooltipDiv,a=this._tooltipContents;d.style.left=d.style.right=d.style.width=d.style.height=a.style.width=a.style.height="auto";var g=c.contents;g instanceof Array&&(g=this._getAnnotationContents(g));if(typeof g==="string")a.innerHTML=
g;else if(this._isNode(g))a.appendChild(g);else if(g instanceof e.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=a;var s=j.themeClass;s?((s=s.replace("tooltipTheme",""))&&(s=" "+s),s="tooltipTheme"+s):s="tooltipTheme";j.themeClass=s;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(g);g=j.computeSize();a.style.width=g.width+"px";a.style.height=g.height+"px";j.resize()}else return;a=d.ownerDocument.documentElement;
c.anchor==="right"?(g=a.clientWidth-c.x,d.style.right=g+"px"):(g=parseInt(this._getNodeStyle(d,"padding-left","0"),10),g+=parseInt(this._getNodeStyle(d,"border-left-width","0"),10),g=c.x-g,d.style.left=g+"px");d.style.maxWidth=a.clientWidth-g-10+"px";g=parseInt(this._getNodeStyle(d,"padding-top","0"),10);g+=parseInt(this._getNodeStyle(d,"border-top-width","0"),10);g=c.y-g;d.style.top=g+"px";d.style.maxHeight=a.clientHeight-g-10+"px";d.style.opacity="1";d.style.visibility="visible";if(b){var r=this,
v=this._getWindow();r._hideTimeout=v.setTimeout(function(){r._hideTimeout=null;var a=parseFloat(r._getNodeStyle(d,"opacity","1"));r._fadeTimeout=v.setInterval(function(){d.style.visibility==="visible"&&a>0?(a-=0.1,d.style.opacity=a):r._hide()},r._fadeDelay/10)},r._autoHideDelay)}}}},_getAnnotationContents:function(b){function h(a,b){var d=u.getLineStart(u.getLineAtOffset(a)),c=u.getLineEnd(u.getLineAtOffset(b),!0);return u.getText(d,c)}function d(a){var b=a.title,d=i.createElement(k,"div");d.className=
"tooltipRow";if(a.html)d.innerHTML=a.html,d.lastChild&&c.addEventListener(d.lastChild,"click",function(){var b=a.start,d=a.end;v.getBaseModel&&(b=v.mapOffset(b,!0),d=v.mapOffset(d,!0));r.setSelection(b,d,1/3,function(){j._hide()})},!1),d.appendChild(k.createTextNode("\u00a0"));b||(b=h(a.start,a.end));typeof b==="function"&&(b=a.title());if(typeof b==="string"){var e=i.createElement(k,"span");e.appendChild(k.createTextNode(b));b=e}d.appendChild(b);return d}for(var a,l=[],m=0;m<b.length;m++)a=b[m],
a.title!==""&&!a.groupAnnotation&&l.push(a);b=l;if(b.length===0)return null;var j=this,k=this._tooltipDiv.ownerDocument,r=this._view,v=r.getModel(),u=v.getBaseModel?v.getBaseModel():v;if(b.length===1)if(a=b[0],a.title!==void 0){a=d(a);if(a.firstChild)(b=a.firstChild.className)&&(b+=" "),b+="single",a.firstChild.className=b;return a}else return b=new e.ProjectionTextModel(u),l=u.getLineStart(u.getLineAtOffset(a.start)),m=u.getCharCount(),a.end!==m&&b.addProjection({start:a.end,end:m}),l>0&&b.addProjection({start:0,
end:l}),b;else{l=i.createElement(k,"div");a=i.createElement(k,"em");a.appendChild(k.createTextNode(g.multipleAnnotations));l.appendChild(a);for(m=0;m<b.length;m++)a=b[m],(a=d(a))&&l.appendChild(a);return l}},_getNodeStyle:function(b,c,d){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||d},_isNode:function(b){return typeof Node==="object"?b instanceof Node:b&&typeof b==="object"&&typeof b.nodeType==="number"&&typeof b.nodeName==="string"}};return{Tooltip:b}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function j(b,a,c){this.start=b;this.end=a;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(){}function c(b,a){var c=b.lastIndexOf("."),c=b.substring(c+1),f={title:g[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};a?f.lineStyle={styleClass:"annotationLine "+
c}:f.rangeStyle={styleClass:"annotationRange "+c};e.registerType(b,f)}function i(){}function b(b){this._annotations=[];var a=this;this._listener={onChanged:function(b){a._onChanged(b)}};this.setTextModel(b)}function f(b,a){this._view=b;this._annotationModel=a;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("postLineStyle",
this._listener.onLineStyle);a.addEventListener("Changed",this._listener.onChanged)}j.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);
return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},collapse:function(){if(this._collapse()){var b=this._projectionModel,a=b.getBaseModel();this._projection={annotation:this,start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};b.addProjection(this._projection)}},expand:function(){this._expand()&&
this._projectionModel.removeProjection(this._projection)}};e.ANNOTATION_ERROR="orion.annotation.error";e.ANNOTATION_WARNING="orion.annotation.warning";e.ANNOTATION_TASK="orion.annotation.task";e.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";e.ANNOTATION_BOOKMARK="orion.annotation.bookmark";e.ANNOTATION_FOLDING="orion.annotation.folding";e.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";e.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";e.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";
e.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";e.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";e.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";e.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";e.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";e.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";e.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";e.ANNOTATION_BLAME="orion.annotation.blame";e.ANNOTATION_CURRENT_BLAME=
"orion.annotation.currentBlame";var h={};e.registerType=function(b,a){var c=a;if(typeof c!=="function")c=function(a,b,d){this.start=a;this.end=b;if(d!==void 0)this.title=d},c.prototype=a;c.prototype.type=b;h[b]=c;return b};e.createAnnotation=function(b,a,c,e){return new (this.getType(b))(a,c,e)};e.getType=function(b){return h[b]};c(e.ANNOTATION_ERROR);c(e.ANNOTATION_WARNING);c(e.ANNOTATION_TASK);c(e.ANNOTATION_BREAKPOINT);c(e.ANNOTATION_BOOKMARK);c(e.ANNOTATION_CURRENT_BRACKET);c(e.ANNOTATION_MATCHING_BRACKET);
c(e.ANNOTATION_CURRENT_SEARCH);c(e.ANNOTATION_MATCHING_SEARCH);c(e.ANNOTATION_READ_OCCURRENCE);c(e.ANNOTATION_WRITE_OCCURRENCE);c(e.ANNOTATION_SELECTED_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINKED_GROUP);c(e.ANNOTATION_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINE,!0);c(e.ANNOTATION_BLAME,!0);c(e.ANNOTATION_CURRENT_BLAME,!0);e.registerType(e.ANNOTATION_FOLDING,j);i.addMixin=function(b){var a=i.prototype,c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])};i.prototype={addAnnotationType:function(b){if(!this._annotationTypes)this._annotationTypes=
[];this._annotationTypes.push(b)},getAnnotationTypePriority:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===b)return a+1;return 0},getAnnotationsByType:function(b,a,c){b=b.getAnnotations(a,c);for(c=[];b.hasNext();)a=b.next(),this.getAnnotationTypePriority(a.type)!==0&&c.push(a);var e=this;c.sort(function(a,b){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(b){return this.getAnnotationTypePriority(b)!==
0},removeAnnotationType:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===b){this._annotationTypes.splice(a,1);break}}};b.prototype={addAnnotation:function(b){if(b){var a=this._annotations,c=this._binarySearch(a,b.start);a.splice(c,0,b);b._annotationModel=this;this.onChanged({type:"Changed",added:[b],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(b,a){var c=this._annotations,e,f=0,h;h=b===
void 0&&a===void 0?function(){return f<c.length?c[f++]:null}:function(){for(;f<c.length;){var e=c[f++];if(b===e.start||(b>e.start?b<e.end:e.start<a))return e;if(e.start>=a)break}return null};e=h();return{next:function(){var a=e;a&&(e=h());return a},hasNext:function(){return e!==null}}},modifyAnnotation:function(b){if(b&&!(this._getAnnotationIndex(b)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[b]})},onChanged:function(b){return this.dispatchEvent(b)},removeAnnotations:function(b){var a=
this._annotations,c,e;if(b){c=[];for(e=a.length-1;e>=0;e--){var f=a[e];if(f.type===b)a.splice(e,1),c.splice(0,0,f),f._annotationModel=null}}else c=a;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(b){if(b){var a=this._getAnnotationIndex(b);if(!(a<0))b._annotationModel=null,this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})}},replaceAnnotations:function(b,a){var c=this._annotations,e,f,h,g=[];if(b)for(e=b.length-1;e>=
0;e--)if(h=b[e],f=this._getAnnotationIndex(h),!(f<0))h._annotationModel=null,c.splice(f,1),g.splice(0,0,h);a||(a=[]);for(e=0;e<a.length;e++)h=a[e],f=this._binarySearch(c,h.start),h._annotationModel=this,c.splice(f,0,h);this.onChanged({type:"Changed",removed:g,added:a,changed:[]})},setTextModel:function(b){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=b)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(b,a){for(var c=
b.length,e=-1,f;c-e>1;)f=Math.floor((c+e)/2),a<=b[f].start?c=f:e=f;return c},_getAnnotationIndex:function(b){for(var a=this._annotations,c=this._binarySearch(a,b.start);c<a.length&&a[c].start===b.start;){if(a[c]===b)return c;c++}return-1},_onChanged:function(b){var a=b.start,c=b.removedCharCount,e=this._annotations,f=a+c;if(0<e.length){for(var h={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:b},b=b.addedCharCount-c,c=0;c<e.length;c++){var g=e[c];if(g.start>=f)g._oldStart=g.start,
g._oldEnd=g.end,g.start+=b,g.end+=b,h.changed.push(g);else if(!(g.end<=a))g.start<a&&f<g.end?(g._oldStart=g.start,g._oldEnd=g.end,g.end+=b,h.changed.push(g)):(e.splice(c,1),h.removed.push(g),g._annotationModel=null,g.expand&&g.expand(),c--)}if(h.added.length>0||h.removed.length>0||h.changed.length>0)this.onChanged(h)}}};k.EventTarget.addMixin(b.prototype);f.prototype={destroy:function(){var b=this._view;if(b)b.removeEventListener("Destroy",this._listener.onDestroy),b.removeEventListener("LineStyle",
this._listener.onLineStyle),this.view=null;(b=this._annotationModel)&&b.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.tagName&&!b.tagName)b.tagName=a.tagName;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||
(b.attributes[c]=a.attributes[c])}}return b},_mergeStyleRanges:function(b,a){b||(b=[]);var c,e;for(e=0;e<b.length&&a;e++){var f=b[e];if(a.end<=f.start)break;if(!(a.start>=f.end)){c=this._mergeStyle({},f.style);c=this._mergeStyle(c,a.style);var h=[];h.push(e,1);a.start<f.start&&h.push({start:a.start,end:f.start,style:a.style});a.start>f.start&&h.push({start:f.start,end:a.start,style:f.style});h.push({start:Math.max(f.start,a.start),end:Math.min(f.end,a.end),style:c});a.end<f.end&&h.push({start:a.end,
end:f.end,style:f.style});a=a.end>f.end?{start:f.end,end:a.end,style:a.style}:null;Array.prototype.splice.apply(b,h)}}a&&(c=this._mergeStyle({},a.style),b.splice(e,0,{start:a.start,end:a.end,style:c}));return b},_onAnnotationModelChanged:function(b){function a(a,b){h.getBaseModel&&(a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));a!==-1&&b!==-1&&e.redrawRange(a,b)}function c(b,d){for(var e=0;e<b.length;e++)if(f.isAnnotationTypeVisible(b[e].type)){var h=b[e];a(h.start,h.end);d&&h._oldStart!==void 0&&h._oldEnd&&
a(h._oldStart,h._oldEnd)}}var e=this._view;if(e){var f=this,h=e.getModel();c(b.added);c(b.removed);c(b.changed,!0)}},_onDestroy:function(){this.destroy()},_onLineStyle:function(b){var a=this._annotationModel,c=b.textView.getModel(),e=a.getTextModel(),f=b.lineStart,h=b.lineStart+b.lineText.length;e!==c&&(f=c.mapOffset(f),h=c.mapOffset(h));for(a=a.getAnnotations(f,h);a.hasNext();)if(f=a.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,g=f.end;e!==c&&(h=c.mapOffset(h,!0),g=
c.mapOffset(g,!0));b.ranges=this._mergeStyleRanges(b.ranges,{start:h,end:g,style:f.rangeStyle})}if(f.lineStyle)b.style=this._mergeStyle({},b.style),b.style=this._mergeStyle(b.style,f.lineStyle)}}};i.addMixin(f.prototype);return{FoldingAnnotation:j,AnnotationType:e,AnnotationTypeList:i,AnnotationModel:b,AnnotationStyler:f}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(g,k,j,e,c,i){function b(b){b=b||{};this._domNode=b.domNode;this._model=b.model;this._undoStack=b.undoStack;this._statusReporter=b.statusReporter;this._title=null;var a=this;this._listener={onChanged:function(b){a.onChanged(b)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function f(d){d=d||{};b.call(this,d);this._textViewFactory=d.textViewFactory;this._undoStackFactory=d.undoStackFactory;this._textDNDFactory=d.textDNDFactory;this._annotationFactory=d.annotationFactory;this._foldingRulerFactory=d.foldingRulerFactory;this._lineNumberRulerFactory=d.lineNumberRulerFactory;this._contentAssistFactory=d.contentAssistFactory;this._keyBindingFactory=d.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var h=e.AnnotationType;b.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(b,a){return this.getModel().getText(b,a)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(b){return this.dispatchEvent(b)},onInputChanged:function(b){return this.dispatchEvent(b)},onChanged:function(){this.checkDirty()},reportStatus:function(b,a,c){this._statusReporter&&this._statusReporter(b,a,c)},resize:function(){},setDirty:function(b){if(this._dirty!==b)this._dirty=b,this.onDirtyChanged({type:"DirtyChanged"})},
_setModelText:function(b){this._model&&this._model.setText(b)},setInput:function(b,a,c,e){this._title=b;e||(a?this.reportStatus(a,"error"):c!==null&&c!==void 0&&typeof c==="string"&&this._setModelText(c),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:b,message:a,contents:c,contentsSaved:e})},setText:function(b,a,c){this.getModel().setText(b,a,c)},uninstall:function(){this.installed=!1}};k.EventTarget.addMixin(b.prototype);f.prototype=new b;
c.mixin(f.prototype,{destroy:function(){b.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(b,a){if(this._annotationRulerVisible!==b||a)if(this._annotationRulerVisible=b,this._annotationRuler){var c=this._textView;b?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(b,a){if(this._foldingRulerVisible!==b||a)if(this._foldingRulerVisible=
b,this._foldingRuler){var c=this._textView;c.getModel().getBaseModel&&(b?c.addRuler(this._foldingRuler):c.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(b,a){if(this._lineNumberRulerVisible!==b||a)if(this._lineNumberRulerVisible=b,this._lineNumberRuler){var c=this._textView;b?c.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(b,a){if(this._overviewRulerVisible!==b||a)if(this._overviewRulerVisible=
b,this._overviewRuler){var c=this._textView;b?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},mapOffset:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(b=c.mapOffset(b,a));return b},getLineAtOffset:function(b){return this.getModel().getLineAtOffset(this.mapOffset(b))},getLineStart:function(b){return this.getModel().getLineStart(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},_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===h.ANNOTATION_FOLDING&&a.expand&&a.expand()},setCaretOffset:function(b,a,c){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(b),b=f.mapOffset(b,!0));e.setCaretOffset(b,a,c)},setText:function(b,a,c){var e=this._textView,
f=e.getModel();f.getBaseModel&&(a!==void 0&&(this._expandOffset(a),a=f.mapOffset(a,!0)),c!==void 0&&(this._expandOffset(c),c=f.mapOffset(c,!0)));e.setText(b,a,c)},setSelection:function(b,a,c,e){var f=this._textView,h=f.getModel();h.getBaseModel&&(this._expandOffset(b),this._expandOffset(a),b=h.mapOffset(b,!0),a=h.mapOffset(a,!0));f.setSelection(b,a,c,e)},moveSelection:function(b,a,c,e){var f=this._textView;this.setSelection(b,a||b,1/3,function(){(e===void 0||e)&&f.focus();c&&c()})},_getTooltipInfo:function(b,
a){var c=this._textView,e=this.getAnnotationModel();if(!e)return null;var f=this._annotationStyler;if(!f)return null;var h=c.getOffsetAtLocation(b,a);if(h===-1)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(e,h,h+1);e=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&e.push(f[h]);if(e.length===0)return null;c=c.convert({x:b,y:a},"document","page");return{contents:e,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(b,a){var c=this._annotationModel;if(c){var e=this._textView;if(!e.getOptions("singleMode")){var f=
e.getModel(),g=a?f.getLineAtOffset(a.start):-1,i=f.getLineAtOffset(b.start),e=b.start===b.end,j=!a||a.start===a.end,k=f.getLineStart(i),w=f.getLineEnd(i);f.getBaseModel&&(k=f.mapOffset(k),w=f.mapOffset(w));f=this._currentLineAnnotation;if(!(g===i&&j&&e&&f&&f.start===k&&f.end===w)){var g=f?[f]:null,t;e&&(f=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,k,w),t=[f]);this._currentLineAnnotation=f;c.replaceAnnotations(g,t)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty();if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();var d=this,a=this._textView,c=this;this._listener={onModelChanged:function(){c.checkDirty()},onMouseOver:function(a){c._listener.onMouseMove(a)},onMouseMove:function(b){var d=
j.Tooltip.getTooltip(a);if(d&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,c._listener.lastMouseY=b.event.clientY,d.setTarget({x:b.x,y:b.y,getTooltipInfo:function(){return c._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(b){var d=j.Tooltip.getTooltip(a);if(d&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,c._listener.lastMouseY=b.event.clientY,
d.setTarget(null)},onScroll:function(){var b=j.Tooltip.getTooltip(a);b&&b.setTarget(null,0,0)},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);if(this._keyBindingFactory){var e;if(e=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(d,this._undoStack,this._contentAssist))this._textActions=e.textActions,this._linkedMode=e.linkedMode,this._sourceCodeActions=e.sourceCodeActions}e=function(a){if(a!==void 0&&a!==-1){for(var b=this.getView().getModel(),c=this.getAnnotationModel(),e=d.mapOffset(b.getLineStart(a)),
a=d.mapOffset(b.getLineEnd(a)),b=c.getAnnotations(e,a),f=null;b.hasNext();){var g=b.next();if(g.type===h.ANNOTATION_BOOKMARK){f=g;break}}f?c.removeAnnotation(f):(f=h.createAnnotation(h.ANNOTATION_BOOKMARK,e,a),f.title=void 0,c.addAnnotation(f))}};if(this._annotationFactory){var f=a.getModel();f.getBaseModel&&(f=f.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))f.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),
f.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(h.ANNOTATION_ERROR),f.addAnnotationType(h.ANNOTATION_WARNING),f.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_LINE),f.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_LINKED_GROUP),
f.addAnnotationType("orion.annotation.highlightError");var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),g=this._annotationRuler=f.annotationRuler;if(g)g.onDblClick=e,g.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===
void 0,!0);if(g=this._overviewRuler=f.overviewRuler)g.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK),g.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),
g.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||this._overviewRulerVisible===void 0,!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=e,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:a});b.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var d=this._textView;if(d)d.destroy(),
this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:d}),b.prototype.uninstall.call(this)},_updateCursorStatus:function(){var b=
this.getModel(),a=this.getCaretOffset(),c=b.getLineAtOffset(a),b=b.getLineStart(c);a-=b;for(var b=this.getKeyModes(),e=0;e<b.length;e++){var f=b[e];if(f.isActive()&&f.isStatusActive&&f.isStatusActive())return}this.reportStatus(i.formatMessage(g.lineColumn,c+1,a+1))},showAnnotations:function(b,a,c,e){var f=this._annotationModel;if(f){for(var g=[],i=[],j=f.getTextModel(),k=f.getAnnotations(),w;k.hasNext();)w=k.next(),a.indexOf(w.type)!==-1&&w.creatorID===this&&g.push(w);if(b)for(a=0;a<b.length;a++)if(w=
b[a]){if(c)w=c(w);else{var t;typeof w.line==="number"?(t=j.getLineStart(w.line-1),k=t+w.start-1,t=t+w.end-1):(k=w.start,t=w.end);var x=e(w);if(!x)continue;w=h.createAnnotation(x,k,t,w.description)}w.creatorID=this;i.push(w)}f.replaceAnnotations(g,i)}},showProblems:function(b){this.showAnnotations(b,[h.ANNOTATION_ERROR,h.ANNOTATION_WARNING,h.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return h.ANNOTATION_ERROR;case "warning":return h.ANNOTATION_WARNING;case "task":return h.ANNOTATION_TASK}return null})},
showOccurrences:function(b){this.showAnnotations(b,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(b){var a=this._blameRGB,f=this.getTextView().getOptions("parent").ownerDocument;if(!a){var j=i.createElement(f,"div");j.className="annotation blame";f.body.appendChild(j);var k=(f.defaultView||f.parentWindow).getComputedStyle(j).getPropertyValue("background-color");j.parentNode.removeChild(j);
var j=k.indexOf("("),s=k.indexOf(")"),k=k.substring(j+1,s);this._blameRGB=a=k.split(",").slice(0,3)}var r=function(){var a=e.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=c.mixin({},a.style);a.style.style=c.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},v=function(){var a=i.createElement(f,"div");a.className="tooltipTitle";var b=this.blame.Message.indexOf("\n");
if(b===-1)b=this.blame.Message.length;var d=i.createElement(f,"a");d.href=this.blame.CommitLink;d.appendChild(f.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(d);a.appendChild(i.createElement(f,"br"));a.appendChild(f.createTextNode(i.formatMessage(g.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},u=this.getModel();this.showAnnotations(b,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(b){var d=u.getLineStart(b.Start-1),f=u.getLineEnd(b.End-1,!0),d=e.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,
d,f,v),f=a.slice(0);f.push(b.Shade);d.style=c.mixin({},d.style);d.style.style=c.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+f.join()+")";d.groupId=b.Name;d.groupType=h.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=r;d.html='<img class="annotationHTML blame" src="'+b.AuthorImage+'"/>';d.blame=b;return d})},showSelection:function(b,a,c,e,f){typeof b==="number"?(typeof a!=="number"&&(a=b),this.moveSelection(b,a)):typeof c==="number"&&(b=this.getModel().getLineStart(c-1),typeof e===
"number"&&(b+=e),typeof f!=="number"&&(f=0),this.moveSelection(b,b+f))},_setModelText:function(b){this._textView&&(this._textView.setText(b),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(d,a,c,e,f){b.prototype.setInput.call(this,d,a,c,e);this._textView&&!e&&!f&&this._textView.focus()},onGotoLine:function(b,a,c,e){if(this._textView){var f=this.getModel(),b=Math.max(0,Math.min(b,f.getLineCount()-1)),h=f.getLineStart(b),
g=0;c===void 0&&(c=0);typeof a==="string"?(b=f.getLine(b).indexOf(a),b!==-1&&(g=b,c=g+a.length)):(g=a,a=f.getLineEnd(b)-h,g=Math.min(g,a),c=Math.min(c,a));this.moveSelection(h+g,h+c,e)}}});return{BaseEditor:b,Editor:f}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/regex,orion/objects,orion/util".split(","),function(g,k,j,e,c,i,b){function f(a){var b=a.getTextView();j.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+c.escape(e),"i")))&&e.length>0)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function h(a,b,d){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var c=this;this._listeners={onEditorFocus:function(a){c._removeCurrentAnnotation(a)}};this.setOptions(d)}}var d={};f.prototype=new j.KeyMode;i.mixin(f.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var d=this._prefix;if(d.length===0)return!1;var c=this.editor,e=c.getModel(),e=a?this._success?b?this._start:c.getCaretOffset()+
1:0:this._success?b?this._start:c.getCaretOffset():e.getCharCount()-1;if(d=c.getModel().find({string:d,start:e,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next()){if(!b)this._start=e;this._ignoreSelection=this._success=!0;c.moveSelection(a?d.start:d.end,a?d.end:d.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;a=b.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
d.IncrementalFind=f;h.prototype={find:function(a,b,d){this.setOptions({reverse:!a});var c=this.getFindString(),e;if(b)c=b.findString||c,e=b.count;a=this.getOptions();this.setOptions(b);b=d?this._startOffset:this.getStartOffset();if((e=this._doFind(c,b,e))&&!d)this._startOffset=e.start;this.setOptions(a);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=c.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",d=!1,c=this._editor.getModel().getLineDelimiter(),e=0;e<a.length;e++){var f=a.substring(e,e+1);if(d){switch(f){case "R":b+=c;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+f}d=!1}else f==="\\"?d=!0:b+=f}d&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,d=this._processReplaceString(this.getReplaceString()),c=b.getSelection().start;if(b=b.getModel().find({string:a,start:c,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var d=this._editor,c=d.getTextView();d.reportStatus(g.replaceAll);var e=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var h=0,i=0;;){var j=f._doFind(a,h,null,!0);if(!j)break;i++;i===1&&(c.setRedraw(!1),f.startUndo());f._doReplace(j.start,j.end,a,e);h=f.getStartOffset()}i>
0&&(f.endUndo(),c.setRedraw(!0));h>0?d.reportStatus(b.formatMessage(g.replacedMatches,i)):d.reportStatus(g.nothingReplaced,"error");f._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===!0||a.caseInsensitive===!1)this._caseInsensitive=
a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=
a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,d){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:d?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,d,c){var d=d||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,i;if(this._regex)try{i=this._find(a,b,c)}catch(j){f.reportStatus(j.message,
"error");return}else i=this._find(a,b,c);for(a=0;a<d&&i.hasNext();a++)h=i.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){d=e.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=f.getAnnotationModel())i.removeAnnotations(d),h&&i.addAnnotation(e.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var k=this;this._timer=window.setTimeout(function(){k._markAllOccurrences();
k._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,d,c){var e=this._editor;if(this._regex&&(c=e.getText(a,b).replace(RegExp(d,this._caseInsensitive?"i":""),c),!c))return;e.setText(c,a,b);e.setSelection(a,a+c.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=e.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(),c=[],f;d.hasNext();){var h=d.next();h.type===
b&&c.push(h)}if(this.isVisible()){d=this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)h=d.next(),f.push(e.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(c,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(){var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};d.Find=h;return d});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(g,k,j,e,c,i){function b(a,b,d){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=d?d:new c.Find(a,b);this._lastEditLocation=null;this.init()}function f(a,b,d,c){this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedMode=c;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var h=j.AnnotationType,d={};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(a){if(this.undoStack){var b=1;if(a&&a.count)b=a.count;for(;b>0;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:g.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;if(a&&a.count)b=a.count;for(;b>0;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:g.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(g.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:g.find});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:g.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:g.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.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:g.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:g.deleteLines});a.setKeyBinding(new k.KeyBinding("l",!i.isMac,!1,!1,i.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!i.isMac,!1,!1,i.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),e=b.getLineStart(c),c=b.getLineEnd(d,!0),f=b.getLineCount(),h="",e=b.getText(e,c);d===f-1&&(e=(h=b.getLineDelimiter())+e);a.setText(e,c,c);a.setSelection(c+h.length,c+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-
1:d.end),c=b.getLineStart(c),e=b.getLineEnd(d,!0),f=b.getLineCount(),h="",e=b.getText(c,e);d===f-1&&(e+=h=b.getLineDelimiter());a.setText(e,c,c);a.setSelection(c,c+e.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=1;if(a&&a.count)d=a.count;var c=b.getSelection(),e=b.getModel(),f=e.getLineAtOffset(c.start),a=e.getLineStart(f),d=c.start!==c.end||d===1?e.getLineAtOffset(c.end>c.start?c.end-1:c.end):Math.min(f+d-1,e.getLineCount()-
1),d=e.getLineEnd(d,!0);b.setText("",a,d);return!0},expandAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;var c=b.getModel(),e=b.getCaretOffset(),f=c.getLineAtOffset(e),e=c.getLineStart(f),f=c.getLineEnd(f,!0);c.getBaseModel&&(e=c.mapOffset(e),f=c.mapOffset(f),c.getBaseModel());for(var h,d=d.getAnnotations(e,f);!h&&d.hasNext();)c=d.next(),c.type===j.AnnotationType.ANNOTATION_FOLDING&&(h=c);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,d=b.getTextView(),c=b.getAnnotationModel();if(!c)return!0;b.getModel();c=c.getAnnotations();for(d.setRedraw(!1);c.hasNext();)b=c.next(),b.type===j.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var d=a.getModel(),c=a.getSelection(),e=d.getLineAtOffset(c.start),
f=d.getLineAtOffset(c.end>c.start?c.end-1:c.end);if(e!==f){var h=[];h.push("");for(var g=e;g<=f;g++)h.push(d.getLine(g,!0));g=d.getLineStart(e);d=d.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),g,d);a.setSelection(g===c.start?c.start:c.start+b.length,c.end+(f-e+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=
this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(g.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=b.getLineCount();if(e===f-1)return!0;var c=b.getLineStart(c),d=b.getLineEnd(e,!0),h=b.getLineEnd(e+1,!0)-(d-c),g=0;e!==f-2?b=b.getText(c,d):(e=b.getLineEnd(e),
b=b.getText(e,d)+b.getText(c,e),g+=d-e);this.startUndo();a.setText("",c,d);a.setText(b,h,h);a.setSelection(h+g,h+g+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start);if(c===0)return!0;var e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=b.getLineCount(),d=b.getLineStart(c-1),h=b.getLineStart(c),g=b.getLineEnd(e,!0),i=b.getText(h,g),j=0;e===f-1&&(e=b.getLineEnd(c-
1),c=b.getLineEnd(c-1,!0),i+=b.getText(e,c),h=e,j=c-e);this.startUndo();a.setText("",h,g);a.setText(i,d,d);a.setSelection(d,d+i.length-j);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===h.ANNOTATION_MATCHING_BRACKET||a.type===h.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(a.type)}var d=this.editor,c=d.getAnnotationModel();if(!c)return!0;var f=d.getOverviewRuler()||d.getAnnotationStyler();if(!f)return!0;for(var g=d.getModel(),i=d.getCaretOffset(),
j=c.getAnnotations(a?i:0,a?g.getCharCount():i),k=null;j.hasNext();){var t=j.next();if(a){if(t.start<=i)continue}else if(t.start>=i)continue;if(!b(t)&&(k=t,a))break}if(k){for(var x=[k],j=c.getAnnotations(k.start,k.start);j.hasNext();)t=j.next(),t!==k&&!b(t)&&x.push(t);var n=d.getTextView(),p=g.getLineAtOffset(k.start),y=e.Tooltip.getTooltip(n);if(!y)return d.moveSelection(k.start),!0;d.moveSelection(k.start,k.start,function(){y.setTarget({getTooltipInfo:function(){var a=n.convert({x:n.getLocationAtOffset(k.start).x,
y:n.getLocationAtOffset(g.getLineStart(p)).y},"document","page");return{contents:x,x:a.x,y:a.y+Math.floor(n.getLineHeight(p)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var d=a.getModel(),c=a.getSelection(),e=d.getLineAtOffset(c.start),f=d.getLineAtOffset(c.end>c.start?c.end-1:c.end),h=b.getOptions("tabSize"),g=Array(h+1).join(" "),i=[],j=b=0,k=e;k<=f;k++){var n=d.getLine(k,!0);if(d.getLineStart(k)!==
d.getLineEnd(k))if(n.indexOf("\t")===0)n=n.substring(1),b++;else if(n.indexOf(g)===0)n=n.substring(h),b+=h;else return!0;k===e&&(j=b);i.push(n)}e=d.getLineStart(e);h=d.getLineEnd(f,!0);d=d.getLineStart(f);a.setText(i.join(""),e,h);f=e===c.start?c.start:c.start-j;c=Math.max(f,c.end-b+(c.end===d+1&&c.start!==c.end?1:0));a.setSelection(f,c);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.TextActions=
b;f.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new k.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:g.trimTrailingWhitespaces});a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!i.isMac,!1,i.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!i.isMac,!1,i.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:g.removeBlockComment});a.setKeyBinding(new k.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new k.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new k.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));
a.setKeyBinding(new k.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));a.setKeyBinding(new k.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new k.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));
a.setKeyBinding(new k.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new k.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new k.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));
a.setKeyBinding(new k.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var d=a.getSelection();if(d.start===d.end){for(var c=a.getModel(),e=c.getLineAtOffset(d.start),f=c.getLine(e,!1),h=c.getLineStart(e),g=0,i=d.start-
h,j;g<i&&((j=f.charCodeAt(g))===32||j===9);)g++;var h=f.substring(0,g),b=b.getOptions("tabSize","expandTab"),k=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=c.getLineDelimiter(),n=/^[\s]*\/\*[\*]*[\s]*$/,p=/^[\s]*\*/,y=/\*\/[\s]*$/,q=f.substring(0,i),z=f.substring(i),C;if(this.smartIndentation&&f.charCodeAt(C=q.trimRight().length-1)===123)return c=i-C-1,z=z.length-z.trimLeft().length,f=f.charCodeAt(i+z)===125?b+h+k+b+h:b+h+k,a.setText(f,d.start-c,d.end+z),a.setCaretOffset(d.start+b.length+h.length+
k.length-c),!0;else if(this.autoCompleteComments&&!y.test(q)&&(n.test(q)||p.test(q))){if(g=n.exec(q)){f=b+h+" * ";f+=y.test(z)?z.substring(0,z.length-2).trim():z.trim();if(c.getLineCount()===e+1||!p.test(c.getLine(e+1)))f+=b+h+" */";a.setText(f,d.start,d.end+z.length);a.setCaretOffset(d.start+b.length+h.length+3);return!0}if(g=p.exec(q))for(e-=1;e>=0;e--)if(g=c.getLine(e,!1),n.test(g))return y.test(z)||f.charCodeAt(i)===47?(f=b+h+"*"+z,h=d.start+b.length+h.length+1):(f=b+h+"* "+z,h=d.start+b.length+
h.length+2),a.setText(f,d.start,d.end+z.length),a.setCaretOffset(h),!0;else if(!p.test(g))break}else if(y.test(q)&&h.charCodeAt(h.length-1)===32)return f=b+h.substring(0,h.length-1),a.setText(f,d.start,d.end),a.setCaretOffset(d.start+f.length),!0;else if(g>0){for(g=i;g<f.length&&((j=f.charCodeAt(g++))===32||j===9);)d.end++;a.setText(c.getLineDelimiter()+h,d.start,d.end);return!0}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),
d=a.getSelection(),c=this._findEnclosingComment(b,d.start,d.end);if(c.commentStart!==void 0&&c.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;var c=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(e-c));return!0},autoPairBrackets:function(a,b){if(a==="["&&!this.autoPairSquareBrackets)return!1;else if(a==="{"&&!this.autoPairBraces)return!1;else if(a==="("&&!this.autoPairParentheses)return!1;else if(a===
"<"&&!this.autoPairAngleBrackets)return!1;var d=this.editor;if(d.getTextView().getOptions("readonly"))return!1;var c=d.getSelection(),e=d.getModel(),f=d.getCaretOffset()===e.getCharCount()?"":e.getText(c.start,c.start+1).trim(),h=/^$|[)}\]>]/;if(c.start===c.end&&h.test(f))return d.setText(a+b,c.start,c.start),d.setCaretOffset(c.start+1),!0;else if(c.start!==c.end)return e=e.getText(c.start,c.end),d.setText(a+e+b,c.start,c.end),d.setSelection(c.start+1,c.end+1),!0;return!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;
var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=b.getSelection(),c=b.getModel(),e=b.getCaretOffset(),f=e===0?"":c.getText(d.start-1,d.start).trim(),h=e===c.getCharCount()?"":c.getText(d.start,d.start+1).trim(),e=/^"$|^'$/,g=/\w/,i=/^$|[)}\]>]/;if(d.start!==d.end){c=c.getText(d.start,d.end);if(e.test(c))return!1;b.setText(a+c+a,d.start,d.end);b.setSelection(d.start+1,d.end+1)}else if(h===a)b.setCaretOffset(d.start+1);else if(f===a||e.test(h)||g.test(f)||!i.test(h))return!1;
else b.setText(a+a,d.start,d.start),b.setCaretOffset(d.start+1);return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=[],d=0;d<a.positions.length;++d)b[d]={positions:[{offset:a.positions[d].offset,length:a.positions[d].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):
a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var d=a.getModel(),c=a.getCaretOffset(),e=c===0?"":d.getText(b.start-1,b.start),d=c===d.getCharCount()?"":d.getText(b.start,b.start+1);(e==="("&&d===")"||e==="["&&d==="]"||e==="{"&&d==="}"||e==="<"&&d===">"||e==='"'&&d==='"'||e==="'"&&d==="'")&&a.setText("",b.start,b.start+
1);return!1},_findEnclosingComment:function(a,b,d){var c=a.getLineAtOffset(b),e=a.getLineAtOffset(d),f,h,g,i,j,k;for(f=c;f>=0;f--)if(h=a.getLine(f),g=f===c?b-a.getLineStart(c):h.length,i=h.lastIndexOf("/*",g),h=h.lastIndexOf("*/",g),h>i)break;else if(i!==-1){j=a.getLineStart(f)+i;break}for(f=e;f<a.getLineCount();f++)if(h=a.getLine(f),g=f===e?d-a.getLineStart(e):0,i=h.indexOf("/*",g),h=h.indexOf("*/",g),i!==-1&&i<h)break;else if(h!==-1){k=a.getLineStart(f)+h;break}return{commentStart:j,commentEnd:k}},
lineStart:function(){for(var a=this.editor,b=a.getModel(),d=a.getCaretOffset(),c=b.getLineAtOffset(d),e=b.getLineStart(c),b=b.getLine(c),c=0;c<b.length;c++){var f=b.charCodeAt(c);if(!(f===32||f===9))break}c+=e;return d!==c?(a.setSelection(c,c),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),c=b.getText(d.start,d.end),e,f,h;for(h=0;h<c.length;h++)if(c.substring(h,h+2)==="/*"){e=d.start+h;break}for(;h<c.length;h++)if(c.substring(h,
h+2)==="*/"){f=d.start+h;break}if(e!==void 0&&f!==void 0)a.setText(b.getText(e+2,f),e,f+2),a.setSelection(e,f);else{c=this._findEnclosingComment(b,d.start,d.end);if(c.commentStart===void 0||c.commentEnd===void 0)return!0;b=b.getText(c.commentStart+2,c.commentEnd);a.setText(b,c.commentStart,c.commentEnd+2);a.setSelection(d.start-2,d.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),d=a.getSelection(),c=b.getLineAtOffset(d.start),
e=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=!0,h=[],g,i,j=c;j<=e;j++)if(g=b.getLine(j,!0),h.push(g),!f||(i=g.indexOf("//"))===-1)f=!1;else if(i!==0){var k;for(k=0;k<i;k++)if(f=g.charCodeAt(k),!(f===32||f===9))break;f=k===i}j=b.getLineStart(c);k=b.getLineEnd(e,!0);if(f){for(f=0;f<h.length;f++)g=h[f],i=g.indexOf("//"),h[f]=g.substring(0,i)+g.substring(i+2);h=h.join("");g=b.getLineStart(e);b=j===d.start?d.start:d.start-2;d=d.end-2*(e-c+1)+(d.end===g+1?2:0)}else h.splice(0,0,""),h=h.join("//"),
b=j===d.start?d.start:d.start+2,d=d.end+2*(e-c+1);a.setText(h,j,k);a.setSelection(b,d);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),d=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var c=/(\s+$)/,e=b.getLineCount(),f=0;f<e;f++){var h=b.getLine(f),g=c.exec(h);if(g){var i=b.getLineStart(f),h=g[0].length,g=i+g.index;b.setText("",g,g+h);if(d.start>g)d.start=Math.max(g,d.start-h);if(d.start!==d.end&&d.end>g)d.end=Math.max(g,d.end-
h)}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(d.start,d.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=b.getSelection(),c=b.getModel();return(b.getCaretOffset()===c.getCharCount()?"":c.getText(d.start,d.start+1))===a?(b.setCaretOffset(d.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setSmartIndentation:function(a){this.smartIndentation=a}};d.SourceCodeActions=f;if(!String.prototype.trimLeft)String.prototype.trimLeft=
function(){return this.replace(/^\s+/g,"")};if(!String.prototype.trimRight)String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")};return d});
define("orion/editor/undoStack",[],function(){function g(e,c,g,b,f){this.model=e;this.offset=c;this.text=g;this.previousText=b;this.type=f}function k(e){this.owner=e;this.changes=[]}function j(e,c){this.size=c!==void 0?c:100;this.reset();var g=this;this._listener={onChanging:function(b){g._onChanging(b)},onDestroy:function(b){g._onDestroy(b)}};if(e.getModel){var b=e.getModel();b.getBaseModel&&(b=b.getBaseModel());this.model=b;this.setView(e)}else this.shared=!0,this.model=e;this.model.addEventListener("Changing",
this._listener.onChanging)}g.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(e,c){this._doUndoRedo(this.offset,this.previousText,this.text,e,c);return!0},redo:function(e,c){this._doUndoRedo(this.offset,this.text,this.previousText,e,c);return!0},merge:function(e,c,g,b,f){if(b===this.type)if(b===1&&e===
this.offset+this.text.length)return this.text+=c,!0;else if(b===-1&&f===this.offset)return this.offset=e,this.previousText=g+this.previousText,!0;else if(b===-1&&e===this.offset)return this.previousText+=g,!0;return!1},_doUndoRedo:function(e,c,g,b,f){this.model.setText(c,e,e+g.length);f&&b&&(g=b.getModel(),g!==this.model&&(e=g.mapOffset(e,!0)),b.setSelection(e,e+c.length))}};k.prototype={getRedoChanges:function(){for(var e=[],c=0;c<this.changes.length;c++)e=e.concat(this.changes[c].getRedoChanges());
return e},getUndoChanges:function(){for(var e=[],c=this.changes.length-1;c>=0;c--)e=e.concat(this.changes[c].getUndoChanges());return e},add:function(e){this.changes.push(e)},end:function(e){if(e)this.endSelection=e.getSelection(),this.endCaret=e.getCaretOffset();(e=this.owner)&&e.end&&e.end()},undo:function(e,c){this.changes.length>1&&e&&e.setRedraw(!1);for(var g=this.changes.length-1;g>=0;g--)this.changes[g].undo(e,!1);this.changes.length>1&&e&&e.setRedraw(!0);if(c&&e){var g=this.startSelection.start,
b=this.startSelection.end;e.setSelection(this.startCaret?g:b,this.startCaret?b:g)}(g=this.owner)&&g.undo&&g.undo();return this.changes.length>0},redo:function(e,c){this.changes.length>1&&e&&e.setRedraw(!1);for(var g=0;g<this.changes.length;g++)this.changes[g].redo(e,!1);e&&e.setRedraw(!0);if(c&&e){var g=this.endSelection.start,b=this.endSelection.end;e.setSelection(this.endCaret?g:b,this.endCaret?b:g)}(g=this.owner)&&g.redo&&g.redo();return this.changes.length>0},merge:function(e,c,g,b,f){var h=this.changes.length;
return h>0?this.changes[h-1].merge(e,c,g,b,f):!1},start:function(e){if(e)this.startSelection=e.getSelection(),this.startCaret=e.getCaretOffset();(e=this.owner)&&e.start&&e.start()}};j.prototype={destroy:function(){this._onDestroy()},add:function(e){this.compoundChange?this.compoundChange.add(e):(this.stack.splice(this.index,this.stack.length-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-
1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var e=[],c=this.index;c<this.stack.length;c++)e=e.concat(this.stack[c].getRedoChanges());
return e},getUndoChanges:function(){this._commitUndo();for(var e=[],c=this.index;c>=0;c--)e=e.concat(this.stack[c].getUndoChanges());return e},undo:function(){this._commitUndo();var e;e=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(e=e.undo(this.view,!0)));this._ignoreUndo=!1;return e},redo:function(){this._commitUndo();var e;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;e=this.stack[this.index++]}while(!e.redo(this.view,!0));this._ignoreUndo=
!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(e){if(this.view!==e)this.view&&e.removeEventListener("Destroy",this._listener.onDestroy),(this.view=e)&&e.addEventListener("Destroy",this._listener.onDestroy)},startCompoundChange:function(e){this._commitUndo();e=new k(e);this.add(e);this.compoundChange=e;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(e){(!e||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);if(this.view)this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null},_onChanging:function(e){if(!this._ignoreUndo){var c=e.text,i=e.start,b=e.addedCharCount,f=e.removedCharCount,e=i+f,h=0;b===0&&f===1?h=-1:b===1&&f===0&&(h=1);b=this.stack.length;f=this.model.getText(i,e);(!(b>0&&this.index===b)||!this.stack[b-1].merge(i,c,f,h,e))&&this.add(new g(this.model,i,c,
f,h))}}};return{UndoStack:j}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,k,j,e){function c(b,a,c,e){this._location=a||"left";this._overview=c||"page";this._rulerStyle=e;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(b)}function i(b,a,e,f,h){c.call(this,b,a,"page",e);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function b(b,a,e){c.call(this,b,a,"page",e)}function f(b,a,e){c.call(this,b,a,"document",e)}function h(d,a,c){b.call(this,d,a,c)}c.prototype={getAnnotations:function(b,a){var c=this._annotationModel;if(!c)return[];var e=this._view.getModel(),f=e.getLineStart(b),h=e.getLineEnd(a-1),g=e;e.getBaseModel&&(g=e.getBaseModel(),f=e.mapOffset(f),h=e.mapOffset(h));for(var i=[],c=this.getAnnotationsByType(c,f,h),f=0;f<
c.length;f++)for(var h=c[f],j=g.getLineAtOffset(h.start),k=g.getLineAtOffset(Math.max(h.start,h.end-1)),t=j;t<=k;t++){var x=t;if(e!==g){x=g.getLineStart(t);x=e.mapOffset(x,!0);if(x===-1)continue;x=e.getLineAtOffset(x)}if(b<=x&&x<a){var n=this._mergeAnnotation(i[x],h,t-j,k-j+1);n&&(i[x]=n)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var p in i)i[p]._multiple&&(i[p].html+=this._multiAnnotationOverlay.html);return i},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(b){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=b)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(b){this._multiAnnotation=b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=
b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(b){if(b!==void 0){var a=this._view,c=a.getModel(),e=c,f=c.getLineStart(b),h=f,g=f,i=this._annotationModel;if(i){a=a.getSelection();g=c.getLineEnd(b,!0);if(f<=a.start&&a.start<g)f=a.start;c.getBaseModel&&(f=c.mapOffset(f),
g=c.mapOffset(g),e=c.getBaseModel());for(var k,g=i.getAnnotations(f,g),i=null;!k&&g.hasNext();)a=g.next(),this.isAnnotationTypeVisible(a.type)&&(i=a,a.start<=f||(k=a));if(i&&i.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===i.groupId?null:i.groupId,this._setCurrentGroup(b);k&&e.getLineAtOffset(k.start)===e.getLineAtOffset(f)?(f=k.start,g=k.end):g=f=h;c.getBaseModel&&(f=c.mapOffset(f,!0),g=c.mapOffset(g,!0))}(b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null);this._view.setSelection(g,
f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(b,a){var c=j.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=b;var e=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(b,a){this.onMouseMove(b,a);this._currentClickGroup||this._setCurrentGroup(b)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var b=j.Tooltip.getTooltip(this._view);
b&&b.setTarget(null)},_getTooltipInfo:function(b,a){if(b!==void 0){var c=this._view,e=c.getModel(),f=this._annotationModel,h=[];if(f){var h=e.getLineStart(b),g=e.getLineEnd(b);e.getBaseModel&&(h=e.mapOffset(h),g=e.mapOffset(g));h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(b,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=c.getClientArea();h.y=this.getOverview()==="document"?c.convert({y:a},"view","document").y:c.getLocationAtOffset(e.getLineStart(b)).y;c.convert(h,
"document","page");f.x=h.x;f.y=h.y;f.anchor==="right"&&(f.x+=h.width);return f}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var d=a[b].start,h=a[b].end;e.getBaseModel&&(d=e.mapOffset(d,!0),h=e.mapOffset(h,!0));d!==-1&&h!==-1&&c.redrawLines(e.getLineAtOffset(d),e.getLineAtOffset(Math.max(d,h-1))+1,f)}}var c=this._view;if(c){var e=c.getModel(),f=this,h=e.getLineCount();b.textModelChangedEvent?
(b=b.textModelChangedEvent.start,e.getBaseModel&&(b=e.mapOffset(b,!0)),b=e.getLineAtOffset(b),c.redrawLines(b,h,f)):(a(b.added),a(b.removed),a(b.changed))}},_mergeAnnotation:function(b,a,c){b||(b={});if(c===0)if(b.html&&a.html){if(a.html!==b.html&&!b._multiple&&this._multiAnnotation)b.html=this._multiAnnotation.html;b._multiple=!0}else b.html=a.html;b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?
b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]===void 0&&(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]===void 0&&(b.attributes[c]=a.attributes[c])}}return b},_setCurrentGroup:function(b){var a=this._annotationModel,c=null,e=a.getTextModel(),f,h=this._currentGroupAnnotation;if(b!==-1){var g=e.getLineStart(b),i=e.getLineEnd(b);e.getBaseModel&&(g=e.mapOffset(g),
i=e.mapOffset(i));for(f=a.getAnnotations(g,i);f.hasNext();)if(e=f.next(),this.isAnnotationTypeVisible(e.type)&&e.start<=g&&e.end>=i&&e.groupId!==void 0){c=e;break}if(h&&c&&h.groupId===c.groupId)return}this._currentGroupAnnotation=null;h&&a.removeAnnotations(h.groupType);if(c&&b!==-1){this._currentGroupAnnotation=c;f=a.getAnnotations();for(b=[];f.hasNext();)e=f.next(),delete e.groupAnnotation,e.groupId===c.groupId&&(e=e.createGroupAnnotation(),b.push(e));a.replaceAnnotations(null,b)}}};k.AnnotationTypeList.addMixin(c.prototype);
i.prototype=new c;i.prototype.getAnnotations=function(b,a){for(var e=c.prototype.getAnnotations.call(this,b,a),f=this._view.getModel(),h=b;h<a;h++){var g=h&1?this._oddStyle:this._evenStyle,i=h;f.getBaseModel&&(i=f.getLineStart(i),i=f.getBaseModel().getLineAtOffset(f.mapOffset(i)));e[h]||(e[h]={});e[h].html=this._firstLine+i+"";if(!e[h].style)e[h].style=g}return e};i.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();return this.getAnnotations(b-1,b)[b-1]};i.prototype.setFirstLine=
function(b){this._firstLine=b!==void 0?b:1};i.prototype._onTextModelChanged=function(b){var b=b.start,a=this._view.getModel(),c=(this._firstLine+(a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())-1+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(a.getLineAtOffset(b),a.getLineCount(),this)};b.prototype=new c;f.prototype=new c;f.prototype.getRulerStyle=function(){var b={style:{lineHeight:"1px",fontSize:"1px"}};return b=this._mergeStyle(b,this._rulerStyle)};
f.prototype._getTooltipContents=function(b,a){if(a.length===0){var f=this._view.getModel(),h=b;f.getBaseModel&&(h=f.getLineStart(h),h=f.getBaseModel().getLineAtOffset(f.mapOffset(h)));return e.formatMessage(g.line,h+1)}return c.prototype._getTooltipContents.call(this,b,a)};f.prototype._mergeAnnotation=function(b,a,c,e){if(c===0){if(!b)b={html:"&nbsp;",style:{style:{height:3*e+"px"}}},b.style=this._mergeStyle(b.style,a.overviewStyle);return b}};h.prototype=new b;h.prototype.onClick=function(b){if(b!==
void 0){var a=this._annotationModel;if(a){var c=this._view.getModel(),e=c.getLineStart(b),b=c.getLineEnd(b,!0);c.getBaseModel&&(e=c.mapOffset(e),b=c.mapOffset(b),c=c.getBaseModel());for(var f,a=a.getAnnotations(e,b);!f&&a.hasNext();)b=a.next(),this.isAnnotationTypeVisible(b.type)&&(f=b);f&&c.getLineAtOffset(f.start)===c.getLineAtOffset(e)&&((c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null),f.expanded?f.collapse():f.expand())}}};h.prototype._getTooltipContents=function(c,a){return a.length===
1&&a[0].expanded?null:b.prototype._getTooltipContents.call(this,c,a)};h.prototype._onAnnotationModelChanged=function(c){function a(a){for(g=0;g<a.length;g++)if(h.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;f.getBaseModel&&(b=f.mapOffset(b,!0));b!==-1&&(j=Math.min(j,f.getLineAtOffset(b)))}}if(c.textModelChangedEvent)b.prototype._onAnnotationModelChanged.call(this,c);else{var e=this._view;if(e){var f=e.getModel(),h=this,g,i=f.getLineCount(),j=i;a(c.added);a(c.removed);a(c.changed);c=e.getRulers();
for(g=0;g<c.length;g++)e.redrawLines(j,i,c[g])}}};return{Ruler:c,AnnotationRuler:b,LineNumberRuler:i,OverviewRuler:f,FoldingRuler:h}});
define("orion/editor/textDND",["orion/util"],function(g){function k(g,e){this._view=g;this._undoStack=e;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var c=this;this._listener={onDragStart:function(e){c._onDragStart(e)},onDragEnd:function(e){c._onDragEnd(e)},onDragEnter:function(e){c._onDragEnter(e)},onDragOver:function(e){c._onDragOver(e)},onDrop:function(e){c._onDrop(e)},onDestroy:function(e){c._onDestroy(e)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var g=this._view;if(g)g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var e=this._view,c=e.getSelection(),e=e.getModel();if(e.getBaseModel)c.start=e.mapOffset(c.start),c.end=e.mapOffset(c.end),e=e.getBaseModel();if(e=e.getText(c.start,c.end))this._dragSelection=c,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",e)},_onDragEnd:function(j){if(this._dragSelection){var e=
this._view,c=j.event.dataTransfer.dropEffect;if(!g.isFirefox&&(c!=="none"||this._dropText))c=j.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(j=c==="move")&&e.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var c=this._dropText,i=this._dropOffset;if(j)if(i>=this._dragSelection.end)i-=this._dragSelection.end-this._dragSelection.start;else if(i>=this._dragSelection.start)i=this._dragSelection.start;e.setText(c,
i,i);e.setSelection(i,i+c.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(j){var e=j.event.dataTransfer.types,c=!this._view.getOptions("readonly");c&&e&&(c=e.contains?e.contains("text/plain")||e.contains("Text"):e.indexOf("text/plain")!==-1||e.indexOf("Text")!==-1);if(c){if(!g.isFirefox)this._dropEffect=j.event.dataTransfer.dropEffect=(g.isMac?j.event.altKey:
j.event.ctrlKey)?"copy":"move"}else j.event.dataTransfer.dropEffect="none"},_onDrop:function(j){var e=this._view,c=j.event.dataTransfer.getData("Text");if(c){if(!g.isFirefox)j.event.dataTransfer.dropEffect=this._dropEffect;j=e.getOffsetAtLocation(j.x,j.y);this._dragSelection?(this._dropOffset=j,this._dropText=c):(e.setText(c,j,j),e.setSelection(j,j+c.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function g(g,e,c,i){this.prefix=g;this.description=e;this.template=c;this.name=i;this._parse()}function k(g,e){this._keywords=g||[];this._templates=[];this.addTemplates(e||[])}g.prototype={getProposal:function(g,e,c){var g=e-g.length,e={},i,b=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(b+=c.indentation);for(var f=c.tab!==void 0?c.tab:"\t",h=0,d=this.variables,a=this.segments,c=[],k=0;k<a.length;k++){var m=a[k],o=d[m];if(o!==void 0)switch(m){case "${tab}":m=
f;break;case "${delimiter}":m=b;break;case "${cursor}":m="";i=h;break;default:var s=e[m];s||(s=e[m]={data:o.data,positions:[]});m=o.substitution;s.data&&s.data.values&&(m=s.data.values[0]);s.positions.push({offset:g+h,length:m.length})}c.push(m);h+=m.length}var b=[],r;for(r in e)e.hasOwnProperty(r)&&b.push(e[r]);c=c.join("");if(i===void 0)i=c.length;return{proposal:c,name:this.name,description:this.description,groups:b,escapePosition:g+i,style:"noemphasis"}},match:function(g){return this.prefix.indexOf(g)===
0},_parse:function(){var g=this.template,e=[],c={},i,b=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(f,h,d){var a=f.substring(2,f.length-1),h=f,k=a,m=null,o=k.indexOf(":");o!==-1&&(k=k.substring(0,o),h="${"+k+"}",m=JSON.parse(a.substring(o+1).replace("\\}","}").trim()));(a=c[h])||(a=c[h]={});a.substitution=k;if(m)a.data=m;(i=g.substring(b,d))&&e.push(i);e.push(h);b=d+f.length;return k});(i=g.substring(b,g.length))&&e.push(i);this.segments=
e;this.variables=c}};k.prototype={addTemplates:function(j){for(var e=this.getTemplates(),c=0;c<j.length;c++)e.push(new g(j[c].prefix,j[c].description,j[c].template,j[c].name))},computeProposals:function(g,e,c){var i=this.getPrefix(g,e,c),b=[];this.isValid(i,g,e,c)&&(b=b.concat(this.getTemplateProposals(i,e,c)),b=b.concat(this.getKeywordProposals(i)));return b},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var e=[],c=this.getKeywords();if(c){for(var i=0;i<c.length;i++)c[i].indexOf(g)===
0&&e.push({proposal:c[i].substring(g.length),description:c[i],style:"noemphasis_keyword"});0<e.length&&e.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return e},getPrefix:function(g,e,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,e,c){for(var i=[],b=this.getTemplates(),f=0;f<b.length;f++){var h=b[f];h.match(g)&&(h=h.getProposal(g,e,c),this.removePrefix(g,h),i.push(h))}0<i.length&&(i.sort(function(b,
a){return b.name<a.name?-1:b.name>a.name?1:0}),i.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return i},removePrefix:function(g,e){if(!(e.overwrite=e.proposal.substring(0,g.length)!==g))e.proposal=e.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,TemplateContentAssist:k}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/templates,orion/objects,orion/util".split(","),function(g,k,j,e,c,i){function b(b,c,a){var e=b.getTextView();j.KeyMode.call(this,e);this.editor=b;this.undoStack=c;this.contentAssist=a;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),c=this.linkedModeModel,d,e;c;)if(d=this._getPositionChanged(c,b,b+a.removedCharCount),e=d.position,e===void 0||e.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var f,h=0;h<d.length;++h){f=d[h];e=f.position;var g=e.offset<=b&&b<=e.offset+e.length;g&&!f.ansestor?(e.offset+=c,
e.length+=a,c+=a):(e.offset+=c,f.ansestor&&g&&(e.length+=a));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,c=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),e=this.linkedModeModel,f,h;e;)if(f=this._getPositionChanged(e,c,d),h=f.position,h===void 0||h.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var g=this._compoundChange;g?g.owner.model===e&&g.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=h.group;var g=0,i=a.text.length-(d-c);f=f.positions;var j;c-=h.position.offset;for(var k=d-h.position.offset,l=0;l<f.length;++l)if(j=f[l],d=j.position,j.oldOffset=d.offset,j.model===e&&j.group===h.group?(d.offset+=g,d.length+=i,g+=i):(d.offset+=g,j.ansestor&&(d.length+=h.count*i)),j.escape)j.model.escapePosition=d.offset;this.ignoreVerify=!0;for(l=f.length-1;l>=0;l--)j=f[l],j.model===e&&j.group===h.group&&b.setText(a.text,j.oldOffset+
c,j.oldOffset+k);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var f={};b.prototype=new j.KeyMode;i.mixin(b.prototype,{createKeyBindings:function(){var b=k.KeyBinding,c=[];c.push({actionID:"linkedModeEnter",keyBinding:new b(13)});c.push({actionID:"linkedModeCancel",keyBinding:new b(27)});c.push({actionID:"linkedModeNextGroup",keyBinding:new b(9)});c.push({actionID:"linkedModePreviousGroup",keyBinding:new b(9,!1,!0)});return c},enterLinkedMode:function(b){if(!this.linkedModeModel){var c=
this.editor.getTextView();c.addKeyMode(this);c.addEventListener("Verify",this.linkedModeListener.onVerify);c.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)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 c=this.linkedModeModel;this.linkedModeModel=c.previousModel;c.parentGroup=c.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var a=this.editor,e=a.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);b&&a.setCaretOffset(c.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var b=this,c=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:c,group:c.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 d=this.linkedModeModel;if(d){d.selectedGroupIndex=b;var b=d.groups[b],a=b.positions[0],e=this.editor;e.setSelection(a.offset,a.offset+a.length);if(d=this.contentAssist)if(d.offset=void 0,b.data&&b.data.type==="link"&&b.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(b.data.values)).getPrefix=function(){var b=
e.getSelection();return b.start===b.end&&(b=e.getCaretOffset(),a.offset<=b&&b<=a.offset+a.length)?e.getText(a.offset,b):""},d.offset=a.offset,d.deactivate(),d.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,d.deactivate()}this._updateAnnotations()},_getModelPositions:function(b,c,a){for(var e=c.groups,f=0;f<e.length;f++)for(var g=e[f].positions,i=0;i<g.length;i++){var j=g[i];a&&(j={offset:j.offset+a,length:j.length});j={index:i,group:f,count:g.length,model:c,
position:j};b.push(j);if(c.nextModel&&c.nextModel.parentGroup===f)j.ansestor=!0,this._getModelPositions(b,c.nextModel,(a||0)+g[i].offset-g[0].offset)}},_getSortedPositions:function(b){var c=this._sortedPositions;if(!c){for(c=[];b.previousModel;)b=b.previousModel;for(this._getModelPositions(c,b);b;)b.escapePosition!==void 0&&c.push({escape:!0,model:b,position:{offset:b.escapePosition,length:0}}),b=b.nextModel;c.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=c}return c},
_getPositionChanged:function(b,c,a){for(var e,b=this._getSortedPositions(b),f=b.length-1;f>=0;f--){var g=b[f].position;if(g.offset<=c&&a<=g.offset+g.length){e=b[f];break}}return{position:e,positions:b}},_updateAnnotations:function(b){var c=this.editor.getAnnotationModel();if(c){var a=[],f=[];c.getTextModel();for(var g=c.getAnnotations(),i;g.hasNext();)switch(i=g.next(),i.type){case e.AnnotationType.ANNOTATION_LINKED_GROUP:case e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(i)}if(g=
this.linkedModeModel)for(var b=b||this._getSortedPositions(g),j=0;j<b.length;j++)if(i=b[j],i.model===g){var k=e.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===g.selectedGroupIndex&&(k=i.index===0?e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=e.AnnotationType.createAnnotation(k,i.offset,i.offset+i.length,"");f.push(i)}c.replaceAnnotations(a,f)}}});f.LinkedMode=b;return f});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(g,k,j,e,c,i){function b(){}function f(){}function h(){}function d(){}function a(){}function l(){}var m={};b.prototype={createKeyBindings:function(a,b,c,d){var d=new g.TextActions(a,b,d),e=new i.LinkedMode(a,b,c),a=new g.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};m.KeyBindingsFactory=
b;f.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};m.UndoFactory=f;h.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=h;d.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=d;a.prototype={createAnnotationModel:function(a){return new e.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new e.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new j.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new j.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};m.AnnotationFactory=a;l.prototype={createTextDND:function(a,b){return new c.TextDND(a.getTextView(),b)}};m.TextDNDFactory=l;return m});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(g,k,j,e){return e.mixin({},g,k,j)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleActionContainer">\n\t\t\t<div class="compareActionContainer" id="left_action_id"></div>\n\t\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t</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="titleActionContainer">\n\t\t\t<div class="compareActionContainer" id="right_action_id"></div>\n\t\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t</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(g,k,j){var e=e||{};e.TwoWayCompareUIFactory=function(){function c(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}c.prototype={_init:function(){var c=this._parentDivID+"_";this._topWidgetDiv=g.node("topWidget_id");
this._topWidgetDiv.id=c+"topWidget_id";this._leftEditorParentDiv=g.node("left_editor_id");this._leftEditorParentDiv.id=c+"left_editor_id";this._rightEditorParentDiv=g.node("right_editor_id");this._rightEditorParentDiv.id=c+"right_editor_id";this._rightEditorWrapperDiv=g.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=c+"right_editor_wrapper_id";this._leftActionDiv=g.node("left_action_id");this._leftActionDiv.id=c+"left_action_id";this._rightActionDiv=g.node("right_action_id");this._rightActionDiv.id=
c+"right_action_id";this._leftTitleDiv=g.node("left_title_id");this._leftTitleDiv.id=c+"left_title_id";this._rightTitleDiv=g.node("right_title_id");this._rightTitleDiv.id=c+"right_title_id";this._leftStatusDiv=g.node("left_status_id");this._leftStatusDiv.id=c+"left_status_id";this._rightStatusDiv=g.node("right_status_id");this._rightStatusDiv.id=c+"right_status_id";this._diffCanvasDiv=g.node("diff_canvas_id");this._diffCanvasDiv.id=c+"diff_canvas_id";this._splitterId=c+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var c=g.$(".split",this._topWidgetDiv);c.id=this._splitterId;var b=g.$(".leftPanelLayout",this._topWidgetDiv),e=g.$(".rightPanelLayout",this._topWidgetDiv);if(c&&b&&e)this._splitter=new k.Splitter({node:c,sidePanel:b,mainPanel:e})},buildUI:function(){g.node(this._parentDivID).innerHTML=j;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(c){return g.$(".leftPanelLayout",
this._topWidgetDiv)===c},getEditorParentDiv:function(c){return c?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(c){return c?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(c){return c?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(c){return c?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return c}();return e});
var JsDiff=function(){function g(b){for(var c=[],d=0;d<b.length;d++)b[d]&&c.push(b[d]);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 j=function(b){this.ignoreWhitespace=b};j.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),d=c.length,a=b.length,e=d+a,g=[{newPos:-1,components:[]}],i=this.extractCommon(g[0],
c,b,0);if(g[0].newPos+1>=d&&i+1>=a)return g[0].components;for(var j=1;j<=e;j++)for(var k=-1*j;k<=j;k+=2){var v;v=g[k-1];var u=g[k+1],i=(u?u.newPos:0)-k;v&&(g[k-1]=void 0);var w=v&&v.newPos+1<d,t=u&&0<=i&&i<a;if(!w&&!t)g[k]=void 0;else if(!w||t&&v.newPos<u.newPos?(v={newPos:u.newPos,components:u.components.slice(0)},this.pushComponent(v.components,b[i],void 0,!0)):(v={newPos:v.newPos,components:v.components.slice(0)},v.newPos++,this.pushComponent(v.components,c[v.newPos],!0,void 0)),i=this.extractCommon(v,
c,b,k),v.newPos+1>=d&&i+1>=a)return v.components;else g[k]=v}},pushComponent:function(b,c,d,a){var e=b[b.length-1];e&&e.added===d&&e.removed===a?b[b.length-1]={value:this.join(e.value,c),added:d,removed:a}:b.push({value:c,added:d,removed:a})},extractCommon:function(b,c,d,a){for(var e=c.length,g=d.length,i=b.newPos,a=i-a;i+1<e&&a+1<g&&this.equals(c[i+1],d[a+1]);)i++,a++,this.pushComponent(b.components,c[i],void 0,void 0);b.newPos=i;return a},equals:function(b,c){var d=/\S/;return this.ignoreWhitespace&&
!d.test(b)&&!d.test(c)?!0:b==c},join:function(b,c){return b+c},tokenize:function(b){return b}};var e=new j,c=new j(!1);c.tokenize=function(b){return g(b.split(/(\s+|\b)/))};var i=new j(!0);i.tokenize=function(b){return g(b.split(/([{}:;,]|\s+)/))};var b=new j;b.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,c){return e.diff(b,c)},diffWords:function(b,e){return c.diff(b,e)},diffLines:function(c,e){return b.diff(c,e)},diffCss:function(b,c){return i.diff(b,c)},createPatch:function(c,
e,d,a,g){var i=[];i.push("Index: "+c);i.push("===================================================================");i.push("--- "+c+"\t"+a);i.push("+++ "+c+"\t"+g);c=b.diff(e,d);c.push({value:"",lines:[]});for(var d=e=0,a=[],j=g=1,k=0;k<c.length;k++){var r=c[k],v=r.lines||r.value.replace(/\n$/,"").split("\n");r.lines=v;if(r.added||r.removed){if(!e){var u=c[k-1],e=g,d=j;u&&(a.push.apply(a,u.lines.slice(-4).map(function(a){return" "+a})),e-=4,d-=4)}a.push.apply(a,v.map(function(a){return(r.added?"+":
"-")+a}));r.added?j+=v.length:g+=v.length}else e&&(v.length<=8&&k<c.length-1?a.push.apply(a,v.map(function(a){return" "+a})):(u=Math.min(v.length,4),i.push("@@ -"+e+","+(g-e+u)+" +"+d+","+(j-d+u)+" @@"),i.push.apply(i,a),i.push.apply(i,v.slice(0,u).map(function(a){return" "+a})),d=e=0,a=[])),g+=v.length,j+=v.length}c.length>1&&!/\n$/.test(c[c.length-2].value)&&i.push("\\ No newline at end of file\n");return i.join("\n")},convertChangesToXML:function(b){for(var c=[],d=0;d<b.length;d++){var a=b[d];
a.added?c.push("<ins>"):a.removed&&c.push("<del>");c.push(k(a.value));a.added?c.push("</ins>"):a.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(g){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={_specialLine:function(e,c,g){return c.value===e&&g!==e},adapt:function(e,c,i){i||(i="\n");for(var b=e.split(i),f=c.split(i),h=b[b.length-1]==="",f=f[f.length-1]==="",d=g.diffLines(e,c),e=[],c=[],a=0,j=0,k=-1,o=0,s=!0,r=i,v=0;v<d.length;v++){var u=d[v],w=u.lines||u.value.split(i),t=w.length,x=0;w.length>1&&w[w.length-1]===""&&t--;t>1&&!s&&w[0]===""&&(t--,x++);u.lines=w;
if(!u.added&&!u.removed){if(!this._specialLine(i,u,r)){if(a||j)e.push([a,j,k]),j=a=0,k=-1,o+=j;e.push([t,t,0]);o+=t}}else if(u.added){k===-1&&(k=c.length+1);a+=t;for(s=x;s<t+x;s++)c.push(u.lines[s])}else j+=t;s=!1;w.length>1&&w[w.length-1]===""&&(s=!0);r=u.value?u.value[u.value.length-1]:i}if(a||j)e.push([a,j,k]),o+=j;o<b.length&&b.length>1&&(i=e[e.length-1],i[2]===0?(i[0]+=1,i[1]+=1):i[2]===-1?e.push([1,1,0]):h===f?e.push([1,1,0]):(f&&(i[0]+=1),h&&(i[1]+=1)));return{mapper:e,changContents:{array:c,
index:0}}},adaptCharDiff:function(e,c,i){for(var e=i?g.diffWords(e,c):g.diffChars(e,c),c=[],b=i=0,f=0,h=0,d=0;d<e.length;d++){var a=e[d];if(!a.added&&!a.removed){if(f>0||h>0)c.push([b,b+f,i,i+h]),b+=f,i+=h,h=f=0;b+=a.value.length;i+=a.value.length}else a.added?f+=a.value.length:h+=a.value.length}(f>0||h>0)&&c.push([b,b+f,i,i+h]);return c}};return j}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(g,k,j,e){var c={},i,b,f,h,d,a,l,m,o,s,r,v,u,w,t,x;c.DiffTreeNavigator=function(){function c(a,b,d,e,f,h){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,e,f,h)}i="orion.annotation.diff.addedBlock";b="orion.annotation.diff.currentAddedBlock";f="orion.annotation.diff.deletedBlock";h="orion.annotation.diff.currentDeletedBlock";
d="orion.annotation.diff.blockTop";a="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";m="orion.annotation.diff.currentBlockConflict";o="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";r="orion.annotation.diff.deletedWord";v="orion.annotation.diff.currentDeletedWord";u="orion.annotation.diff.emptyDeletedWordLeft";w="orion.annotation.diff.emptyDeletedWordRight";t="orion.annotation.diff.emptyAddedWordLeft";x="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});j.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});j.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(o,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(r,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});c.prototype={initAll:function(a,b,c,d,e,f,h){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=h;(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 e.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var f=this.generatePairWordAnnotations(d,a,c);if(f)d.children=f}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new g.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],h=a===0?f.oldA:f.newA;if(b>=h.start&&b<=h.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(),f=[];d&&e.hasNext();){var h=e.next();h.type===c&&f.push(h)}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},h={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(h,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 (j.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(e.current))(h.start,
h.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,h=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"),h=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,
c,f,b,2,3);this.generateWordDiffAnnotations(1,d,h,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=j.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 h=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",h.normal),g=0;g<d.length;g++){var i=j.AnnotationType.createAnnotation(h.normal,d[g][e]+c,d[g][f]+c);a.push(i);b.push(i)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,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 c}();c.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return this._mapperColumnIndex===0},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:s,normal:o,list:[]}):a.push({type:"word",
current:v,normal:r,list:[]});a.push({type:"word",current:u});a.push({type:"word",current:w});a.push({type:"word",current:t});a.push({type:"word",current:x})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:o}:{current:this._repositionEmptyWord(a,b),normal:r}:this._isAddedSide()?{current:s,normal:o}:{current:v,normal:r}},_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._isAddedSide()?x:w;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._isAddedSide()?x:w;return this._isAddedSide()?t:u},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}();c.TwoWayDiffBlockFeeder=function(){function e(a,b,c,d){this._mapperColumnIndex=c;this._reverseAnnotation=d;this.init(a,b)}e.prototype=new c.DiffBlockFeeder;e.prototype._isAddedSide=function(){return this._reverseAnnotation?this._mapperColumnIndex!==0:this._mapperColumnIndex===0};e.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]}};e.prototype.getBlockAnnoTypes=function(c){this._isAddedSide()?c.push({type:"block",normal:i,current:b,list:[]}):c.push({type:"block",normal:f,current:h,list:[]});c.push({type:"block",normal:d,current:a,list:[]});c.push({type:"block",normal:l,current:m,list:[]})};e.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=c)return null;c=this._diffBlocks[c][1];
if(this._mapper[c][this._mapperColumnIndex]===0)return{normal:d,current:a};else if(k.isMapperConflict(this.getMapper(),c))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:f,current:h,list:[]}};return e}();c.inlineDiffBlockFeeder=function(){function a(b,c){this._mapperColumnIndex=c;this.init(b)}a.prototype=new c.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._isAddedSide()){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._isAddedSide()?a.push({type:"block",normal:i,current:b,list:[]}):a.push({type:"block",normal:f,current:h,list:[]});a.push({type:"block",normal:l,current:m,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:s,normal:o};else if(k.isMapperConflict(this.getMapper(),
a))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:f,current:h,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 c});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(g,k,j,e,c,i,b,f,h,d,a,l,m){var o={};o.CompareView=function(){function a(){this._diffParser=new e.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,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}}},_loadImageFile:function(a,b,c){var d=document.createElement("img");d.src=a;var e=new k;d.onload=
function(){b.appendChild(d);if(c){var a=document.createElement("hr");b.appendChild(a)}e.resolve(d.height)};d.onerror=function(){e.resolve(0)};return e},_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));if(a.newFileOnRight){var c=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=c}},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(){},initImageMode:function(){}};return a}();o.TwoWayCompareView=function(){function a(b){this.setOptions(b,!0);this._diffNavigator=new m.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
if(!this._uiFactory)this._uiFactory=new d.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new c.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}a.prototype=new o.CompareView;a.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new c.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return g["There are unsaved changes."]}.bind(this)};
a.prototype.initImageMode=function(){if(this._editors)this._editors.forEach(function(a){a.destroy()}),this._editors=null;this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};a.prototype.getImageMode=function(){return this._imageMode};a.prototype.getEditors=function(){return this._editors};a.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)};a.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};a.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};a.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};a.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};a.prototype._createEditor=function(a,c,d,e,f){var j=typeof e.readonly===
"undefined"?!0:e.readonly,k=function(){var a=new h.TextView({parent:c,readonly:j,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)?f:!f)&&a.resize()}}.bind(this));return a}.bind(this),l=e.keyBindingFactory;l||(l=new b.KeyBindingsFactory);var m=null;if(d)var q="",m=function(a,b){if(d)q=b?g["ERROR: "]+
a:a,d.textContent=""+q};k=new i.Editor({textViewFactory:k,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:c});k.installTextView();k.setInput(null,null,e.Content?e.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,!f))this.options.mapper=null}.bind(this));f?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};a.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),
this._uiFactory.destroy())};a.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);
this._hasRuler=!0}};a.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new k).resolve(a>b?a:b)})})}var c=this.options.oldFile.Content,d=this.options.newFile.Content,e=this.options.diffContent;typeof d===
"string"?e=this._generateMapper(c,d,e,this.options.hasConflicts):(e=this._generateMapper(c,d,e,this.options.hasConflicts),d=e.output);var f=new m.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),e.mapper,1,this.options.newFileOnRight),h=new m.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),e.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],f,h,this._overviewRuler,this._curveRuler);
this._curveRuler.init(e.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),this._editors[0].setInput(this.options.oldFile.Name,null,c));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);
this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;c=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>c?a:c};a.prototype.refreshTitle=function(a,b){if(a===1){var c=this._uiFactory.getTitleDiv(!0);c&&(j.empty(c),
c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(c=this._uiFactory.getTitleDiv(!1))j.empty(c),c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return a}();o.InlineCompareView=function(){function d(a){this.setOptions(a,!0);this._diffNavigator=new m.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);
this._editorDiv=this.options.parentDivId}d.prototype=new o.CompareView;d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=
!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(a){var d=j.node(this._editorDiv),e=function(){return new h.TextView({parent:d,readonly:!0,tabSize:4})}.bind(this);this._editor=new i.Editor({textViewFactory:e,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,
domNode:d});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 c.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._overviewRuler=new c.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),this._textView)}.bind(this))};d.prototype.initImageMode=
function(){if(this._editor)this._editor.destroy(),this._editor=null;j.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};d.prototype.getImageMode=function(){return this._imageMode};d.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)}};d.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&
this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,j.node(this._editorDiv),!0).then(function(a){return b._loadImageFile(b.options.oldFile.URL,j.node(b._editorDiv)).then(function(b){return(new k).resolve(a+b+20)})})}var c=this.options.oldFile.Content,d=this.options.newFile.Content,e=this._generateMapper(c,d,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);if(typeof d!=="string")d=e.output;this._textView.getModel().setText(c);
c=new m.inlineDiffBlockFeeder(e.mapper,1);d=new m.inlineDiffBlockFeeder(e.mapper,0);a.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),e.mapper,e.diffArray.array,e.diffArray.index,this._diffParser._lineDelimiter);c.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,c,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();e=this._textView.getTopIndex();this._textView.redrawLines(e,e+1,this._overviewRuler);this._textView.redrawLines(e,e+1,this._rulerOrigin);this._textView.redrawLines(e,e+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=
function(a){this._conflcit=a};return d}();o.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new o.InlineCompareView(c):new o.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;if(!this._imageMode){var b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();j.empty(j.node(a.parentDivId));
this._widget=this._widget.type==="inline"?new o.TwoWayCompareView(a):new o.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return o});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",patterns:[{include:"#brace_open"},{include:"#brace_close"},{include:"#bracket_open"},{include:"#bracket_close"},{include:"#parenthesis_open"},{include:"#parenthesis_close"},{include:"#number_decimal"},{include:"#number_hex"},{include:"#string_doubleQuote"},{include:"#string_singleQuote"}],repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},
bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\<\\S*\\>",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",patterns:[{include:"orion.lib"},{include:"#comment_singleLine"},{include:"#comment_block"}],repository:{comment_singleLine:{match:"//.*",name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:"/\\*",end:"\\*/",name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",
captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(g){var k="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(","),g=g.grammars;g.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{include:"orion.lib#doc_block"},
{include:"orion.c-like"},{match:"\\b(?:"+k.join("|")+")\\b",name:"keyword.control.js"},{match:"/(?![\\s])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"}]});return{id:g[g.length-1].id,grammars:g,keywords:k}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(g){var k="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(","),g=g.grammars;g.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#doc_block"},{include:"orion.c-like"},{match:"\\b(?:"+k.join("|")+")\\b",name:"keyword.control.java"}],repository:{string_singleQuote:{}}});return{id:g[g.length-1].id,grammars:g,keywords:k}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(g){var k="alignment-adjust,alignment-baseline,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,animation,appearance,azimuth,backface-visibility,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,background,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-bottom,border-collapse,border-color,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-image,border-left-color,border-left-style,border-left-width,border-left,border-radius,border-right-color,border-right-style,border-right-width,border-right,border-spacing,border-style,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-top,border-width,border,bottom,box-align,box-decoration-break,box-direction,box-flex-group,box-flex,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color-profile,color,column-count,column-fill,column-gap,column-rule-color,column-rule-style,column-rule-width,column-rule,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue-after,cue-before,cue,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-position,fit,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float-offset,float,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,font,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-ruby,line-stacking-shift,line-stacking-strategy,line-stacking,list-style-image,list-style-position,list-style-type,list-style,margin-bottom,margin-left,margin-right,margin-top,margin,mark-after,mark-before,mark,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-color,outline-offset,outline-style,outline-width,outline,overflow-style,overflow-x,overflow-y,overflow,padding-bottom,padding-left,padding-right,padding-top,padding,page-break-after,page-break-before,page-break-inside,page-policy,page,pause-after,pause-before,pause,perspective-origin,perspective,phonemes,pitch-range,pitch,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest-after,rest-before,rest,richness,right,rotation-point,rotation,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak-header,speak-numeral,speak-punctuation,speak,speech-rate,stress,string-set,table-layout,target-name,target-new,target-position,target,text-align-last,text-align,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform-origin,transform-style,transform,transition-delay,transition-duration,transition-property,transition-timing-function,transition,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch-range,voice-pitch,voice-rate,voice-stress,voice-volume,volume,white-space-collapse,white-space,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),g=
g.grammars;g.push({id:"orion.css",contentTypes:["text/css"],patterns:[{include:"orion.lib"},{include:"orion.c-like#comment_block"},{match:"(?:-webkit-|-moz-|-ms-|\\b)(?:"+k.join("|")+")\\b",name:"keyword.control.css"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{begin:"(['\"])(?:\\\\.|[^\\\\\\1])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\\\1])*(\\1|[^\\\\]$))",name:"string.quoted.multiline.css"}],
repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});return{id:g[g.length-1].id,grammars:g,keywords:k}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(g,k,j,e){function c(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function i(){c.call(this,null,!0)}function b(a){c.call(this,null,a)}function f(){c.call(this,null,!1)}function h(e,h,g){this.commentStart="/*";this.commentEnd="*/";var j=[];switch(h){case "java":j=a;break;
case "js":j=d;break;case "css":j=l}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new c(j,this.whitespacesVisible);this._firstScanner=new f;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new i;if(h==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=e;this.annotationModel=g;this._bracketAnnotations=void 0;var k=this;this._listener=
{onChanged:function(a){k._onModelChanged(a)},onDestroy:function(a){k._onDestroy(a)},onLineStyle:function(a){k._onLineStyle(a)},onMouseDown:function(a){k._onMouseDown(a)},onSelection:function(a){k._onSelection(a)}};h=e.getModel();h.getBaseModel&&(h=h.getBaseModel());h.addEventListener("Changed",this._listener.onChanged);e.addEventListener("MouseDown",this._listener.onMouseDown);e.addEventListener("Selection",this._listener.onSelection);e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();e.redrawLines()}var d=k.keywords,a=j.keywords,l=e.keywords,m={styleClass:"comment"},o={styleClass:"comment"},s={styleClass:"comment block documentation"},r={styleClass:"keyword other documentation markup"},v={styleClass:"keyword other documentation task"},u={styleClass:"keyword other documentation tag"},w={styleClass:"string"},t={styleClass:"constant numeric"},x={styleClass:"keyword"},n={styleClass:"punctuation separator space",
unmergeable:!0},p={styleClass:"punctuation separator tab",unmergeable:!0},y={styleClass:"meta annotation currentLine"};c.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}};i.prototype=new c(null);i.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);
return 1}}};b.prototype=new c(null);b.prototype.setType=function(a){this._type=a};b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=
90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};f.prototype=new c(null);f.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};h.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,
b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var c=[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var h=e[f];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&c.push(h)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=
this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var h=d.getAnnotations(b,c),e=[],i=g.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=h.next();j.type===i&&e.push(j)}h=[];j=this._commentScanner;j.setText(f.getText(b,c));for(var k;k=j.nextToken();){var l=j.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),h.push(g.AnnotationType.createAnnotation(i,l,k,f.getText(l,k))))}d.replaceAnnotations(e,
h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return y}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,h=this.comments,g=this._binarySearch(h,c,!0);g<h.length;g++){if(h[g].start>=d)break;var i=h[g].start,j=h[g].end;f<i&&this._parse(b.substring(f-c,i-c),f,e);var k=h[g].type,l;switch(k){case 8:l=s;break;case 7:l=o;break;case 5:l=
w}f=Math.max(f,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-c,i-c),f,e,l,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,i-c),f,e,w):e.push({start:f,end:i,style:l});f=j}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var e=
d.getStartOffset()+b,f=null;switch(a){case 2:f=x;break;case 3:f=t;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),e,c,w);continue}else f=w;break;case 8:this._parseComment(d.getData(),e,c,s,a);continue;case 6:this._parseComment(d.getData(),e,c,m,a);continue;case 7:this._parseComment(d.getData(),e,c,o,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=n)}c.push({start:e,end:d.getOffset()+b,
style:f})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=n);break;case 12:h=r;break;case 13:h=u;break;case 14:h=v;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(f.getData(),e,c,h))}h&&c.push({start:e,end:f.getOffset()+b,style:h})}},_parseString:function(a,b,c,d){var e=
this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=p);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=n)}h&&c.push({start:f,end:e.getOffset()+b,style:h})}},_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,h=f;h>0;){f=e.charCodeAt(h-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;h--}if(h>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(h-
1,h)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var g=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(h,g)};c.push({start:b,end:b+h,style:d});c.push({start:b+h,end:b+g,style:f});c.push({start:b+g,end:b+a.length,style:d});return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;
var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+
1,e+2);for(var h=a.getLineAtOffset(b),c=a.getLine(h),g=a.getLineStart(h),i=a.getLineEnd(h),c=this._findBrackets(d,f,c,g,g,i),i=0;i<c.length;i++)if(g=c[i]>=0?1:-1,c[i]*g-1===b){var j=1;if(e&1){for(i--;i>=0;i--)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*g-1;for(h-=1;h>=0;){c=a.getLine(h);g=a.getLineStart(h);i=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,i);for(e=c.length-1;e>=0;e--)if(g=c[e]>=0?1:-1,j+=g,j===0)return c[e]*g-1;h--}}else{for(i++;i<c.length;i++)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*
g-1;h+=1;for(e=a.getLineCount();h<e;){c=a.getLine(h);g=a.getLineStart(h);i=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,i);for(i=0;i<c.length;i++)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*g-1;h++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var h=[],a=a.charCodeAt(0),b=b.charCodeAt(0),g=e,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;j=k[l].start;var n=k[l].end;if(g<j)for(i.setText(c.substring(g-e,j-e));j=i.nextToken();)j===a?h.push(i.getStartOffset()+
g-e+d+1):j===b&&h.push(-(i.getStartOffset()+g-e+d+1));g=n}if(g<f)for(i.setText(c.substring(g-e,f-e));j=i.nextToken();)j===a?h.push(i.getStartOffset()+g-e+d+1):j===b&&h.push(-(i.getStartOffset()+g-e+d+1));return h},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=
a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;f===e&&b&&h||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&h&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,i,j;if(c.start===c.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(i=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,
j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,
a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,h=f.getCharCount(),i=this.comments.length,j=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,j,!0),l=this._binarySearch(this.comments,c,!1,k-1,i);k<i&&this.comments[k].start<=j&&j<this.comments[k].end?(j=this.comments[k].start,j>b&&(j+=d)):j=k===i&&i>0&&h-d===this.comments[i-1].end?this.comments[i-1].start:j;var n;l<i?(n=this.comments[l].end,n>b&&(n+=d),l+=1):(l=i,n=h);for(var m,h=this._findComments(f.getText(j,n),j),
i=k;i<this.comments.length;i++)m=this.comments[i],m.start>b&&(m.start+=d),m.start>b&&(m.end+=d);var t=l-k!==h.length;if(!t)for(i=0;i<h.length;i++){m=this.comments[k+i];var p=h[i];if(m.start!==p.start||m.end!==p.end||m.type!==p.type){t=!0;break}}i=[k,l-k].concat(h);Array.prototype.splice.apply(this.comments,i);t&&(i=j,m=n,a!==f&&(i=a.mapOffset(i,!0),m=a.mapOffset(m,!0)),e.redrawRange(i,m));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(j,n);j=[];for(n=
[];k.hasNext();)if(m=k.next(),m.type===g.AnnotationType.ANNOTATION_FOLDING){n.push(m);for(i=0;i<h.length;i++)if(m.start===h[i].start&&m.end===h[i].end)break;i===h.length?(j.push(m),m.expand()):(i=m.start,l=m.end,i>b&&(i-=d),l>b&&(l-=d),i<=b&&b<l&&i<=c&&c<l&&(i=f.getLineAtOffset(m.start),l=f.getLineAtOffset(m.end),i!==l?m.expanded||m.expand():e.removeAnnotation(m)))}b=[];for(i=0;i<h.length;i++){m=h[i];for(d=0;d<n.length;d++)if(n[d].start===m.start&&n[d].end===m.end)break;d===n.length&&(m=this._createFoldingAnnotation(a,
f,m.start,m.end))&&b.push(m)}e.replaceAnnotations(j,b)}}};return{TextStyler:h}});
define("orion/editor/textStyler",["orion/editor/annotations"],function(g){function k(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function j(a,b,c,d,e){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.pattern=b;this._styler=c;this._parent=e;this._linePatterns=[];this._blockPatterns=[];this._enclosurePatterns=
{};if(d)this._initPatterns(),this._subBlocks=u(d,d.getText(this.start,this.end),this,this.start)}function e(a){this._styler=a}function c(a,b,c,d){this.highlightCaretLine=this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=b;this.patternManager=new k(c,d);this._accessor=new e(this);this._bracketAnnotations=void 0;var f=this;this._listener={onChanged:function(a){f._onModelChanged(a)},onDestroy:function(a){f._onDestroy(a)},
onLineStyle:function(a){f._onLineStyle(a)},onMouseDown:function(a){f._onMouseDown(a)},onSelection:function(a){f._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);d=c.getCharCount();this._rootBlock=
new j({start:0,contentStart:0,end:d,contentEnd:d},null,this,c);this._computeFolding(this._rootBlock.getBlocks());b&&this.detectTasks&&(d=[],w(this._rootBlock,c,d),b.replaceAnnotations([],d));a.redrawLines()}var i={styleClass:"meta annotation currentLine"},b=/$/,f=/\\(\d)/g,h=/(.*)(?:[\r\n]|$)/g,d={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},a={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},l=function(a,b,c,d){var e=c,f=a.lastIndex;h.lastIndex=
c;var c=h.exec(b),g,i;a.lastIndex=0;if(c){for(i=c.index;0<=--i;)if(g=b.charAt(i),g==="\n"||g==="\r")break;g=b.substring(i+1,c.index+c[1].length);a.lastIndex=i=c.index-i-1}for(;c&&c.index<b.length;){var j;if(d){var k=a.lastIndex;if(a.test(g))a.lastIndex=k,j=a.exec(g)}else j=a.exec(g);if(j)return j.index+=e,j.index-=i,a.lastIndex=f,j;i=0;e+=c[0].length;if(c=h.exec(b))g=c[1],a.lastIndex=0}a.lastIndex=f;return null},m=function(a,b){var c=a.toString();f.lastIndex=0;if(!f.test(c))return a;f.lastIndex=0;
for(var d=f.exec(c);d;)c=c.replace(d[0],b[d[1]]||""),f.lastIndex=0,d=f.exec(c);return RegExp(c.substring(1,c.length-2),"g")},o=function(a,b,c,d){if(b=l(a.pattern.regex?a.pattern.regex:a.pattern.regexBegin,b,d,!0)){a.result=b;for(d=0;d<c.length;d++)if(b.index<c[d].result.index||b.index===c[d].result.index&&a.pattern.pattern.index<c[d].pattern.pattern.index){c.splice(d,0,a);return}c.push(a)}},s=function(a,b,c,d){if(b[0])d.push({start:c,end:c+a[0].length,style:b[0].name});else for(var e=0,f=1;f<a.length;f++)if(a[f]){var h=
b[f];if(h){var g=c+e;d.push({start:g,end:g+a[f].length,style:h.name})}e+=a[f].length}},r=function(a,b,c){var d=a.start;b.forEach(function(b){d<=b.start&&c.push({start:d,end:b.start,style:a.style});c.push(b);d=b.end});d<a.end&&c.push({start:d,end:a.end,style:a.style})},v=function(a,c,d,e,f){if(d=d.getLinePatterns()){var h=[];d.forEach(function(b){var c=b.regex||b.regexBegin;c.oldLastIndex=c.lastIndex;(c=l(c,a,0))&&h.push({result:c,pattern:b})});h.sort(function(a,b){return a.result.index<b.result.index?
-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var g=0;h.length>0;){var i=h[0];h.splice(0,1);if(!(i.result.index<g)){var j=i.result.index,k,u=[];if(i.pattern.regex){g=i.result;k=j+g[0].length;k={start:c+j,end:c+k,style:i.pattern.pattern.name};if(!f){i.pattern.pattern.captures&&s(g,i.pattern.pattern.captures,c+j,u);u.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(j=0;j<u.length-1;j++)if(u[j+1].start<u[j].end){var v={start:u[j+1].end,
end:u[j].end,style:u[j].style};u[j].end=u[j+1].start;u.splice(j+2,0,v)}}r(k,u,e)}else{g=i.pattern.regexEnd;g=m(g,i.result);g=l(g,a,i.result.index+i.result[0].length);if(!g)b.lastIndex=0,g=b.exec(a);k=g.index+g[0].length;e.push({start:c+j,end:c+k,style:i.pattern.pattern.name})}g=g.index+g[0].length}o(i,a,h,g)}d.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},u=function(a,c,d,e){var f=[];d.getBlockPatterns().forEach(function(a){var b=l(a.regexBegin||a.regex,c,0);b&&f.push({result:b,
pattern:a})}.bind(this));if(!f.length)return f;f.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var h=0,g=[];f.length>0;){var i=f[0];f.splice(0,1);if(!(i.result.index<h)){var k=a.getLineAtOffset(e+i.result.index),u=a.getLine(k),s=[];v(u,a.getLineStart(k),d,s);k=e+i.result.index;for(u=0;u<s.length;u++)if(s[u].start===k){var h=i.result.index,r=null,w=i.pattern.regexEnd;if(w){h+=i.result[0].length;
for(var w=m(w,i.result),B=h;!r;){B=l(w,c,B);if(!B)b.lastIndex=0,B=b.exec(c);var M=[],K=new j({start:k,end:e+B.index+B[0].length,contentStart:e+h,contentEnd:e+B.index},i.pattern,d.getStyler(),a,d);v(c.substring(h,B.index+B[0].length),h,K,M);if(!M.length||M[M.length-1].end<=B.index)r=K;B=B.index+B[0].length}}else r=new j({start:k,end:k+i.result[0].length,contentStart:k,contentEnd:k+i.result[0].length},i.pattern,d.getStyler(),a,d);g.push(r);h=r.end-e;break}u===s.length&&(h=i.result.index+1)}o(i,c,f,
h)}return g},w=function(a,b,c){if(a.getAnnotationModel()){var d=g.AnnotationType.ANNOTATION_TASK;if(a.getLinePatterns().length&&a.pattern&&a.pattern.pattern.name&&a.pattern.pattern.name.indexOf("comment")===0){var e=[];v(b.getText(a.contentStart,a.end),a.contentStart,a,e,!0);for(var f=0;f<e.length;f++)e[f].style==="meta.annotation.task.todo"&&c.push(g.AnnotationType.createAnnotation(d,e[f].start,e[f].end,b.getText(e[f].start,e[f].end)))}a.getBlocks().forEach(function(a){w(a,b,c)}.bind(this))}};k.prototype=
{getPatterns:function(a){var b=[0],c={},d=RegExp("^"+(a?typeof a==="string"?a:a.qualifiedId:this._rootId)+"#[^#]+$"),e=[];this._patterns.forEach(function(a){if(d.test(a.qualifiedId))a.include?e.push(a):(a.index=b[0]++,c[a.id]=a)}.bind(this));e.forEach(function(a){this._processInclude(a,b,c)}.bind(this));var f=[];Object.keys(c).forEach(function(a){f.push(c[a])});return f},_addPatterns:function(a,b){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,b)}.bind(this))},_addRepositoryPatterns:function(a,
b){Object.keys(a).forEach(function(c){this._addPattern(a[c],c,b)}.bind(this))},_addPattern:function(a,b,c){a.parentId=c;a.id=b;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_processInclude:function(a,b,c){var d,e=a.include.indexOf("#");d=e===0?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):e===-1?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");var f=[];this._patterns.forEach(function(a){if(d.test(a.qualifiedId))if(a.include)f.push(a);
else if(!c[a.id])a.index=b[0]++,c[a.id]=a}.bind(this));f.forEach(function(a){this._processInclude(a,b,c)}.bind(this))},_NO_ID:"NoID"};j.prototype={adjustEnd:function(a){this.end+=a;this.contentEnd+=a;this._subBlocks.forEach(function(b){b.adjustEnd(a)})},adjustStart:function(a){this.start+=a;this.contentStart+=a;this._subBlocks.forEach(function(b){b.adjustStart(a)})},computeStyle:function(a,b){if(!this.pattern||!(this.start<=b&&b<this.end))return null;var c={start:this.start,end:this.end,style:this.pattern.pattern.name};
if(this.contentStart<=b&&b<this.contentEnd)return this.pattern.pattern.contentName?{start:this.contentStart,end:this.contentEnd,style:this.pattern.pattern.contentName}:c;var d,e,f,h;if(b<this.contentStart){e=this.pattern.pattern.beginCaptures||this.pattern.pattern.captures;if(!e)return c;d=this.pattern.regexBegin;f=a.getText(this.start,this.contentStart);h=this.start}else{e=this.pattern.pattern.endCaptures||this.pattern.pattern.captures;if(!e)return c;d=this.pattern.regexEnd;f=a.getText(this.contentEnd,
this.end);h=this.contentEnd}d.lastIndex=0;if(f=d.exec(f)){d=[];s(f,e,h,d);for(e=0;e<d.length;e++)if(d[e].start<=b&&b<d[e].end)return d[e]}return c},getAnnotationModel:function(){return this._styler._getAnnotationModel()},getBlockPatterns:function(){return this._blockPatterns},getBlocks:function(){return this._subBlocks},getEnclosurePatterns:function(){return this._enclosurePatterns},getLinePatterns:function(){return this._linePatterns},getParent:function(){return this._parent},getPatternManager:function(){return this._styler._getPatternManager()},
getStyler:function(){return this._styler},isRenderingWhitespace:function(){return this._styler._isRenderingWhitespace()},_initPatterns:function(){var a=function(a){var b=/^\(\?i\)\s*/.exec(a);b&&(a=a.substring(b[0].length));return a};this.getPatternManager().getPatterns(this.pattern?this.pattern.pattern:null).forEach(function(b){var c;if(b.match&&!b.begin&&!b.end){c="g";var d=a(b.match);d!==b.match&&(c+="i");c={regex:RegExp(d,c),pattern:b};this._linePatterns.push(c);if(b.patterns)this._blockPatterns.push(c);
else if(b.name&&b.name.indexOf("punctuation.section")===0&&(b.name.indexOf(".begin")!==-1||b.name.indexOf(".end")!==-1))this._enclosurePatterns[b.name]=c}else if(!b.match&&b.begin&&b.end){c="g";d=a(b.begin);d!==b.begin&&(c+="i");var e="g",f=a(b.end);f!==b.end&&(e+="i");c={regexBegin:RegExp(d,c),regexEnd:RegExp(f,e),pattern:b};this._linePatterns.push(c);this._blockPatterns.push(c)}}.bind(this))}};e.prototype={getStyles:function(a){return this._styler.getStyles(a)}};c.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}},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var b=[],c=this.view.getModel();c.getBaseModel&&
(c=c.getBaseModel());var d=this._findBlock(this._rootBlock,a),e=c.getLineAtOffset(a),f=c.getLine(e),h=[];v(f,c.getLineStart(e),d,h);for(e=0;e<h.length;e++){if(a<h[e].start)break;if(h[e].start<=a&&a<h[e].end){b.push(h[e]);break}}for(;d;)(h=d.computeStyle(c,a))&&b.splice(0,0,h),d=d.getParent();return b},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==
a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(){},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},_computeFolding:function(a){if(this.foldingEnabled){var b=this.view.getModel();if(b.getBaseModel){var c=this.annotationModel;if(c){c.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var d=[],e=b.getBaseModel(),f=0;f<a.length;f++){var h=a[f];(h=this._createFoldingAnnotation(b,e,h.start,h.end))&&d.push(h)}c.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),
b=b.getLineAtOffset(d);return e===b?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_findBlock:function(a,b){var c=a.getBlocks();if(!c.length)return a;var d=this._binarySearch(c,b,!0);return d<c.length&&c[d].start<=b&&b<c[d].end?this._findBlock(c[d],b):a},_findBrackets:function(a,b,c,d,e,f){for(var h=[],g=[],i=e,j=c.getBlocks(),k=this._binarySearch(j,e,!0);k<j.length;k++){if(j[k].start>=f)break;var l=j[k].start,m=j[k].end;i<l&&(v(d.substring(i-e,l-e),i,c,g),g.forEach(function(c){c.style.indexOf(a.pattern.name)===
0?h.push(c.start+1):c.style.indexOf(b.pattern.name)===0&&h.push(-(c.start+1))}),g=[]);i=m}i<f&&(v(d.substring(i-e,f-e),i,c,g),g.forEach(function(c){c.style.indexOf(a.pattern.name)===0?h.push(c.start+1):c.style.indexOf(b.pattern.name)===0&&h.push(-(c.start+1))}));return h},_findMatchingBracket:function(a,b,c){for(var d=a.getLineAtOffset(c),e=a.getLineEnd(d),f=a.getText(c,e),h,g=b.getEnclosurePatterns(),i=Object.keys(g),j=0;j<i.length;j++){var k=g[i[j]],m=l(k.regex,f,0);if(m&&m.index===0){h=k;break}}if(!h)return-1;
f=!1;h.pattern.name.indexOf(".begin")!==-1?(f=!0,j=h.pattern.name.replace(".begin",".end")):j=h.pattern.name.replace(".end",".begin");g=g[j];if(!g)return-1;i=a.getLine(d);k=a.getLineStart(d);e=this._findBrackets(h,g,b,i,k,e);for(j=0;j<e.length;j++)if(i=e[j]>=0?1:-1,e[j]*i-1===c){c=1;if(f){for(j++;j<e.length;j++)if(i=e[j]>=0?1:-1,c+=i,c===0)return e[j]*i-1;d+=1;for(j=a.getLineCount();d<j;){i=a.getLine(d);k=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(h,g,b,i,k,e);for(f=0;f<e.length;f++)if(i=
e[f]>=0?1:-1,c+=i,c===0)return e[f]*i-1;d++}}else{for(j--;j>=0;j--)if(i=e[j]>=0?1:-1,c+=i,c===0)return e[j]*i-1;for(d-=1;d>=0;){i=a.getLine(d);k=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(h,g,b,i,k,e);for(j=e.length-1;j>=0;j--)if(i=e[j]>=0?1:-1,c+=i,c===0)return e[j]*i-1;d--}}break}return-1},_getAnnotationModel:function(){return this.annotationModel},_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 i}return null},_getPatternManager:function(){return this.patternManager},_getStyles:function(a,b,c,d){b.getBaseModel&&(d=b.mapOffset(d));for(var e=d+c.length,f=[],h=d,g=a.getBlocks(),i=this._binarySearch(g,d,!0);i<g.length;i++){if(g[i].start>=e)break;var j=g[i].start,k=g[i].end;h<j&&v(c.substring(h-d,j-d),h,a,f);var m=Math.max(h,j);if(m===j&&g[i].pattern.regexBegin){var o=l(g[i].pattern.regexBegin,c.substring(m-d),0);if(o){var u=g[i].pattern.pattern.beginCaptures||g[i].pattern.pattern.captures;
u?s(o,u,m,f):f.push({start:m,end:m+o[0].length,style:g[i].pattern.pattern.name});m+=o[0].length}}var j=Math.min(e,k),r=[];if(j===k&&g[i].pattern.regexEnd&&(h=c.substring(j-h-(g[i].end-g[i].contentEnd)),o=l(g[i].pattern.regexEnd,h,0)))(u=g[i].pattern.pattern.endCaptures||g[i].pattern.pattern.captures)?s(o,u,j-o[0].length,r):g[i].pattern.pattern.name&&r.push({start:j-o[0].length,end:j,style:g[i].pattern.pattern.name}),j-=o[0].length;var h=this._getStyles(g[i],b,c.substring(m-d,j-d),m),w=g[i].pattern.pattern.contentName||
g[i].pattern.pattern.name;if(w){var O=m;h.forEach(function(a){a.start-O&&f.push({start:O,end:a.start,style:w});f.push(a);O=a.end});j-O&&f.push({start:O,end:j,style:w})}else f=f.concat(h);f=f.concat(r);h=k}h<e&&v(c.substring(h-d,e-d),h,a,f);if(b.getBaseModel)for(a=0;a<f.length;a++)c=f[a].end-f[a].start,f[a].start=b.mapOffset(f[a].start,!0),f[a].end=f[a].start+c;return f},_isRenderingWhitespace:function(){return this.whitespacesVisible&&(this.tabsVisible||this.spacesVisible)},_onDestroy:function(){this.destroy()},
_onLineStyle:function(b){if(b.textView===this.view)b.style=this._getLineStyle(b.lineIndex);b.ranges=this._getStyles(this._rootBlock,b.textView.getModel(),b.lineText,b.lineStart);b.ranges.forEach(function(a){if(a.style)a.style={styleClass:a.style.replace(/\./g," ")}});this._isRenderingWhitespace()&&(this.spacesVisible&&this._spliceStyles(d,b.ranges,b.lineText,b.lineStart),this.tabsVisible&&this._spliceStyles(a,b.ranges,b.lineText,b.lineStart))},_onSelection:function(a){var b=a.oldValue,c=a.newValue,
d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;f===e&&b&&h||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&h&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,i,j;if(c.start===c.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),c=this._findBlock(this._rootBlock,j),a=this._findMatchingBracket(a,c,j),a!==-1&&(i=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,
a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());var h=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(f,h,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,a=a.addedCharCount-c,d=this.view,e=d.getModel(),f=e.getBaseModel?e.getBaseModel():e,c=b+c,h=f.getCharCount(),i=this._rootBlock.getBlocks(),j=i.length,k=f.getLineStart(f.getLineAtOffset(b)),l=this._binarySearch(i,k,!0),m=this._binarySearch(i,c,!1,l-1,j),o;l<j&&i[l].start<=k&&k<i[l].end?(o=i[l].start,o>b&&(o+=a)):o=l===j&&j>0&&h-a===i[j-1].end?i[j-1].start:k;var s;do m<j?(s=i[m].end,s>b&&(s+=a),m+=1):
(m=j,s=h),k=f.getText(o,s),k=u(f,k,this._rootBlock,o);while(k.length&&i.length&&m<j&&k[k.length-1].pattern.pattern.id!==i[m-1].pattern.pattern.id);for(h=l;h<i.length;h++)j=i[h],j.start>b&&j.adjustStart(a),j.start>b&&j.adjustEnd(a);var v=m-l!==k.length;if(!v)for(h=0;h<k.length;h++){var j=i[l+h],r=k[h];if(j.start!==r.start||j.end!==r.end||j.type!==r.type){v=!0;break}}h=[l,m-l].concat(k);Array.prototype.splice.apply(i,h);v&&(h=o,j=s,e!==f&&(h=e.mapOffset(h,!0),j=e.mapOffset(j,!0)),d.redrawRange(h,j));
if(this.annotationModel){d=[];i=[];l=[];o=this.annotationModel.getAnnotations(o,s);for(s=this.foldingEnabled&&f!==e;o.hasNext();)if(j=o.next(),s&&j.type===g.AnnotationType.ANNOTATION_FOLDING){l.push(j);for(h=0;h<k.length;h++)if(j.start===k[h].start&&j.end===k[h].end)break;h===k.length?(d.push(j),j.expand()):(h=j.start,m=j.end,h>b&&(h-=a),m>b&&(m-=a),h<=b&&b<m&&h<=c&&c<m&&(h=f.getLineAtOffset(j.start),m=f.getLineAtOffset(j.end),h!==m?j.expanded||j.expand():this.annotationModel.removeAnnotation(j)));
for(h=0;h<k.length;h++){j=k[h];for(m=0;m<l.length;m++)if(l[m].start===j.start&&l[m].end===j.end)break;m===l.length&&(j=this._createFoldingAnnotation(e,f,j.start,j.end))&&i.push(j)}}else j.type===g.AnnotationType.ANNOTATION_TASK&&d.push(j);if(this.detectTasks)for(h=0;h<k.length;h++)w(k[h],f,i);this.annotationModel.replaceAnnotations(d,i)}},_spliceStyles:function(a,b,c,d){for(var e=a.regex,f=e.lastIndex=0,h=e.exec(c);h;){for(h=d+h.index;f<b.length;){if(h<b[f].end)break;f++}var g={start:h,end:h+1,style:a.style};
if(f<b.length&&b[f].start<=h){var i={start:h+1,end:b[f].end,style:b[f].style};b[f].end=h;b.splice(f+1,0,i);b.splice(f+1,0,g);f+=2}else b.splice(f,0,g),f++;h=e.exec(c)}}};return{TextStyler:c}});
define("orion/editor/textMateStyler",["orion/regex"],function(g){function k(c){var e;if(c instanceof Array){e=Array(c.length);for(var b=0;b<c.length;b++)e[b]=k(c[b])}else for(b in e={},c)if(Object.prototype.hasOwnProperty.call(c,b)){var f=c[b];e[b]=typeof f==="object"&&f!==null?k(f):f}return e}function j(c,e,b){this.initialize(c);this.grammar=k(e);this.externalGrammars=b?k(b):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var e={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function g(b,a){throw Error('Unsupported regex feature "'+b+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var b="",f,c=e.processGlobalFlag("x",c,function(b){for(var a="",c=!1,e=b.length,f=0;f<e;){var h=b.charAt(f);if(!c&&h==="#")for(;f<e&&h!=="\r"&&h!=="\n";)h=b.charAt(++f);
else if(!c&&/\s/.test(h))for(;f<e&&/\s/.test(h);)h=b.charAt(++f);else h==="\\"?(a+=h,/\s/.test(b.charAt(f+1))||(a+=b.charAt(f+1),f+=1)):(h==="["?c=!0:h==="]"&&(c=!1),a+=h),f+=1}return a}),c=e.processGlobalFlag("i",c,function(c){b+="i";return c});for(f=0;f<this.unsupported.length;f++){var h;(h=this.unsupported[f].regex.exec(c))&&g(this.unsupported[f].func(h),h)}return RegExp(c,b)},processGlobalFlag:function(c,e,b){function f(b,a){for(var c=0,e=b.length,f=-1,h=a;h<e&&f===-1;h++)switch(b.charAt(h)){case "\\":h++;
break;case "(":c++;break;case ")":c--,c===0&&(f=h)}return f}var h="(?"+c+")",c="(?"+c+":";if(e.substring(0,h.length)===h)return b(e.substring(h.length));else if(e.substring(0,c.length)===c){h=f(e,0);if(h<e.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+e);return b(e.substring(c.length,h))}return e},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,e,b){for(var b=typeof b==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
f=[],h=0;h<c.length;h++){var d=c[h],a=/\\(\d+)/.exec(d);a?(d=e[a[1]]||"",f.push(b?g.escape(d):d)):f.push(d)}return RegExp(f.join(""))},groupify:function(c,e){for(var b=c.source,f=b.length,h=[],d=0,a=[],g=1,j=1,k=[],s={},r={},v=0;v<f;v++){var u=h[h.length-1],w=b.charAt(v);switch(w){case "(":if(u===4)h.pop(),k.push(")"),a[a.length-1].end=v;var t=v+2<f?b.charAt(v+1)+""+b.charAt(v+2):null;if(t==="?:"||t==="?="||t==="?!"){var x;t==="?:"?x=1:(x=3,d++);h.push(x);a.push({start:v,end:-1,type:x});k.push(w);
k.push(t);v+=t.length}else h.push(2),a.push({start:v,end:-1,type:2,oldNum:g,num:j}),k.push(w),d===0&&(r[j]=null),s[g]=j,g++,j++;break;case ")":u=h.pop();u===3&&d--;a[a.length-1].end=v;k.push(w);break;case "*":case "+":case "?":case "}":var n=w,p=b.charAt(v-1),t=v-1;if(w==="}"){for(x=v-1;b.charAt(x)!=="{"&&x>=0;x--);p=b.charAt(x-1);t=x-1;n=b.substring(x,v+1)}x=a[a.length-1];if(p===")"&&(x.type===2||x.type===4)){k.splice(x.start,0,"(");k.push(n);k.push(")");w={start:x.start,end:k.length-1,type:4,num:x.num};
for(p=0;p<a.length;p++)if(u=a[p],(u.type===2||u.type===4)&&u.start>=x.start&&u.end<=t)if(u.start+=1,u.end+=1,u.num+=1,u.type===2)s[u.oldNum]=u.num;a.push(w);j++;break}default:w!=="|"&&u!==2&&u!==4&&d===0&&(h.push(4),a.push({start:v,end:-1,type:4,num:j}),k.push("("),r[j]=null,j++),k.push(w),w==="\\"&&(w=b.charAt(v+1),k.push(w),v+=1)}}for(;h.length;)h.pop(),k.push(")");var b=RegExp(k.join("")),f={},e=e||s,y;for(y in e)e.hasOwnProperty(y)&&(f[y]="\\"+e[y]);b=this.getSubstitutedRegex(b,f,!1);return[b,
s,r]},complexCaptures:function(c){if(!c)return!1;for(var e in c)if(c.hasOwnProperty(e)&&e!=="0")return!0;return!1}};j.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var e=this;this._listener={onModelChanged:function(b){e.onModelChanged(b)},onDestroy:function(b){e.onDestroy(b)},onLineStyle:function(b){e.onLineStyle(b)},onStorage:function(b){e.onStorage(b)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);
c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var e=
c.pop();if(!e._resolvedRule||!e._typedRule)if(e._resolvedRule=this._resolve(e),e._typedRule=this._createTypedRule(e),this.addStyles(e.name),this.addStyles(e.contentName),this.addStylesForCaptures(e.captures),this.addStylesForCaptures(e.beginCaptures),this.addStylesForCaptures(e.endCaptures),e._resolvedRule!==e&&c.push(e._resolvedRule),e.patterns)for(var b=0;b<e.patterns.length;b++)c.push(e.patterns[b])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var e=c.split("."),b=0;b<
e.length;b++)this._styles[c].push(e.slice(0,b+1).join("-"))}},addStylesForCaptures:function(c){for(var e in c)c.hasOwnProperty(e)&&this.addStyles(c[e].name)},ContainerRule:function(){function c(c){this.rule=c;this.subrules=c.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(c){this.rule=c;this.beginRegex=e.toRegExp(c.begin);this.endRegex=e.toRegExp(c.end);this.subrules=c.patterns||[];this.endRegexHasBackRef=e.hasBackReference(this.endRegex);var b=e.complexCaptures(c.captures),
c=e.complexCaptures(c.beginCaptures)||e.complexCaptures(c.endCaptures);if(this.isComplex=b||c)b=e.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=e.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(c){this.rule=c;this.matchRegex=e.toRegExp(c.match);if(this.isComplex=e.complexCaptures(c.captures))c=
e.groupify(this.matchRegex),this.matchRegex=c[0],this.matchOld2New=c[1],this.matchConsuming=c[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var e=c;if(c.include){if(c.begin||c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(e=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!e)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")e=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(e=this._allGrammars[c],!e)for(var b=0;b<this.externalGrammars.length;b++){var f=this.externalGrammars[b];if(f.scopeName===c){this.preprocess(f);e=this._allGrammars[c]=f;break}}}return e},ContainerNode:function(){function c(c,b){this.parent=c;this.rule=b;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(c){this.children.push(c)};c.prototype.valueOf=function(){var c=this.rule;return"ContainerNode { "+(c.include||"")+" "+(c.name||"")+(c.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(c,b,f){this.parent=c;this.rule=b;this.children=[];this.setStart(f);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?e.getSubstitutedRegex(b.endRegex,f):null}c.prototype.addChild=function(c){this.children.push(c)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(c){this.start=c.index;this.beginMatch=c};c.prototype.setEnd=function(c){c&&typeof c==="object"?(this.endMatch=c,this.end=c.index+c[0].length):(this.endMatch=null,this.end=c)};c.prototype.shiftStart=function(c){this.start+=c;this.beginMatch.index+=c};c.prototype.shiftEnd=function(c){this.end+=c;this.endMatch&&(this.endMatch.index+=c)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,e){if(e)for(var b=e.length;b>0;)c.push(e[--b])},exec:function(c,e,b){(e=c.exec(e))&&(e.index+=b);c.lastIndex=0;return e},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,e,b){if(c instanceof this.BeginEndNode){var f=c.rule,c=c.endRegexSubstituted||f.endRegex;return!c?null:this.exec(c,e,b)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(c){var e=c.addedCharCount,b=c.removedCharCount,c=c.start;if(this._tree){var f=this.textView.getModel(),h=f.getCharCount(),f=f.getLineEnd(f.getLineAtOffset(c)-1),d=this.getFirstDamaged(f,f),f=f===-1?0:f,e=d?this.parse(d,!0,f,c,e,b):h;this.textView.redrawRange(f,e)}else this.initialParse()},getFirstDamaged:function(c,e){if(c<0)return this._tree;for(var b=[this._tree],f=null;b.length;){var h=b.pop();if(!h.parent||this.isDamaged(h,c,e)){h instanceof this.BeginEndNode&&(f=
h);for(var d=0;d<h.children.length;d++)b.push(h.children[d])}}return f||this._tree},isDamaged:function(c,e,b){return c.start<=b&&c.end>e},parse:function(c,e,b,f,h,d){var a=this.textView.getModel(),g=a.getLineStart(a.getLineCount()-1),j=a.getCharCount(),k=this.getInitialExpected(c,b),s=-1;if(e)c.repaired=!0,c.endNeedsUpdate=!0,s=(s=c.children[c.children.length-1])?a.getLineEnd(a.getLineAtOffset(s.end+(h-d))):-1,f=a.getLineEnd(a.getLineAtOffset(f+d)),s=Math.max(s,f);for(var s=s===-1?j:s,f=k,r=c,v=!1,
u=b,w=-1;r&&(!e||u<s);){var t=this.getNextMatch(a,r,u);t||(u=u>=g?j:a.getLineStart(a.getLineAtOffset(u)+1));var x=t&&t.match,n=t&&t.rule,p=t&&t.isEnd;if(t&&t.isSub){if(u=this.afterMatch(x),n instanceof this.BeginEndRule)v=!0,e&&n===f.rule&&r===f.parent?(r=f,r.setStart(x),r.repaired=!0,r.endNeedsUpdate=!0,f=this.getNextExpected(f,"begin")):(e&&(this.prune(r,f),e=!1),x=new this.BeginEndNode(r,n,x),r.addChild(x),r=x)}else if(p||u===j){if(r instanceof this.BeginEndNode)x?(v=!0,w=Math.max(w,r.end),r.setEnd(x),
u=this.afterMatch(x),e&&r===f&&r.parent===f.parent?(r.repaired=!0,delete r.endNeedsUpdate,f=this.getNextExpected(f,"end")):e&&(this.prune(r,f),e=!1)):(r.setEnd(j),delete r.endNeedsUpdate);r=r.parent}e&&u>=s&&!v&&(this.prune(c,k),e=!1)}this.removeUnrepairedChildren(c,e,b);this.cleanup(e,c,b,s,j,h,d);return e?Math.max(w,u):u},removeUnrepairedChildren:function(c,e,b){if(e){for(var e=c.children,f=-1,h=0;h<e.length;h++){var d=e[h];if(!d.repaired&&this.isDamaged(d,b,Number.MAX_VALUE)){f=h;break}}if(f!==
-1)c.children.length=f}},cleanup:function(c,e,b,f,h,d,a){if(c){c=d-a;h=this.getIntersecting(f-c+1,h);e=this.getIntersecting(b,f);for(b=0;b<h.length;b++)f=h[b],!f.repaired&&f instanceof this.BeginEndNode&&(f.shiftEnd(c),f.shiftStart(c));for(b=0;b<e.length;b++)f=e[b],f.repaired&&f.endNeedsUpdate&&f.shiftEnd(c),delete f.endNeedsUpdate,delete f.repaired}else{e=this.getIntersecting(b,f);for(b=0;b<e.length;b++)delete e[b].repaired}},getNextMatch:function(c,e,b,f){var h=c.getLineAtOffset(b),h=c.getLineEnd(h),
d=c.getText(b,h),a=[],g=[],c=[],h=[];for(this.push(a,e.rule.subrules);a.length;){var j=a.length?a.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&g.indexOf(j)===-1)g.push(j),this.push(a,j.subrules);else if(!j||!f||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,d,b);k&&(c.push(k),h.push(j))}}a=Number.MAX_VALUE;g=-1;for(j=0;j<c.length;j++)if(k=c[j],k.index<a)a=k.index,g=j;if(!f&&(b=this.getEndMatch(e,d,b)))if(f=e.rule.applyEndPatternLast,g===-1||b.index<a||
!f&&b.index===a)return{isEnd:!0,rule:e.rule,match:b};return g===-1?null:{isSub:!0,rule:h[g],match:c[g]}},getInitialExpected:function(c,e){var b,f;if(c===this._tree)for(b=0;b<c.children.length;b++){if(f=c.children[b],f.start>=e)return f}else if(c instanceof this.BeginEndNode&&c.endMatch){var h=c.endMatch.index;for(b=0;b<c.children.length;b++)if(f=c.children[b],f.start>=e)break;if(f&&f.start<h)return f}return c},getNextExpected:function(c,e){if(e==="begin"){var b=c.children[0];return b?b:c}else if(e===
"end"&&(b=c.parent)){var f=b.children[b.children.indexOf(c)+1];return f?f:b}return null},prune:function(c,e){if(e.parent===c)c.children.length=e.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var e=c.lineStart,b=this.textView.getModel(),f=b.getLineEnd(c.lineIndex),h=b.getLineEnd(b.getLineAtOffset(e)-1),h=this.getFirstDamaged(h,h),e=this.getLineScope(b,
h,e,f);c.ranges=this.toStyleRanges(e);c.ranges.sort(function(b,a){return b.start-a.start})},getLineScope:function(c,e,b,f){for(var h=b,d=this.getInitialExpected(e,b),a=[],g=[];e&&h<f;){var j=this.getNextMatch(c,e,h);if(!j)break;var k=j&&j.match,s=j&&j.rule,r=j&&j.isSub,j=j&&j.isEnd;k.index!==h&&g.push({start:h,end:k.index,node:e});if(r)h=this.afterMatch(k),s instanceof this.BeginEndRule?(this.addBeginScope(a,k,s),e=d,d=this.getNextExpected(d,"begin")):this.addMatchScope(a,k,s);else if(j)h=this.afterMatch(k),
this.addEndScope(a,k,s),d=this.getNextExpected(d,"end"),e=e.parent}h<f&&g.push({start:h,end:f,node:e});c=this.getInheritedLineScope(g,b,f);return a.concat(c)},getInheritedLineScope:function(c){for(var e=[],b=0;b<c.length;b++)for(var f=c[b],h=f.node;h;){var d=h.rule.rule,a=d.name;if(d=d.contentName||a){this.addScopeRange(e,f.start,f.end,d);break}h=h.parent}return e},addBeginScope:function(c,e,b){var f=b.rule;this.addCapturesScope(c,e,f.beginCaptures||f.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},
addEndScope:function(c,e,b){var f=b.rule;this.addCapturesScope(c,e,f.endCaptures||f.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(c,e,b){var f=b.rule,h=f.name;(f=f.captures)?this.addCapturesScope(c,e,f,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(c,e,h)},addScope:function(c,e,b){b&&c.push({start:e.index,end:this.afterMatch(e),scope:b})},addScopeRange:function(c,e,b,f){f&&c.push({start:e,end:b,scope:f})},addCapturesScope:function(c,e,b,f,h,d){if(b)if(f){for(var f=
{1:0},a=0,g=1;e[g]!==void 0;g++)d[g]!==void 0&&(a+=e[g].length),e[g+1]!==void 0&&(f[g+1]=a);d=e.index;for(a=1;b[a];a++){var g=b[a].name,j=h[a],k=d+f[j];typeof e[j]!=="undefined"&&this.addScopeRange(c,k,k+e[j].length,g)}}else this.addScope(c,e,b[0]&&b[0].name)},getIntersecting:function(c,e){for(var b=[],f=this._tree?[this._tree]:[];f.length;){var h=f.pop(),d=!1;h instanceof this.ContainerNode?d=!0:this.isDamaged(h,c,e)&&(d=!0,b.push(h));if(d)for(var d=h.children.length,a=0;a<d;a++)f.push(h.children[a])}return b.reverse()},
toStyleRanges:function(c){for(var e=[],b=0;b<c.length;b++){var f=c[b],h=this._styles[f.scope];if(!h)throw Error("styles not found for "+f.scope);h=h.join(" ");e.push({start:f.start,end:f.end,style:{styleClass:h}})}return e}};return{RegexUtil:e,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function j(b){return b.getProperty("objectClass").indexOf(c)!==-1&&b.getProperty("type")==="highlighter"}function e(b,c,e){this.initialize(b,c,e);this.lineStyles=[]}var c="orion.edit.highlighter",i=c+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:g.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
e.prototype={initialize:function(b,e,h){this.textView=b;this.serviceRegistry=e;this.annotationModel=h;this.services=[];var d=this;this.listener={onModelChanging:function(a){d.onModelChanging(a)},onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStyleReady:function(a){d.onStyleReady(a)},onServiceAdded:function(a){d.onServiceAdded(a.serviceReference,d.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){d.onServiceRemoved(a.serviceReference,
d.serviceRegistry.getService(a.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);e.addEventListener("registered",this.listener.onServiceAdded);e.addEventListener("unregistering",this.listener.onServiceRemoved);b=e.getServiceReferences(c);for(h=0;h<b.length;h++){var a=b[h];j(a)&&this.addServiceListener(e.getService(a))}},
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,e=-1,d=this.textView.getModel(),a;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(this.lineStyles[a]=c[a],b=Math.min(b,a),e=Math.max(e,a));b=Math.max(b,0);e=Math.min(e,d.getLineCount());if(c=this.annotationModel){for(var g=c.getAnnotations(d.getLineStart(b),d.getLineEnd(e)),i=[];g.hasNext();){var j=g.next();j.type==="orion.annotation.highlightError"&&i.push(j)}g=[];for(j=b;j<=e;j++){a=j;var s=this.lineStyles[a],s=s&&s.errors;
a=d.getLineStart(a);if(s)for(var r=0;r<s.length;r++){var v=s[r];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",v.start+a,v.end+a))}}c.replaceAnnotations(i,g)}this.textView.redrawLines(b,e+1)},onLineStyle:function(b){function c(b,a){for(var e=b.length,f=[],h=0;h<e;h++){var g=b[h];f.push({start:g.start+a,end:g.end+a,style:g.style})}return f}var e=this.lineStyles[b.lineIndex];if(e)if(e.ranges)b.ranges=c(e.ranges,b.lineStart);else if(e.style)b.style=e.style},_getEmptyStyle:function(b){for(var c=
[],e=0;e<b;e++)c.push(null);return c},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var c=this.services[b];if(c.setContentType){var e=this.serviceRegistry.getService("orion.page.progress");e?e.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}},onServiceAdded:function(b,c){j(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 c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(i))},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(i))}};return e});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(g,k,j,e,c){function i(b,d,a,i,m,o,s){function r(b,e){var f=b.getProperty("contentType")||b.getProperty("contentTypes"),h=b.getProperty("fileTypes");if(f)return c.when(d.isSomeExtensionOf(a,f)).then(function(a){return a?b:null});else if(e&&h&&h.indexOf(e)!==-1)return f=new c,f.resolve(b),f;return null}function v(a){var b=null;switch(a&&
a.id){case "application/javascript":case "application/json":b=new g.TextStyler(i,"js",m);break;case "text/x-java-source":b=new g.TextStyler(i,"java",m);break;case "text/css":b=new g.TextStyler(i,"css",m)}return b}if(!f){var u=v(a);if(u)return o=new c,o.resolve(u),o}if(f&&!this.orionGrammars)this.orionGrammars={};for(var u=o&&o.split(".").pop().toLowerCase(),o=b.getServiceReferences("orion.edit.highlighter"),w=[],t=[],x=0;x<o.length;x++){var n=o[x],p=n.getProperty("type");p==="grammar"||!f&&typeof p===
"undefined"?w.push(n.getProperty("grammar")):p!=="highlighter"&&(p=n.getProperty("id"))&&!this.orionGrammars[p]&&(this.orionGrammars[p]={id:p,contentTypes:n.getProperty("contentTypes"),patterns:n.getProperty("patterns"),repository:n.getProperty("repository")});(n=r(n,u))&&t.push(n)}return c.all(t,function(a){return{_error:a}}).then(function(c){for(var d,g=c.length-1;g>=0;g--){var n=c[g];if(n&&!n._error&&(s||n.getProperty("type")!=="highlighter")){d=n;break}}var t;if(d)if(c=d.getProperty("type"),c===
"highlighter")t=new e(i,b,m),t.setContentType(a);else if(c==="grammar"||!f&&typeof c==="undefined")d=d.getProperty("grammar"),t=new j.TextMateStyler(i,d,w);else if(f){t=[];for(var o in this.orionGrammars)t.push(this.orionGrammars[o]);t=new k.TextStyler(i,m,t,d.getProperty("id"))}return t})}function b(b,c){this.serviceRegistry=b;this.contentTypeService=c;this.styler=null}var f=1;b.prototype={setup:function(b,c,a,e,f){f=typeof f==="undefined"?!0:f;if(this.styler)this.styler.destroy&&this.styler.destroy(),
this.styler=null;var g=this;return i(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),b,c,a,e,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:i,SyntaxHighlighter:b}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(g){function k(j,e,c){g.attach(this);this._binderFunc=e;this.setInputField(j);(j=c?c.group:null)||(j=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=j+"__completion__";this._proposeFromStart=c?c.proposeFromStart:!1;this._extendedProvider=c?c.extendedProvider:null;this._serviceRegistry=c?c.serviceRegistry:null;this._onDelete=c?c.onDelete:null;this._deleteToolTips=
c?c.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];c=function(c){this._binderFunc&&this._binderFunc(function(b){this._bind(b);c.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",c);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:c});c=function(){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",c);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:c});c=function(){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",c);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:c})}k.prototype._removeListeners=function(g){g&&g.forEach(function(e){e.evtTarget.removeEventListener(e.type,e.handler,!1)})};k.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};k.prototype.hasValueOf=function(g){return this._dataList.some(function(e){return e.value===g})};k.prototype.setInputField=function(g){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=g;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);g=function(){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):this._dismiss()}.bind(this);this._inputField.addEventListener("blur",g);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:g});g=function(e){this.onKeyDown(e)}.bind(this);this._inputField.addEventListener("keydown",g);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:g});g=function(){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",g);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:g});g=function(){if(this._dismissed&&this._binderFunc)this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(e){this._bind(e)}.bind(this))}.bind(this);this._inputField.addEventListener("focus",g);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:g})};k.prototype.onKeyDown=function(g){if(this._dismissed)return!0;var e=g.charCode||g.keyCode;if(e===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=
0&&this._proposalIndex<this._proposalList.length)return g.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,g.ctrlKey),g.stopPropagation(),!1}else if((e===40||e===38)&&this._proposalList&&this._proposalList.length>0)return g.preventDefault(),this._walk(e===40),g.stopPropagation(),!1;else if(e===27)return g.preventDefault(),this._dismiss(),!1;else if(e===46&&this._proposalIndex>-1&&this._onDelete)return g.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),g.stopPropagation(),!1;return!0};k.prototype._resetIndexAfterDeletion=function(){if(this._proposalList.length<=1)this._proposalIndex=-1;else if(this._proposalIndex===this._proposalList.length-1)this._proposalIndex=this._proposalList.length-2};k.prototype._bind=function(g){this._dataList=g};k.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};k.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
k.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());if(!this._completionUIContainer)this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer);this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());if(!this._completionUL)this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL";this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};k.prototype._createProposalLink=function(g,e,c,i){var b=
document.createElement("a");b.href=require.toUrl(e);b.appendChild(this._createBoldText(g,c,i));return b};k.prototype._createBoldText=function(g,e,c,i){if(e<0)return document.createTextNode(g);var i=i?i:document.createElement("span"),b;0!==e&&(b=document.createTextNode(g.substring(0,e)),i.appendChild(b));var f=document.createElement("b");i.appendChild(f);b=document.createTextNode(g.substring(e,e+c));f.appendChild(b);e+c<g.length&&(b=document.createTextNode(g.substring(e+c)),i.appendChild(b));return i};
k.prototype._proposeOnCategory=function(g,e){if(e.length!==0){var c;if(g){c=document.createElement("li");c.className="inputCompletionLICategory";var i=document.createTextNode(g);c.appendChild(i);this._completionUL.appendChild(c)}e.forEach(function(b){c=document.createElement("li");c.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);c.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);c.className="inputCompletionLINormal";c.completionItem=b.item;
var e;if(typeof b.item.value==="string"){var h=document.createElement("table");h.style.width="100%";h.style.tableLayout="fixed";h.style.borderSpacing="0";var d=document.createElement("tr");d.style.width=this._inputField.offsetWidth+"px";h.appendChild(d);var a=document.createElement("td");a.classList.add("inputCompletionLILeftTD");var g=this._createBoldText(b.item.value,b.boldIndex,b.boldLength);a.appendChild(g);a.style.overflow="hidden";d.appendChild(a);if(this._onDelete)e=document.createElement("button"),
e.classList.add("inputCompletionDismissButton"),e.classList.add("layoutRight"),e.classList.add("core-sprite-close"),e.classList.add("imageSprite"),e.style.display="none",e.style.margin="0 0 0",e.title=this._deleteToolTips,e.onclick=function(a){a.stopPropagation();this._onDelete(b.item.value,this);this._resetIndexAfterDeletion()}.bind(this),a=document.createElement("td"),a.classList.add("inputCompletionLIRightTD"),a.appendChild(e),d.appendChild(a);c.appendChild(h)}else b.item.value.name&&b.item.value.type===
"link"&&c.appendChild(this._createProposalLink(b.item.value.name,b.item.value.value,b.boldIndex,b.boldLength));this._completionUL.appendChild(c);this._proposalList.push({item:b.item,domNode:c,deleteBtn:e})}.bind(this))}};k.prototype._domNode2Index=function(g){if(this._proposalList)for(var e=0;e<this._proposalList.length;e++)if(this._proposalList[e].domNode===g)return e;return-1};k.prototype._highlight=function(g,e){var c=g,i,b=!1;if(!isNaN(c))b=!0,this._proposalList&&g>=0&&g<this._proposalList.length?
(c=this._proposalList[g].domNode,i=this._proposalList[g].deleteBtn):c=null;if(c){c.className=e?"inputCompletionLISelected":"inputCompletionLINormal";if(i)i.style.display=e?"":"none";e&&b&&(c.offsetTop<this._completionUIContainer.scrollTop?c.scrollIntoView(!0):c.offsetTop+c.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&c.scrollIntoView(!1))}};k.prototype._selectProposal=function(g,e){var c=g;isNaN(c)&&(c=this._domNode2Index(g));if(c!==this._proposalIndex||
e)this._highlight(this._proposalIndex,!1),this._proposalIndex=c,this._highlight(this._proposalIndex,!0)};k.prototype._dismiss=function(g,e){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof g==="string")this._inputField.value=g,this._dismissing=!0,this._inputField.focus();else if(g&&g.name&&g.type==="link")e?window.open(g.value):window.location.href=g.value;window.setTimeout(function(){this._completionUIContainer.style.display="none"}.bind(this),200)}};
k.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var g=0,e=0,c=this._inputField;c;)g+=c.offsetLeft,e+=c.offsetTop,c=c.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=e+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=g+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=
-1,this._completionUIContainer.style.display="none"};k.prototype._walk=function(g){g=this._proposalIndex+(g?1:-1);g<-1?g=this._proposalList.length-1:g>=this._proposalList.length&&(g=-1);this._selectProposal(g)};k.prototype._proposeOnList=function(g,e,c){var i="",b=[],f=e?e.length:0;g.forEach(function(h){if(h.type==="category")this._proposeOnCategory(i,b),i=h.label,b=[];else{var d=!0,a=-1;if(e&&c){var g;typeof h.value==="string"?g=h.value.toLowerCase():h.value.name&&(g=h.value.name.toLowerCase());
a=g.indexOf(e);a<0?d=!1:this._proposeFromStart&&(d=a===0)}d&&b.push({item:h,boldIndex:a,boldLength:f})}}.bind(this));this._proposeOnCategory(i,b)};k.prototype._proposeOn=function(g){this._completionUL.textContent="";var e=g?g.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,e,!0);this._extendedProvider&&e?this._extendedProvider(g,function(c){c&&c.forEach(function(c){this._proposeOnList(c.proposals,c.filterForMe?e:g,c.filterForMe)}.bind(this));this._show()}.bind(this),[]):
this._show()};k.prototype.constructor=k;return{InputCompletion:k}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages,orion/editor/find,orion/commands,orion/objects,orion/searchUtils,orion/inputCompletion/inputCompletion,orion/webui/littlelib".split(","),function(g,k,j,e,c,i,b){function f(b,c,a,e,f){k.Find.call(this,b,e,f);this._serviceRegistry=c;this._commandService=a}f.prototype=new k.Find;e.mixin(f.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;this._addRecentfind(c);var b=b.replaceString,a=document.getElementById("localSearchFindWith");a||(this._createActionTable(),a=document.getElementById("localSearchFindWith"));
if(c)a.value=c;if(b)document.getElementById("localSearchReplaceWith").value=b;window.setTimeout(function(){a.select();a.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw==",this._replaceInfo.title=g["Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw==",
this._replaceInfo.title=g["Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]);this._replaceInfo.style.display=""},_createActionTable:function(){var b=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){var a=document.createElement("input");a.type="text";a.name=g["Find:"];a.className="parameterInput";a.id="localSearchFindWith";a.placeholder=
g["Find With"];a.oninput=function(a){return b._handleInput(a)};a.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(a);b._initCompletion(a);b._createButton(g.Next,c,function(){b._addRecentfind(b.getFindString());b.find(!0)});b._createButton(g.Previous,c,function(){b._addRecentfind(b.getFindString());b.find(!1)});var e=b._editor.getTextView().getOptions("readonly");if(!e){var f=document.createElement("input");f.type="text";f.name=g["ReplaceWith:"];f.className="parameterInput";f.id="localSearchReplaceWith";
f.placeholder=g["Replace With"];f.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(f);b._replaceInfo=b._createInfoImage(null,c,null);b._showReplaceInfo();b._createButton(g.Replace,c,function(){b.replace()});b._createButton(g["Replace All"],c,function(){b.replaceAll()})}f=document.createElement("div");c.appendChild(f);f.classList.add("findOptionsDiv");var i=j.createDropdownMenu(f,g.Options,null,"dismissButton",null,!0);i.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(i.menu,
g["Show all"],b._showAll,function(a){b.setOptions({showAll:a.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Case sensitive"],!b._caseInsensitive,function(a){b.setOptions({caseInsensitive:!a.target.checked});i.dropdown.close(!0);b.find(!0)});j.createCheckedMenuItem(i.menu,g["Wrap search"],b._wrap,function(a){b.setOptions({wrap:a.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Incremental search"],b._incremental,function(a){b.setOptions({incremental:a.target.checked});
i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Whole Word"],b._wholeWord,function(a){b.setOptions({wholeWord:a.target.checked});i.dropdown.close(!0);b.find(!0)});b._regExBox=j.createCheckedMenuItem(i.menu,g["Regular expression"],b._regex,function(a){b.setOptions({regex:a.target.checked});i.dropdown.close(!0);b.find(!0);b._showReplaceInfo()});e||j.createCheckedMenuItem(i.menu,g["Find after replace"],b._findAfterReplace,function(a){b.setOptions({findAfterReplace:a.target.checked});i.dropdown.close(!0)});
return a},function(){b.hide()})},_storeRecentFind:function(b,c,a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentFind",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:a})}.bind(this),20)})},_addRecentfind:function(b){typeof b==="string"&&b&&(!this._completion||!this._completion.hasValueOf(b))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var a,
c=c.get("recentFind");typeof c==="string"&&(c=JSON.parse(c));if(c){for(a in c)if(c[a].name===b)return;c.length>=30&&c.splice(29,c.length-30+1)}else c=[];c.splice(0,0,{name:b});this._storeRecentFind(c,this._completion)}.bind(this))},_removeRecentSearch:function(b,c){typeof b==="string"&&b&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var e,a=a.get("recentFind");typeof a==="string"&&(a=JSON.parse(a));if(a)for(e in a)if(a[e].name===b){a.splice(e,
1);this._storeRecentFind(a,c,!0);break}}.bind(this))},_initCompletion:function(b){if(this._completion)this._completion.setInputField(b);else{var c=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get("recentFind");typeof b==="string"&&(b=JSON.parse(b));if(b){var c=[];b.forEach(function(a){c.push({type:"proposal",label:a.name,value:a.name})});a(c)}})}.bind(this);this._completion=new i.InputCompletion(b,c,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,b){this._removeRecentSearch(a,b)}.bind(this),deleteToolTips:g["Click or use delete key to delete the search term"]})}},_createButton:function(c,d,a){var e=document.createElement("button");e.addEventListener("click",a.bind(this),!1);var f=this;e.addEventListener("keydown",function(a){a.keyCode===b.KEY.ESCAPE&&f.hide()});e.appendChild(document.createTextNode(c));e.className="dismissButton parameterInlineButton";d.appendChild(e)},_createInfoImage:function(b,c){var a=
document.createElement("img");a.classList.add("replaceInfo");a.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));c.appendChild(a);return 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,this._addRecentfind(this.getFindString()),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:f}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(g,k,j){function e(c,e){for(var b=e.getFileMetadata(),f=c.getServiceReferences("orion.edit.blamer"),h=0;h<f.length;h++){var d=f[h],a={};a.validationProperties=d.getProperty("validationProperties");a.forceSingleItem=!0;a=g._makeValidator(a,c);if(a.validationFunction.bind(a)(b))return c.getService(d)}return null}return{isVisible:function(c,g){return!!e(c,g)&&!!c.getService("orion.core.blame")},getBlame:function(c,
g){var b=e(c,g);b&&b.doBlame(g.getInput()).then(function(b){for(var e=k.getOrionHome(),d=0;d<b.length;d++){var a=b[d],g=new j(a.CommitLink),i={};i.OrionHome=e;a.CommitLink=g.expand(i)}c.getService("orion.core.blame")._setAnnotations(b)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(g){var k=Object.create(null);g.getServiceReferences("orion.edit.context").forEach(function(j){var e=g.getService(j);Object.keys(e).forEach(function(c){typeof e[c]==="function"&&(k[c]=e[c].bind(e))})});return k},getOptions:function(g){var k=Object.create(null);g.getServiceReferences("orion.edit.context").forEach(function(g){g.getPropertyKeys().forEach(function(e){e!=="service.id"&&e!=="service.names"&&e!=="objectClass"&&
(k[e]=g.getProperty(e))})});return k}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/widgets/input/DropDownMenu,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/extensionCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/editor/annotations,orion/blamer,orion/regex,orion/util,orion/edit/editorContext".split(","),function(g,k,j,e,c,i,b,f,h,d,a,l,m,o,s,r,v,u,w,t){function x(a){var c=
new b(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||s.getOrionHome();var c=c.expand(d),d=document.createElement("div"),e=document.createElement("iframe");e.id=a.id;e.name=a.id;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=a.border!==void 0?a.border:1;e.src=c;e.className="delegatedUI";if(a.width)d.style.width=a.width,e.style.width=a.width;if(a.height)d.style.height=a.height,e.style.height=a.height;e.style.visibility="hidden";a.parent!==null&&(a.parent||window.document.body).appendChild(d);
d.appendChild(e);e.style.left=a.left||(window.innerWidth-parseInt(e.clientWidth,10))/2+"px";e.style.top=a.top||(window.innerHeight-parseInt(e.clientHeight,10))/2+"px";e.style.visibility="";window.addEventListener("message",function A(b){if(b.source===e.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",A,!1);e.parentNode.removeChild(e)}},!1);return d}function n(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var p={},y=null;p.createDelegatedUI=x;n.prototype={generateSimpleEditorCommands:function(a,b){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,b));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(a){var b=this,d=new f.Command({imageClass:"core-sprite-wrench",tooltip:g.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return a.installed},callback:function(e){var f=d.settingsDropDown;if(!f||
f.isDestroyed())f=d.settingsDropDown=new c(e.domNode.parentNode,e.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){f.focus()},onHide:function(){a.focus()}}),f.updateContent=b.localSettings.show.bind(b.localSettings),e=f.getContentNode(),e.tabIndex=e.style.marginTop=0;f.click()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new h.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){this.commandService.addCommand(new f.Command({name:g.Undo,
id:"orion.undo",visibleWhen:function(){return a.installed},callback:function(){a.getUndoStack().undo()}}));this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new h.KeyBinding("z",!0));this.commandService.addCommand(new f.Command({name:g.Redo,id:"orion.redo",visibleWhen:function(){return a.installed},callback:function(){a.getUndoStack().redo()}}));this.commandService.registerCommandContribution(this.editToolbarId||
this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,w.isMac?new h.KeyBinding("z",!0,!0):new h.KeyBinding("y",!0))},_generateSearchFilesCommand:function(a){var b=this;if(b._searcher){var c=!1;this.commandService.addCommand(new f.Command({name:g.searchFiles,tooltip:g.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return a.installed},callback:function(){if(!c){var d=a.getSelection(),d=a.getText(d.start,d.end),f=b.serviceRegistry.getService("orion.page.progress"),
h=new e.OpenResourceDialog({searcher:b._searcher,progress:f,searchRenderer:b._searcher.defaultRenderer,nameSearch:!1,title:g.searchFiles,message:g.searchTerm,initialText:d,onHide:function(){c=!1;a.focus()}});window.setTimeout(function(){c=!0;h.show(j.node(b.toolbarId))},0)}}}));this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new h.KeyBinding("h",!0))}},_generateSaveCommand:function(a,
b){var c=this,d=b?b:"orion.save",e=new f.Command({name:g.Save,tooltip:g.saveFile,id:d,visibleWhen:function(){return!a.installed||c.inputManager.getReadOnly()?!1:!0},callback:function(){c.inputManager.save();return!0}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,d,1,this.saveToolbarId?"orion.menuBarFileGroup/orion.saveGroup":null,!1,new h.KeyBinding("s",!0));a.getTextView&&a.getTextView()&&(a.getTextView().setKeyBinding(new h.KeyBinding("s",
!0),"save"),a.getTextView().setAction("save",e.callback,e))},_generateGotoLineCommnand:function(a){var b=this,c=new d.ParametersDescription([new d.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new d.CommandParameter("line","number","Line:",b.toString())]}),c=new f.Command({name:g.gotoLine,tooltip:g.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return a.installed},parameters:c,callback:function(b){var c=
a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(g.gotoLinePrompt,b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new h.KeyBinding("l",!w.isMac,!1,!1,w.isMac),new d.URLBinding("gotoLine",
"line"));a.getTextView&&a.getTextView()&&a.getTextView().setAction("gotoLine",function(c){if(c)return a.onGotoLine(c.line-1,0,void 0,c.callback),!0;b.commandService.runCommand("orion.gotoLine");return!0},c)},_generateFindCommnand:function(a){var b=this,c=new d.ParametersDescription([new d.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var c=a.getSelection(),e="";c.end>c.start&&(e=a.getModel().getText(c.start,c.end),b._localSearcher&&b._localSearcher.getOptions().regex&&(e=
u.escape(e)));return[new d.CommandParameter("find","text","Find:",e)]}),c=new f.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",visibleWhen:function(){return a.installed},parameters:c,callback:function(c){if(b._localSearcher){var d="",e=null,f=a.getSelection();f.end>f.start&&c.parameters.valueFor("useEditorSelection")?(d=a.getModel().getText(f.start,f.end),b._localSearcher.getOptions().regex&&(d=u.escape(d))):c.parameters&&c.parameters.valueFor("find")&&(d=c.parameters.valueFor("find"),
e=o.matchResourceParameters(),m.convertFindURLBinding(e));if(e){b._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive});c={};if(e.atLine)c.start=a.getModel().getLineStart(e.atLine-1);b._localSearcher.show({findString:d,replaceString:e.replaceWith});b._localSearcher.find(!0,c)}else b._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,
this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new h.KeyBinding("f",!0),new d.URLBinding("find","find"));a.getTextView&&a.getTextView()&&a.getTextView().setAction("find",function(a){if(a)return b._localSearcher.show(a),!0;b.commandService.runCommand("orion.editor.find",null,null,new d.ParametersDescription([new d.CommandParameter("useEditorSelection","text","","true")],{clientCollect:!0}));return!0},c)},_generateBlame:function(a){var b=this;this.commandService.addCommand(new f.Command({name:g.Blame,
tooltip:g.BlameTooltip,id:"orion.edit.blame",parameters:new d.ParametersDescription([new d.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.installed?!1:v.isVisible(b.serviceRegistry,b.inputManager)},callback:function(c){for(var d=!1,e=a.getAnnotationModel().getAnnotations();e.hasNext();)if(e.next().type===r.AnnotationType.ANNOTATION_BLAME){d=!0;break}d=!d;c.parameters&&c.parameters.valueFor("blame")&&(d=c.parameters.valueFor("blame")==="true");d?v.getBlame(b.serviceRegistry,
b.inputManager):a.showBlame([])}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new h.KeyBinding("b",!0,!0),new d.URLBinding("blame","blame"))},_generateEditCommands:function(b){function c(a){if(!a)return null;var b=new h.KeyBinding;h.KeyBinding.apply(b,a);return b}function d(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=e.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}
var e=this,m=this.toolbarId,n=this.serviceRegistry,o=n.getServiceReferences("orion.edit.command"),p=this.inputManager,u=n.getService("orion.page.progress"),v=function(a,c,h){var i=h.visibleWhen;h.visibleWhen=function(a){return!b.installed||e.inputManager.getReadOnly()?!1:!i||i(a)};h.callback=function(){b=this;var e=b.getSelection?b.getSelection():{start:0,end:0},f=b.getModel(),h=function(a){typeof a==="object"&&a?(a.text&&b.setText(a.text),a.selection&&(b.setSelection&&b.setSelection(a.selection.start,
a.selection.end,!0),b.focus())):typeof a==="string"&&(b.setText(a,e.start,e.end,!0),b.setSelection&&b.setSelection(e.start,e.start+a.length),b.focus())},i;c.execute?(f={contentType:p.getContentType(),input:p.getInput()},i=t.getEditorContext(n),i.openDelegatedUI=x,i.setStatus=d,f=c.execute(i,f),i=null):(f=c.run(f.getText(e.start,e.end),f.getText(),e,p.getInput()),i=function(b){if(b&&b.uriTemplate){var c={};c.uriTemplate=b.uriTemplate;c.params=p.getFileMetadata();c.id=a.id;c.width=b.width;c.height=
b.height;c.done=h;c.status=d;x(c)}else b&&(b.Status||b.status)?d(b.Status||b.status):h(b)});u.showWhile(f,k.formatMessage(g.running,a.name)).then(i);return!0};h.callback=h.callback.bind(b);return new f.Command(h)};i.when(function(a){if(y)return y;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new l.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return y=a})}(this.serviceRegistry),function(){var d=[],f=100;o.forEach(function(h){var g=
h.getProperty("editor");if(!g||!(b.id&&g!==b.id)){for(var i=e.serviceRegistry.getService(h),j={},g=h.getPropertyKeys(),k=0;k<g.length;k++)j[g[k]]=h.getProperty(g[k]);j.forceSingleItem=!0;h=a._createCommandOptions(j,h,e.serviceRegistry,y,!1,function(){return p.getFileMetadata()});d.push(h);h.then(function(a){a=v(j,i,a);e.commandService.addCommand(a);e.commandService.registerCommandContribution(e.toolbarId,a.id,f,"orion.menuBarToolsGroup",!1,c(j.key))});f++}});i.all(d,function(a){return{_error:a}}).then(function(){var a;
if(a=p.getFileMetadata()){var c=j.node(m);c&&(e.commandService.destroy(c),e.commandService.renderCommands(c.id,c,a,b,"button"));if(c=j.node("pageNavigationActions"))e.commandService.destroy(c),e.commandService.renderCommands(c.id,c,b,b,"button")}})})}};p.EditorCommandFactory=n;return p});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(g,k,j,e,c,i){function b(b){this._document=b.document||document;this._timeout=b.timeout;for(var b="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),a=function(){this._resetTimer()}.bind(this),c=0;c<b.length;c++)this._document.addEventListener(b[c],a,!0);e.attach(this)}function f(b,a){if(b){if(!a.Severity){var c=a,e={Severity:"Error",
Message:g.noResponse};if(c.status!==0)if(c.responseText){c=c.responseText;try{var f=JSON.parse(c);e.Severity=f.Severity||e.Severity;e.Message=f.Message||e.Message}catch(h){e.Message=c}}else try{e.Message=JSON.stringify(c)}catch(i){}a=e}b.setProgressResult(a)}else window.console.log(a)}function h(b){e.attach(this);this.serviceRegistry=b.serviceRegistry;this.statusService=b.statusService;this.fileClient=b.fileClient;this.progressService=b.progressService;this.contentTypeRegistry=b.contentTypeRegistry;
this.selection=b.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}b.prototype={_resetTimer:function(){var b=this._document.defaultView||this._document.parentWindow;if(this._timer)b.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=b.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},onIdle:function(b){return this.dispatchEvent(b)},setTimeout:function(b){this._timeout=b;this._resetTimer()}};
c.mixin(h.prototype,{_maybeLoadWorkspace:function(b){var a=this.fileClient;return b===a.fileServiceRootURL(b)?a.loadWorkspace(b).then(function(a){return a.Location}):(new j).resolve(b)},_read:function(b){if(this.cachedMetadata&&this.cachedMetadata.Location===b)return(new j).resolve(this.cachedMetadata);var a=this.fileClient,c=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(b).then(function(b){return a.read.apply(a,[b].concat(c))})},load:function(){var b=this.getInput();if(b){var a=
this.fileClient,c=this._parsedLocation.resource,e=this.progressService,h=function(a,b,c){return!e?a:e.progress(a,k.formatMessage(b,c))},i=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&h(a.read(c,!0),g.ReadingMetadata,b).then(function(e){if(this._fileMetadata&&this._fileMetadata.Location===e.Location&&this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!i.isDirty()||window.confirm(g.loadOutOfSync))&&h(a.read(c),g.Reading,b).then(function(a){i.setInput(b,
null,a);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var r=c;if(r.indexOf("/gitapi/commit/")===0){var v=r.indexOf("/file"),u=r.indexOf("?",v);if(u===-1)u=r.length;r=r.substring(v,u);this._readonly=!0}var w=window.setTimeout(function(){w=null;this.reportStatus(k.formatMessage(g.Fetching,b))}.bind(this),800),t=function(){this.reportStatus("");w&&window.clearTimeout(w)}.bind(this),x=function(a){t();var b=null;if(this.serviceRegistry)b=this.serviceRegistry.getService("orion.page.message");else if(this.statusService)b=
this.statusService;f(b,a);this._setNoInput()}.bind(this);this._acceptPatch=null;h(this._read(r,!0),g.ReadingMetadata,r).then(function(e){e?e.Directory?j.when(e.Children||h(a.fetchChildren(e.ChildrenLocation),g.Reading,b),function(a){t();e.Children=a;this._setInputContents(this._parsedLocation,b,a,e)}.bind(this),x):this._isText(e)?h(a.read(c,!1,!0),g.Reading,b).then(function(a){t();if(typeof a!=="string")this._acceptPatch=a.acceptPatch,a=a.result;this._setInputContents(this._parsedLocation,b,a,e)}.bind(this),
x):h(a._getService(c).readBlob(c),g.Reading,b).then(function(a){t();this._setInputContents(this._parsedLocation,b,a,e)}.bind(this),x):x({responseText:k.formatMessage(g.ReadingMetadataError,r)})}.bind(this),x)}}},processParameters:function(b){var a=this.getEditor();a&&a.processParameters&&a.processParameters(b)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var b=this._fileMetadata;return this._readonly||!b||b.Attributes&&b.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(b){if(this._getSaveDiffsEnabled()){var a=this._unsavedChanges.length,c=b.removedCharCount,e=b.start,f=b.start+c,h=0;
b.addedCharCount===0?h=-1:c===0&&(h=1);if(a>0&&h===this.previousChangeType){a=this._unsavedChanges[a-1];if(c===0&&e===a.end+a.text.length){a.text+=b.text;return}if(b.addedCharCount===0&&f===a.start){a.start=e;return}}this.previousChangeType=h;this._unsavedChanges.push({start:e,end:f,text:b.text})}},reportStatus:function(b){this.statusReporter?this.statusReporter(b):this.editor&&this.editor.reportStatus(b)},save:function(){function b(a){if(h===p.getInput())p.getFileMetadata().ETag=a.ETag,c.setInput(h,
null,i,!0);p.reportStatus("");e&&n&&n.setProgressResult({Message:g.Saved,Severity:"Normal"});p.afterSave&&p.afterSave();p._saving=!1}function a(a){p.reportStatus("");f(n,a);p._saving=!1;p._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c&&c.isDirty()&&!this.getReadOnly()){var e=this._errorSaving;this._saving=!0;var h=this.getInput();this.reportStatus(g["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});c.markClean();var i=c.getText(),j=i;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var v=this._unsavedChanges,u=0,w=0;w<v.length;w++)u+=v[w].text.length;i.length>u&&(j={diff:v})}this._unsavedChanges=[];this._errorSaving=!1;var v={ETag:this.getFileMetadata().ETag},t=this._parsedLocation.resource,j=this.fileClient.write(t,j,v),x=this.progressService,n=null;this.serviceRegistry&&(n=this.serviceRegistry.getService("orion.page.message"));x&&(j=x.progress(j,k.formatMessage(g.savingFile,h)));var p=this;j.then(b,function(c){c.status===412?window.confirm(g.saveOutOfSync)?
(c=p.fileClient.write(t,i),x&&(c=x.progress(c,k.formatMessage(g.savingFile,h))),c.then(b,a)):p._saving=!1:a(c)})}}},setAutoLoadEnabled:function(b){this._autoLoadEnabled=b},setAutoSaveTimeout:function(c){this._autoSaveEnabled=c!==-1;this._idle?this._idle.setTimeout(c):(this._idle=new b({document:document,timeout:c}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(b){this._contentType=b},setInput:function(b){if(!this._ignoreInput&&
(b||(b=i.hash()),typeof b==="string")){var a=this.getEditor();b&&b[0]!=="#"&&(b="#"+b);var c=i.matchResourceParameters(b),e=this._parsedLocation||{};if(a&&a.isDirty()){var f=this._location;if(e.resource!==c.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(g.confirmUnsavedChanges)){window.location.hash=f;return}}a=a&&e.editor!==c.editor;this._location=b;this._parsedLocation=c;this._ignoreInput=!0;this.selection&&this.selection.setSelections(b);this._ignoreInput=!1;(b=c.resource)?
b===this._input?a?(this.reportStatus(""),this._setInputContents(c,b,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(c):(this._input=b,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(b){var a=b.lastIndexOf("/");a!==-1&&(b=b.substring(a+1));this._title=b},setSaveDiffsEnabled:function(b){this._saveDiffsEnabled=b},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch!==null&&this._acceptPatch.indexOf("application/json-patch")!==
-1},_isText:function(b){b=this.contentTypeRegistry.getFileContentType(b);if(!b)return!0;var a=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(b,a)},_setNoInput:function(b){b?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),this.dispatchEvent({type:"InputChanged",input:null}))},
_setInputContents:function(b,a,c,e,f){var h,g=!1;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this.setContentType(this.contentTypeRegistry.getFileContentType(e)),h=e.Name,g=e.Directory):(this._fileMetadata=null,this.setTitle(a),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),h=this.getTitle());var i=this.getEditor();if(this._focusListener)i&&i.getTextView&&i.getTextView()&&i.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=
null;if(this._changingListener)i&&i.getModel&&i.getModel()&&i.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null;e={type:"InputChanged",input:b,name:h,title:a,contentType:this.getContentType(),metadata:e,location:window.location,contents:c};this.dispatchEvent(e);this.editor=i=e.editor;if(!g){if(i&&i.getModel&&i.getModel())i.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this));f||i.setInput(a,null,c);if(i&&i.getTextView&&
i.getTextView())i.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this));this._unsavedChanges=[];this.processParameters(b)}}});return{handleError:f,InputManager:h}});
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(g,k,j,e,c,i,b,f,h,d,a,l,m,o,s,r,v){function u(a){this._syntaxHighlither=
new f.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new i.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return j.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 j).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 j).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.contentTypeRegistry").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}();u.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function f(a,c,d,e){this._registry=a;this._commandService=c;this._fileClient=new h.FileClient(a);this._fileClient=new h.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(d,!0);this._compareView=d.toggleable?new b.toggleableCompareView(d.type==="inline"?"inline":"twoWay",e):d.type==="inline"?new b.inlineCompareView(e):new b.TwoWayCompareView(e);this._compareView.getWidget().setOptions({extCmdHolder:this});
e.highlighters||this._compareView.getWidget().setOptions({highlighters:[new u(a),new u(a)]});e.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(d.readonlyRight)}});e.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(d.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(g["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(){a.manager.setDirty(b.isDirty())})}}.bind(this))}f.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?typeof a==="undefined"?!1:a:typeof a==="undefined"?!0:a},_getFileOptions:function(a){return a===1?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new r.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];if(!this.options.toggleable&&this._compareView.getWidget()._uiFactory&&this._compareView.getWidget().type==="twoWay"){if(!this._checkReadonly(this.options.readonlyRight))this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId());if(!this._checkReadonly(this.options.readonly,!0))this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))}var a=this;this._inputManagers.forEach(function(b){if(b.manager)this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(c,d,e,f){d=new m.TextSearcher(c,a._registry,a._commandService,e);e=(new v.KeyBindingsFactory).createKeyBindings(c,e,f,d);(new o.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:d})).generateSimpleEditorCommands(c,b.manager._editorIndex===1?"orion.compare.save.left":"orion.compare.save.right");return e}}.bind(this))},_initInputManager:function(a,b,c){var f=this;s.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:c,getInput:function(){return this.filePath},setDirty:function(a){var b=f._compareView.getWidget().getEditors(),c=a;b&&b.length===2&&(c=b[0].isDirty()||b[1].isDirty());d.setDirtyIndicator(c);
f._compareView.getWidget().refreshTitle&&f._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return f._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a){this._parsedLocation={resource:a};f._progress.progress(f._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=e.node(this._actionBarId);if(b){f._commandService.destroy(b);var c=this._editorIndex;
f._commandService.renderCommands(b.id,b,f._compareView.getWidget().getEditors()[c],f._compareView.getWidget().getEditors()[c],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a){a.charAt(0)==="*"?d.setDirtyIndicator(!0):d.setDirtyIndicator(!1)},afterSave:function(){var a=f._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();f._getFileOptions(this._editorIndex).Content=
a;f._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=c.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,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(g["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return c.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var b=this._compareView.getWidget().options.commandProvider;if(b&&b.getOptions().commandSpanId){var b=b.getOptions().commandSpanId,c=new a.Command({tooltip:g["Generate link of the current diff"],
name:g["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),d=new a.Command({tooltip:g["Open the compare page"],name:g.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(c);this._commandService.addCommand(d);this._commandService.registerCommandContribution(b,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(b,"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 j.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_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 b=a._isImage(b.newFile.Type),c=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)c.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)c.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new j).resolve(a+5)})):
a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var c=a._getFileOptions(b.manager._editorIndex),d=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=c.URL;b.manager.setInput(c.URL,d)}});return(new j).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return f}();return k});
define("orion/git/uiUtil",["orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib","orion/git/util"],function(g,k,j,e){e=Object.create(e);e.createCompareWidget=function(c,e,b,f,h,d,a,l,m){var o=new k.DefaultDiffProvider(c),d=new g.CompareCommandFactory({commandService:e,commandSpanId:d,gridRenderer:l});(new k.ResourceComparer(c,e,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:f,diffProvider:o,resource:b,compareTo:m,editableInComparePage:a},{parentDivId:h,commandProvider:d})).start().then(function(a){var b=
420;a<b&&(b=a);j.node(h).style.height=b+"px"})};return e});
define("orion/git/gitCommitExplorer","require,i18n!git/nls/gitmessages,orion/section,orion/explorers/explorer,orion/URITemplate,orion/PageUtil,orion/i18nUtil,orion/webui/littlelib,orion/globalCommands,orion/git/gitCommands,orion/git/uiUtil,orion/Deferred,orion/webui/tooltip".split(","),function(g,k,j,e,c,i,b,f,h,d,a,l,m){var l={},o=new c("git/git-repository.html#{,resource,params*}"),s=new c("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");l.GitCommitExplorer=function(){function c(a,b,
d,f,h,g,i,j){this.parentId=h;this.registry=a;this.commandService=b;this.linkService=d;this.selection=f;this.parentId=h;this.toolbarId=g;this.selectionToolsId=i;this.checkbox=!1;this.actionScopeId=j;e.createExplorerCommands(b)}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);a.status===404&&
(this.initTitleBar(),this.displayCommit())};c.prototype.changedItem=function(){this.redisplay()};c.prototype.redisplay=function(){this.display(i.matchResourceParameters().resource)};c.prototype.display=function(a){var b=this,c=this.registry.getService("orion.page.progress");c.showWhile(this.registry.getService("orion.git.provider").getGitClone(a),"Getting repository details").then(function(a){if(a.Children.length===0)b.initTitleBar(),b.displayCommit();else if(a.Children.length===1&&a.Children[0].Type===
"Commit"){var e=a.Children;c.progress(b.registry.getService("orion.git.provider").getGitClone(a.CloneLocation),"Getting repository details "+a.Name).then(function(a){a=a.Children;b.initTitleBar(e[0],a[0]);b.displayCommit(e[0]);b.displayTags(e[0]);b.displayDiffs(e[0]);e[0].CloneLocation=a[0].Location;d.updateNavTools(b.registry,b.commandService,b,"pageActions","selectionTools",e[0])},function(a){b.handleError(a)})}},function(a){b.handleError(a)})};c.prototype.initTitleBar=function(a,b){var c={};a.GitUrl=
b.GitUrl;a.ContentLocation=b.ContentLocation;if(a)c={},c.Name=a.Name,c.Parents=[],c.Parents[0]={},c.Parents[0].Name=b.Name,c.Parents[0].Location=b.Location,c.Parents[0].ChildrenLocation=b.Location,c.Parents[1]={},c.Parents[1].Name=k.Repositories;h.setPageTarget({task:"Commit",target:a,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href=g.toUrl(o.expand({resource:b||""}))},serviceRegistry:this.registry,commandService:this.commandService})};c.prototype.displayCommit=function(a){var c=f.node("table");
f.empty(c);if(a){var d=document.createElement("div");d.className="sectionTable";c.appendChild(d);c=document.createElement("div");c.className="mainPadding";c.id="commitNode";d.appendChild(c);d=document.createElement("div");d.className="sectionTableItem";c.appendChild(d);var c=this._splitCommitMessage(a.Message),e=document.createElement("div");e.style.paddingBottom="15px";this.registry.getService("orion.core.textlink").addLinks(c[0],e);d.appendChild(e);if(c[1]!==null)e=document.createElement("pre"),
e.style.paddingBottom="15px",e.style.marginTop="0px",this.registry.getService("orion.core.textlink").addLinks(c[1],e),d.appendChild(e);c=document.createElement("div");c.appendChild(document.createTextNode(b.formatMessage(k["commit: 0"],a.Name)));d.appendChild(c);if(a.Parents&&a.Parents.length>0)c=document.createElement("div"),c.style.paddingBottom="15px",e=document.createElement("a"),e.className="pnavlinkonpage",e.href=g.toUrl(s.expand({resource:a.Parents[0].Location})),e.textContent=b.formatMessage(k["parent: 0"],
a.Parents[0].Name),c.appendChild(e),d.appendChild(c);if(a.AuthorImage)c=document.createElement("div"),c.style["float"]="left",e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon-small",c.appendChild(e),d.appendChild(c);c=document.createElement("div");e=document.createElement("div");e.appendChild(document.createTextNode(b.formatMessage(k["authored by 0 (1) on 2"],a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString())));c.appendChild(e);e=document.createElement("div");
e.appendChild(document.createTextNode(b.formatMessage(k["committed by 0 (1)"],a.CommitterName,a.CommitterEmail)));c.appendChild(e);d.appendChild(c)}else new j.Section(c,{id:"commitSection",title:k["No Commits"],iconClass:"core-sprite-file"})};c.prototype._splitCommitMessage=function(a){var b=!1,c=a.split(/(\r?\n|$)/)[0].trim();c.length>100&&(b=c.indexOf(" ",90),c=c.substring(0,b!==-1?b:100),b=!0);a=a.substring(c.length+1,a.length).trim();a=a.length>0?b?"..."+a:a:null;c+=b?"...":"";return[c,a]};c.prototype.displayTags=
function(a){var b=a.Tags,c=f.node("table"),c=new j.Section(c,{id:"tagSection",title:b&&b.length>0?k["Tags:"]:k["No Tags"],iconClass:["gitImageSprite","git-sprite-tag"],slideout:!0,content:'<div id="tagNode"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(c.actionsNode.id,"eclipse.orion.git.addTag",100);this.commandService.renderCommands(c.actionsNode.id,c.actionsNode,a,this,"button");if(b||!(b.length>0))for(a=
0;a<b.length&&a<10;a++)this.renderTag(b[a])};c.prototype.renderTag=function(a){var b=f.node("tagNode"),c=document.createElement("div");c.className="sectionTableItem";b.appendChild(c);b=document.createElement("div");b.className="sectionTableItem";c.appendChild(b);c=document.createElement("div");c.className="stretch";b.appendChild(c);var d=document.createElement("span");d.textContent=a.Name;c.appendChild(d);c=document.createElement("div");c.className="sectionTableItemActions";b.appendChild(c);this.commandService.renderCommands(this.actionScopeId,
c,a,this,"tool",!1)};c.prototype.displayDiffs=function(b){var c=this,d=b.Diffs,b=f.node("table"),b=new j.Section(b,{id:"diffSection",title:k.Diffs,content:'<div id="diffNode"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(b.actionsNode.id,"orion.explorer.expandAll",100);this.commandService.registerCommandContribution(b.actionsNode.id,"orion.explorer.collapseAll",200);var h="diffSectionItemActionArea",g=function(){function a(){}
a.prototype={destroy:function(){},getRoot:function(a){a(d)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(a.Type==="Diff"){if(!a.children)a.children=[],a.children.push({parent:a,DiffLocation:a.DiffLocation});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"diffRoot":a.Type==="Diff"?"diff"+a.DiffLocation:"diffWidget"+a.DiffLocation}};return a}(),i=function(){function b(a,c){this._init(a);this.options=a;this.explorer=c;this.registry=a.registry}
b.prototype=new e.SelectionRenderer;b.prototype.getCellElement=function(b,d,e){switch(b){case 0:if(d.Type==="Diff"){var b=document.createElement("td"),f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);var h=d.OldPath,g="git-sprite-file",i=k.Diffs;if(d.ChangeType==="ADD")h=d.NewPath,g="git-sprite-addition",i=k.Addition;else if(d.ChangeType==="DELETE")g="git-sprite-removal",i=k.Deletion;this.getExpandImage(e,f);e=document.createElement("span");e.className=g;e.classList.add("gitImageSprite");
e.commandTooltip=new m.Tooltip({node:e,text:i,position:["above","below","right","left"]});f.appendChild(e);e=document.createElement("span");e.className="gitMainDescription";e.textContent=h;f.appendChild(e)}else{b=document.createElement("td");b.colSpan=2;f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);e=document.createElement("div");e.className="sectionExplorerActions";f.appendChild(e);var j=document.createElement("span");j.id="diff"+d.parent.DiffLocation+"DiffActionWrapper";
e.appendChild(j);h=document.createElement("span");h.id="diff"+d.parent.DiffLocation+"CompareWidgetActionWrapper";e.appendChild(h);e=document.createElement("div");e.id="diffArea_"+d.parent.DiffLocation;e.style.height="420px";e.style.border="1px solid lightgray";e.style.overflow="hidden";f.appendChild(e);f=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,!0):null;a.createCompareWidget(c.registry,c.commandService,d.parent.DiffLocation,!1,e,h.id,!1,{navGridHolder:f,additionalCmdRender:function(a){c.commandService.destroy(j.id);
c.commandService.renderCommands("itemLevelCommands",j.id,d.parent,c,"tool",!1,a)},before:!0})}return b}};return b}(),l=new (function(){function a(b,c,d,e){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.renderer=new i({registry:this.registry,actionScopeId:h,cachePrefix:"DiffNavigator",checkbox:!1},this);this.createTree(this.parentId,new g,{})}a.prototype=new e.Explorer;a.prototype.isRowSelectable=function(){return!1};a.prototype.getItemCount=function(){return d.length};
return a}())(this.registry,null,"diffNode",h);this.commandService.renderCommands(b.actionsNode.id,b.actionsNode.id,l,l,"button")};return c}();return l});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(g,k){function j(){}function e(){this.styles=[];var c=new j;c.name="Eclipse";c.annotationRuler="white";c.background="white";c.comment="green";c.keyword="#7f0055";c.text="darkSlateGray";c.string="blue";c.overviewRuler="white";c.lineNumberOdd="#444";c.lineNumberEven="#444";c.lineNumber="#444";c.currentLine="#EAF2FE";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=
b;this.styles.push(c);c=new j;c.name="Prospecto";c.annotationRuler="white";c.background="white";c.comment="#3C802C";c.keyword="#CC4C07";c.text="#333";c.string="#446FBD";c.overviewRuler="white";c.lineNumberOdd="silver";c.lineNumberEven="silver";c.lineNumber="silver";c.currentLine="#EAF2FE";c.tag="#CC4C07";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Blue";c.annotationRuler="lavender";c.background="aliceBlue";c.comment="indigo";c.keyword="cornFlowerBlue";c.text=
"navy";c.string="cornFlowerBlue";c.overviewRuler="lavender";c.lineNumberOdd="darkSlateGray";c.lineNumberEven="darkSlateGray";c.lineNumber="darkSlateGray";c.currentLine="white";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Ambience";c.annotationRuler="#3D3D3D";c.background="#202020";c.comment="mediumslateblue";c.keyword="cornFlowerBlue";c.text="darkseagreen";c.string="lightcoral";c.overviewRuler="white";c.lineNumberOdd="black";c.lineNumberEven=
"black";c.lineNumber="black";c.currentLine="lightcyan";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Tierra";c.annotationRuler="moccasin";c.background="lemonchiffon";c.comment="darkseagreen";c.keyword="darkred";c.text="#555555";c.string="orangered";c.overviewRuler="moccasin";c.lineNumberOdd="chocolate";c.lineNumberEven="chocolate";c.lineNumber="chocolate";c.currentLine="#baa289";c.tag="darkred";c.attribute="cadetBlue";c.fontFamily=i;
c.fontSize=b;this.styles.push(c);c=new j;c.name="Nimbus";c.annotationRuler="#444";c.background="dimgray";c.comment="darkseagreen";c.keyword="darkorange";c.text="white";c.string="cornflowerblue";c.overviewRuler="#444";c.lineNumberOdd="#aaa";c.lineNumberEven="#aaa";c.lineNumber="#aaa";c.currentLine="#aabfbb";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Adelante";c.annotationRuler="#E2D2B2";c.background="#F1E7C8";c.comment="#5D774E";c.keyword=
"#AF473B";c.text="dimgray";c.string="#DE5D3B";c.overviewRuler="#E2D2B2";c.lineNumberOdd="#AF473B";c.lineNumberEven="#AF473B";c.lineNumber="#AF473B";c.currentLine="#9e937b";c.tag="#AF473B";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Raspberry Pi";c.annotationRuler="seashell";c.background="seashell";c.comment="#66B32F";c.keyword="#E73E36";c.text="dimgray";c.string="darkorange";c.overviewRuler="seashell";c.lineNumberOdd="#E73E36";c.lineNumberEven="#E73E36";
c.lineNumber="#E73E36";c.currentLine="#F5B1AE";c.tag="#E73E36";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c)}function c(){return this.styles}var i='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";e.prototype.styles=[];e.prototype.getStyles=c;e.prototype.fontSettable=!0;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",version:"5.0"}};e.prototype.parseToXML=function(b){try{var c=
null;if(window.DOMParser){var c=(new DOMParser).parseFromString(b,"text/xml"),d=c.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?c:null}else return c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(b),c}catch(a){}};e.prototype.selectFontSize=function(b){console.log("fontsize: "+b)};e.prototype.importTheme=function(b){console.log("import theme");console.log(b);var c=this.parseToXML(b.parameters.valueFor("name")),d=new j;d.name=c.getElementsByTagName("colorTheme")[0].attributes[1].value;
d.annotationRuler=c.getElementsByTagName("background")[0].attributes[0].value;d.background=c.getElementsByTagName("background")[0].attributes[0].value;d.comment=c.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=c.getElementsByTagName("keyword")[0].attributes[0].value;d.text=c.getElementsByTagName("foreground")[0].attributes[0].value;d.string=c.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=c.getElementsByTagName("background")[0].attributes[0].value;
d.lineNumberOdd=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=c.getElementsByTagName("selectionBackground")[0].attributes[0].value;b.items.addTheme(d)};e.prototype.processSettings=function(b){var c=k.TextTheme.getTheme();c.setThemeClass("editorTheme",c.buildStyleSheet("editorTheme",b))};e.prototype.getViewData=function(){var b=
{top:10,left:10,width:400,height:350},c=b.left,d=b.top;b.shapes=[{type:"TEXT",name:g["Line Numbers"],label:"1",x:c+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:g.Background,x:c+46,y:d,width:290,height:b.height,family:"background",fill:"white"},{type:"TEXT",name:g.Strings,label:"'text/javascript'",x:c+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:c+124,y:d+20,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Current Line"],x:c+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:c+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Overview Ruler"],x:c+336,y:d,width:14,height:b.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:g.Comments,label:"/* comment */",x:c+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
name:g["HTML Tag"],label:"<script",x:c+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:c+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,label:"'Result'",x:c+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"multiply(a,b){",x:c+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"function",
x:c+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:c+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output = ",x:c+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:";",x:c+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:c+95,y:d+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"result = a*b;",x:c+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"return",x:c+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output + result;",x:c+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"}",x:c+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:g["HTML Tag"],label:"<\/script>",x:c+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"<style",x:c+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:c+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:c+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,
label:"'text/css'",x:c+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:c+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:".some-class",x:c+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"{",x:c+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Attribute"],label:"color:",
x:c+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Value"],label:"#123456",x:c+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Text"],label:";",x:c+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"}",x:c+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"</style>",x:c+55,y:d+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Annotation Ruler"],x:c,y:d,width:46,height:b.height,family:"annotationRuler",fill:"white"}];for(var a=0;a<16;a++)b.shapes.push({type:"TEXT",name:g["Line Numbers"],label:a+1,x:c+20,y:d+20*a+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return b};return{ThemeData:e,getStyles:c}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(g,k){function j(c,e,b,f){g("GET",c,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(h){h=h.response?JSON.parse(h.response):null;e.progress(h);!h.type||h.type==="loadstart"||h.type==="progress"?setTimeout(function(){j(c,e,b,f)},2E3):(h.type==="error"||h.type==="abort"?e.reject(f?f(h):h.Result):e.resolve(b?b(h):h.Result.JsonData),h.Location||g("DELETE",c,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(b){var c=b;if(b.responseText!==
void 0){c=b.responseText;try{c=JSON.parse(b.responseText)}catch(a){}}c.Message!==void 0?(c.HttpCode=c.HttpCode===void 0?b.status:c.HttpCode,c.Severity=c.Severity===void 0?"Error":c.Severity,e.reject(c)):e.reject({Severity:"Error",Message:c,HttpCode:b.status})})}function e(c,e){e.then(null,function(b){b instanceof Error&&b.name==="Cancel"&&g("PUT",c,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(c,g,b){var f=new k;e(c,f);j(c,f,g,b);return f}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(g,k,j,e){var c=c||{};c.GitService=function(){function c(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this)}c.prototype={checkGitService:function(){},cloneGitRepository:function(b,c,e,d,a,i,m,o,s,r,v){var u=this,w={};if(b)w.Name=b;if(e)w.Path=e;if(c)w.GitUrl=c;w.Location=d;if(a)w.GitSshUsername=a;if(i)w.GitSshPassword=i;if(m)w.GitSshKnownHost=m;if(o)w.GitSshPrivateKey=
o;if(s)w.GitSshPassphrase=s;if(r){if(r.GitMail)w.GitMail=r.GitMail;if(r.GitName)w.GitName=r.GitName}if(v)w.initProject=v;var b=g.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),t=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(w)}).then(function(a){u._getGitServiceResponse(t,a)},function(a){u._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(b){var c=this,e=new j;k("DELETE",
b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitStatus:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},stage:function(b){var c=
this,e=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},stageMultipleFiles:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,
a)});return d},unstageAll:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},unstage:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(a){e._getGitServiceResponse(d,
a)},function(a){e._handleGitServiceResponseError(d,a)});return d},checkoutPath:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c,RemoveUntracked:"true"})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},commitAll:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:e}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},getGitClone:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitCloneConfig:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1",
"Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitBranch:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitRemote:function(b){var c=this,
e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},checkoutBranch:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,
a)});return d},resetIndex:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:c,Reset:"HARD"})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},addBranch:function(b,c,e){var d=this,a={};if(c)a.Name=c;if(e)a.Branch=e;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){d._getGitServiceResponse(g,a)},function(a){d._handleGitServiceResponseError(g,a)});return g},removeBranch:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},addRemote:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:c,RemoteURI:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},removeRemote:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});
return e},doGitLog:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getDiff:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(a){e._getGitServiceResponse(d,
a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doFetch:function(b,c,e,d,a,g,i){var o=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:c,GitSshUsername:e,GitSshPassword:d,GitSshKnownHost:a,GitSshPrivateKey:g,GitSshPassphrase:i})}).then(function(a){o._getGitServiceResponse(s,a)},function(a){o._handleGitServiceResponseError(s,a)});return s},doPull:function(b,
c,e,d,a,g,i){var o=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:c,GitSshUsername:e,GitSshPassword:d,GitSshKnownHost:a,GitSshPrivateKey:g,GitSshPassphrase:i})}).then(function(a){o._getGitServiceResponse(s,a)},function(a){o._handleGitServiceResponseError(s,a)});return s},doMerge:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:c,Squash:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},doCherryPick:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doRevert:function(b,
c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doRebase:function(b,c,e){var d=this,a={};a.Rebase=c;if(e)a.Operation=e;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){d._getGitServiceResponse(g,
a)},function(a){d._handleGitServiceResponseError(g,a)});return g},doPush:function(b,c,e,d,a,g,i,o,s){var r=this,v=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:c,PushTags:e,Force:d,GitSshUsername:a,GitSshPassword:g,GitSshKnownHost:i,GitSshPrivateKey:o,GitSshPassphrase:s})}).then(function(a){r._getGitServiceResponse(v,a)},function(a){r._handleGitServiceResponseError(v,a)});return v},getLog:function(b,
c){var e=this,d=new j,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(b){a.resolve(b.xhr.getResponseHeader("Location"))},function(a){e._handleGitServiceResponseError(d,a)});a.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,
a)})});return d},getDefaultRemoteBranch:function(b){var c=this,e=new j,d=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(e,a)});d.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"application/json; 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,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doRemoveTag:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},checkoutTag:function(b,c,e){var d=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:c,Branch:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},addCloneConfigurationProperty:function(b,c,e){var d=
this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:c,Value:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},editCloneConfigurationProperty:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:c})}).then(function(a){e._getGitServiceResponse(d,
a)},function(a){e._handleGitServiceResponseError(d,a)});return d},deleteCloneConfigurationProperty:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},sendCommitReviewRequest:function(b,c,e,d,a,g){var i=this,o=new j;k("POST",c,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:d,ReviewReqNotifyLogin:e,ReviewReqAuthorName:a,ReviewMessage:g})}).then(function(a){i._getGitServiceResponse(o,a)},function(a){i._handleGitServiceResponseError(o,a)});return o},_getGitServiceResponse:function(b,c){var g=c.response?JSON.parse(c.response):null;if(c.xhr&&c.xhr.status===202){var d=e.handle(g.Location);d.then(b.resolve,function(a){a.failedOperation=g.Location;b.reject(a)},b.progress);b.then(null,function(a){d.reject(a)})}else b.resolve(g)},
_handleGitServiceResponseError:function(b,c){b.reject(c)}};return c}();return c});
define("orion/links",[],function(){function g(g){this._init(g)}g.prototype={_init:function(g){this._registry=g.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(g,j,e,c,i){var b=g.search(e);b>0&&(j.appendChild(document.createTextNode(g.substring(0,b))),g=g.substring(b));var e=g.replace(e,""),b=g.substring(0,g.length-e.length),f=b.split(" ",c);if(f.length===c){for(var g=document.createElement("a"),h=0;h<c;h++)i=i.replace("%"+
(h+1),f[h]);g.setAttribute("href",i);g.textContent=b;j.appendChild(g);g=e}return g},addLinks:function(g,j){var e=j||document.createElement("div"),c=this._registry.getServiceReferences("orion.core.linkScanner");if(c.length>0)for(var i=c[0],c=RegExp(i.getProperty("pattern"),"i"),b=i.getProperty("words"),i=i.getProperty("anchor"),f=g.search(c);f>=0;)g=this._replaceLink(g,e,c,b,i),f=g.search(c);g.length>0&&e.appendChild(document.createTextNode(g));return e}};g.prototype.constructor=g;return{TextLinkService:g}});
var eclipse;
define('built-git-commit.js',"i18n!git/nls/gitmessages,require,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/commands,orion/keyBinding,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitCommitExplorer,orion/git/gitCommands,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/git/gitClient,orion/links,orion/contentTypes,orion/URITemplate,orion/PageUtil".split(","),function(g,k,
j,e,c,i,b,f,h,d,a,l,m,o,s,r,v,u,w,t,x,n,p){j.startup().then(function(j){var q=j.serviceRegistry,j=j.preferences;new h.DialogService(q);var z=new d.Selection(q),z=new i.CommandRegistry({selection:z}),C=new l.OperationsClient(q);new e.StatusReportingService(q,C,"statusPane","notifications","notificationArea");new c.ProgressService(q,C,z);(new v.ThemePreferences(j,new u.ThemeData)).apply();C=new t.TextLinkService({serviceRegistry:q});new w.GitService(q);var H=new a.FileClient(q);new x.ContentTypeRegistry(q);
var I=new m.Searcher({serviceRegistry:q,commandService:z,fileService:H}),A=new s.GitCommitExplorer(q,z,C,null,"artifacts","pageActions",null,"itemLevelCommands");o.generateBanner("orion-git-commit",q,z,j,I,A);r.createFileCommands(q,z,A,"pageActions","selectionTools");r.createGitClonesCommands(q,z,A,"pageActions","selectionTools",H);z.addCommandGroup("pageActions","eclipse.gitGroup",100);z.registerCommandContribution("pageActions","eclipse.orion.git.cherryPick",100,"eclipse.gitGroup");z.registerCommandContribution("pageActions",
"eclipse.orion.git.revert",101,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.askForReviewCommand",102,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.openCommitCommand",102,"eclipse.gitGroup",!0,new f.KeyBinding("h",!0,!0));z.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);var E=new n("edit/edit.html#{,resource,params*}"),q=new b.Command({name:g["Working Directory Version"],tooltip:g["View the working directory version of the file"],
id:"eclipse.orion.git.diff.showCurrent",hrefCallback:function(a){return k.toUrl(E.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return a.Type==="Diff"}});z.addCommand(q);z.registerCommandContribution("itemLevelCommands","eclipse.orion.git.diff.showCurrent",2E3);q=p.matchResourceParameters();A.display(q.resource);window.addEventListener("hashchange",function(){var a=p.matchResourceParameters();A.display(a.resource)},!1)})});