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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
 Alex Lakatos - fix for bug#369781

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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) 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
 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
*/
(function(){function j(b,d,a,e,h,g){d[b]&&(a.push(b),(d[b]===!0||d[b]===1)&&e.push(h+b+"/"+g))}function k(b,d,a,e,h){d=e+d+"/"+h;require._fileExists(b.toUrl(d+".js"))&&a.push(d)}function i(b,d,a){for(var e in d)d.hasOwnProperty(e)&&(!b.hasOwnProperty(e)||a)?b[e]=d[e]:typeof d[e]==="object"&&i(b[e],d[e],a)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var f=b.config?b.config():{};return{version:"2.0.1+",load:function(a,e,b,g){g=g||{};if(g.locale)f.locale=g.locale;
var c=d.exec(a),l=c[1],m=c[4],n=c[5],p=m.split("-"),t=[],r={},s,v="";if(c[5])l=c[1],a=l+n;else{n=c[4];m=f.locale;if(!m)m=f.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();p=m.split("-")}if(g.isBuild){t.push(a);k(e,"root",t,l,n);for(s=0;s<p.length;s++)g=p[s],v+=(v?"-":"")+g,k(e,v,t,l,n);e(t,function(){b()})}else e([a],function(c){var a=[],q;j("root",c,a,t,l,n);for(s=0;s<p.length;s++)q=p[s],v+=(v?"-":"")+q,j(v,c,a,t,l,n);e(t,function(){var o,
q,g;for(o=a.length-1;o>-1&&a[o];o--){g=a[o];q=c[g];if(q===!0||q===1)q=e(l+g+"/"+n);i(r,q)}b(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,k,i,d){var d=d||{},b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,f=b.exec(j);if(f){if(!k.defined||k.defined(j))try{i(k(j));return}catch(a){}if(d.isBuild||d.isTest)i({});else{var e=f[1],h=f[3]?f[2]:"",g=f[3]||f[2];k(["orion/bootstrap"],function(c){c.startup().then(function(c){var a=c.serviceRegistry,c=a.getServiceReferences("orion.i18n.message");if(h)c.some(function(c){return j===c.getProperty("name")?(a.getService(c).getMessageBundle().then(function(c){i(c)},
function(){i({})}),!0):!1})||i({});else{var n={},p;c.forEach(function(c){var a=c.getProperty("name");if((f=b.exec(a))&&e===f[1]&&g===(f[3]||f[2]))if(h=f[3]?f[2]:""){if((c=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&c.toLowerCase().indexOf(h.toLowerCase())===0)n[h]=!0,(!k.specified||!k.specified(a))&&define(a,["orion/i18n!"+a],function(c){return c})}else p=c});!k.specified||!k.specified(j)?p?a.getService(p).getMessageBundle().then(function(c){Object.keys(n).forEach(function(a){typeof c[a]===
"undefined"&&(c[a]=n[a])});define(j,[],c);i(c)},function(){define(j,[],n);i(n)}):(define(j,[],n),i(n)):i(n)}})})}}else i(null)}}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search",
"Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
(function(){function j(){for(var b=navigator.userAgent,d={browser:!1,version:!1},a=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],e=0;e<a.length;e++){var h=a[e],g=b.match(h.regExp);if(g){d.browser=!0;d.version=g[1]>=h.minVersion;d.name=h.name;break}}return d}function k(){try{return"localStorage"in
window&&window.localStorage!==null}catch(b){return!1}}function i(b){alert(b);throw Error("unsupported browser");}var d=j();if(d.browser)d.version||i("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.name+".\n");else if(k()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=1;else throw"unsupported browser";
else k()||i("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:j,supportsLocalStorage:k,throwBrowserAlert:i}})();define("orion/browserCompatibility",function(){});
(function(j,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(j.orion=j.orion||{},j.orion.Deferred=k())})(this,function(){function j(){for(var a;a=b.shift();)a();f=!1}function k(a){b.push(a);f||(f=!0,setTimeout(j,0))}function i(a){return function(){a.apply(void 0,arguments)}}function d(){function a(){for(var a;a=f.shift();){var e=a.deferred,g=l==="fulfilled"?"resolve":"reject";if(typeof a[g]==="function")try{var h=(0,a[g])(c),d=h&&(typeof h===
"object"||typeof h==="function")&&h.then;if(typeof d==="function")if(h===e.promise)e.reject(new TypeError);else{var n=h.cancel;typeof n==="function"?e._protected(b).parentCancel=n.bind(h):delete e._protected(b).parentCancel;d.call(h,i(e.resolve),i(e.reject),i(e.progress))}else e.resolve(h)}catch(q){e.reject(q)}else e[g](c)}}function e(e){delete p.parentCancel;l="rejected";c=e;f.length&&k(a)}function h(g){function b(c){return function(o){i||(i=!0,c(o))}}var i=!1;delete p.parentCancel;try{var j=g&&
(typeof g==="object"||typeof g==="function")&&g.then;if(typeof j==="function")if(g===n)e(new TypeError);else{l="assumed";var w=g&&g.cancel;if(typeof w!=="function"){var u=new d,g=u.promise;try{j(u.resolve,u.reject,u.progress)}catch(q){u.reject(q)}w=g.cancel;j=g.then}c=g;j.call(g,b(h),b(e));p.parentCancel=w.bind(g)}else l="fulfilled",c=g,f.length&&k(a)}catch(o){b(e)(o)}}function g(){var c=p.parentCancel;if(c)delete p.parentCancel,c();else if(!l)c=Error("Cancel"),c.name="Cancel",e(c)}var c,l,f=[],n=
this,p={};Object.defineProperty(this,"_protected",{value:function(c){if(c!==b)throw Error("protected");return p}});this.resolve=function(c){l||h(c);return n};this.reject=function(c){l||e(c);return n};this.progress=function(c){l||f.forEach(function(a){if(a.progress)try{a.progress(c)}catch(e){}});return n.promise};this.cancel=function(){p.parentCancel?setTimeout(g,0):g();return n};this.then=function(c,e,g){c={resolve:c,reject:e,progress:g,deferred:new d};f.push(c);c.deferred._protected(b).parentCancel=
n.promise.cancel.bind(n);(l==="fulfilled"||l==="rejected")&&k(a);return c.deferred.promise};this.promise={then:n.then,cancel:n.cancel}}var b=[],f=!1;d.all=function(a,e){function b(a,e){f||(l[a]=e,--c===0&&n.resolve(l))}function g(c,a){if(!f){if(e)try{b(c,e(a));return}catch(g){a=g}n.reject(a)}}var c=a.length,l=[],f=!1,n=new d;n.then(void 0,function(){f=!0;a.forEach(function(c){c.cancel&&c.cancel()})});c===0?n.resolve(l):a.forEach(function(c,a){c.then(b.bind(void 0,a),g.bind(void 0,a))});return n.promise};
d.when=function(a,e,b,g){var c;if(!(a&&typeof a.then==="function"))c=new d,c.resolve(a),a=c.promise;return a.then(e,b,g)};return d});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var i=this._namedListeners[j.type];i&&i.forEach(function(d){try{typeof d==="function"?d(j):d.handleEvent(j)}catch(b){typeof console!=="undefined"&&console.log(b)}});return!j.defaultPrevented},addEventListener:function(j,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(i)},
removeEventListener:function(j,i){var d=this._namedListeners[j];if(d)for(var b=0;b<d.length;b++)if(d[b]===i){d.length===1?delete this._namedListeners[j]:d.splice(b,1);break}}};j.prototype.constructor=j;j.attach=function(k){var i=new j;k.dispatchEvent=i.dispatchEvent.bind(i);k.addEventListener=i.addEventListener.bind(i);k.removeEventListener=i.removeEventListener.bind(i)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,k){function i(a,b,g){this._properties=g||{};this._properties["service.id"]=a;this._properties.objectClass=b;this._properties["service.names"]=b}function d(a,b,g){this._serviceId=a;this._serviceReference=b;this._internalRegistry=g}function b(a,b){function g(c){return function(){var g;try{if(!b())throw Error("Service was unregistered");var d=a[c].apply(a,Array.prototype.slice.call(arguments));if(d&&typeof d.then==="function")return d;
else g=new j,g.resolve(d)}catch(f){g=new j,g.reject(f)}return g.promise}}for(var c in a)typeof a[c]==="function"&&(this[c]=g(c))}function f(a,b){this.type=a;this.serviceReference=b}function a(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(b){return a._entries[b]?!0:!1},unregisterService:function(b){var g=a._entries[b];if(!g)throw Error("Service has already been unregistered: "+b);var c=g.reference;a._serviceEventTarget.dispatchEvent(new f("unregistering",
c));a._entries[b]=null;c.getProperty("objectClass").forEach(function(g){for(var b=a._namedReferences[g],h=0;h<b.length;h++)if(b[h]===c){b.length===1?delete a._namedReferences[g]:b.splice(h,1);break}})},modifyService:function(b){var g=a._entries[b];if(!g)throw Error("Service not found while trying to send modified event: "+b);a._serviceEventTarget.dispatchEvent(new f("modified",g.reference))}}}i.prototype={getPropertyKeys:function(){var a=[],b;for(b in this._properties)this._properties.hasOwnProperty(b)&&
a.push(b);return a},getProperty:function(a){return this._properties[a]}};i.prototype.constructor=i;d.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(a){var b=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;
a.objectClass=b.objectClass;a["service.names"]=b["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;a.prototype={getService:function(a){var b;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(a){b=this._entries[a.getProperty("service.id")].service;return!!b},this);else if(a=this._entries[a.getProperty("service.id")])b=a.service;return b||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:
[];var b=[];this._entries.forEach(function(a){a&&b.push(a.reference)});return b},registerService:function(a,h,g){if(typeof h==="undefined"||h===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var c=this._entries.length,l=new i(c,a,g),m=this._namedReferences;a.forEach(function(c){m[c]=m[c]||[];m[c].push(l)});a=new b(h,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:l,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new f("registered",
l));return new d(c,l,a)},addEventListener:function(a,b){this._serviceEventTarget.addEventListener(a,b)},removeEventListener:function(a,b){this._serviceEventTarget.removeEventListener(a,b)}};a.prototype.constructor=a;return{ServiceRegistry:a}});
define("orion/xhr",["orion/Deferred"],function(j){function k(i,d,b,f){var a=typeof b.response!=="undefined"?b.response:b.responseText,e;try{e=b.status}catch(h){e=0}i={args:d,response:a,responseText:typeof a==="string"?a:null,status:e,url:i,xhr:b};if(typeof f!=="undefined")i.error=f;return i}return function(i,d,b){var b=b||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,a=new j,e=b.headers||{},h=b.log||!1,g;typeof e["X-Requested-With"]==="undefined"&&(e["X-Requested-With"]="XMLHttpRequest");
if(typeof b.data!=="undefined"&&(i==="POST"||i==="PUT"))g=b.data;var c=!1,l=!1;a.promise.then(void 0,function(a){c=!0;!l&&a instanceof Error&&a.name==="Cancel"&&f.abort()});f.onabort=function(){l=!0;if(!c){var b=Error("Cancel");b.name="Cancel";a.reject(b)}};f.onload=function(){var c=k(d,b,f);200<=f.status&&f.status<400?a.resolve(c):(a.reject(c),h&&typeof console!=="undefined"&&console.log(Error(f.statusText)))};f.onerror=function(){var c=k(d,b,f);a.reject(c);h&&typeof console!=="undefined"&&console.log(Error(f.statusText))};
f.onprogress=function(c){c.xhr=f;a.progress(c)};try{f.open(i,d,!0);if(typeof b.responseType==="string")f.responseType=b.responseType;if(typeof b.timeout==="number")if(typeof f.timeout==="number")f.timeout=b.timeout,f.addEventListener("timeout",function(){a.reject(k(d,b,f,"Timeout exceeded"))});else{var m=setTimeout(function(){a.reject(k(d,b,f,"Timeout exceeded"))},b.timeout);a.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(e).forEach(function(c){f.setRequestHeader(c,
e[c])});f.send(g||null)}catch(n){a.reject(k(d,b,f,n))}return a.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,k,i){function d(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function b(a,c){return{get:function(b,e){if(c===0)return null;var h=localStorage.getItem(a+b);if(h===null)return null;h=JSON.parse(h);return e||c===-1||h._expires&&h._expires>(new Date).getTime()?(delete h._expires,h):null},set:function(b,e){if(c!==0){if(c!==-1)e._expires=(new Date).getTime()+
1E3*c;if(Object.keys(e).length===0)localStorage.removeItem(a+b);else{var h=JSON.stringify(e);localStorage.setItem(a+b,h);delete e._expires}}},remove:function(c){localStorage.removeItem(a+c)}}}function f(a){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=a.getService(c[0])}return!!this._service}}function a(a){this._location=
a;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function e(){this._cache=new b("/orion/preferences/local",-1)}function h(b,c){this._userProvider=new f(b);this._localProvider=new e;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=j.toUrl(c));this._defaultsProvider=new a(c);this._serviceRegistration=b.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var b=this._stores[c];this._dirty.indexOf(b)!==-1&&
a.push(this._providers[c].put(this._name,b));if(this._pendingDeletes[c]&&this._pendingDeletes[c].length>0){for(b=0;b<this._pendingDeletes[c].length;b++)a.push(this._providers[c].remove(this._name,this._pendingDeletes[c][b]));delete this._pendingDeletes[c]}}this._dirty=[];return k.all(a)},_scheduleFlush:function(a){a&&this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),
0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var c=this._stores[a],b;for(b in c)c.hasOwnProperty(b)&&typeof this._cached[b]==="undefined"&&(this._cached[b]=c[b])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(this._stores.length!==0){var b=this._stores[0];if(b[a]!==c)b[a]=c,this._cached=null,this._scheduleFlush(b)}},remove:function(a){for(var c=0;c<
this._stores.length;++c){var b=this._stores[c];if(b.hasOwnProperty(a))return delete b[a],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,b=[],e=0;e<this._providers.length;++e)b.push(this._providers[e].get(this._name,
a).then(function(a){return function(b){c._stores[a]=b}}(e)));return k.all(b).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var b=new k,e=null;c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)b.resolve(e);else{this._currentPromises[a]=b;var h=this;this._service.get(a).then(function(c){h._cache.set(a,c);delete h._currentPromises[a];b.resolve(c)},function(c){c.status===
404?(c={},h._cache.set(a,c),delete h._currentPromises[a],b.resolve(c)):(delete h._currentPromises[a],b.resolve(h._cache.get(a,!0)||{}))})}return b},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)},remove:function(a,c){var b=this._cache.get(a);delete b[c];this._cache.set(a,b);return this._service.remove(a,c)}};a.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;var b=new k,e=null;c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)b.resolve(e);
else{this._currentPromise=b;var h=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);h._cache.set(a,c[a]||{});h._currentPromise=null;b.resolve(c[a]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(h._cache.set(a,{}),h._currentPromise=null,b.resolve({})):(h._currentPromise=null,c=h._cache.get(a,!0),c!==null?b.resolve(c[a]||{}):b.resolve({}))})}return b},put:function(){var a=new k;a.resolve();return a},remove:function(a,c){var b=
this._cache.get(a);delete b[c];this.put(a,b)}};e.prototype={get:function(a){var c=new k,a=this._cache.get(a);a!==null?c.resolve(a):c.resolve({});return c},put:function(a,c){var b=new k;this._cache.set(a,c);b.resolve();return b},remove:function(a,c){var b=this._cache.get(a);delete b[c];this.put(a,b)}};h.DEFAULT_SCOPE=1;h.LOCAL_SCOPE=2;h.USER_SCOPE=4;h.prototype={listenForChangedSettings:function(a,c,b){if(!c||typeof c!=="number"||c>7||c<1)b=c,c=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;window.addEventListener("storage",
b,!1);if((h.USER_SCOPE&c)!==0)return"/orion/preferences/user"+a;else if((h.LOCAL_SCOPE&c)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,c){if(!c||typeof c!=="number"||c>7||c<1)c=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;var b=[];h.USER_SCOPE&c&&this._userProvider.available()&&b.push(this._userProvider);h.LOCAL_SCOPE&c&&b.push(this._localProvider);h.DEFAULT_SCOPE&c&&b.push(this._defaultsProvider);var e=new d(a,b);return e.sync().then(function(){return e})},
getSetting:function(a,c,b){for(var e,h=0;h<a.length;h++)if(a[h].label===c)for(var d=0;d<a[h].data.length;d++)if(a[h].data[d].label===b){e=a[h].data[d].value;break}return e}};return{PreferencesService:h}});
(function(){function j(c){if(typeof c!=="string")throw new TypeError;}function k(c){return c?c.split("&"):[]}function i(c){return c.length===0?"":c.join("&")}function d(c){var a=/([^=]*)(?:=?)(.*)/.exec(c),c=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[c,a]}function b(c){var a=encodeURIComponent(c[0]);c[1]&&(a+="="+encodeURIComponent(c[1]));return a}function f(c,a){var o="",q=[],b=0;return{next:function(){if(o!==c.query)o=c.query,q=k(o);if(b<q.length){var e=d(q[b++]);
switch(a){case "keys":return e[0];case "values":return e[1];case "keys+values":return[e[0],e[1]];default:throw new TypeError;}}throw x;}}}function a(c){Object.defineProperty(this,"_url",{get:function(){return c._url}})}function e(c){var a=[];c.split("/").forEach(function(c){c===".."?a.pop():c!=="."&&a.push(c)});return a.join("/")}function h(c){return c.replace(/\s/g,function(c){return"%"+c.charCodeAt(0).toString(16)})}function g(c,a){if(typeof c!=="string")throw new TypeError;var c=h(c),o=n.exec(c);
if(!o)return null;var q={};q.scheme=o[1]||"";if(q.scheme&&!t.test(q.scheme))return null;var b=o[2];if(b&&(b=p.exec(b),q.userinfo=b[1],q.host=b[2],q.port=b[3],q.port&&!r.test(q.port)))return null;q.path=o[3];q.query=o[4];q.fragment=o[5];if(!q.scheme&&a&&(q.scheme=a.scheme,!q.host&&a.host))q.userinfo=a.userinfo,q.host=a.host,q.port=a.port,q.pathRelative=!0;if(q.pathRelative)if(q.path){if(q.path[0]!=="/")o=/^(.*\/)[^\/]*$/.exec(a.path)[1]||"/",q.path=o+q.path}else q.path=a.path;if(q.scheme)q.scheme=
q.scheme.toLowerCase();if(q.port)q.port=/[1-9]\d*$/.exec(q.port)[0];if(q.host&&q.path)q.path=e(q.path);return q}function c(c,o){var q;if(o){o=o.href||o;q=g(o);if(!q||!q.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:q})}q=g(c,q);if(!q)throw new SyntaxError;Object.defineProperty(this,"_input",{value:c,writable:!0});Object.defineProperty(this,"_url",{value:q,writable:!0});var b=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?b:null},enumerable:!0})}
try{var l;if(typeof window.URL==="function"&&window.URL.length!==0&&(l=new window.URL("http://www.w3.org?q")).protocol==="http:"&&l.query)return}catch(m){}var n=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,t=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,w=/^([^?#\s]*)$/,u=/^([^\s]*)$/,q=/^\S*$/,o=/([^:]*):?(.*)/,x=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),C={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(c){j(c);var a;k(this._url.query).some(function(o){o=d(o);if(o[0]===c)return a=o[1],!0});return a},enumerable:!0},set:{value:function(c,a){j(c);j(a);var o=k(this._url.query);o.some(function(q,e){var g=d(q);if(g[0]===c)return g[1]=a,o[e]=b(g),!0})||o.push(b([c,a]));this._url.query=i(o)},enumerable:!0},has:{value:function(c){j(c);
return k(this._url.query).some(function(a){if(d(a)[0]===c)return!0})},enumerable:!0},"delete":{value:function(c){j(c);var a=k(this._url.query),o=a.filter(function(a){return d(a)[0]!==c});return o.length!==a.length?(this._url.query=i(o),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(c,a){if(typeof c!=="function")throw new TypeError;var o=f(this._url,"keys+values");try{for(;;){var q=o.next();c.call(a,q[1],q[0],this)}}catch(b){if(b!==x)throw b;
}},enumerable:!0},keys:{value:function(){return f(this._url,"keys")},enumerable:!0},values:{value:function(){return f(this._url,"values")},enumerable:!0},items:{value:function(){return f(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(c){j(c);var a=[];k(this._url.query).forEach(function(o){o=d(o);o[0]===c&&a.push(o[1])});return a},enumerable:!0},append:{value:function(c,a){j(c);j(a);var o=k(this._url.query);o.push(b([c,a]));this._url.query=
i(o)},enumerable:!0}});Object.defineProperties(c.prototype,{href:{get:function(){var c;if(this._url){c=this._url;var a=c.scheme?c.scheme+":":"";c.host&&(a+="//",c.userinfo&&(a+=c.userinfo+"@"),a+=c.host,c.port&&(a+=":"+c.port));a+=c.path;c.query&&(a+="?"+c.query);c.fragment&&(a+="#"+c.fragment);c=a}else c=this._input;return c},set:function(c){j(c);this._input=c;this._url=g(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(c){j(c);if(this._url&&(c=c.slice(-1)===":"?c.substring(0,c.length-1):c,t.test(c)))this._url.scheme=c.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(c){j(c);if(this._url)this._url.userinfo=c}},username:{get:function(){if(!this._url)return"";var c=o.exec(this._userinfo);return decodeURIComponent(c[1]||"")},set:function(c){j(c);if(this._url){var a=
o.exec(this._userinfo),c=[encodeURIComponent(c||"")];a[2]&&c.push(a[2]);this._userinfo=c.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var c=o.exec(this._userinfo);return decodeURIComponent(c[2]||"")},set:function(c){j(c);if(this._url){var a=[o.exec(this._userinfo)[1]||""];c&&a.push(encodeURIComponent(c));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var c="";this._url&&this._url.host&&(c+=this._url.host,this._url.port&&(c+=":"+this._url.port));return c},
set:function(c){j(c);if(this._url&&(c=v.exec(c)))this._url.host=c[1],this._url.port=/[1-9]\d*$/.exec(c[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(c){j(c);if(this._url&&s.exec(c))this._url.host=c},enumerable:!0},port:{get:function(){var c=this._url?this._url.port||"":"";c&&c===C[this.protocol]&&(c="");return c},set:function(c){j(c);if(this._url&&r.exec(c))this._url.port=/[1-9]\d*$/.exec(c)[0]},enumerable:!0},pathname:{get:function(){return this._url?
this._url.path:""},set:function(c){j(c);if(this._url&&w.exec(c))this._url.host&&c&&c[0]!=="/"&&(c="/"+c),this._url.path=c?e(c):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(c){j(c);if(this._url&&(c&&c[0]==="?"&&(c=c.substring(1)),u.exec(c)))this._url.query=c},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(c){j(c);if(this._url&&(c&&c[0]==="#"&&(c=c.substring(1)),q.exec(c)))this._url.fragment=
c},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(c,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(c,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=c})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(j,k){function i(c,a){var b=Object.keys(c),e=Object.keys(a);if(b.length!==e.length)return!1;b.sort();e.sort();for(var g=0,h=b.length;g<h;g++){var d=b[g];if(d!==e[g])return!1;var f=c[d],d=a[d];if(f!==d&&JSON.stringify(f)!==JSON.stringify(d))return!1}return!0}function d(c){if(c.indexOf("://")===-1)try{return(new URL(c,location.href)).href}catch(a){}return c}function b(c){var a=null,b={key:function(b){return(a=
a||Object.keys(c))[b]},getItem:function(a){return c[a]},setItem:function(b,e){c[b]=e;a=null},removeItem:function(b){delete c[b];a=null},clear:function(){(a=a||Object.keys(c)).forEach(function(a){delete c[a]}.bind(this));a=null}};Object.defineProperty(b,"length",{get:function(){return(a=a||Object.keys(c)).length}});return b}function f(c,a){if(a&&a instanceof XMLHttpRequest){var b,e;try{b=a.status,e=a.statusText}catch(g){b=0,e=""}return{status:b||0,statusText:e}}return a}function a(c){var a=c?JSON.parse(JSON.stringify(c,
f)):c;if(c instanceof Error)a.__isError=!0,a.message=a.message||c.message,a.name=a.name||c.name;return a}function e(c,a){this.type=c;this.plugin=a}function h(c,a){this.__objectId=c;this.__methods=a}function g(c,b,g){function d(c){I&&g.postMessage(c,I)}function f(c){if(!I)return(new j).reject(Error("plugin not connected"));c.id=String(V++);var a=new j;T[c.id]=a;a.then(null,function(a){A==="active"&&a instanceof Error&&a.name==="Cancel"&&d({requestId:c.id,method:"cancel",params:a.message?[a.message]:
[]})});var o=Object.prototype.toString;c.params.forEach(function(q,b){if(o.call(q)==="[object Object]"&&!(q instanceof h)){var e,g;for(e in q)o.call(q[e])==="[object Function]"&&(g=g||[],g.push(e));if(g){var l=Q++;S[l]=q;e=function(){delete S[l]};a.then(e,e);c.params[b]=new h(l,g)}}});g.postMessage(c,I);return a.promise}function r(c,a){c||c===0?d({id:c,result:null,error:a}):console.log(a)}function s(c,o,q,b){b.forEach(function(c,a){if(c&&typeof c.__objectId!=="undefined"){var o={};c.__methods.forEach(function(a){o[a]=
function(){return f({objectId:c.__objectId,method:a,params:Array.prototype.slice.call(arguments)})}});b[a]=o}});var e=typeof c===void 0?null:{id:c,result:null,error:null};try{var g=q.apply(o,b);if(e)g&&typeof g.then==="function"?(M[c]=g,g.then(function(a){delete M[c];e.result=a;d(e)},function(o){if(M[c])delete M[c],e.error=a(o),d(e)},function(){d({responseId:c,method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=g,d(e))}catch(h){if(e)e.error=a(h),d(e)}}function v(c){try{if(c.method){var a=
c.method,o=c.params||[];if("serviceId"in c){var q=U[c.serviceId];q||r(c.id,"service not found");a in q?s(c.id,q,q[a],o):r(c.id,"method not found")}else if("objectId"in c){var b=S[c.objectId];b||r(c.id,"object not found");a in b?s(c.id,b,b[a],o):r(c.id,"method not found")}else if("requestId"in c){var e=M[c.requestId];e&&a==="cancel"&&e.cancel&&e.cancel.apply(e,o)}else if("responseId"in c){var h=T[c.responseId];h&&a==="progress"&&h.progress&&h.progress.apply(h,o)}else if("plugin"===c.method){var l=
c.params[0];O({headers:l.headers,services:l.services}).then(function(){z.resolve(x)})}else if("timeout"===c.method)z&&z.reject(c.error);else throw Error("Bad method: "+c.method);}else{var d=T[String(c.id)];delete T[String(c.id)];if(c.error){var f=g.handleServiceError(x,c.error);d.reject(f)}else d.resolve(c.result)}}catch(m){console.log("Plugin._messageHandler "+m)}}function w(c){var a={};if(c.methods&&(c.methods.forEach(function(o){a[o]=function(){var a={serviceId:c.serviceId,method:o,params:Array.prototype.slice.call(arguments)};
return A==="active"?f(a):x.start({"transient":!0}).then(function(){return f(a)})}}),a.addEventListener&&a.removeEventListener)){var o=new k,q=Q++;S[q]={handleEvent:o.dispatchEvent.bind(o)};var b=new h(q,["handleEvent"]),e=a.addEventListener;a.addEventListener=function(c,a){o._namedListeners[c]||e(c,b);o.addEventListener(c,a)};var g=a.removeEventListener;a.removeEventListener=function(c,a){o.removeEventListener(c,a);o._namedListeners[c]||g(c,b)}}return a}function u(a){var o=JSON.parse(JSON.stringify(a.properties));
o.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);o.objectClass=a;return o}function q(c){var a=w(c),o=u(c),o=g.registerService(c.names||c.type,a,o);J[c.serviceId]={registration:o,proxy:a}}function o(){g.persist(c,{created:C,headers:E,services:D,autostart:y,lastModified:B})}var x=this,b=b||{},C=b.created||(new Date).getTime(),E=b.headers||{},D=b.services||[],y=b.autostart,B=b.lastModified||0,A="installed",F,z,I,J={},V=0,Q=0,M={},T={},S={},U={},O;this._persist=o;this._resolve=function(){A=
"resolved";g.dispatchEvent(new e("resolved",x))};this._getAutostart=function(){return y};this._getCreated=function(){return C};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(E))};this.getName=function(){var c=this.getHeaders();return c?c.name||"":null};this.getVersion=function(){var c=this.getHeaders();return c?c.version||"0.0.0":null};this.getLastModified=function(){return B};this.getServiceReferences=function(){var c=[];Object.keys(J).forEach(function(a){c.push(J[a].registration.getReference())});
return c};this.getState=function(){return A};this.start=function(a){if(A==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.start.bind(this,a));if(A==="active")return(new j).resolve();if(!a||!a.transient){var b=a&&a.lazy?"lazy":"started";b!==y&&(y=b,o())}b=g.getState();if(b!=="starting"&&b!=="active")return a.transient?(new j).reject(Error("start transient error")):(new j).resolve();if(A==="installed")try{this._resolve()}catch(h){return(new j).reject(h)}A===
"resolved"&&D.forEach(function(c){q(c)});if(a&&a.lazy)return A!=="starting"&&(A="starting",g.dispatchEvent(new e("lazy activation",x))),(new j).resolve();var d=new j;F=d;A="starting";g.dispatchEvent(new e("starting",x));z=new j;I=g.connect(c,v);z.then(function(){z=null;A="active";g.dispatchEvent(new e("started",x));F=null;d.resolve()},function(){z=null;A="stopping";g.dispatchEvent(new e("stopping",x));Object.keys(J).forEach(function(c){J[c].registration.unregister();delete J[c]});g.disconnect(I);
I=null;A="resolved";F=null;g.dispatchEvent(new e("stopped",x));d.reject(Error("plugin activation error"))});return d.promise};this.stop=function(c){if(A==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.stop.bind(this,c));if((!c||!c.transient)&&"stopped"!==y)y="stopped",o();if(A!=="active"&&A!=="starting")return(new j).resolve();F=c=new j;A="stopping";g.dispatchEvent(new e("stopping",x));Object.keys(J).forEach(function(c){J[c].registration.unregister();
delete J[c]});I&&(g.disconnect(I),I=null);A="resolved";F=null;g.dispatchEvent(new e("stopped",x));c.resolve();return c.promise};O=function(a){if(A==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!a)return B===0&&(B=(new Date).getTime(),o()),g.loadManifest(c).then(O);var b=E,h=D,d=y;E=a.headers||{};D=a.services||{};y=a.autostart||y;a.lastModified?B=a.lastModified:(B=(new Date).getTime(),o());if(i(E,b)&&i(D,h)&&y===d)return(new j).resolve();if(A==="active"||A==="starting"){var f=
[];Object.keys(D).forEach(function(c){var a=D[c];f.push(c);var o=J[c];if(o){if(i(a.methods,Object.keys(o.proxy))){var c=u(a),b=o.registration.getReference(),e={};b.getPropertyKeys().forEach(function(c){e[c]=b.getProperty(c)});i(c,e)||o.registration.setProperties(c);return}o.registration.unregister();delete J[c]}q(a)});Object.keys(J).forEach(function(c){f.indexOf(c)===-1&&(J[c].registration.unregister(),delete J[c])})}A==="active"&&(g.disconnect(I),z=new j,I=g.connect(c,v),z.then(function(){z=null},
function(){z=null;A="stopping";g.dispatchEvent(new e("stopping"),x);Object.keys(J).forEach(function(c){J[c].registration.unregister();delete J[c]});g.disconnect(I);I=null;A="resolved";g.dispatchEvent(new e("stopped",x))}));return(new j).resolve()};this.update=function(c){return O(c).then(function(){g.dispatchEvent(new e("updated",x))})};this.uninstall=function(){if(A==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(A==="active"||A==="starting"||A==="stopping")return this.stop().then(this.uninstall.bind(this),
this.uninstall.bind(this));g.removePlugin(this);A="uninstalled";g.dispatchEvent(new e("uninstalled",x));return(new j).resolve()}}var c=/^http[s]?/i;return{Plugin:g,PluginRegistry:function(a,h){function f(c){var a=c.source;i.some(function(b){if(a===b.target){try{var e;if(typeof b.useStructuredClone==="undefined"){var g=typeof c.data!=="string";e=g?c.data:JSON.parse(c.data);b.useStructuredClone=g}else e=b.useStructuredClone?c.data:JSON.parse(c.data);b.handler(e)}catch(h){}return!0}})}var h=h||{},p=
h.storage||localStorage;p.getItem||(p=b(p));var t="installed",r=[],i=[],v=new k,w={},u={registerService:a.registerService.bind(a),connect:function(c,a,b){function e(c){c=Error(c);c.name="timeout";a({method:"timeout",error:c})}var g={handler:a,url:c},l=setTimeout(e.bind(null,"Load timeout for: "+c),b||15E3),d=document.createElement("iframe");d.name=c+"_"+(new Date).getTime();if(!h.visible)d.style.display="none",d.style.visibility="hidden";d.src=c;d.onload=function(){clearTimeout(l);setTimeout(e.bind(null,
"Plugin handshake timeout for: "+c),5E3)};d.sandbox="allow-scripts allow-same-origin";document.body.appendChild(d);g.target=d.contentWindow;g.close=function(){d&&(document.body.removeChild(d),d=null)};i.push(g);return g},disconnect:function(c){for(var a=0;a<i.length;a++)if(c===i[a]){i.splice(a,1);try{c.close()}catch(b){}break}},removePlugin:function(c){for(var a=0;a<r.length;a++)if(c===r[a]){r.splice(a,1);break}p.removeItem("plugin."+c.getLocation())},persist:function(c,a){p.setItem("plugin."+c,JSON.stringify(a))},
postMessage:function(c,a){a.target.postMessage(a.useStructuredClone?c:JSON.stringify(c),a.url)},dispatchEvent:function(c){try{v.dispatchEvent(c)}catch(a){console&&console.log("PluginRegistry.dispatchEvent "+a)}},loadManifest:function(c){var a=new j,b=u.connect(c,function(c){b&&c.method&&("manifest"===c.method||"plugin"===c.method?(c=c.params[0],u.disconnect(b),b=null,a.resolve(c)):"timeout"===c.method&&(u.disconnect(b),b=null,a.reject(c.error)))});return a.promise},getState:function(){return t},handleServiceError:function(a,
o){if(o&&o.status===401){var b=a.getHeaders(),e=a.getName()||a.getLocation(),g=document.createElement("span");g.appendChild(document.createTextNode("Authentication required for: "+e+"."));if(b.login)g.appendChild(document.createTextNode(" ")),e=document.createElement("a"),e.target="_blank",e.textContent="Login",e.href=b.login,c.test(e.href)?(g.appendChild(e),g.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login);return{Severity:"Error",HTML:!0,
Message:(new XMLSerializer).serializeToString(g)}}if(o.__isError){var h=o,o=Error(h.message);Object.keys(h).forEach(function(c){o[c]=h[c]});delete o.__isError}return o}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=u.getState;this.init=function(){if(!(t==="starting"||t==="active"||t==="stopping")){addEventListener("message",f,
!1);for(var c=[],a=0,b=p.length;a<b;a++)c.push(p.key(a));c.forEach(function(c){if(c.indexOf("plugin.")===0){var a=c.substring(7),c=JSON.parse(p.getItem(c));c.created&&r.push(new g(a,c,u))}});r.sort(function(c,a){return c._getCreated()<a._getCreated()?-1:1});h.plugins&&Object.keys(h.plugins).forEach(function(c){c=d(c);if(!this.getPlugin(c)){var a=h.plugins[c],a=typeof a==="object"||{};a.autostart=a.autostart||h.defaultAutostart||"lazy";r.push(new g(c,a,u))}}.bind(this));t="starting"}};this.start=function(){t!==
"starting"&&this.init();if(t!=="starting")return(new j).reject("Cannot start framework. Framework is already "+t+".");var c=[],a=(new Date).getTime();r.forEach(function(b){var e=b._getAutostart();b.getLastModified()===0?c.push(b.update().then(function(){if("started"===e)return b.start({"transient":!0});if("lazy"===e)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===e?c.push(b.start({"transient":!0})):"lazy"===e?(c.push(b.start({lazy:!0,"transient":!0})),a>b.getLastModified()+864E5&&
b.update()):b._resolve()});return j.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){t="active"})};this.stop=function(){if(t!=="starting"&&t!=="active")return(new j).reject("Cannot stop registry. Registry is already "+t+".");t="stopping";var c=[];r.forEach(function(a){c.push(a.stop({"transient":!0}))});return j.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){removeEventListener("message",f);t="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};
this.uninstall=function(){return(new j).reject("Cannot uninstall registry")};this.installPlugin=function(c,a){var c=d(c),b=this.getPlugin(c);if(b)return(new j).resolve(b);if(w[c])return w[c];if(a)return b=new g(c,a,u),r.push(b),b._persist(),u.dispatchEvent(new e("installed",b)),(new j).resolve(b);var h=u.loadManifest(c).then(function(a){b=new g(c,a,u);r.push(b);b._persist();delete w[c];u.dispatchEvent(new e("installed",b));return b},function(a){delete w[c];throw a;});return w[c]=h};this.getPlugins=
function(){return r.slice()};this.getPlugin=function(c){var a=null,c=d(c);r.some(function(b){if(c===b.getLocation())return a=b,!0});return a};this.addEventListener=v.addEventListener.bind(v);this.removeEventListener=v.removeEventListener.bind(v);this.resolvePlugins=function(){var c=!0;r.forEach(function(a){c=c&&a._resolve()});return c}}}});
define("orion/serviceTracker",[],function(){function j(d,b){function f(c){var a=c.getProperty("service.id"),b=this.addingService(c);b&&(e[a]=c,h[a]=b)}function a(c){var a=c.getProperty("service.id"),b=h[a];delete e[a];delete h[a];this.removedService(c,b)}this.serviceRegistry=d;var e={},h={},g=k,c,l;this.close=function(){if(g!==i)throw"Already closed";g=k;d.removeEventListener("registered",c);d.removeEventListener("unregistering",l);l=c=null;var b=this;this.getServiceReferences().forEach(function(c){a.call(b,
c)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var c=Object.keys(e);return!c.length?null:c.map(function(c){return e[c]})};this.open=function(){if(g!==k)throw"Already open";g=i;var e=this;c=function(c){if(c.serviceReference.getProperty("objectClass").indexOf(b)!==-1&&(f.call(e,c.serviceReference),typeof e.onServiceAdded==="function"))return e.onServiceAdded(c.serviceReference,e.serviceRegistry.getService(c.serviceReference))};l=function(c){c.serviceReference.getProperty("objectClass").indexOf(b)!==
-1&&a.call(e,c.serviceReference)};d.addEventListener("registered",c);d.addEventListener("unregistering",l);d.getServiceReferences(b).forEach(function(c){f.call(e,c)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,i=1;j.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/objects",[],function(){function j(j){for(var i=1;i<arguments.length;i++){var d=arguments[i],b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(j[b]=d[b])}return j}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var i=Object.create(Object.getPrototypeOf(k));j(i,k);return i},mixin:j,toArray:function(j){return Array.isArray(j)?j:[j]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(j,k,i){var d,b,f,a,e,h="pid";d=function(c,a,b){function e(c,b,g){b.forEach(function(e,q){try{var o=c[q].getProperty("__plugin__"),h=o&&a.getPlugin(o);(!o||h&&h.getState()==="active")&&b[q].updated(g)}catch(d){typeof console!=="undefined"&&console.log(d)}})}k.call(this,c,"orion.cm.managedservice");var g={},d={},f=function(a){var e=[];a.plugin.getServiceReferences().forEach(function(a){if(a.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var g=a.getProperty(h),a=c.getService(a);g&&a&&(g=(g=b._find(g))&&g.getProperties(),e.push(a.updated(g)))}});return j.all(e)};this.addingService=function(a){var b=a.getProperty(h),e=c.getService(a);if(!b||!e)return null;g[b]||(g[b]=[]);d[b]||(d[b]=[]);g[b].push(a);d[b].push(e);return e};this.onServiceAdded=function(c,a){var g=c.getProperty(h),g=b._find(g);e([c],[a],g&&g.getProperties())};this.onOpen=function(){a.addEventListener("started",f)};this.onClose=function(){a.removeEventListener("started",
f)};this.notifyUpdated=function(c){var a=c.getPid();e(g[a]||[],d[a]||[],c.getProperties())};this.notifyDeleted=function(c){c=c.getPid();e(g[c]||[],d[c]||[],null)};this.removedService=function(c,a){var b=c.getProperty(h),e=g[b],q=d[b];e.length>1?e.splice(e.indexOf(c),1):delete g[b];q.length>1?q.splice(q.indexOf(a),1):delete d[b]}};b=function(){function c(c,b,e){this.store=new f(this,e);this.configAdmin=new a(this,this.store);this.tracker=new d(c,b,this.store)}c.prototype={getConfigurationAdmin:function(){var c=
this;return this.configAdmin._init().then(function(a){c.tracker.open();return a})},notifyDeleted:function(c){this.tracker.notifyDeleted(c)},notifyUpdated:function(c){this.tracker.notifyUpdated(c)}};return c}();a=function(){function c(c,a){this.factory=c;this.store=a}c.prototype={_init:function(){var c=this;return this.store._init().then(function(){return c})},getConfiguration:function(c){return this.store.get(c)},listConfigurations:function(){return this.store.list()}};return c}();var g="/cm/configurations";
f=function(){function c(c,a){this.factory=c;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var b=this;this.initPromise=this.prefsService.getPreferences(g).then(function(c){b.pref=c;c.keys().forEach(function(a){if(!b.configs[a]){var g=c.get(a);typeof g==="object"&&g!==null&&Object.keys(g).length>0&&(g[h]=a,b.configs[a]=new e(b.factory,b,g))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(c){return this.configs[c]||null},get:function(c){var a=this._find(c);
a||(a=new e(this.factory,this,c),this.configs[c]=a);return a},list:function(){var c=this,a=[];this.pref.keys().forEach(function(b){(b=c._find(b))&&b.getProperties()!==null&&a.push(b)});return a},remove:function(c){this.pref.remove(c);delete this.configs[c]},save:function(c,a){this.pref.put(c,a.getProperties(!0)||{})}};return c}();e=function(){function c(c,a){a=i.clone(a);delete a[h];c.properties=a}function a(b,e,g){this.factory=b;this.store=e;if(g!==null&&typeof g==="object")this.pid=g[h],c(this,
g);else if(typeof g==="string")this.pid=g,this.properties=null;else throw Error("Invalid pid/properties "+g);}a.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var a=null;if(this.properties&&(a=i.clone(this.properties),!c))a[h]=this.pid;return a},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return a}();return{ConfigurationAdminFactory:b}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,k,i,d,b,f){var a;return{startup:function(){if(a)return a;a=new k;var e=new i.ServiceRegistry,h=new d.PreferencesService(e);return h.getPreferences("/plugins").then(function(g){var c={plugins:{}};g.keys().forEach(function(a){var b=j.toUrl(a);c.plugins[b]=g[a]});var d=new b.PluginRegistry(e,c);return d.start().then(function(){if(e.getServiceReferences("orion.core.preference.provider").length>
0)return h.getPreferences("/plugins",h.USER_SCOPE).then(function(c){var a=[];c.keys().forEach(function(c){c=j.toUrl(c);d.getPlugin(c)||a.push(d.installPlugin(c,{autostart:"lazy"}).then(function(c){return c.update().then(function(){return c.start({lazy:!0})})}))});return k.all(a,function(c){console.log(c)})})}).then(function(){return(new f.ConfigurationAdminFactory(e,d,h)).getConfigurationAdmin().then(e.registerService.bind(e,"orion.cm.configadmin"))}).then(function(){var c=e.getService("orion.core.auth");
if(c){var a=c.getUser().then(function(a){if(a)localStorage.setItem("lastLogin",(new Date).getTime());else return c.getAuthForm(window.location.href).then(function(c){setTimeout(function(){window.location=c},0)})}),b=localStorage.getItem("lastLogin");if(!b||b<(new Date).getTime()-9E5)return a}}).then(function(){var c={serviceRegistry:e,preferences:h,pluginRegistry:d};a.resolve(c);return c})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
"Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20131030-1703","LOG: ":"LOG: ",View:"View","no parent":"no parent",
"no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Raw:"Raw","Open the raw file or folder in the browser":"Open the raw file or folder in the browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred."});
define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/util",[],function(){var j=navigator.userAgent,k=j.indexOf("MSIE")!==-1||j.indexOf("Trident")!==-1?document.documentMode:void 0,i=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,d=j.indexOf("Opera")!==-1,b=parseFloat(j.split("Chrome/")[1])||void 0,f=j.indexOf("Safari")!==-1&&!b,a=parseFloat(j.split("WebKit/")[1])||void 0,e=j.indexOf("Android")!==-1,h=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,g=h||j,c=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==
-1,m=navigator.platform.indexOf("Linux")!==-1;return{formatMessage:function(c){var a=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(c,b){return a[(b<<0)+1]})},createElement:function(c,a){return c.createElementNS?c.createElementNS("http://www.w3.org/1999/xhtml",a):c.createElement(a)},isIE:k,isFirefox:i,isOpera:d,isChrome:b,isSafari:f,isWebkit:a,isAndroid:e,isIPad:h,isIPhone:j,isIOS:g,isMac:c,isWindows:l,isLinux:m,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(j){function k(a,b){b||(b=document);return b.querySelectorAll(a)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var g=i(a.childNodes[b]);if(g)return g}return null}function d(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;b>=0;b--){var g=d(a.childNodes[b]);if(g)return g}return null}function b(a,h){if(a.nodeType===3){var g=f.exec(a.nodeValue);g&&g.length>1&&h(a,
g)}if(a.hasChildNodes())for(g=0;g<a.childNodes.length;g++)b(a.childNodes[g],h)}var f=/\$\{([^\}]+)\}/,a=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:k,$$array:function(a,b){return Array.prototype.slice.call(k(a,b))},node:function(a){var b=a;typeof a==="string"&&(b=document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var g=a.compareDocumentPosition(b);return Boolean(g&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+
document.body.scrollLeft,top:a.top+document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:i,lastTabbable:d,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,h){b(a,function(a,c){a.parentNode.replaceChild(document.createTextNode(h[c[1]]||c[1]),a)})},processDOMNodes:function(a,h){b(a,function(a,c){var b=h[c[1]];if(b){var e=document.createRange(),
d=c.index;e.setStart(a,d);e.setEnd(a,d+c[0].length);e.deleteContents();e.insertNode(b)}})},addAutoDismiss:function(b,h){function g(c){a.forEach(function(a){var b=!1,e=a.excludeNodes.some(function(a){return document.body.contains(a)?(b=!0,a.contains(c.target)):!1});if(b&&!e)try{a.dismiss()}catch(g){typeof console!=="undefined"&&console&&console.error(g&&g.message)}});a=a.filter(function(c){return c.excludeNodes.some(function(c){return document.body.contains(c)})})}a===null&&(a=[],document.addEventListener("click",
g,!0),j.isIOS&&document.addEventListener("touchend",function(c){function a(){c.target.removeEventListener("click",a)}c.touches.length===0&&c.target.addEventListener("click",a)},!1));a.push({excludeNodes:b,dismiss:h})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(j){var k,i,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,e=a&&location.protocol&&location.protocol.replace(/\:/,""),h=a&&location.hostname,g=a&&(location.port||void 0),c=[],l=j.config&&j.config()||{};k={version:"2.0.5",strip:function(c){if(c){var c=c.replace(b,""),a=c.match(f);a&&(c=a[1])}else c="";return c},
jsEscape:function(c){return c.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var c,a,b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(a=0;a<3;a+=1){b=d[a];try{c=new ActiveXObject(b)}catch(e){}if(c){d=[b];break}}return c},parseName:function(c){var a,
b,e=!1,g=c.indexOf(".");a=c.indexOf("./")===0||c.indexOf("../")===0;g!==-1&&(!a||g>1)?(a=c.substring(0,g),b=c.substring(g+1,c.length)):a=c;c=b||a;g=c.indexOf("!");g!==-1&&(e=c.substring(g+1)==="strip",c=c.substring(0,g),b?b=c:a=c);return{moduleName:a,ext:b,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(c,a,b,e){var g,h;g=k.xdRegExp.exec(c);if(!g)return!0;c=g[2];g=g[3];g=g.split(":");h=g[1];g=g[0];return(!c||c===a)&&(!g||g.toLowerCase()===b.toLowerCase())&&(!h&&!g||h===e)},finishLoad:function(a,
b,e,g){e=b?k.strip(e):e;l.isBuild&&(c[a]=e);g(e)},load:function(c,b,d,f){if(f.isBuild&&!f.inlineText)d();else{l.isBuild=f.isBuild;var r=k.parseName(c),f=r.moduleName+(r.ext?"."+r.ext:""),i=b.toUrl(f),j=l.useXhr||k.useXhr;!a||j(i,e,h,g)?k.get(i,function(a){k.finishLoad(c,r.strip,a,d)},function(c){d.error&&d.error(c)}):b([f],function(c){k.finishLoad(r.moduleName+"."+r.ext,r.strip,c,d)})}},write:function(a,b,e){if(c.hasOwnProperty(b)){var g=k.jsEscape(c[b]);e.asModule(a+"!"+b,"define(function () { return '"+
g+"';});\n")}},writeFile:function(c,a,b,e,g){var a=k.parseName(a),h=a.ext?"."+a.ext:"",d=a.moduleName+h,l=b.toUrl(a.moduleName+h)+".js";k.load(d,b,function(){var a=function(c){return e(l,c)};a.asModule=function(c,a){return e.asModule(c,l,a)};k.write(c,d,a,g)},g)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)i=require.nodeRequire("fs"),k.get=function(c,a){var b=i.readFileSync(c,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));a(b)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(c,a,b,e){var g=k.createXhr(),h;g.open("GET",c,!0);if(e)for(h in e)e.hasOwnProperty(h)&&g.setRequestHeader(h.toLowerCase(),e[h]);if(l.onXhr)l.onXhr(g,c);g.onreadystatechange=function(){var e;if(g.readyState===4)e=g.status,e>399&&e<600?(e=Error(c+" HTTP status: "+e),e.xhr=g,b(e)):a(g.responseText)};g.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(c,a){var b,e,g=new java.io.File(c),h=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),d="";try{b=new java.lang.StringBuffer;(e=g.readLine())&&e.length()&&e.charAt(0)===65279&&(e=e.substring(1));for(b.append(e);(e=g.readLine())!==null;)b.append(h),b.append(e);d=String(b.toString())}finally{g.close()}a(d)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(j,k,i){return{slideoutHTMLFragment:function(d){var b=document.createElement("div");b.innerHTML=i;var f=k.$("#slideContainer",b);f.id=d+f.id;f=k.$("#pageCommandParameters",b);f.id=d+f.id;f=k.$("#pageCommandDismiss",b);f.id=d+f.id;return b.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(j){function k(d,b,f,a,e,h){this.type=h||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=f!==void 0&&f!==null?f:!1;this.mod3=a!==void 0&&a!==null?a:!1;this.mod4=e!==void 0&&e!==null?e:!1}function i(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,b){if(b!==void 0){if(b!==0)return!1}else if(d instanceof Array){if(d.length>1)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(j.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(j.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:j.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d?!1:this.keyCode!==d.keyCode?!1:this.mod1!==d.mod1?!1:this.mod2!==d.mod2?!1:this.mod3!==d.mod3?!1:this.mod4!==d.mod4?!1:this.type!==d.type?!1:!0}};i.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,b){var f=this.keys;if(b!==void 0)return b>f.length?!1:f[b].match(d)?b===f.length-1?!0:b+1:!1;else{d instanceof Array||(d=[d]);if(d.length>f.length)return!1;var a;for(a=0;a<d.length;a++)if(!f[a].match(d[a]))return!1;return a===f.length?!0:a}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var b=0;b<d.keys.length;b++)if(!d.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:i}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){this._dropdownNode=k.node(d.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=d.populate;this._selectionClass=d.selectionClass;var b=this;this._triggerNode.addEventListener("click",function(d){b.toggle()&&
k.stop(d)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(d){if(d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.SPACE)b.toggle(),k.stop(d)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this.isVisible()?this.close():this.open()},isVisible:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")},open:function(){if(!this.isVisible()){this._populate&&(this.empty(),
this._populate(this._dropdownNode));var d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss){var b=k.$$(".dropdownSubMenu",this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(b)),function(){if(this.isVisible()){this.close();for(var b=this._dropdownNode.parentNode;b;)b.dropdown&&typeof b.dropdown.close==="function"&&b.dropdown.close(),b=b.parentNode}}.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&
this._triggerNode.classList.add(this._selectionClass);this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();d[0].focus();return!0}return!1}},_positionDropdown:function(){this._dropdownNode.style.left="";var d=k.bounds(this._dropdownNode),b=k.bounds(document.body);if(d.left+d.width>b.left+b.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-d.width+"px";else{var b=k.bounds(this._boundingNode(this._triggerNode)),f=k.bounds(this._triggerNode);
this._dropdownNode.style.left=f.left-b.left-d.width+f.width+"px"}},_boundingNode:function(d){var b=window.getComputedStyle(d,null);return b===null?d:b.getPropertyValue("position")==="absolute"||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},close:function(d){if(this.isVisible())return this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),
d&&this._triggerNode.focus(),!0},getItems:function(){var d=[],b=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===b._dropdownNode&&d.push(f)});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===d._dropdownNode&&b.parentNode.removeChild(b)})},_dropdownKeyDown:function(d){if(d.keyCode===k.KEY.UP||d.keyCode===k.KEY.DOWN||d.keyCode===k.KEY.RIGHT||d.keyCode===k.KEY.ENTER||
d.keyCode===k.KEY.LEFT){var b=this.getItems(),f=document.activeElement;if(b.length&&b.length>0&&f){var a=b.indexOf(f);a<0&&(a=b.indexOf(f.parentNode));a>=0&&(d.keyCode===k.KEY.UP&&a>0?(a--,b[a].focus()):d.keyCode===k.KEY.DOWN&&a<b.length-1?(a++,b[a].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&f.dropdown&&f.dropdown.open():d.keyCode===k.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(d))}}else d.keyCode===
k.KEY.ESCAPE&&(this.close(!0),k.stop(d))}};i.prototype.constructor=i;return{Dropdown:i}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-downarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){this._node=k.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=d.hideDelay===void 0?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var b=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(a){a.target===b._node&&(b.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=d.showDelay===void 0?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(a){k.contains(b._node,a.target)&&(b.show(),k.stop(a))},!1);this._leaveHandler=function(a){k.contains(b._node,a.target)&&b.hide()};for(var f=0;f<d.length;f++)this._node.addEventListener(d[f],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;k.addAutoDismiss([this._tip,this._node],function(){d.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(d._timeout)window.clearTimeout(d._timeout),d._timeout=null;d._tip.addEventListener("mouseout",function(b){k.contains(d._tip,b.target)&&(d.hide(),k.stop(b))},
!1)},!1)}return this._tip},_positionTip:function(d,b){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var f=this._node,a;for(a=k.bounds(f);f&&!a.width&&!a.height;f=f.parentNode)a=k.bounds(f);var f=k.bounds(this._tipInner),e;switch(d){case "above":e=a.top-f.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":e=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":e=a.top-this._tailSize/2;a=a.left-f.width-
this._tailSize-1;break;default:e=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var h=k.bounds(document.documentElement);if(e+f.height>h.height)if(b)e=h.height-f.height-1;else return!1;if(a+f.width>h.width)if(b)a=h.width-f.width-1;else return!1;if(a<0)if(b)a=4;else return!1;if(e<0)if(b)e=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+d),d==="above"||d==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,
this._tipInner),d==="left"))this._tail.style.left=f.width+"px";this._tip.style.top=e+"px";this._tip.style.left=a+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var d=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var b=!1,f=0;!b&&f<d._position.length;)b=d._positionTip(d._position[f]),f++;b||d._positionTip(d._position[0],
!0);d._tip.classList.add("tooltipShowing");d._afterShowing&&d._afterShowing()},this._showDelay)}},hide:function(d){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(d===void 0)d=this._hideDelay;var b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");b._tip.removeAttribute("style");b._afterHiding&&b._afterHiding()},d)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var d=["mouseout","click"],b=0;b<d.length;b++)this._node.removeEventListener(d[b],this._leaveHandler,!1)}}};i.prototype.constructor=i;return{Tooltip:i}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(j,k,i,d,b,f,a,e){function h(c){var a=c.invocation;if(a){var b=c.command;if(b.hrefCallback)return c=b.hrefCallback.call(a.handler||window,a),c.then?c.then(function(c){window.open(c)}):window.open(c),!0;else if(a.commandRegistry)return a.commandRegistry._invoke(a),
!0;else if(b.onClick||b.callback)return window.setTimeout(function(){(b.onClick||b.callback).call(a.handler||window,a)},0),!0}return!1}function g(c,a){for(var b in a)if(a[b]&&a[b].keyBinding&&a[b].command&&a[b].keyBinding.match(c)){var e=a[b],g=e.keyBinding;if((!g.domScope||i.contains(i.node(g.domScope),c.target))&&h(e)){i.stop(c);break}}}function c(c,a,b){a.classList.add("commandImage");var e;c.imageClass?c.addImageClassToElement?a.classList.add(c.imageClass):(e=document.createElement("span"),a.appendChild(e),
e.classList.add(c.spriteClass),e.classList.add(c.imageClass)):(e=new Image,e.alt=c.name,e.name=b,e.id=b,e.src=c.image,a.appendChild(e));return e}function l(c,a,b,e,g){this.commandRegistry=g;this.handler=c;this.items=a;this.userData=b;this.command=e;if(e.parameters)this.parameters=e.parameters.makeCopy();this.id=e.id}function m(c){this._init(c)}var n=null,p={};window.document.addEventListener("keydown",function(c){c=c||window.event;if(function(c){if(k.isMac){if(c.metaKey&&!c.altKey)return!c.shiftKey&&
!c.ctrlKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===90)?!0:!1}else{if(c.ctrlKey&&!c.altKey)return!c.shiftKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===90)?!0:!1;if(c.altKey&&!c.ctrlKey)return!1}if(c["char"])return c["char"].length>0;else if(c.charCode||c.keyCode)switch(c=c.charCode||c.keyCode,c){case 8:case 9:case 13:case 46:return!0;default:return c>=32&&c<112||c>123}return!1}(c)){if(c.target.contentEditable==="true")return;
var a=c.target.nodeName.toLowerCase();if(a==="input")switch(c.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(a==="textarea")return}a={};if(n){var b,e,h;e=Object.keys(p);for(b=0;b<e.length;b++)h=e[b],a[h]=p[h];var d=n();e=Object.keys(d);for(b=0;b<e.length;b++)h=e[b],a[h]=d[h]}else a=p;g(c,a)},!1);l.prototype=
{collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(c){var a=new l(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(c)a.parameters=c.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};l.prototype.constructor=l;m.prototype={_init:function(c){this.id=c.id;this.name=c.name;this.tooltip=c.tooltip||c.name;this.callback=c.callback;
this.hrefCallback=c.hrefCallback;this.choiceCallback=c.choiceCallback;this.image=c.image||j.toUrl("images/none.png");this.imageClass=c.imageClass;this.addImageClassToElement=c.addImageClassToElement;this.selectionClass=c.selectionClass;this.spriteClass=c.spriteClass||"commandSprite";this.visibleWhen=c.visibleWhen;this.parameters=c.parameters},populateChoicesMenu:function(c,a,b,e,g){this.getChoices(a,b,e).forEach(function(b){if(b.name){var e=document.createElement("li");c.appendChild(e);var o=document.createElement("span");
o.tabIndex=0;o.role="menuitem";o.classList.add("dropdownMenuItem");var h=document.createTextNode(b.name);o.appendChild(h);e.appendChild(o);o.choice=b;o.addEventListener("click",function(c){c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1);o.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1)}else g._generateMenuSeparator(c)})},getChoices:function(c,a,b){return this.choiceCallback?
this.choiceCallback.call(a,c,b):null},makeChoiceCallback:function(c,a){return function(b){c.callback&&c.callback.call(c,a,b)}},hasImage:function(){return this.imageClass||this.image!==j.toUrl("images/none.png")}};m.prototype.constructor=m;return{Command:m,CommandInvocation:l,createDropdownMenu:function(a,e,g,h,l,f,q){a=i.node(a);if(!a)throw"no parent node was specified";var o=document.createRange();o.selectNode(a);o=o.createContextualFragment(b);i.processTextNodes(o,{ButtonText:e});a.appendChild(o);
a=a.lastChild;o=a.previousSibling;h?o.classList.add(h):(o.classList.add("orionButton"),o.classList.add("commandButton"));if(l){if(!f)o.textContent="",o.setAttribute("aria-label",e);c({spriteClass:"commandSprite",imageClass:l},o,e);o.classList.add("orionButton")}o.dropdown=new d.Dropdown({dropdown:a,populate:g,selectionClass:q});a.dropdown=o.dropdown;return{menuButton:o,menu:a,dropdown:o.dropdown}},createCheckedMenuItem:function(c,b,e,g){c=i.node(c);if(!c)throw"no parent node was specified";var h=
document.createRange();h.selectNode(c);h=h.createContextualFragment(a);i.processTextNodes(h,{ItemText:b});c.appendChild(h);c=i.$(".checkedMenuItem",c.lastChild);c.checked=e;c.addEventListener("change",g,!1);return c},createCommandItem:function(a,b,g,h,d,l,q){var o,l=l||!b.name&&b.hasImage();if(b.hrefCallback)o=document.createElement("a"),o.id=h,l&&b.hasImage()?c(b,o,h):(o.className="commandLink",o.appendChild(document.createTextNode(b.name))),q=b.hrefCallback.call(g.handler,g),q.then?q.then(function(c){o.href=
c}):o.href=q?q:"#";else{o=document.createElement("button");o.className="orionButton";l?b.hasImage()?(c(b,o,h),b.name&&o.setAttribute("aria-label",b.name)):(o.classList.add("commandButton"),o.classList.add("commandMissingImageButton"),o.appendChild(document.createTextNode(b.name))):(o.classList.add("commandButton"),h=document.createTextNode(b.name),o.appendChild(h));var f=q||b.callback;if(f)b.onClick=f,o.addEventListener("click",function(){f.call(g.handler,g)},!1)}a.nodeName.toLowerCase()==="ul"?(q=
document.createElement("li"),a.appendChild(q),a=q):o.classList.add("commandMargins");a.appendChild(o);if(b.tooltip)o.commandTooltip=new e.Tooltip({node:o,text:b.tooltip,position:["above","below","right","left"]});d&&(p[b.id]={keyBinding:d,command:b,invocation:g});return o},createCommandMenuItem:function(c,a,b,g,h){var d,q=c.dropdown;if(a.hrefCallback)d=document.createElement("a"),d.appendChild(document.createTextNode(a.name)),h=a.hrefCallback.call(b.handler,b),h.then?h.then(function(c){d.href=c}):
d.href=h?h:"#",d.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&d.click()},!1);else{d=document.createElement("span");d.tabIndex=0;d.appendChild(document.createTextNode(a.name));var o=h||a.callback;if(o)a.onClick=o,d.addEventListener("click",function(){q.close(!0);o.call(b.handler,b)},!1),d.addEventListener("keydown",function(c){if(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)c.preventDefault(),d.click()},!1)}if(a.tooltip)d.commandTooltip=new e.Tooltip({node:d,
text:a.tooltip,position:["right","left","above","below"]});d.className="dropdownMenuItem";d.role="menuitem";h=document.createElement("li");c.appendChild(h);h.appendChild(d);g&&(p[a.id]={keyBinding:g,command:a,invocation:b});return d},executeBinding:h,setKeyBindingProvider:function(c){n=c},localKeyBindings:p,_testMethodProcessKey:g}});
define("orion/explorers/navigationUtils",[],function(){function j(i,d){if(!k&&i)i.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,d,b){i&&(i=i.getGridNavHolder(d,!0))&&j(i,b)},generateNavGrid:j,removeNavGrid:function(i,d){if(i)for(var b=0;b<i.length;b++)if(i[b].domNode===d){i.splice(b,1);break}}}});
define("orion/PageUtil",[],function(){var j=/^http[s]?/i;return{hash:function(){var j=window.location.href.split("#")[1];return j?"#"+j:""},matchResourceParameters:function(j){var j=j||window.location.toString(),i={resource:""},d=j.indexOf("#");if(d!==-1&&(j=j.substring(d+1),j.length!==0)){j=j.split(",");i.resource=decodeURIComponent(j[0]);for(d=1;d<j.length;d++){var b=/([^=]*)(=?)(.*)/.exec(j[d]),f=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");f!==""&&f!=="resource"&&(i[f]=b)}}return i},
validateURLScheme:function(k,i){var d=k;if(k.indexOf("://")===-1){var b=document.createElement("a");b.href=k;d=b.href}b=!1;return(b=i?i.some(function(b){return RegExp("^"+b+":","i").test(d)}):j.test(d))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function i(b){var d="",a=navigator.platform.indexOf("Mac")!==-1;b.mod1&&(d+=a?"Cmd+":"Ctrl+");b.mod2&&(d+="Shift+");b.mod3&&(d+="Alt+");b.mod4&&a&&(d+="Ctrl+");if(b.alphaKey)return d+b.alphaKey;if(b.type==="keypress")return d+b.keyCode;for(var e in k.KEY)if(typeof(k.KEY[e]==="number")&&k.KEY[e]===b.keyCode)return d+e;var h;switch(b.keyCode){case 59:h=b.mod2?":":";";break;case 61:h=b.mod2?"+":"=";break;case 188:h=
b.mod2?"<":",";break;case 190:h=b.mod2?">":".";break;case 191:h=b.mod2?"?":"/";break;case 192:h=b.mod2?"~":"`";break;case 219:h=b.mod2?"{":"[";break;case 220:h=b.mod2?"|":"\\";break;case 221:h=b.mod2?"}":"]";break;case 222:h=b.mod2?'"':"'"}return h?d+h:b.keyCode>=112&&b.keyCode<=123?d+"F"+(b.keyCode-111):d+String.fromCharCode(b.keyCode)}function d(b){var d=window.navigator.platform.indexOf("Mac")!==-1;return d&&b.metaKey||!d&&b.ctrlKey}return{getUserKeyString:function(b){for(var d="",b=b.getKeys(),
a=0;a<b.length;a++)a!==0&&(d+=" "),d+=i(b[a]);return d},getUserText:function(b,d,a,e,h,g,c,l,m){var n=!1,c=function(c){return function(l){if(!n){var i=k.node(b),p=i.value;if(i)if(c&&l.keyCode===k.KEY.ESCAPE){if(a)d.style.display="inline";n=!0;i.parentNode.removeChild(i);g&&g()}else if(!(c&&l.keyCode!==k.KEY.ENTER)){if(p.length===0||!m&&p===e){if(a)d.style.display="inline"}else if(h(p),a&&d.parentNode)d.style.display="inline";n=!0;i.parentNode&&i.parentNode.removeChild(i);g&&g()}}}},i=document.createElement("input");
i.id=b;i.value=e||"";d.parentNode.insertBefore(i,d.nextSibling);i.classList.add("userEditBoxPrompt");if(a)d.style.display="none";i.addEventListener("keydown",c(!0),!1);i.addEventListener("blur",c(!1),!1);window.setTimeout(function(){i.focus();if(e){var c=k.node(b),a=l?e.indexOf(l):-1;if(a>0)if(c.createTextRange)c=c.createTextRange(),c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",a),c.select();else if(c.setSelectionRange)c.setSelectionRange(0,a);else{if(c.selectionStart!==void 0)c.selectionStart=
0,c.selectionEnd=a}else c.select()}},0)},openInNewWindow:d,followLink:function(b,f){f&&d(f)?window.open(b):window.location=b},createButton:function(b,d){var a=document.createElement("button");a.className="orionButton commandButton commandMargins";a.addEventListener("click",function(a){d();k.stop(a)},!1);b&&a.appendChild(document.createTextNode(b));return a},createDropdownButton:function(){},isFormElement:function(b){switch(b.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","require,orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(j,k,i,d,b,f,a,e,h,g,c){function l(c){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(c);this._parameterCollector=
null}function m(c,a){this.token=c;this.parameterName=a}function n(c,a,b,e,g){this.name=c;this.type=a;this.label=b;this.value=e;this.lines=g||1}function p(c,a,b){this._storeParameters(c);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=a&&a.clientCollect}l.prototype={_init:function(c){this._selectionService=c.selection;var a=this;k.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(c){for(var a in this._urlBindings)if(this._urlBindings[a]&&
this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var b=this._urlBindings[a].urlBinding.match(c);if(b){var e=this._urlBindings[a],g=e.command,h=e.invocation;if(h&&h.parameters&&g.callback){h.parameters.setValue(b.parameterName,b.parameterValue);var q=this;window.setTimeout(function(){q._invoke(h)},0);break}}}},findCommand:function(c){return this._commandList[c]},runCommand:function(c,a,b,e){a?(c=this._commandList[c])&&(c.visibleWhen?c.visibleWhen(a):1)&&c.callback&&this._invoke(new k.CommandInvocation(b,
a,null,c,this),e):(a=this._urlBindings[c])&&a.command&&a.command.callback&&this._invoke(a.invocation,e)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(c){this._parameterCollector=c},openParameterCollector:function(c,a,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(c,a,b))},confirm:function(c,a,b,e,g,h){var q=!1;if(this._parameterCollector&&!g){var o=this;this._parameterCollector.close();if(this._parameterCollector.open(c,
function(c,g){var h=document.createElement("span");h.classList.add("parameterPrompt");h.textContent=a;c.appendChild(h);h=document.createElement("button");h.addEventListener("click",function(){q=!0;o._parameterCollector.close()},!1);g.appendChild(h);h.appendChild(document.createTextNode(b));h.className="dismissButton";var d=document.createElement("button");d.addEventListener("click",function(){q=!1;o._parameterCollector.close()},!1);g.appendChild(d);d.appendChild(document.createTextNode(e));d.className=
"dismissButton";return h},function(){h(q)}))return}q=window.confirm(a);h(q)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(c,a){return this._collectAndInvoke(c.makeCopy(a),!1)},_collectAndInvoke:function(c,a){if(c)if(this._parameterCollector&&c.parameters&&c.parameters.hasParameters()&&(a||c.parameters.shouldCollectParameters())){var b=!1;c.parameters.updateParameters(c);
if(c.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(c),!b)){var g=new e.Tooltip({node:c.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),b=g.contentContainer();b.classList.add("parameterPopup");var h=window.document.activeElement,d=this._parameterCollector.getFillFunction(c,function(){h&&h.focus();g.destroy()})(b);g.show();window.setTimeout(function(){d.focus();d.select()},0);b=!0}b||c.command.callback.call(c.handler||
window,c)}else c.command.callback.call(c.handler||window,c);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(c){this._collectAndInvoke(c,!0)},showKeyBindings:function(c){function a(c){return function(){k.executeBinding(c)}}var e={},g,h,d=[],q;for(q in this._activeBindings)(h=this._activeBindings[q])&&h.keyBinding&&h.command&&(h.command.name||h.command.tooltip)&&d.push(h);d.sort(function(c,a){return(c.command.name||
c.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(q=0;q<d.length;q++)h=d[q],h.keyBinding.scopeName?(e[h.keyBinding.scopeName]||(e[h.keyBinding.scopeName]=[]),e[h.keyBinding.scopeName].push(h)):(g=b.getUserKeyString(h.keyBinding),c.createItem(g,h.command.name||h.command.tooltip,a(h)));for(var o in e)e[o].length&&e[o].length>0&&(c.createHeader(o),e[o].forEach(function(e){g=b.getUserKeyString(e.keyBinding);c.createItem(g,e.command.name||e.command.tooltip,a(e))}))},addCommand:function(c){this._commandList[c.id]=
c;var a=this._pendingBindings[c.id];if(a){var b=this;a.forEach(function(a){b._addBinding(c,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[c.id]}},addCommandGroup:function(c,a,b,e,g,h,q,o,d){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];g&&(c=this._createEntryForPath(c,g));if(c[a]){if(e)c[a].title=e;if(b)c[a].position=b;if(q)c[a].imageClass=q;if(o)c[a].tooltip=o;if(d)c[a].selectionClass=d;c[a].emptyGroupMessage=h}else c[a]={title:e,
position:b,emptyGroupMessage:h,imageClass:q,tooltip:o,selectionClass:d,children:{}},c.sortedContributions=null},_createEntryForPath:function(c,a){a&&a.split("/").forEach(function(a){if(a.length>1)c[a]||(c[a]={position:0,children:{}}),c=c[a].children});return c},registerSelectionService:function(c,a){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});this._contributionsByScopeId[c].localSelectionService=a},registerCommandContribution:function(c,a,b,e,g,h,q){this._contributionsByScopeId[c]||
(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];e&&(c=this._createEntryForPath(c,e));c[a]={position:b};h&&((b=this._commandList[a])?this._addBinding(b,"key",h,g):this._addPendingBinding(a,"key",h,g));q&&((b=this._commandList[a])?this._addBinding(b,"url",q,g):this._addPendingBinding(a,"url",q,g));c.sortedContributions=null},_addBinding:function(c,a,b,e){if(!c.id)throw Error("No command id: "+c);a==="key"?this._activeBindings[c.id]={command:c,keyBinding:b,bindingOnly:e}:a==="url"&&
(this._urlBindings[c.id]={command:c,urlBinding:b,bindingOnly:e})},_addPendingBinding:function(c,a,b,e){this._pendingBindings[c]=this._pendingBindings[c]||[];this._pendingBindings[c].push({type:a,binding:b,bindingOnly:e})},_checkForTrailingSeparator:function(c,a,b){var e;if(a==="tool"||a==="button")if((e=c.childNodes.length>0?c.childNodes[c.childNodes.length-1]:null)&&e.classList.contains("commandSeparator"))return b?(c.removeChild(e),!1):!0;if(a==="menu"&&(c=f.$$array("li > *",c),c.length>0&&c[c.length-
1].classList.contains("dropdownSeparator")))if(e=c[c.length-1],b)e.parentNode.parentNode.removeChild(e.parentNode);else return!0;return!1},renderCommands:function(c,a,b,e,g,h,q){if(typeof c!=="string")throw"a scope id for rendering must be specified";a=f.node(a);if(!a)throw"no parent";var o=this._contributionsByScopeId[c];if(!b&&o){var b=o.localSelectionService||this._selectionService,d=this;b&&b.getSelections(function(b){d.renderCommands(c,a,b,e,g,h)})}else o&&(this._render(this._contributionsByScopeId[c],
a,b,e,g||"button",h,q),this._checkForTrailingSeparator(a,g,!0))},destroy:function(c){c=f.node(c);if(!c)throw"no parent";for(;c.hasChildNodes();){var a=c.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();this.destroy(a);c.removeChild(a)}},_render:function(c,a,b,g,h,d,q){var o=c.sortedContributions;if(!o){var o=[],l=!1,f;for(f in c)if(Object.prototype.hasOwnProperty.call(c,f)){var m=c[f];if(m&&typeof m.position==="number")m.id=f,o.push(m),l=!0}if(l)o.sort(function(c,
a){return c.position-a.position}),c.sortedContributions=o}var n=0,p=this;o.forEach(function(c){var o,l;if(!c.imageClass)c.imageClass=null;if(c.children&&Object.getOwnPropertyNames(c.children).length>0){o=c.children;var f;if(h==="tool"||h==="button")if(c.title)f=p._createDropdownMenu(a,c.title,null,null,c.imageClass,c.tooltip,c.selectionClass),q&&i.generateNavGrid(q,f.menuButton),window.setTimeout(function(){p._render(c.children,f.menu,b,g,"menu",d,q);p._checkForTrailingSeparator(f.menu,"menu",!0);
if(f.menu.childNodes.length===0)if(c.emptyGroupMessage){if(!f.menuButton.emptyGroupTooltip)f.menuButton.emptyGroupTooltip=new e.Tooltip({node:f.menuButton,text:c.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else q&&i.removeNavGrid(q,f.menuButton),f.menu.parentNode&&f.menu.parentNode.removeChild(f.menu),f.destroyButton&&f.destroyButton.parentNode&&f.destroyButton.parentNode.removeChild(f.destroyButton);else f.menuButton.style.visibility="visible"},0);else{var x;a.childNodes.length>
0&&!p._checkForTrailingSeparator(a,h)&&(x=p.generateSeparatorImage(a));p._render(o,a,b,g,h,d,q);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==x&&(x=p.generateSeparatorImage(a))}else if(c.title){if(x=p._createDropdownMenu(a,c.title,!0,null,null,c.imageClass))p._render(o,x.menu,b,g,"menu",d,q),x.menu.childNodes.length===0&&x.destroyButton&&a.removeChild(x.destroyButton)}else a.childNodes.length>0&&p._generateMenuSeparator(a),p._render(o,a,b,g,h,d,q),p._generateMenuSeparator(a)}else{var m=
p._commandList[c.id];o=m?!0:!1;var C=null,C=null;if(m){l=new k.CommandInvocation(g,b,d,m,p);l.domParent=a;x=o&&(m.visibleWhen?m.visibleWhen(b):!0);if(p._activeBindings[m.id]&&p._activeBindings[m.id].keyBinding)C=p._activeBindings[m.id],C.invocation=x?l:null,C.bindingOnly&&(o=!1);if(p._urlBindings[m.id]&&p._urlBindings[m.id].urlBinding)C=p._urlBindings[m.id],C.invocation=x?l:null,C.bindingOnly&&(o=!1);o=o&&x}if(o)m.choiceCallback?(h==="tool"||h==="button"?(o=a,x=!1,a.nodeName.toLowerCase()==="ul"&&
(o=document.createElement("li"),a.appendChild(o))):(o=a,x=!0),p._createDropdownMenu(o,m.name,x,function(c){m.populateChoicesMenu(c,b,g,d,p)}.bind(m),m.imageClass,m.tooltip||m.title,m.selectionClass)):(l.handler=l.handler||this,l.domParent=a,x=function(){p._invoke(l)},h==="menu"?o=k.createCommandMenuItem(a,m,l,null,x):(o=h+m.id+n,o=k.createCommandItem(a,m,l,o,null,h==="tool",x)),i.generateNavGrid(q,o),l.domNode=o,n++)}})},_createDropdownMenu:function(b,g,h,d,l,m,q){b=f.node(b);if(!b||!f.contains(document.body,
b))return null;var o,x=b;if(h)m=document.createRange(),m.selectNode(b),m=m.createContextualFragment(c),f.processTextNodes(m,{ButtonText:g}),b.appendChild(m),o=b.lastChild,b=o.lastChild,g=b.previousSibling,g.dropdown=new a.Dropdown({dropdown:b,populate:d}),b.dropdown=g.dropdown;else if(b.nodeName.toLowerCase()==="ul"&&(x=document.createElement("li"),b.appendChild(x),o=x),b=null,l&&(b="dropdownButtonWithIcon",m=m||g),m=l?m||g:m,d=k.createDropdownMenu(x,g,d,b,l,!1,q),g=d.menuButton,b=d.menu,m)g.commandTooltip=
new e.Tooltip({node:g,text:m,position:["above","below","right","left"]});return{menuButton:g,menu:b,dropdown:g.dropdown,destroyButton:o}},_generateMenuSeparator:function(c){if(!this._checkForTrailingSeparator(c,"menu")){var a=document.createElement("li");a.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");a.appendChild(b);c.appendChild(a)}},generateSeparatorImage:function(c){var a;a=c.nodeName.toLowerCase()==="ul"?document.createElement("li"):
document.createElement("span");c.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};l.prototype.constructor=l;m.prototype={match:function(c){c=d.matchResourceParameters(c);return typeof c[this.token]!=="undefined"?(this.parameterValue=c[this.token],this):null}};m.prototype.constructor=m;n.prototype={optionsRequested:function(){return this.optionsRequested}};n.prototype.constructor=n;p.prototype={_storeParameters:function(c){this.parameterTable=
null;if(c){var a=this.parameterTable={};c.forEach(function(c){a[c.name]=c})}},updateParameters:function(c){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(c))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(c){return this.parameterTable[c]},valueFor:function(c){return(c=this.parameterTable[c])?c.value:null},setValue:function(c,a){var b=this.parameterTable[c];
if(b)b.value=a},forEach:function(c){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&c(this.parameterTable[a])},makeCopy:function(){var c=[];this.forEach(function(a){a=new n(a.name,a.type,a.label,a.value,a.lines);c.push(a)});var a=new p(c,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};p.prototype.constructor=p;return{CommandRegistry:l,URLBinding:m,ParametersDescription:p,
CommandParameter:n}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,k,i){function d(b,d){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=d}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(b,d,a){typeof b==="string"&&(b=i.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=a;var e=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!e)return!1;this._activeElements.focusNode=e;b=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=j.Close;d.appendChild(b);var h=this;b.addEventListener("click",function(){h.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(e)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){e.focus();e.select&&e.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,d){i.$$array("input",d).forEach(function(a){a.type==="checkbox"?b.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&b.parameters.setValue(a.parameterName,a.value.trim())});i.$$array("textArea",d).forEach(function(a){b.parameters.setValue(a.parameterName,a.value.trim())});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b){return b.parameters?
(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b))):!1},getFillFunction:function(b,d){var a=this;return function(e,h){var g=null,c=function(){d&&d();a.close()},l=function(g){g.keyCode===i.KEY.ENTER&&a._collectAndCall(b,e);if(g.keyCode===i.KEY.ESCAPE||g.keyCode===i.KEY.ENTER)c(),i.stop(g)};b.parameters.forEach(function(a){var b=null;if(a.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+
"parameterCollector"),b.textContent=a.label,e.appendChild(b);var h=a.name+"parameterCollector",d=b||e;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)b=document.createElement("textarea"),b.rows=a.lines,b.type="textarea",b.id=h,d.appendChild(b),l=function(a){a.keyCode===i.KEY.ESCAPE&&(c(),i.stop(a))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=h,d.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=h,
d.appendChild(b),a.value)b.value=a.value;b.classList.add("parameterInput");b.setAttribute("speech","speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=a.name;g||(g=b);b.addEventListener("keydown",l,!1)});var m=h;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),e.appendChild(m));var n=function(c,a){var b=document.createElement("button");a.appendChild(b);c&&b.appendChild(document.createTextNode(c));b.classList.add("dismissButton");
return b};if(b.parameters.hasOptionalParameters())b.parameters.optionsRequested=!1,n(j.More,m).addEventListener("click",function(){b.parameters.optionsRequested=!0;a._collectAndCall(b,e);c()},!1);n(j.Submit,m).addEventListener("click",function(){a._collectAndCall(b,e);c()},!1);m=n(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");m.title=j.Close;m.addEventListener("click",function(){c()},!1);return g}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/regex",[],function(){return{escape:function(j){return j.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(j){return(j=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(j))?{pattern:j[1],flags:j[2]}:null}}});
define("orion/contentTypes",[],function(){function j(b,a){function e(c,a,b,e){var b=a.filename.indexOf(b)>=0,g;g=e.toLowerCase();g=a.extension.indexOf(g)!==-1;if(b||g){if(!(g=!c))b&&(e=e.toLowerCase(),b=c.extension.indexOf(e)!==-1),g=b;if(g)return a}return c}if(typeof b!=="string")return null;for(var h=b&&b.split(".").pop(),g=null,c=0;c<a.length;c++){var d=a[c];e(g,d,b,h)===d&&(g=d)}return g}function k(f){this.serviceRegistry=f;this.map=function(a){function e(c){return c===null||typeof c==="undefined"?
[]:Array.isArray(c)?c:[c]}function h(c){return e(c).map(function(c){return String.prototype.toLowerCase.call(c)})}for(var a=a.getServiceReferences(d).concat(a.getServiceReferences(b)),g={},c=0;c<a.length;c++)for(var l=e(a[c].getProperty("contentTypes")),f=0;f<l.length;f++){var n=l[f];g[n.id]||(g[n.id]={id:n.id,name:n.name,image:n.image,"extends":n["extends"],extension:h(n.extension),filename:e(n.filename)})}return g}(f);f.registerService(i,this)}var i="orion.core.contentTypeRegistry",d="orion.core.contenttype",
b="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],e;for(e in b)Object.prototype.hasOwnProperty.call(b,e)&&a.push(b[e]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(b){return j(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return j(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b=typeof b==="string"?this.getContentType(b):b;
a=typeof a==="string"?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;else for(var e=b,h={};e&&(e=this.getContentType(e["extends"]));){if(e.id===a.id)return!0;if(h[e.id])throw Error("Cycle: "+e.id);h[e.id]=!0}return!1},isSomeExtensionOf:function(b,a){for(var e=0;e<a.length;e++)if(this.isExtensionOf(b,a[e]))return!0;return!1}};return{ContentTypeRegistry:k,getFilenameContentType:j}});
define("orion/URITemplate",[],function(){function j(c){this._text=c}function k(c){return c.replace("%25","%")}function i(c,a){if(a==="U")return encodeURIComponent(c).replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(g,k);if(a==="U+R-,")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function d(c,a,b){for(var e=
[],g=0;g<c.length;g++)typeof c[g]!=="undefined"&&e.push(i(c[g],a));return e.join(b)}function b(c,a,b,e){for(var g=Object.keys(c),h=[],d=0;d<g.length;d++)typeof c[g[d]]!=="undefined"&&h.push(i(g[d],a)+b+i(c[g[d]],a));return h.join(e)}function f(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[c[0]])?c=c.substring(1):this._operator=e.NUL;for(var a=[],b=c.split(","),g=0;g<b.length;g++){var d=b[g].match(h);if(d===null)throw Error("Bad VarSpec: "+c);a.push({name:d[1],
explode:!!d[2],prefix:d[3]?parseInt(d[3],10):-1})}this._varSpecList=a}function a(c){for(var a=[],b=0,e=c.indexOf("{",b);e!==-1;){a.push(new j(c.substring(b,e)));b=c.indexOf("}",e+1);if(b===-1)throw Error("Invalid template: "+c);a.push(new f(c.substring(e+1,b)));b+=1;e=c.indexOf("{",b)}a.push(new j(c.substring(b)));this._templateComponents=a}var e={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]+))?$/,g=/%25[0-9A-F][0-9A-F]/g;j.prototype={expand:function(){return encodeURI(this._text)}};
f.prototype={expand:function(c){for(var a=[],e=0;e<this._varSpecList.length;e++){var g=this._varSpecList[e],h=g.name,f=c[h],j=typeof f;if(j!=="undefined"&&f!==null){var k=a.length===0?this._operator.first:this._operator.sep;if(j==="string")this._operator.named&&(k+=i(h,"U+R"),k+=f.length===0?this._operator.ifemp:"="),g.prefix!==-1&&g.prefix<f.length&&(f=f.substring(0,g.prefix)),k+=i(f,this._operator.allow);else if(Array.isArray(f))g.explode?k+=d(f,this._operator.allow,this._operator.sep):(this._operator.named&&
(k+=i(h,"U+R"),k+=f.length===0?this._operator.ifemp:"="),k+=d(f,this._operator.allow,","));else if(j==="object")g.explode?k+=b(f,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(k+=i(h,"U+R"),k+=Object.keys(f).length===0?this._operator.ifemp:"="),k+=b(f,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+j);a.push(k)}}return a.join("")}};a.prototype={expand:function(c){for(var a=[],b=0;b<this._templateComponents.length;b++)a.push(this._templateComponents[b].expand(c));
return a.join("")}};return a});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,k){function i(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var d={};return{getMessageBundle:function(b){function f(){j(["i18n!"+b],function(e){if(e){var c=b;e._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(e));delete e._expires}a.resolve(e)})}if(d[b])return d[b];var a=new k;d[b]=
a;var e=i(b);if(e)return a.resolve(e),a;try{j([b],f)}catch(h){j(["orion/i18n!"+b],f)}return a},formatMessage:function(b){var d=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(a,b){return d[(b<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(j,k,i,d,b){function f(){return(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function a(a,h){var g=a.getServiceReferences(h||"orion.page.link"),c=i.matchResourceParameters(window.location.href),l={OrionHome:f(),Location:c.resource},m=[];g.forEach(function(c){var a={};c.getPropertyKeys().forEach(function(b){a[b]=c.getProperty(b)});if(a.uriTemplate&&
a.nls&&(a.name||a.nameKey)){var e=new k;b.getMessageBundle(a.nls).then(function(c){var b=(new d(a.uriTemplate)).expand(l),b=i.validateURLScheme(b);a.href=b;a.textContent=a.nameKey?c[a.nameKey]:a.name;e.resolve(a)});m.push(e)}else if(a.uriTemplate&&a.name){var g=(new d(a.uriTemplate)).expand(l),g=i.validateURLScheme(g);a.href=g;a.textContent=a.name;m.push((new k).resolve(a))}});return k.all(m)}return{createPageLinks:function(b,h){return a(b,h).then(function(a){a.sort(function(c,a){var b=c.textContent&&
c.textContent.toLowerCase(),e=a.textContent&&a.textContent.toLowerCase();return b<e?-1:b>e?1:0});return a.map(function(c){var a=c.href,c=c.textContent,b=document.createElement("a");b.href=a;b.target="_self";b.classList.add("targetSelector");b.textContent=c;return b})})},getPageLinksInfo:a,getOrionHome:f}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(j,k,i,d,b,f,a,e,h){var g={},c=h.getOrionHome();g._cloneItemWithoutChildren=function n(c){if(c===null||typeof c!=="object")return c;var a=c.constructor(),b;for(b in c)b!=="children"&&b!=="Children"&&(a[b]=n(c[b]));return a};g._getOpenWithNavCommandExtensions=function(c){function a(c,b){for(var e=c.getServiceReferences("orion.navigate.openWith"),
g=[],q=0;q<e.length;q++){var h=e[q];h.getProperty("editor")===b.id&&(h=h.getProperty("contentType"),h instanceof Array?g=g.concat(h):h!==null&&typeof h!=="undefined"&&g.push(h))}return g}for(var b=function(){for(var a=c.getServiceReferences("orion.edit.editor"),b=[],e=0;e<a.length;e++){var g=a[e],q=g.getProperty("id");b.push({id:q,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||
[]})}return b}(),e=function(c){for(c=c.getServiceReferences("orion.navigate.openWith.default");0<c.length;)return{editor:c[0].getProperty("editor")};return null}(c),g=[],h=0;h<b.length;h++){var d=b[h],l=e&&e.editor===d.id,q=a(c,d);q.length&&g.push({properties:{name:d.name||d.id,nameKey:d.nameKey,id:"eclipse.openWithCommand."+d.id,tooltip:d.name,tooltipKey:d.nameKey,contentType:q,uriTemplate:d.uriTemplate,nls:d.nls,forceSingleItem:!0,isEditor:l?"default":"editor",validationProperties:d.validationProperties},
service:{}})}return g};g._makeValidator=function(a,e,g,h){function d(c,a,b,e){var g=b.match,h;if(a.indexOf("[")===0){if(a.indexOf("]")<0)return!1;if(!Array.isArray(c))return!1;h=a.replace("[","").replace("]","");for(a=0;a<c.length;a++)if(d(c[a],h,b,e))return!0}else if(a.indexOf("|")>=0)return h=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),d(c,h,b,e)?!0:d(c,a,b,e);else if(a.indexOf(":")>=0)return h=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),c[h]?d(c[h],a,b,e):!1;
else{a:{h=!1;var l;if(a.charAt(0)==="!")b=typeof c[a.substring(1)]==="undefined";else if(typeof c[a]!=="undefined"){if(typeof g==="undefined")l=c[a],h=!0;else if(typeof g==="string"){if(!typeof(c[a]==="string")){b=!1;break a}if(b.variableName){if(g=RegExp(g).exec(c[a]))h=g[0],l=b.variableMatchPosition==="before"?c[a].substring(0,g.index):b.variableMatchPosition==="after"?c[a].substring(g.index+h.length):b.variableMatchPosition==="only"?h:c[a],h=!0}else{b=RegExp(g).test(c[a]);break a}}else c[a]===
g&&(l=c[a],h=!0);if(h&&b.variableName&&(e[b.variableName]=l,e.itemCached=c,b.replacements))for(c=0;c<b.replacements.length;c++)a=!1,b.replacements[c].pattern?e[b.variableName]=e[b.variableName].replace(RegExp(b.replacements[c].pattern),b.replacements[c].replacement||""):a=!0,a&&window.console.log("Invalid replacements specified in validation property.  "+b.replacements[c]);b=h}else b=!1}return b}}return{info:a,validationFunction:function(c){typeof h==="function"&&(c=h.call(this,c));if(c){if(Array.isArray(c)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&c.length!==1)return!1;if(c.length<1)return!1}else c=[c];for(var e=0;e<c.length;e++){var l;a:{var q=c[e],o=g;if(this.info.validationProperties)for(l=0;l<this.info.validationProperties.length;l++){var f=this.info.validationProperties[l];if(typeof f.source!=="undefined"){if(!d(q,f.source,f,this)){l=!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");l=!1;break a}}if(this.info.contentType&&o){f=!1;if(q=b.getFilenameContentType(q.Name,
o))for(l=0;l<this.info.contentType.length;l++)if(q.id===this.info.contentType[l]){f=!0;break}l=f}else l=!0}if(!l)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b[e]=a[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var g=this.info.validationProperties[e];g.source&&g.variableName&&(this.itemCached===a&&this[g.variableName]||
d(a,g.source,g,this),a[g.variableName]?window.console.log("Variable name "+g.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[g.variableName]=this[g.variableName])}b.OrionHome=c;return(new f(this.info.uriTemplate)).expand(b)}return null}}};g._createCommandOptions=function(c,b,e,h,d,l){function f(a,o){var x=g._makeValidator(c,e,h,l);a.visibleWhen=x.validationFunction.bind(x);if(d)if(x.generatesURI.bind(x)())a.hrefCallback=function(c){c=
Array.isArray(c.items)?c.items[0]:c.items;return x.getURI.bind(x)(c)};else{var i=c;a.callback=function(c){var o;if(i.forceSingleItem)c=Array.isArray(c.items)?c.items[0]:c.items,o=g._cloneItemWithoutChildren(c);else if(Array.isArray(c.items)){o=[];for(var h=0;h<c.items.length;h++)o.push(g._cloneItemWithoutChildren(c.items[h]))}else o=g._cloneItemWithoutChildren(c.items);if(e)var d=e.getService("orion.page.progress");b.run?d?d.progress(b.run(o),"Running command: "+a.name):b.run(o):e&&(d?d.progress(e.getService(b).run(o),
"Running command: "+a.name):e.getService(b).run(o))}}o.resolve(a)}var i=new k;c.nls?a.getMessageBundle(c.nls).then(function(a){f({name:c.nameKey?a[c.nameKey]:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltipKey?a[c.tooltipKey]:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},i)}):f({name:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},i);return i};g.getOpenWithCommands=function(c){var a=[],b;for(b in c._commandList){var e=c._commandList[b];
e.isEditor&&a.push(e)}return a};var l;g.createAndPlaceFileCommandsExtension=function(c,a,b,e,h,d){var l=!!d;return g.createFileCommands(c,null,d?"all":void 0,l).then(function(c){a._addedOpenWithCommands=l;var g=!1,o=!1;c.forEach(function(c){a.addCommand(c);h&&!g&&(g=!0,a.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,null,h));h&&!o&&(o=!0,a.addCommandGroup(b,"eclipse.openWith",1E3,"Open With",h+"/eclipse.fileCommandExtensions"));this.isEditor?a.registerCommandContribution(b,c.id,e+this.index,
h?h+"/eclipse.fileCommandExtensions/eclipse.openWith":null):a.registerCommandContribution(b,c.id,e+this.index,h?h+"/eclipse.fileCommandExtensions":null)});return{}})};g.createFileCommands=function(c,a,b,e){var b=b===void 0?"global":b,e=e===void 0?!0:e,h=c.getServiceReferences("orion.navigate.command"),d=[];if(b==="all"||b==="global")for(var f=0;f<h.length;f++)if(h[f].getProperty("id")!=="orion.navigateFromMetadata"){for(var j=c.getService(h[f]),q={},o=h[f].getPropertyKeys(),x=0;x<o.length;x++)q[o[x]]=
h[f].getProperty(o[x]);(b==="all"||q.forceSingleItem&&q.showGlobally)&&d.push({properties:q,service:j})}return k.when(function(){var b=c.getService("orion.core.contentTypeRegistry")||a;return l||k.when(b.getContentTypes(),function(c){return l=c})}(),function(){d=e?d.concat(g._getOpenWithNavCommandExtensions(c,l)):d;var a=d.map(function(a){var b=a.properties;return g._createCommandOptions(b,a.service,c,l,!0).then(function(c){c=new i.Command(c);if(b.isEditor)c.isEditor=b.isEditor;return c})});return k.all(a,
function(c){return{_error:c}}).then(function(c){return c})})};g.createOpenWithCommands=function(c,a,b){return b&&b._addedOpenWithCommands?(new k).resolve(g.getOpenWithCommands(b)):g.createFileCommands(c,a,"none",!0)};return g});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var b=k.node(d.container);if(!b)throw"no parent container";this._container=b;b.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents){d=document.createElement("a");var b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,b):d.href=j.toUrl("edit/edit.html")+"#"+b}else d=document.createElement("span");k.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var b=
document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(d));return b},addSegmentHref:function(d,b){this._makeHref?this._makeHref(d,b.Location,b):d.href=j.toUrl("edit/edit.html")+"#"+b.ChildrenLocation},buildSegments:function(d,b){if(this._resource.Parents){var f=this._resource.Parents.slice(0),a,e;f&&(f=f.slice(0),b==="reverse"&&(f=f.reverse().slice(0)),f.forEach(function(b){d?(e=d,d=null):e=b.Name;a=this.buildSegment(e);this.path+=b.Name;this.addSegmentHref(a,
b);a.include=!1;this.segments.push(a)}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",
this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(d){this.crumbs.appendChild(d)},addTitle:function(d,b){var f=b||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(f)),d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,
b){d=document.createElement("span");b?d.appendChild(document.createTextNode(b)):d.appendChild(document.createTextNode(this._resource.Name));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)},firstSegment:function(d){if(d)this.append(d),this._resource&&this._resource.Parents?(d.classList.add("breadcrumb"),this.addDivider()):(d.href="",d.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){d.include===
!0&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=document.getElementById("location");d.style.width="auto";this.MAX_LENGTH=d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility=
"hidden";var d=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;if(b)this.addTitle(d,b);else if(this.finalSegment(d,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"reverse"),this.measureSegments(),this.firstSegment(d)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;b?this.addTitle(d,b):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),
this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(j,k,i){function d(b){k.attach(this);this._init(b)}d.prototype={_init:function(b){this._tracking=null;this._animationDelay=501;this.$node=i.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=i.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=i.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=
b.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(b.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof b.closeByDefault!=="undefined")this._closeByDefault=b.closeByDefault;this._initializeFromStoredSettings();this._closed?
(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(b){this.addEventListener("resize",function(d){b(d.node)})},_initializeFromStoredSettings:function(){var b=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof b==="string"?b==="closed":this._closeByDefault;if(this._vertical)if(b=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(b,10);else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(b=localStorage.getItem(this._prefix+
"/xPosition"))this._splitLeft=parseInt(b,10);else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var b=i.bounds(this.$node),d=i.bounds(this.$node.parentNode);return this.vertical?b.top-d.top:b.left-d.left},_adjustToSplitPosition:function(b){var d=i.bounds(this.$node),a=i.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(b||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",
this._splitTop);b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-a.top);this.$sideNode.style.height=b+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=d.width;if(b||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-a.left);this.$sideNode.style.width=b+"px";this.$sideNode.style.display=
"block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b,d,a){var b=b||0,e=i.bounds(this.$node.parentNode),h=i.bounds(this.$node);if(this._vertical){if(a===void 0)a=h.top,this.$node.parentNode.style.position==="relative"&&(a-=e.top);a+=h.height;this.$mainNode.style.top=a+"px"}else{if(d===void 0)d=h.left,this.$node.parentNode.style.position==="relative"&&(d-=e.left);d+=h.width;this.$mainNode.style.left=d+"px"}var g=this;window.setTimeout(function(){g._notifyResizeListeners(g.$mainNode);
g._notifyResizeListeners(g.$sideNode)},b)},_notifyResizeListeners:function(b){this.dispatchEvent({type:"resize",node:b})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(b,d){b||this._addAnimation();var a=this._splitTop,e=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")a=e=this._initialSplit}else this._closed=!0,a=e=0;this._vertical?(this.$sideNode.style.height=
a+"px",this.$node.style.top=a+"px"):(this.$sideNode.style.width=e+"px",this.$node.style.left=e+"px");this._resize(this._animationDelay,e,a);b||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var h=this;window.setTimeout(function(){h._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var b=this;window.setTimeout(function(){b.$sideNode.classList.remove(b._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");
b.$mainNode.classList.remove(b._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");b.$node.classList.remove(b._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":
"splitLayoutAnimation")},_mouseDown:function(b){if(b.target===this._thumb)return i.stop(b),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),i.stop(b)},_mouseMove:function(b){if(this._tracking){var d=i.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=b.clientY;if(this._splitTop<
d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-d.top);this.$node.style.top=a+"px"}else{this._splitLeft=b.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>d.left+d.width-5)this._splitLeft=d.left+d.width-5;a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-d.left);this.$node.style.left=
a+"px"}this._adjustToSplitPosition(!0);i.stop(b)}},_mouseUp:function(b){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),i.stop(b)}};d.prototype.constructor=d;return{Splitter:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(j,i){this._preferences=j;this._themeData=i;var d=i.getThemeStorageInfo(),b=j.listenForChangedSettings(d.storage,2,function(d){d.key===b&&this.apply()}.bind(this))}j.prototype={_initialize:function(j,i,d){var b=d.get(j.styleset);b||(b=i.getStyles(),d.put(j.styleset,JSON.stringify(b)));(i=d.get("selected"))&&(i=JSON.parse(i));if(!i||i[j.selectedKey]===void 0)i=i||{},i[j.selectedKey]=j.defaultTheme,d.put("selected",JSON.stringify(i))},
apply:function(){this.setTheme()},getTheme:function(j){var i=this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,i,b);var f=JSON.parse(b.get("selected")),b=JSON.parse(b.get(d.styleset)),a;if(b)for(var e=0;e<b.length;e++)if(b[e].name===f[d.selectedKey]){a=b[e];break}j({style:a,styles:b})}.bind(this))},setTheme:function(j,i){var d=this._themeData,b=d.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(f){this._initialize(b,
d,f);var a=JSON.parse(f.get("selected"));j||(j=a[b.selectedKey]);a[b.selectedKey]=j;f.put("selected",JSON.stringify(a));i?f.put(b.styleset,JSON.stringify(i)):i=JSON.parse(f.get(b.styleset));for(f=0;f<i.length;f++)if(i[f].name===a[b.selectedKey]){d.processSettings(i[f]);break}}.bind(this))},setFontSize:function(j){var i=this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,i,b);var f=JSON.parse(b.get("selected")),a=JSON.parse(b.get(d.styleset)),
e;if(a)for(var h=0;h<a.length;h++)a[h].fontSize=j,a[h].name===f[d.selectedKey]&&(e=a[h]);b.put(d.styleset,JSON.stringify(a));i.processSettings(e)}.bind(this))}};return{ThemePreferences:j}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",
keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",
localSettingsTooltip:"Toggle whether this setting is shown in local editor settings drop down.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(k){var i=j.prototype,d;for(d in i)i.hasOwnProperty(d)&&(k[d]=i[d])};j.prototype={addEventListener:function(j,i,d){if(!this._eventTypes)this._eventTypes={};var b=this._eventTypes[j];b||(b=this._eventTypes[j]={level:0,listeners:[]});b.listeners.push({listener:i,useCapture:d})},dispatchEvent:function(j){var i=j.type;this._dispatchEvent("pre"+i,j);this._dispatchEvent(i,j);this._dispatchEvent("post"+i,j)},_dispatchEvent:function(j,
i){var d=this._eventTypes?this._eventTypes[j]:null;if(d){var b=d.listeners;try{if(d.level++,b)for(var f=0,a=b.length;f<a;f++)if(b[f]){var e=b[f].listener;typeof e==="function"?e.call(this,i):e.handleEvent&&typeof e.handleEvent==="function"&&e.handleEvent(i)}}finally{if(d.level--,d.compact&&d.level===0){for(f=b.length-1;f>=0;f--)b[f]||b.splice(f,1);b.length===0&&delete this._eventTypes[j];d.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
i,d){if(this._eventTypes){var b=this._eventTypes[j];if(b){for(var f=b.listeners,a=0,e=f.length;a<e;a++){var h=f[a];if(h&&h.listener===i&&h.useCapture===d){b.level!==0?(f[a]=null,b.compact=!0):f.splice(a,1);break}}f.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,k,i){function d(b){b=b||{};this._document=b.document||document}var b={};d.getTheme=function(f){var f=f||"default",a=b[f];a||(a=b[f]=new d);return a};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,a){var e=this,h=e._themeClass;e._themeClass=b;this._load(b,a,function(){e.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:e.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,a){function e(a,c,e){c&&(h.push("."+b+" ."+a+" {"),h.push("\t"+(e?"background-color":"color")+": "+c+";"),h.push("}"))}var h=[];h.push("");h.push("."+b+" {");a.fontFamily&&h.push("\tfont-family: "+a.fontFamily+";");a.fontSize&&h.push("\tfont-size: "+a.fontSize+";");a.fontSize&&h.push("\tcolor: "+a.text+";");h.push("}");h.push("."+b+".textview {");a.background&&h.push("\tbackground-color: "+a.background+";");h.push("}");e("ruler.annotations",a.annotationRuler,!0);e("ruler.lines",
a.annotationRuler,!0);e("ruler.folding",a.annotationRuler,!0);e("ruler.overview",a.overviewRuler,!0);e("rulerLines",a.lineNumber,!1);e("rulerLines.even",a.lineNumberEven,!1);e("rulerLines.odd",a.lineNumberOdd,!1);e("annotationLine.currentLine",a.currentLine,!0);e("entity-name-tag",a.keyword,!1);e("entity-other-attribute-name",a.attribute,!1);e("string-quoted",a.string,!1);e("line_caret",a.currentLine,!0);e("token_keyword",a.keyword,!1);e("token_string",a.string,!1);e("token_singleline_comment",a.comment,
!1);e("token_multiline_comment",a.comment,!1);e("token_doc_comment",a.comment,!1);e("token_doc_html_markup",a.comment,!1);return h.join("\n")},_createStyle:function(b,a,e,h){var g=this._document,b="orion-theme-"+b,c=g.getElementById(b);if(c){if(h||c.firstChild.data===a)return;c.removeChild(c.firstChild);c.appendChild(g.createTextNode(a))}else h?(c=i.createElement(g,"link"),c.rel="stylesheet",c.type="text/css",c.href=a,c.addEventListener("load",function(){e()})):(c=i.createElement(g,"style"),c.appendChild(g.createTextNode(a))),
c.id=b,(g.getElementsByTagName("head")[0]||g.documentElement).appendChild(c);h||e()},_load:function(b,a,e){if(b)if(typeof a==="string")this._createStyle(b,a,e);else if(a=a.href,a.substring(a.length-4)!==".css"&&(a+=".css"),/^\//.test(a)||/[a-zA-Z0-9]+:\/\//i.test(a)||!j.toUrl)this._createStyle(b,a,e,!0);else{var h=this;j(["text!"+a],function(a){h._createStyle(b,a,e,!1)})}else e()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function j(j){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=j;this.classString="."+j+"{ "}j.prototype.className=null;j.prototype.classString=void 0;j.prototype.style=void 0;j.prototype.closeString=" }\n";j.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:j}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(j){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var i="",d=[],b=new j.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";d.push(b);b=new j.ThemeClass("topRowBanner");b.style.margin="0";b.style.border="0";b.style.backgroundColor=this.navbar;b.style.height="16px";b.style.padding="10px";b.style.paddingLeft="6px";b.style.paddingRight="2px";d.push(b);b=new j.ThemeClass("a");b.style.textDecoration="none";b.style.color=this.content;d.push(b);b=new j.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;
d.push(b);b=new j.ThemeClass("primaryNav");b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";d.push(b);b=new j.ThemeClass("primaryNav a");b.style.fontSize="8pt";b.style.color=this.navtext;b.style.marginRight="6px";b.style.marginLeft="6px";b.style.verticalAlign="baseline";b.style.textDecoration="none";d.push(b);b=new j.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";
b.style.fontWeight="normal";d.push(b);for(var f in d)i+=d[f].toString();return i};k.prototype.writeLocationStyle=function(){var i="",d=[],b=new j.ThemeClass("titleArea");b.style.margin="0";b.style.paddingTop="5px";b.style.border="0";b.style.background=this.location;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";b.style.borderBottom="1px solid "+this.location;b.style.minHeight="20px";d.push(b);b=new j.ThemeClass("breadcrumb");
b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";d.push(b);b=new j.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";d.push(b);b=new j.ThemeClass("breadcrumbSeparator");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2";b.style.fontWeight="bold";d.push(b);b=new j.ThemeClass("currentLocation");b.style.fontWeight="bold";b.style.fontSize=
"8pt";b.style.color="#f1f1f2";b.style.textDecoration="none";b.style.textWrap="normal";b.style.lineHeight="10pt";d.push(b);b=new j.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";d.push(b);b=new j.ThemeClass("navlinkonpage");b.style.color=this.content;d.push(b);b=new j.ThemeClass("progressPane_running");b.style.background="url(../images/progress_running_dark.gif) no-repeat center";
b.style.width="16px";b.style.height="16px";d.push(b);for(var f in d)i+=d[f].toString();return i};k.prototype.writeButtonStyle=function(){var i="",d=[],b=new j.ThemeClass("commandButton");b.style.color="#666";b.style.border="1px solid #dedede";b.style.backgroundColor="#ddd";b.style.textAlign="center";b.style.verticalAlign="baseline";b.style.cursor="pointer";b.style.display="inline-block";b.style.padding="4px 6px";b.style.borderRadius="3px";b.style.lineHeight="12px";b.style.fontSize="8pt";b.style.userSelect=
"none";d.push(b);b=new j.ThemeClass("commandButton:over");b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";d.push(b);b=new j.ThemeClass("commandMenu");b.style.color="#222";b.style.display="inline-block";b.style.verticalAlign="baseline";b.style.margin="0";b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.border="1px solid #dedede";b.style.backgroundColor="#efefef";b.style.cursor="pointer";b.style.borderRadius="1px";d.push(b);b=new j.ThemeClass("commandMenuItem");b.style.border=
"0";b.style.padding="0";b.style.margin="0";d.push(b);for(var f in d)i+=d[f].toString();return i};k.prototype.writeMainStyle=function(){var i="",d=[],b=new j.ThemeClass("searchbox");b.style.backgroundImage="url(../images/core_sprites.png)";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="4px -297px";b.style.width="12px";b.style.height="12px";b.style.backgroundColor=this.search;b.style.border="1px solid "+this.search;b.style.fontSize="11px";b.style.width="15em";b.style.height="16px";
b.style.borderRadius="10px";b.style.color="#999";b.style.padding="0";b.style.paddingLeft="20px";b.style.marginLeft="5px";b.style.marginTop="6px !important";b.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(b);b=new j.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline="none";d.push(b);b=new j.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";d.push(b);b=new j.ThemeClass("navbar-item-selected");
b.style.background=this.selection;b.style.color=this.content;d.push(b);b=new j.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";b.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";d.push(b);b=new j.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;d.push(b);b=new j.ThemeClass("mainToolbar");
b.style.background=this.toolpanel;b.style.height="32px";b.style.borderBottom="1px solid #ebebeb";b.style.paddingTop="3px";d.push(b);for(var f in d)i+=d[f].toString();return i};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(i){i.navbar.value?(this.navbar=i.navbar.value,this.button=i.button.value,this.location=i.location.value,this.selection=
i.selection.value,this.sidepanel=i.sidepanel.value,this.mainpanel=i.mainpanel.value,this.navtext=i.navtext.value,this.search=i.search.value,this.content=i.content.value,this.toolpanel=i.toolpanel.value):(this.navbar=i.navbar,this.button=i.button,this.location=i.location,this.selection=i.selection,this.sidepanel=i.sidepanel,this.mainpanel=i.mainpanel,this.navtext=i.navtext,this.search=i.search,this.content=i.content,this.toolpanel=i.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+
this.writeMainStyle()+this.writeButtonStyle()};return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(j,k,i){function d(){}function b(){this.styles=[];var a=new d;a.name="Orion";a.navbar="#404648";a.button="#EFEFEF";a.location="#efefef";a.selection="FEC";a.sidepanel="#FBFBFB";a.mainpanel="white";a.toolpanel="white";a.navtext="#bfbfbf";a.content="#3087B3";a.search="#444";a.breadcrumb="#3087B3";a.separator="#333";this.styles.push(a);
a=new d;a.name="Green Zone";a.navbar="seagreen";a.button="lavender";a.location="darkseagreen";a.selection="moccasin";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="darkgreen";a.search="darkgreen";a.breadcrumb="#3087B3";a.separator="seagreen";this.styles.push(a);a=new d;a.name="Pretty In Pink";a.navbar="plum";a.button="lavender";a.location="pink";a.selection="lavender";a.sidepanel="seashell";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";
a.content="mediumorchid";a.search="violet";a.breadcrumb="#3087B3";a.separator="plum";this.styles.push(a);a=new d;a.name="Blue Monday";a.navbar="cornflowerblue";a.button="lavender";a.location="skyblue";a.selection="lavender";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="royalblue";a.search="royalblue";a.breadcrumb="#3087B3";a.separator="cornflowerblue";this.styles.push(a);a=new d;a.name="Vanilla Skies";a.navbar="sandybrown";a.button="lemmonchiffon";
a.location="cornsilk";a.selection="lemonchiffon";a.sidepanel="white";a.mainpanel="white";a.toolpanel="white";a.navtext="lemonchiffon";a.content="chocolate";a.search="moccasin";a.breadcrumb="#3087B3";a.separator="sandybrown";this.styles.push(a);a=new d;a.name="Beetlejuice";a.navbar="indigo";a.button="slateblue";a.location="darkslateblue";a.selection="silver";a.sidepanel="lavender";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumslateblue";a.search="#444";a.breadcrumb="#3087B3";
a.separator="indigo";this.styles.push(a);a=new d;a.name="Red";a.navbar="#CD2127";a.button="#777777";a.location="#D85F56";a.selection="lightcoral";a.sidepanel="#EFDAB2";a.mainpanel="#FDFADD";a.toolpanel="#FDFADD";a.navtext="#FBFBFB";a.content="darkred";a.search="#D85F56";a.breadcrumb="darkred";a.separator="#CD2127";this.styles.push(a)}function f(){return this.styles}d.prototype.name="Orion";d.prototype.navbar="#404648";d.prototype.button="#EFEFEF";d.prototype.location="#333";d.prototype.breadcrumb=
"#3087B3";d.prototype.separator="#333";d.prototype.selection="FEC";d.prototype.sidepanel="#FBFBFB";d.prototype.mainpanel="white";d.prototype.toolpanel="white";d.prototype.navtext="#bfbfbf";d.prototype.content="#3087B3";d.prototype.search="#444";b.prototype.styles=[];b.prototype.getStyles=f;b.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};b.prototype.getViewData=function(){var a={top:10,left:10,width:350,height:350};
a.shapes=[{type:"RECTANGLE",name:j["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:j["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:j["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:j["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:j["Selection Bar"],
x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:j.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:j["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:j.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:j.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",
order:9},{type:"TEXT",name:j.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:j["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:j.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:j["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:j["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:j["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],x1:20,y1:100,x2:140,
y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:j["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:j["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var b=0;b<3;b++)a.shapes.push({type:"TEXT",name:j.Content,label:"org.eclipse.orion.content",x:170,y:127+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TEXT",name:j.Content,label:"Item",x:25,y:115+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+b*20,x2:165,y2:124+b*20,x3:160,y3:127+b*20,family:"navbar",fill:"#333"});a.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return a};b.prototype.processSettings=function(a){var b=new i.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(a))};return{ThemeData:b,getStyles:f}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",
test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:","Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination",
"Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(j){function k(i,d,b){this.elements=b;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);d===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),j.addAutoDismiss([this.container],this.destroy.bind(this))):i.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(i){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='<span class="workingSpan"><img src="'+i.image+'" id="'+i.label+'ImageNode" alt="'+i.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+i.label+'LabelNode" >'+i.label+"</span></span>";d.onmouseover=function(){document.getElementById(i.label+"ImageNode").src=i.secondaryImage;document.getElementById(i.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};
d.onmouseout=function(){document.getElementById(i.label+"ImageNode").src=i.image;document.getElementById(i.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var b=this;d.onclick=function(){b.showMedia(i)};this.elementNode.appendChild(d)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(i){this.clearElements();this.addElement(i);var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
i.media+'" alt="'+i.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);i=document.getElementById(i.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=i.parentNode;i.className="chosenCircle"};k.prototype.createSwitch=function(i){var d;d=i?i.label+"switch":"indexSwitch";var b=document.createElement("span");b.className="workingSpan";b.innerHTML='<div class="circle" id ="'+d+'"></div>';var f=this;b.onclick=
i?function(){f.showMedia(i)}:function(){f.initialize();f.chosenSwitch.firstChild.className="circle";f.chosenSwitch=b;f.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(b);return this.radioButtons[this.radioButtons.length]=b};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(j,k,i,d){function b(){}b.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var b=document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var a=document.createRange();a.selectNode(b);a=a.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(a);this.$frame=b.lastChild;this.title&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var e=this;this.$close.addEventListener("click",function(){e.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);
a=document.createRange();a.selectNode(this.$parent);b=a.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE?e.hide():a.keyCode===i.KEY.ENTER&&typeof e._defaultCallback==="function"&&e._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);
this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(a){var e=d.createButton(a.text,a.callback);if(a.id)e.id=a.id,b["$"+e.id]=e;if(a.isDefault)b._defaultCallback=a.callback,b._defaultButton=e;b.$buttonContainer.appendChild(e)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(c){b.$lastFocusedElement=c.target},!0);this._modalListener=function(c){var a=!i.contains(b.$frame,
c.target);if(a)for(var e=0;e<b.$$modalExclusions.length;e++)if(i.contains(b.$$modalExclusions[e],c.target)){a=!1;break}a&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),i.stop(c))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var a=this.$frameParent.childNodes,e=!1;this._addedBackdrop=[];for(var h=0;h<a.length;h++){for(var g=0;g<this.$$modalExclusions.length;g++)if(i.contains(this.$$modalExclusions[g],
a[h])){e=!0;break}!e&&a[h]!==b.$frame&&a[h].classList&&!a[h].classList.contains("tooltipContainer")&&(g=a[h],g.classList.contains("modalBackdrop")||(g.classList.add("modalBackdrop"),this._addedBackdrop.push(g)))}(a=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&a.addEventListener("keydown",function(c){if(c.keyCode===i.KEY.TAB){var a=b._getFirstFocusField();a&&a!==c.target&&a.focus();i.stop(c)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},
_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var e=b.childNodes[a];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var b=this;this.keepAlive||
window.setTimeout(function(){b.destroy()},0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var a=i.bounds(this.$frame),e=i.bounds(document.documentElement),h;b?(h=i.bounds(b),b=h.top+h.height+4,h=h.left+4,b+a.height>e.height&&(b=Math.max(0,e.height-a.height-4)),h+a.width>e.width&&(h=Math.max(0,e.width-a.width-4))):(h=Math.max(0,(e.width-a.width)/2),b=Math.max(0,(e.height-a.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=
h+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return i.firstTabbable(this.$parent)||this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",
this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};b.prototype.constructor=b;return{Dialog:b}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(j,k,i,d,b){function f(a){this._displaySignOut=!0;this._init(a)}f.prototype={_init:function(a){this._dropdownNode=i.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;if(a.signOut!==void 0)this._displaySignOut=a.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(a){var b=0,h;for(h in a)a.hasOwnProperty(h)&&b++;return b},_makeMenuItem:function(a,
b){var h=document.createElement("span");h.role="menuitem";h.tabIndex=0;var g=document.createTextNode(a);h.appendChild(g);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.addEventListener("click",b,!1);h.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&b()},!1);return h},_renderAuthenticatedService:function(a){var b=this,h=this.authenticatedServices[a].authService;
if(h&&h.logout&&this._displaySignOut){var g=document.createElement("li"),c=this._makeMenuItem(j["Sign Out"],function(){h.logout().then(function(){b.addUserItem(a,h,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;c>=0;c--){var g=localStorage.key(c);g&&g.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(g)}h.getAuthForm(window.location.href).then(function(c){window.location=c})})});g.appendChild(c);this._dropdownNode.appendChild(g)}},
renderServices:function(){function a(c){h[c]||(h[c]=b.createDocumentFragment());return h[c]}var b=document,h=[],g=this._serviceRegistry;d.getPageLinksInfo(g,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&i.empty(this._dropdownNode);c.forEach(function(c){var g=a(typeof c.category==="number"?c.category:1),h=b.createElement("li"),d=b.createElement("a");d.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):
d.classList.add("dropdownMenuItem");d.href=c.href;d.textContent=c.textContent;h.appendChild(d);g.appendChild(h);d.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&d.click()},!1)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),d=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");
c.appendChild(d);a(0).appendChild(c)}if(c=g.getServiceReferences("orion.page.getstarted")[0])d=c.getProperty("data"),c=document.createElement("li"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)),c.appendChild(d),a(0).appendChild(c);var f=this;h.sort(function(c,a){return c-a}).forEach(function(c,a){if(a<h.length-1&&!this._noSeparator){var b=document.createElement("li");b.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");
b.appendChild(e);c.appendChild(b)}f._dropdownNode.appendChild(c)}.bind(this));if(this.isSingleService())for(var n in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(n)&&this._renderAuthenticatedService(n,0)}.bind(this))},getStartedDialog:function(a){new b(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,d,g){g?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,
label:d,data:g}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:d,pending:this.unauthenticatedServices[a].pending}:{authService:b,label:d});this.renderServices()}};f.prototype.constructor=f;return{UserMenu:f}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,k,i,d,b,f){function a(a,b,c){var e="";c&&(e="^");if(e=i.parse("/"+e+a.searchStr+"/"))c=e.pattern,e=e.flags,e.indexOf("i")===-1&&!b.caseSensitive&&(e+="i"),a.regExp={pattern:c,flags:e},a.wildCard=!0}var e={ALL_FILE_TYPE:"*.*"};e.doSearch=function(a,b,c,d){if(a){var f=!0;c==="*"&&(c="");c===""&&(f=d&&d.type!==e.ALL_FILE_TYPE);if(f){c!==""&&e.addRecentSearch(b,
c,d?d.regEx:!1);var a=a.createSearchParams(c,!1,!1,d),n=e.generateSearchHref(a);e.getOpenSearchPref(b,function(c){c?window.open(n):window.location=n})}}else window.alert(j["Can't search: no search service is available"])};e.generateSearchHelper=function(b,g){var c=b.keyword,d=c,f={};b.fileType&&b.fileType!==e.ALL_FILE_TYPE&&c===""&&(d="*."+b.fileType);if(b.regEx)f.searchStr=c,a(f,b,g);else{var n=c.indexOf("*")>-1,i=c.indexOf("?")>-1;n&&(c=c.split("*").join(".*"));i&&(c=c.split("?").join("."));!n&&
!i&&!b.nameSearch?(f.searchStr=b.caseSensitive?c.split("\\").join(""):c.split("\\").join("").toLowerCase(),f.wildCard=!1):(f.searchStr=b.caseSensitive?c:c.toLowerCase(),a(f,b,g),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:b,inFileQuery:f,displayedSearchTerm:d}};e.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};e.copySearchParams=function(a,b){var c={},e;for(e in a)if(a[e]!==void 0&&a[e]!==null&&(b||e!=="replace"))c[e]=a[e];return c};e.generateSearchHref=function(a){var b=k.toUrl("search/search.html"),a=e.copySearchParams(a,!0),c=a.resource;a.resource=void 0;return typeof a.keyword!=="undefined"?(new f(b+"#{,resource,params*}")).expand({resource:c,params:a}):
(new f(b+"#{,resource}")).expand({resource:c})};e.generateFindURLBinding=function(a,b,c,e,d){a={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof e==="string"?e:void 0,atLine:typeof c==="number"?c:void 0};return d?a:","+(new f("{,params*}")).expand({params:a})};e.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()===
"true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};e.replaceRegEx=function(a,b,c){return a.replace(RegExp(b.pattern,b.flags),c)};e.replaceStringLiteral=function(a,b,c){b=i.parse("/"+b+"/gim");return e.replaceRegEx(a,b,c)};e.searchOnelineLiteral=function(a,b,c){var e;e=0;for(var d=!1,f=[];;)if(e=b.indexOf(a.searchStr,e),e<0)break;else{f.push({startIndex:e,length:a.searchStrLength});d=!0;if(c)break;e+=a.searchStrLength}return d?f:null};e.findRegExp=function(a,b,c,e){if(!b)return null;
c=c||"";c+=(c.indexOf("g")===-1?"g":"")+(c.indexOf("m")===-1?"m":"");var d=null;return(d=RegExp(b,c).exec(a.substring(e)))&&{startIndex:d.index+e,length:d[0].length}};e.searchOnelineRegEx=function(a,b,c){for(var d=0,f=!1,n=[];;)if(d=e.findRegExp(b,a.regExp.pattern,a.regExp.flags,d)){n.push(d);f=!0;if(c)break;d=d.startIndex+d.length}else break;return f?n:null};e.generateNewContents=function(a,b,c,d,f,n){if(d&&b){if(!a)c.contents=[];for(var i=0;i<b.length;i++){for(var j=b[i],k=!1,s=!1,v=[],w,u=0,q=
0;q<d.children.length;q++)if(d.children[q].lineNumber-1===i){u=q;for(k=0;k<d.children[q].matches.length;k++)d.children[q+k].checked!==!1&&v.push(k);s=v.length>0;w=d.children[q].matches;k=!0;break}if(k){if(s){v=e.replaceCheckedMatches(j,f,w,v,n);j=v.replacedStr;for(k=0;k<d.children[u].matches.length;k++)d.children[u+k].newMatches=v.newMatches}else for(k=0;k<d.children[u].matches.length;k++)d.children[u+k].newMatches=d.children[u+k].matches;a?c.contents[i]=j:c.contents.push(j)}else a||c.contents.push(j)}}};
e.generateMatchContext=function(a,b,c){var e=[],d=a*2+1,f;b.length<=d?(f=0,a=b.length-1):(f=c-a,f<0?(f=0,a=f+d-1):(a=c+a,a>b.length-1&&(a=b.length-1,f=a-d+1)));for(d=f;d<=a;d++)e.push({context:b[d],current:d===c});return e};e.splitFile=function(a){for(var b=0,c=0,e=0,d=0,f=[];;){b!==-1&&b<=e&&(b=a.indexOf("\r",e));c!==-1&&c<=e&&(c=a.indexOf("\n",e));if(c===-1&&b===-1){f.push(a.substring(d));break}var i=1;b!==-1&&c!==-1?b+1===c?(i=2,e=c+1):e=(b<c?b:c)+1:e=b!==-1?b+1:c+1;f.push(a.substring(d,e-i));
d=e}return f};e.searchWithinFile=function(a,b,c,d,f,n){c=e.splitFile(c);if(f)b.contents=c;if(b){b.children=[];for(var i=d=0;i<c.length;i++){var j=c[i];if(j&&j.length>0){var k=n?j:j.toLowerCase();if(k=a.wildCard?e.searchOnelineRegEx(a,k):e.searchOnelineLiteral(a,k)){var s,v=i+1;if(f)for(var w=0;w<k.length;w++)s=w+1,s={parent:b,checked:b.checked,type:"detail",matches:k,lineNumber:v,matchNumber:s,name:j,location:b.location+"-"+v+"-"+s},b.children.push(s);else s={parent:b,context:e.generateMatchContext(2,
c,i),checked:b.checked,type:"detail",matches:k,lineNumber:v,name:j,location:b.location+"-"+v},b.children.push(s);d+=k.length}}}b.totalMatches=d}};e.replaceCheckedMatches=function(a,b,c,e,d){for(var f=0,i="",j=[],k=0;k<c.length;k++){f!==c[k].startIndex&&(i+=a.substring(f,c[k].startIndex));if(c[k].length)d=c[k].length;for(var f=!1,s=0;s<e.length;s++)if(e[s]===k){f=!0;break}f?(j.push({startIndex:i.length,length:b.length}),i+=b):(j.push({startIndex:i.length,length:d}),i+=a.substring(c[k].startIndex,c[k].startIndex+
d));f=c[k].startIndex+d}f<a.length&&(i+=a.substring(f));return{replacedStr:i,newMatches:j}};e.fullPathNameByMeta=function(a){var b=a.length,c="";if(b>0)for(b-=1;b>-1;b--)c=c+(c===""?"":"/")+a[b].Name;return c};e.path2FolderName=function(a,b,c){return a.substring(0,a.length-b.length-(c?0:1))};e._storeRecentSearch=function(a,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),
20)})};e.addRecentSearch=function(a,b,c){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var f,d=d.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));if(d){for(f in d)if(d[f].name===b)return;d.length>=20&&d.splice(19,d.length-20+1)}else d=[];d.splice(0,0,{name:b,regEx:c});e._storeRecentSearch(a,d)})};e.removeRecentSearch=function(a,b,c){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var f,
d=d.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));if(d)for(f in d)if(d[f].name===b){d.splice(f,1);e._storeRecentSearch(a,d,c);break}})};e.getSearches=function(a,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(b);typeof a==="string"&&(a=JSON.parse(a));a&&c&&c(a)})};e.getMixedSearches=function(a,b,c,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var h=a.get("recentSearch");typeof h===
"string"&&(h=JSON.parse(h));b&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var b=e.parseQueryStr(a.query);h.some(function(c){return b.searchStrTitle===c.name})||h.push({name:b.searchStrTitle,label:a.name})}else h.push({name:null,label:a.name,value:a.query})}));h&&d&&d(h)})};e.getOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(c){c=c.get("nav.config");b(c&&c["links.newtab"]!=="undefined"?
c["links.newtab"]?!0:!1:!1)})};e.setOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("openSearchPref",{openInNewTab:b})})};return e});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,k,i,d,b,f){function a(a,b,g,c){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=g;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(g);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._cancelled=!1;this.registry.getService("orion.page.message").setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}a.prototype.search=function(a){var b=this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=a;this._cancelled=!1;this._deferredArray=[];b.getContentTypes().then(function(a){this.contentTypesCache=
a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})}.bind(this))}.bind(this))};a.prototype.searchName=function(a,b){if(a)this.searchHelper=d.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var g=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var c=0;c<this.fileSkeleton.length;c++){var f=
this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(g.push(this.fileSkeleton[c]),g.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:g.length,docs:g}})}};a.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=
[];var c=this;a();d.getContentTypes().then(function(a){c.contentTypesCache=a;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;b();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};a.prototype._searchCompleted=function(){console.log("Search Completed.")};a.prototype._searchFiles=function(){var a=[];if(this.fileLocations.length>0)for(var b=0;b<this.fileLocations.length;b++)a.push(this._sniffSearch(this.fileLocations[b]));return f.all(a)};a.prototype._sort=function(a){a.sort(function(a,
b){var c=a.Name&&a.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return c<e?-1:c>e?1:0})};a.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};a.prototype._visitRecursively=function(a){var d=[],g=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var c=g.registry.getService("orion.page.progress");return(c?c.progress(g.fileClient.fetchChildren(a),
"Crawling search for children of "+a):g.fileClient.fetchChildren(a)).then(function(c){for(var a=0;a<c.length;a++)if(c[a].Directory!==void 0&&c[a].Directory===!1)if(g._searchOnName)d.push(g._buildSingleSkeleton(c[a]));else if(g._buildSkeletonOnly)d.push(g._buildSingleSkeleton(c[a]));else{if(!g._cancelled){var e=b.getFilenameContentType(c[a].Name,g.contentTypesCache);if(e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&g._onFileType(e))e=g._sniffSearch(c[a]),d.push(e),g._deferredArray.push(e)}}else if(c[a].Location)if(g._cancelled)break;
else e=g._visitRecursively(c[a].ChildrenLocation),d.push(e),g._deferredArray.push(e);return f.all(d)})};a.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,a,!0)};a.prototype._reportSingleHit=function(a){a.LastModified=a.LocalTimeStamp;this.fileLocations.push(a);this._hitCounter++;this._sort(this.fileLocations);
this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};a.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(a){a.cancel()});this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}});console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length);this.registry.getService("orion.page.message").setProgressResult({Message:j["Search cancelled by user"],
Severity:"Warning"})};a.prototype._sniffSearch=function(a){this._totalCounter++;var b=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(j["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(b.fileClient.read(a.Location),"Reading file "+a.Location).then(function(d){b._hitOnceWithinFile(d)&&
b._reportSingleHit(a);b.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(j["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)},j.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+a.message)})};a.prototype._buildSingleSkeleton=function(a){this._totalCounter++;this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new f;a.resolve(this._totalCounter);
return a};a.prototype.constructor=a;return{SearchCrawler:a}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(j,k,i,d,b,f,a){function e(a){this._init(a)}e.prototype=new a.Dialog;e.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+d.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';e.prototype._init=function(a){this.title=a.title||j["Find File Named"];this.modal=!0;this.messages=j;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new i.ContentTypeRegistry(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");
this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(j["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(j["Missing required argument: searchRenderer"]);this._initialize()};e.prototype._bindToDom=function(a){var e=this;e.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",j.Search);this.$fileName.addEventListener("input",function(){e._time=+new Date;e._timeoutId&&clearTimeout(e._timeoutId);e._timeoutId=setTimeout(e.checkSearch.bind(e),0)},!1);this.$fileName.addEventListener("keydown",function(c){if(c.keyCode===b.KEY.ENTER){var a=b.$("a",e.$results);
a&&(b.stop(c),window.open(a.href),e.hide())}},!1);a.addEventListener("keydown",function(c){var a,d,h;if(c.keyCode===b.KEY.DOWN||c.keyCode===b.KEY.UP)a=b.$$array("a",e.$results),d=document.activeElement,h=a.indexOf(d),c.keyCode===b.KEY.DOWN?h>=0?(d.classList.remove("treeIterationCursor"),a=h<a.length-1?a[h+1]:a[0],a.focus(),a.classList.add("treeIterationCursor")):a.length>0&&(a=-1<a.length-1?a[0]:a[0],a.focus(),a.classList.add("treeIterationCursor")):h>=0?(d.classList.remove("treeIterationCursor"),
d=e.$fileName,a=h>0?a[h-1]:d,a.focus(),h>0&&a.classList.add("treeIterationCursor")):a.length>0&&(a[a.length-1].focus(),a[a.length-1].classList.add("treeIterationCursor")),b.stop(c)});a.addEventListener("mouseup",function(c){c.target.focus()},!1);setTimeout(function(){if(e._forceUseCrawler||!e._fileService.getService(e._searcher.getSearchLocation()).search){var c=e._searchOnRoot?e._searcher.getSearchRootLocation():e._searcher.getChildrenLocation(),c=new k.SearchCrawler(e._searcher.registry,e._fileService,
"",{searchOnName:!0,location:c});e._searcher.setCrawler(c);c.buildSkeleton(function(){e.$crawlingProgress.style.display="inline";e.$progress.appendChild(document.createTextNode(j["Building file skeleton..."]))},function(){e.$crawlingProgress.style.display="none";e.$progress.removeChild(e.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=
this._initialText,this.doSearch()};e.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};e.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._searcher.createSearchParams(a,this._nameSearch,this._searchOnRoot),c=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));
this.currentSearch=c;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:f.formatMessage(j["Searching for occurrences of"],a)));b.empty(this.$results);this.$results.appendChild(d);this._searcher.search(e,!1,function(){c===this.currentSearch&&c.apply(null,arguments)}.bind(this))}};e.prototype.decorateResult=function(a){for(var e=this,a=b.$$array("a",a),c=0;c<a.length;c++){var d=a[c];d.addEventListener("mouseup",function(c){c.button===0&&!c.ctrlKey&&
!c.metaKey&&e.hide()},!1);d.addEventListener("keyup",function(c){c.keyCode===b.KEY.ENTER&&e.hide()},!1)}};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};e.prototype.constructor=e;return{OpenResourceDialog:e}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=4.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<div class="layoutRight commandList pageActions" id="settingsActions"></div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(j,k){function i(d,b,f){if(d=k.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=f=f||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=f.selectionClass;d=document.createElement("div");d.classList.add("dropDownContainer");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=d;if(b=k.node(b))this._triggerNode=
b;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!f.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(a){a.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}j.mixin(i.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){this._dropdownMenu.style.display="";this._positionDropdown();
this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},addContent:function(d){this._dropdownMenu.innerHTML=
d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,b){b()},_positionDropdown:function(){this._dropdownMenu.style.left="";var d=k.bounds(this._dropdownMenu),b=k.bounds(this._boundingNode(this._parent));if(d.left+d.width>b.left+b.width)this._dropdownMenu.style.right=0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||!d.parentNode.style?d:this._boundingNode(d.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},
isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.empty(this._parent),this._parent=this.select=null}});return i});
define("orion/widgets/input/GroupedContent",["i18n!orion/widgets/nls/messages","orion/objects","orion/webui/littlelib"],function(j,k){function i(){}k.mixin(i.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">'+j["Main Pages"]+'</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">'+j["Related Links"]+'</span><nav><ul id="relatedLinks"></ul></nav></section></div>',
getContentPane:function(){return this.templateString}});return i});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file",
"Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",
'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.",
"Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file","Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository",
"Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.","Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.",
"Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder","Import local file...":"Import local file...","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection",
"Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",
"Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system",
"Create new content":"Create new content","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.",
"Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,k,i){function d(a,b,d){if(!a[b])throw b+j[" is not supported in this file system"];return a[b].apply(a,d)}function b(a,e,h,g){if(!a.readBlob)throw j["source file service does not support binary read"];if(!h.writeBlob)throw j["target file service does not support binary write"];if(e[e.length-1]!=="/")return d(a,"readBlob",[e]).then(function(c){return d(h,"writeBlob",[g,c])});var c=g.substring(0,
g.length-1),f=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return d(h,"createFolder",[c,f]).then(function(){},function(){}).then(function(){return d(a,"fetchChildren",[e]).then(function(c){for(var e=[],d=0;d<c.length;++d){var f=c[d].Location,l=f;c[d].Directory&&(l=f.substring(0,f.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=g+encodeURIComponent(l);c[d].Directory&&(l+="/");e[d]=b(a,f,h,l)}return k.all(e)})})}function f(a,b){function d(c){var a=
new k;a.reject(j["No Matching FileService for location:"]+c);return a}var g=a.getServiceReferences("orion.core.file"),c=g;if(b)for(var c=[],f=0;f<g.length;++f)b(g[f])&&c.push(g[f]);for(var m=[],n=[],p=[],t=[],r={fetchChildren:function(){var c=new k;c.resolve(t);return c},createWorkspace:function(){var c=new k;c.reject(j["no file service"]);return c},loadWorkspaces:function(){var c=new k;c.reject(j["no file service"]);return c},loadWorkspace:function(){var c=new k;window.setTimeout(function(){c.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:j["File Servers"],Location:"/",Children:t,ChildrenLocation:"/"})},100);return c},search:d,createProject:d,createFolder:d,createFile:d,deleteFile:d,moveFile:d,copyFile:d,read:d,write:d},g=0;g<c.length;++g)t[g]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[g].getProperty("top"),ChildrenLocation:c[g].getProperty("top"),Name:c[g].getProperty("Name")},f=c[g].getProperty("pattern")||".*",f[0]!=="^"&&(f="^"+f),m[g]=RegExp(f),n[g]=a.getService(c[g]),p[g]=c[g].getProperty("Name"),
c[g].getProperty("NameKey")&&c[g].getProperty("nls")&&i.getMessageBundle(c[g].getProperty("nls")).then(function(a,b){t[a].Name=b[c[a].getProperty("NameKey")];p[a]=b[c[a].getProperty("NameKey")]}.bind(this,g));this._getServiceIndex=function(c){if(c==="/")return-1;else if(!c||c.length&&c.length===0)return n[0]?0:-1;for(var a=0;a<m.length;++a)if(m[a].test(c))return a;throw j["No Matching FileService for location:"]+c;};this._getService=function(c){c=this._getServiceIndex(c);return c===-1?r:n[c]};this._getServiceName=
function(c){c=this._getServiceIndex(c);return c===-1?r.Name:p[c]};this._getServiceRootURL=function(c){c=this._getServiceIndex(c);return c===-1?r.Location:t[c].Location}}f.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return d(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return d(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return d(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,b,h,g){return d(this._getService(a),"createProject",arguments)},createFolder:function(a,b){return d(this._getService(a),"createFolder",arguments)},createFile:function(a,b){return d(this._getService(a),"createFile",arguments)},deleteFile:function(a){return d(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,e,h){var g=this._getService(a),c=this._getService(e);if(g===c)return d(g,"moveFile",arguments);var f=a[a.length-1]==="/",m=e;m[m.length-1]!=="/"&&(m+="/");if(h)m+=encodeURIComponent(h);else{var n=a;f&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}f&&m[m.length-1]!=="/"&&(m+="/");return b(g,a,c,m).then(function(){return d(g,"deleteFile",[a])})},copyFile:function(a,e,h){var g=this._getService(a),c=this._getService(e);if(g===c)return d(g,"copyFile",arguments);
var f=a[a.length-1]==="/",m=e;m[m.length-1]!=="/"&&(m+="/");if(h)m+=encodeURIComponent(h);else{var n=a;f&&(n=n.substring(0,n.length-1));m+=n.substring(n.lastIndexOf("/")+1)}f&&m[m.length-1]!=="/"&&(m+="/");return b(g,a,c,m)},read:function(a,b){return d(this._getService(a),"read",arguments)},write:function(a,b,h){return d(this._getService(a),"write",arguments)},remoteImport:function(a,b){return d(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,b){return d(this._getService(a),
"remoteExport",arguments)},search:function(a){return d(this._getService(a.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(j,
k,i,d,b,f,a,e,h,g,c,l,m,n,p,t,r,s,v,w,u,q,o,x,C,E,D,y,B,A,F,z){function I(c,a){if(c.getLabel)return c.getLabel();else{var b=new u;b.resolve(a.properties.name);return b}}function J(c){l.node("progressPane").setAttribute("aria-label",j["Operations - Press spacebar to show current operations"]);(c=c.getService("orion.page.progress"))&&c.init.bind(c)("progressPane")}function V(c,a){var b=c.getServiceReferences("orion.core.auth");H=[];for(var e=G.createMenuGenerator.apply(this,arguments),d=0;d<b.length;d++){var o=
b[d],g=c.getService(o);I(g,o).then(function(c){g.getKey().then(function(a){H.push(a);g.getUser().then(function(b){e.addUserItem(a,g,c,b)},function(b,d){e.addUserItem(a,g,c,d)});window.addEventListener("storage",function(){L[a]!==localStorage.getItem(a)&&(L[a]=localStorage.getItem(a),g.getUser().then(function(b){e.addUserItem(a,g,c,b)},function(){e.addUserItem(a,g,c)}))},!1)})})}}function Q(c){return c}function M(c,a,b,d,o){function g(c){if(c)if(!c.visibleWhen||c.visibleWhen(a)){var b=new f.CommandInvocation(a,
a,null,c,d);return(new u).resolve([c,b])}else if(typeof o==="function")return l||(l=o()),u.when(l,function(b){if(b&&a===K&&(!c.visibleWhen||c.visibleWhen(b)))return b=new f.CommandInvocation(b,b,null,c,d),[c,b]});return(new u).resolve()}var q=arguments,h,l,x=c&&c.getServiceReferences("orion.page.link.related");x&&x.length!==0&&u.when(function(){if(h)return h;var a=c.getService("orion.core.contentTypeRegistry");a||(a=new t.ContentTypeRegistry(c),a=c.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(c){return h=
c})}(),function(){if(G.beforeGenerateRelatedLinks.apply(this,q)){for(var a=[],o=0;o<x.length;o++){var l={},m,n=x[o].getPropertyKeys();for(m=0;m<n.length;m++)l[n[m]]=x[o].getProperty(n[m]);if(l.id&&(m=m=null,b.indexOf(l.id)<0))if((l.nls&&l.nameKey||l.name)&&l.uriTemplate)m=e._createCommandOptions(l,x[o],c,h,!0),a.push(m);else if(m=d.findCommand(l.id))a.push((new u).resolve(m));else{var i=c.getServiceReferences("orion.navigate.command");for(m=0;m<i.length;m++)if(i[m].getProperty("id")===l.id){for(var l=
{},n=i[m].getPropertyKeys(),C=0;C<n.length;C++)l[n[C]]=i[m].getProperty(n[C]);m=e._createCommandOptions(l,i[m],c,h,!0);a.push(m);break}}}u.all(a,Q).then(function(c){c=c.map(function(c){return c instanceof f.Command?c:new f.Command(c)}).sort(function(c,a){return c.name.localeCompare(a.name)});return u.all(c.map(g),Q).then(function(c){c.forEach(function(c){c&&G.addRelatedLinkCommand(c[0],c[1])});G.afterGenerateRelatedLinks.apply(this,q)})})}})}function T(c){var a=l.node("globalActions");a&&(c.destroy(a),
c.renderCommands(a.id,a,{},{},"tool"))}function S(c){var a=window.getComputedStyle(c,null);return a===null?c:a.getPropertyValue("position")==="absolute"||!c.parentNode||c===document.body?c:S(c.parentNode)}function U(c){var a={},b=null;typeof c==="string"&&(c=l.node(c));c||(c=l.node("pageActions"));for(var e=c;e&&e.classList;){if(e.classList.contains("toolComposite")){b=e;break}e=e.parentNode}if(c.classList.contains("commandMarker"))a.commandNode=c;if(b&&(a.slideContainer=l.$(".slideParameters",b),
a.parameterArea=l.$(".parameters",b),a.dismissArea=l.$(".parametersDismiss",b),a.notifications=l.$("#notificationArea",b),b.parentNode&&(a.toolbarTarget=l.$(".toolbarTarget",b.parentNode),a.toolbarTarget)))c=l.bounds(a.toolbarTarget),e=l.bounds(S(a.toolbarTarget.parentNode)),a.toolbarTargetY=c.top-e.top,a.toolbar=b;return a}function O(c){if(c.toolbarTarget&&c.toolbarTargetY){var a=0,b;c.notifications&&c.notifications.classList.contains("slideContainerActive")&&(b=l.bounds(c.notifications),a+=b.height);
c.slideContainer&&c.slideContainer.classList.contains("slideContainerActive")&&(b=l.bounds(c.slideContainer),a+=b.height);a>0&&(a+=8);a?(c.toolbarTarget.style.top=c.toolbarTargetY+a+"px",c.toolbar.style.paddingBottom=a+"px"):c.toolbarTarget.style.top=c.toolbar.style.paddingBottom=""}}var b=function(c){var a=document.createElement("a");a.href=c;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),L={},G={createMenuGenerator:F.createMenuGenerator||function(c,a){if(l.node("userMenu")){var b=l.node("userDropdown"),
e=new n.Dropdown({dropdown:b}),b=new q.UserMenu({dropdownNode:b,dropdown:e,serviceRegistry:c}),e=l.node("userTrigger");new p.Tooltip({node:e,text:j.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),d=e.className;d+=" imageSprite core-sprite-silhouette";e.className=d;b.setKeyAssist(a);return b}},beforeGenerateRelatedLinks:F.beforeGenerateRelatedLinks||function(){var c=l.node("relatedLinks");l.empty(c);return!0},addRelatedLinkCommand:F.addRelatedLinkCommand||function(c,
a){var b=l.node("relatedLinks");f.createCommandMenuItem(b,c,a).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:F.afterGenerateRelatedLinks||function(){},afterSetPageTarget:F.afterSetPageTarget||function(){},generateNavigationMenu:F.generateNavigationMenu||function(){var c=document.getElementById("centralNavigation");new p.Tooltip({node:c,text:"Navigation Menu",position:["right"]});var c=new y("primaryNav","centralNavigation"),a=new B;c.addContent(a.getContentPane())},afterGenerateBanner:F.afterGenerateBanner||
function(){}},H=[],K,R=[],N,P=null;return{generateBanner:function(c,b,e,g,q,n,p,t){function I(){this.create();this._filterString=""}function r(c){c.registerService("orion.cm.managedservice",{updated:function(c){for(var c=c&&c["links.newtab"]!=="undefined"?c["links.newtab"]?"_blank":"_self":"_self",a=l.$$array(".targetSelector"),b=0;b<a.length;b++)a[b].target=c}},{pid:"nav.config"})}(new v.ThemePreferences(g,new w.ThemeData)).apply();var y=l.node(c);if(!y)throw j["could not find banner parent, id was "]+
c;var B=document.createRange();B.selectNode(y);B=B.createContextualFragment(C);l.processTextNodes(B,j);y.firstChild?y.insertBefore(B,y.firstChild):y.appendChild(B);y=l.node("home");y.href=k.toUrl("edit/edit.html");y.setAttribute("aria-label",j["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(y=l.node("pageToolbar"))y.classList.add("toolbarLayout"),y.innerHTML=D+i.slideoutHTMLFragment("mainToolbar");(y=l.node("closeNotifications"))&&y.setAttribute("aria-label",j["Close notification"]);
if(A.isFirefox<=17&&(y=l.node("staticBanner")))y.style.width="100%",y.style.MozBoxSizing="border-box";if(y=l.node("footer"))y.innerHTML=E,l.processTextNodes(y,j);e.setParameterCollector(new a.CommandParameterCollector(U,O));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&(c=b.getService("orion.page.message"))&&c.setProgressMessage("")},!1);G.generateNavigationMenu.apply(this,arguments);var s=l.node("navigationlinks");s&&o.createPageLinks(b,"orion.page.link").then(function(c){c.forEach(function(c){var a=
document.createElement("li");a.appendChild(c);s.appendChild(a)})});if(y=l.$(".split")){var B=l.$(".sidePanelLayout"),F=l.$(".mainPanelLayout");if(B&&F)P={side:B,main:F},P.splitter=new m.Splitter({node:y,sidePanel:B,mainPanel:F,toggle:!0,closeByDefault:t}),y=new f.Command({name:j["Toggle side panel"],tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){P.splitter.toggleSidePanel()}}),e.addCommand(y),e.registerCommandContribution("pageActions","orion.toggleSidePane",
1,null,!0,new d.KeyBinding("o",!0)),p&&P.splitter.addResizeListener(function(c){p&&c===F&&p.resize()})}var z=!1,u=function(c,a,b){if(!z){var a=a.getService("orion.page.progress"),e=new x.OpenResourceDialog({searcher:c,progress:a,searchRenderer:c.defaultRenderer,onHide:function(){z=!1;b&&b.focus()}});window.setTimeout(function(){z=!0;e.show()},0)}},y=new f.Command({name:j["Find File Named..."],tooltip:j["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){u(q,
b,p)}});e.addCommand(y);e.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));y=new f.Command({name:j["Toggle banner and footer"],tooltip:j["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var c=l.node("banner"),a=l.node("footer"),b=l.$(".content-fixedHeight");c.style.visibility==="hidden"?(c.style.visibility="visible",a.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized")):(c.style.visibility=
"hidden",a.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"));p&&p.resize();return!0}});e.addCommand(y);e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));y=new f.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});e.addCommand(y);e.registerCommandContribution("globalActions","orion.configDetailsPage",
100,null,!0,new d.KeyBinding(112,!0,!0));y=new f.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});e.addCommand(y);e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));I.prototype={create:function(){var c=this._keyAssistDiv=document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");
c.setAttribute("role","menu");var a=this._keyAssistInput=document.createElement("input");a.classList.add("keyAssistInput");a.type="text";a.placeholder=j["Filter bindings"];c.appendChild(a);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(A.isIOS||A.isAndroid)b.style.overflowY="auto";c.appendChild(b);var e=this._keyAssistTable=document.createElement("table");e.tabIndex=0;e.classList.add("keyAssistList");b.appendChild(e);document.body.appendChild(c);
a.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));e.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));a.addEventListener("input",function(){this.filterChanged()}.bind(this));b.addEventListener(A.isFirefox?"DOMMouseScroll":"mousewheel",function(c){this._scrollWheel(c)}.bind(this));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));l.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);
this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(p&&p.getTextView&&p.getTextView()){var c=p.getTextView(),a=c.getActions(!0).filter(function(a){return(a=c.getActionDescription(a))&&a.name});a.sort(function(a,b){return c.getActionDescription(a).name.localeCompare(c.getActionDescription(b).name)});this.createHeader(j.Editor);for(var b=function(a){return function(){c.focus();return c.invokeAction(a)}},d={},o,g=0;g<a.length;g++)for(var q=a[g],f=c.getActionDescription(q),
x=c.getKeyBindings(q),m=0;m<x.length;m++){o=x[m];var n=h.getUserKeyString(o);o.scopeName?(d[o.scopeName]||(d[o.scopeName]=[]),d[o.scopeName].push({bindingString:n,name:f.name,execute:b(q)})):this.createItem(n,f.name,b(q))}for(var i in d)if(d[i].length){this.createHeader(i);for(a=0;a<d[i].length;a++)o=d[i][a],this.createItem(o.bindingString,o.name,o.execute)}}this.createHeader(j.Global);e.showKeyBindings(this)},createItem:function(c,a,b){if(this._filterString){var e=this._filterString.toLowerCase(),
d;e!==this._filterString?(e=this._filterString,d=function(c){return c}):d=function(c){return c.toLowerCase()};if(d(a).indexOf(e)===-1&&d(c).indexOf(e)===-1&&d(this._lastHeader).indexOf(e)===-1)return}var o=this._keyAssistTable.insertRow(-1);o.id="keyAssist-keyBinding-"+this._idCount++;o.setAttribute("role","menuitem");o._execute=b;o.classList.add("keyAssistItem");o.addEventListener("click",function(c){this._selectedRow=o;this.execute();c.preventDefault()}.bind(this));b=o.insertCell(-1);b.classList.add("keyAssistName");
b.appendChild(document.createTextNode(a));b=o.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var a=this._keyAssistTable.insertRow(-1);a.classList.add("keyAssistSection");var a=a.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(c));a.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,a=this._keyAssistDiv,c=a===c||(a.compareDocumentPosition(c)&16)!==0;a.style.display="none";c&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();
this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(c){var a=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(a.length===0)this._selectedIndex=-1;else{var b=this._selectedIndex;b+=c?1:-1;b%=a.length;b<0&&(b=a.length-1);if(this._selectedIndex!==-1)c=a[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=b;if(this._selectedIndex!==-1){this._selectedRow=c=a[this._selectedIndex];
c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();var a=c.getBoundingClientRect(),e=this._keyAssistContents,d=e.getBoundingClientRect();c.offsetTop<e.scrollTop?b===0?e.scrollTop=0:c.scrollIntoView(!0):a.bottom>d.bottom&&c.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),this._keyAssistInput.select()},_keyDown:function(c){if(c.keyCode===40)this.select(!0);else if(c.keyCode===38)this.select(!1);else if(c.keyCode===13)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var a=0,a=A.isIE||A.isOpera?-c.wheelDelta:A.isFirefox?c.detail*40:-c.wheelDeltaY,b=this._keyAssistContents,e=b.scrollTop;b.scrollTop+=a;if(e!==b.scrollTop)return c.preventDefault&&
c.preventDefault(),!1}};var Q=new I,M=new f.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){Q.isVisible()?Q.hide():Q.show();return!0}});e.addCommand(M);e.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));y=function(){p.getTextView().setKeyBinding(new d.KeyBinding(191,!1,!0,!A.isMac,A.isMac),M.id);p.getTextView().setAction(M.id,M.callback,M)};p&&p.getTextView&&
(p.getTextView()?y():p.addEventListener("TextViewInstalled",y));T(e);V(b,M.callback);J(b);window.addEventListener("hashchange",function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){r(b)},0);G.afterGenerateBanner.apply(this,arguments)},getToolbarElements:U,getMainSplitter:function(){return P},layoutToolbarElements:O,setPageTarget:function(a){var b,e,d=a.breadcrumbRootName,o=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&
!a.breadcrumbTarget&&(e=d?d+" ":"",e+=a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,K=a.target,M(o,a.target,R,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,M(o,{NoTarget:""},R,a.commandService,a.makeAlternate));(N=a.title)||(N=b?b+" - "+a.task:a.task);window.document.title=N;G.afterSetPageTarget.apply(this,arguments);if(b=l.node("location")){l.empty(b);var g=o&&new z.FileClient(o),o=a.breadcrumbTarget||a.target,g=g&&o&&o.Location?
g.fileServiceRootURL(o.Location):null;new c.BreadCrumbs({container:b,resource:o,rootSegmentName:d,workspaceRootSegmentName:e,workspaceRootURL:g,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(c){if(N)N.charAt(0)==="*"&&!c&&(N=N.substring(1)),c&&N.charAt(0)!=="*"&&(N="*"+N),window.document.title=N;var a=l.node("dirty");if(a)a.textContent=c?"*":""},setPageCommandExclusions:function(c){R=c},notifyAuthenticationSite:b}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(k){for(var i=/\[([^\]]*)\]\(([^\)]+)\)/g,d=i.exec(k),b=[],f=0;d;){if(d.length===3&&d[2].length>0){var a=new URL(d[2]);a.protocol!==":"&&j.validateURLScheme(a.href)&&(d.index>f&&b.push({segmentStr:k.substring(f,d.index)}),b.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),f=d.index+d[0].length)}d=i.exec(k)}if(f===0)return null;f<k.length-1&&b.push({segmentStr:k.substring(f)});return b},processURLSegments:function(j,
i){i.forEach(function(d){if(d.urlStr){var b=document.createElement("a");b.href=d.urlStr;b.appendChild(document.createTextNode(d.segmentStr))}else b=document.createElement("span"),b.textContent=d.segmentStr;j.appendChild(b)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(j,k,i,d){function b(a,b,d,g,c){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=c;this.domId=d;this.progressDomId=g||d;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var f;b.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&
!this._hookedClose){a.style.cursor="pointer";this._hookedClose=!0;var b=k.node(this.notificationContainerDomId);k.addAutoDismiss([b],function(){this._clickToDisMiss&&this.close()}.bind(this));a.addEventListener("click",function(){this.close()}.bind(this));b.addEventListener("click",function(a){a&&a.target&&a.target.nodeName.toLowerCase()==="a"&&(a=k.$$("a",b))&&a.length&&a.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);this.setProgressMessage("");var a=k.node("closeNotifications");
if(this._cancelMsg&&this._cancelFunc&&a)a.innerHTML="",a.classList.remove("cancelButton"),a.classList.add("dismissButton"),a.classList.add("core-sprite-close"),a.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,b,d){this._init();this.currentMessage=a;var g=k.node(this.domId);if(typeof d==="boolean"){var c=
g.getAttribute("aria-live");g.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){a===this.currentMessage&&(k.empty(g),g.appendChild(document.createTextNode(a)),window.setTimeout(function(){g.setAttribute("aria-live",c)},100))}.bind(this),100)}else k.empty(g),g.appendChild(document.createTextNode(a));typeof b==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(g),g.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(a){this._clickToDisMiss=
!0;this.currentMessage=a;this._init();var b=a.responseText||a.message||a;if(typeof b==="string")try{b=JSON.parse(b)}catch(d){}var a=b.Message||b,g="red";if(b.Severity)switch(b.Severity){case "Warning":g="#FFCC00";break;case "Error":g="red";break;case "Info":case "Ok":g="green"}b=document.createElement("span");b.style.color=g;b.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(b)},setProgressMessage:function(a){this._clickToDisMiss=!1;this._init();this.currentMessage=
a;var b=document.createElement("span");b.classList.add("imageSprite");b.classList.add("progressIcon");b.classList.add("core-sprite-progress");var d=k.node(this.progressDomId);k.empty(d);d.appendChild(b);d.appendChild(document.createTextNode(a));b=k.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(a&&a.length>0)b.classList.add("progressNormal"),b.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();
else b.classList.remove("notificationShow"),b.classList.add("notificationHide")},setCancelFunction:function(a){this._cancelFunc=a},setProgressResult:function(a,b){this._clickToDisMiss=!1;this._cancelMsg=b;this.currentMessage=a;var h=a.responseText||a;if(typeof h==="string")try{h=JSON.parse(h)}catch(g){}this._init();var c=h.Message||h.toString(),f=j.UnknownError,m="core-sprite-information",n="progressNormal",i=document.createElement("span");i.classList.add("imageSprite");i.classList.add("progressIcon");
var t=[];if(h.Severity)switch(h.Severity){case "Warning":f=j.UnknownWarning;m="core-sprite-warning";n="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";n="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:n="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");
i.classList.add(m);var r=k.node(this.progressDomId),m=k.node(this.notificationContainerDomId);k.empty(r);r.appendChild(i);c===Object.prototype.toString()&&(c=f);if(h.HTML)h=document.createElement("span"),h.innerHTML=c,r.appendChild(h);else{if(f=d.detectValidURL(c))c=document.createDocumentFragment(),d.processURLSegments(c,f),Array.prototype.forEach.call(k.$$("a",c),function(c){c.target="_blank"});else{if(h.Severity!=="Warning"&&h.Severity!=="Error"&&!b)this._timer&&window.clearTimeout(this._timer),
this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);c=document.createTextNode(c)}r.appendChild(c)}if(n&&this.progressDomId!==this.domId){m.classList.add(n);for(n=0;n<t.length;n++)m.classList.remove(t[n])}m.classList.add("notificationShow");if((t=k.node("closeNotifications"))&&this._cancelMsg)t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg},
showWhile:function(a,b){var d=this;if(b){d.setProgressMessage(b);var g=function(){b===d.currentMessage&&d.setProgressMessage("")};a.then(g,g)}return a},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,b){return new f(this,++this._lastProgressId,a,b)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",b=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(b||(a+=", "),a+=this._progressMonitors[d].status,b=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},
_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};b.prototype.constructor=b;f=function(a,b,d,g){this.statusService=a;this.progressId=
b;if(d){this.deferred=d;this.begin(g);var c=this;d.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};f.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};f.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};f.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};f.prototype.constructor=f;return{StatusReportingService:b,ProgressMonitor:f}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,k,i,d){function b(){}b.prototype={_initialize:function(b,a,e,h,g){this._tooltip=new d.Tooltip({node:b,hideDelay:g||0,afterShowing:this._afterShowingFunction(a).bind(this),afterHiding:e,trigger:h?h:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(b,j);this.$parent.appendChild(b);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var e=b.childNodes[a];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var a=
i.firstTabbable(this.$parent);a&&a.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};b.prototype.constructor=b;return{PopupDialog:b}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,k,i,d){var b={};(function(){var f=!1;b.updateNavTools=function(a,b,d,g,c,l){var m=i.node(g);if(m)b.destroy(m);else throw j["could not find toolbar "]+g;b.renderCommands(g,m,l,d,"button");if(c&&(g=i.node(c)))b.destroy(g),b.renderCommands(c,g,null,d,"button");f||(f=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var g=i.node(c);
g&&(b.destroy(g),b.renderCommands(c,g,a.selections,d,"button"))}))};b.createOperationsCommands=function(a,b,h){function g(c){return!c.operation||!c.operation.type?!1:c.operation.type==="loadstart"||c.operation.type==="progress"}var c=new d.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){h.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(c);
c=new d.Command({name:j.Remove,tooltip:j["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var d=c[a];h.removeOperation.bind(h)(d.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return!g(c);for(var a in c)if(g(c[a]))return!1;return!0}});a.addCommand(c);
c=new d.Command({name:j.Cancel,tooltip:j["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var b=c[a];b.deferred&&b.deferred.cancel()}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return g(c)&&(c.operation&&c.operation.cancelable?!0:!1);for(var a in c)if(!g(c[a])||!c[a].operation||!c[a].operation.cancelable)return!1;return!0}});a.addCommand(c)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,k,i,d,b){function f(a){this._options=a}f.prototype=new d.PopupDialog;f.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>';f.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;b.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};f.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};f.prototype.setOperations=function(a,b){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var d in a)this._myOperations.push(a[d]),this._operationsDeferreds.push(b[d]);this._renderOperations()};f.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var d={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==d.Message)d.DetailedMessage=a.DetailedMessage;return d};f.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};f.prototype._renderOperationsTable=function(a,b,d){i.empty(a);for(var g=0;g<b.length;g++){var c=b[g],f=document.createElement("tr"),m=document.createElement("td");m.style.paddingLeft="5px";m.style.paddingRight="5px";m.textContent=c.Name;f.appendChild(m);var n=document.createElement("div");m.appendChild(n);m=document.createElement("span");m.style.paddingRight="5px";m.classList.add("imageSprite");switch(c.type){case "Warning":m.classList.add("core-sprite-warning");m.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":m.classList.add("core-sprite-error");m.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":m.classList.add("core-sprite-start");m.setAttribute("aria-label",j["Operation is running."]);break;case "abort":m.classList.add("core-sprite-stop");m.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":m.classList.add("core-sprite-ok"),m.setAttribute("aria-label","Operation ok.")}n.appendChild(m);
m=document.createElement("span");m.classList.add("operationStatus");m.textContent=c.Name;n.appendChild(m);if(c.error){var p=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(p+=": "+c.error.DetailedMessage);m.textContent=p;m.classList.remove("operationStatus");m.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",n,{operation:c,deferred:d[g]},this,"tool");a.appendChild(f)}this._setOperationsVisibility()};f.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"};f.prototype.constructor=f;return{OperationsDialog:f}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,k,i,d,b){function f(a,h){if(!this._progressPane){this._progressPane=d.node(a);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:h});var g=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===d.KEY.ENTER)&&g._operationsDialog.show()})}}function a(a,b,d,c){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}f.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,b){var d=
{},c;for(c in a)a[c].progressMonitor||(d[c]=a[c]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(c in d){var m=d[c];if(m.type&&(m.type==="loadstart"||m.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=j["Operations running"];this._progressPane.alt=j["Operations running"];
this._progressPane.setAttribute("aria-valuetext",j["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=j["Some operations finished with warning"];this._progressPane.alt=j["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=j["Some operations finished with error"];this._progressPane.alt=
j["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(d,b)},_isEmpty:function(a){for(var b in a)return!1;return!0}};
f.prototype.constructon=f;a.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new f(a,this._commandRegistry)},progress:function(a,b,d){var c=this,f=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(b));a.then(function(){if(c._operations[f]){var m=c._operations[f];if(b)m.Name=b;c._lastOperation=m;m.type="loadend";if(d)m.progressMonitor=d;c.writeOperation.bind(c)(f,m,a);m.Location||c._removeOperationFromTheList.bind(c)(f)}},
function(m){if(c._operations[f]){var n=c._operations[f];if(b)n.Name=b;if(d)n.progressMonitor=d;c._lastOperation=n;n.type=m.canceled?"abort":"error";n.error=m;c.writeOperation.bind(c)(f,n,a);n.Location||c._removeOperationFromTheList.bind(c)(f)}},function(m){if(b)m.Name=b;if(d)m.progressMonitor=d;c.writeOperation.bind(c)(f,m,a)});return a},removeOperation:function(a){for(var b in this._operations)if(this._operations[b].Location&&this._operations[b].Location===a){this._removeOperationFromTheList(b);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var b=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];b?b.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var b=this._operations[a];if(b.type&&b.type!=="loadstart"&&b.type!=="progress")(b=this._operations[a].progressMonitor)&&
b.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,b){b&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(b);var d=this;a.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(c){d.setProgressResult.bind(d)(c);
return c});return this.progress(a,b)},writeOperation:function(a,b,d){this._operations[a]=b;this._operationDeferrds[a]=d;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(c){c.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};a.prototype.constructor=a;return{ProgressService:a}});
define("orion/dialogs",[],function(){function j(j){this._serviceRegistry=j;this._serviceRegistration=j.registerService("orion.page.dialog",this)}j.prototype={confirm:function(j,i){i(window.confirm(j))},openFiles:function(){}};j.prototype.constructor=j;return{DialogService:j}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(j){function k(i,d){d||(d="orion.page.selection");this._serviceRegistry=i;j.attach(this);this._serviceRegistration=i.registerService(d,this);this._selections=null}k.prototype={getSelection:function(i){var d=this._getSingleSelection();typeof i==="function"&&i(d);return d},getSelections:function(i){var d=Array.isArray(this._selections)?this._selections.slice():[];typeof i==="function"&&i(d);return d},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(i){var d=this._selections;this._selections=Array.isArray(i)?i.length>0?i.slice():null:i?[i]:null;d!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(j,k,i,d){function b(a,b){var h=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");var g=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var c=0;c<g.length;c++)this.domNode.classList.add(g[c]);this.domNode.id=b.id;if(b.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(c){(c.target===h.titleNode||c.target===h.twistie)&&h._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(c){c.keyCode===j.KEY.ENTER&&(c.target===h.domNode||c.target===h.titleNode||c.target===h.twistie)&&h._changeExpandedState()},!1);if(b.iconClass){var f=document.createElement("span");f.classList.add("sectionIcon");this.domNode.appendChild(f);(Array.isArray(b.iconClass)?b.iconClass:[b.iconClass]).forEach(function(c){f.classList.add(c)})}this.titleNode=document.createElement("div");
this.titleNode.id=b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;if(typeof b.getItemCount==="function")g=document.createElement("div"),g.classList.add("layoutLeft"),g.classList.add("sectionItemCount"),this.domNode.appendChild(g),g.textContent=b.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
b.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);g=document.createElement("div");g.id=b.id+"FilterSearchBox";this.domNode.appendChild(g);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);b.slideout&&(g=d.slideoutHTMLFragment(b.id),c=document.createRange(),c.selectNode(this.domNode),g=c.createContextualFragment(g),this.domNode.appendChild(g));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);
this.hidden=b.hidden;if(typeof b.onExpandCollapse==="function")this._onExpandCollapse=b.onExpandCollapse;this._preferenceService=b.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var m=this;this._preferenceService.getPreferences("/window/views").then(function(c){c=c.get(m.id);if(c!==void 0)m.hidden=!c;if(!m.hidden)m._contentParent.style.display="block";m._updateExpandedState(!m.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function f(a){this._section=a;this._id=++a._lastMonitor}b.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new f(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility=
"visible";this._loading[a]=b;var d="",g;for(g in this._loading)d!==""&&(d+="\n"),d+=this._loading[g];this._progressNode.title=d},_monitorDone:function(a){delete this._loading[a];var a="",b;for(b in this._loading)a!==""&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(a,b){var d=this.twistie,g=this.id;d&&(d.classList.add(a?this._expandImageClass:this._collapseImageClass),d.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&b&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(g,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};b.prototype.constructor=b;f.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};f.prototype.constructor=f;return{Section:b}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var b=d.parent,f=this,b=k.node(b);if(!b)throw j["no parent"];if(!d.model)throw j["no tree model"];if(!d.renderer)throw j["no renderer"];this._parent=b;this._treeModel=d.model;this._renderer=d.renderer;this._showRoot=d.showRoot===void 0?!1:d.showRoot;this._indent=d.indent===void 0?16:d.indent;this._onCollapse=d.onCollapse;this._labelColumnIndex=
d.labelColumnIndex===void 0?0:d.labelColumnIndex;this._id=d.id===void 0?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){f._showRoot?(a._depth=0,f._generate([a],0)):f._treeModel.getChildren(a,function(a){f.destroyed||f._generate(a,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,b){k.empty(this._parent);
var f=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(f);var a=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(a);a.id=this._id;this._tableStyle&&a.classList.add(this._tableStyle);this._renderer.initTable(a,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";d.length===
0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,b);a.appendChild(this._bodyElement);f.appendChild(a);this._parent.appendChild(f);this._rowsChanged()},_generateChildren:function(d,b,f){for(var a=0;a<d.length;a++){var e=document.createElement(this._tableRowElement);e.id=this._treeModel.getId(d[a]);this._renderer.rowCallback&&this._renderer.rowCallback(e);e._depth=b;e._item=d[a];this._renderer.render(d[a],e);e.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*b+"px";f?(this._bodyElement.insertBefore(e,f.nextSibling),f&&(f=e)):this._bodyElement.appendChild(e)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,b,f){var a=this._treeModel.getId(d),e;if(a===this._id)this._removeChildRows(a),this._generateChildren(b,0),this._rowsChanged();else{var h=k.node(a);h?(h._item=d,h&&(f||h._expanded)?(this._removeChildRows(a),this._renderer.updateExpandVisuals(h,
!0),b?(h._expanded=!0,this._generateChildren(b,h._depth+1,h),this._rowsChanged()):(e=this,b=this._treeModel.getChildren(h._item,function(a){if(!e.destroyed&&!h._expanded)h._expanded=!0,e._generateChildren(a,h._depth+1,h),e._rowsChanged()}))):this._renderer.updateExpandVisuals(h,!1)):console.log(j["could not find table row "]+a)}},getItem:function(d){var b=k.node(d);return b&&b._item?b._item:d},toggle:function(d){var b=k.node(d);b&&(b._expanded?(this.collapse(d),this._renderer.updateExpandVisuals(b,
!1)):(this.expand(d),this._renderer.updateExpandVisuals(b,!0)))},isExpanded:function(d){d=typeof d==="string"?d:this._treeModel.getId(d);return(d=k.node(d))?d._expanded:!1},expand:function(d,b,f){var d=typeof d==="string"?d:this._treeModel.getId(d),a=k.node(d);if(a&&!a._expanded){var e=this;this._renderer.updateExpandVisuals(a,!0);this._treeModel.getChildren(a._item,function(d){if(!e.destroyed){if(!a._expanded)a._expanded=!0,e._generateChildren(d,a._depth+1,a),e._rowsChanged();b&&b.apply(e,f)}})}},
_removeChildRows:function(d){for(var b=d===this._id,f=!1,a=-1,e=[],h=k.$$array(".treeTableRow",this._parent),g=0;g<h.length;g++){var c=h[g];if(f)break;if(b)c._depth>a?e.push(c):f=!0;else if(c.id===d)b=!0,a=c._depth}for(d=0;d<e.length;d++)b=e[d],b.parentNode.removeChild(b)},collapse:function(d){var d=typeof d==="string"?d:this._treeModel.getId(d),b=k.node(d);if(b){if(!b._expanded)return;b._expanded=!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&
this._onCollapse(b._item)}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function j(i,d){this.firstLevelChildren=i;this.reset();this._init(d)}j.prototype={_init:function(i){if(i)this.isExpanded=i.isExpanded,this.isExpandable=i.isExpandable,this.forceExpandFunc=i.forceExpandFunc,this.getChildrenFunc=i.getChildrenFunc},topLevel:function(i){return i.parent?i.parent===this.root:!0},_getChildren:function(i){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(i):i?i.children:
null},_expanded:function(i){if(!i)return!0;var d=this._getChildren(i),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(i));return d},_expandable:function(i){return!i?!0:this.isExpandable?this.isExpandable(i):!1},_diveIn:function(i){return this._expanded(i)?(this.setCursor(this._getChildren(i)[0]),this.cursor()):null},_drillToLast:function(i){return this._expanded(i)?(i=this._getChildren(i),this._drillToLast(i[i.length-1])):i},_forward:function(i){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(i&&this._expandable(this._cursor)&&this.forceExpandFunc){var b=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&b.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(i){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(i&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var b=this;return this.forceExpandFunc(d,"last",function(d){d&&
b.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(i,d){for(var b=this.topLevel(i),f=this._getChildren(i.parent),f=b?this.firstLevelChildren:f,a=0;a<f.length;a++)if(f[a]===i)return a===0&&!d?b?null:i.parent:a===f.length-1&&d?b?null:this._findSibling(i.parent,d):d?f[a+1]:f[a-1];return null},_inParentChain:function(i,d){for(var b=i.parent;b;){if(b===d)return!0;b=b.parent}return!1},_getTopLevelParent:function(i){if(this.topLevel(i))return i;for(i=i.parent;i;){if(this.topLevel(i))return i;
i=i.parent}return null},_onCollapse:function(i){return this._expanded(i.parent)?i:this._onCollapse(i.parent)},_scan:function(i,d,b){this.setCursor(d);var f=[];for(f.push(d);;){if(this.iterate(i))f.push(this.cursor());else break;if(b===this.cursor())return f}return null},setCursor:function(i){this._prevCursor=this._cursor;this._cursor=i},setTree:function(i){this.firstLevelChildren=i;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(i,d){var b=this.cursor(),
f=this._scan(!0,i,d);f||(f=this._scan(!1,i,d));this.setCursor(b);return f},iterate:function(i,d){return i?this._forward(d):this._backward(d)},iterateOnTop:function(i,d){var b=this._findSibling(this._getTopLevelParent(this.cursor()),i);b?this.setCursor(b):d&&this.firstLevelChildren.length>0&&this.setCursor(i?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(i){if(!this._cursor)return null;return this._inParentChain(this._cursor,i)?(this.setCursor(i),
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 j}();return j});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(j,k,i,d){var j={},b=navigator.userAgent.indexOf("iPad")!==-1,f=window.navigator.platform.indexOf("Mac")!==-1;j.ExplorerNavHandler=function(){function a(a,b,g){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var c=this;this._modelIterator=new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:g.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,d){return c.explorer.forceExpandFunc(a,b,d)}:void 0});this._init(g);(!g||g.setFocus!==!1)&&a.focus();g=function(a){if(d.isFormElement(a.target))return!0;if(c.explorer.preventDefaultFunc&&
c.explorer.preventDefaultFunc(a,c._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return c.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return c.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return c.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return c.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return c.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return c.onEnter(a)};a.addEventListener("keydown",g,!1);this._listeners.push({type:"keydown",listener:g});g=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);
else c.toggleCursor(null,!1)};a.addEventListener("blur",g,!1);this._listeners.push({type:"blur",listener:g});g=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};a.addEventListener("focus",g,!1);this._listeners.push({type:"focus",listener:g});this._parentDiv=a}a.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=
a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=a.postDefaultFunc},_ctrlKeyOn:function(a){return f?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(a):k.node(this.explorer._parentId)},isExpandable:function(a){return!a?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){b._clearSelection();for(var c=0;c<d.length;c++)b._selections.push(d[c]);b._selections.length>0?b.cursorOn(b._selections[0],
!0,!1,a):b.cursorOn();if(!(b._shiftSelectionAnchor&&b._inSelection(b._shiftSelectionAnchor)>=0))b._shiftSelectionAnchor=null})},refreshModel:function(a,b,d,c){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),b=0;b<this._selections.length;b++)if(a===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(a){if(this._selectionPolicy!==
a)this._selectionPolicy=a,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(a,b,d){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){!b||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a):(b=this._inSelection(a),b>=0?(this._checkRow(a,!0),this._selections.splice(b,1)):(this._checkRow(a,
!1),this._selections.push(a),this._lastSelection=a));if(d)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,b){a||(a=this.currentModel());var d=this._getGridChildren(a);if(d&&d.length>1||b===0&&d){b!==0&&this.toggleCursor(a,!1);var c=this._currentColumn,f=!0;c+=b;c<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():f=!1),
c=f?d.length-1:this._currentColumn):c>=d.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():f=!1),c=f?0:this._currentColumn);this._currentColumn=c;b!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var b=
this._parentDiv,d;a&&a!==b&&(d=a.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var d=this.getRowDiv(a),c=this.getCurrentGrid(a);c?(d&&(b?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),c.domNode&&(d=this.getAriaContainerElement(c.domNode),b?(c.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):
d&&(b?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,d,c){var f,m;if(a||b){if(m===this._modelIterator.cursor())return;f=this._modelIterator.cursor();m=a;this._modelIterator.setCursor(m)}else f=this._modelIterator.prevCursor(),m=this._modelIterator.cursor();if(f!==m||b)if(this.toggleCursor(f,!1),!b||m){this.moveColumn(null,0);this.toggleCursor(m,!0);if((a=this.getRowDiv())&&
!c){for(c=a.parentNode;c;){b=window.getComputedStyle(c,null);if(!b)break;b=b.getPropertyValue("overflow-y");if(b==="hidden"||b==="auto"||b==="scroll")break;c=c.parentNode}if(!c)c=document.body;b=!0;a.offsetTop<=c.scrollTop?(b=!1,d===void 0&&(d=!1)):a.offsetTop+a.offsetHeight>=c.scrollTop+c.clientHeight&&(b=!1,d===void 0&&(d=!0));b||a.scrollIntoView(!d)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(f,m)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=
[],b=0;b<this._selections.length;b++)a.push(this.model.getId(this._selections[b]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),b=this._navDict.getValue(a);return b&&b.rowDomNode?b.rowDomNode:k.node(a)},iterate:function(a,b,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),d&&(a=this._inSelection(this._modelIterator.prevCursor()),b=this._inSelection(this._modelIterator.cursor()),a>=0&&
b>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(a);if(d){var c=k.node(this.explorer.renderer.getCheckBoxId(d.id)),f=b?!c.checked:!0;if(f!==c.checked)this.explorer.renderer.onCheck(d,c,f,!0)}}else this._select(a,b)},_select:function(a){a||(a=this._modelIterator.cursor());var b=this.getRowDiv(a);b&&(this._inSelection(a)<0?b.classList.add("checkedRow"):
b.classList.remove("checkedRow"))},_onModelGrid:function(a,b){var d=this._getGridChildren(a);if(d)for(var c=0;c<d.length;c++)if(b.target===d[c].domNode)return!0;return!1},onClick:function(a,d){var g=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));if(d.target!==g&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,d)))if(this.cursorOn(a,!0,!1,!0),b)this.setSelection(a,!0);else if(this._ctrlKeyOn(d))this.setSelection(a,!0,!0);else if(d.shiftKey&&this._shiftSelectionAnchor){if(g=
this._modelIterator.scan(this._shiftSelectionAnchor,a)){this._clearSelection(!0);for(var c=0;c<g.length;c++)this.setSelection(g[c],!0)}}else this.setSelection(a,!1,!0)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),
!1,!0);a.preventDefault();return!1},_shouldMoveColumn:function(a){var b=this.currentModel(),d=this._getGridChildren(b);return d&&d.length>1?this.isExpandable(b)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),a.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1,!0))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),
!0,!0);a.preventDefault()},onEnter:function(a){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();else{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(d)}else if(this.explorer.renderer.getRowActionElement&&(b=this._modelIterator.cursor()))if(b=this.explorer.renderer.getRowActionElement(this.model.getId(b)),
b.href)this._ctrlKeyOn(a)?window.open(b.href):window.location.href=b.href}};return a}();j.ExplorerNavDict=function(){function a(a){this._dict={};this._model=a}a.prototype={addRow:function(a,b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var d=this._model.getId(a);if(this._dict[d]){if(!this._dict[d].gridChildren&&b)this._dict[d].gridChildren=[];return this._dict[d].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;
a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return j});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(j,k,i,d,b,f){var a={};a.Explorer=function(){function a(b,d,c,e){this.registry=b;this.renderer=c;this.selection=d;this.commandService=e;this.myTree=null}a.prototype={destroy:function(){this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();this.destroyed=!0},changedItem:function(a,b){this.myTree&&
this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,b,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=b+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=b+"placeHolderRow";var d=document.createElement("td");d.id=b+"placeHolderCol";
c.appendChild(d);a.appendChild(c);c=i.node(b+"placeHolderRow");a=i.node(b+"placeHolderCol");if(c&&a)return{tempNode:c,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return i.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this._expandRecursively(a[b])},_expandRecursively:function(a){if(this._navHandler&&
this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(a===void 0||a===null))for(var d=a.length,e=0;e<d;e++)b._expandRecursively(a[e])})})}},createTree:function(a,e,c){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=a+"innerTree",m=i.node(f);m&&i.empty(m);if(e)e.rootId=f;this.model=e;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=
c?c.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:f,model:e,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy===
"cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var c=a.getSelection(),d=0;d<c.length;d++){var e=a.getRowDiv(c[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&b.push(e.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:
null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new b.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var d=this;this.model.getRoot(function(c){c instanceof Array?d.getNavHandler().refreshModel(d.getNavDict(),
d.model,c):c.children&&c.children instanceof Array&&d.getNavHandler().refreshModel(d.getNavDict(),d.model,c.children);a&&a.setFocus&&d.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();a.createExplorerCommands=function(a,b){function d(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?b?b(a):!0:!1:!1}var c=new f.Command({tooltip:j["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()}}),l=new f.Command({tooltip:j["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()}});a.addCommand(c);a.addCommand(l)};a.ExplorerModel=function(){function a(b,d,c){this.rootPath=b;this.fetchItems=d;this.idPrefix=c||""}a.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=
c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return a}();a.ExplorerFlatModel=function(){function b(a,d,c){this.rootPath=a;this.fetchItems=d;this.root=c}b.prototype=new a.ExplorerModel;
b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return b}();a.ExplorerRenderer=function(){function a(b,d){this.explorer=d;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=
a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?
1:0},initTable:function(a,b){this.tableTree=b;i.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,e){var c=c||"tool",f=document.createElement("td");f.id=b.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,c,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));c.appendChild(d);var e=this;d.addEventListener("click",function(a){e.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,e){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&c.getSelectionPolicy()!=="cursorOnly"&&(a=window.sessionStorage[a+"selection"],typeof a==="string"&&(a=a.length>0?JSON.parse(a):null),a)){for(var d=[],c=0;c<
a.length;c++){var e=b.getValue(a[c]);if(e&&e.rowDomNode&&e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=i.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=
!1,c=window.sessionStorage[a+"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(i.node(c[d])){this._expanded.push(c[d]);var e=this;this.tableTree.expand(c[d],function(){e._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+
"__expand"},updateExpandVisuals:function(a,b){var c=i.node(this.expandCollapseImageId(a.id));c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,c,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(a.id);b.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(c){var f=document.createElement("span");b.appendChild(f);
f.classList.add(d||"imageSprite");f.classList.add(c)}var i=this;e.onclick=function(){i.tableTree.toggle(a.id);if(i.tableTree.isExpanded(a.id))i._expanded.push(a.id);else for(var c in i._expanded)if(i._expanded[c]===a.id){i._expanded.splice(c,1);break}(c=i._getUIStatePreferencePath())&&window.sessionStorage&&i._storeExpansions(c)};return e},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),
this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=i.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],d=i.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();
a.SelectionRenderer=function(){function b(a,d){this._init(a);this.explorer=d}b.prototype=new a.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);b.appendChild(c);d>0&&a.appendChild(b)};
b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,b);var d=this;b.addEventListener("click",function(c){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,e=this.getCellElement(c,a,b);e;)b.appendChild(e),c===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle()):e.classList.add("navColumn"):
this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();a.SimpleFlatModel=function(){function b(a,d,c){this.items=a;this.getKey=c;this.idPrefix=d;this.root={children:a}}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,
""),b="",c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return a});
define("orion/inputCompletion/inputCompletion",["i18n!orion/search/nls/messages","orion/EventTarget","orion/searchUtils"],function(j,k,i){function d(b,d,a){this._inputField=b;k.attach(this);if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);this._binderFunc=d;(b=a?a.group:null)||(b=this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=b+"__completion__";this._proposeFromStart=a?a.proposeFromStart:!1;this._extendedProvider=
a?a.extendedProvider:null;this._serviceRegistry=a?a.serviceRegistry:null;this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this.addEventListener("recentSearchesChanged",function(){this._binderFunc&&this._binderFunc(function(a){this._bind(a);this._proposeOn(this._inputField.value)}.bind(this))}.bind(this));this._completionUIContainer.addEventListener("mousedown",function(){this._mouseDown=!0}.bind(this));this._completionUIContainer.addEventListener("mouseup",
function(){this._mouseDown=!1}.bind(this));this._inputField.addEventListener("blur",function(){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),200):this._dismiss()}.bind(this));this._inputField.addEventListener("keydown",function(a){this.onKeyDown(a)}.bind(this));this._inputField.addEventListener("input",function(){this._proposeOn(this._inputField.value)}.bind(this));this._inputField.addEventListener("focus",function(){if(this._dismissed&&this._binderFunc)this._dismissing?
this._dismissing=!1:this._binderFunc&&this._binderFunc(function(a){this._bind(a)}.bind(this))}.bind(this))}d.prototype.onKeyDown=function(b){if(this._dismissed)return!0;var d=b.charCode||b.keyCode;if(d===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=0&&this._proposalIndex<this._proposalList.length)return b.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,b.ctrlKey),b.stopPropagation(),!1}else if((d===40||d===38)&&this._proposalList&&
this._proposalList.length>0)return b.preventDefault(),this._walk(d===40),b.stopPropagation(),!1;else if(d===27)return b.preventDefault(),this._dismiss(),!1;else if(d===46&&this._proposalIndex>-1)return b.preventDefault(),this._delete(),b.stopPropagation(),!1;return!0};d.prototype._bind=function(b){this._dataList=b};d.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};d.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};d.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)};d.prototype._createProposalLink=function(b,d,a,e){var h=
document.createElement("a");h.href=require.toUrl(d);h.appendChild(this._createBoldText(b,a,e));return h};d.prototype._createBoldText=function(b,d,a,e){if(d<0)return document.createTextNode(b);var e=e?e:document.createElement("span"),h;0!==d&&(h=document.createTextNode(b.substring(0,d)),e.appendChild(h));var g=document.createElement("b");e.appendChild(g);h=document.createTextNode(b.substring(d,d+a));g.appendChild(h);d+a<b.length-1&&(h=document.createTextNode(b.substring(d+a)),e.appendChild(h));return e};
d.prototype._proposeOnCategory=function(b,d){if(d.length!==0){var a;if(b){a=document.createElement("li");a.className="inputCompletionLICategory";var e=document.createTextNode(b);a.appendChild(e);this._completionUL.appendChild(a)}d.forEach(function(b){a=document.createElement("li");a.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);a.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);a.className="inputCompletionLINormal";a.completionItem=b.item;
var d;if(typeof b.item.value==="string"){var c=document.createElement("table");c.style.width="100%";c.style.tableLayout="fixed";c.style.borderSpacing="0";var e=document.createElement("tr");e.style.width=this._inputField.offsetWidth+"px";c.appendChild(e);d=document.createElement("td");var f=this._createBoldText(b.item.value,b.boldIndex,b.boldLength);d.appendChild(f);d.style.overflow="hidden";e.appendChild(d);d=document.createElement("button");d.classList.add("dismissButton");d.classList.add("layoutRight");
d.classList.add("core-sprite-close");d.classList.add("imageSprite");d.style.display="none";d.style.margin="0 0 0";d.title=j["Click or use delete key to delete the search term"];d.onclick=function(a){a.stopPropagation();this._proposalIndex=-1;i.removeRecentSearch(this._serviceRegistry,b.item.value,this)}.bind(this);f=document.createElement("td");f.style.width="16px";f.style.height="16px";f.appendChild(d);e.appendChild(f);a.appendChild(c)}else b.item.value.name&&b.item.value.type==="link"&&a.appendChild(this._createProposalLink(b.item.value.name,
b.item.value.value,b.boldIndex,b.boldLength));this._completionUL.appendChild(a);this._proposalList.push({item:b.item,domNode:a,deleteBtn:d})}.bind(this))}};d.prototype._domNode2Index=function(b){if(this._proposalList)for(var d=0;d<this._proposalList.length;d++)if(this._proposalList[d].domNode===b)return d;return-1};d.prototype._highlight=function(b,d){var a=b,e,h=!1;if(!isNaN(a))h=!0,this._proposalList&&b>=0&&b<this._proposalList.length?(a=this._proposalList[b].domNode,e=this._proposalList[b].deleteBtn):
a=null;if(a){a.className=d?"inputCompletionLISelected":"inputCompletionLINormal";if(e)e.style.display=d?"":"none";d&&h&&(a.offsetTop<this._completionUIContainer.scrollTop?a.scrollIntoView(!0):a.offsetTop+a.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&a.scrollIntoView(!1))}};d.prototype._selectProposal=function(b){var d=b;isNaN(d)&&(d=this._domNode2Index(b));if(d!==this._proposalIndex)this._highlight(this._proposalIndex,!1),this._proposalIndex=d,this._highlight(this._proposalIndex,
!0)};d.prototype._dismiss=function(b,d){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof b==="string")this._inputField.value=b,this._dismissing=!0,this._inputField.focus();else if(b&&b.name&&b.type==="link")d?window.open(b.value):window.location.href=b.value;window.setTimeout(function(){this._completionUIContainer.style.display="none"}.bind(this),200)}};d.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var b=0,d=0,
a=this._inputField;a;)b+=a.offsetLeft,d+=a.offsetTop,a=a.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=d+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=b+"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"};d.prototype._walk=function(b){b=
this._proposalIndex+(b?1:-1);b<-1?b=this._proposalList.length-1:b>=this._proposalList.length&&(b=-1);this._selectProposal(b)};d.prototype._delete=function(){return this._proposalIndex>-1?(i.removeRecentSearch(this._serviceRegistry,this._proposalList[this._proposalIndex].item.value,this),this._proposalIndex=-1,!0):!1};d.prototype._proposeOnList=function(b,d,a){var e="",h=[],g=d?d.length:0;b.forEach(function(c){if(c.type==="category")this._proposeOnCategory(e,h),e=c.label,h=[];else{var b=!0,m=-1;if(d&&
a){var i;typeof c.value==="string"?i=c.value.toLowerCase():c.value.name&&(i=c.value.name.toLowerCase());m=i.indexOf(d);m<0?b=!1:this._proposeFromStart&&(b=m===0)}b&&h.push({item:c,boldIndex:m,boldLength:g})}}.bind(this));this._proposeOnCategory(e,h)};d.prototype._proposeOn=function(b){this._completionUL.textContent="";var d=b?b.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,d,!0);this._extendedProvider&&d?this._extendedProvider(b,function(a){a&&a.forEach(function(a){this._proposeOnList(a.proposals,
a.filterForMe?d:b,a.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};d.prototype.constructor=d;return{InputCompletion:d}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",
ReadingMetadata:"Reading metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find",noResponse:"No response from server.  Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",
Project:"Project",New:"New",Add:"Add",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/widgets/filesystem/filesystemSwitcher","i18n!orion/edit/nls/messages,orion/objects,orion/webui/littlelib,orion/i18nUtil,orion/commands,orion/URL-shim".split(","),function(j,k,i,d,b){function f(a){this.commandRegistry=a.commandRegistry;this.rootChangeListener=a.rootChangeListener;this.filesystemChangeDispatcher=a.filesystemChangeDispatcher;this.fileClient=a.fileClient;this.node=a.node;this.serviceRegistry=a.serviceRegistry;var b=this;this.listener=function(a){b.refresh(a.root)};this.rootChangeListener&&
this.rootChangeListener.addEventListener("rootChanged",this.listener);this.render()}k.mixin(f.prototype,{destroy:function(){this.rootChangeListener&&this.rootChangeListener.removeEventListener("rootChanged",this.listener);this.commandRegistry.destroy(this.node);i.empty(this.node);this.rootChangeListener=this.filesystemChangeDispatcher=this.listener=this.node=null},registerCommands:function(){if(!this.commandsRegistered){this.commandsRegistered=!0;var a=this.commandRegistry,d=this.serviceRegistry,
f=new b.Command({name:j.ChooseFS,imageClass:"core-sprite-openarrow",selectionClass:"dropdownSelection",tooltip:j.ChooseFSTooltip,id:"orion.nav.switchfs",visibleWhen:function(){return d.getServiceReferences("orion.core.file").length>1},choiceCallback:this._switchFsMenuCallback.bind(this)});a.addCommand(f);a.registerCommandContribution("orion.mininav","orion.nav.switchfs",1)}},_switchFsMenuCallback:function(){var a=this;return this.serviceRegistry.getServiceReferences("orion.core.file").map(function(b){b=
b.getProperty("top");return{name:a._fileServiceLabel(b,!0),callback:a.setActiveFilesystem.bind(a,b)}})},render:function(){this.fsName=document.createElement("div");this.fsName.classList.add("filesystemName");this.fsName.classList.add("layoutLeft");this.menu=document.createElement("ul");this.menu.classList.add("filesystemSwitcher");this.menu.classList.add("commandList");this.menu.classList.add("layoutRight");this.menu.classList.add("pageActions");this.node.appendChild(this.fsName);this.node.appendChild(this.menu);
this.registerCommands();this.fsName.addEventListener("click",this._openMenu.bind(this))},_openMenu:function(){var a=i.$(".dropdownTrigger",this.menu);if(a){var b=document.createEvent("MouseEvents");b.initEvent("click",!0,!0);a.dispatchEvent(b)}},_fileServiceHostname:function(a){a=this.fileClient.fileServiceRootURL(a);a.indexOf("filesystem:")===0&&(a=a.substr(11));var b=a;try{b=(new URL(a,window.location.href)).hostname}catch(d){}return b},_fileServiceLabel:function(a,b){var f=this.fileClient.fileServiceName(a),
g=this._fileServiceHostname(a);if(b)return d.formatMessage(j.FSTitle,f,g);var c=document.createDocumentFragment();c.textContent=j.FSTitle;i.processDOMNodes(c,[document.createTextNode(f),document.createTextNode(g)]);return c},refresh:function(a){var b=a;if(a.ChildrenLocation)b=a.ChildrenLocation;i.empty(this.fsName);this.fsName.appendChild(this._fileServiceLabel(b));this.commandRegistry.destroy(this.menu);this.commandRegistry.renderCommands("orion.mininav",this.menu,{},"menu")},setActiveFilesystem:function(a){var b=
a;if(a.ChildrenLocation)b=a.ChildrenLocation;a=this.fileClient.fileServiceRootURL(b);this.filesystemChangeDispatcher&&this.filesystemChangeDispatcher.dispatchEvent({type:"filesystemChanged",newInput:a})}});return{FilesystemSwitcher:f}});define("text!orion/globalSearch/searchBuilder.html",[],function(){return'\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advSearchInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advSearchCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advReplaceInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advReplacePreviewCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchTypeLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<select id="advSearchTypes" class="search-control" style="min-width:10em;"></select>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSortByLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<select id="advSortBy" class="search-control" style="min-width:10em;"></select>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchCaseSensitiveLabel" class="search-label" ></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="checkbox" id="advSearchCaseSensitive" class="search-control"></input>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchRegExLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="checkbox" id="advSearchRegEx" class="search-control"></input>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advSaveSearchInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advSaveSearchCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class="searchOptionBlock" id="moreOptions">\n\t</div>'});
define("orion/globalSearch/advSearchOptContainer","i18n!orion/search/nls/messages,require,orion/fileClient,orion/searchUtils,orion/contentTypes,orion/i18nUtil,orion/webui/littlelib,orion/inputCompletion/inputCompletion,orion/Deferred,orion/commands,orion/section,orion/objects,orion/EventTarget,orion/widgets/filesystem/filesystemSwitcher,text!orion/globalSearch/searchBuilder.html".split(","),function(j,k,i,d,b,f,a,e,h,g,c,l,m,n,p){function t(a,c,b,e){m.attach(this);this._parentDiv=a;this._searcher=
c;this._serviceRegistry=b;this._commandService=e;this.fileClient=new i.FileClient(this._serviceRegistry);this.fsToolbar=null;this.fileSysChangeListener=function(a){a=d.generateSearchHref({resource:a.newInput});window.location=a};this.addEventListener("filesystemChanged",this.fileSysChangeListener);if(!this.fsToolbar)a=this.fsToolbar=document.createElement("div"),a.classList.add("fsToolbarLayout"),a.classList.add("fsToolbar"),this._parentDiv.parentNode.insertBefore(a,this._parentDiv);this.fsSwitcher=
new n.FilesystemSwitcher({commandRegistry:this._commandService,rootChangeListener:this,filesystemChangeDispatcher:this,fileClient:this.fileClient,node:this.fsToolbar,serviceRegistry:this._serviceRegistry})}function r(c,b,d,e){this._parent=a.node(c);this._optRenderer=new t(this._parent,b,d,e);this._optRenderer.render()}l.mixin(t.prototype,{destroy:function(){this.removeEventListener("filesystemChanged",this.fileSysChangeListener);this.fileSysChangeListener=null},getOptions:function(a){var c;a&&(c=
this._searchParams?this._searchParams.resource:this._searcher.getSearchRootLocation());return{keyword:this._searchBox.value,sort:this._sortBy.options[this._sortBy.selectedIndex].value,rows:40,start:0,replace:this._replaceBox.value?this._replaceBox.value:void 0,caseSensitive:this._caseSensitiveCB.checked,regEx:this._regExCB.checked,fileType:this._fileTypes.options[this._fileTypes.selectedIndex].value,resource:c}},loadSearchParams:function(a){this._searchParams=a;this._locationName=null;this.dispatchEvent({type:"rootChanged",
root:this.fileClient.fileServiceRootURL(this._searchParams.resource)});if(this._searchParams.resource.length>0)this._serviceRegistry.getService("orion.page.progress").progress(this.fileClient.read(this._searchParams.resource,!0),"Getting file metadata "+this._searchParams.resource).then(function(a){var c=a.Parents?d.fullPathNameByMeta(a.Parents):"";this._locationName=c.length===0?a.Name:c+"/"+a.Name;if(this._searchNameBox)this._searchNameBox.value=this._getDefaultSaveName()}.bind(this),function(){this._locationName=
"root";if(this._searchNameBox)this._searchNameBox.value=this._getDefaultSaveName()}.bind(this));else if(this._locationName="root",this._searchNameBox)this._searchNameBox.value=this._getDefaultSaveName();this._loadSearchParams()},_loadSearchParams:function(){if(this._init&&this._searchParams){this._searchBox.value=this._searchParams.keyword?this._searchParams.keyword:"";this._replaceBox.value=this._searchParams.replace?this._searchParams.replace:"";this._caseSensitiveCB.checked=this._searchParams.caseSensitive;
this._regExCB.checked=this._searchParams.regEx;var a;for(a=0;a<this._fileTypes.options.length;a++)if(this._fileTypes.options[a].value===this._searchParams.fileType){this._fileTypes.selectedIndex=a;break}for(a=0;a<this._sortBy.options.length;a++)if(this._sortBy.options[a].value===this._searchParams.sort){this._sortBy.selectedIndex=a;break}}},render:function(){var a=this._serviceRegistry.getService("orion.core.contentTypeRegistry");a?a.getContentTypes().then(function(a){this.contentTypesCache=a;this._render()}.bind(this)):
(a=new b.ContentTypeRegistry(this._serviceRegistry),this.contentTypesCache=a.getContentTypes(),this._render())},_render:function(){this._parentDiv.innerHTML=p;this._initHTMLLabels();this._initControls();this._searchBox.focus()},_submitSearch:function(){var a=this.getOptions();a.replace=null;d.doSearch(this._searcher,this._serviceRegistry,a.keyword,a)},_replacePreview:function(){var a=this.getOptions();if(!a.replace)a.replace="";a.keyword&&d.doSearch(this._searcher,this._serviceRegistry,a.keyword,
a)},_saveSearch:function(){if(this._searchBox.value&&this._searchNameBox.value){var a=this.getOptions(!0),a=d.generateSearchHref(a).split("#")[1];this._serviceRegistry.getService("orion.core.savedSearches").addSearch(this._searchNameBox.value,a)}},_getDefaultSaveName:function(){if(this._searchBox&&this._searchBox.value){var a="'"+this._searchBox.value+"' in ",c="root";if(this._locationName)c=this._locationName;return a+c}return""},_initCompletion:function(){var a=function(a){d.getMixedSearches(this._serviceRegistry,
!0,!1,function(c){var b,d=[],e=!1,g=!1;for(b in c)c[b].label&&c[b].value?(e||(d.push({type:"category",label:j["Saved searches"]}),e=!0),d.push({type:"proposal",value:{name:c[b].label,value:k.toUrl("search/search.html")+"#"+c[b].value,type:"link"}})):(g||(d.push({type:"category",label:j["Recent searches"]}),g=!0),d.push({type:"proposal",label:c[b].name,value:c[b].name}));a(d)})}.bind(this),c=function(a,c){var b=this._serviceRegistry.getServiceReferences("orion.search.proposal");if(!b||b.length===0)c(null);
else{var d=[];b.forEach(function(c){var b=c.getProperty("filterForMe");d.push(this._serviceRegistry.getService(c).run(a).then(function(a){for(var c={filterForMe:b,proposals:[]},d=0;d<a.length;d++){c.proposals.push({type:"category",label:a[d].category});for(var o=0;o<a[d].datalist.length;o++)c.proposals.push({type:"proposal",label:a[d].datalist[o],value:a[d].datalist[o]})}return c}))}.bind(this));h.all(d).then(function(a){c(a)})}}.bind(this);this._completion=new e.InputCompletion(this._searchBox,a,
{serviceRegistry:this._serviceRegistry,group:"globalSearch",extendedProvider:c})},_initControls:function(){this._searchBox=document.getElementById("advSearchInput");this._replaceBox=document.getElementById("advReplaceInput");this._searchNameBox=document.getElementById("advSaveSearchInput");this._fileTypes=document.getElementById("advSearchTypes");this._sortBy=document.getElementById("advSortBy");this._caseSensitiveCB=document.getElementById("advSearchCaseSensitive");this._regExCB=document.getElementById("advSearchRegEx");
for(var a=[{label:j["All types"],value:d.ALL_FILE_TYPE}],c=0;c<this.contentTypesCache.length;c++)if(this.contentTypesCache[c]["extends"]==="text/plain"||this.contentTypesCache[c].id==="text/plain")for(var b=0;b<this.contentTypesCache[c].extension.length;b++)a.push({label:this.contentTypesCache[c].extension[b],value:this.contentTypesCache[c].extension[b]});a.forEach(function(a){var c=document.createElement("option"),b=document.createTextNode(a.label);c.appendChild(b);this._fileTypes.appendChild(c);
c.value=a.value}.bind(this));[{label:j["Path name"],value:"Path asc"},{label:j["File name"],value:"NameLower asc"}].forEach(function(a){var c=document.createElement("option"),b=document.createTextNode(a.label);c.appendChild(b);this._sortBy.appendChild(c);c.value=a.value}.bind(this));this._init=!0;this._loadSearchParams();this._initCompletion();this._searchBox.addEventListener("keydown",function(a){a.defaultPrevented||(a.charCode||a.keyCode)===13&&this._submitSearch()}.bind(this));this._searchBox.addEventListener("change",
function(){this._searchNameBox.value=this._getDefaultSaveName()}.bind(this));this._replaceBox.addEventListener("keydown",function(a){(a.charCode||a.keyCode)===13&&this._replacePreview()}.bind(this));this._fileTypes.addEventListener("change",function(){var a=this._fileTypes.options[this._fileTypes.selectedIndex].value;this._searchBox.placeholder=a===d.ALL_FILE_TYPE?j["Type a search term"]:f.formatMessage(j["All ${0} files"],a)}.bind(this));a=new g.Command({name:j.Search,id:"orion.globalSearch.search",
callback:function(){this._submitSearch()}.bind(this),visibleWhen:function(){return!0}});c=new g.Command({name:j.Replace,id:"orion.globalSearch.previewCurrentPage",callback:function(){this._replacePreview()}.bind(this),visibleWhen:function(){return!0}});b=new g.Command({name:j.Save,tooltip:j["Save the current search"],id:"orion.globalSearch.saveSearch",callback:function(){this._saveSearch()},visibleWhen:function(){return!0}});this._commandService.addCommand(a);this._commandService.addCommand(c);this._commandService.addCommand(b);
this._commandService.registerCommandContribution("advSearchCmd","orion.globalSearch.search",1);a=[];this._commandService.renderCommands("advSearchCmd","advSearchCmd",this,this,"button",null,a);a[0].domNode.classList.add("search-button");this._commandService.registerCommandContribution("advReplacePreviewCmd","orion.globalSearch.previewCurrentPage",1);a=[];this._commandService.renderCommands("advReplacePreviewCmd","advReplacePreviewCmd",this,this,"button",null,a);a[0].domNode.classList.add("search-button");
this._commandService.registerCommandContribution("advSaveSearchCmd","orion.globalSearch.saveSearch",1);a=[];this._commandService.renderCommands("advSaveSearchCmd","advSaveSearchCmd",this,this,"button",null,a);a[0].domNode.classList.add("search-button")},_initHTMLLabels:function(){document.getElementById("advSearchInput").placeholder=j["Type a search term"];document.getElementById("advReplaceInput").placeholder=j["Type a replace term"];document.getElementById("advSaveSearchInput").placeholder=j["Type a name for the search"];
document.getElementById("advSearchTypeLabel").appendChild(document.createTextNode(j["File type"]));document.getElementById("advSearchCaseSensitiveLabel").appendChild(document.createTextNode(j["Case sensitive"]));document.getElementById("advSearchRegExLabel").appendChild(document.createTextNode(j["Regular expression"]));document.getElementById("advSortByLabel").appendChild(document.createTextNode(j["Sort by"]))}});r.prototype.getRenderer=function(){return this._optRenderer};r.prototype.constructor=
r;return{AdvSearchOptContainer:r,AdvSearchOptRenderer:t}});
define("orion/searchOutliner","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/section,orion/commands,orion/commandRegistry,orion/keyBinding,orion/selection,orion/explorers/explorer,orion/EventTarget,orion/globalSearch/advSearchOptContainer,orion/webui/splitter".split(","),function(j,k,i,d,b,f,a,e,h,g,c,l,m){function n(a){this._searches=[];c.attach(this);this._init(a);this._initializeSearches()}function p(a,c){this.explorer=c;this._init(a)}function t(a,c){this.selection=
c;this.registry=a;this.renderer=new p({checkbox:!1},this)}function r(c){var b=i.node(c.parent);if(!b)throw"no parent";if(!c.serviceRegistry)throw"no service registry";this._parent=b;this._registry=c.serviceRegistry;this.commandService=c.commandService;var b=new f.Command({name:j.Rename,imageClass:"core-sprite-rename",id:"eclipse.renameSearch",parameters:new a.ParametersDescription([new a.CommandParameter("name","text","Name:","")]),visibleWhen:function(a){a=Array.isArray(a)?a:[a];return a.length===
1&&a[0].query},callback:function(a){var c=Array.isArray(a.items)?a.items[0]:a.items;a.parameters&&a.parameters.valueFor("name")&&this._registry.getService("orion.core.savedSearches").renameSearch(c.query,a.parameters.valueFor("name"))}.bind(this)}),e=new f.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteSearch",visibleWhen:function(a){a=Array.isArray(a)?a:[a];if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!a[c].query)return!1;return!0},callback:function(a){var a=Array.isArray(a.items)?
a.items:[a.items],b=a.length===1?d.formatMessage("Are you sure you want to delete '${0}' from the searches?",a[0].name):d.formatMessage("Are you sure you want to delete these ${0} searches?",a.length);if(window.confirm(b))for(b=0;b<a.length;b++)c.serviceRegistry.getService("orion.core.savedSearches").removeSearch(a[b].query)}});this.commandService.addCommand(b);this.commandService.addCommand(e);if(b=this._registry.getService("orion.core.savedSearches")){var q=this._registry;b.getSearches().then(function(a){this.render(a.searches,
q)}.bind(this));b.addEventListener("searchesChanged",function(a){this.render(a.searches,a.registry)}.bind(this))}}function s(a){var c=i.node(a.parent);if(!c)throw"no parent";if(!a.serviceRegistry)throw"no service registry";this._parent=c;this._registry=a.serviceRegistry;this.commandService=a.commandService;this.advSearchOptContainer=new l.AdvSearchOptContainer(this._parent,a.searcher,this._registry,this.commandService);var a=i.node("outlineContainer"),b=i.$("#outlineTop",a),d=i.$("#outlineBottom",
a),o=i.$(".outlinerSplitLayout",a);o.id="searchOutlineSplitter";window.setTimeout(function(){this._splitter=new m.Splitter({node:o,sidePanel:b,mainPanel:d,toggle:!0,vertical:!0})},100)}n.prototype={_init:function(a){this._registry=a.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.savedSearches",this)},_notifyListeners:function(){this.dispatchEvent({type:"searchesChanged",searches:this._searches,registry:this._registry})},_initializeSearches:function(){var a=this;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var b,c=c.get("search");typeof c==="string"&&(c=JSON.parse(c));if(c)for(b in c)a._searches.push(c[b]);a._notifyListeners()})},_storeSearches:function(){var a=this._searches;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("search",a)})},addSearch:function(a,c){var b=!1,d;for(d in this._searches)if(this._searches[d].query===c)this._searches[d].name=
a,b=!0;b?this._registry.getService("orion.page.message").setMessage(a+" is already saved.",2E3):this._searches.push({name:a,query:c});this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},removeSearch:function(a){for(var c in this._searches)if(this._searches[c].query===a){this._searches.splice(c,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(a,c){var b=!1,d;for(d in this._searches)if(this._searches[d].query===
a){var o=this._searches[d];if(o.name!==c)o.name=c,b=!0}b&&(this._searches.sort(this._sorter),this._storeSearches(),this._notifyListeners())},getSearches:function(){return{searches:this._searches}},_sorter:function(a,c){var b=a.name.toLowerCase(),d=c.name.toLowerCase();return b>d?1:b<d?-1:0}};p.prototype=g.SelectionRenderer.prototype;p.prototype.constructor=p;p.prototype.getLabelColumnIndex=function(){return 0};p.prototype.getCellElement=function(a,c,b){if(c.query){var a=k.toUrl("search/search.html")+
"#"+c.query,d=document.createElement("td");b.appendChild(d);d.classList.add("mainNavColumn");d.classList.add("singleNavColumn");b=document.createElement("a");b.href=a;b.className="navlinkonpage";d.appendChild(b);b.appendChild(window.document.createTextNode(c.name))}};t.prototype=g.Explorer.prototype;t.prototype.constructor=t;r.prototype={render:function(a,c){var d=this.commandService;if(!this.searchesSection){this.searchesSection=new b.Section(this._parent,{id:"searchSection",title:j["My Saved Searches"],
content:'<div id="searchContent"></div>',useAuxStyle:!0,preferenceService:c.getService("orion.core.preference"),slideout:!0});this.searchSelection=new h.Selection(c,"orion.searches.selection");var q=this.searchesSection.selectionNode.id,o;o=new e.KeyBinding(113);o.domScope="searchContent";o.scopeName=j["My Saved Searches"];this.commandService.registerCommandContribution(q,"eclipse.renameSearch",1,null,!1,o);o=new e.KeyBinding(46);o.domScope="searchContent";o.scopeName=j["My Saved Searches"];this.commandService.registerCommandContribution(q,
"eclipse.deleteSearch",2,null,!1,o);d.registerSelectionService(q,this.searchSelection);c.getService("orion.searches.selection").addEventListener("selectionChanged",function(a){var c=i.node(q);c&&(d.destroy(c),d.renderCommands(q,c,a.selections,this,"button"))})}if(a.length>0)this.searchTable=(new t(c,this.searchSelection)).createTree("searchContent",new g.SimpleFlatModel(a,"srch",function(a){return a.query}));else if(o=i.node("searchContent")){var f=document.createElement("p");f.textContent=j["Save frequently used searches by clicking on the ${0} button above."];
var l=document.createElement("b");l.textContent=j.Save;i.processDOMNodes(f,[l]);i.empty(o);o.appendChild(f)}}};r.prototype.constructor=r;s.prototype={loadSearchParams:function(a){this.advSearchOptContainer.getRenderer().loadSearchParams(a)}};s.prototype.constructor=r;return{SavedSearches:n,SearchOutliner:r,SearchBuilder:s}});
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(j,k,i,d,b,f,a,e){function h(d,e,g,h,i,j,s,v,w){var e=f.clone(e),u;if(e.Directory)u=document.createElement("a"),u.className="navlinkonpage",u.href=!d?c:(new a(d+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&u.appendChild(document.createTextNode(e.Name));
else{i||(i=b.getOpenWithCommands(g));if(!j)for(d=0;d<i.length;d++)i[d].isEditor==="default"&&(j=i[d]);u=document.createElement("a");u.className="navlink targetSelector";s&&typeof s==="object"&&Object.keys(s).forEach(function(a){u[a]=s[a]});var q=null,o=null;if(q=w?w.holderDom:u)o=document.createElement("span"),o.className="core-sprite-file modelDecorationSprite",q.appendChild(o);e.Name&&u.appendChild(document.createTextNode(e.Name));var x=!1,C=e.Location;if(v&&typeof v==="object")e.params={},f.mixin(e.params,
v);for(d=0;d<i.length;d++)if(v=i[d],v.visibleWhen(e)){C=v.hrefCallback({items:e});x=!0;break}k.when(h.getFileContentType(e),function(a){var c;if(c=!x)if(c=j){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":c=!0;break a}c=!1}c=!c}c&&(C=j.hrefCallback({items:e}));if(q){c=q;var b=e.Location,d=o,g;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":g=document.createElement("img");
g.src=b;g.classList.add("thumbnail");break;default:if(a&&a.image)g=document.createElement("img"),g.src=a.image,g.classList.add("thumbnail")}g&&c.replaceChild(g,d)}u.href=C})}return u}function g(a,c,b,d){this.explorer=c;this.commandService=b;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var c=new a("#{,resource,params*}");g.prototype=new i.SelectionRenderer;g.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};
g.prototype.tableCallback=function(a){a.setAttribute("aria-label",j.Navigator);a.setAttribute("role","presentation")};g.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};g.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var d=document.createElement("div");d.classList.add("noFile");d.textContent=j.NoFile;var g=document.createElement("span");g.classList.add("core-sprite-addcontent");g.classList.add("icon-inline");
g.classList.add("imageSprite");e.processDOMNodes(d,[g]);b.appendChild(d);c.appendChild(b);a.appendChild(c)};g.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"}};g.prototype.setTarget=function(a){this.target=a};g.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};g.prototype.createFolderNode=
function(a){var c;this.showFolderLinks?(c=h(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&c.insertBefore(a,c.firstChild)):(c=document.createElement("span"),c.textContent=a.Name);return c};g.prototype.showFolderLinks=!0;g.prototype.getCellElement=function(a,c,e){switch(a){case 0:var a=document.createElement("td"),g=document.createElement("span");g.id=e.id+"MainCol";g.setAttribute("role","presentation");a.appendChild(g);a.setAttribute("role","presentation");
g.className="mainNavColumn";var f;if(c.Directory)this.getExpandImage(e,g),f=this.createFolderNode(c),g.appendChild(f),this.explorer._makeDropTarget(c,f),this.explorer._makeDropTarget(c,e);else{if(!this.openWithCommands){this.openWithCommands=b.getOpenWithCommands(this.commandService);for(f=0;f<this.openWithCommands.length;f++)if(this.openWithCommands[f].isEditor==="default")this.defaultEditor=this.openWithCommands[f]}f=h("",c,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
{target:this.target});g.appendChild(f)}if(f)f.id=e.id+"NameLink",f.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),c,f),f.setAttribute("role","link"),f.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,c,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;e=document.createElement("td");if(c.LocalTimeStamp)e.textContent=(new Date(c.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;
e=document.createElement("td");if(!c.Directory&&typeof c.Length==="number")c=parseInt(c.Length,10)/1024,e.textContent=Math.ceil(c).toLocaleString()+" KB";e.style.textAlign="right";return e}};g.prototype.constructor=g;return{NavigatorRenderer:g,createLink:h}});
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(j,k,i,d,b,f,a,e,h){function g(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new g(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}g.prototype.makeRenderFunction=function(c,g,f,p,t){var r=this.serviceRegistry,s=this.commandRegistry;this.openWithCommands=this.openWithCommands||e.createOpenWithCommands(r,c,s);var v=this;return function(e,r,q,o){h.when(v.openWithCommands,function(x){if(q)i.empty(g),x=document.createElement("div"),x.appendChild(document.createTextNode(j["Search failed."])),g.appendChild(x),typeof p==="function"&&p(g);else{var h=
function(){function a(c,b){var d=b.folderName?b.folderName:b.path,o=document.createElement("span");o.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");o.appendChild(document.createTextNode(" - "+d+" "));c.appendChild(o)}var c={};return function(b,d){var o=d.name;if(c.hasOwnProperty(o)){a(b,d);var e=c[o];typeof e==="function"&&(c[o]=null,e())}else c[o]=function(){a(b,d)}}}(),E=!1;i.empty(g);if(e&&e.length>0){var D=document.createElement("table");D.setAttribute("role","presentation");for(var y=0;y<e.length;y++){var B=
e[y],A;if(!E&&(E=!0,f))A=D.insertRow(0).insertCell(0),A.textContent=f;A=D.insertRow(-1).insertCell(0);A.colspan=2;t&&t(A);var F={Name:B.name,Directory:B.directory,Location:B.path||B.location},z=null;if(typeof B.LineNumber==="number")z={},z.line=B.LineNumber;if(o&&o.keyword&&!o.nameSearch){var I=b.generateSearchHelper(o),z=z||{};z.find=I.inFileQuery.searchStr;z.regEx=I.inFileQuery.wildCard?!0:void 0}F=a.createLink(k.toUrl("edit/edit.html"),F,s,c,x,null,{"aria-describedby":(B.folderName?B.folderName:
B.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}},z);B.LineNumber&&F.appendChild(document.createTextNode(" (Line "+B.LineNumber+")"));A.appendChild(F);h(A,B)}g.appendChild(D);typeof p==="function"&&p(g)}!E&&r&&(x=d.formatMessage(j["No matches found for ${0}"],r),i.empty(g),g.appendChild(document.createTextNode(x)),typeof p==="function"&&p(g))}})}};c.prototype={search:function(a,c,d){var e=function(a){for(var c=[],d=0;d<a.response.docs.length;d++){var e=a.response.docs[d];c.push({name:e.Name,
path:e.Location,folderName:b.path2FolderName(e.Path?e.Path:e.Location,e.Name),directory:e.Directory,lineNumber:e.LineNumber})}return c};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){d(e(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var b=a.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);d(e(c),b,null,a)},function(a){d(null,null,a,null)})}catch(g){typeof g===
"string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(c){d(e(c),null,null,a)}):typeof g==="string"&&g.indexOf("search")>-1&&!a.nameSearch?(new f.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){d(e(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,c){console.error(a);
i.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>0?e=c.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),
this._childrenLocation=a.ChildrenLocation;e=i.node("search");b||(b="");if(e&&e.placeholder){e.value="";var g=d.formatMessage(j["Search ${0}"],b);e.placeholder=g.length>30?g.substring(0,27)+"...":d.formatMessage(j["Search ${0}"],b)}if(e&&e.title)e.title=j["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?
this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,d){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,
sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,keyword:a,replace:d?d.replace:void 0}}};c.prototype.constructor=c;return{Searcher:c}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,k){function i(a,b,d){return a[b].apply(a,d)}function d(a){this._location=a}function b(){var a=new k;a.reject(j["No Matching OperationService for location:"]+this._location);return a}function f(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
f=0;f<b.length;f++){var g=a.getService(b[f]);this._services[f]=g;g=b[f].getProperty("pattern")||".*";g[0]!=="^"&&(g="^"+g);this._patterns[f]=RegExp(g)}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 d(a)}}d.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};d.prototype.constructor=d;f.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var b=this;this._preferenceService.getPreferences("/operations").then(function(d){b._operations=d;a.resolve(b._operations)});return a},getOperation:function(a){return i(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,d=0;d<this._services.length;d++){var g=this._patterns[d],c=new k;a[d]=c.promise;i(this._services[d],"removeCompletedOperations").then(function(a){return function(c){Array.isArray(c)&&
b.getOperations.bind(b)().then(function(b){for(var d=b.keys(),e=0;e<d.length;e++){var f=d[e];g.test(f)&&c.indexOf(f)<0&&b.remove(f)}a.resolve()})}}(c),function(a){return function(c){a.reject(c)}}(c))}return k.all(a)},removeOperation:function(a){var b=this;return i(this._getService(a),"removeOperation",arguments).then(function(){b.getOperations.bind(b)().then(function(b){b.remove(a)})},function(a){return a},function(a){return a})}};f.prototype.constructor=f;return{OperationsClient:f}});
define("text!orion/globalSearch/search-features.html",[],function(){return'<div id="replaceTopWidget_id" style="height:100%;width:100%;position:relative;">\n\t<div id="replaceTop" class="topPanelLayout">\n\t</div>\n\t<div class="replaceSplitLayout"></div>\n\t<div id="replaceBottom" class="bottomPanelLayout">\n\t</div>\n</div>'});
define("orion/globalSearch/search-features",["orion/webui/littlelib","orion/webui/splitter","orion/globalCommands","text!orion/globalSearch/search-features.html"],function(j,k,i,d){var b=b||{};b.SearchUIFactory=function(){function b(a){this._parentDivID=a.parentDivID}b.prototype={buildUI:function(){var a=j.node(this._parentDivID);a.innerHTML=d;var b=j.$("#replaceTop",a),f=j.$("#replaceBottom",a),a=j.$(".replaceSplitLayout",a);a.id="replaceSplitter";var g=new k.Splitter({node:a,sidePanel:b,mainPanel:f,
vertical:!0});window.setTimeout(function(){g._adjustToSplitPosition(!0)},100);g.addResizeListener(function(a){a===f&&this._compareWidget&&this._compareWidget.resizeEditors&&this._compareWidget.resizeEditors()}.bind(this));var c=i.getMainSplitter();c&&c.splitter&&c.splitter.addResizeListener(function(a){a===c.main&&this._compareWidget&&this._compareWidget.getSplitter()&&this._compareWidget.getSplitter()._adjustToSplitPosition(!0)}.bind(this))},destroy:function(){},setCompareWidget:function(a){this._compareWidget=
a},getMatchDivID:function(){return"replaceTop"},getCompareDivID:function(){return"replaceBottom"}};return b}();return b});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t<div class="compareEditorParent" id="left_editor_id"></div>\n\t\t<div class="statusContainer" id="left_status_id"></div>\n\t</div>\n\t<div class="split compareSplitLayout"></div>\n\t<div class="rightPanelLayout">\n\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t<div class="compareEditorParent"  id="right_editor_wrapper_id">\n\t\t\t<div class="canvasContainer">\n\t\t\t\t<canvas id="diff_canvas_id" class="compareCanvas" width="46" height="3000"></canvas>\n\t\t\t</div>\n\t\t\t<div class="compareEditorParentWithCanvas" id="right_editor_id"></div>\n\t\t</div>\n\t\t<div class="statusContainer" id="right_status_id"></div>\n\t</div>\n</div>'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(j,k,i){var d=d||{};d.TwoWayCompareUIFactory=function(){function b(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}b.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=
b+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var b=j.$(".split",this._topWidgetDiv);b.id=this._splitterId;var a=j.$(".leftPanelLayout",this._topWidgetDiv),d=j.$(".rightPanelLayout",this._topWidgetDiv);if(b&&a&&d)this._splitter=new k.Splitter({node:b,sidePanel:a,mainPanel:d})},buildUI:function(){j.node(this._parentDivID).innerHTML=
i;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return j.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return b}();return d});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/compare/diffParser",[],function(){var j=j||{};j.DiffParser=function(){function j(d,b){this._lineDelimiter=d?d:i?"\r\n":"\n";this._diffLineDelimiter=b?b:this._lineDelimiter;this._DEBUG=!1}var i=window.navigator.platform.indexOf("Win")!==-1;j.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(d){this._diffLineDelimiter=this._lineDelimiter=d},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(d,b,f,a){this._init();if(b==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=b.split(this._diffLineDelimiter);b=this._diffContents.length;this._hunkRanges=[];for(var e=0;e<b;e++){var h=this._parseHunkRange(e);h&&this._hunkRanges.push(h)}if(0===this._hunkRanges.length)return{outPutFile:d,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(d=0;d<this._hunkRanges.length;d++)this._parseHunkBlock(d);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(f);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));a||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var d=0;d<this._deltaMap.length;d++)if(console.log(JSON.stringify(this._deltaMap[d])),
this._deltaMap[d][2]>0){console.log("    **Diff content on change/add: \n");for(var b=0;b<this._deltaMap[d][0];b++)console.log("    "+this._diffContents[this._deltaMap[d][2]+b-1])}},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,b,f,a){a===f&&d===" "||(f=[f,a-f,"s"],d==="-"?f[2]="r":d==="+"?f[2]="a":d==="c"&&(f[2]="c"),b.push(f))},_createMinusBlock:function(d,b,f){var a=this._oBlocks.length;a===0||d!==this._oBlocks[a-
1][0]?(this._oBlocks.push([d===0?1:d,f]),this._nBlocks.push([b,0,-2])):this._oBlocks[a-1][1]+=f},_createPlusBlock:function(d,b,f,a){var e=this._nBlocks.length;e===0||b!==this._nBlocks[e-1][0]?(this._oBlocks.push([d===0?1:d,0]),this._nBlocks.push([b,f,a])):(this._nBlocks[e-1][1]+=f,this._nBlocks[e-1][2]=a)},_parseHunkBlock:function(d){for(var b=" ",f=this._hunkRanges[d][0]+1,a=d===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[d+1][0],e=0,h=0,g=this._hunkRanges[d][1],c=this._hunkRanges[d][3],
l=f,m=f;m<a;m++)if(0!==this._diffContents[m].length){var i=this._diffContents[m][0];if(i==="\\"&&("\\ 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]))b==="-"?this._oNewLineAtEnd=!1:b===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,m>f&&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(i){case "-":case "+":case " ":break;default:continue}if(b!==i){i==="+"&&(l=m);switch(b){case " ":g=this._hunkRanges[d][1]+e;c=this._hunkRanges[d][3]+h;break;case "-":this._createMinusBlock(g,c,this._hunkRanges[d][1]+e-g);break;case "+":this._createPlusBlock(g,c,this._hunkRanges[d][3]+h-c,l)}b=i}switch(i){case "-":e++;break;case "+":h++;break;case " ":e++,h++}}}switch(b){case "-":this._createMinusBlock(g,c,this._hunkRanges[d][1]+e-g);break;case "+":this._createPlusBlock(g,
c,this._hunkRanges[d][3]+h-c,l)}},_detectConflictes:function(d,b){if(d<0)return!1;for(var f=d+b,a=d;a<f;a++){var e=this._diffContents[a];if(e.indexOf("<<<<<")>-1||e.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(d){var b=this._oBlocks.length,f=this._oFileContents.length,a=0,e;e=1;for(var h=0;h<b;h++)e=this._oBlocks[h][0]-e,e>0&&(this._deltaMap.push([e,e,0]),a+=e),d&&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]),a+=this._oBlocks[h][1],e=this._oBlocks[h][0]+this._oBlocks[h][1];0<f-e&&(this._deltaMap.push([f-e+1,f-e+1,0]),a+=f-e+1);a<f&&(e=f-a,d=this._deltaMap[this._deltaMap.length-1],d[2]===0?(d[0]+=e,d[1]+=e):d[2]===-1?this._deltaMap.push([e,e,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([e,e,0]):(this._nNewLineAtEnd&&(d[0]+=e),this._oNewLineAtEnd&&(d[1]+=e)))},_buildNewFile:function(){var d=
1,b=!1,f=this._deltaMap.length,a,e;for(a=0;a<f;a++){b=!1;if(this._deltaMap[a][2]===0){for(e=0;e<this._deltaMap[a][0];e++)this._nFileContents.push(this._oFileContents[d+e-1]);b=!0}else if(this._deltaMap[a][2]>0)for(e=0;e<this._deltaMap[a][0];e++)this._nFileContents.push(this._diffContents[this._deltaMap[a][2]+e-1].substring(1));d+=this._deltaMap[a][1]}this._nNewLineAtEnd&&!b&&this._nFileContents.push("")},_parseHRangeBody:function(d,b){if(0<d.indexOf(",")){var f=d.split(","),a=parseInt(f[0],10),f=
parseInt(f[1],10);b.push(a>=0?a:1);b.push(f>=0?f:1)}else a=parseInt(d,10),b.push(a>=0?a:1),b.push(1)},_parseHunkRange:function(d){var b=this._diffContents[d];if(8>b.length)return null;if("@@"!==b.substring(0,2))return null;var b=b.substring(2),f=b.indexOf("@@");if(f<0)return null;var b=b.substring(0,f),f=b.indexOf("-"),a=b.indexOf("+");if(f<0||a<0)return null;d=[d];f<a?(b=b.substring(f+1).split("+"),this._parseHRangeBody(b[0],d),this._parseHRangeBody(b[1],d)):(b=b.substring(a+1).split("-"),this._parseHRangeBody(b[1],
d),this._parseHRangeBody(b[0],d));return d}};return j}();return j});
define("orion/compare/compareUtils",["orion/URITemplate"],function(j){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(i,d,b){for(var f=0,a=0;a<i.length;a++){var e=i[a][d];e===0&&(e=1);if(b>=f&&b<f+e)return{mapperIndex:a,startFrom:f};if(a===i.length-1)break;f+=i[a][d]}return{mapperIndex:i.length-1,startFrom:f}};k.compareUtils.lookUpLineIndex=function(i,d,b){if(b===0)return 0;for(var f=0,a=0;a<b;a++)f+=i[a][d];return f};k.compareUtils.updateMapper=function(i,d,b,f,
a){if(f!==a&&(f>0||a>0)){var e=k.compareUtils.lookUpMapper(i,d,b);if(!(e.mapperIndex<0)){if(f>0)for(var h=b-e.startFrom,b=e.mapperIndex;b<i.length;b++){h=i[b][d]-h;if(f<=h){i[b][d]-=f;break}i[b][d]-=h;f-=h;h=0}a>0&&(i[e.mapperIndex][d]+=a)}}};k.compareUtils.overlapMapper=function(i,d,b,f,a){i=b+i[d]-1;i<b&&(i=b);a<f&&(a=f);return i<f||a<b?!1:!0};k.compareUtils.findFirstDiff=function(i,d,b,f){for(var a=0,e=null,h=0;h<i.length;h++){if(a>f)break;if(k.compareUtils.overlapMapper(i[h],d,a,b,f)&&(e={mapperIndex:h,
startFrom:a},i[h][2]!==0))break;a+=i[h][d]}return e};k.compareUtils.matchMapper=function(i,d,b,f){if(i.length===0)return b;var a=b+Math.round((f-b)/3),e=k.compareUtils.findFirstDiff(i,d,b,f),h=i[e.mapperIndex][d]===0?e.startFrom:e.startFrom+i[e.mapperIndex][d]-1,g=k.compareUtils.lookUpLineIndex(i,1-d,e.mapperIndex),c=e.startFrom-b;return i[e.mapperIndex][2]===0?g-c:a>=e.startFrom&&a<=h?g-Math.round((f-b)/3):a<e.startFrom?g-c:(i[e.mapperIndex][1-d]===0?g:g+i[e.mapperIndex][1-d]-1)-(h-b)};k.compareUtils.getMapperLineCount=
function(i){for(var d=0,b=0;b<i.length;b++)d+=Math.max(i[b][0],i[b][1]);return d};k.compareUtils.getAnnotationIndex=function(i,d){for(var b=0;b<i.length;b++)if(i[b][0]===d)return b;return-1};k.compareUtils.getAnnotationMapperIndex=function(i,d){return i[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(i,d){for(var b=0;b<i.length;b++)if(i[b][1]===d)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(i,d){return d<0?!1:!i[d][3]?!1:
i[d][3]===1};k.compareUtils.mergeDiffBlocks=function(i,d,b,f,a,e){for(var h=0;h<d.length;h++){var g=d[h][0],c=b[d[h][1]];if(c[0]>0){for(var l="",m=0;m<c[0];m++)l=l+f[c[2]-1+m].substring(a)+e;c=i.getLineCount();g>=c&&(g=c-1);g=i.getLineStart(g);i.setText(l,g,g)}}};k.compareUtils.generateCompareHref=function(i,d){var b=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new j(b+"#{,resource,params*}")).expand({resource:i,params:d})};k.compareUtils.generateCompareTreeHref=
function(i,d){var b=require.toUrl("compare-tree/compare-tree.html");return(new j(b+"#{,resource,params*}")).expand({resource:i,params:d})};return k.compareUtils});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(j){var k=k||{};k.CompareRuler=function(){function i(d,b,f){this._location=d||"left";this._overview=b||"page";this._rulerStyle=f;this._editor=null;var a=this;this._listener={onModelChanged:function(b){a._onModelChanged(b)}}}i.prototype={setView:function(d){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=d;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(d,b){for(var f=[],a=d;a<b;a++){var e=this.getStyle(a);e&&(f[a]={html:this.getHTML(a),style:e})}return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return i}();k.LineNumberCompareRuler=function(){function i(d,b,f,a,e,h){k.CompareRuler.call(this,f,"page",a);this._diffNavigator=d;this._oddStyle=e||{style:{backgroundColor:"white"}};this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){return d===void 0?this._rulerStyle:this._evenStyle};i.prototype.getHTML=function(d){var b=this._editor.getModel(),
f=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!f?"":d===-1?b.getLineCount():f.getLineNumber?(d=f.getLineNumber(d),d===-1?"":d+1):d+1};i.prototype._onModelChanged=function(d){var d=d.start,b=this._editor.getModel(),f=b.getLineCount(),a=(f+"").length;if(this._numOfDigits!==a)this._numOfDigits=a,this._editor.redrawLines(b.getLineAtOffset(d),f,this)};return i}();k.CompareOverviewRuler=function(){function i(d,b,f,a){this._diffNavigator=f;this._onClick=a;k.CompareRuler.call(this,d,
"document",b)}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){var b,f;if(d===void 0)b=this._rulerStyle||{},f=b.style||(b.style={}),f.lineHeight="1px",f.fontSize="1px",f.width="14px";else if(b=d!==-1?{styleClass:"annotationOverview breakpoint"}:{},f=b.style||(b.style={}),f.cursor="pointer",f.width="8px",f.left="2px",d>=0){var a;if(this._diffNavigator&&this._diffNavigator.getFeeder())a=this._diffNavigator.getFeeder().getDiffBlocks();else return null;d=j.getAnnotationIndex(a,d);if(d===
-1)return null;a=j.getAnnotationMapperIndex(a,d);var e;e=this._diffNavigator.getMapper();if(a=j.isMapperConflict(e,a))f.border="1px #FF0000 solid";if(d===this._diffNavigator.getCurrentBlockIndex())f.backgroundColor=a?"red":"blue";d=this._diffNavigator.getFeeder().getDiffBlockH(d);a=this._diffNavigator.getFeeder().getOverviewLineCount();if(d<0)return null;e=this._editor.getClientArea();d=Math.floor(e.height*d/a);d<2&&(d=2);f.height=d+"px"}else return null;return b};i.prototype.setDiffNavigator=function(d){this._diffNavigator=
d};i.prototype.getHTML=function(){return"&nbsp;"};i.prototype.onClick=function(d){d!==void 0&&this._onClick(d,this)};i.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return i}();k.CompareCurveRuler=function(){function i(d){this._canvasDiv=d;this._mapper=void 0}i.prototype={init:function(d,b,f,a){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=d;this._leftEditor=b;this._rightEditor=f;this._leftTextView=b.getTextView();
this._rightTextView=f.getTextView();this._diffNavigator=a;this.render()},matchPositionFrom:function(d){var b=d?this._leftTextView:this._rightTextView,f=d?this._rightTextView:this._leftTextView,a=b.getTopIndex(),b=b.getBottomIndex(),d=j.matchMapper(this._mapper,d?0:1,a,b);f.setTopIndex(d)},copyTo:function(d){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();if(b&&(b.type==="word"?!b.copied&&!b.parent.copied:!b.copied)){var f=d?this._rightTextView.getText(b.oldA.start,b.oldA.end):
this._leftTextView.getText(b.newA.start,b.newA.end),a=d?b.newA:b.oldA;(d?this._leftTextView:this._rightTextView).setText(f,a.start,a.end);b.copied=!0}}},render:function(){if(this._mapper){var d=this._canvasDiv.getContext("2d");d.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);d.strokeStyle="#AAAAAA";d.lineWidth=1;d.beginPath();var b=this._leftTextView.getTopIndex(),f=this._leftTextView.getBottomIndex(),a=this._rightTextView.getTopIndex(),e=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var h=0,g=0,c=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(j.overlapMapper(this._mapper[l],0,h,b,f)||j.overlapMapper(this._mapper[l],1,g,a,e))this._renderCurve(l,h,g,this._canvasDiv,d,b,f,a,e),c=!0;else if(c)break;h+=this._mapper[l][0];g+=this._mapper[l][1]}d.stroke()}},_renderCurve:function(d,b,f,a,e){var h=this._mapper[d],b=this._leftTextView.getLinePixel(b+h[0]/2)+h[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),f=this._rightTextView.getLinePixel(f+h[1]/2)+h[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),a=a.parentNode.clientWidth;d===this._diffNavigator.getCurrentMapperIndex()?(e.stroke(),e.strokeStyle="#000",e.lineWidth=1,e.beginPath(),e.moveTo(0,b),e.bezierCurveTo(a/3,b,a*0.666,f,a,f),e.stroke(),e.strokeStyle="#AAAAAA",e.lineWidth=1,e.beginPath()):(e.moveTo(0,b),e.bezierCurveTo(a/3,b,a*0.666,f,a,f),e.stroke())},onChanged:function(d,b){var f=b?this._rightIniting:
this._leftIniting;if(d.removedLineCount!==d.addedLineCount){var a=b?this._rightTextView:this._leftTextView;f||j.updateMapper(this._mapper,b?1:0,a.getModel().getLineAtOffset(d.start),d.removedLineCount,d.addedLineCount);(d.removedLineCount>0||d.addedLineCount>0)&&this.render()}b?this._rightIniting=!1:this._leftIniting=!1;return f}};return i}();return k});define("orion/editor/i18n",{load:function(j,k,i){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+j],function(d){i(d)}):i({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",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(j,k){var i={root:k},d;for(d in j)j.hasOwnProperty(d)&&typeof i[d]==="undefined"&&(i[d]=j[d]);return i});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(j,k){function i(d,b){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(b)}i.prototype={find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var b=d.string,f=b,a=d.caseInsensitive;!d.regex&&b&&(f=b.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(f=f.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var e=null,h;if(f){var b=d.reverse,g=d.wrap,c=d.wholeWord,
l=d.start||0,d=d.end,m=d!==null&&d!==void 0,i="";i.indexOf("g")===-1&&(i+="g");a&&i.indexOf("i")===-1&&(i+="i");c&&(f="\\b"+f+"\\b");var j=this._text[0],k,r,s=0;m&&(a=l<d?l:d,j=j.substring(a,l<d?d:l),s=a);var v=RegExp(f,i);if(b)h=function(){var a=null;for(v.lastIndex=0;;){r=v.lastIndex;k=v.exec(j);if(r===v.lastIndex)return null;if(k){if(!(k.index+s<l)){if(!g||a)break;l=j.length+s}a={start:k.index+s,end:v.lastIndex+s}}else break}if(a)l=a.start;return a};else{if(!m)v.lastIndex=l;h=function(){for(;;){r=
v.lastIndex;k=v.exec(j);if(r===v.lastIndex)break;if(k)return{start:k.index+s,end:v.lastIndex+s};if(!(r!==0&&g))break}return null}}e=h()}return{next:function(){var a=e;a&&(e=h());return a},hasNext:function(){return e!==null}}},getCharCount:function(){for(var d=0,b=0;b<this._text.length;b++)d+=this._text[b].length;return d},getLine:function(d,b){var f=this.getLineCount();if(!(0<=d&&d<f))return null;var a=this._lineOffsets[d];if(d+1<f){f=this.getText(a,this._lineOffsets[d+1]);if(b)return f;for(var a=
f.length,e;(e=f.charCodeAt(a-1))===10||e===13;)a--;return f.substring(0,a)}else return this.getText(a)},getLineAtOffset:function(d){var b=this.getCharCount();if(!(0<=d&&d<=b))return-1;var f=this.getLineCount();if(d===b)return f-1;var a,e,h=this._lastLineIndex;if(0<=h&&h<f&&(a=this._lineOffsets[h],e=h+1<f?this._lineOffsets[h+1]:b,a<=d&&d<e))return h;for(var g=f,c=-1;g-c>1;)if(h=Math.floor((g+c)/2),a=this._lineOffsets[h],e=h+1<f?this._lineOffsets[h+1]:b,d<=a)g=h;else if(d<e){g=h;break}else c=h;return this._lastLineIndex=
g},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,b){var f=this.getLineCount();if(!(0<=d&&d<f))return-1;if(d+1<f){f=this._lineOffsets[d+1];if(b)return f;for(var a=this.getText(Math.max(this._lineOffsets[d],f-2),f),e=a.length,h;(h=a.charCodeAt(e-1))===10||h===13;)e--;return f-(a.length-e)}else return this.getCharCount()},getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,
b){d===void 0&&(d=0);b===void 0&&(b=this.getCharCount());if(d===b)return"";for(var f=0,a=0,e;a<this._text.length;){e=this._text[a].length;if(d<=f+e)break;f+=e;a++}for(var h=f,g=a;a<this._text.length;){e=this._text[a].length;if(b<=f+e)break;f+=e;a++}if(g===a)return this._text[g].substring(d-h,b-f);h=this._text[g].substring(d-h);f=this._text[a].substring(0,b-f);return h+this._text.slice(g+1,a).join("")+f},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},
setLineDelimiter:function(d,b){d==="auto"&&(d=void 0,this.getLineCount()>1&&(d=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=d?d:k.platformDelimiter;if(b){var f=this.getLineCount();if(f>1){for(var a=Array(f),e=0;e<f;e++)a[e]=this.getLine(e);this.setText(a.join(this._lineDelimiter))}}},setText:function(d,b,f){d===void 0&&(d="");b===void 0&&(b=0);f===void 0&&(f=this.getCharCount());if(!(b===f&&d==="")){for(var a=this.getLineAtOffset(b),e=this.getLineAtOffset(f),h=b,g=
f-b,c=e-a,l=d.length,m=0,i=this.getLineCount(),j=0,k=0,r=0,s=[];;){j!==-1&&j<=r&&(j=d.indexOf("\r",r));k!==-1&&k<=r&&(k=d.indexOf("\n",r));if(k===-1&&j===-1)break;r=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;s.push(b+r);m++}this.onChanging({type:"Changing",text:d,start:h,removedCharCount:g,addedCharCount:l,removedLineCount:c,addedLineCount:m});s.length===0&&(r=this.getLineStart(a),e=e+1<i?this.getLineStart(e+1):this.getCharCount(),b!==r&&(d=this.getText(r,b)+d,b=r),f!==e&&(d+=this.getText(f,
e),f=e));r=l-g;for(e=a+c+1;e<i;e++)this._lineOffsets[e]+=r;if(s.length<5E4)a=[a+1,c].concat(s),Array.prototype.splice.apply(this._lineOffsets,a);else{r=a+1;this._lineOffsets.splice(r,c);for(i=0;i<s.length;i+=5E4)a=[r,0].concat(s.slice(i,Math.min(s.length,i+5E4))),Array.prototype.splice.apply(this._lineOffsets,a),r+=5E4}for(r=i=0;r<this._text.length;){e=this._text[r].length;if(b<=i+e)break;i+=e;r++}a=i;for(s=r;r<this._text.length;){e=this._text[r].length;if(f<=i+e)break;i+=e;r++}e=this._text[r];b=
this._text[s].substring(0,b-a);f=e.substring(f-i);s=[s,r-s+1];b&&s.push(b);d&&s.push(d);f&&s.push(f);Array.prototype.splice.apply(this._text,s);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:h,removedCharCount:g,addedCharCount:l,removedLineCount:c,addedLineCount:m})}}};j.EventTarget.addMixin(i.prototype);return{TextModel:i}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(j,k){function i(b){if(b)this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(b){i.call(this,b)}i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var d=[],a=this._keyBindings,e=0;e<a.length;e++)a[e].actionID===b&&d.push(a[e].keyBinding);return d},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(b){if(b.type==="keydown")switch(b.keyCode){case 16:case 17:case 18:case 91:return}for(var d=this._keyBindingIndex,a=this._matchingKeyBindings||this._keyBindings,e=[],h=0;h<a.length;h++){var g=a[h],c=g.keyBinding.match(b,d);if(c===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,g.actionID;else typeof c==="number"&&e.push(g)}if(e.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=e,"noop"},setKeyBinding:function(b,
d){for(var a=this._keyBindings,e=0;e<a.length;e++){var h=a[e];if(h.keyBinding.equals(b)){d?h.actionID=d:h.predefined?h.actionID="noop":a.splice(e,1);return}}d&&a.push({keyBinding:b,actionID:d})},setView:function(b){this._view=b}};d.prototype=new i;d.prototype.createKeyBindings=function(){var b=j.KeyBinding,d=[];d.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});d.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});d.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});
d.push({actionID:"charNext",keyBinding:new b(39),predefined:!0});k.isMac?(d.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),d.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),d.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),
d.push({actionID:"wordPrevious",keyBinding:new b(37,null,null,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),d.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),d.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),d.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),d.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,
!0),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new b(40,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(d.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),d.push({actionID:"pageDown",
keyBinding:new b(34),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),d.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),d.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(d.push({actionID:"lineUp",keyBinding:new b(38,
!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new b(40,!0),predefined:!0}));k.isWindows&&(d.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),d.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));d.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});d.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});d.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});d.push({actionID:"selectCharNext",
keyBinding:new b(39,null,!0),predefined:!0});d.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});d.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});k.isMac?(d.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new b(39,
null,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),d.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),
d.push({actionID:"selectLineStart",keyBinding:new b(38,null,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(k.isLinux&&(d.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),d.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),d.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",
keyBinding:new b(37,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));d.push({actionID:"undo",keyBinding:new j.KeyBinding("z",!0),predefined:!0});k.isMac?d.push({actionID:"redo",keyBinding:new j.KeyBinding("z",!0,!0),predefined:!0}):d.push({actionID:"redo",keyBinding:new j.KeyBinding("y",!0),predefined:!0});
d.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});d.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});d.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});d.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});d.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
d.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});d.push({actionID:"enter",keyBinding:new b(13),predefined:!0});d.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});d.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});d.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});k.isMac&&(d.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
predefined:!0}),d.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));d.push({actionID:"toggleWrapMode",keyBinding:new j.KeyBinding("w",!0,!1,!0)});d.push({actionID:"toggleOverwriteMode",keyBinding:new j.KeyBinding(45)});if(!k.isFirefox){var a=k.isMac&&k.isChrome;d.push({actionID:"noop",keyBinding:new b("u",!a,!1,!1,a),predefined:!0});d.push({actionID:"noop",keyBinding:new b("i",!a,!1,!1,a),predefined:!0});d.push({actionID:"noop",keyBinding:new b("b",!a,!1,!1,a),predefined:!0})}k.isFirefox&&
(d.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),d.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),d.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));k.isMac&&(d.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
!1,!0),predefined:!0}),d.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(d.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(d.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return d};return{KeyMode:i,DefaultKeyMode:d}});
define("orion/editor/util",[],function(){return{contains:function(j,k){if(!k)return!1;if(!j.compareDocumentPosition){for(var i=k;i;){if(j===i)return!0;i=i.parentNode}return!1}return j===k||(j.compareDocumentPosition(k)&16)!==0},addEventListener:function(j,k,i,d){typeof j.addEventListener==="function"?j.addEventListener(k,i,d===!0):j.attachEvent("on"+k,i)},removeEventListener:function(j,k,i,d){typeof j.removeEventListener==="function"?j.removeEventListener(k,i,d===!0):j.detachEvent("on"+k,i)}}});
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(j,k,i,d,b,f,a){function e(c,b,d){if(d){b.className="";for(var d=b.attributes,e=d.length;e-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&d[e].specified)&&b.removeAttribute(d[e].name)}if(c){if(c.styleClass)b.className=c.styleClass;if(d=c.style)for(var g in d)d.hasOwnProperty(g)&&(b.style[g]=d[g]);if(c=c.attributes)for(var f in c)c.hasOwnProperty(f)&&
b.setAttribute(f,c[f])}}function h(a){return a instanceof Array?a.slice(0):a}function g(a,c){if(!a)return c;if(!c)return a;for(var b in c)c.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=c[b]));return a}function c(a,b){if(a===b)return!0;if(a&&!b||!a&&b)return!1;if(a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof Array&&b instanceof Array))return!1;if(a.length!==b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;
return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)){if(!b.hasOwnProperty(d))return!1;if(!c(a[d],b[d]))return!1}for(d in b)if(!a.hasOwnProperty(d))return!1;return!0}function l(a,c,b){for(var d=0,e=0,g=0,f=a.length;g<f;){d!==-1&&d<=g&&(d=a.indexOf("\r",g));e!==-1&&e<=g&&(e=a.indexOf("\n",g));var h=g,l;if(e===-1&&d===-1){c(a.substring(g));break}d!==-1&&e!==-1?d+1===e?(l=d,g=e+1):(l=d<e?d:e,g=(d<e?d:e)+1):d!==-1?(l=d,g=d+1):(l=e,g=e+1);c(a.substring(h,
l));b()}}function m(a){var c,b,d,e,g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(g.getComputedStyle)a=g.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,e=a.currentStyle.paddingBottom;return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(d,
10)||0,bottom:parseInt(e,10)||0}}function n(a){var c,b,d,e,g=a._trim;if(!g){var g=m(a),f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)e=f.getComputedStyle(a,null),c=e.getPropertyValue("border-left-width"),b=e.getPropertyValue("border-top-width"),d=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)c=a.currentStyle.borderLeftWidth,b=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;
c=parseInt(c,10)||0;b=parseInt(b,10)||0;d=parseInt(d,10)||0;e=parseInt(e,10)||0;g.left+=c;g.top+=b;g.right+=d;g.bottom+=e;a._trim=g}return g}function p(a,c,b){this.start=a;this.end=c;this.caret=b}function t(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function r(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function s(a){this._init(a||{})}var v=f.addEventListener,w=f.removeEventListener,u=function(){function a(c){this.options=c}a.prototype.play=function(){var a=
typeof this.options.duration==="number"?this.options.duration:350,c=this.options.easing||this.defaultEasing,b=this.options.onAnimate||function(){},d=this.options.curve[0],e=this.options.curve[1],g=e-d,q=-1,f,h=this;this.interval=this.options.window.setInterval(function(){q=q===-1?(new Date).getTime():q;var l=((new Date).getTime()-q)/a;l<1?(l=c(l),f=d+l*g,b(f)):(b(e),h.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();p.prototype={clone:function(){return new p(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}};t.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};r.prototype={create:function(a,c){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,c,this.lineIndex);b._line=
this;return b}},_createLine:function(b,d,g){var f=this.view,h=f._model,l=h.getLine(g),i=h.getLineStart(g),m={type:"LineStyle",textView:f,lineIndex:g,lineText:l,lineStart:i};if(l.length<2E3)f.onLineStyle(m);h=d||a.createElement(b.ownerDocument,"div");if(!d||!c(d.viewStyle,m.style)){e(m.style,h,d);if(d)d._trim=null;h.viewStyle=m.style;h.setAttribute("role","presentation")}h.lineIndex=g;g=[];this._createRanges(m.ranges,l,0,l.length,i,{tabOffset:0,ranges:g});l=" ";!f._fullSelection&&a.isIE<9&&(l="\ufeff");
a.isWebkit&&(l="\u200c");m={text:l,style:f._metrics.largestFontStyle,ignoreChars:1};g.length===0||!g[g.length-1].style||g[g.length-1].style.tagName!=="div"?g.push(m):g.splice(g.length-1,0,m);var n,j,p,k,t,l=f=0,r,s;if(d){if(j=d.modelChangedEvent)j.removedLineCount===0&&j.addedLineCount===0?(s=j.start-i,r=j.addedCharCount-j.removedCharCount):s=-1,d.modelChangedEvent=void 0;j=d.firstChild}for(i=0;i<g.length;i++){m=g[i];k=m.text;f+=k.length;n=m.style;if(j)if(t=j.firstChild.data,p=j.viewStyle,t===k&&
c(n,p)){l+=t.length;j._rectsCache=void 0;n=j=j.nextSibling;continue}else for(;j;){if(s!==-1){p=f;p>=s&&(p-=r);t=(t=j.firstChild.data)?t.length:0;if(l+t>p)break;l+=t}p=j.nextSibling;h.removeChild(j);j=p}n=this._createSpan(h,k,n,m.ignoreChars);j?h.insertBefore(n,j):h.appendChild(n);if(d)d.lineWidth=void 0}if(d)for(b=n?n.nextSibling:null;b;)p=b.nextSibling,d.removeChild(b),b=p;else b.appendChild(h);return h},_createRanges:function(a,b,d,e,g,f){if(!(d>e)){if(a)for(var h=0;h<a.length;h++){var l=a[h];if(!(l.end<
g+d)){var m=Math.max(g+d,l.start)-g;if(m>e)break;var i=Math.min(g+e,l.end)-g;if(m<=i){m=Math.max(d,m);i=Math.min(e,i);d<m&&this._createRange(b,d,m,null,f);if(!l.style||!l.style.unmergeable)for(;h+1<a.length&&a[h+1].start-g===i&&c(l.style,a[h+1].style);)l=a[h+1],i=Math.min(g+e,l.end)-g,h++;this._createRange(b,m,i,l.style,f);d=i}}}d<e&&this._createRange(b,d,e,null,f)}},_createRange:function(a,c,b,d,e){if(!(c>b)){var g=this.view._customTabSize;if(g&&g!==8)for(var f=a.indexOf("\t",c);f!==-1&&f<b;){c<
f&&(c={text:a.substring(c,f),style:d},e.ranges.push(c),e.tabOffset+=c.text.length);c=g-e.tabOffset%g;if(c>0){for(var h="\u00a0",l=1;l<c;l++)h+=" ";c={text:h,style:d,ignoreChars:c-1};e.ranges.push(c);e.tabOffset+=c.text.length}c=f+1;if(c===b)return;f=a.indexOf("\t",c)}c<=b&&(c={text:a.substring(c,b),style:d},e.ranges.push(c),e.tabOffset+=c.text.length)}},_createSpan:function(c,b,d,g){var f=this.view,h="span";d&&d.tagName&&(h=d.tagName.toLowerCase());var l=h==="a";if(l)c.hasLink=!0;l&&!f._linksVisible&&
(h="span");l=c.ownerDocument;c=a.createElement(c.ownerDocument,h);d&&d.html?(c.innerHTML=d.html,c.ignore=!0):d&&d.node?(c.appendChild(d.node),c.ignore=!0):c.appendChild(l.createTextNode(d&&d.text?d.text:b));e(d,c);if(h==="a"){var m=f._getWindow();v(c,"click",function(a){return f._handleLinkClick(a?a:m.event)},!1)}c.viewStyle=d;if(g)c.ignoreChars=g;return c},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(c,
b){var d=this._ensureCreated(),e=this.view;if(c===void 0)return this._getLineBoundingClientRect(d,!0);var g=e._model,f=d.ownerDocument,h=this.lineIndex,l=null;if(c<g.getLineEnd(h)){h=g.getLineStart(h);for(g=d.firstChild;g;){if(!g.ignore){var m=g.firstChild,i=m.length;g.ignoreChars&&(i-=g.ignoreChars);if(h+i>c){l=c-h;if(m.length===1)l=new t(g.getBoundingClientRect());else if(e._isRangeRects)f=f.createRange(),f.setStart(m,l),f.setEnd(m,l+1),l=new t(f.getBoundingClientRect());else if(a.isIE){if(f=f.body.createTextRange(),
f.moveToElementText(g),f.collapse(),(h=l===0&&a.isIE===8)&&(l=1),f.moveEnd("character",l+1),f.moveStart("character",l),l=new t(f.getBoundingClientRect()),h)l.left=g.getClientRects()[0].left}else{var n=m.data;g.removeChild(m);g.appendChild(f.createTextNode(n.substring(0,l)));var j=a.createElement(f,"span");j.appendChild(f.createTextNode(n.substring(l,l+1)));g.appendChild(j);g.appendChild(f.createTextNode(n.substring(l+1)));l=new t(j.getBoundingClientRect());g.innerHTML="";g.appendChild(m);this._createdDiv||
(f=e._getSelection(),(h<=f.start&&f.start<h+i||h<=f.end&&f.end<h+i)&&e._updateDOMSelection())}a.isIE&&(f=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=f.screen.logicalXDPI/f.screen.deviceXDPI,f=f.screen.logicalYDPI/f.screen.deviceYDPI,l.left*=d,l.right*=d,l.top*=f,l.bottom*=f);break}h+=i}g=g.nextSibling}}d=this.getBoundingClientRect();if(!l)e._wrapMode?(e=this.getClientRects(),l=e[e.length-1],l.left=l.right,l.left+=d.left,l.top+=d.top,l.right+=d.left,l.bottom+=d.top):(l=new t(d),l.left=
l.right);if(b||b===void 0)l.left-=d.left,l.top-=d.top,l.right-=d.left,l.bottom-=d.top;return l},_getClientRects:function(a,c){var b,d,e,g;if(!a._rectsCache){b=a.getClientRects();d=Array(b.length);for(g=0;g<b.length;g++)e=d[g]=new t(b[g]),e.left-=c.left,e.top-=c.top,e.right-=c.left,e.bottom-=c.top;a._rectsCache=d}b=a._rectsCache;d=[b.length];for(g=0;g<b.length;g++)d[g]=new t(b[g]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),
b=[],d=c.firstChild,e,g=c.getBoundingClientRect();d;){if(!d.ignore)for(var f=this._getClientRects(d,g),c=0;c<f.length;c++){var h=f[c],l;if(h.top!==h.bottom){var m=h.top+(h.bottom-h.top)/2;for(l=0;l<b.length;l++)if(e=b[l],e.top<=m&&m<e.bottom)break;if(l===b.length)b.push(h);else{if(h.left<e.left)e.left=h.left;if(h.top<e.top)e.top=h.top;if(h.right>e.right)e.right=h.right;if(h.bottom>e.bottom)e.bottom=h.bottom}}}d=d.nextSibling}return a!==void 0?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=
new t(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),b.right=d.right+n(a).right}c&&(d=n(a),b.left+=d.left,b.right-=d.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,
b=0;b<c.length;b++)if(c[b].top<=a&&a<c[b].bottom)return b;return c.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var c=this.getClientRects();return this.getOffset(c[a].left+1,c[a].top+1)},getOffset:function(c,b){var d=this.view,e=d._model,g=this.lineIndex,f=e.getLineStart(g),h=e.getLineEnd(g);if(f===h)return f;var l=this._ensureCreated(),m=this.getBoundingClientRect(),i,n;if(d._wrapMode){i=this.getClientRects();if(b<i[0].top)b=i[0].top;for(var j=
0;j<i.length;j++)if(n=i[j],n.top<=b&&b<n.bottom)break;if(c<n.left)c=n.left;c>n.right&&(c=n.right-1)}else c<0&&(c=0),c>m.right-m.left&&(c=m.right-m.left);var p=l.ownerDocument,j=p.defaultView||p.parentWindow,k=a.isIE?j.screen.logicalXDPI/j.screen.deviceXDPI:1,t=a.isIE?j.screen.logicalYDPI/j.screen.deviceYDPI:1,j=f,r=l.firstChild;a:for(;r;){if(!r.ignore){var s=r.firstChild,l=s.length;r.ignoreChars&&(l-=r.ignoreChars);var v,u,w;i=this._getClientRects(r,m);for(var L=0;L<i.length;L++)if(n=i[L],n.left<=
c&&c<n.right&&(!d._wrapMode||n.top<=b&&b<n.bottom)){var L=n.left+m.left,G;if(a.isIE||d._isRangeRects){for(var p=d._isRangeRects?p.createRange():p.body.createTextRange(),H=l,K=-1;H-K>1;){var R=Math.floor((H+K)/2);i=K+1;n=R===l-1&&r.ignoreChars?s.length:R+1;G=i===0&&a.isIE===8;d._isRangeRects?(p.setStart(s,i),p.setEnd(s,n)):(G&&(i=1),p.moveToElementText(r),p.move("character",i),p.moveEnd("character",n-i));i=p.getClientRects();for(var N=!1,P=0;P<i.length;P++)if(n=i[P],v=(G?L:n.left)*k-m.left,w=n.right*
k-m.left,u=n.top*t-m.top,n=n.bottom*t-m.top,v<=c&&c<w&&(!d._wrapMode||u<=b&&b<n)){N=!0;break}N?H=R:K=R}j+=H;i=H;n=H===l-1&&r.ignoreChars?s.length:Math.min(H+1,s.length);d._isRangeRects?(p.setStart(s,i),p.setEnd(s,n)):(p.moveToElementText(r),p.move("character",i),p.moveEnd("character",n-i));i=p.getClientRects();d=!1;i.length>0&&(n=i[0],v=(G?L:n.left)*k-m.left,w=n.right*k-m.left,d=c>v+(w-v)/2);m=j-f;e=e.getLine(g);g=e.charCodeAt(m);55296<=g&&g<=56319&&d?m<e.length&&(g=e.charCodeAt(m+1),56320<=g&&g<=
57343&&(j+=1)):56320<=g&&g<=57343&&!d&&m>0&&(g=e.charCodeAt(m-1),55296<=g&&g<=56319&&(j-=1));d&&j++}else{e=[];for(g=0;g<l;g++)e.push("<span>"),g===l-1?e.push(s.data.substring(g)):e.push(s.data.substring(g,g+1)),e.push("</span>");r.innerHTML=e.join("");for(e=r.firstChild;e;){n=e.getBoundingClientRect();v=n.left-m.left;w=n.right-m.left;if(v<=c&&c<w){c>v+(w-v)/2&&j++;break}j++;e=e.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(s),m=d._getSelection(),(j<=m.start&&m.start<j+l||j<=m.end&&
m.end<j+l)&&d._updateDOMSelection()}break a}j+=l}r=r.nextSibling}return Math.min(h,Math.max(f,j))},getNextOffset:function(c,b){if(b.unit==="line"){var d=this.view._model,e=d.getLineAtOffset(c);if(b.count>0)return b.count--,d.getLineEnd(e);b.count++;return d.getLineStart(e)}return b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS"?this._getNextOffset_W3C(c,b):a.isIE?this._getNextOffset_IE(c,b):this._getNextOffset_W3C(c,b)},_getNextOffset_W3C:function(a,c){function b(a){return 33<=a&&a<=47||
58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function d(a){return a===32||a===9}var e=this.view._model,g=e.getLineAtOffset(a),f=e.getLine(g),h=e.getLineStart(g),e=e.getLineEnd(g),g=f.length,l=a-h,m,i=c.count<0?-1:1;if(c.unit==="word"||c.unit==="wordend"||c.unit==="wordWS"||c.unit==="wordendWS")for(var n,j,p;c.count!==0;){if(c.count>0){if(l===g)return e;m=f.charCodeAt(l);n=b(m);j=!n&&!d(m);for(l++;l<g;){m=f.charCodeAt(l);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){p=b(m);if(c.unit==="wordend"){if(!p&&
n)break}else if(p&&!n)break;m=!p&&!d(m)}else m=!d(m);if(c.unit==="wordend"||c.unit==="wordendWS"){if(!m&&j)break}else if(m&&!j)break;j=m;n=p;l++}}else{if(l===0)return h;l--;m=f.charCodeAt(l);n=b(m);for(j=!n&&!d(m);0<l;){m=f.charCodeAt(l-1);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){p=b(m);if(c.unit==="wordend"){if(p&&!n)break}else if(!p&&n)break;m=!p&&!d(m)}else m=!d(m);if(c.unit==="wordend"||c.unit==="wordendWS"){if(m&&!j)break}else if(!m&&j)break;j=m;n=p;l--}}c.count-=i}else for(;c.count!==0&&
0<=l+i&&l+i<=g;)l+=i,m=f.charCodeAt(l),56320<=m&&m<=57343&&l>0&&(m=f.charCodeAt(l-1),55296<=m&&m<=56319&&(l+=i)),c.count-=i;return h+l},_getNextOffset_IE:function(a,c){var b=this._ensureCreated(),d=this.view._model,e=this.lineIndex,g=0,f;f=d.getLineStart(e);var h=b.ownerDocument,l=c.count<0?-1:1;if(a===d.getLineEnd(e)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;if(!b)return f;g=h.body.createTextRange();g.moveToElementText(b);f=g.text.length;g.moveEnd(c.unit,l);g=
a+g.text.length-f}else if(a===f&&c.count<0)g=f;else for(b=b.firstChild;b;){d=b.firstChild.length;b.ignoreChars&&(d-=b.ignoreChars);if(f+d>a){g=h.body.createTextRange();a===f&&c.count<0?g.moveToElementText(b.previousSibling):(g.moveToElementText(b),g.collapse(),g.moveEnd("character",a-f));f=g.text.length;g.moveEnd(c.unit,l);g=a+g.text.length-f;break}f=d+f;b=b.nextSibling}c.count-=l;return g},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};s.prototype=
{addKeyMode:function(a,c){var b=this._keyModes;c!==void 0?b.splice(c,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var d,e;for(d=0,e=0;d<b.length&&e<c;d++)a.getLocation()===b[d].getLocation()&&e++;b.splice(e,0,a);c=e}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var c=0,b=0,d=this._model,e=this._clientDiv;if(!e)return{width:c,height:b};var g=e.style.width;if(a.isWebkit)e.style.width="0x7fffffffpx";
for(var d=d.getLineCount(),f=0;f<d;f++){var h=this._getLine(f),l=h.getBoundingClientRect(),c=Math.max(c,l.right-l.left);b+=l.bottom-l.top;h.destroy()}if(a.isWebkit)e.style.width=g;e=this._getViewPadding();c+=e.right+e.left+this._metrics.scrollWidth;b+=e.bottom+e.top+this._metrics.scrollWidth;return{width:c,height:b}},convert:function(a,c,b){if(this._clientDiv){var d=this._getScroll(),e=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect();c==="document"&&(a.x!==void 0&&(a.x+=-d.x+g.left+
e.left),a.y!==void 0&&(a.y+=-d.y+g.top+e.top));b==="document"&&(a.x!==void 0&&(a.x+=d.x-g.left-e.left),a.y!==void 0&&(a.y+=d.y-g.top-e.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),this._clientDiv.focus(),
this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var c=[],b=this._actions,d;for(d in b)b.hasOwnProperty(d)&&(a||!b[d].defaultHandler)&&c.push(d);return c},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var c=[],b=this._keyModes,d=0;d<b.length;d++)c=c.concat(b[d].getKeyBindings(a));return c},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},
getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var c=this._model,a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getNextOffset:function(a,c){var b=new p(a,a,!1);this._doMove(c,b);return b.getCaret()},
getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return h(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=h(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),d=this._getLine(b),b=d.getOffset(a,c-this._getLinePixel(b));
d.destroy();return b},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,c,b){if(this._clientDiv){if(a=this._actions[a]){if(!c&&a.handler&&a.handler(b))return!0;if(a.defaultHandler)return typeof a.defaultHandler(b)===
"boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},
onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},
onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,
c){if(!(this._redrawCount>0))for(var b=this.getRulers(),d=0;d<b.length;d++)this.redrawLines(a,c,b[d])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var d=this._clientDiv;if(d){if(b)for(d=this._getRulerParent(b).firstChild;d;){if(d._ruler===b)break;d=d.nextSibling}b?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(d=d.firstChild;d;){var e=d.lineIndex;if(a<=e&&e<c)d.lineChanged=
!0;d=d.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,c){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);c===void 0&&(c=b.getCharCount());var d=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(d,b)}},removeKeyMode:function(a){for(var c=this._keyModes,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,
1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var d=this._actions,e=d[a];e||(e=d[a]={});e.handler=c;if(b!==void 0)e.actionDescription=b}},setKeyBinding:function(a,c){this._keyModes[0].setKeyBinding(a,c)},setCaretOffset:function(a,c,b){var d=this._model.getCharCount(),
a=Math.max(0,Math.min(a,d));this._setSelection(new p(a,a,!1),c===void 0||c,!0,b)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var c=this._model.getLineCount(),
b=this._model.getCharCount(),d=a.getLineCount(),e=a.getCharCount(),g={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:e,removedLineCount:c,addedLineCount:d};this.onModelChanging(g);this._model=a;g={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:e,removedLineCount:c,addedLineCount:d};this.onModelChanged(g);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);
this._reset();this._update()}},setOptions:function(a){var b=this._defaultOptions(),d;for(d in a)if(a.hasOwnProperty(d)){var e=a[d];if(!c(this["_"+d],e)){var g=b[d]?b[d].update:null;g?g.call(this,e):this["_"+d]=h(e)}}},setSelection:function(a,c,b,d){var e=a>c;if(e)var g=a,a=c,c=g;g=this._model.getCharCount();a=Math.max(0,Math.min(a,g));c=Math.max(0,Math.min(c,g));this._setSelection(new p(a,c,e),b===void 0||b,!0,d)},setText:function(c,b,d){var e=b===void 0&&d===void 0;b===void 0&&(b=0);d===void 0&&
(d=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:c,start:b,end:d,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new p(0,0,!1),!0),a.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,c){this._clientDiv&&
(a&&this._updateStyle(),c===void 0||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(c){if(!this._ignoreEvent(c)){if(a.isFirefox&&c.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var b=this._overlayDiv||this._clientDiv;if(a.isIE<9)b=this._viewDiv;for(var d=c.target?c.target:c.srcElement;d;){if(b===d)return;d=d.parentNode}c.preventDefault&&c.preventDefault();c.stopPropagation&&c.stopPropagation();if(!this._isW3CEvents){var e=
this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(c){if(!this._ignoreEvent(c)&&a.isFirefox&&c.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(a.isIE<9&&!this._getSelection().isEmpty()){var c=this._rootDiv,b=a.createElement(c.ownerDocument,"div");c.appendChild(b);c.removeChild(b)}if(this._cursorDiv)this._cursorDiv.style.display=
"none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",c=this._getWindow(),b=this._selDiv1.ownerDocument,c.getSelection){b=c.getSelection();for(c=b.anchorNode;c;){if(c===this._clientDiv){b.rangeCount>0&&b.removeAllRanges();break}c=c.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(c=b.selection.createRange().parentElement();c;){if(c===this._clientDiv){b.selection.empty();break}c=c.parentNode}this._ignoreSelect=
!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(c){if(!this._ignoreEvent(c)){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",c),b.screenX=c.screenX,b.screenY=c.screenY,this.onContextMenu(b),b=b.defaultPrevented):a.isMac&&a.isFirefox&&c.button===0&&(b=!0);if(b)return c.preventDefault&&c.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&
this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){if(!this._ignoreEvent(a)&&(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),this._clickCount!==2))this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(c){if(!this._ignoreEvent(c)){if(a.isFirefox){var b=
this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",c)),this._dragOffset=-1;else return c.preventDefault&&c.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(c){if(!this._ignoreEvent(c)){this._dropTarget=
!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",c));a.isFirefox&&(this._fixCaret(),c.dataTransfer.dropEffect==="none"&&!c.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(c){if(!this._ignoreEvent(c)){var b=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",c)));if(a.isWebkit||b)return c.preventDefault&&c.preventDefault(),!1}},_handleDragOver:function(c){if(!this._ignoreEvent(c)){var b=
!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",c)));if(a.isWebkit||b){if(b)c.dataTransfer.dropEffect="none";c.preventDefault&&c.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",
a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;a.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var c=this._highlightRGB;this._selDiv1.style.background=c;this._selDiv2.style.background=c;this._selDiv3.style.background=c}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(c){if(!this._ignoreEvent(c)){if(this.isListening("KeyDown")){var b=
this._createKeyEvent("KeyDown",c);this.onKeyDown(b);if(b.defaultPrevented){if(a.isFirefox)this._keyDownPrevented=!0;c.preventDefault();return}}b=!1;switch(c.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(c.keyCode===229){if(this._readonly)return c.preventDefault&&c.preventDefault(),!1;b=!0;if(a.isSafari&&a.isMac&&c.ctrlKey)b=!1,c.keyCode=129;b&&this._startIME()}else b||this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=
c,!0;if(this._doAction(c))return c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1}},_handleKeyPress:function(c){if(!this._ignoreEvent(c))if(this._keyDownPrevented)c.preventDefault&&(c.preventDefault(),c.stopPropagation()),this._keyDownPrevented=void 0;else{if(a.isMac&&a.isWebkit&&(63232<=c.keyCode&&c.keyCode<=63487||c.keyCode===13||c.keyCode===8))return c.preventDefault&&c.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&
this._doAction(this._keyDownEvent))return c.preventDefault&&c.preventDefault(),!1;var b=a.isMac?c.metaKey:c.ctrlKey;if(c.charCode!==void 0&&b)switch(c.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",c),this.onKeyPress(b),b.defaultPrevented)){c.preventDefault();return}if(this._doAction(c))return c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1;b=!1;if(a.isMac){if(c.ctrlKey||
c.metaKey)b=!0}else if(a.isFirefox){if(c.ctrlKey||c.altKey)b=!0}else c.ctrlKey^c.altKey&&(b=!0);if(!b&&(b=a.isOpera?c.which:c.charCode!==void 0?c.charCode:c.keyCode,b>31))return this._doContent(String.fromCharCode(b)),c.preventDefault&&c.preventDefault(),!1}},_handleDocKeyUp:function(c){(a.isMac?c.metaKey:c.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",a);this.onKeyUp(c);if(c.defaultPrevented){a.preventDefault();
return}}this._handleDocKeyUp(a);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(c){if(!(a.isMac?c.metaKey:c.ctrlKey))return c.preventDefault&&c.preventDefault(),!1},_handleMouse:function(c){var b=this._getWindow(),d=!0,e=b;if(a.isIE||a.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var g=this;b.setTimeout(function(){g.focus();g._ignoreFocus=!1},0)}this._clickCount===1?(d=this._setSelectionTo(c.clientX,c.clientY,c.shiftKey,!a.isOpera&&
this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(c.clientX,c.clientY,c.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(c){if(!this._ignoreEvent(c)){if(this._linksVisible)if((c.target||c.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var b=c.which;b||(c.button===4&&(b=2),c.button===2&&(b=3),c.button===1&&(b=1));
var d=b!==2&&c.timeStamp?c.timeStamp:(new Date).getTime(),e=d-this._lastMouseTime,g=Math.abs(this._lastMouseX-c.clientX),f=Math.abs(this._lastMouseY-c.clientY),h=this._lastMouseButton===b;this._lastMouseX=c.clientX;this._lastMouseY=c.clientY;this._lastMouseTime=d;this._lastMouseButton=b;if(b===1)this._isMouseDown=!0,h&&e<=this._clickTime&&g<=this._clickDist&&f<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",c),this.onMouseDown(d),
d.defaultPrevented)){c.preventDefault();return}if(b===1&&this._handleMouse(c)&&(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),c.preventDefault();a.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&
this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(c){if(!this._animation){var b=this._isClientDiv(c);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",c));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==c.clientX||this._lastMouseMoveY!==c.clientY;this._lastMouseMoveX=c.clientX;this._lastMouseMoveY=c.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(a.isMac?c.metaKey:c.ctrlKey));
if(!this._isW3CEvents){if(c.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&c.button===1&&(this._clickCount&1)!==0&&b)return this._clickCount=2,this._handleMouse(c,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var b=c.clientX,c=c.clientY,e=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect(),f=this._getClientWidth(),h=this._getClientHeight(),d=g.left+e.left,l=g.top+e.top,f=g.left+e.left+f,e=g.top+e.top+h;c<l?this._doAutoScroll("up",b,c-l):c>e?this._doAutoScroll("down",
b,c-e):b<d&&!this._wrapMode?this._doAutoScroll("left",b-d,c):b>f&&!this._wrapMode?this._doAutoScroll("right",b-f,c):(this._endAutoScroll(),this._setSelectionTo(b,c,!0))}}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,c){return{type:a,event:c,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,c){var b=this.convert({x:c.clientX,y:c.clientY},
"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(c){var b=c.which?c.button===0:c.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(c)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",c));if(!this._linksVisible&&b&&this._isMouseDown){if(this._dragOffset!==-1)b=this._getSelection(),b.extend(this._dragOffset),b.collapse(),this._setSelection(b,!0,!0),this._dragOffset=
-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);a.isFirefox&&c.preventDefault()}},_handleMouseWheel:function(c){var b=this._getLineHeight(),d=0,e=0;a.isIE||a.isOpera?e=-c.wheelDelta/40*b:a.isFirefox?(b=a.isMac?c.detail*3:Math.max(-256,Math.min(256,c.detail))*b,c.axis===c.HORIZONTAL_AXIS?d=b:e=b):a.isMac?(e=c.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=c.timeStamp,d=c.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=c.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,d=
Math.ceil(-c.wheelDeltaX/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),e=Math.ceil(-c.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(d=-c.wheelDeltaX,e=-c.wheelDeltaY/120*8*b);if(a.isSafari){for(b=c.target;b&&b.lineIndex===void 0;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(d,e);d=this._getScroll();if(b.x!==d.x||b.y!==d.y)return c.preventDefault&&c.preventDefault(),!1},_handlePaste:function(c){if(!this._ignoreEvent(c)&&!this._ignorePaste&&this._doPaste(c)){if(a.isIE){var b=
this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}c.preventDefault&&c.preventDefault();return!1}},_handleResize:function(){var b=this._parent.clientWidth,d=this._parent.clientHeight;if(this._parentWidth!==b||this._parentHeight!==d){this._parentWidth!==b&&this._wrapMode&&this._resetLineHeight();this._parentWidth=b;this._parentHeight=d;b=a.isIE<9;d=this._calculateMetrics();if(!c(d,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=
!1,this._resetLineHeight();this._metrics=d;b=!0}b?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var c=a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;){if(b===void 0&&c.lineIndex!==void 0)b=c.lineIndex;c=c.parentNode}var d=c?c._ruler:null;if(b===void 0&&d&&d.getOverview()==="document"){var b=this._getClientHeight(),e=this._model.getLineCount(),g=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-f.top-this._metrics.scrollWidth)*
e/(b+g.top+g.bottom-2*this._metrics.scrollWidth));0<=b&&b<e||(b=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(b,a);break;case "dblclick":if(d.onDblClick)d.onDblClick(b,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(b,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(b,a);break;case "mouseout":if(d.onMouseOut){for(e=a.relatedTarget;e&&e!==this._rootDiv;){if(e===c)return;e=e.parentNode}d.onMouseOut(b,a)}}},_handleScroll:function(){var a=this._getScroll(!1),c=this._hScroll,
b=this._vScroll;if(c!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:c,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var d=0,e=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var g=b.firstChild;if(g===a){b.ignoreChars&&(d-=b.ignoreChars);d+=c;break}b.ignoreChars&&
(d-=b.ignoreChars);d+=g.data.length;b=b.nextSibling}return Math.max(0,d)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),c=this._getModelOffset(a.anchorNode,a.anchorOffset),a=this._getModelOffset(a.focusNode,a.focusOffset);c===void 0||a===void 0||this._setSelection(new p(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var c=this._getWindow();this._selTimer&&c.clearTimeout(this._selTimer);var b=this;this._selTimer=
c.setTimeout(function(){if(b._clientDiv)b._selTimer=null,b._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(c){if(!this._ignoreEvent(c)){this._imeOffset=-1;if(a.isAndroid){for(var b=this._getWindow().getSelection(),d=b.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var e=this._model,g=d.lineIndex,f=e.getLine(g),h=f,l=0,e=e.getLineStart(g);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),g=d.ownerDocument.createTextNode(c.data),b.getRangeAt(0).insertNode(g),
l=this._getDOMText(d,g),h=l.text,l=l.offset,g.parentNode.removeChild(g);d.lineRemoved=!0;for(d=0;f.charCodeAt(d)===h.charCodeAt(d)&&d<l;)d++;b=f.length-1;for(g=h.length-f.length;f.charCodeAt(b)===h.charCodeAt(b+g)&&b+g>=l+c.data.length;)b--;b++;f=h.substring(d,b+g);d+=e;b+=e;this._modifyContent({text:f,start:d,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(c.data);c.preventDefault()}},_handleTouchStart:function(c){this._commitIME();var b=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display=
"none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=c.touches;if(d.length===1){var d=d[0],e=d.clientX,g=d.clientY;this._touchStartX=e;this._touchStartY=g;if(a.isAndroid&&(g<d.pageY-b.pageYOffset||e<d.pageX-b.pageXOffset))e=d.pageX-b.pageXOffset,g=d.pageY-b.pageYOffset;b=this.convert({x:e,y:g},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=c.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=
a.touches;if(c.length===1){c=c[0];this._touchCurrentX=c.clientX;this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,
b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";d.clearInterval(b._touchScrollTimer);b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,c=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var c,b,d=this._keyModes;
for(b=d.length-1;b>=0;b--)if(c=d[b],typeof c.match==="function"&&(c=c.match(a),c!==void 0))return this.invokeAction(c);return!1},_doMove:function(a,c){var b=this._model,d=c.getCaret(),e=b.getLineAtOffset(d);if(!a.count)a.count=1;for(;a.count!==0;){var g=b.getLineStart(e);if(a.count<0&&d===g)if(e>0)a.unit==="character"&&a.count++,e--,c.extend(b.getLineEnd(e));else break;else if(a.count>0&&d===b.getLineEnd(e))if(e+1<b.getLineCount())a.unit==="character"&&a.count--,e++,c.extend(b.getLineStart(e));else break;
else{var f=!1;a.expandTab&&a.unit==="character"&&(d-g)%this._tabSize===0&&(f=!/[^ ]/.test(b.getText(g,d)));f?(c.extend(d-this._tabSize),a.count+=a.count<0?1:-1):(g=this._getLine(e),c.extend(g.getNextOffset(d,a)),g.destroy())}d=c.getCaret()}return c},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,c)}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doCase:function(a){var c=this._getSelection();
this._doMove(a,c);var b=this.getText(c.start,c.end);this._setSelection(c,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(c=0;c<b.length;c++){var d=b[c],e=d.toLowerCase(),d=e!==d?e:d.toUpperCase();a+=d}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var c=this._getSelection();if(this._overwriteMode&&c.isEmpty()){var b=this._model,d=b.getLineAtOffset(c.end);
c.end<b.getLineEnd(d)&&(b=this._getLine(d),c.extend(b.getNextOffset(c.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?this._setClipboardText(this._getBaseText(c.start,c.end),a):!0},_doCursorNext:function(a){var c=this._getSelection();!c.isEmpty()&&!a.select?c.start=c.end:this._doMove(a,c);a.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(a){var c=
this._getSelection();if(!c.isEmpty()&&!a.select)c.end=c.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,c)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doCut:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();c.isEmpty()&&this._doMove(a,c);this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=
this._getSelection(),b=this._model,d;if(a.ctrl)c.extend(b.getCharCount()),d=function(){};else{var e=c.getCaret(),g=b.getLineAtOffset(e);if(this._wrapMode){var f=this._getLine(g),e=f.getLineIndex(e),e=e===f.getLineCount()-1?b.getLineEnd(g):f.getLineStart(e+1)-1;f.destroy()}else a.count&&a.count>0&&(g=Math.min(g+a.count-1,b.getLineCount()-1)),e=b.getLineEnd(g);c.extend(e)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());
if(a&&a.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(a){var c=this._getSelection(),b=this._model,d;if(a.ctrl)c.extend(0),d=function(){};else{var e=c.getCaret(),g=b.getLineAtOffset(e);this._wrapMode?(b=this._getLine(g),e=b.getLineIndex(e),e=b.getLineStart(e),b.destroy()):e=b.getLineStart(g);c.extend(e)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doLineDown:function(c){var b=this._model,d=this._getSelection(),e=d.getCaret(),g=b.getLineAtOffset(e),f=
this._getLine(g),h=this._columnX,l=1,m=!1;if(h===-1||c.wholeLine||c.select&&a.isIE)h=c.wholeLine?b.getLineEnd(g+1):e,h=f.getBoundingClientRect(h).left;(e=f.getLineIndex(e))<f.getLineCount()-1?l=f.getClientRects(e+1).top+1:(e=b.getLineCount()-1,m=g===e,c.count&&c.count>0?g=Math.min(g+c.count,e):g++);e=!1;if(m){if(c.select||a.isMac||a.isLinux)d.extend(b.getCharCount()),e=!0}else f.lineIndex!==g&&(f.destroy(),f=this._getLine(g)),d.extend(f.getOffset(h,l)),e=!0;e&&(c.select||d.collapse(),this._setSelection(d,
!0,!0));this._columnX=h;f.destroy();return!0},_doLineUp:function(c){var b=this._model,d=this._getSelection(),e=d.getCaret(),g=b.getLineAtOffset(e),f=this._getLine(g),h=this._columnX,l=!1,m;if(h===-1||c.wholeLine||c.select&&a.isIE)h=c.wholeLine?b.getLineStart(g-1):e,h=f.getBoundingClientRect(h).left;(e=f.getLineIndex(e))>0?m=f.getClientRects(e-1).top+1:(l=g===0,l||(c.count&&c.count>0?g=Math.max(g-c.count,0):g--,m=this._getLineHeight(g)-1));e=!1;if(l){if(c.select||a.isMac||a.isLinux)d.extend(0),e=!0}else f.lineIndex!==
g&&(f.destroy(),f=this._getLine(g)),d.extend(f.getOffset(h,m)),e=!0;e&&(c.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=h;f.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(c){var b=this,d=this._model,e=this._getSelection(),g=e.getCaret(),f=d.getLineAtOffset(g),h=d.getLineCount(),l=this._getScroll(),d=this._getClientHeight(),m,i;if(this._lineHeight){m=this._columnX;l=this._getBoundsAtOffset(g);if(m===-1||c.select&&a.isIE)m=l.left;g=this._getLineIndex(l.top+d);
i=this._getLine(g);f=this._getLinePixel(g);g=i.getOffset(m,l.top+d-f);d=i.getBoundingClientRect(g);i.destroy();e.extend(g);c.select||e.collapse();this._setSelection(e,!0,!0,function(){b._columnX=m},d.top+f-l.top);return!0}if(f<h-1){var n=this._getLineHeight(),j=Math.min(h-f-1,Math.floor(d/n)),j=Math.max(1,j);m=this._columnX;if(m===-1||c.select&&a.isIE)i=this._getLine(f),m=i.getBoundingClientRect(g).left,i.destroy();i=this._getLine(f+j);e.extend(i.getOffset(m,0));i.destroy();c.select||e.collapse();
c=h*n;g=l.y+j*n;g+d>c&&(g=c-d);this._setSelection(e,!0,!0,function(){b._columnX=m},g-l.y)}return!0},_doPageUp:function(c){var b=this,d=this._model,e=this._getSelection(),g=e.getCaret(),f=d.getLineAtOffset(g),h=this._getScroll(),l=this._getClientHeight(),m;if(this._lineHeight){m=this._columnX;h=this._getBoundsAtOffset(g);if(m===-1||c.select&&a.isIE)m=h.left;g=this._getLineIndex(h.bottom-l);d=this._getLine(g);f=this._getLinePixel(g);g=d.getOffset(m,h.bottom-l-f);l=d.getBoundingClientRect(g);d.destroy();
e.extend(g);c.select||e.collapse();this._setSelection(e,!0,!0,function(){b._columnX=m},l.top+f-h.top);return!0}if(f>0){var i=this._getLineHeight(),l=Math.max(1,Math.min(f,Math.floor(l/i)));m=this._columnX;if(m===-1||c.select&&a.isIE)d=this._getLine(f),m=d.getBoundingClientRect(g).left,d.destroy();d=this._getLine(f-l);e.extend(d.getOffset(m,this._getLineHeight(f-l)-1));d.destroy();c.select||e.collapse();c=Math.max(0,h.y-l*i);this._setSelection(e,!0,!0,function(){b._columnX=m},c-h.y)}return!0},_doPaste:function(c){var b=
this;return this._getClipboardText(c,function(c){c&&(a.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(c))})!==null},_doScroll:function(a){var c=a.type,b=this._model,d=b.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();d*=e;var g=this._getScroll().y,f;switch(c){case "textStart":f=0;break;case "textEnd":f=d-a;break;case "pageDown":f=g+a;break;case "pageUp":f=g-a;break;case "lineDown":f=
g+e;break;case "lineUp":f=g-e;break;case "centerLine":c=this._getSelection(),f=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-f+1)*e,f=f*e-a/2+b/2}f!==void 0&&(f=Math.min(Math.max(0,f),d-a),this._scrollViewAnimated(0,f-g,function(){}));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),
b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%this._tabSize+1).join(" ");this._doContent(a);return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var c=
this._model,b=this._getSelection(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=b.getCaret(),g=c.getLineCount(),f=c.getLineAtOffset(e),h;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),h=Math.max(0,Math.min(g-1,f+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")h=this._getLineIndex(d.y),f=this._getLine(f),d.x+=f.getBoundingClientRect(e,!1).left,f.destroy();
h===0&&(a.isMac||a.isLinux)?b.extend(0):h===g-1&&(a.isMac||a.isLinux)?b.extend(c.getCharCount()):(f=this._getLine(h),b.extend(f.getOffset(d.x,d.y-this._getLinePixel(h))),f.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var c=this._model.getLineCount(),b=0;if(a){for(var a=
0,d=(new Date).getTime(),e=0;b<c;)if(this._lineHeight[b]||(a++,e||(e=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-d>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){var g=this;this._calculateLHTimer=a.setTimeout(function(){g._calculateLHTimer=null;g._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),
c=a.getBoundingClientRect();a.destroy();return Math.max(1,c.bottom-c.top)},_calculateMetrics:function(){var c=this._clientDiv,b=c.ownerDocument,d=a.createElement(b,"div");d.style.lineHeight="normal";var g={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(g);e(g.style,d);d.style.position="fixed";d.style.left="-1000px";var f=a.createElement(b,"span");f.appendChild(b.createTextNode(" "));d.appendChild(f);var h=a.createElement(b,"span");h.style.fontStyle=
"italic";h.appendChild(b.createTextNode(" "));d.appendChild(h);var l=a.createElement(b,"span");l.style.fontWeight="bold";l.appendChild(b.createTextNode(" "));d.appendChild(l);g=a.createElement(b,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(b.createTextNode(" "));d.appendChild(g);c.appendChild(d);var i=d.getBoundingClientRect(),f=f.getBoundingClientRect(),h=h.getBoundingClientRect(),l=l.getBoundingClientRect(),g=g.getBoundingClientRect(),f=f.bottom-f.top,h=h.bottom-h.top,
l=l.bottom-l.top,j=g.bottom-g.top,p=0,g=i.bottom-i.top<=0,i=Math.max(1,i.bottom-i.top);h>f&&(p=1);l>h&&(p=2);j>l&&(p=3);var k;if(p!==0){k={style:{}};if((p&1)!==0)k.style.fontStyle="italic";if((p&2)!==0)k.style.fontWeight="bold"}f=n(d);c.removeChild(d);j=m(this._viewDiv);d=a.createElement(b,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=j.left+"px";d.style.paddingTop=j.top+"px";d.style.paddingRight=j.right+"px";d.style.paddingBottom=j.bottom+"px";d.style.width="100px";d.style.height=
"100px";j=a.createElement(b,"div");j.style.width="100%";j.style.height="100%";d.appendChild(j);c.appendChild(d);p=d.getBoundingClientRect();h=j.getBoundingClientRect();l=0;if(!this._singleMode)d.style.overflow="hidden",j.style.height="200px",l=d.clientWidth,d.style.overflow="scroll",l-=d.clientWidth;c.removeChild(d);j={left:h.left-p.left,top:h.top-p.top,right:p.right-h.right,bottom:p.bottom-h.bottom};h=p=0;if(!g&&(this._wrapOffset||this._marginOffset))d=a.createElement(b,"div"),d.style.position="fixed",
d.style.left="-1000px",d.innerHTML=Array(this._wrapOffset+1).join(" "),c.appendChild(d),p=d.getBoundingClientRect(),p=Math.ceil(p.right-p.left),d.innerHTML=Array(this._marginOffset+1).join(" "),h=d.getBoundingClientRect(),h=Math.ceil(h.right-h.left),c.removeChild(d);return{lineHeight:i,largestFontStyle:k,lineTrim:f,viewPadding:j,scrollWidth:l,wrapWidth:p,marginWidth:h,invalid:g}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var c=
this._getSelection();if(c.isEmpty())return!1;a==="next"?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),d=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+d.length-a.length;b!==a&&this._doContent(d.substring(b,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new i.DefaultKeyMode(this));
var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(c){return a._doLineUp(g(c,{select:!1}))},actionDescription:{name:j.lineUp}},lineDown:{defaultHandler:function(c){return a._doLineDown(g(c,{select:!1}))},actionDescription:{name:j.lineDown}},lineStart:{defaultHandler:function(c){return a._doHome(g(c,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineStart}},lineEnd:{defaultHandler:function(c){return a._doEnd(g(c,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineEnd}},
charPrevious:{defaultHandler:function(c){return a._doCursorPrevious(g(c,{select:!1,unit:"character"}))},actionDescription:{name:j.charPrevious}},charNext:{defaultHandler:function(c){return a._doCursorNext(g(c,{select:!1,unit:"character"}))},actionDescription:{name:j.charNext}},pageUp:{defaultHandler:function(c){return a._doPageUp(g(c,{select:!1}))},actionDescription:{name:j.pageUp}},pageDown:{defaultHandler:function(c){return a._doPageDown(g(c,{select:!1}))},actionDescription:{name:j.pageDown}},scrollPageUp:{defaultHandler:function(c){return a._doScroll(g(c,
{type:"pageUp"}))},actionDescription:{name:j.scrollPageUp}},scrollPageDown:{defaultHandler:function(c){return a._doScroll(g(c,{type:"pageDown"}))},actionDescription:{name:j.scrollPageDown}},scrollLineUp:{defaultHandler:function(c){return a._doScroll(g(c,{type:"lineUp"}))},actionDescription:{name:j.scrollLineUp}},scrollLineDown:{defaultHandler:function(c){return a._doScroll(g(c,{type:"lineDown"}))},actionDescription:{name:j.scrollLineDown}},wordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(g(c,
{select:!1,unit:"word"}))},actionDescription:{name:j.wordPrevious}},wordNext:{defaultHandler:function(c){return a._doCursorNext(g(c,{select:!1,unit:"word"}))},actionDescription:{name:j.wordNext}},textStart:{defaultHandler:function(c){return a._doHome(g(c,{select:!1,ctrl:!0}))},actionDescription:{name:j.textStart}},textEnd:{defaultHandler:function(c){return a._doEnd(g(c,{select:!1,ctrl:!0}))},actionDescription:{name:j.textEnd}},scrollTextStart:{defaultHandler:function(c){return a._doScroll(g(c,{type:"textStart"}))},
actionDescription:{name:j.scrollTextStart}},scrollTextEnd:{defaultHandler:function(c){return a._doScroll(g(c,{type:"textEnd"}))},actionDescription:{name:j.scrollTextEnd}},centerLine:{defaultHandler:function(c){return a._doScroll(g(c,{type:"centerLine"}))},actionDescription:{name:j.centerLine}},selectLineUp:{defaultHandler:function(c){return a._doLineUp(g(c,{select:!0}))},actionDescription:{name:j.selectLineUp}},selectLineDown:{defaultHandler:function(c){return a._doLineDown(g(c,{select:!0}))},actionDescription:{name:j.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(c){return a._doLineUp(g(c,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(c){return a._doLineDown(g(c,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineDown}},selectLineStart:{defaultHandler:function(c){return a._doHome(g(c,{select:!0,ctrl:!1}))},actionDescription:{name:j.selectLineStart}},selectLineEnd:{defaultHandler:function(c){return a._doEnd(g(c,{select:!0,ctrl:!1}))},
actionDescription:{name:j.selectLineEnd}},selectCharPrevious:{defaultHandler:function(c){return a._doCursorPrevious(g(c,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharPrevious}},selectCharNext:{defaultHandler:function(c){return a._doCursorNext(g(c,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharNext}},selectPageUp:{defaultHandler:function(c){return a._doPageUp(g(c,{select:!0}))},actionDescription:{name:j.selectPageUp}},selectPageDown:{defaultHandler:function(c){return a._doPageDown(g(c,
{select:!0}))},actionDescription:{name:j.selectPageDown}},selectWordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(g(c,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordPrevious}},selectWordNext:{defaultHandler:function(c){return a._doCursorNext(g(c,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordNext}},selectTextStart:{defaultHandler:function(c){return a._doHome(g(c,{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextStart}},selectTextEnd:{defaultHandler:function(c){return a._doEnd(g(c,
{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextEnd}},deletePrevious:{defaultHandler:function(c){return a._doBackspace(g(c,{unit:"character"}))},actionDescription:{name:j.deletePrevious}},deleteNext:{defaultHandler:function(c){return a._doDelete(g(c,{unit:"character"}))},actionDescription:{name:j.deleteNext}},deleteWordPrevious:{defaultHandler:function(c){return a._doBackspace(g(c,{unit:"word"}))},actionDescription:{name:j.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(c){return a._doDelete(g(c,
{unit:"word"}))},actionDescription:{name:j.deleteWordNext}},deleteLineStart:{defaultHandler:function(c){return a._doBackspace(g(c,{unit:"line"}))},actionDescription:{name:j.deleteLineStart}},deleteLineEnd:{defaultHandler:function(c){return a._doDelete(g(c,{unit:"line"}))},actionDescription:{name:j.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:j.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:j.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:j.enter}},enterNoCursor:{defaultHandler:function(c){return a._doEnter(g(c,{noCursor:!0}))},actionDescription:{name:j.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:j.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:j.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:j.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:j.paste}},
uppercase:{defaultHandler:function(c){return a._doCase(g(c,{type:"upper"}))},actionDescription:{name:j.uppercase}},lowercase:{defaultHandler:function(c){return a._doCase(g(c,{type:"lower"}))},actionDescription:{name:j.lowercase}},capitalize:{defaultHandler:function(c){return a._doCase(g(c,{unit:"word",type:"capitalize"}))},actionDescription:{name:j.capitalize}},reversecase:{defaultHandler:function(c){return a._doCase(g(c,{type:"reverse"}))},actionDescription:{name:j.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:j.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:j.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:j.toggleWrapMode}}}},_createRulerParent:function(c){var b=a.createElement(document,"div");b.className=c;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom=
"0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");this._rootDiv.appendChild(b);return b},_createRuler:function(c,b){if(this._clientDiv){var d=this._getRulerParent(c);if(d){if(d!==this._marginDiv||this._marginOffset)d.style.display="block";var e=a.createElement(d.ownerDocument,"div");e._ruler=c;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat="left";e.style.styleFloat="left";e.style.outline="none";if(b===void 0||b<0||b>=d.children.length)d.appendChild(e);
else{for(var g=d.firstChild;g&&b-- >0;)g=g.nextSibling;d.insertBefore(e,g)}}}},_createView:function(){if(!this._clientDiv){for(var c=this._parent;c.hasChildNodes();)c.removeChild(c.lastChild);var b=c.ownerDocument,d=a.createElement(b,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");c.appendChild(d);this._leftDiv=this._createRulerParent("textviewLeftRuler");
c=a.createElement(b,"div");c.className="textviewScroll";this._viewDiv=c;c.tabIndex=-1;c.style.position="absolute";c.style.top="0px";c.style.bottom="0px";c.style.borderWidth="0px";c.style.margin="0px";c.style.outline="none";c.style.background="transparent";if(a.isMac&&a.isWebkit)c.style.pointerEvents="none",c.style.zIndex="2";d.appendChild(c);(this._rightDiv=this._createRulerParent("textviewRightRuler")).style.right="0px";var e=a.createElement(b,"div");this._scrollDiv=e;e.style.margin="0px";e.style.borderWidth=
"0px";e.style.padding="0px";c.appendChild(e);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";if(!a.isIE&&!a.isIOS)this._clipDiv=c=a.createElement(b,"div"),c.style.position="absolute",c.style.overflow="hidden",c.style.margin="0px",c.style.borderWidth="0px",c.style.padding="0px",c.style.background="transparent",d.appendChild(c),this._clipScrollDiv=e=a.createElement(b,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",
c.appendChild(e);this._setFullSelection(this._fullSelection,!0);c=a.createElement(b,"div");c.className="textviewContent";this._clientDiv=c;c.tabIndex=0;c.style.position="absolute";c.style.borderWidth="0px";c.style.margin="0px";c.style.padding="0px";c.style.outline="none";c.style.zIndex="1";c.style.WebkitUserSelect="text";c.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)c.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(c);if(a.isIOS||a.isAndroid)this._vScrollDiv=
e=a.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",d.appendChild(e),this._hScrollDiv=e=a.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle=
"solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",d.appendChild(e);if(a.isFirefox&&!c.setCapture)this._overlayDiv=b=a.createElement(b,"div"),b.style.position=c.style.position,b.style.borderWidth=c.style.borderWidth,b.style.margin=c.style.margin,b.style.padding=c.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||
d).appendChild(b);c.contentEditable="true";c.setAttribute("role","textbox");c.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();d=this._rulers;for(b=0;b<d.length;b++)this._createRuler(d[b]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},
scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:b.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=this._getRulerParent(a);if(c)for(var b=c.firstChild;b;){if(b._ruler===a){b._ruler=void 0;c.removeChild(b);if(c.children.length===0&&(c!==this._marginDiv||!this._marginOffset))c.style.display="none";break}b=b.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=
this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),
b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(c,b){var d=this._model.getLineDelimiter(),e,g,f=this._getWindow(),h=f.clipboardData;if(!h&&c)h=c.clipboardData;if(h)return e=[],g=h.getData(a.isIE?"Text":"text/plain"),
l(g,function(a){e.push(a)},function(){e.push(d)}),g=e.join(""),b&&b(g),g;if(a.isFirefox){this._ignoreFocus=!0;var m=this._clipboardDiv,h=this._rootDiv.ownerDocument;if(!m)this._clipboardDiv=m=a.createElement(h,"div"),m.style.position="fixed",m.style.whiteSpace="pre",m.style.left="-1000px",this._rootDiv.appendChild(m);m.innerHTML="<pre contenteditable=''></pre>";m.firstChild.focus();var i=this,n=function(){var a=i._getTextFromElement(m);m.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(d)});
return e.join("")},j=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{j=h.execCommand("paste",!1,null)}catch(p){j=m.childNodes.length>1||m.firstChild&&m.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!j)return c?(f.setTimeout(function(){i.focus();(g=n())&&b&&b(g);i._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(g=n())&&b&&b(g);return g}return""},_getDOMText:function(a,c){for(var b=a.firstChild,d="",e=0;b;){var g;if(!b.ignore)if(b.ignoreChars){g=
b.lastChild;for(var f=0,h=[],l=-1;g;){for(var m=g.data,i=m.length-1;i>=0;i--){var n=m.substring(i,i+1);f<b.ignoreChars&&(n===" "||n==="\u200c"||n==="\ufeff")?f++:h.push(n==="\u00a0"?"\t":n)}if(c===g)l=h.length;g=g.previousSibling}h=h.reverse().join("");l!==-1&&(e=d.length+h.length-l);d+=h}else for(g=b.firstChild;g;){if(c===g)e=d.length;d+=g.data;g=g.nextSibling}b=b.nextSibling}return{text:d,offset:e}},_getTextFromElement:function(a){var c=a.ownerDocument,b=c.defaultView;if(!b.getSelection)return a.innerText||
a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],d;for(d=0;d<a.rangeCount;d++)b.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(d=0;d<b.length;d++)a.addRange(b[d]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?c._line:new r(this,a)},_getLineHeight:function(a,c){if(a!==
void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||c===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===
-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,d=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<
e&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=e&&b<d-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(d-1,b))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},
_getTopIndex:function(a){var c=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+b.top&&(c=this._getLineNext(c)||c)}return c.lineIndex},_hookEvents:function(){var c=this;this._modelListener={onChanging:function(a){c._onModelChanging(a)},onChanged:function(a){c._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",
this._modelListener.onChanged);this._themeListener={onChanged:function(){c._setThemeClass(c._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var b=this._handlers=[],d=this._clientDiv,e=this._viewDiv,g=this._rootDiv,f=this._overlayDiv||d,h=d.ownerDocument,l=this._getWindow(),m=a.isIE?h:l;b.push({target:l,type:"resize",handler:function(a){return c._handleResize(a?a:l.event)}});b.push({target:d,type:"blur",handler:function(a){return c._handleBlur(a?a:l.event)}});
b.push({target:d,type:"focus",handler:function(a){return c._handleFocus(a?a:l.event)}});b.push({target:e,type:"focus",handler:function(){d.focus()}});b.push({target:e,type:"scroll",handler:function(a){return c._handleScroll(a?a:l.event)}});b.push({target:d,type:"textInput",handler:function(a){return c._handleTextInput(a?a:l.event)}});b.push({target:d,type:"keydown",handler:function(a){return c._handleKeyDown(a?a:l.event)}});b.push({target:d,type:"keypress",handler:function(a){return c._handleKeyPress(a?
a:l.event)}});b.push({target:d,type:"keyup",handler:function(a){return c._handleKeyUp(a?a:l.event)}});a.isIE&&b.push({target:h,type:"keyup",handler:function(a){return c._handleDocKeyUp(a?a:l.event)}});b.push({target:d,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:l.event)}});b.push({target:d,type:"copy",handler:function(a){return c._handleCopy(a?a:l.event)}});b.push({target:d,type:"cut",handler:function(a){return c._handleCut(a?a:l.event)}});b.push({target:d,type:"paste",
handler:function(a){return c._handlePaste(a?a:l.event)}});if(a.isIOS||a.isAndroid)b.push({target:h,type:"selectionchange",handler:function(a){return c._handleSelectionChange(a?a:l.event)}}),b.push({target:d,type:"touchstart",handler:function(a){return c._handleTouchStart(a?a:l.event)}}),b.push({target:d,type:"touchmove",handler:function(a){return c._handleTouchMove(a?a:l.event)}}),b.push({target:d,type:"touchend",handler:function(a){return c._handleTouchEnd(a?a:l.event)}});else{b.push({target:d,type:"selectstart",
handler:function(a){return c._handleSelectStart(a?a:l.event)}});b.push({target:d,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:l.event)}});b.push({target:d,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:l.event)}});b.push({target:d,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:l.event)}});b.push({target:m,type:"mouseup",handler:function(a){return c._handleMouseUp(a?a:l.event)}});b.push({target:m,type:"mousemove",handler:function(a){return c._handleMouseMove(a?
a:l.event)}});b.push({target:g,type:"mousedown",handler:function(a){return c._handleRootMouseDown(a?a:l.event)}});b.push({target:g,type:"mouseup",handler:function(a){return c._handleRootMouseUp(a?a:l.event)}});b.push({target:f,type:"dragstart",handler:function(a){return c._handleDragStart(a?a:l.event)}});b.push({target:f,type:"drag",handler:function(a){return c._handleDrag(a?a:l.event)}});b.push({target:f,type:"dragend",handler:function(a){return c._handleDragEnd(a?a:l.event)}});b.push({target:f,
type:"dragenter",handler:function(a){return c._handleDragEnter(a?a:l.event)}});b.push({target:f,type:"dragover",handler:function(a){return c._handleDragOver(a?a:l.event)}});b.push({target:f,type:"dragleave",handler:function(a){return c._handleDragLeave(a?a:l.event)}});b.push({target:f,type:"drop",handler:function(a){return c._handleDrop(a?a:l.event)}});b.push({target:this._clientDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:l.event)}});this._clipDiv&&
b.push({target:this._clipDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:l.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(e=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new e(function(a){c._handleDataModified(a)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return c._handleDataModified(a?a:l.event)}});this._overlayDiv&&
(b.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:l.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:l.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:l.event)}}),b.push({target:this._overlayDiv,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:l.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",
handler:function(a){return c._handleDblclick(a?a:l.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(e=0;e<b.length;e++)g=b[e],v(g.target,g.type,g.handler,g.capture)},_hookRulerEvents:function(c,b){if(c){var d=this,e=this._getWindow();a.isIE&&b.push({target:c,type:"selectstart",handler:function(){return!1}});b.push({target:c,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?
a:e.event)}});b.push({target:c,type:"click",handler:function(a){d._handleRulerEvent(a?a:e.event)}});b.push({target:c,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:e.event)}});b.push({target:c,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:e.event)}});b.push({target:c,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:e.event)}});b.push({target:c,type:"mouseout",handler:function(a){d._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(c){var b=c.parent;typeof b==="string"&&(b=(c.document||document).getElementById(b));if(!b)throw"no parent";c.parent=b;c.model=c.model||new k.TextModel;var d=this._defaultOptions(),e;for(e in d)d.hasOwnProperty(e)&&(this["_"+e]=c[e]!==void 0?c[e]:d[e].value);this._keyModes=[];this._rulers=[];this._selection=new p(0,0,!1);this._linksVisible=
!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!a.isIE||a.isIE>=9)&&typeof b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=
this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}c&&(b=
this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,d=a.removedCharCount,e=a.addedLineCount,g=a.removedLineCount,f=this._getSelection();f.end>c&&(f.end>c&&f.start<c+d?f.setCaret(c+b):(f.start+=b-d,f.end+=b-d),this._setSelection(f,!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){d=b.lineIndex;if(c<=
d&&d<=c+g)c===d&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(d>c+g)b.lineIndex=d+e-g,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}this._lineHeight&&(a=[c,g].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+g)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type=
"ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,c){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&c!==void 0)for(var b=a;b<c;b++)this._lineHeight[b]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},
_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new p(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var c=this._clientDiv;if(c){for(var b=c.firstChild;b;)b.lineRemoved=!0,b=b.nextSibling;if(a.isFirefox)this._ignoreFocus=
!1,(b=this._hasFocus)&&c.blur(),c.contentEditable=!1,c.contentEditable=!0,b&&c.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,c,b){var d=this._getWindow();if(b&&this._scrollAnimation){var e=this;this._animation=new u({window:d,duration:this._scrollAnimation,curve:[c,0],onAnimate:function(a){a=c-Math.floor(a);e._scrollView(0,a);c-=a},onEnd:function(){e._animation=null;e._scrollView(a,c);b&&d.setTimeout(b,0)}});this._animation.play()}else this._scrollView(a,c),b&&d.setTimeout(b,0)},_scrollView:function(a,
c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(c,b){var d,e=this._getWindow(),g=e.clipboardData;if(!g&&b)g=b.clipboardData;if(g&&(d=[],l(c,function(a){d.push(a)},function(){d.push(a.platformDelimiter)}),g.setData(a.isIE?"Text":"text/plain",d.join(""))))return!0;var f=this._parent.ownerDocument,h=a.createElement(f,"pre");h.style.position="fixed";h.style.left="-1000px";l(c,function(a){h.appendChild(f.createTextNode(a))},function(){h.appendChild(a.createElement(f,
"br"))});h.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(h);g=f.createRange();g.setStart(h.firstChild,0);g.setEndBefore(h.lastChild);var m=e.getSelection();m.rangeCount>0&&m.removeAllRanges();m.addRange(g);var i=this,g=function(){h&&h.parentNode===i._clientDiv&&i._clientDiv.removeChild(h);i._updateDOMSelection()},m=!1;this._ignoreCopy=!0;try{m=f.execCommand("copy",!1,null)}catch(n){}this._ignoreCopy=!1;if(!m&&b)return e.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(c,
b,d,e,g){for(var f,h,l,m,i=0,n=c.firstChild,j,p,k=this._model.getLine(c.lineIndex).length;n;){if(!n.ignore){j=n.firstChild;p=j.length;n.ignoreChars&&(p-=n.ignoreChars);if(i+p>b||i+p>=k){f=j;h=b-i;n.ignoreChars&&p>0&&h===p&&(h+=n.ignoreChars);break}i+=p}n=n.nextSibling}for(var i=0,n=d.firstChild,t=this._model.getLine(d.lineIndex).length;n;){if(!n.ignore){j=n.firstChild;p=j.length;n.ignoreChars&&(p-=n.ignoreChars);if(p+i>e||i+p>=t){l=j;m=e-i;n.ignoreChars&&p>0&&m===p&&(m+=n.ignoreChars);break}i+=p}n=
n.nextSibling}this._setDOMFullSelection(c,b,k,d,e,t);c=this._getWindow();b=this._parent.ownerDocument;if(c.getSelection){d=c.getSelection();c=b.createRange();c.setStart(f,h);c.setEnd(l,m);if(this._hasFocus&&(d.anchorNode!==f||d.anchorOffset!==h||d.focusNode!==l||d.focusOffset!==m||d.anchorNode!==l||d.anchorOffset!==m||d.focusNode!==f||d.focusOffset!==h))this._ignoreSelect=!1,d.rangeCount>0&&d.removeAllRanges(),d.addRange(c),this._ignoreSelect=!0;if(this._cursorDiv&&(c=b.createRange(),g?(c.setStart(f,
h),c.setEnd(f,h)):(c.setStart(l,m),c.setEnd(l,m)),l=c.getClientRects()[0],m=this._cursorDiv.parentNode,f=m.getBoundingClientRect(),l&&f))this._cursorDiv.style.top=l.top-f.top+m.scrollTop+"px",this._cursorDiv.style.left=l.left-f.left+m.scrollLeft+"px"}else if(b.selection&&this._hasFocus)g=b.body,c=a.createElement(b,"div"),g.appendChild(c),g.removeChild(c),c=g.createTextRange(),c.moveToElementText(f.parentNode),c.moveStart("character",h),f=g.createTextRange(),f.moveToElementText(l.parentNode),f.moveStart("character",
m),c.setEndPoint("EndToStart",f),this._ignoreSelect=!1,c.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,c,b,d,e){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,b.style.width="0px",b.style.height="0px",!(a===d&&c===e))){var g=this._model,f=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),l=this._viewDiv.getBoundingClientRect(),b=l.left+f.left,m=h.right,f=l.top+f.top,
i=h.bottom,l=h=0;this._clipDiv?(l=this._clipDiv.getBoundingClientRect(),h=l.left-this._clipDiv.scrollLeft):(l=this._rootDiv.getBoundingClientRect(),h=l.left);l=l.top;this._ignoreDOMSelection=!0;var n=(new r(this,a.lineIndex,a)).getBoundingClientRect(g.getLineStart(a.lineIndex)+c,!1),j=n.left,c=(new r(this,d.lineIndex,d)).getBoundingClientRect(g.getLineStart(d.lineIndex)+e,!1),g=c.left;this._ignoreDOMSelection=!1;var p=this._selDiv1,j=Math.min(m,Math.max(b,j)),k=Math.min(i,Math.max(f,n.top)),t=m,e=
Math.min(i,Math.max(f,n.bottom));p.style.left=j-h+"px";p.style.top=k-l+"px";p.style.width=Math.max(0,t-j)+"px";p.style.height=Math.max(0,e-k)+"px";if(a.lineIndex===d.lineIndex)t=Math.min(g,m),p.style.width=Math.max(0,t-j)+"px";else if(n=Math.min(i,Math.max(f,c.top)),g=Math.min(m,Math.max(b,g)),f=Math.min(i,Math.max(f,c.bottom)),i=this._selDiv3,i.style.left=b-h+"px",i.style.top=n-l+"px",i.style.width=Math.max(0,g-b)+"px",i.style.height=Math.max(0,f-n)+"px",Math.abs(a.lineIndex-d.lineIndex)>1)a=this._selDiv2,
a.style.left=b-h+"px",a.style.top=e-l+"px",a.style.width=Math.max(0,m-b)+"px",a.style.height=Math.max(0,n-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(c){if(this._linksVisible!==c){this._linksVisible=c;if(a.isIE&&c)this._hadFocus=this._hasFocus;var b=this._clientDiv;b.contentEditable=!c;this._hadFocus&&!c&&b.focus();
if(this._overlayDiv)this._overlayDiv.style.zIndex=c?"-1":"1";for(c=this._getLineNext();c;){if(c.hasLink)for(b=c.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var d=b.nextSibling,e=b.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&c.replaceChild(c._line._createSpan(c,b.firstChild.data,e),b);b=d}c=this._getLineNext(c)}this._updateDOMSelection()}},_setSelection:function(a,c,b,d,e){if(a){this._columnX=-1;b===void 0&&(b=!0);var g=this._selection;this._selection=a;c!==!1&&this._showCaret(!1,d,c,
e);b&&this._updateDOMSelection();if(!g.equals(a))this.onSelection({type:"Selection",oldValue:{start:g.start,end:g.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,c,b,d){var e=this._model,g=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),a=this._getLineIndex(c.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(c.x,c.y-this._getLinePixel(a));e.destroy();if(d&&!b&&g.start<=a&&a<g.end)return this._dragOffset=a,!1;g.extend(a);b||g.collapse()}else(this._clickCount&
1)===0?(e=this._getLine(a),a=e.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,d=e.getNextOffset(a,{unit:"wordend",count:1})):(b=e.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(b=e.getNextOffset(a,{unit:"word",count:-1}),d=e.getNextOffset(b,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(d=e.getLineAtOffset(this._doubleClickSelection.start),a>=d?(b=e.getLineStart(d),
d=e.getLineEnd(a)):(b=e.getLineStart(a),d=e.getLineEnd(d))):(b=e.getLineStart(a),d=e.getLineEnd(a)),g.setCaret(b),g.extend(d);this._setSelection(g,!0,!0);return!0},_setFullSelection:function(c,b){this._fullSelection=c;if(a.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!a.isIOS){var e=d.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var g=a.createElement(e,"div");this._selDiv1=g;g.style.position=
"absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";d.appendChild(g);var f=a.createElement(e,"div");this._selDiv2=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);this._selDiv3=
e=a.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);if(a.isFirefox&&a.isMac){d=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d=
"rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;g.style.background=d;f.style.background=d;e.style.background=d}b||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),
this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var c=a.createElement(document,"div");c.className="textviewBlockCursor";this._cursorDiv=c;c.tabIndex=-1;c.style.zIndex="2";c.style.color=
"transparent";c.style.position="absolute";c.style.pointerEvents="none";c.innerHTML="&nbsp;";this._viewDiv.appendChild(c);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(a,c){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!c)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,c){this._wrapOffset=a;if(!c)this._metrics=this._calculateMetrics(),
this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,c){this._singleMode=a;this._updateOverflow();this._updateStyle(c)},_setTabSize:function(c,b){this._tabSize=c;this._customTabSize=void 0;var d=this._clientDiv;if(a.isOpera){if(d)d.style.OTabSize=this._tabSize+""}else if(a.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==
8)this._customTabSize=this._tabSize;b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,c){this._themeClass=a;var b="textview",d=this._theme.getThemeClass();d&&(b+=" "+d);this._themeClass&&d!==this._themeClass&&(b+=" "+this._themeClass);
this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a&&this._wrappable;var b=this._clientDiv;this._wrapMode?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word"):(b.style.whiteSpace="pre",b.style.wordWrap="normal");this._updateOverflow();c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c,b,d){if(this._clientDiv){var e=this._model,g=this._getSelection(),f=this._getScroll(),h=g.getCaret(),l=g.start,m=g.end,i=e.getLineAtOffset(m),
n=Math.max(Math.max(l,e.getLineStart(i)),m-1),e=this._getClientWidth(),i=this._getClientHeight(),j=e/4,p=this._getBoundsAtOffset(h===l?l:n),k=p.left,t=p.right,r=p.top,s=p.bottom;a&&!g.isEmpty()&&(p=this._getBoundsAtOffset(h===m?l:n),p.top===r?h===l?t=k+Math.min(p.right-k,e):k=t-Math.min(t-p.left,e):h===l?s=r+Math.min(p.bottom-r,i):r=s-Math.min(s-p.top,i));a=0;k<f.x&&(a=Math.min(k-f.x,-j));t>f.x+e&&(a=Math.max(t-f.x-e,j));g=0;r<f.y?g=r-f.y:s>f.y+i&&(g=s-f.y-i);d&&(d>0?g>0&&(g=Math.max(g,d)):g<0&&(g=
Math.min(g,d)));if(a!==0||g!==0)return g!==0&&typeof b==="number"&&(b<0&&(b=0),b>1&&(b=1),g+=Math.floor(g>0?b*i:-b*i)),this._scrollViewAnimated(a,g,c),i!==this._getClientHeight()||e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else c&&c();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",
this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var c=this._handlers[a];w(c.target,c.type,c.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&
this._clientDiv){var a=this._getSelection(),c=this._model,b=c.getLineAtOffset(a.start),d=c.getLineAtOffset(a.end),e=this._getLineNext();if(e){var g=this._getLinePrevious(),f;b<e.lineIndex?(f=e,b=0):b>g.lineIndex?(f=g,b=0):(f=this._getLineNode(b),b=a.start-c.getLineStart(b));d<e.lineIndex?c=0:d>g.lineIndex?(e=g,c=0):(e=this._getLineNode(d),c=a.end-c.getLineStart(d));this._setDOMSelection(f,b,e,c,a.caret)}}},_update:function(c){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),
this._updateTimer=null,c=!1;var b=this._clientDiv,d=this._viewDiv;if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,g=this._getScroll(!1),f=this._getViewPadding(),h=e.getLineCount(),l=this._getLineHeight(),m=!1,i=!1,n=!1,j=this._metrics.scrollWidth;if(this._wrapMode)b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px";var p,k,t,s,v=0,w=0,u;if(this._lineHeight){for(;w<h;){u=this._getLineHeight(w);if(v+u>g.y)break;
v+=u;w++}p=w;k=Math.max(0,p-1);t=e=g.y-v;p>0&&(e+=this._getLineHeight(p-1))}else s=Math.max(0,g.y)/l,p=Math.floor(s),k=Math.max(0,p-1),e=Math.round((s-k)*l),t=Math.round((s-p)*l);this._topIndexY=t;s=this._parent;var O=s.clientWidth,L=s.clientHeight;if(c){l=0;this._leftDiv&&(p=this._leftDiv.getBoundingClientRect(),l=p.right-p.left);p=this._getClientWidth();s=this._getClientHeight();i=p;if(this._wrapMode){if(this._metrics.wrapWidth)i=this._metrics.wrapWidth}else i=Math.max(this._maxLineWidth,i);for(;w<
h;)u=this._getLineHeight(w,!1),v+=u,w++;h=v}else{s=this._getClientHeight();t=Math.min(p+Math.floor((s+t)/l),h-1);var g=Math.min(t+1,h-1),G;for(u=b.firstChild;u;){G=u.lineIndex;var H=u.nextSibling;if(!(k<=G&&G<=g)||u.lineRemoved||u.lineIndex===-1)this._mouseWheelLine===u?(u.style.display="none",u.lineIndex=-1):b.removeChild(u);u=H}u=this._getLineNext();var H=d.ownerDocument,K=H.createDocumentFragment();for(G=k;G<=g;G++)if(!u||u.lineIndex>G)(new r(this,G)).create(K,null);else{K.firstChild&&(b.insertBefore(K,
u),K=H.createDocumentFragment());if(u&&u.lineChanged)u=(new r(this,G)).create(K,u),u.lineChanged=!1;u=this._getLineNext(u)}K.firstChild&&b.insertBefore(K,u);if(a.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";u=this._getLineNext();G=s+e;for(K=!1;u;){k=u.lineWidth;if(k===void 0)if(H=u._line.getBoundingClientRect(),k=u.lineWidth=Math.ceil(H.right-H.left),H=H.bottom-H.top,this._lineHeight)this._lineHeight[u.lineIndex]=H;else if(l!==0&&H!==0&&Math.ceil(l)!==Math.ceil(H))this._variableLineHeight=
!0,this._lineHeight=[],this._lineHeight[u.lineIndex]=H;if(this._lineHeight&&!K&&(G-=this._lineHeight[u.lineIndex],G<0))t=u.lineIndex,K=!0;if(!this._wrapMode){if(k>=this._maxLineWidth)this._maxLineWidth=k,this._maxLineIndex=u.lineIndex;if(this._checkMaxLineIndex===u.lineIndex)this._checkMaxLineIndex=-1}if(u.lineIndex===p)this._topChild=u;if(u.lineIndex===t)this._bottomChild=u;u=this._getLineNext(u)}if(this._checkMaxLineIndex!==-1&&(G=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=G&&G<h)){l=
new r(this,G);H=l.getBoundingClientRect();k=H.right-H.left;if(k>=this._maxLineWidth)this._maxLineWidth=k,this._maxLineIndex=G;l.destroy()}for(;w<h;)u=this._getLineHeight(w,w<=t),v+=u,w++;h=v;this._updateRuler(this._leftDiv,p,g,L);this._updateRuler(this._rightDiv,p,g,L);this._updateRuler(this._marginDiv,p,g,L);l=0;this._leftDiv&&(p=this._leftDiv.getBoundingClientRect(),l=p.right-p.left);g=0;this._rightDiv&&(g=this._rightDiv.getBoundingClientRect(),g=g.right-g.left);d.style.left=l+"px";d.style.right=
g+"px";g=this._scrollDiv;g.style.height=h+"px";p=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){v=m=s;(w=d.style.overflowX==="scroll")?m+=j:v-=j;u=t=p;(k=d.style.overflowY==="scroll")?t+=j:u-=j;s=m;p=t;h>s&&(n=!0,p=u);this._maxLineWidth>p&&(i=!0,s=v,h>s&&(n=!0,p=u));if(w!==i)d.style.overflowX=i?"scroll":"hidden";if(k!==n)d.style.overflowY=n?"scroll":"hidden";m=w!==i||k!==n}n=p;if(this._wrapMode){if(this._metrics.wrapWidth)n=this._metrics.wrapWidth}else n=Math.max(this._maxLineWidth,
n);i=n;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>p)n+=f.right+f.left;g.style.width=n+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=n+"px";g=this._getScroll(!1)}if(this._vScrollDiv)n=s-8,v=Math.max(15,Math.ceil(Math.min(1,n/(h+f.top+f.bottom))*n)),this._vScrollDiv.style.left=l+p-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,g.y*n/h))+"px",this._vScrollDiv.style.height=v+"px";if(!this._wrapMode&&this._hScrollDiv)n=p-8,v=Math.max(15,Math.ceil(Math.min(1,n/(this._maxLineWidth+
f.left+f.right))*n)),this._hScrollDiv.style.left=l+Math.floor(Math.max(0,Math.floor(g.x*n/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=s-9+"px",this._hScrollDiv.style.width=v+"px";w=g.x;v=this._clipDiv;n=this._overlayDiv;if(t=this._marginDiv)t.style.left=-w+l+this._metrics.marginWidth+f.left+"px",t.style.bottom=(d.style.overflowX==="scroll"?j:0)+"px";if(v){v.scrollLeft=w;v.scrollTop=0;d=l+f.left;j=f.top;c=p;l=s;w=0;t=-e;if(g.x===0)d-=f.left,c+=f.left,w=f.left;g.x+p===i&&(c+=f.right);g.y===
0&&(j-=f.top,l+=f.top,t+=f.top);g.y+s===h&&(l+=f.bottom);v.style.left=d+"px";v.style.top=j+"px";v.style.right=O-c-d+"px";v.style.bottom=L-l-j+"px";b.style.left=w+"px";b.style.top=t+"px";b.style.width=i+"px";b.style.height=s+e+"px";if(n)n.style.left=b.style.left,n.style.top=b.style.top,n.style.width=b.style.width,n.style.height=b.style.height}else{d=w;j=e;O=w+p;L=e+s;d===0&&(d-=f.left);j===0&&(j-=f.top);O===i&&(O+=f.right);g.y+s===h&&(L+=f.bottom);b.style.clip="rect("+j+"px,"+O+"px,"+L+"px,"+d+"px)";
b.style.left=-w+l+f.left+"px";b.style.width=(this._wrapMode||a.isWebkit?i:p+w)+"px";if(!c)b.style.top=-e+f.top+"px",b.style.height=s+e+"px";if(n&&(n.style.clip=b.style.clip,n.style.left=b.style.left,n.style.width=b.style.width,!c))n.style.top=b.style.top,n.style.height=b.style.height}this._updateDOMSelection();if(m)b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate()}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",
a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(c,b,d,g){if(c)for(var f=this._parent.ownerDocument,h=this._getLineHeight(),l=this._getViewPadding(),c=c.firstChild;c;){var m=c._ruler,i=h,n=m.getOverview();n==="page"&&(i+=this._topIndexY);c.style.top=-i+"px";c.style.height=g+i+"px";c.rulerChanged&&e(m.getRulerStyle(),c);var j,p=c.firstChild;p?(j=p,p=p.nextSibling):(j=a.createElement(f,"div"),j.style.visibility="hidden",c.appendChild(j));var k;if(c.rulerChanged&&j){i=-1;
if(k=m.getWidestAnnotation())if(e(k.style,j),k.html)j.innerHTML=k.html;j.lineIndex=i;j.style.height=h+l.top+"px"}var t;if(n==="page"){for(m=m.getAnnotations(b,d+1);p;)i=p.lineIndex,k=p.nextSibling,(!(b<=i&&i<=d)||p.lineChanged)&&c.removeChild(p),p=k;p=c.firstChild.nextSibling;t=f.createDocumentFragment();for(i=b;i<=d;i++)if(!p||p.lineIndex>i){j=a.createElement(f,"div");if(k=m[i]){e(k.style,j);if(k.html)j.innerHTML=k.html;j.annotation=k}j.lineIndex=i;j.style.height=this._getLineHeight(i)+"px";t.appendChild(j)}else if(t.firstChild&&
(c.insertBefore(t,p),t=f.createDocumentFragment()),p)p=p.nextSibling;t.firstChild&&c.insertBefore(t,p)}else{k=this._getClientHeight();i=this._model.getLineCount();p=k+l.top+l.bottom-2*this._metrics.scrollWidth;n=h*i<p?h:p/i;if(c.rulerChanged){for(k=c.childNodes.length;k>1;)c.removeChild(c.lastChild),k--;m=m.getAnnotations(0,i);t=f.createDocumentFragment();for(var r in m)if(i=r>>>0,!(i<0)){j=a.createElement(f,"div");k=m[r];e(k.style,j);j.style.position="absolute";j.style.top=this._metrics.scrollWidth+
h+Math.floor(i*n)+"px";if(k.html)j.innerHTML=k.html;j.annotation=k;j.lineIndex=i;t.appendChild(j)}c.appendChild(t)}else if(c._oldTrackHeight!==p)for(j=c.firstChild?c.firstChild.nextSibling:null;j;)j.style.top=this._metrics.scrollWidth+h+Math.floor(j.lineIndex*n)+"px",j=j.nextSibling;c._oldTrackHeight=p}c.rulerChanged=!1;c=c.nextSibling}},_updateStyleSheet:function(){var c="";a.isWebkit&&this._metrics.scrollWidth>0&&(c+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");a.isFirefox&&
a.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(c+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(c){var b=document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(c));else{b=a.createElement(document,"style");b.id="_textviewStyle";var d=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(c));d.insertBefore(b,d.firstChild)}}},_updateStyle:function(c){if(!c&&
a.isIE)this._rootDiv.style.lineHeight="normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();c||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(s.prototype);return{TextView:s}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(j,k){function i(d){this._model=d;this._projections=[]}i.prototype={addProjection:function(d){if(d){var b=this._model,f=this._projections;d._lineIndex=b.getLineAtOffset(d.start);d._lineCount=b.getLineAtOffset(d.end)-d._lineIndex;var a=d.text;a||(a="");d._model=typeof a==="string"?new j.TextModel(a,b.getLineDelimiter()):a;var b=this.mapOffset(d.start,!0),a=d.end-d.start,e=d._lineCount,h=d._model.getCharCount(),
g=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),start:b,removedCharCount:a,addedCharCount:h,removedLineCount:e,addedLineCount:g});var c=this._binarySearch(f,d.start);f.splice(c,0,d);this.onChanged({type:"Changed",start:b,removedCharCount:a,addedCharCount:h,removedLineCount:e,addedLineCount:g})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,b){var f=this._projections,a=0,e,h;if(b){for(e=
0;e<f.length;e++){h=f[e];if(h.start>d)break;if(h.end>d)return-1;a+=h._model.getCharCount()-(h.end-h.start)}return d+a}for(e=0;e<f.length;e++){h=f[e];if(h.start>d-a)break;var g=h._model.getCharCount();if(h.start+g>d-a)return-1;a+=g-(h.end-h.start)}return d-a},removeProjection:function(d){var b,f=0;for(b=0;b<this._projections.length;b++){var a=this._projections[b];if(a===d){d=a;break}f+=a._model.getCharCount()-(a.end-a.start)}if(b<this._projections.length){var a=this._model,f=d.start+f,e=d.end-d.start,
h=d._lineCount,g=d._model.getCharCount(),c=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:a.getText(d.start,d.end),start:f,removedCharCount:g,addedCharCount:e,removedLineCount:c,addedLineCount:h});this._projections.splice(b,1);this.onChanged({type:"Changed",start:f,removedCharCount:g,addedCharCount:e,removedLineCount:c,addedLineCount:h})}},_binarySearch:function(d,b){for(var f=d.length,a=-1,e;f-a>1;)e=Math.floor((f+a)/2),b<=d[e].start?f=e:a=e;return f},getCharCount:function(){for(var d=
this._model.getCharCount(),b=this._projections,f=0;f<b.length;f++){var a=b[f];d+=a._model.getCharCount()-(a.end-a.start)}return d},getLine:function(d,b){if(d<0)return null;var f=this._model,a=this._projections,e=0,h=[],g=0,c,l,m;for(c=0;c<a.length;c++){m=a[c];if(m._lineIndex>=d-e)break;l=m._model.getLineCount()-1;if(m._lineIndex+l>=d-e)if(g=d-(m._lineIndex+e),g<l)return m._model.getLine(g,b);else h.push(m._model.getLine(l));g=m.end;e+=l-m._lineCount}for(g=Math.max(g,f.getLineStart(d-e));c<a.length;c++){m=
a[c];if(m._lineIndex>d-e)break;h.push(f.getText(g,m.start));l=m._model.getLineCount()-1;if(m._lineIndex+l>d-e)return h.push(m._model.getLine(0,b)),h.join("");h.push(m._model.getText());g=m.end;e+=l-m._lineCount}a=f.getLineEnd(d-e,b);g<a&&h.push(f.getText(g,a));return h.join("")},getLineAtOffset:function(d){for(var b=this._model,f=this._projections,a=0,e=0,h=0;h<f.length;h++){var g=f[h];if(g.start>d-a)break;var c=g._model.getCharCount();if(g.start+c>d-a){f=d-(g.start+a);e+=g._model.getLineAtOffset(f);
a+=f;break}e+=g._model.getLineCount()-1-g._lineCount;a+=c-(g.end-g.start)}return b.getLineAtOffset(d-a)+e},getLineCount:function(){for(var d=this._projections,b=this._model.getLineCount(),f=0;f<d.length;f++){var a=d[f];b+=a._model.getLineCount()-1-a._lineCount}return b},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,b){if(d<0)return-1;for(var f=this._model,a=this._projections,e=0,h=0,g=0;g<a.length;g++){var c=a[g];if(c._lineIndex>d-e)break;var l=c._model.getLineCount()-
1;if(c._lineIndex+l>d-e)return c._model.getLineEnd(d-(c._lineIndex+e),b)+c.start+h;h+=c._model.getCharCount()-(c.end-c.start);e+=l-c._lineCount}return f.getLineEnd(d-e,b)+h},getLineStart:function(d){if(d<0)return-1;for(var b=this._model,f=this._projections,a=0,e=0,h=0;h<f.length;h++){var g=f[h];if(g._lineIndex>=d-a)break;var c=g._model.getLineCount()-1;if(g._lineIndex+c>=d-a)return g._model.getLineStart(d-(g._lineIndex+a))+g.start+e;e+=g._model.getCharCount()-(g.end-g.start);a+=c-g._lineCount}return b.getLineStart(d-
a)+e},getText:function(d,b){d===void 0&&(d=0);var f=this._model,a=this._projections,e=0,h=[],g,c,l;for(g=0;g<a.length;g++){c=a[g];if(c.start>d-e)break;l=c._model.getCharCount();if(c.start+l>d-e)if(b!==void 0&&c.start+l>b-e)return c._model.getText(d-(c.start+e),b-(c.start+e));else h.push(c._model.getText(d-(c.start+e))),d=c.end+e+l-(c.end-c.start);e+=l-(c.end-c.start)}var m=d-e;if(b!==void 0){for(;g<a.length;g++){c=a[g];if(c.start>b-e)break;h.push(f.getText(m,c.start));l=c._model.getCharCount();if(c.start+
l>b-e)return h.push(c._model.getText(0,b-(c.start+e))),h.join("");h.push(c._model.getText());m=c.end;e+=l-(c.end-c.start)}h.push(f.getText(m,b-e))}else{for(;g<a.length;g++)c=a[g],h.push(f.getText(m,c.start)),h.push(c._model.getText()),m=c.end;h.push(f.getText(m))}return h.join("")},_onChanging:function(d,b,f,a,e,h){for(var g=this._model,c=this._projections,l,m=0,i,j=b+f;l<c.length;l++){f=c[l];if(f.start>b)break;m+=f._model.getCharCount()-(f.end-f.start)}b+=m;for(var k=l;l<c.length;l++){f=c[l];if(f.start>
j)break;m+=f._model.getCharCount()-(f.end-f.start);i+=f._model.getLineCount()-1-f._lineCount}f=j+m;m=l;this.onChanging(b,f-b,a,e+i,h);c.splice(c,m-k);for(d=d.length-(f-b);l<c.length;l++)f=c[l],f.start+=d,f.end+=d,f._lineIndex=g.getLineAtOffset(f.start)},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d){this._model.setLineDelimiter(d)},setText:function(d,b,f){d===void 0&&(d="");b===void 0&&(b=0);var a=b,e=f,h=this._model,
g=this._projections,c=0,l=0,m,i,j,k,r,s=0;for(m=0;m<g.length;m++){i=g[m];if(i.start>b-c)break;j=i._model.getCharCount();if(i.start+j>b-c)if(f!==void 0&&i.start+j>f-c){i._model.setText(d,b-(i.start+c),f-(i.start+c));return}else s=i._model.getLineCount()-1-i._model.getLineAtOffset(b-(i.start+c)),k={projection:i,start:b-(i.start+c)},b=i.end+c+j-(i.end-i.start);l+=i._model.getLineCount()-1-i._lineCount;c+=j-(i.end-i.start)}b-=c;var v=m,s=h.getLineAtOffset(b)+l-s;if(f!==void 0)for(;m<g.length;m++){i=g[m];
if(i.start>f-c)break;j=i._model.getCharCount();if(i.start+j>f-c){l+=i._model.getLineAtOffset(f-(i.start+c));j=f-(i.start+c);f=i.end+c;r={projection:i,end:j};break}l+=i._model.getLineCount()-1-i._lineCount;c+=j-(i.end-i.start)}else{for(;m<g.length;m++)i=g[m],l+=i._model.getLineCount()-1-i._lineCount,c+=i._model.getCharCount()-(i.end-i.start);f=e=h.getCharCount()+c}f-=c;i=h.getLineAtOffset(f)+l;e-=a;for(var l=i-s,s=d.length,w=j=i=c=0;;){i!==-1&&i<=w&&(i=d.indexOf("\r",w));j!==-1&&j<=w&&(j=d.indexOf("\n",
w));if(j===-1&&i===-1)break;w=i!==-1&&j!==-1?i+1===j?j+1:(i<j?i:j)+1:i!==-1?i+1:j+1;c++}this.onChanging({type:"Changing",text:d,start:a,removedCharCount:e,addedCharCount:s,removedLineCount:l,addedLineCount:c});h.setText(d,b,f);if(k)i=k.projection,i._model.setText("",k.start);if(r)i=r.projection,i._model.setText("",0,r.end),i.start=i.end,i._lineCount=0;g.splice(v,m-v);for(d=d.length-(f-b);m<g.length;m++)i=g[m],i.start+=d,i.end+=d,i._lineIndex=h.getLineAtOffset(i.start);this.onChanged({type:"Changed",
start:a,removedCharCount:e,addedCharCount:s,removedLineCount:l,addedLineCount:c})}};k.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages,orion/editor/textView,orion/editor/textModel,orion/editor/projectionTextModel,orion/editor/util,orion/util".split(","),function(j,k,i,d,b,f){function a(a){this._view=a;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(a.getOptions("parent").ownerDocument)}a.getTooltip=function(b){if(!b._tooltip)b._tooltip=new a(b);return b._tooltip};a.prototype={_create:function(a){if(!this._tooltipDiv){var d=
this._tooltipDiv=f.createElement(a,"div");d.tabIndex=0;d.className="textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var g=this._tooltipContents=f.createElement(a,"div");d.appendChild(g);a.body.appendChild(d);var c=this;b.addEventListener(d,"mouseover",function(){if(c._hideDelay){var a=c._getWindow();if(c._delayedHideTimeout)a.clearTimeout(c._delayedHideTimeout),c._delayedHideTimeout=null;if(c._hideTimeout)a.clearTimeout(c._hideTimeout),c._hideTimeout=
null;c._nextTarget=null}},!1);b.addEventListener(d,"mouseout",function(a){a=a.relatedTarget||a.toElement;a===d||c._hasFocus()||(!a||!b.contains(d,a))&&c._hide()},!1);b.addEventListener(d,"keydown",function(a){a.keyCode===27&&c._hide()},!1);b.addEventListener(a,"mousedown",this._mouseDownHandler=function(a){c.isVisible()&&(b.contains(d,a.target||a.srcElement)||c._hide())},!0);this._view.addEventListener("Destroy",function(){c.destroy()});this._hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;
return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);b.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var a=this._tooltipDiv;return!a?!1:b.contains(a,a.ownerDocument.activeElement)},hide:function(a){if(a===void 0)a=this._hideDelay;var b=this._getWindow();if(this._delayedHideTimeout)b.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var d=this;a?d._delayedHideTimeout=b.setTimeout(function(){d._delayedHideTimeout=null;d._hide();d.setTarget(d._nextTarget,0)},a):(d._hide(),d.setTarget(d._nextTarget,0))},_hide:function(){var a=this._tooltipDiv;if(a){this._hasFocus()&&this._view.focus();if(this._contentsView)this._contentsView.destroy(),this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";a.style.visibility="hidden";a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),
this._showTimeout=null;if(this._delayedHideTimeout)a.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null}},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,b,d){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=a,this.hide(d)}else if(this._target=a){var c=
this,a=c._getWindow();if(c._showTimeout)a.clearTimeout(c._showTimeout),c._showTimeout=null;b===0?c.show(!0):c._showTimeout=a.setTimeout(function(){c._showTimeout=null;c.show(!0)},b?b:c._showDelay)}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var g=this._tooltipDiv,c=this._tooltipContents;g.style.left=g.style.right=g.style.width=g.style.height=c.style.width=c.style.height="auto";var f=b.contents;f instanceof Array&&(f=this._getAnnotationContents(f));if(typeof f==="string")c.innerHTML=
f;else if(this._isNode(f))c.appendChild(f);else if(f instanceof d.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=c;var p=j.themeClass;p?((p=p.replace("tooltipTheme",""))&&(p=" "+p),p="tooltipTheme"+p):p="tooltipTheme";j.themeClass=p;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(f);f=j.computeSize();c.style.width=f.width+"px";c.style.height=f.height+"px";j.resize()}else return;c=g.ownerDocument.documentElement;
b.anchor==="right"?(f=c.clientWidth-b.x,g.style.right=f+"px"):(f=parseInt(this._getNodeStyle(g,"padding-left","0"),10),f+=parseInt(this._getNodeStyle(g,"border-left-width","0"),10),f=b.x-f,g.style.left=f+"px");g.style.maxWidth=c.clientWidth-f-10+"px";f=parseInt(this._getNodeStyle(g,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(g,"border-top-width","0"),10);f=b.y-f;g.style.top=f+"px";g.style.maxHeight=c.clientHeight-f-10+"px";g.style.opacity="1";g.style.visibility="visible";if(a){var t=this,
r=this._getWindow();t._hideTimeout=r.setTimeout(function(){t._hideTimeout=null;var a=parseFloat(t._getNodeStyle(g,"opacity","1"));t._fadeTimeout=r.setInterval(function(){g.style.visibility==="visible"&&a>0?(a-=0.1,g.style.opacity=a):t._hide()},t._fadeDelay/10)},t._autoHideDelay)}}}},_getAnnotationContents:function(a){function h(a,c){var b=s.getLineStart(s.getLineAtOffset(a)),d=s.getLineEnd(s.getLineAtOffset(c),!0);return s.getText(b,d)}function g(a){var c=a.title,d=f.createElement(p,"div");d.className=
"tooltipRow";if(a.html)d.innerHTML=a.html,d.lastChild&&b.addEventListener(d.lastChild,"click",function(){var c=a.start,b=a.end;r.getBaseModel&&(c=r.mapOffset(c,!0),b=r.mapOffset(b,!0));k.setSelection(c,b,1/3,function(){n._hide()})},!1),d.appendChild(p.createTextNode("\u00a0"));c||(c=h(a.start,a.end));typeof c==="function"&&(c=a.title());if(typeof c==="string"){var e=f.createElement(p,"span");e.appendChild(p.createTextNode(c));c=e}d.appendChild(c);return d}for(var c,l=[],i=0;i<a.length;i++)c=a[i],
c.title!==""&&!c.groupAnnotation&&l.push(c);a=l;if(a.length===0)return null;var n=this,p=this._tooltipDiv.ownerDocument,k=this._view,r=k.getModel(),s=r.getBaseModel?r.getBaseModel():r;if(a.length===1)if(c=a[0],c.title!==void 0){c=g(c);if(c.firstChild)(a=c.firstChild.className)&&(a+=" "),a+="single",c.firstChild.className=a;return c}else return a=new d.ProjectionTextModel(s),l=s.getLineStart(s.getLineAtOffset(c.start)),i=s.getCharCount(),c.end!==i&&a.addProjection({start:c.end,end:i}),l>0&&a.addProjection({start:0,
end:l}),a;else{l=f.createElement(p,"div");c=f.createElement(p,"em");c.appendChild(p.createTextNode(j.multipleAnnotations));l.appendChild(c);for(i=0;i<a.length;i++)c=a[i],(c=g(c))&&l.appendChild(c);return l}},_getNodeStyle:function(a,b,d){var c;if(a&&(c=a.style[b],!c))if(a.currentStyle){for(c=0;(c=b.indexOf("-",c))!==-1;)b=b.substring(0,c)+b.substring(c+1,c+2).toUpperCase()+b.substring(c+2);c=a.currentStyle[b]}else c=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(b):null;
return c||d},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:a}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(j,k){function i(a,c,b){this.start=a;this.end=c;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function b(a,c){var b=a.lastIndexOf("."),b=a.substring(b+1),e={title:j[b],style:{styleClass:"annotation "+b},html:"<div class='annotationHTML "+b+"'></div>",overviewStyle:{styleClass:"annotationOverview "+b}};c?e.lineStyle={styleClass:"annotationLine "+
b}:e.rangeStyle={styleClass:"annotationRange "+b};d.registerType(a,e)}function f(){}function a(a){this._annotations=[];var c=this;this._listener={onChanged:function(a){c._onChanged(a)}};this.setTextModel(a)}function e(a,c){this._view=a;this._annotationModel=c;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);c.addEventListener("Changed",this._listener.onChanged)}i.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,c=a.getBaseModel();this._projection=
{start:c.getLineStart(c.getLineAtOffset(this.start)+1),end:c.getLineEnd(c.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};d.ANNOTATION_ERROR="orion.annotation.error";d.ANNOTATION_WARNING="orion.annotation.warning";d.ANNOTATION_TASK="orion.annotation.task";d.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
d.ANNOTATION_BOOKMARK="orion.annotation.bookmark";d.ANNOTATION_FOLDING="orion.annotation.folding";d.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";d.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";d.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";d.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";d.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";d.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";d.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
d.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";d.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";d.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";d.ANNOTATION_BLAME="orion.annotation.blame";d.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var h={};d.registerType=function(a,c){var b=c;if(typeof b!=="function")b=function(a,c,b){this.start=a;this.end=c;if(b!==void 0)this.title=b},b.prototype=c;b.prototype.type=a;h[a]=b;return a};d.createAnnotation=
function(a,c,b,d){return new (this.getType(a))(c,b,d)};d.getType=function(a){return h[a]};b(d.ANNOTATION_ERROR);b(d.ANNOTATION_WARNING);b(d.ANNOTATION_TASK);b(d.ANNOTATION_BREAKPOINT);b(d.ANNOTATION_BOOKMARK);b(d.ANNOTATION_CURRENT_BRACKET);b(d.ANNOTATION_MATCHING_BRACKET);b(d.ANNOTATION_CURRENT_SEARCH);b(d.ANNOTATION_MATCHING_SEARCH);b(d.ANNOTATION_READ_OCCURRENCE);b(d.ANNOTATION_WRITE_OCCURRENCE);b(d.ANNOTATION_SELECTED_LINKED_GROUP);b(d.ANNOTATION_CURRENT_LINKED_GROUP);b(d.ANNOTATION_LINKED_GROUP);
b(d.ANNOTATION_CURRENT_LINE,!0);b(d.ANNOTATION_BLAME,!0);b(d.ANNOTATION_CURRENT_BLAME,!0);d.registerType(d.ANNOTATION_FOLDING,i);f.addMixin=function(a){var c=f.prototype,b;for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};f.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a)return c+1;return 0},
getAnnotationsByType:function(a,c,b){a=a.getAnnotations(c,b);for(b=[];a.hasNext();)c=a.next(),this.getAnnotationTypePriority(c.type)!==0&&b.push(c);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a){this._annotationTypes.splice(c,
1);break}}};a.prototype={addAnnotation:function(a){if(a){var c=this._annotations,b=this._binarySearch(c,a.start);c.splice(b,0,a);this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,c){var b=this._annotations,d,e=0,f=function(){for(;e<b.length;){var d=b[e++];if(a===d.start||(a>d.start?a<d.end:d.start<c))return d;if(d.start>=c)break}return null};d=f();return{next:function(){var a=d;a&&(d=f());return a},hasNext:function(){return d!==
null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var c=this._annotations,b,d;if(a){b=[];for(d=c.length-1;d>=0;d--){var e=c[d];e.type===a&&(c.splice(d,1),b.splice(0,0,e))}}else b=c;this.onChanged({type:"Changed",removed:b,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",
removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,c){var b=this._annotations,d,e,f,h=[];if(a)for(d=a.length-1;d>=0;d--)f=a[d],e=this._getAnnotationIndex(f),e<0||(b.splice(e,1),h.splice(0,0,f));c||(c=[]);for(d=0;d<c.length;d++)f=c[d],e=this._binarySearch(b,f.start),b.splice(e,0,f);this.onChanged({type:"Changed",removed:h,added:c,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=
a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,c){for(var b=a.length,d=-1,e;b-d>1;)e=Math.floor((b+d)/2),c<=a[e].start?b=e:d=e;return b},_getAnnotationIndex:function(a){for(var c=this._annotations,b=this._binarySearch(c,a.start);b<c.length&&c[b].start===a.start;){if(c[b]===a)return b;b++}return-1},_onChanged:function(a){var c=a.start,b=a.removedCharCount,d=this._annotations,e=c+b;if(0<d.length){for(var f={type:"Changed",added:[],removed:[],changed:[],
textModelChangedEvent:a},a=a.addedCharCount-b,b=0;b<d.length;b++){var h=d[b];h.start>=e?(h.start+=a,h.end+=a,f.changed.push(h)):h.end<=c||(h.start<c&&e<h.end?(h.end+=a,f.changed.push(h)):(d.splice(b,1),f.removed.push(h),b--))}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(a.prototype);e.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),
this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.tagName&&!a.tagName)a.tagName=c.tagName;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=
c.attributes[b])}}return a},_mergeStyleRanges:function(a,c){a||(a=[]);var b,d;for(d=0;d<a.length&&c;d++){var e=a[d];if(c.end<=e.start)break;if(!(c.start>=e.end)){b=this._mergeStyle({},e.style);b=this._mergeStyle(b,c.style);var f=[];f.push(d,1);c.start<e.start&&f.push({start:c.start,end:e.start,style:c.style});c.start>e.start&&f.push({start:e.start,end:c.start,style:e.style});f.push({start:Math.max(e.start,c.start),end:Math.min(e.end,c.end),style:b});c.end<e.end&&f.push({start:c.end,end:e.end,style:e.style});
c=c.end>e.end?{start:e.end,end:c.end,style:c.style}:null;Array.prototype.splice.apply(a,f)}}c&&(b=this._mergeStyle({},c.style),a.splice(d,0,{start:c.start,end:c.end,style:b}));return a},_onAnnotationModelChanged:function(a){function c(a){for(var c=0;c<a.length;c++)if(d.isAnnotationTypeVisible(a[c].type)){var g=a[c].start,f=a[c].end;e.getBaseModel&&(g=e.mapOffset(g,!0),f=e.mapOffset(f,!0));g!==-1&&f!==-1&&b.redrawRange(g,f)}}if(!a.textModelChangedEvent){var b=this._view;if(b){var d=this,e=b.getModel();
c(a.added);c(a.removed);c(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var c=this._annotationModel,b=a.textView.getModel(),d=c.getTextModel(),e=a.lineStart,f=a.lineStart+a.lineText.length;d!==b&&(e=b.mapOffset(e),f=b.mapOffset(f));for(c=c.getAnnotations(e,f);c.hasNext();)if(e=c.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,h=e.end;d!==b&&(f=b.mapOffset(f,!0),h=b.mapOffset(h,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:h,style:e.rangeStyle})}if(e.lineStyle)a.style=
this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};f.addMixin(e.prototype);return{FoldingAnnotation:i,AnnotationType:d,AnnotationTypeList:f,AnnotationModel:a,AnnotationStyler:e}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(j,k,i,d,b,f){function a(a){a=a||{};this._domNode=a.domNode;this._statusReporter=a.statusReporter;this._dirty=!1;this._title=null}function e(b){b=b||{};a.call(this,b);this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._textDNDFactory=b.textDNDFactory;this._annotationFactory=b.annotationFactory;
this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null}var h=d.AnnotationType;a.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null},focus:function(){},getModel:function(){return this._model},
getText:function(a,c){return this.getModel().getText(a,c)},getTitle:function(){return this._title},install:function(){},isDirty:function(){return this._dirty},markClean:function(){this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},reportStatus:function(a,c,b){this._statusReporter&&this._statusReporter(a,c,b)},resize:function(){},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},
setInput:function(a,c,b,d){this._title=a;this.onInputChanged({type:"InputChanged",title:a,message:c,contents:b,contentsSaved:d})},uninstall:function(){}};k.EventTarget.addMixin(a.prototype);e.prototype=new a;b.mixin(e.prototype,{destroy:function(){a.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},
getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getUndoStack:function(){return this._undoStack},
getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},markClean:function(){this.getUndoStack().markClean()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,c){if(this._annotationRulerVisible!==a||c)if(this._annotationRulerVisible=
a,this._annotationRuler){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,c){if(this._foldingRulerVisible!==a||c)if(this._foldingRulerVisible=a,this._foldingRuler){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler):b.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,c){if(this._lineNumberRulerVisible!==a||c)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var b=
this._textView;a?b.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,c){if(this._overviewRulerVisible!==a||c)if(this._overviewRulerVisible=a,this._overviewRuler){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,c));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,c=a.getSelection(),a=a.getModel();if(a.getBaseModel)c.start=a.mapOffset(c.start),c.end=a.mapOffset(c.end);return c},_expandOffset:function(a){var c=this._textView.getModel(),b=this._annotationModel;if(b&&c.getBaseModel)for(a=b.getAnnotations(a,a+1);a.hasNext();)c=a.next(),c.type===h.ANNOTATION_FOLDING&&c.expand&&(c.expand(),b.modifyAnnotation(c))},setCaretOffset:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(a),
a=e.mapOffset(a,!0));d.setCaretOffset(a,c,b)},setText:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(c!==void 0&&(this._expandOffset(c),c=e.mapOffset(c,!0)),b!==void 0&&(this._expandOffset(b),b=e.mapOffset(b,!0)));d.setText(a,c,b)},setSelection:function(a,c,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(a),this._expandOffset(c),a=f.mapOffset(a,!0),c=f.mapOffset(c,!0));e.setSelection(a,c,b,d)},moveSelection:function(a,c,b,d){var e=this._textView;
this.setSelection(a,c||a,1/3,function(){(d===void 0||d)&&e.focus();b&&b()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(a,c){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;if(!e)return null;var f=b.getOffsetAtLocation(a,c);if(f===-1)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(d.length===0)return null;b=b.convert({x:a,y:c},
"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(a,c){var b=this._annotationModel;if(b){var d=this._textView;if(!d.getOptions("singleMode")){var e=d.getModel(),f=c?e.getLineAtOffset(c.start):-1,i=e.getLineAtOffset(a.start),d=a.start===a.end,j=!c||c.start===c.end,k=e.getLineStart(i),v=e.getLineEnd(i);e.getBaseModel&&(k=e.mapOffset(k),v=e.mapOffset(v));e=this._currentLineAnnotation;if(!(f===i&&j&&d&&e&&e.start===k&&e.end===v)){var f=e?[e]:null,w;
d&&(e=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,k,v),w=[e]);this._currentLineAnnotation=e;b.replaceAnnotations(f,w)}}}},install:function(){this.installTextView()},installTextView:function(){if(!this._textView){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();
var a=this,c=this._textView,b=this;this._listener={onModelChanged:function(){b.checkDirty()},onMouseOver:function(a){b._listener.onMouseMove(a)},onMouseMove:function(a){var d=i.Tooltip.getTooltip(c);if(d&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,b._listener.lastMouseY=a.event.clientY,d.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return b._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var d=i.Tooltip.getTooltip(c);
if(d&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,b._listener.lastMouseY=a.event.clientY,d.setTarget(null)},onScroll:function(){var a=i.Tooltip.getTooltip(c);a&&a.setTarget(null,0,0)},onSelection:function(a){b._updateCursorStatus();b._highlightCurrentLine(a.newValue,a.oldValue)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Selection",this._listener.onSelection);c.addEventListener("MouseOver",
this._listener.onMouseOver);c.addEventListener("MouseOut",this._listener.onMouseOut);c.addEventListener("MouseMove",this._listener.onMouseMove);c.addEventListener("Scroll",this._listener.onScroll);if(this._keyBindingFactory){var d;if(d=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist))this._textActions=d.textActions,this._linkedMode=d.linkedMode,
this._sourceCodeActions=d.sourceCodeActions}d=function(c){if(c!==void 0&&c!==-1){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),e=a.mapOffset(b.getLineStart(c)),c=a.mapOffset(b.getLineEnd(c)),b=d.getAnnotations(e,c),f=null;b.hasNext();){var i=b.next();if(i.type===h.ANNOTATION_BOOKMARK){f=i;break}}f?d.removeAnnotation(f):(f=h.createAnnotation(h.ANNOTATION_BOOKMARK,e,c),f.title=void 0,d.addAnnotation(f))}};if(this._annotationFactory){var e=c.getModel();e.getBaseModel&&(e=e.getBaseModel());
if(this._annotationModel=this._annotationFactory.createAnnotationModel(e))if(e=this._annotationStyler=this._annotationFactory.createAnnotationStyler(c,this._annotationModel))e.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),e.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),e.addAnnotationType(h.ANNOTATION_ERROR),e.addAnnotationType(h.ANNOTATION_WARNING),e.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),e.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),e.addAnnotationType(h.ANNOTATION_CURRENT_LINE),
e.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),e.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),e.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),e.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),e.addAnnotationType(h.ANNOTATION_LINKED_GROUP),e.addAnnotationType("orion.annotation.highlightError");c.annotationModel=this._annotationModel;var e=this._annotationFactory.createAnnotationRulers(this._annotationModel),f=this._annotationRuler=e.annotationRuler;if(f)f.onDblClick=d,f.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),
f.addAnnotationType(h.ANNOTATION_ERROR),f.addAnnotationType(h.ANNOTATION_WARNING),f.addAnnotationType(h.ANNOTATION_TASK),f.addAnnotationType(h.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===void 0,!0);if(f=this._overviewRuler=e.overviewRuler)f.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),
f.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),f.addAnnotationType(h.ANNOTATION_ERROR),f.addAnnotationType(h.ANNOTATION_WARNING),f.addAnnotationType(h.ANNOTATION_TASK),f.addAnnotationType(h.ANNOTATION_BOOKMARK),f.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),f.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=d,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:c})}},uninstall:function(){this.uninstallTextView()},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=
this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a})},_updateCursorStatus:function(){var a=this.getModel(),c=this.getCaretOffset(),b=a.getLineAtOffset(c),a=a.getLineStart(b);c-=a;for(var a=this.getKeyModes(),d=0;d<a.length;d++){var e=a[d];if(e.isActive()&&e.isStatusActive&&e.isStatusActive())return}this.reportStatus(f.formatMessage(j.lineColumn,
b+1,c+1))},showAnnotations:function(a,c,b,d){var e=this._annotationModel;if(e){for(var f=[],i=[],j=e.getTextModel(),k=e.getAnnotations(0,j.getCharCount()),v;k.hasNext();)v=k.next(),c.indexOf(v.type)!==-1&&v.creatorID===this&&f.push(v);if(a)for(c=0;c<a.length;c++)if(v=a[c]){if(b)v=b(v);else{var w;typeof v.line==="number"?(w=j.getLineStart(v.line-1),k=w+v.start-1,w+=v.end):(k=v.start,w=v.end);var u=d(v);if(!u)continue;v=h.createAnnotation(u,k,w,v.description)}v.creatorID=this;i.push(v)}e.replaceAnnotations(f,
i)}},showProblems:function(a){this.showAnnotations(a,[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(a){this.showAnnotations(a,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(a){var c=
this._blameRGB,e=this.getTextView().getOptions("parent").ownerDocument;if(!c){var i=f.createElement(e,"div");i.className="annotation blame";e.body.appendChild(i);var n=(e.defaultView||e.parentWindow).getComputedStyle(i).getPropertyValue("background-color");i.parentNode.removeChild(i);var i=n.indexOf("("),p=n.indexOf(")"),n=n.substring(i+1,p);this._blameRGB=c=n.split(",").slice(0,3)}var k=function(){var a=d.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=b.mixin({},
a.style);a.style.style=b.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},r=function(){var a=f.createElement(e,"div");a.className="tooltipTitle";var c=this.blame.Message.indexOf("\n");if(c===-1)c=this.blame.Message.length;var b=f.createElement(e,"a");b.href=this.blame.CommitLink;b.appendChild(e.createTextNode(this.blame.Message.substring(0,c)));a.appendChild(b);a.appendChild(f.createElement(e,"br"));
a.appendChild(e.createTextNode(f.formatMessage(j.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},s=this.getModel();this.showAnnotations(a,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(a){var e=s.getLineStart(a.Start-1),g=s.getLineEnd(a.End-1,!0),e=d.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,e,g,r),g=c.slice(0);g.push(a.Shade);e.style=b.mixin({},e.style);e.style.style=b.mixin({},e.style.style);e.style.style.backgroundColor="rgba("+g.join()+")";e.groupId=a.Name;
e.groupType=h.ANNOTATION_CURRENT_BLAME;e.createGroupAnnotation=k;e.html='<img class="annotationHTML blame" src="'+a.AuthorImage+'"/>';e.blame=a;return e})},showSelection:function(a,c,b,d,e){typeof a==="number"?(typeof c!=="number"&&(c=a),this.moveSelection(a,c)):typeof b==="number"&&(a=this.getModel().getLineStart(b-1),typeof d==="number"&&(a+=d),typeof e!=="number"&&(e=0),this.moveSelection(a,a+e))},setInput:function(b,c,d,e){this._textView&&(e||(c?this._textView.setText(c):d!==null&&d!==void 0&&
(this._textView.setText(d),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this._textView.focus()),this.checkDirty());a.prototype.setInput.call(this,b,c,d,e)},onGotoLine:function(a,c,b,d){if(this._textView){var e=this.getModel(),a=Math.max(0,Math.min(a,e.getLineCount()-1)),f=e.getLineStart(a),h=0;b===void 0&&(b=0);typeof c==="string"?(a=e.getLine(a).indexOf(c),a!==-1&&(h=a,b=h+c.length)):(h=c,c=e.getLineEnd(a)-f,
h=Math.min(h,c),b=Math.min(b,c));this.moveSelection(f+h,f+b,d)}}});return{BaseEditor:a,Editor:e}});
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(j,k,i,d,b,f,a){function e(a){var d=a.getTextView();i.KeyMode.call(this,d);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";d.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));d.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var e=this;this._listener={onVerify:function(a){var c=e.editor,d=c.getModel(),g=c.mapOffset(a.start),c=c.mapOffset(a.end),d=d.getText(g,c);if((d=e._prefix.match(RegExp("^"+b.escape(d),"i")))&&d.length>0)e._prefix+=a.text,e._success=!0,e._status(),e.find(e._forward,!0),a.text=null},onSelection:function(){e._ignoreSelection||e.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 e=this;this._listeners={onEditorFocus:function(a){e._removeCurrentAnnotation(a)}};this.setOptions(d)}}var g={};e.prototype=new i.KeyMode;f.mixin(e.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 e=this.editor,g=e.getModel(),g=a?this._success?b?this._start:e.getCaretOffset()+
1:0:this._success?b?this._start:e.getCaretOffset():g.getCharCount()-1;if(d=e.getModel().find({string:d,start:g,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next()){if(!b)this._start=g;this._ignoreSelection=this._success=!0;e.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 c;c=this._forward?this._success?j.incrementalFindStr:j.incrementalFindStrNotFound:this._success?j.incrementalFindReverseStr:j.incrementalFindReverseStrNotFound;c=a.formatMessage(c,this._prefix);this.editor.reportStatus(c,this._success?"":"error")}else this.editor.reportStatus("")}});
g.IncrementalFind=e;h.prototype={find:function(a,b,d){this.setOptions({reverse:!a});var e=this.getFindString(),g;if(b)e=b.findString||e,g=b.count;a=this.getOptions();this.setOptions(b);b=d?this._startOffset:this.getStartOffset();if((g=this._doFind(e,b,g))&&!d)this._startOffset=g.start;this.setOptions(a);this._hideAfterFind&&this.hide();return g},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=b.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",d=!1,e=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var f=a.substring(g,g+1);if(d){switch(f){case "R":b+=e;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()),e=b.getSelection().start;if(b=b.getModel().find({string:a,start:e,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var c=this.getFindString();if(c){this._replacingAll=!0;var b=this._editor,d=b.getTextView();b.reportStatus(j.replaceAll);var e=this._processReplaceString(this.getReplaceString()),g=this;window.setTimeout(function(){for(var f=0,h=0;;){var i=g._doFind(c,f,null,!0);if(!i)break;h++;h===1&&(d.setRedraw(!1),g.startUndo());g._doReplace(i.start,i.end,c,e);f=g.getStartOffset()}h>
0&&(g.endUndo(),d.setRedraw(!0));f>0?b.reportStatus(a.formatMessage(j.replacedMatches,h)):b.reportStatus(j.nothingReplaced,"error");g._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===!0||a.caseInsensitive===!1)this._caseInsensitive=
a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=
a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,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,e,g){var e=e||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,g)}catch(k){f.reportStatus(k.message,
"error");return}else i=this._find(a,b,g);for(a=0;a<e&&i.hasNext();a++)h=i.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(j.notFound,"error");if(this.isVisible()){e=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=f.getAnnotationModel())i.removeAnnotations(e),h&&i.addAnnotation(d.AnnotationType.createAnnotation(e,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var v=this;this._timer=window.setTimeout(function(){v._markAllOccurrences();
v._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,d,e){var g=this._editor;if(this._regex&&(e=g.getText(a,b).replace(RegExp(d,this._caseInsensitive?"i":""),e),!e))return;g.setText(e,a,b);g.setSelection(a,a+e.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,e=a.getAnnotations(0,a.getTextModel().getCharCount()),g=[],f;e.hasNext();){var h=
e.next();h.type===b&&g.push(h)}if(this.isVisible()){e=this.getFindString();e=this._editor.getModel().find({string:e,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];e.hasNext();)h=e.next(),f.push(d.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(g,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(){var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};g.Find=h;return g});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(j,k,i,d,b,f){function a(a,d,e){this.editor=a;this.undoStack=d;this._incrementalFind=new b.IncrementalFind(a);this._find=e?e:new b.Find(a,d);this._lastEditLocation=null;this.init()}function e(a,b,d,e){this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var h=i.AnnotationType,g={};a.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:j.undo});a.setAction("redo",function(){return this.undoStack?
(this.undoStack.redo(),!0):!1}.bind(this),{name:j.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(j.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:j.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:j.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:j.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:j.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:j.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:j.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:j.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),
{name:j.moveLinesDown});a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:j.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:j.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:j.deleteLines});
a.setKeyBinding(new k.KeyBinding("l",!f.isMac,!1,!1,f.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:j.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:j.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:j.prevAnnotation});
a.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:j.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:j.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:j.expandAll});a.setKeyBinding(new k.KeyBinding("c",
!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:j.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!f.isMac,!1,!1,f.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:j.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),e=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:
d.end),g=b.getLineStart(e),e=b.getLineEnd(d,!0),f=b.getLineCount(),h="",g=b.getText(g,e);d===f-1&&(g=(h=b.getLineDelimiter())+g);a.setText(g,e,e);a.setSelection(e+h.length,e+g.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),e=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),e=b.getLineStart(e),g=b.getLineEnd(d,!0),f=b.getLineCount(),h="",g=b.getText(e,g);d===f-1&&(g+=h=b.getLineDelimiter());
a.setText(g,e,e);a.setSelection(e,e+g.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 e=b.getSelection(),g=b.getModel(),f=g.getLineAtOffset(e.start),a=g.getLineStart(f),d=e.start!==e.end||d===1?g.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(f+d-1,g.getLineCount()-1),d=g.getLineEnd(d,!0);b.setText("",a,d);return!0},expandAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();
if(!d)return!0;var e=b.getModel(),g=b.getCaretOffset(),f=e.getLineAtOffset(g),g=e.getLineStart(f),f=e.getLineEnd(f,!0);e.getBaseModel&&(g=e.mapOffset(g),f=e.mapOffset(f),e.getBaseModel());for(var h,e=d.getAnnotations(g,f);!h&&e.hasNext();)g=e.next(),g.type===i.AnnotationType.ANNOTATION_FOLDING&&(h=g);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()),d.modifyAnnotation(h));return!0},expandAnnotations:function(a){var b=this.editor,d=b.getTextView(),e=b.getAnnotationModel();if(!e)return!0;
var b=b.getModel(),g=e.getAnnotations(0,b.getCharCount());for(d.setRedraw(!1);g.hasNext();)b=g.next(),b.type===i.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),e.modifyAnnotation(b));d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var d=a.getModel(),e=a.getSelection(),g=d.getLineAtOffset(e.start),f=d.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(g!==f){var h=[];h.push("");
for(var i=g;i<=f;i++)h.push(d.getLine(i,!0));i=d.getLineStart(g);d=d.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),i,d);a.setSelection(i===e.start?e.start:e.start+b.length,e.end+(f-g+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());
if(b=prompt(j.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(),e=b.getLineAtOffset(d.start),g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=b.getLineCount();if(g===f-1)return!0;var e=b.getLineStart(e),d=b.getLineEnd(g,!0),h=b.getLineEnd(g+1,!0)-(d-e),i=0;g!==f-2?b=b.getText(e,d):(g=b.getLineEnd(g),b=b.getText(g,d)+b.getText(e,g),i+=d-g);this.startUndo();
a.setText("",e,d);a.setText(b,h,h);a.setSelection(h+i,h+i+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),e=b.getLineAtOffset(d.start);if(e===0)return!0;var g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=b.getLineCount(),d=b.getLineStart(e-1),h=b.getLineStart(e),i=b.getLineEnd(g,!0),j=b.getText(h,i),k=0;g===f-1&&(g=b.getLineEnd(e-1),e=b.getLineEnd(e-1,!0),j+=b.getText(g,e),h=g,
k=e-g);this.startUndo();a.setText("",h,i);a.setText(j,d,d);a.setSelection(d,d+j.length-k);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var g=b.getOverviewRuler()||b.getAnnotationStyler();if(!g)return!0;for(var f=b.getModel(),i=b.getCaretOffset(),e=e.getAnnotations(a?i:0,a?f.getCharCount():i),j=null;e.hasNext();){var k=e.next();if(a){if(k.start<=i)continue}else if(k.start>=i)continue;if(!k.lineStyle&&!(k.type===h.ANNOTATION_MATCHING_BRACKET||
k.type===h.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(k.type)))if(j=k,a)break}if(j){var v=b.getTextView(),w=f.getLineAtOffset(j.start),u=d.Tooltip.getTooltip(v);if(!u)return b.moveSelection(j.start),!0;b.moveSelection(j.start,j.start,function(){u.setTarget({getTooltipInfo:function(){var a=v.convert({x:v.getLocationAtOffset(j.start).x,y:v.getLocationAtOffset(f.getLineStart(w)).y},"document","page");return{contents:[j],x:a.x,y:a.y+Math.floor(v.getLineHeight(w)*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(),e=a.getSelection(),g=d.getLineAtOffset(e.start),f=d.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=b.getOptions("tabSize"),i=Array(h+1).join(" "),j=[],k=b=0,u=g;u<=f;u++){var q=d.getLine(u,!0);if(d.getLineStart(u)!==d.getLineEnd(u))if(q.indexOf("\t")===0)q=q.substring(1),b++;else if(q.indexOf(i)===0)q=q.substring(h),b+=h;else return!0;u===g&&(k=b);j.push(q)}g=d.getLineStart(g);h=d.getLineEnd(f,
!0);d=d.getLineStart(f);a.setText(j.join(""),g,h);f=g===e.start?e.start:e.start-k;e=Math.max(f,e.end-b+(e.end===d+1&&e.start!==e.end?1:0));a.setSelection(f,e);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};g.TextActions=a;e.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:j.trimTrailingWhitespaces});a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:j.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),
{name:j.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:j.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 e=a.getModel(),g=e.getLineAtOffset(d.start),f=e.getLine(g,!1),h=e.getLineStart(g),i=0,j=d.start-h,k;i<j&&((k=f.charCodeAt(i))===32||k===9);)i++;var h=f.substring(0,i),b=b.getOptions("tabSize","expandTab"),u=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=e.getLineDelimiter(),q=/^[\s]*\/\*[\*]*[\s]*$/,
o=/^[\s]*\*/,x=/\*\/[\s]*$/,C=f.substring(0,j),E=f.substring(j),D;if(this.smartIndentation&&f.charCodeAt(D=C.trimRight().length-1)===123)return e=j-D-1,E=E.length-E.trimLeft().length,f=f.charCodeAt(j+E)===125?b+h+u+b+h:b+h+u,a.setText(f,d.start-e,d.end+E),a.setCaretOffset(d.start+b.length+h.length+u.length-e),!0;else if(this.autoCompleteComments&&!x.test(C)&&(q.test(C)||o.test(C))){if(i=q.exec(C)){f=b+h+" * ";f+=x.test(E)?E.substring(0,E.length-2).trim():E.trim();if(e.getLineCount()===g+1||!o.test(e.getLine(g+
1)))f+=b+h+" */";a.setText(f,d.start,d.end+E.length);a.setCaretOffset(d.start+b.length+h.length+3);return!0}if(i=o.exec(C))for(g-=1;g>=0;g--)if(i=e.getLine(g,!1),q.test(i))return x.test(E)||f.charCodeAt(j)===47?(f=b+h+"*"+E,h=d.start+b.length+h.length+1):(f=b+h+"* "+E,h=d.start+b.length+h.length+2),a.setText(f,d.start,d.end+E.length),a.setCaretOffset(h),!0;else if(!o.test(i))break}else if(x.test(C))return f=f.substring(d.start)+b+h.substring(0,h.length-1),a.setText(f,d.start,d.end),a.setCaretOffset(d.start+
f.length),!0;else if(i>0){for(i=j;i<f.length&&((k=f.charCodeAt(i++))===32||k===9);)d.end++;a.setText(e.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(),e=this._findEnclosingComment(b,d.start,d.end);if(e.commentStart!==void 0&&e.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;var e=b.length,b=b.replace(/\/\*|\*\//g,""),g=b.length;
a.setText("/*"+b+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(g-e));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 e=d.getSelection(),g=d.getModel(),f=d.getCaretOffset()===g.getCharCount()?"":g.getText(e.start,e.start+1).trim(),
h=/^$|[)}\]>]/;if(e.start===e.end&&h.test(f))return d.setText(a+b,e.start,e.start),d.setCaretOffset(e.start+1),!0;else if(e.start!==e.end)return g=g.getText(e.start,e.end),d.setText(a+g+b,e.start,e.end),d.setSelection(e.start+1,e.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(),e=b.getModel(),g=b.getCaretOffset(),f=g===0?"":e.getText(d.start-1,d.start).trim(),h=g===e.getCharCount()?
"":e.getText(d.start,d.start+1).trim(),g=/^"$|^'$/,i=/\w/,j=/^$|[)}\]>]/;if(d.start!==d.end){e=e.getText(d.start,d.end);if(g.test(e))return!1;b.setText(a+e+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||g.test(h)||i.test(f)||!j.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(),d=a.getModel(),e=a.getCaretOffset(),g=e===0?"":d.getText(b.start-1,b.start),d=e===d.getCharCount()?"":d.getText(b.start,b.start+1);(g==="("&&d===")"||g==="["&&d==="]"||g==="{"&&d==="}"||g==="<"&&d===">"||g==='"'&&d==='"'||g==="'"&&d==="'")&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,d){var e=a.getLineAtOffset(b),g=a.getLineAtOffset(d),f,h,i,j,k,u;for(f=e;f>=0;f--)if(h=a.getLine(f),i=f===e?b-a.getLineStart(e):h.length,j=h.lastIndexOf("/*",i),
h=h.lastIndexOf("*/",i),h>j)break;else if(j!==-1){k=a.getLineStart(f)+j;break}for(f=g;f<a.getLineCount();f++)if(h=a.getLine(f),i=f===g?d-a.getLineStart(g):0,j=h.indexOf("/*",i),h=h.indexOf("*/",i),j!==-1&&j<h)break;else if(h!==-1){u=a.getLineStart(f)+h;break}return{commentStart:k,commentEnd:u}},lineStart:function(){for(var a=this.editor,b=a.getModel(),d=a.getCaretOffset(),e=b.getLineAtOffset(d),g=b.getLineStart(e),b=b.getLine(e),e=0;e<b.length;e++){var f=b.charCodeAt(e);if(!(f===32||f===9))break}e+=
g;return d!==e?(a.setSelection(e,e),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),e=b.getText(d.start,d.end),g,f,h;for(h=0;h<e.length;h++)if(e.substring(h,h+2)==="/*"){g=d.start+h;break}for(;h<e.length;h++)if(e.substring(h,h+2)==="*/"){f=d.start+h;break}if(g!==void 0&&f!==void 0)a.setText(b.getText(g+2,f),g,f+2),a.setSelection(g,f);else{e=this._findEnclosingComment(b,d.start,d.end);if(e.commentStart===
void 0||e.commentEnd===void 0)return!0;b=b.getText(e.commentStart+2,e.commentEnd);a.setText(b,e.commentStart,e.commentEnd+2);a.setSelection(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(),e=b.getLineAtOffset(d.start),g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=!0,h=[],i,j,k=e;k<=g;k++)if(i=b.getLine(k,!0),h.push(i),!f||(j=i.indexOf("//"))===-1)f=!1;else if(j!==0){var u;for(u=
0;u<j;u++)if(f=i.charCodeAt(u),!(f===32||f===9))break;f=u===j}k=b.getLineStart(e);u=b.getLineEnd(g,!0);if(f){for(f=0;f<h.length;f++)i=h[f],j=i.indexOf("//"),h[f]=i.substring(0,j)+i.substring(j+2);h=h.join("");i=b.getLineStart(g);b=k===d.start?d.start:d.start-2;d=d.end-2*(g-e+1)+(d.end===i+1?2:0)}else h.splice(0,0,""),h=h.join("//"),b=k===d.start?d.start:d.start+2,d=d.end+2*(g-e+1);a.setText(h,k,u);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 e=/(\s+$)/,g=b.getLineCount(),f=0;f<g;f++){var h=b.getLine(f),i=e.exec(h);if(i){var j=b.getLineStart(f),h=i[0].length,i=j+i.index;b.setText("",i,i+h);if(d.start>i)d.start=Math.max(i,d.start-h);if(d.start!==d.end&&d.end>i)d.end=Math.max(i,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(),e=b.getModel();return(b.getCaretOffset()===e.getCharCount()?"":e.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}};g.SourceCodeActions=e;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 g});
define("orion/editor/undoStack",[],function(){function j(d,b,f,a){this.offset=d;this.text=b;this.previousText=f;this.type=a}function k(d){this.owner=d;this.changes=[]}function i(d,b){this.view=d;this.size=b!==void 0?b:100;this.reset();var f=d.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;var a=this;this._listener={onChanging:function(b){a._onChanging(b)},onDestroy:function(b){a._onDestroy(b)}};f.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Destroy",this._listener.onDestroy)}
j.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(d,b){this._doUndoRedo(this.offset,this.previousText,this.text,d,b);return!0},redo:function(d,b){this._doUndoRedo(this.offset,this.text,this.previousText,d,b);return!0},merge:function(d,b,f,a,e){if(a===this.type)if(a===1&&d===this.offset+this.text.length)return this.text+=
b,!0;else if(a===-1&&e===this.offset)return this.offset=d,this.previousText=f+this.previousText,!0;else if(a===-1&&d===this.offset)return this.previousText+=f,!0;return!1},_doUndoRedo:function(d,b,f,a,e){var h=a.getModel();if(h.mapOffset&&a.annotationModel){var g=h.mapOffset(d,!0);if(g<0)for(var c=a.annotationModel.getAnnotations(d,d+1);c.hasNext();){var i=c.next();if(i.type==="orion.annotation.folding"){i.expand();g=h.mapOffset(d,!0);break}}if(g<0)return;d=g}h.setText(b,d,d+f.length);e&&a.setSelection(d,
d+b.length)}};k.prototype={getRedoChanges:function(){for(var d=[],b=0;b<this.changes.length;b++)d=d.concat(this.changes[b].getRedoChanges());return d},getUndoChanges:function(){for(var d=[],b=this.changes.length-1;b>=0;b--)d=d.concat(this.changes[b].getUndoChanges());return d},add:function(d){this.changes.push(d)},end:function(d){this.endSelection=d.getSelection();this.endCaret=d.getCaretOffset();(d=this.owner)&&d.end&&d.end()},undo:function(d,b){this.changes.length>1&&d.setRedraw(!1);for(var f=this.changes.length-
1;f>=0;f--)this.changes[f].undo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var f=this.startSelection.start,a=this.startSelection.end;d.setSelection(this.startCaret?f:a,this.startCaret?a:f)}(f=this.owner)&&f.undo&&f.undo();return this.changes.length>0},redo:function(d,b){this.changes.length>1&&d.setRedraw(!1);for(var f=0;f<this.changes.length;f++)this.changes[f].redo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var f=this.endSelection.start,a=this.endSelection.end;d.setSelection(this.endCaret?
f:a,this.endCaret?a:f)}(f=this.owner)&&f.redo&&f.redo();return this.changes.length>0},merge:function(d,b,f,a,e){var h=this.changes.length;return h>0?this.changes[h-1].merge(d,b,f,a,e):!1},start:function(d){this.startSelection=d.getSelection();this.startCaret=d.getCaretOffset();(d=this.owner)&&d.start&&d.start()}};i.prototype={add:function(d){this.compoundChange?this.compoundChange.add(d):(this.stack.splice(this.index,this.stack.length-this.index,d),this.index++,this.stack.length>this.size&&(this.stack.shift(),
this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();
for(var d=[],b=this.index;b<this.stack.length;b++)d=d.concat(this.stack[b].getRedoChanges());return d},getUndoChanges:function(){this._commitUndo();for(var d=[],b=this.index;b>=0;b--)d=d.concat(this.stack[b].getUndoChanges());return d},undo:function(){this._commitUndo();var d;d=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;d=this.stack[--this.index]}while(!(d=d.undo(this.view,!0)));this._ignoreUndo=!1;return d},redo:function(){this._commitUndo();var d;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
d=this.stack[this.index++]}while(!d.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(d){this._commitUndo();d=new k(d);this.add(d);this.compoundChange=d;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);
this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(d){if(!this._ignoreUndo){var b=d.text,f=d.start,a=d.addedCharCount,e=d.removedCharCount,d=f+e,h=0;a===0&&e===1?h=-1:a===1&&e===0&&(h=1);a=this.stack.length;e=this.model.getText(f,d);(!(a>0&&this.index===a)||!this.stack[a-1].merge(f,b,e,h,d))&&this.add(new j(f,b,e,h))}}};return{UndoStack:i}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(j,k,i,d){function b(a,b,d,e){this._location=b||"left";this._overview=d||"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(a)}function f(a,c,d,e,f){b.call(this,a,c,"page",d);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function a(a,c,d){b.call(this,a,c,"page",d)}function e(a,c,d){b.call(this,a,c,"document",d)}function h(b,c,d){a.call(this,b,c,d)}b.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var e=this._view.getModel(),f=e.getLineStart(a),h=e.getLineEnd(b-1),i=e;e.getBaseModel&&(i=e.getBaseModel(),f=e.mapOffset(f),h=e.mapOffset(h));for(var j=[],d=this.getAnnotationsByType(d,f,h),f=0;f<
d.length;f++)for(var h=d[f],k=i.getLineAtOffset(h.start),v=i.getLineAtOffset(Math.max(h.start,h.end-1)),w=k;w<=v;w++){var u=w;if(e!==i){u=i.getLineStart(w);u=e.mapOffset(u,!0);if(u===-1)continue;u=e.getLineAtOffset(u)}if(a<=u&&u<b){var q=this._mergeAnnotation(j[u],h,w-k,v-k+1);q&&(j[u]=q)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var o in j)j[o]._multiple&&(j[o].html+=this._multiAnnotationOverlay.html);return j},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,d=b.getModel(),e=d,f=d.getLineStart(a),h=f,j=f,k=this._annotationModel;if(k){b=b.getSelection();j=d.getLineEnd(a,!0);if(f<=b.start&&b.start<j)f=b.start;d.getBaseModel&&(f=d.mapOffset(f),
j=d.mapOffset(j),e=d.getBaseModel());for(var s,j=k.getAnnotations(f,j),k=null;!s&&j.hasNext();)b=j.next(),this.isAnnotationTypeVisible(b.type)&&(k=b,b.start<=f||(s=b));if(k&&k.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===k.groupId?null:k.groupId,this._setCurrentGroup(a);s&&e.getLineAtOffset(s.start)===e.getLineAtOffset(f)?(f=s.start,j=s.end):j=f=h;d.getBaseModel&&(f=d.mapOffset(f,!0),j=d.mapOffset(j,!0))}(a=i.Tooltip.getTooltip(this._view))&&a.setTarget(null);this._view.setSelection(j,
f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var d=i.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var e=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var a=i.Tooltip.getTooltip(this._view);
a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var d=this._view,e=d.getModel(),f=this._annotationModel,h=[];if(f){var h=e.getLineStart(a),i=e.getLineEnd(a);e.getBaseModel&&(h=e.mapOffset(h),i=e.mapOffset(i));h=this.getAnnotationsByType(f,h,i)}f=this._getTooltipContents(a,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=d.getClientArea();h.y=this.getOverview()==="document"?d.convert({y:b},"view","document").y:d.getLocationAtOffset(e.getLineStart(a)).y;d.convert(h,
"document","page");f.x=h.x;f.y=h.y;f.anchor==="right"&&(f.x+=h.width);return f}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var c=0;c<a.length;c++)if(f.isAnnotationTypeVisible(a[c].type)){var g=a[c].start,h=a[c].end;e.getBaseModel&&(g=e.mapOffset(g,!0),h=e.mapOffset(h,!0));g!==-1&&h!==-1&&d.redrawLines(e.getLineAtOffset(g),e.getLineAtOffset(Math.max(g,h-1))+1,f)}}var d=this._view;if(d){var e=d.getModel(),f=this,h=e.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,e.getBaseModel&&(a=e.mapOffset(a,!0)),a=e.getLineAtOffset(a),d.redrawLines(a,h,f)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d){a||(a={});if(d===0)if(a.html&&b.html){if(b.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var d;if(b.style){if(!a.style)a.style={};for(d in b.style)a.style[d]===void 0&&(a.style[d]=b.style[d])}if(b.attributes){if(!a.attributes)a.attributes={};for(d in b.attributes)a.attributes[d]===void 0&&(a.attributes[d]=b.attributes[d])}}return a},_setCurrentGroup:function(a){var b=this._annotationModel,d=null,e=b.getTextModel(),f,h,i=this._currentGroupAnnotation;if(a!==-1){var j=e.getLineStart(a),k=e.getLineEnd(a);e.getBaseModel&&(j=e.mapOffset(j),
k=e.mapOffset(k));for(h=b.getAnnotations(j,k);h.hasNext();)if(f=h.next(),this.isAnnotationTypeVisible(f.type)&&f.start<=j&&f.end>=k&&f.groupId!==void 0){d=f;break}if(i&&d&&i.groupId===d.groupId)return}this._currentGroupAnnotation=null;i&&b.removeAnnotations(i.groupType);if(d&&a!==-1){this._currentGroupAnnotation=d;h=b.getAnnotations(0,e.getCharCount());for(a=[];h.hasNext();)f=h.next(),delete f.groupAnnotation,f.groupId===d.groupId&&(f=f.createGroupAnnotation(),a.push(f));b.replaceAnnotations(null,
a)}}};k.AnnotationTypeList.addMixin(b.prototype);f.prototype=new b;f.prototype.getAnnotations=function(a,c){for(var d=b.prototype.getAnnotations.call(this,a,c),e=this._view.getModel(),f=a;f<c;f++){var h=f&1?this._oddStyle:this._evenStyle,i=f;e.getBaseModel&&(i=e.getLineStart(i),i=e.getBaseModel().getLineAtOffset(e.mapOffset(i)));d[f]||(d[f]={});d[f].html=this._firstLine+i+"";if(!d[f].style)d[f].style=h}return d};f.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};f.prototype.setFirstLine=function(a){this._firstLine=a!==void 0?a:1};f.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),d=(this._firstLine+(b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())-1+"").length;if(this._numOfDigits!==d)this._numOfDigits=d,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};a.prototype=new b;e.prototype=new b;e.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",
fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};e.prototype._getTooltipContents=function(a,c){if(c.length===0){var e=this._view.getModel(),f=a;e.getBaseModel&&(f=e.getLineStart(f),f=e.getBaseModel().getLineAtOffset(e.mapOffset(f)));return d.formatMessage(j.line,f+1)}return b.prototype._getTooltipContents.call(this,a,c)};e.prototype._mergeAnnotation=function(a,b,d,e){if(d===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*e+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);
return a}};h.prototype=new a;h.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;if(b){var d=this._view.getModel(),e=d.getLineStart(a),a=d.getLineEnd(a,!0);d.getBaseModel&&(e=d.mapOffset(e),a=d.mapOffset(a),d=d.getBaseModel());for(var f,b=b.getAnnotations(e,a);!f&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(f=a);f&&d.getLineAtOffset(f.start)===d.getLineAtOffset(e)&&((d=i.Tooltip.getTooltip(this._view))&&d.setTarget(null),f.expanded?f.collapse():f.expand(),
this._annotationModel.modifyAnnotation(f))}}};h.prototype._getTooltipContents=function(b,c){return c.length===1&&c[0].expanded?null:a.prototype._getTooltipContents.call(this,b,c)};h.prototype._onAnnotationModelChanged=function(b){function c(a){for(h=0;h<a.length;h++)if(f.isAnnotationTypeVisible(a[h].type)){var b=a[h].start;e.getBaseModel&&(b=e.mapOffset(b,!0));b!==-1&&(j=Math.min(j,e.getLineAtOffset(b)))}}if(b.textModelChangedEvent)a.prototype._onAnnotationModelChanged.call(this,b);else{var d=this._view;
if(d){var e=d.getModel(),f=this,h,i=e.getLineCount(),j=i;c(b.added);c(b.removed);c(b.changed);b=d.getRulers();for(h=0;h<b.length;h++)d.redrawLines(j,i,b[h])}}};return{Ruler:b,AnnotationRuler:a,LineNumberRuler:f,OverviewRuler:e,FoldingRuler:h}});
define("orion/editor/textDND",["orion/util"],function(j){function k(i,d){this._view=i;this._undoStack=d;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(d){b._onDragStart(d)},onDragEnd:function(d){b._onDragEnd(d)},onDragEnter:function(d){b._onDragEnter(d)},onDragOver:function(d){b._onDragOver(d)},onDrop:function(d){b._onDrop(d)},onDestroy:function(d){b._onDestroy(d)}};i.addEventListener("DragStart",this._listener.onDragStart);i.addEventListener("DragEnd",
this._listener.onDragEnd);i.addEventListener("DragEnter",this._listener.onDragEnter);i.addEventListener("DragOver",this._listener.onDragOver);i.addEventListener("Drop",this._listener.onDrop);i.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var i=this._view;if(i)i.removeEventListener("DragStart",this._listener.onDragStart),i.removeEventListener("DragEnd",this._listener.onDragEnd),i.removeEventListener("DragEnter",this._listener.onDragEnter),i.removeEventListener("DragOver",
this._listener.onDragOver),i.removeEventListener("Drop",this._listener.onDrop),i.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(i){var d=this._view,b=d.getSelection(),d=d.getModel();if(d.getBaseModel)b.start=d.mapOffset(b.start),b.end=d.mapOffset(b.end),d=d.getBaseModel();if(d=d.getText(b.start,b.end))this._dragSelection=b,i.event.dataTransfer.effectAllowed="copyMove",i.event.dataTransfer.setData("Text",d)},_onDragEnd:function(i){if(this._dragSelection){var d=
this._view,b=i.event.dataTransfer.dropEffect;if(!j.isFirefox&&(b!=="none"||this._dropText))b=i.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(i=b==="move")&&d.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,f=this._dropOffset;if(i)if(f>=this._dragSelection.end)f-=this._dragSelection.end-this._dragSelection.start;else if(f>=this._dragSelection.start)f=this._dragSelection.start;d.setText(b,
f,f);d.setSelection(f,f+b.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(i){this._onDragOver(i)},_onDragOver:function(i){var d=i.event.dataTransfer.types,b=!this._view.getOptions("readonly");b&&d&&(b=d.contains?d.contains("text/plain")||d.contains("Text"):d.indexOf("text/plain")!==-1||d.indexOf("Text")!==-1);if(b){if(!j.isFirefox)this._dropEffect=i.event.dataTransfer.dropEffect=(j.isMac?i.event.altKey:
i.event.ctrlKey)?"copy":"move"}else i.event.dataTransfer.dropEffect="none"},_onDrop:function(i){var d=this._view,b=i.event.dataTransfer.getData("Text");if(b){if(!j.isFirefox)i.event.dataTransfer.dropEffect=this._dropEffect;i=d.getOffsetAtLocation(i.x,i.y);this._dragSelection?(this._dropOffset=i,this._dropText=b):(d.setText(b,i,i),d.setSelection(i,i+b.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function j(i,d,b){this.prefix=i;this.description=d;this.template=b;this._parse()}function k(i,d){this._keywords=i||[];this._templates=[];this.addTemplates(d||[])}j.prototype={getProposal:function(i,d,b){var i=d-i.length,d={},f,a=b.delimiter!==void 0?b.delimiter:"\n";b.indentation&&(a+=b.indentation);for(var e=b.tab!==void 0?b.tab:"\t",h=0,g=this.variables,c=this.segments,b=[],j=0;j<c.length;j++){var k=c[j],n=g[k];if(n!==void 0)switch(k){case "${tab}":k=
e;break;case "${delimiter}":k=a;break;case "${cursor}":k="";f=h;break;default:var p=d[k];p||(p=d[k]={data:n.data,positions:[]});k=n.substitution;p.data&&p.data.values&&(k=p.data.values[0]);p.positions.push({offset:i+h,length:k.length})}b.push(k);h+=k.length}var a=[],t;for(t in d)d.hasOwnProperty(t)&&a.push(d[t]);b=b.join("");if(f===void 0)f=b.length;return{proposal:b,description:this.description,groups:a,escapePosition:i+f}},match:function(i){return this.prefix.indexOf(i)===0},_parse:function(){var i=
this.template,d=[],b={},f,a=0,i=i.replace(/\n/g,"${delimiter}"),i=i.replace(/\t/g,"${tab}");i.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(e,h,g){var c=e.substring(2,e.length-1),h=e,j=c,k=null,n=j.indexOf(":");n!==-1&&(j=j.substring(0,n),h="${"+j+"}",k=JSON.parse(c.substring(n+1).replace("\\}","}").trim()));(c=b[h])||(c=b[h]={});c.substitution=j;if(k)c.data=k;(f=i.substring(a,g))&&d.push(f);d.push(h);a=g+e.length;return j});(f=i.substring(a,i.length))&&d.push(f);this.segments=d;this.variables=b}};
k.prototype={addTemplates:function(i){for(var d=this.getTemplates(),b=0;b<i.length;b++)d.push(new j(i[b].prefix,i[b].description,i[b].template))},computeProposals:function(i,d,b){var f=this.getPrefix(i,d,b),a=[];if(!this.isValid(f,i,d,b))return a;a=a.concat(this.getTemplateProposals(f,d,b));return a=a.concat(this.getKeywordProposals(f))},getKeywords:function(){return this._keywords},getKeywordProposals:function(i){var d=[],b=this.getKeywords();if(b)for(var f=0;f<b.length;f++)b[f].indexOf(i)===0&&
d.push({proposal:b[f].substring(i.length),description:b[f]});return d},getPrefix:function(i,d,b){return b.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(i,d,b){for(var f=[],a=this.getTemplates(),e=0;e<a.length;e++){var h=a[e];h.match(i)&&(h=h.getProposal(i,d,b),this.removePrefix(i,h),f.push(h))}return f},removePrefix:function(i,d){if(!(d.overwrite=d.proposal.substring(0,i.length)!==i))d.proposal=d.proposal.substring(i.length)},isValid:function(){return!0}};return{Template:j,
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(j,k,i,d,b,f){function a(a,b,c){var d=a.getTextView();i.KeyMode.call(this,d);this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.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,g=0;g<d.length;++g){f=d[g];e=f.position;var h=e.offset<=b&&b<=e.offset+e.length;h&&!f.ansestor?(e.offset+=c,e.length+=a,c+=a):(e.offset+=c,f.ansestor&&h&&(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,g;e;)if(f=this._getPositionChanged(e,c,d),g=f.position,g===void 0||g.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var h=this._compoundChange;h?h.owner.model===e&&h.owner.group===g.group||(this.endUndo(),this.startUndo()):this.startUndo();
e.selectedGroupIndex=g.group;var h=0,i=a.text.length-(d-c);f=f.positions;var j;c-=g.position.offset;for(var o=d-g.position.offset,l=0;l<f.length;++l)if(j=f[l],d=j.position,j.oldOffset=d.offset,j.model===e&&j.group===g.group?(d.offset+=h,d.length+=i,h+=i):(d.offset+=h,j.ansestor&&(d.length+=g.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===g.group&&b.setText(a.text,j.oldOffset+c,j.oldOffset+o);this.ignoreVerify=!1;a.text=
null;this._updateAnnotations(f)}}}.bind(this)}}var e={};a.prototype=new i.KeyMode;f.mixin(a.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=this.editor.getTextView();
b.addKeyMode(this);b.addEventListener("Verify",this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(j.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},
exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var c=this.editor,d=c.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);
d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(j.linkedModeExited,null,!0);a&&c.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var d=this.linkedModeModel;if(d){d.selectedGroupIndex=a;var a=d.groups[a],c=a.positions[0],e=this.editor;e.setSelection(c.offset,c.offset+c.length);if(d=this.contentAssist)if(d.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new b.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=e.getSelection();return a.start===
a.end&&(a=e.getCaretOffset(),c.offset<=a&&a<=c.offset+c.length)?e.getText(c.offset,a):""},d.offset=c.offset,d.deactivate(),d.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,d.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var d=b.groups,e=0;e<d.length;e++)for(var f=d[e].positions,i=0;i<f.length;i++){var j=f[i];c&&(j={offset:j.offset+c,length:j.length});j={index:i,group:e,count:f.length,model:b,position:j};a.push(j);if(b.nextModel&&
b.nextModel.parentGroup===e)j.ansestor=!0,this._getModelPositions(a,b.nextModel,(c||0)+f[i].offset-f[0].offset)}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)a.escapePosition!==void 0&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},_getPositionChanged:function(a,
b,c){for(var d,a=this._getSortedPositions(a),e=a.length-1;e>=0;e--){var f=a[e].position;if(f.offset<=b&&c<=f.offset+f.length){d=a[e];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],e=[],f=b.getTextModel(),f=b.getAnnotations(0,f.getCharCount()),i;f.hasNext();)switch(i=f.next(),i.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(i)}if(f=
this.linkedModeModel)for(var a=a||this._getSortedPositions(f),j=0;j<a.length;j++)if(i=a[j],i.model===f){var k=d.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===f.selectedGroupIndex&&(k=i.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=d.AnnotationType.createAnnotation(k,i.offset,i.offset+i.length,"");e.push(i)}b.replaceAnnotations(c,e)}}});e.LinkedMode=a;return e});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(j,k,i,d,b,f){function a(){}function e(){}function h(){}function g(){}function c(){}function l(){}var m={};a.prototype={createKeyBindings:function(a,b,c,d){var d=new j.TextActions(a,b,d),e=new f.LinkedMode(a,b,c),a=new j.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};m.KeyBindingsFactory=
a;e.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};m.UndoFactory=e;h.prototype={createLineNumberRuler:function(a){return new i.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=h;g.prototype={createFoldingRuler:function(a){return new i.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=g;c.prototype={createAnnotationModel:function(a){return new d.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new d.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new i.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new i.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};m.AnnotationFactory=c;l.prototype={createTextDND:function(a,c){return new b.TextDND(a.getTextView(),c)}};m.TextDNDFactory=l;return m});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(j,k,i,d){return d.mixin({},j,k,i)});
var JsDiff=function(){function j(a){for(var b=[],d=0;d<a.length;d++)a[d]&&b.push(a[d]);return b}function k(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}var i=function(a){this.ignoreWhitespace=a};i.prototype={diff:function(a,b){if(b==a)return[{value:b}];if(!b)return[{value:a,removed:!0}];if(!a)return[{value:b,added:!0}];var b=this.tokenize(b),a=this.tokenize(a),d=b.length,c=a.length,f=d+c,i=[{newPos:-1,components:[]}],j=this.extractCommon(i[0],
b,a,0);if(i[0].newPos+1>=d&&j+1>=c)return i[0].components;for(var k=1;k<=f;k++)for(var t=-1*k;t<=k;t+=2){var r;r=i[t-1];var s=i[t+1],j=(s?s.newPos:0)-t;r&&(i[t-1]=void 0);var v=r&&r.newPos+1<d,w=s&&0<=j&&j<c;if(!v&&!w)i[t]=void 0;else if(!v||w&&r.newPos<s.newPos?(r={newPos:s.newPos,components:s.components.slice(0)},this.pushComponent(r.components,a[j],void 0,!0)):(r={newPos:r.newPos,components:r.components.slice(0)},r.newPos++,this.pushComponent(r.components,b[r.newPos],!0,void 0)),j=this.extractCommon(r,
b,a,t),r.newPos+1>=d&&j+1>=c)return r.components;else i[t]=r}},pushComponent:function(a,b,d,c){var f=a[a.length-1];f&&f.added===d&&f.removed===c?a[a.length-1]={value:this.join(f.value,b),added:d,removed:c}:a.push({value:b,added:d,removed:c})},extractCommon:function(a,b,d,c){for(var f=b.length,i=d.length,j=a.newPos,c=j-c;j+1<f&&c+1<i&&this.equals(b[j+1],d[c+1]);)j++,c++,this.pushComponent(a.components,b[j],void 0,void 0);a.newPos=j;return c},equals:function(a,b){var d=/\S/;return this.ignoreWhitespace&&
!d.test(a)&&!d.test(b)?!0:a==b},join:function(a,b){return a+b},tokenize:function(a){return a}};var d=new i,b=new i(!1);b.tokenize=function(a){return j(a.split(/(\s+|\b)/))};var f=new i(!0);f.tokenize=function(a){return j(a.split(/([{}:;,]|\s+)/))};var a=new i;a.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return d.diff(a,b)},diffWords:function(a,d){return b.diff(a,d)},diffLines:function(b,d){return a.diff(b,d)},diffCss:function(a,b){return f.diff(a,b)},createPatch:function(b,
d,f,c,i){var j=[];j.push("Index: "+b);j.push("===================================================================");j.push("--- "+b+"\t"+c);j.push("+++ "+b+"\t"+i);b=a.diff(d,f);b.push({value:"",lines:[]});for(var f=d=0,c=[],k=i=1,p=0;p<b.length;p++){var t=b[p],r=t.lines||t.value.replace(/\n$/,"").split("\n");t.lines=r;if(t.added||t.removed){if(!d){var s=b[p-1],d=i,f=k;s&&(c.push.apply(c,s.lines.slice(-4).map(function(a){return" "+a})),d-=4,f-=4)}c.push.apply(c,r.map(function(a){return(t.added?"+":
"-")+a}));t.added?k+=r.length:i+=r.length}else d&&(r.length<=8&&p<b.length-1?c.push.apply(c,r.map(function(a){return" "+a})):(s=Math.min(r.length,4),j.push("@@ -"+d+","+(i-d+s)+" +"+f+","+(k-f+s)+" @@"),j.push.apply(j,c),j.push.apply(j,r.slice(0,s).map(function(a){return" "+a})),f=d=0,c=[])),i+=r.length,k+=r.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&j.push("\\ No newline at end of file\n");return j.join("\n")},convertChangesToXML:function(a){for(var b=[],d=0;d<a.length;d++){var c=a[d];
c.added?b.push("<ins>"):c.removed&&b.push("<del>");b.push(k(c.value));c.added?b.push("</ins>"):c.removed&&b.push("</del>")}return b.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(j){var k=k||{};k.JSDiffAdapter=function(){function i(){}i.prototype={_specialLine:function(d,b,f){return b.value===d&&f!==d},adapt:function(d,b,f){f||(f="\n");for(var a=d.split(f),e=b.split(f),h=a[a.length-1]==="",e=e[e.length-1]==="",g=j.diffLines(d,b),d=[],b=[],c=0,i=0,k=-1,n=0,p=!0,t=f,r=0;r<g.length;r++){var s=g[r],v=s.lines||s.value.split(f),w=v.length,u=0;v.length>1&&v[v.length-1]===""&&w--;w>1&&!p&&v[0]===""&&(w--,u++);s.lines=v;
if(!s.added&&!s.removed){if(!this._specialLine(f,s,t)){if(c||i)d.push([c,i,k]),i=c=0,k=-1,n+=i;d.push([w,w,0]);n+=w}}else if(s.added){k===-1&&(k=b.length+1);c+=w;for(p=u;p<w+u;p++)b.push(s.lines[p])}else i+=w;p=!1;v.length>1&&v[v.length-1]===""&&(p=!0);t=s.value?s.value[s.value.length-1]:f}if(c||i)d.push([c,i,k]),n+=i;n<a.length&&a.length>1&&(f=d[d.length-1],f[2]===0?(f[0]+=1,f[1]+=1):f[2]===-1?d.push([1,1,0]):h===e?d.push([1,1,0]):(e&&(f[0]+=1),h&&(f[1]+=1)));return{mapper:d,changContents:{array:b,
index:0}}},adaptCharDiff:function(d,b,f){for(var d=f?j.diffWords(d,b):j.diffChars(d,b),b=[],a=f=0,e=0,h=0,g=0;g<d.length;g++){var c=d[g];if(!c.added&&!c.removed){if(e>0||h>0)b.push([a,a+e,f,f+h]),a+=e,f+=h,h=e=0;a+=c.value.length;f+=c.value.length}else c.added?e+=c.value.length:h+=c.value.length}(e>0||h>0)&&b.push([a,a+e,f,f+h]);return b}};return i}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(j,k,i,d){var b={},f,a,e,h,g,c,l,m,n,p,t,r,s,v,w,u;b.DiffTreeNavigator=function(){function b(a,c,d,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,d,e,f,g)}f="orion.annotation.diff.addedBlock";a="orion.annotation.diff.currentAddedBlock";e="orion.annotation.diff.deletedBlock";h="orion.annotation.diff.currentDeletedBlock";
g="orion.annotation.diff.blockTop";c="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";m="orion.annotation.diff.currentBlockConflict";n="orion.annotation.diff.addedWord";p="orion.annotation.diff.currentAddedWord";t="orion.annotation.diff.deletedWord";r="orion.annotation.diff.currentDeletedWord";s="orion.annotation.diff.emptyDeletedWordLeft";v="orion.annotation.diff.emptyDeletedWordRight";w="orion.annotation.diff.emptyAddedWordLeft";u="orion.annotation.diff.emptyAddedWordRight";
i.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});i.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});i.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});i.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});i.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
i.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});i.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});i.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});i.AnnotationType.registerType(n,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});i.AnnotationType.registerType(p,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});i.AnnotationType.registerType(t,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});i.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});i.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});i.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
i.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});i.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});b.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new d.JSDiffAdapter;for(a=0;a<b.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var f=this.generatePairWordAnnotations(e,a,c);if(f)e.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 j.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (i.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (i.AnnotationType.getType(e.current))(g.start,g.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=i.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<d.length;h++){var j=
i.AnnotationType.createAnnotation(g.normal,d[h][e]+c,d[h][f]+c);a.push(j);b.push(j)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return b}();b.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:p,normal:n,list:[]}):a.push({type:"word",current:r,normal:t,list:[]});a.push({type:"word",current:s});a.push({type:"word",current:v});a.push({type:"word",current:w});a.push({type:"word",current:u})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:n}:{current:this._repositionEmptyWord(a,b),normal:t}:this._mapperColumnIndex===0?{current:p,normal:n}:{current:r,normal:t}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?u:v;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?u:v;return this._mapperColumnIndex===0?w:s},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}();b.TwoWayDiffBlockFeeder=function(){function d(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}d.prototype=new b.DiffBlockFeeder;d.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]}};d.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:f,current:a,list:[]}):b.push({type:"block",normal:e,current:h,list:[]});b.push({type:"block",normal:g,current:c,list:[]});b.push({type:"block",normal:l,current:m,list:[]})};d.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=b)return null;b=this._diffBlocks[b][1];
if(this._mapper[b][this._mapperColumnIndex]===0)return{normal:g,current:c};else if(k.isMapperConflict(this.getMapper(),b))return{normal:l,current:m};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:a,list:[]};return{type:"block",normal:e,current:h,list:[]}};return d}();b.inlineDiffBlockFeeder=function(){function c(a,b){this._mapperColumnIndex=b;this.init(a)}c.prototype=new b.DiffBlockFeeder;c.prototype.setModel=function(a){this._textModel=a};c.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(this._mapper[c][2]!==0){if(this._mapperColumnIndex===0){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};c.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:f,current:a,list:[]}):b.push({type:"block",normal:e,current:h,list:[]});b.push({type:"block",normal:l,current:m,list:[]})};c.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0)return null;b=this._diffBlocks[b][1];if(this._mapper[b][this._mapperColumnIndex]===0)return{current:p,normal:n};else if(k.isMapperConflict(this.getMapper(),
b))return{normal:l,current:m};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:a,list:[]};return{type:"block",normal:e,current:h,list:[]}};c.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};c.prototype.getLineNumber=function(a){for(var 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 c}();return b});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(j,k,i,d,b,f,a,e,h,g,c,l,m){var n={};n.CompareView=function(){function a(){this._diffParser=new d.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,d,e){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();n.TwoWayCompareView=function(){function c(a){this.setOptions(a,!0);this._diffNavigator=new m.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new g.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new b.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
c.prototype=new n.CompareView;c.prototype.initEditors=function(a){this._editors=[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));
window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return j["There are unsaved changes."]}.bind(this)};c.prototype.getEditors=function(){return this._editors};c.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)};c.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};c.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
c.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};c.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};c.prototype._createEditor=function(b,c,d,e,g){var i=typeof e.readonly==="undefined"?!0:e.readonly,k=function(){var a=new h.TextView({parent:c,readonly:i,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var b=this.getSplitter();b&&b.addResizeListener(function(b){if(b){var c=
!1;(c=this._uiFactory.isLeftPane(b)?g:!g)&&a.resize()}}.bind(this));return a}.bind(this),l=e.keyBindingFactory;l||(l=new a.KeyBindingsFactory);var m=null;if(d)var p="",m=function(a,b){if(d)p=b?j["ERROR: "]+a:a,d.textContent=""+p};k=new f.Editor({textViewFactory:k,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:c});k.installTextView();k.setInput(null,null,e.Content?e.Content:b);k.setOverviewRulerVisible(!1);var n=k.getTextView();
n.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(n.getCaretOffset(),n)}.bind(this));n.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!g))this.options.mapper=null}.bind(this));g?n.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
n.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};c.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};c.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),c=new b.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(c);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};c.prototype.refresh=function(a){var b=this.options.oldFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;typeof c==="string"?d=this._generateMapper(b,c,d,this.options.hasConflicts):(d=this._generateMapper(b,c,d,this.options.hasConflicts),
c=d.output);var e=new m.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new m.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),this._editors[0].setInput(this.options.oldFile.Name,
null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((b=this._uiFactory.getTitleDiv(!1))&&a)i.empty(b),i.empty(a),b.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return c}();n.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 n.CompareView;d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),
this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(c){var d=i.node(this._editorDiv),e=function(){return new h.TextView({parent:d,readonly:!0,tabSize:4})}.bind(this);this._editor=
new f.Editor({textViewFactory:e,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,c);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new b.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),
this._textView)}.bind(this))};d.prototype._initDiffPosition=function(a){var 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(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new m.inlineDiffBlockFeeder(b.mapper,
1),d=new m.inlineDiffBlockFeeder(b.mapper,0);c.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);
this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();b=this._textView.getTopIndex();this._textView.redrawLines(b,b+1,this._overviewRuler);this._textView.redrawLines(b,b+1,this._rulerOrigin);this._textView.redrawLines(b,b+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=
function(a){this._conflcit=a};return d}();n.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new n.InlineCompareView(c):new n.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();i.empty(i.node(a.parentDivId));this._widget=this._widget.type==="inline"?new n.TwoWayCompareView(a):new n.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return n});
define("orion/editor/keywords",[],function(){return{JSKeywords:"break,case,class,catch,continue,const,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield".split(","),CSSKeywords:"alignment-adjust,alignment-baseline,animation,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,appearance,azimuth,backface-visibility,background,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-align,box-decoration-break,box-direction,box-flex,box-flex-group,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color,color-profile,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue,cue-after,cue-before,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit,fit-position,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float,float-offset,font,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,mark,mark-after,mark-before,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-style,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,page-policy,pause,pause-after,pause-before,perspective,perspective-origin,phonemes,pitch,pitch-range,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest,rest-after,rest-before,richness,right,rotation,rotation-point,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak,speak-header,speak-numeral,speak-punctuation,speech-rate,stress,string-set,table-layout,target,target-name,target-new,target-position,text-align,text-align-last,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-pitch-range,voice-rate,voice-stress,voice-volume,volume,white-space,white-space-collapse,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),JAVAKeywords:"abstract,boolean,break,byte,case,catch,char,class,continue,default,do,double,else,extends,false,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,void,volatile,while".split(",")}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/keywords"],function(j,k){function i(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function d(){i.call(this,null,!0)}function b(a){i.call(this,null,a)}function f(){i.call(this,null,!1)}function a(a,c,j){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(c){case "java":k=h;break;case "js":k=e;break;case "css":k=g}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=
!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new i(k,this.whitespacesVisible);this._firstScanner=new f;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new d;if(c==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=j;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},
onMouseDown:function(a){l._onMouseDown(a)},onSelection:function(a){l._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var e=k.JSKeywords,
h=k.JAVAKeywords,g=k.CSSKeywords,c={styleClass:"token_singleline_comment"},l={styleClass:"token_multiline_comment"},m={styleClass:"token_doc_comment"},n={styleClass:"token_doc_html_markup"},p={styleClass:"token_task_tag"},t={styleClass:"token_doc_tag"},r={styleClass:"token_string"},s={styleClass:"token_number"},v={styleClass:"token_keyword"},w={styleClass:"token_space",unmergeable:!0},u={styleClass:"token_tab",unmergeable:!0},q={styleClass:"line_caret"};i.prototype={getOffset:function(){return this.offset},
getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=
a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===
c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),
b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},
setText:function(a){this.text=a;this.startOffset=this.offset=0}};d.prototype=new i(null);d.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};b.prototype=new i(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 i(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}};a.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",
this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,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(j.AnnotationType.ANNOTATION_FOLDING);for(var c=[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=
e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (j.AnnotationType.getType(j.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var g=d.getAnnotations(b,c),e=[],h=j.AnnotationType.ANNOTATION_TASK;g.hasNext();){var i=
g.next();i.type===h&&e.push(i)}g=[];i=this._commentScanner;i.setText(f.getText(b,c));for(var k;k=i.nextToken();){var l=i.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),g.push(j.AnnotationType.createAnnotation(h,l,k,f.getText(l,k))))}d.replaceAnnotations(e,g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return q}return null},
_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=d)break;var i=g[h].start,j=g[h].end;f<i&&this._parse(b.substring(f-c,i-c),f,e);var k=g[h].type,n;switch(k){case 8:n=m;break;case 7:n=l;break;case 5:n=r}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,n,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-
c,i-c),f,e,r):e.push({start:f,end:i,style:n});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,d){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=null;switch(a){case 2:g=v;break;case 3:g=s;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,r);continue}else g=r;break;case 8:this._parseComment(e.getData(),
f,d,m,a);continue;case 6:this._parseComment(e.getData(),f,d,c,a);continue;case 7:this._parseComment(e.getData(),f,d,l,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w)}d.push({start:f,end:e.getOffset()+b,style:g})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&
(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w);break;case 12:g=n;break;case 13:g=t;break;case 14:g=p;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&
(g=w)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+
g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+
b,end:c.getOffset()+b,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),c=this._findBrackets(d,f,c,h,h,i),i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,c[i]*h-1===b){var j=1;if(e&1){for(i--;i>=0;i--)if(h=c[i]>=0?1:-1,
j+=h,j===0)return c[i]*h-1;for(g-=1;g>=0;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,i);for(e=c.length-1;e>=0;e--)if(h=c[e]>=0?1:-1,j+=h,j===0)return c[e]*h-1;g--}}else{for(i++;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,i);for(i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g++}}break}return-1},_findBrackets:function(a,
b,c,d,e,f){for(var g=[],a=a.charCodeAt(0),b=b.charCodeAt(0),h=e,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 m=k[l].end;if(h<j)for(i.setText(c.substring(h-e,j-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+d+1));h=m}if(h<f)for(i.setText(c.substring(h-e,f-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
h,i;if(c.start===c.end&&(i=d.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),a=this._findMatchingBracket(a,i),a!==-1&&(h=[j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,g=f.getCharCount(),h=this.comments.length,i=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,i,!0),l=this._binarySearch(this.comments,
c,!1,k-1,h);k<h&&this.comments[k].start<=i&&i<this.comments[k].end?(i=this.comments[k].start,i>b&&(i+=d)):i=k===h&&h>0&&g-d===this.comments[h-1].end?this.comments[h-1].start:i;var m;l<h?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=h,m=g);for(var n,g=this._findComments(f.getText(i,m),i),h=k;h<this.comments.length;h++)n=this.comments[h],n.start>b&&(n.start+=d),n.start>b&&(n.end+=d);var p=l-k!==g.length;if(!p)for(h=0;h<g.length;h++){n=this.comments[k+h];var q=g[h];if(n.start!==q.start||n.end!==q.end||
n.type!==q.type){p=!0;break}}h=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,h);p&&(h=i,n=m,a!==f&&(h=a.mapOffset(h,!0),n=a.mapOffset(n,!0)),e.redrawRange(h,n));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(i,m);i=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===j.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(h=0;h<g.length;h++)if(n.start===g[h].start&&n.end===g[h].end)break;h===g.length?(i.push(n),n.expand()):(h=n.start,l=n.end,h>
b&&(h-=d),l>b&&(l-=d),h<=b&&b<l&&h<=c&&c<l&&(h=f.getLineAtOffset(n.start),l=f.getLineAtOffset(n.end),h!==l?n.expanded||(n.expand(),e.modifyAnnotation(n)):e.removeAnnotation(n)))}b=[];for(h=0;h<g.length;h++){n=g[h];for(d=0;d<m.length;d++)if(m[d].start===n.start&&m[d].end===n.end)break;d===m.length&&(n=this._createFoldingAnnotation(a,f,n.start,n.end))&&b.push(n)}e.replaceAnnotations(i,b)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/regex"],function(j){function k(b){var d;if(b instanceof Array){d=Array(b.length);for(var a=0;a<b.length;a++)d[a]=k(b[a])}else for(a in d={},b)if(Object.prototype.hasOwnProperty.call(b,a)){var e=b[a];d[a]=typeof e==="object"&&e!==null?k(e):e}return d}function i(b,d,a){this.initialize(b);this.grammar=k(d);this.externalGrammars=a?k(a):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var d={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function f(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var a="",e,b=d.processGlobalFlag("x",b,function(a){for(var b="",d=!1,e=a.length,f=0;f<e;){var h=a.charAt(f);if(!d&&h==="#")for(;f<e&&h!=="\r"&&h!=="\n";)h=a.charAt(++f);
else if(!d&&/\s/.test(h))for(;f<e&&/\s/.test(h);)h=a.charAt(++f);else h==="\\"?(b+=h,/\s/.test(a.charAt(f+1))||(b+=a.charAt(f+1),f+=1)):(h==="["?d=!0:h==="]"&&(d=!1),b+=h),f+=1}return b}),b=d.processGlobalFlag("i",b,function(b){a+="i";return b});for(e=0;e<this.unsupported.length;e++){var h;(h=this.unsupported[e].regex.exec(b))&&f(this.unsupported[e].func(h),h)}return RegExp(b,a)},processGlobalFlag:function(b,d,a){function e(a,b){for(var d=0,e=a.length,f=-1,h=b;h<e&&f===-1;h++)switch(a.charAt(h)){case "\\":h++;
break;case "(":d++;break;case ")":d--,d===0&&(f=h)}return f}var h="(?"+b+")",b="(?"+b+":";if(d.substring(0,h.length)===h)return a(d.substring(h.length));else if(d.substring(0,b.length)===b){h=e(d,0);if(h<d.length-1)throw Error("Only a "+b+") group that encloses the entire regex is supported in: "+d);return a(d.substring(b.length,h))}return d},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,d,a){for(var a=typeof a==="undefined"?!0:!1,b=b.source.split(/(\\\d+)/g),
e=[],h=0;h<b.length;h++){var g=b[h],c=/\\(\d+)/.exec(g);c?(g=d[c[1]]||"",e.push(a?j.escape(g):g)):e.push(g)}return RegExp(e.join(""))},groupify:function(b,d){for(var a=b.source,e=a.length,h=[],g=0,c=[],i=1,j=1,k=[],p={},t={},r=0;r<e;r++){var s=h[h.length-1],v=a.charAt(r);switch(v){case "(":if(s===4)h.pop(),k.push(")"),c[c.length-1].end=r;var w=r+2<e?a.charAt(r+1)+""+a.charAt(r+2):null;if(w==="?:"||w==="?="||w==="?!"){var u;w==="?:"?u=1:(u=3,g++);h.push(u);c.push({start:r,end:-1,type:u});k.push(v);
k.push(w);r+=w.length}else h.push(2),c.push({start:r,end:-1,type:2,oldNum:i,num:j}),k.push(v),g===0&&(t[j]=null),p[i]=j,i++,j++;break;case ")":s=h.pop();s===3&&g--;c[c.length-1].end=r;k.push(v);break;case "*":case "+":case "?":case "}":var q=v,o=a.charAt(r-1),w=r-1;if(v==="}"){for(u=r-1;a.charAt(u)!=="{"&&u>=0;u--);o=a.charAt(u-1);w=u-1;q=a.substring(u,r+1)}u=c[c.length-1];if(o===")"&&(u.type===2||u.type===4)){k.splice(u.start,0,"(");k.push(q);k.push(")");v={start:u.start,end:k.length-1,type:4,num:u.num};
for(o=0;o<c.length;o++)if(s=c[o],(s.type===2||s.type===4)&&s.start>=u.start&&s.end<=w)if(s.start+=1,s.end+=1,s.num+=1,s.type===2)p[s.oldNum]=s.num;c.push(v);j++;break}default:v!=="|"&&s!==2&&s!==4&&g===0&&(h.push(4),c.push({start:r,end:-1,type:4,num:j}),k.push("("),t[j]=null,j++),k.push(v),v==="\\"&&(v=a.charAt(r+1),k.push(v),r+=1)}}for(;h.length;)h.pop(),k.push(")");var a=RegExp(k.join("")),e={},d=d||p,x;for(x in d)d.hasOwnProperty(x)&&(e[x]="\\"+d[x]);a=this.getSubstitutedRegex(a,e,!1);return[a,
p,t]},complexCaptures:function(b){if(!b)return!1;for(var d in b)if(b.hasOwnProperty(d)&&d!=="0")return!0;return!1}};i.prototype={initialize:function(b){this.textView=b;this.textView.stylerOptions=this;var d=this;this._listener={onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStorage:function(a){d.onStorage(a)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);
b.addEventListener("LineStyle",this._listener.onLineStyle);b.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(b){for(b=[b];b.length!==0;){var d=
b.pop();if(!d._resolvedRule||!d._typedRule)if(d._resolvedRule=this._resolve(d),d._typedRule=this._createTypedRule(d),this.addStyles(d.name),this.addStyles(d.contentName),this.addStylesForCaptures(d.captures),this.addStylesForCaptures(d.beginCaptures),this.addStylesForCaptures(d.endCaptures),d._resolvedRule!==d&&b.push(d._resolvedRule),d.patterns)for(var a=0;a<d.patterns.length;a++)b.push(d.patterns[a])}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var d=b.split("."),a=0;a<
d.length;a++)this._styles[b].push(d.slice(0,a+1).join("-"))}},addStylesForCaptures:function(b){for(var d in b)b.hasOwnProperty(d)&&this.addStyles(b[d].name)},ContainerRule:function(){function b(b){this.rule=b;this.subrules=b.patterns}b.prototype.valueOf=function(){return"aa"};return b}(),BeginEndRule:function(){function b(b){this.rule=b;this.beginRegex=d.toRegExp(b.begin);this.endRegex=d.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var a=d.complexCaptures(b.captures),
b=d.complexCaptures(b.beginCaptures)||d.complexCaptures(b.endCaptures);if(this.isComplex=a||b)a=d.groupify(this.beginRegex),this.beginRegex=a[0],this.beginOld2New=a[1],this.beginConsuming=a[2],a=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=a[0],this.endOld2New=a[1],this.endConsuming=a[2]}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(b){this.rule=b;this.matchRegex=d.toRegExp(b.match);if(this.isComplex=d.complexCaptures(b.captures))b=
d.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var d=b;if(b.include){if(b.begin||b.end||b.match)throw Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if(b.charAt(0)==="#"){if(d=this.grammar.repository&&this.grammar.repository[b.substring(1)],
!d)throw Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")d=this.grammar;else if(b==="$base")throw Error('Include "$base" is not supported');else if(d=this._allGrammars[b],!d)for(var a=0;a<this.externalGrammars.length;a++){var e=this.externalGrammars[a];if(e.scopeName===b){this.preprocess(e);d=this._allGrammars[b]=e;break}}}return d},ContainerNode:function(){function b(b,a){this.parent=b;this.rule=a;this.children=[];this.end=this.start=null}b.prototype.addChild=
function(b){this.children.push(b)};b.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(b,a,e){this.parent=b;this.rule=a;this.children=[];this.setStart(e);this.endMatch=this.end=null;this.endRegexSubstituted=a.endRegexHasBackRef?d.getSubstitutedRegex(a.endRegex,e):null}b.prototype.addChild=function(b){this.children.push(b)};b.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};b.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};b.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};b.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};b.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return b}(),push:function(b,d){if(d)for(var a=d.length;a>0;)b.push(d[--a])},exec:function(b,d,a){(d=b.exec(d))&&(d.index+=a);b.lastIndex=0;return d},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,d,a){if(b instanceof this.BeginEndNode){var e=b.rule,b=b.endRegexSubstituted||e.endRegex;return!b?null:this.exec(b,d,a)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(b){var d=b.addedCharCount,a=b.removedCharCount,b=b.start;if(this._tree){var e=this.textView.getModel(),h=e.getCharCount(),e=e.getLineEnd(e.getLineAtOffset(b)-1),g=this.getFirstDamaged(e,e),e=e===-1?0:e,d=g?this.parse(g,!0,e,b,d,a):h;this.textView.redrawRange(e,d)}else this.initialParse()},getFirstDamaged:function(b,d){if(b<0)return this._tree;for(var a=[this._tree],e=null;a.length;){var h=a.pop();if(!h.parent||this.isDamaged(h,b,d)){h instanceof this.BeginEndNode&&(e=
h);for(var g=0;g<h.children.length;g++)a.push(h.children[g])}}return e||this._tree},isDamaged:function(b,d,a){return b.start<=a&&b.end>d},parse:function(b,d,a,e,h,g){var c=this.textView.getModel(),i=c.getLineStart(c.getLineCount()-1),j=c.getCharCount(),k=this.getInitialExpected(b,a),p=-1;if(d)b.repaired=!0,b.endNeedsUpdate=!0,p=(p=b.children[b.children.length-1])?c.getLineEnd(c.getLineAtOffset(p.end+(h-g))):-1,e=c.getLineEnd(c.getLineAtOffset(e+g)),p=Math.max(p,e);for(var p=p===-1?j:p,e=k,t=b,r=!1,
s=a,v=-1;t&&(!d||s<p);){var w=this.getNextMatch(c,t,s);w||(s=s>=i?j:c.getLineStart(c.getLineAtOffset(s)+1));var u=w&&w.match,q=w&&w.rule,o=w&&w.isEnd;if(w&&w.isSub){if(s=this.afterMatch(u),q instanceof this.BeginEndRule)r=!0,d&&q===e.rule&&t===e.parent?(t=e,t.setStart(u),t.repaired=!0,t.endNeedsUpdate=!0,e=this.getNextExpected(e,"begin")):(d&&(this.prune(t,e),d=!1),u=new this.BeginEndNode(t,q,u),t.addChild(u),t=u)}else if(o||s===j){if(t instanceof this.BeginEndNode)u?(r=!0,v=Math.max(v,t.end),t.setEnd(u),
s=this.afterMatch(u),d&&t===e&&t.parent===e.parent?(t.repaired=!0,delete t.endNeedsUpdate,e=this.getNextExpected(e,"end")):d&&(this.prune(t,e),d=!1)):(t.setEnd(j),delete t.endNeedsUpdate);t=t.parent}d&&s>=p&&!r&&(this.prune(b,k),d=!1)}this.removeUnrepairedChildren(b,d,a);this.cleanup(d,b,a,p,j,h,g);return d?Math.max(v,s):s},removeUnrepairedChildren:function(b,d,a){if(d){for(var d=b.children,e=-1,h=0;h<d.length;h++){var g=d[h];if(!g.repaired&&this.isDamaged(g,a,Number.MAX_VALUE)){e=h;break}}if(e!==
-1)b.children.length=e}},cleanup:function(b,d,a,e,h,g,c){if(b){b=g-c;h=this.getIntersecting(e-b+1,h);d=this.getIntersecting(a,e);for(a=0;a<h.length;a++)e=h[a],!e.repaired&&e instanceof this.BeginEndNode&&(e.shiftEnd(b),e.shiftStart(b));for(a=0;a<d.length;a++)e=d[a],e.repaired&&e.endNeedsUpdate&&e.shiftEnd(b),delete e.endNeedsUpdate,delete e.repaired}else{d=this.getIntersecting(a,e);for(a=0;a<d.length;a++)delete d[a].repaired}},getNextMatch:function(b,d,a,e){var h=b.getLineAtOffset(a),h=b.getLineEnd(h),
g=b.getText(a,h),c=[],i=[],b=[],h=[];for(this.push(c,d.rule.subrules);c.length;){var j=c.length?c.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&i.indexOf(j)===-1)i.push(j),this.push(c,j.subrules);else if(!j||!e||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,g,a);k&&(b.push(k),h.push(j))}}c=Number.MAX_VALUE;i=-1;for(j=0;j<b.length;j++)if(k=b[j],k.index<c)c=k.index,i=j;if(!e&&(a=this.getEndMatch(d,g,a)))if(e=d.rule.applyEndPatternLast,i===-1||a.index<c||
!e&&a.index===c)return{isEnd:!0,rule:d.rule,match:a};return i===-1?null:{isSub:!0,rule:h[i],match:b[i]}},getInitialExpected:function(b,d){var a,e;if(b===this._tree)for(a=0;a<b.children.length;a++){if(e=b.children[a],e.start>=d)return e}else if(b instanceof this.BeginEndNode&&b.endMatch){var h=b.endMatch.index;for(a=0;a<b.children.length;a++)if(e=b.children[a],e.start>=d)break;if(e&&e.start<h)return e}return b},getNextExpected:function(b,d){if(d==="begin"){var a=b.children[0];return a?a:b}else if(d===
"end"&&(a=b.parent)){var e=a.children[a.children.indexOf(b)+1];return e?e:a}return null},prune:function(b,d){if(d.parent===b)b.children.length=d.getIndexInParent();else if(b instanceof this.BeginEndNode)b.endMatch=null,b.end=null;if(b.parent)b.parent.children.length=b.getIndexInParent()+1},onLineStyle:function(b){this._tree||this.initialParse();var d=b.lineStart,a=this.textView.getModel(),e=a.getLineEnd(b.lineIndex),h=a.getLineEnd(a.getLineAtOffset(d)-1),h=this.getFirstDamaged(h,h),d=this.getLineScope(a,
h,d,e);b.ranges=this.toStyleRanges(d);b.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(b,d,a,e){for(var h=a,g=this.getInitialExpected(d,a),c=[],i=[];d&&h<e;){var j=this.getNextMatch(b,d,h);if(!j)break;var k=j&&j.match,p=j&&j.rule,t=j&&j.isSub,j=j&&j.isEnd;k.index!==h&&i.push({start:h,end:k.index,node:d});if(t)h=this.afterMatch(k),p instanceof this.BeginEndRule?(this.addBeginScope(c,k,p),d=g,g=this.getNextExpected(g,"begin")):this.addMatchScope(c,k,p);else if(j)h=this.afterMatch(k),
this.addEndScope(c,k,p),g=this.getNextExpected(g,"end"),d=d.parent}h<e&&i.push({start:h,end:e,node:d});b=this.getInheritedLineScope(i,a,e);return c.concat(b)},getInheritedLineScope:function(b){for(var d=[],a=0;a<b.length;a++)for(var e=b[a],h=e.node;h;){var g=h.rule.rule,c=g.name;if(g=g.contentName||c){this.addScopeRange(d,e.start,e.end,g);break}h=h.parent}return d},addBeginScope:function(b,d,a){var e=a.rule;this.addCapturesScope(b,d,e.beginCaptures||e.captures,a.isComplex,a.beginOld2New,a.beginConsuming)},
addEndScope:function(b,d,a){var e=a.rule;this.addCapturesScope(b,d,e.endCaptures||e.captures,a.isComplex,a.endOld2New,a.endConsuming)},addMatchScope:function(b,d,a){var e=a.rule,h=e.name;(e=e.captures)?this.addCapturesScope(b,d,e,a.isComplex,a.matchOld2New,a.matchConsuming):this.addScope(b,d,h)},addScope:function(b,d,a){a&&b.push({start:d.index,end:this.afterMatch(d),scope:a})},addScopeRange:function(b,d,a,e){e&&b.push({start:d,end:a,scope:e})},addCapturesScope:function(b,d,a,e,h,g){if(a)if(e){for(var e=
{1:0},c=0,i=1;d[i]!==void 0;i++)g[i]!==void 0&&(c+=d[i].length),d[i+1]!==void 0&&(e[i+1]=c);g=d.index;for(c=1;a[c];c++){var i=a[c].name,j=h[c],k=g+e[j];typeof d[j]!=="undefined"&&this.addScopeRange(b,k,k+d[j].length,i)}}else this.addScope(b,d,a[0]&&a[0].name)},getIntersecting:function(b,d){for(var a=[],e=this._tree?[this._tree]:[];e.length;){var h=e.pop(),g=!1;h instanceof this.ContainerNode?g=!0:this.isDamaged(h,b,d)&&(g=!0,a.push(h));if(g)for(var g=h.children.length,c=0;c<g;c++)e.push(h.children[c])}return a.reverse()},
toStyleRanges:function(b){for(var d=[],a=0;a<b.length;a++){var e=b[a],h=this._styles[e.scope];if(!h)throw Error("styles not found for "+e.scope);h=h.join(" ");d.push({start:e.start,end:e.end,style:{styleClass:h}})}return d}};return{RegexUtil:d,TextMateStyler:i}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(j,k){function i(a){return a.getProperty("objectClass").indexOf(b)!==-1&&a.getProperty("type")==="highlighter"}function d(a,b,d){this.initialize(a,b,d);this.lineStyles=[]}var b="orion.edit.highlighter",f=b+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:j.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(a,d,f){this.textView=a;this.serviceRegistry=d;this.annotationModel=f;this.services=[];var g=this;this.listener={onModelChanging:function(a){g.onModelChanging(a)},onModelChanged:function(a){g.onModelChanged(a)},onDestroy:function(a){g.onDestroy(a)},onLineStyle:function(a){g.onLineStyle(a)},onStyleReady:function(a){g.onStyleReady(a)},onServiceAdded:function(a){g.onServiceAdded(a.serviceReference,g.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){g.onServiceRemoved(a.serviceReference,
g.serviceRegistry.getService(a.serviceReference))}};a.addEventListener("ModelChanging",this.listener.onModelChanging);a.addEventListener("ModelChanged",this.listener.onModelChanged);a.addEventListener("Destroy",this.listener.onDestroy);a.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);a=d.getServiceReferences(b);for(f=0;f<a.length;f++){var c=a[f];i(c)&&this.addServiceListener(d.getService(c))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var b=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[b,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var b=a.lineStyles||a.style,a=Number.MAX_VALUE,d=-1,f=this.textView.getModel(),c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(this.lineStyles[c]=b[c],a=Math.min(a,c),d=Math.max(d,c));a=Math.max(a,0);d=Math.min(d,f.getLineCount());if(b=this.annotationModel){for(var i=b.getAnnotations(f.getLineStart(a),f.getLineEnd(d)),j=[];i.hasNext();){var n=i.next();n.type==="orion.annotation.highlightError"&&j.push(n)}i=[];for(n=a;n<=d;n++){c=n;var p=this.lineStyles[c],p=p&&p.errors;
c=f.getLineStart(c);if(p)for(var t=0;t<p.length;t++){var r=p[t];i.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+c,r.end+c))}}b.replaceAnnotations(j,i)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function b(a,c){for(var d=a.length,e=[],f=0;f<d;f++){var h=a[f];e.push({start:h.start+c,end:h.end+c,style:h.style})}return e}var d=this.lineStyles[a.lineIndex];if(d)if(d.ranges)a.ranges=b(d.ranges,a.lineStart);else if(d.style)a.style=d.style},_getEmptyStyle:function(a){for(var b=
[],d=0;d<a;d++)b.push(null);return b},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var b=this.services[a];if(b.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(a,b){i(a)&&this.addServiceListener(b)},onServiceRemoved:function(a,
b){this.services.indexOf(b)!==-1&&this.removeServiceListener(b)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var b=this.serviceRegistry.getService("orion.page.progress");b?b.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(f))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(f))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(j,k,i,d){function b(a,b,f,g,c,l,m){function n(a,c){var g=a.getProperty("contentType"),i=a.getProperty("fileTypes");if(g)return b.isSomeExtensionOf(f,g).then(function(b){return b?a:null});else if(c&&i&&i.indexOf(c)!==-1)return g=new d,g.resolve(a),g;return null}var p=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new j.TextStyler(g,"js",c);break;case "text/x-java-source":b=new j.TextStyler(g,"java",c);break;case "text/css":b=new j.TextStyler(g,"css",c)}return b}(f);if(p)return l=new d,l.resolve(p),l;for(var p=l&&l.split(".").pop().toLowerCase(),l=a.getServiceReferences("orion.edit.highlighter"),t=[],r=[],s=0;s<l.length;s++){var v=l[s];v.getProperty("type")==="grammar"&&t.push(v.getProperty("grammar"));(v=n(v,p))&&r.push(v)}return d.all(r,function(a){return{_error:a}}).then(function(b){for(var d,e=b.length-
1;e>=0;e--){var j=b[e];if(j&&!j._error&&(m||j.getProperty("type")!=="highlighter")){d=j;break}}var l;if(d)if(b=d.getProperty("type"),b==="highlighter")l=new i(g,a,c),l.setContentType(f);else if(b==="grammar"||typeof b==="undefined")d=d.getProperty("grammar"),l=new k.TextMateStyler(g,d,t);return l})}function f(a){this.serviceRegistry=a;this.styler=null}f.prototype={setup:function(a,d,f,g,c){c=typeof c==="undefined"?!0:c;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var i=
this;return b(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,d,f,g,c).then(function(a){return i.styler=a})},getStyler:function(){return this.styler}};return{createStyler:b,SyntaxHighlighter:f}});
define("orion/searchExplorer","i18n!orion/search/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/contentTypes,orion/i18nUtil,orion/explorers/explorer,orion/explorers/explorerNavHandler,orion/fileClient,orion/commands,orion/searchUtils,orion/globalSearch/search-features,orion/compare/compareUIFactory,orion/compare/compareView,orion/highlight,orion/explorers/navigationUtils,orion/webui/tooltip,orion/explorers/navigatorRenderer,orion/extensionCommands".split(","),function(j,k,i,d,b,f,
a,e,h,g,c,l,m,n,p,t,r,s,v){function w(a){(a=d.node(a))&&d.empty(a);return a}function u(a,b,c){(a=d.node(a))&&a.addEventListener(b,c,!1)}function q(a,b,c){if(b=d.node(b))c==="only"&&d.empty(b),b.appendChild(a)}function o(a,b,c,e){a=document.createElement(a);if(b)if(Array.isArray(b))for(var f=0;f<b.length;f++)a.classList.add(b[f]);else if(typeof b==="string")a.className=b;if(c)a.id=c;(b=d.node(e))&&b.appendChild(a);return a}function x(a,b,c,d,e){a=o("a",a,b,d);a.href=c;e&&a.appendChild(document.createTextNode(e));
return a}function C(a,b,c,d){a=o("span",a,b,c);d&&a.appendChild(document.createTextNode(d));return a}function E(a){return!a?null:a.type==="file"?a:a.parent}function D(a){return typeof a.getValidFileList==="function"?a.getValidFileList():a.getListRoot().children}function y(a,b){this._init(a);this.explorer=b}function B(a,b){this._init(a);this.options=a;this.explorer=b}function A(a,b,c){this.parentId=a;this.reportList=b;this.resultModel=c;this.renderer=new B({checkbox:!1},this)}function F(a){this._syntaxHighlither=
new p.SyntaxHighlighter(a)}function z(a,c){this.registry=a;this._commandService=c;this.fileClient=new h.FileClient(this.registry);this.defaulRows=40;this._contentTypeService=new b.ContentTypeRegistry(this.registry);this.declareCommands()}y.prototype=new a.SelectionRenderer;y.prototype.initCheckboxColumn=function(){if(this._useCheckboxSelection){var a=o("th"),b=o("span",null,null,a);b.classList.add("selectionCheckmarkSprite");b.classList.add("core-sprite-check");if(this.getCheckedFunc)b.checked=this.getCheckedFunc(this.explorer.model.getListRoot()),
b.classList.toggle("core-sprite-check_on");u(b,"click",function(a){this.onCheck(null,a.target,a.target.checked?!1:!0)}.bind(this));return a}};y.prototype.getCellHeaderElement=function(a){if(a>2)return null;var b,c;if(a!==0){b=o("th");c=o("h2","search_header",null,b);if(a===1)c.textContent=typeof this.explorer.model.getHeaderString==="function"?this.explorer.model.getHeaderString():j.Results;else if(a===2)c.textContent=j.Location;return b}else return o("th")};y.prototype.focus=function(){var a=d.node(this.explorer.getParentDivId());
window.setTimeout(function(){a.focus()},10)};y.prototype.staleFileElement=function(a,b){if(a.stale){var c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null;t.removeNavGrid(c,d.node(this.getItemLinkId(a)));c=d.node(this.getFileSpanId(a));w(c);q(document.createTextNode(b?b:this.explorer.model.getFileName(a)),c,"last");c=d.node(this.getFileIconId(a));w(c)}else this.explorer._prepareFilter(a)};y.prototype.replaceFileElement=function(a){var b=a.totalMatches?this.explorer.model.getFileName(a)+
" ("+f.formatMessage(j["${0} matches"],a.totalMatches)+")":this.explorer.model.getFileName(a)+" ("+j["No matches"]+")";a.totalMatches?(a=d.node(this.getItemLinkId(a)),q(document.createTextNode(b),a,"only")):(a.stale=!0,this.staleFileElement(a,b))};y.prototype.replaceDetailIcon=function(a,b){if(!this.explorer.model.replaceMode()&&a&&a.type==="detail"){var c=d.node(this.getDetailIconId(a));c&&(w(c),c=C(null,null,c),c.classList.add("imageSprite"),b==="right"?c.classList.add("core-sprite-rightarrow"):
b==="left"?c.classList.add("core-sprite-leftarrow"):c.classList.add("core-sprite-none"))}};y.prototype.renderFileElement=function(a,b,d){var e=null;this.explorer.model._provideSearchHelper&&(e=this.explorer.model._provideSearchHelper());e=e?c.generateFindURLBinding(e.params,e.inFileQuery,null,e.params.replace,!0):null;e=s.createLink(null,{Location:a.location,Name:this.explorer.model._filterText?null:d},this.explorer._commandService,this.explorer._contentTypeService,this.explorer._openWithCommands,
null,{id:this.getItemLinkId(a)},e,{holderDom:this._lastFileIconDom});b.appendChild(e);t.addNavGrid(this.explorer.getNavDict(),a,e);if(this.explorer.model._filterText){var a=o("span",null,null,e),b=c.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),searchStrLength:this.explorer.model._filterText.length},d.toLowerCase(),!1),f=[];f.push({name:d,startIndex:0,bold:!1,highlight:!1});b&&b.forEach(function(a){f=this._mergesingleSegment(f,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));
this._renderSegments(f,a)}};y.prototype.generateContextTip=function(a){for(var b=o("table"),c=0;c<a.context.length;c++){var d=o("tr",null,null,b);a.context[c].current?(d=o("td",null,null,d),d.noWrap=!0,d=o("span",null,null,d),this.generateDetailHighlight(a,d)):(d=o("td",null,null,d),d.noWrap=!0,d.textContent=a.context[c].context+"\u00a0")}return b};y.prototype._generateDetailSegments=function(a){for(var b=0,c=[],d=0;d<a.matches.length;d++){if(b>=a.lineString.length)break;if(!(this.explorer.model.replaceMode()&&
d!==a.matchNumber)&&(b!==a.matches[d].startIndex&&c.push({name:a.lineString.substring(b,a.matches[d].startIndex),startIndex:b,bold:!1,highlight:!1}),b=a.matches[d].length,c.push({name:a.lineString.substring(a.matches[d].startIndex,a.matches[d].startIndex+b),startIndex:a.matches[d].startIndex,bold:!0,highlight:!1}),b=a.matches[d].startIndex+b,this.explorer.model.replaceMode()))break}b<a.lineString.length-1&&c.push({name:a.lineString.substring(b),startIndex:b,bold:!1,highlight:!1});return c};y.prototype._mergesingleSegment=
function(a,b){var c=[];a.forEach(function(a){var d=a.startIndex,e=a.startIndex+a.name.length;b.start>d&&b.end<e?(c.push({name:a.name.substring(0,b.start-d),startIndex:a.startIndex,bold:a.bold,highlight:!1}),c.push({name:a.name.substring(b.start-d,b.end-d),startIndex:b.start,bold:a.bold,highlight:!0}),c.push({name:a.name.substring(b.end-d),startIndex:b.end,bold:a.bold,highlight:!1})):b.start>d&&b.start<e?(c.push({name:a.name.substring(0,b.start-d),startIndex:a.startIndex,bold:a.bold,highlight:!1}),
c.push({name:a.name.substring(b.start-d),startIndex:b.start,bold:a.bold,highlight:!0})):d>=b.start&&e<=b.end?(a.highlight=!0,c.push(a)):b.end>d&&b.end<e?(c.push({name:a.name.substring(0,b.end-d),startIndex:a.startIndex,bold:a.bold,highlight:!0}),c.push({name:a.name.substring(b.end-d),startIndex:b.end,bold:a.bold,highlight:!1})):c.push(a)}.bind(this));return c};y.prototype._mergeFilteredSegments=function(a,b){if(!this.explorer.model._filterText)return a;var d=c.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),
searchStrLength:this.explorer.model._filterText.length},b.toLowerCase(),!1),e=a;d&&d.forEach(function(a){e=this._mergesingleSegment(e,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));return e};y.prototype._renderSegments=function(a,b){a.forEach(function(a){var c=a.bold?o("b",null,null,b):o("span",null,null,b);a.highlight&&c.classList.add("search-filter-text");q(document.createTextNode(a.name),c,"only")}.bind(this))};y.prototype.generateDetailHighlight=function(a,b,c){var a=this.explorer.model.getDetailInfo(a),
d=this._generateDetailSegments(a);c&&(d=this._mergeFilteredSegments(d,a.lineString));this._renderSegments(d,b)};y.prototype.renderDetailElement=function(a,b,c,d){b=this.getDetailElement(a,b,c);d&&this.renderDetailLineNumber(a,b);this.generateDetailHighlight(a,b,!0)};y.prototype.renderDetailLineNumber=function(a,b){var c=this.explorer.model.getDetailInfo(a),d=c.lineNumber+1;!this.explorer.model.replaceMode()||c.matches.length<=1?q(document.createTextNode(d+":"),b,"last"):q(document.createTextNode(d+
"("+(c.matchNumber+1)+"):"),b,"last")};y.prototype.getDetailElement=function(a,b,d){var e=this,b=null;this.explorer.model._provideSearchHelper&&(b=this.explorer.model._provideSearchHelper());b=b?c.generateFindURLBinding(b.params,b.inFileQuery,a.lineNumber,b.params.replace,!0):null;b=s.createLink(null,{Location:a.parent.location,Name:null},this.explorer._commandService,this.explorer._contentTypeService,this.explorer._openWithCommands,null,{id:this.getItemLinkId(a)},b,{});d.appendChild(b);t.addNavGrid(this.explorer.getNavDict(),
a,b);u(b,"click",function(){e.explorer.getNavHandler().cursorOn(a)});return o("span",null,null,b)};y.prototype.getRowActionElement=function(a){return d.node(this.getItemLinkId(a))};y.prototype.getLocationSpanId=function(a){return this.explorer.model.getId(a)+"_locationSpan"};y.prototype.getFileSpanId=function(a){return this.explorer.model.getId(a)+"_fileSpan"};y.prototype.getFileIconId=function(a){return this.explorer.model.getId(a)+"_fileIcon"};y.prototype.getItemLinkId=function(a){return typeof a===
"string"?a+"_itemLink":this.explorer.model.getId(a)+"_itemLink"};y.prototype.getDetailIconId=function(a){return this.explorer.model.getId(a)+"_detailIcon"};y.prototype.renderLocationElement=function(a,b){var e=b?b:d.node(this.getLocationSpanId(a));w(e);var f=this.explorer.model.getScopingParams(a),e=x("navlinkonpage",null,f.href,e,this.explorer.model._filterText?null:f.name);e.title=f.tooltip;t.addNavGrid(this.explorer.getNavDict(),a,e);var g=this;u(e,"click",function(){g.explorer.closeContextTip()});
if(this.explorer.model._filterText){var e=o("span",null,null,e),h=c.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),searchStrLength:this.explorer.model._filterText.length},f.name.toLowerCase(),!1),i=[];i.push({name:f.name,startIndex:0,bold:!1,highlight:!1});h&&h.forEach(function(a){i=this._mergesingleSegment(i,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));this._renderSegments(i,e)}};y.prototype.getPrimColumnStyle=function(){return"search_primaryColumn"};
y.prototype.getSecondaryColumnStyle=function(){return"search_secondaryColumn"};y.prototype.getCellElement=function(a,b,c){var d;switch(a){case 0:return a=o("td"),b.type==="file"?(a.noWrap=!0,this._lastFileIconDom=d=C(null,this.getFileIconId(b),a,null),this.explorer.model._provideSearchHelper&&this.explorer.model._provideSearchHelper().params.keyword===""||this.getExpandImage(c,d)):(d=C(null,null,a,null),a.noWrap=!0,a.align="right",this.renderDetailLineNumber(b,d)),a;case 1:return a=o("td"),d=C(null,
this.getFileSpanId(b),a,null),b.type==="file"?(c=b.totalMatches?this.explorer.model.getFileName(b)+" ("+b.totalMatches+" matches)":this.explorer.model.getFileName(b),this.renderFileElement(b,d,c)):(this.renderDetailElement(b,c,d),b=C(null,this.getDetailIconId(b),d,null),b=C(null,null,b,null),b.classList.add("imageSprite"),b.classList.add("core-sprite-none")),a;case 2:return a=o("td"),b.type==="file"&&(d=C(null,this.getLocationSpanId(b),a,null),b.parentLocation&&this.renderLocationElement(b,d)),a}};
y.prototype.constructor=y;B.prototype=new a.SelectionRenderer;B.prototype.getCellHeaderElement=function(a){switch(a){case 0:a=o("th","search_report",null,null);a=o("h2",null,null,a);a.textContent=j["Files replaced"];break;case 1:a=o("th","search_report",null,null),a=o("h2",null,null,a),a.textContent=j.Status}};B.prototype.getCellElement=function(a,b){switch(a){case 0:var c=o("td","search_report",null,null),d=o("div",null,null,c),e=o("span","primaryColumn",null,d);q(document.createTextNode(b.model.fullPathName+
"/"+this.explorer.resultModel.getFileName(b.model)),e,"only");u(e,"click",function(){window.open(b.model.linkLocation)});u(e,"mouseover",function(){e.style.cursor="pointer"});u(e,"mouseout",function(){e.style.cursor="default"});d=o("span",null,null,d);d.classList.add("imageSprite");if(b.status)switch(b.status){case "warning":d.classList.add("core-sprite-warning");break;case "failed":d.classList.add("core-sprite-error");break;case "pass":d.classList.add("core-sprite-ok")}return c;case 1:if(b.status){switch(b.status){case "warning":c=
b.message;break;case "failed":c=b.message;break;case "pass":c=b.model.totalMatches?f.formatMessage(j["${0} out of ${1}  matches replaced."],b.matchesReplaced,b.model.totalMatches):b.message}d=o("td","search_report",null,null);d.textContent=c;return d}}};B.prototype.constructor=B;A.prototype=new a.Explorer;A.prototype.report=function(){this.createTree(this.parentId,new a.ExplorerFlatModel(null,null,this.reportList))};A.prototype.constructor=A;F.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,
c.getTextView(),null,a,!1)}};z.prototype=new a.Explorer;z.prototype.onchange=function(){};z.prototype.setResult=function(a,b){var c=this;this.parentNode=a;this.model=b;this.model.replaceMode()?(this.checkbox=this._hasCheckedItems=!0,this.renderer=new y({checkbox:!0,highlightSelection:!1,getCheckedFunc:function(a){return c.getItemChecked(a)},onCheckedFunc:function(a,b,d){c.onRowChecked(a,b,d)}},c)):(this.checkbox=!1,this.renderer=new y({checkbox:!1,highlightSelection:!1},this));this._reporting=!1;
this._currentPreviewModel=this._uiFactory=null;this._currentReplacedContents={contents:null};this._popUpContext=!1;this.timerRunning-=0;this.twoWayCompareView=this._filterTimer=this._timer=null};z.prototype.declareCommands=function(){var b=this,d=new g.Command({name:j["Apply Changes"],tooltip:j["Replace all selected matches"],id:"orion.globalSearch.replaceAll",callback:function(){b.replaceAll()},visibleWhen:function(){return b.model&&b.model.replaceMode()&&!b._reporting&&b._hasCheckedItems}}),e=new g.Command({name:j["Hide Compare"],
tooltip:j["Hide compare view of changes"],id:"orion.globalSearch.hideCompare",callback:function(){b.toggleCompare(!1)},visibleWhen:function(){return b.model&&b.model.replaceMode()&&!b._reporting&&b._uiFactory}}),f=new g.Command({name:j["Show Compare"],tooltip:j["Show compare view of changes"],id:"orion.globalSearch.showCompare",callback:function(){b.toggleCompare(!0)},visibleWhen:function(){return b.model&&b.model.replaceMode()&&!b._reporting&&!b._uiFactory}});this._commandService.addCommand(e);this._commandService.addCommand(f);
this._commandService.addCommand(d);this._commandService.addCommandGroup("pageActions","orion.searchActions.unlabeled",200);this._commandService.registerCommandContribution("pageActions","orion.globalSearch.hideCompare",1,"orion.searchActions.unlabeled");this._commandService.registerCommandContribution("pageActions","orion.globalSearch.showCompare",2,"orion.searchActions.unlabeled");this._commandService.registerCommandContribution("pageActions","orion.globalSearch.replaceAll",3,"orion.searchActions.unlabeled");
var d=new g.Command({name:j["Show All"],tooltip:j["Show all the results in one page"],id:"orion.search.showAll",hrefCallback:function(){if(!this.model._provideSearchHelper)return null;var a=c.copySearchParams(this.model._provideSearchHelper().params,!0);a.start=0;a.rows=this.model.getPagingParams().totalNumber;return c.generateSearchHref(a)}.bind(this),visibleWhen:function(){var a=this.model.getPagingParams();return!this._crawling&&a.totalNumber>a.rows}.bind(this)}),e=new g.Command({name:j["< Previous Page"],
tooltip:j["Show previous page of search result"],id:"orion.search.prevPage",hrefCallback:function(){if(!b.model._provideSearchHelper)return null;var a=b.caculatePrevPage(),d=c.copySearchParams(b.model._provideSearchHelper().params,!0);d.start=a.start;return c.generateSearchHref(d)},visibleWhen:function(){var a=b.caculatePrevPage();return!this._crawling&&a.start!==b.model.getPagingParams().start}.bind(this)}),f=new g.Command({name:j["Next Page >"],tooltip:j["Show next page of search result"],id:"orion.search.nextPage",
hrefCallback:function(){if(!b.model._provideSearchHelper)return null;var a=b.caculateNextPage(),d=c.copySearchParams(b.model._provideSearchHelper().params,!0);d.start=a.start;return c.generateSearchHref(d)},visibleWhen:function(){var a=b.caculateNextPage();return!this._crawling&&a.start!==b.model.getPagingParams().start}.bind(this)}),h=new g.Command({tooltip:j["Next result"],imageClass:"core-sprite-move-down",id:"orion.search.nextResult",groupId:"orion.searchGroup",visibleWhen:function(){return!b._reporting},
callback:function(){b.gotoNext(!0,!0)}}),i=new g.Command({tooltip:j["Previous result"],imageClass:"core-sprite-move-up",id:"orion.search.prevResult",groupId:"orion.searchGroup",visibleWhen:function(){return!b._reporting},callback:function(){b.gotoNext(!1,!0)}});this._commandService.addCommand(d);this._commandService.addCommand(e);this._commandService.addCommand(f);this._commandService.addCommand(h);this._commandService.addCommand(i);a.createExplorerCommands(this._commandService,function(a){var c=
!1;b.model._provideSearchHelper&&b.model._provideSearchHelper().params.keyword===""&&(c=!0);return!a._reporting&&!c});this._commandService.registerCommandContribution("pageNavigationActions","orion.explorer.expandAll",1);this._commandService.registerCommandContribution("pageNavigationActions","orion.explorer.collapseAll",2);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.nextResult",3);this._commandService.registerCommandContribution("pageNavigationActions",
"orion.search.prevResult",4);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.showAll",5);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.prevPage",6);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.nextPage",7)};z.prototype._checkStale=function(a){return this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location),"Checing file "+a.location+" for stale").then(function(b){if(this.model.staleCheck(b))a.stale=
!1}.bind(this),function(a){console.error("Error loading file contents: "+a.message);throw a;}.bind(this))};z.prototype.staleCheck=function(){var a=[];D(this.model).forEach(function(b){a.push(this._loadFileMetaData(b))}.bind(this));return i.all(a,function(a){return{_error:a}})};z.prototype._loadFileMetaData=function(a){return this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location,!0),"Getting file metadata "+a.location).then(function(b){a.fullPathName=c.fullPathNameByMeta(b.Parents);
a.parentLocation=b.Parents[0].Location;a.stale=a.lastModified!==b.LocalTimeStamp;a.ETag=b.ETag;if(a.stale)return this._checkStale(a).then(function(){this.renderer.staleFileElement(a)}.bind(this));else this._prepareFilter(a);return a}.bind(this),function(b){console.error("Error loading file metadata: status "+b.status);a.stale=!0;this.renderer.staleFileElement(a);throw b;}.bind(this))};z.prototype.setCrawling=function(a){this._crawling=a};z.prototype.preview=function(){var a=this;this._commandService.openParameterCollector("pageActions",
function(b){var c=o("input",null,"globalSearchReplaceWith",b);c.type="text";c.name="ReplaceWith:";c.placeholder="Replace With";c.onkeydown=function(b){if(b.keyCode===13)return b=d.node("globalSearchReplaceWith"),a._commandService.closeParameterCollector(),a._doPreview(b.value);if(b.keyCode===27)return a._commandService.closeParameterCollector(),!1};o("span","parameters","globalSearchReplaceCommands",b);return c});var b=document.getElementById("globalSearchReplaceWith");b.value=this.model.defaultReplaceStr;
window.setTimeout(function(){b.select();b.focus()},10);this._commandService.addCommand(new g.Command({name:"Preview Changes",image:k.toUrl("images/replaceAll.gif"),id:"orion.globalSearch.innerReplaceAll",groupId:"orion.searchGroup",callback:function(){var b=d.node("globalSearchReplaceWith");a._commandService.closeParameterCollector();return a._doPreview(b.value)}}));this._commandService.registerCommandContribution("globalSearchReplaceCommands","orion.globalSearch.innerReplaceAll",1);this._commandService.renderCommands("globalSearchReplaceCommands",
"globalSearchReplaceCommands",this,this,"button")};z.prototype._fileExpanded=function(a,b){var c=D(this.model)[a];if(b===null||b===void 0)return{childrenNumber:0,childDiv:d.node(this.model.getId(c))};return c.children&&c.children.length>0?(b<0?b=c.children.length-1:b>=c.children.length&&(b=0),{childrenNumber:c.children.length,childDiv:d.node(this.model.getId(c.children[b]))}):{childrenNumber:0,childDiv:null}};z.prototype._doPreview=function(a,b){if(this.model._provideSearchHelper){this.model._storeGlobalStatus&&
this.model._storeGlobalStatus(a);var d=c.copySearchParams(this.model._provideSearchHelper().params,!0);d.replace=a;if(b)d.start=0,d.rows=this.model.getPagingParams().totalNumber;d=c.generateSearchHref(d);window.location.href=d}};z.prototype.searchAgain=function(){if(this.model._provideSearchHelper){var a=c.copySearchParams(this.model._provideSearchHelper().params,!0);a.replace=null;if(a.rows>this.defaulRows)a.rows=this.defaulRows;a=c.generateSearchHref(a);a===window.location.href?window.location.reload():
window.location.href=a}};z.prototype.replaceAll=function(){var a=[],b=this;this._reporting=!0;this.initCommands();this.reportStatus(j["Writing files..."]);this.model.writeReplacedContents(a).then(function(){w(b.getParentDivId());(new A(b.getParentDivId(),a,b.model)).report();b.reportStatus("")})};z.prototype.toggleCompare=function(a){this.replacePreview(!1,a)};z.prototype.replacePreview=function(a,b){w(this.getParentDivId());b?(this._uiFactory=new l.SearchUIFactory({parentDivID:this.getParentDivId()}),
this._uiFactory.buildUI()):(this._uiFactory&&this._uiFactory.destroy(),this._uiFactory=null);this._currentPreviewModel=this.twoWayCompareView=null;this.initCommands();a&&this.reportStatus(j["Preparing preview..."]);var c=this;this.createTree(this._uiFactory?this._uiFactory.getMatchDivID():this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,onCollapse:function(a){c.onCollapse(a)}});a?(this.gotoCurrent(this.model.restoreLocationStatus?this.model.restoreLocationStatus():null),this.reportStatus(""),
!this._crawling&&this.model.staleCheck&&this.staleCheck().then(function(){c.refreshValidFiles()})):this.gotoCurrent(this.model.restoreLocationStatus?this.model.restoreLocationStatus():null)};z.prototype.getItemChecked=function(a){if(a.checked===void 0)a.checked=!0;return a.checked};z.prototype._checkedItem=function(){for(var a=D(this.model),b=0;b<a.length;b++){if(a[b].checked)return!0;if(a[b].children)for(var c=0;c<a[b].children.length;c++)if(a[b].children[c].checked)return!0}return!1};z.prototype.onRowChecked=
function(a,b,c){if(a){if((a=d.node(a))&&a._item)this.onItemChecked(a._item,b,c);a=this._checkedItem()}else a=b,this.onItemChecked(this.model.getListRoot(),b,c);if(a!==this._hasCheckedItems)this._hasCheckedItems=a,this.initCommands()};z.prototype.onNewContentChanged=function(a){a===E(this.getNavHandler().currentModel())&&this.buildPreview(!0)};z.prototype.onItemChecked=function(a,b,c){a.checked=b;if(a.type==="file"||a===this.model.getListRoot()){if(a.children)for(c=0;c<a.children.length;c++){var e=
d.node(this.renderer.getCheckBoxId(this.model.getId(a.children[c])));if(e)this.renderer.onCheck(null,e,b,!1);else a.children[c].checked=b}if(a.type==="file")this.onNewContentChanged(a)}else if(c)this.onNewContentChanged(a.parent)};z.prototype.buildPreview=function(a){if(this._uiFactory&&D(this.model).length!==0){var b=this._uiFactory,c=E(this.getNavHandler().currentModel());this._currentPreviewModel=c;var d=this;this.model.provideFileContent(c,function(c){if(d.model.onMatchNumberChanged)d.model.onMatchNumberChanged(c);
d.model.getReplacedFileContent(d._currentReplacedContents,a,c);var e=d._currentReplacedContents.contents;Array.isArray(e)&&(e=d._currentReplacedContents.contents.join(d._currentReplacedContents.lineDelim));var g=d.model.getFileName(c),h=d._contentTypeService.getFilenameContentType(g),c={readonly:!0,hasConflicts:!1,newFile:{Name:c.location,Type:h,Content:d.model.getFileContents(c)},oldFile:{Name:c.location,Type:h,Content:e}};d.twoWayCompareView?(d.twoWayCompareView.setOptions(c),d.twoWayCompareView.refresh(!0)):
(d.uiFactoryCompare=new m.TwoWayCompareUIFactory({parentDivID:b.getCompareDivID(),showTitle:!0,rightTitle:f.formatMessage(j["Replaced File (${0})"],g),leftTitle:f.formatMessage(j["Original File (${0})"],g),showLineStatus:!1}),d.uiFactoryCompare.buildUI(),c.uiFactory=d.uiFactoryCompare,c.parentDivID=b.getCompareDivID(),d.twoWayCompareView=new n.TwoWayCompareView(c),d.twoWayCompareView.setOptions({highlighters:[new F(d.registry),new F(d.registry)]}),d.twoWayCompareView.startup(),d._uiFactory.setCompareWidget(d.twoWayCompareView));
w(d.uiFactoryCompare.getTitleDiv());q(document.createTextNode(f.formatMessage(j["Replaced File (${0})"],g)),d.uiFactoryCompare.getTitleDiv(),"only");w(d.uiFactoryCompare.getTitleDiv(!0));q(document.createTextNode(f.formatMessage(j["Original File (${0})"],g)),d.uiFactoryCompare.getTitleDiv(!0),"only");window.setTimeout(function(){d.renderer.focus()},100)})}};z.prototype.addSavedSearch=function(a,b){this.registry.getService("orion.core.savedSearches").addSearch(a,b)};z.prototype.saveSearch=function(a){if(this.model._provideSearchHelper){var b=
c.generateSearchHref(a).split("#")[1],d=b;typeof this.model._provideSearchHelper().displayedSearchTerm==="string"&&typeof a.resource==="string"?(d="'"+this.model._provideSearchHelper().displayedSearchTerm+"' in ",a.resource.length>0?this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.resource,!0),"Getting file metadata "+a.resource).then(function(a){var e=c.fullPathNameByMeta(a.Parents);this.addSavedSearch(d+(e.length===0?a.Name:e+"/"+a.Name),b)}.bind(this),function(a){console.error("Error loading file meta data: "+
a.message);this.addSavedSearch(d+"root",b)}.bind(this)):this.addSavedSearch(d+"root",b)):this.addSavedSearch(d,b)}};z.prototype.caculateNextPage=function(){var a=this.model.getPagingParams();return a.start+a.rows>=a.totalNumber?{start:a.start}:{start:a.start+a.rows}};z.prototype.caculatePrevPage=function(){var a=this.model.getPagingParams(),a=a.start-a.rows;a<0&&(a=0);return{start:a}};z.prototype.initCommands=function(){this._commandService.destroy("pageActions");this._commandService.renderCommands("pageActions",
"pageActions",this,this,"button");this._commandService.destroy("pageNavigationActions");this._commandService.renderCommands("pageNavigationActions","pageNavigationActions",this,this,"button")};z.prototype.reportStatus=function(a){this.registry.getService("orion.page.message").setProgressMessage(a)};z.prototype.isExpanded=function(a){return this.myTree.isExpanded(this.model.getId(a))};z.prototype.popupContext=function(a){if(this.contextTip)this.contextTip.destroy(),this.contextTip=null;var b=this.renderer.getDetailIconId(a),
a=this.renderer.generateContextTip(a),b=d.node(b),c=["below","right"];if(b)for(var e=this.myTree._parent.getClientRects()[0],f=b.getClientRects(),g=0,h=f.length;g<h;g++)if(f[g].bottom+100>e.bottom){c=["above","right"];break}this.contextTip=new r.Tooltip({node:b,showDelay:0,trigger:"none",position:c});this.contextTip.contentContainer().appendChild(a);this.contextTip.show()};z.prototype.closeContextTip=function(a){if(!this.model.replaceMode()){if(this.contextTip)this.contextTip.destroy(),this.contextTip=
null;if(!a)this._popUpContext=!1;this.renderer.replaceDetailIcon(this.getNavHandler().currentModel(),"right")}};z.prototype.onCollapse=function(a){var b=this.getNavHandler().currentModel();b&&b.type==="detail"&&E(a)===a&&this.getNavHandler().cursorOn(a)};z.prototype.onExpand=function(a,b){if(a&&a.children&&a.children.length>0&&typeof b==="string"){var c=0,c=b==="first"?0:b==="last"?a.children.length-1:JSON.parse(b);if(typeof c==="string"||c<0||c>=a.children.length)c=0;this.getNavHandler().cursorOn(a.children[c])}};
z.prototype.forceExpandFunc=function(a,b,c){this.myTree.expand(a,function(){this.onExpand(a,b,c)}.bind(this));return null};z.prototype.keyEventListeningDiv=function(a){return d.node(this.getParentDivId(a))};z.prototype.onFocus=function(a){a||this.closeContextTip()};z.prototype.preventDefaultFunc=function(a,b){if(!b)return!0;if(!this.model.replaceMode()&&!a.ctrlKey&&b.type==="detail"){if(a.keyCode===37&&this._popUpContext)return this.closeContextTip(),a.preventDefault(),!0;if(a.keyCode===39&&!this._popUpContext)return this._popUpContext=
!0,this.renderer.replaceDetailIcon(b,"left"),this.popupContext(b),a.preventDefault(),!0}return!1};z.prototype.onReplaceCursorChanged=function(a,b){E(this._currentPreviewModel)===E(b)||this.buildPreview();if(b.type==="detail"){var c=this.model.getDetailInfo(b);this.twoWayCompareView.gotoDiff(c.lineNumber,c.matches[c.matchNumber].startIndex,!1)}};z.prototype.onCursorChanged=function(a,b){this.renderer.replaceDetailIcon(a,"none");this.model.storeLocationStatus&&this.model.storeLocationStatus(b);var c=
this;if(this.model.replaceMode()){if(this._uiFactory)if(this._timer){if(this.timerRunning)window.clearTimeOut(this._timer),this._timer=window.setTimeout(function(){c.onReplaceCursorChanged(a,b);c.timerRunning=!1;c._timer=null},500)}else this._timer=window.setTimeout(function(){c.onReplaceCursorChanged(a,b);c.timerRunning=!1;c._timer=null},500)}else b.type==="detail"?this._popUpContext?(this.popupContext(b),this.renderer.replaceDetailIcon(b,"left")):this.renderer.replaceDetailIcon(b,"right"):this._popUpContext&&
this.closeContextTip(!0)};z.prototype._prepareFilter=function(a){this._validateFilter()&&(a?this.model.getChildren(a,function(){}):D(this.model).forEach(function(a){this.model.getChildren(a,function(){})}.bind(this)))};z.prototype._validateFilter=function(){return!this.model.replaceMode()&&typeof this.model.filterOn==="function"};z.prototype._startUp=function(){var a=w("filterBox");if(this.model.getPagingParams().numberOnPage===0){if(a)a.style.visibility="hidden";a=j["No matches"];this.model._provideSearchHelper&&
(a=f.formatMessage(j["No matches found for ${0}"],this.model._provideSearchHelper().displayedSearchTerm));this.parentNode.textContent="";var b=o("b",null,null,this.parentNode);q(document.createTextNode(a),b,"only");this.reportStatus("")}else{var c=this;if(a&&this._validateFilter()){a.style.visibility="visible";var d=o("input",["search-control","search-filter-input"],null,a);d.type="text";d.placeholder=j["Type filter text"];d.addEventListener("input",function(){this._filterTimer&&window.clearTimeout(this._filterTimer);
this._filterTimer=window.setTimeout(function(){this._filterTimer=null;this._renderFiltered(d.value)}.bind(this),1E3)}.bind(this))}this.model.buildResultModel();this.model.replaceMode()?c.replacePreview(!0,!0):(this.initCommands(),w(this.getParentDivId()),this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,getChildrenFunc:function(a){return this.model.getFilteredChildren(a)}.bind(this),onCollapse:function(a){c.onCollapse(a)}}),this.gotoCurrent(this.model.restoreLocationStatus?
this.model.restoreLocationStatus():null),this.reportStatus(""),!this._crawling&&this.model.staleCheck?this.staleCheck().then(function(){c.refreshValidFiles()}):c._prepareFilter())}};z.prototype.startUp=function(){if(this._openWithCommands)this._startUp();else{var a=v.createOpenWithCommands(this.registry,this._contentTypeService,this._commandService);i.when(a,function(a){this._openWithCommands=a;this._startUp()}.bind(this))}};z.prototype._incrementalRender=function(){var a=this;this.model.buildResultModel();
this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",getChildrenFunc:function(a){return this.model.getFilteredChildren(a)}.bind(this),indent:0,onCollapse:function(b){a.onCollapse(b)}})};z.prototype.incrementalRender=function(){if(this._openWithCommands)this._incrementalRender();else{var a=v.createOpenWithCommands(this.registry,this._contentTypeService,this._commandService);i.when(a,function(a){this._openWithCommands=a;this._incrementalRender()}.bind(this))}};z.prototype._renderFiltered=
function(a){this.model.filterOn(a);this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,onCollapse:function(a){this.onCollapse(a)}.bind(this)});a&&this.expandAll()};z.prototype.refreshValidFiles=function(){for(var a=[],b=E(this.getNavHandler().currentModel()),c=D(this.model),d=0;d<c.length;d++)c[d].stale?b===c[d]&&(b=null):a.push(c[d]);this.model.setValidFileList&&this.model.setValidFileList(a);D(this.model).length===0?(this.getNavHandler().refreshModel(this.getNavDict(),
this.model,D(this.model)),this.getNavHandler().cursorOn(null,!0)):b?this.getNavHandler().refreshModel(this.getNavDict(),this.model,D(this.model),!0):(this.getNavHandler().cursorOn(null,!0),this.getNavHandler().refreshModel(this.getNavDict(),this.model,D(this.model)),this.gotoCurrent())};z.prototype.getItemCount=function(){return this.model.getListRoot().children.length};z.prototype.getParentDivId=function(a){return!this.model.replaceMode()||!a?this.parentNode.id:this._uiFactory?this._uiFactory.getMatchDivID():
this.parentNode.id};z.prototype.gotoCurrent=function(a){var b=null,c="none";a?(b=a.file,c=a.detail):b=this.getNavHandler().currentModel();b||(b=D(this.model).length>0?D(this.model)[0]:null);this.getNavHandler().cursorOn(b,!0);b&&c&&c!=="none"&&this.myTree.expand(b,function(){this.onExpand(b,c)}.bind(this))};z.prototype.gotoNext=function(a,b){D(this.model).length!==0&&this.getNavHandler().iterate(a,b)};z.prototype.constructor=z;return{SearchResultExplorer:z}});
define("orion/searchModel","i18n!orion/search/nls/messages,require,orion/Deferred,orion/i18nUtil,orion/explorers/explorer,orion/searchUtils".split(","),function(j,k,i,d,b,f){function a(a,b,d,c,i,j){this.registry=a;this.fileClient=b;this._resultLocation=d;this._numberOnPage=d.length;this._totalNumber=c;this._listRoot={isRoot:!0,children:[]};this._filteredRoot={isRoot:!0,children:[]};this._filterText=null;this._indexedFileItems=[];this._location2ModelMap=[];this._lineDelimiter="\n";this.onMatchNumberChanged=
j.onMatchNumberChanged;this._searchHelper=f.generateSearchHelper(i)}a.prototype=new b.ExplorerModel;a.prototype.getRoot=function(a){a(this.getListRoot())};a.prototype.getChildren=function(a,b){a&&(a.type==="file"&&this._filterText?a.filteredChildren?b(a.filteredChildren):b([]):a.children?b(a.children):a.type==="detail"?b([]):a.type==="file"&&a.location?this._searchHelper.params.keyword!==""&&this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location),"Getting file contents "+
a.name).then(function(d){f.searchWithinFile(this._searchHelper.inFileQuery,a,d,this._lineDelimiter,this.replaceMode(),this._searchHelper.params.caseSensitive);if(this.onMatchNumberChanged)this.onMatchNumberChanged(a);b(a.children)}.bind(this),function(a){console.error("Error loading file content: "+a.message);b([])}.bind(this)):b([]))};a.prototype.getId=function(a){a===this.getListRoot()?a=this.rootId:(a=a.location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""));return a};a.prototype.getListRoot=function(){return this._filterText?
this._filteredRoot:this._listRoot};a.prototype.buildResultModel=function(){this._restoreGlobalStatus();this._indexedFileItems=[];this.getListRoot().children=[];for(var a=0;a<this._resultLocation.length;a++){var b={parent:this.getListRoot(),type:"file",name:this._resultLocation[a].name,lastModified:this._resultLocation[a].lastModified,linkLocation:this._resultLocation[a].linkLocation,location:this._resultLocation[a].location,parentLocation:f.path2FolderName(this._resultLocation[a].location,this._resultLocation[a].name,
!0),fullPathName:f.path2FolderName(this._resultLocation[a].path,this._resultLocation[a].name)};this._location2ModelMap[b.location]=b;this.getListRoot().children.push(b);this._indexedFileItems.push(b)}};a.prototype.replaceMode=function(){return typeof this._searchHelper.params.replace==="string"};a.prototype.getPagingParams=function(){return{totalNumber:this._totalNumber,start:this._searchHelper.params.start,rows:this._searchHelper.params.rows,numberOnPage:this._numberOnPage}};a.prototype.getScopingParams=
function(a){var b=f.copySearchParams(this._searchHelper.params,!0);b.resource=a.parentLocation;b.start=0;var b=f.generateSearchHref(b),g=d.formatMessage(j['Search again in this folder with "${0}"'],this._searchHelper.displayedSearchTerm);return{name:a.fullPathName,href:b,tooltip:g}};a.prototype.getDetailInfo=function(a){return{lineString:a.name,lineNumber:a.lineNumber-1,matches:a.matches,matchNumber:a.matchNumber?a.matchNumber-1:0}};a.prototype.getFileName=function(a){return a.name};a.prototype.provideFileContent=
function(a,b){this._provideFileContent(a).then(function(){b(a)})};a.prototype._provideFileContent=function(a){return a.contents?(new i).resolve(a):this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location),"Getting file contents "+a.Name).then(function(b){f.searchWithinFile(this._searchHelper.inFileQuery,a,b,this._lineDelimiter,this.replaceMode(),this._searchHelper.params.caseSensitive);return a}.bind(this),function(b){console.error("Error loading file content: "+b.message);
return a}.bind(this))};a.prototype.getFileContents=function(a){return a.contents.join(this._lineDelimiter)};a.prototype.getReplacedFileContent=function(a,b,d){f.generateNewContents(b,d.contents,a,d,this._searchHelper.params.replace,this._searchHelper.inFileQuery.searchStrLength);a.lineDelim=this._lineDelimiter};a.prototype.writeReplacedContents=function(a){var b=[];this.getValidFileList().forEach(function(d){b.push(this._writeOneFile(d,a))}.bind(this));return i.all(b,function(a){return{_error:a}})};
a.prototype.getHeaderString=function(){var a=j.Results;if(this._searchHelper.displayedSearchTerm){var b=this.getPagingParams();if(b.numberOnPage>0)var a=b.start+1,f=a+b.numberOnPage-1,a=this.replaceMode()?d.formatMessage(j["Replace ${0} with ${1} for files ${2} of ${3}"],this._searchHelper.displayedSearchTerm,this._searchHelper.params.replace,a+"-"+f,b.totalNumber):d.formatMessage(j["Files ${0} of ${1} matching ${2}"],a+"-"+f,b.totalNumber,this._searchHelper.displayedSearchTerm)}return a};a.prototype.getValidFileList=
function(){return this._indexedFileItems};a.prototype.setValidFileList=function(a){this._indexedFileItems=a};a.prototype.storeLocationStatus=function(a){if(a){var b;b=a?a.type==="file"?a:a.parent:null;if(b)window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentFileLocation"]=b.location,window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentDetailIndex"]=a.type==="file"?"none":JSON.stringify(this._model2Index(a))}};a.prototype.restoreLocationStatus=function(){var a=
this._location2Model(window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentFileLocation"]),b="none",d=window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentDetailIndex"];typeof d==="string"&&d.length>0&&(b=d);return{file:a,detail:b}};a.prototype.staleCheck=function(a){a=a.toLowerCase();return this._searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this._searchHelper.inFileQuery,a,!0):f.searchOnelineLiteral(this._searchHelper.inFileQuery,a,!0)};
a.prototype.filterOn=function(a){if(this._filterText=a){var b=this._filterText.toLowerCase();this._filteredRoot.children=[];this._indexedFileItems.forEach(function(a){var c=!1;if(this._filterSingleString(a.name,b)||this._filterSingleString(a.fullPathName,b))c=!0;if(a.children)a.filteredChildren=[],a.children.forEach(function(d){this._filterSingleString(d.name,b)&&(a.filteredChildren.push(d),c=!0)}.bind(this));c&&this._filteredRoot.children.push(a)}.bind(this))}};a.prototype.getFilteredChildren=function(a){if(a.type===
"file"&&this._filterText&&a.filteredChildren)return a.filteredChildren;else if(a.isRoot&&this._filterText)return this._filteredRoot.children;return a.children};a.prototype._provideSearchHelper=function(){return this._searchHelper};a.prototype._filterSingleString=function(a,b){return a.toLowerCase().indexOf(b)>=0};a.prototype._model2Index=function(a,b){var d=b;if(!d&&a.parent)d=a.parent.children;if(d)for(var c=0;c<d.length;c++)if(d[c]===a)return c;return-1};a.prototype._location2Model=function(a){return a&&
this._location2ModelMap[a]?this._location2ModelMap[a]:this._indexedFileItems.length>0?this._indexedFileItems[0]:null};a.prototype._restoreGlobalStatus=function(){this.defaultReplaceStr=this._searchHelper.displayedSearchTerm;var a=window.sessionStorage.global_search_default_replace_string;if(typeof a==="string"&&a.length>0)this.defaultReplaceStr=a;this.sortByName=this._provideSearchHelper().params.sort.indexOf("Name")>-1};a.prototype._storeGlobalStatus=function(a){window.sessionStorage.global_search_default_replace_string=
a};a.prototype._writeOneFile=function(a,b){var d=this._matchesReplaced(a);return d>0?this._provideFileContent(a).then(function(){d=this._matchesReplaced(a);var c={};f.generateNewContents(!1,a.contents,c,a,this._searchHelper.params.replace,this._searchHelper.inFileQuery.searchStrLength);var c=c.contents.join(this._lineDelimiter),i=a.ETag,i=i?{ETag:i}:null;return this.registry.getService("orion.page.progress").progress(this.fileClient.write(a.location,c,i),"Saving changes to "+a.location).then(function(){b.push({model:a,
matchesReplaced:d,status:"pass"})}.bind(this),function(c){c.status===412?b.push({model:a,message:j["Resource has been changed by others."],matchesReplaced:d,status:"failed"}):(c.log=!0,b.push({model:a,message:j["Failed to write file."],matchesReplaced:d,status:"failed"}))}.bind(this))}.bind(this)):(new i).resolve(a)};a.prototype._matchesReplaced=function(a){var b=0;if(!a.children)return a.checked===!1?0:1;if(a.children)for(var d=0;d<a.children.length;d++)a.children[d].checked!==!1&&(b+=1);return b};
a.prototype.constructor=a;return{SearchResultModel:a}});
define("orion/searchResults","i18n!orion/search/nls/messages,orion/i18nUtil,require,orion/webui/littlelib,orion/searchExplorer,orion/searchModel,orion/searchUtils,orion/crawler/searchCrawler".split(","),function(j,k,i,d,b,f,a,e){function h(a,c,d,e,f,h){this.registry=a;this.fileService=e;this.resultsId=c;this.commandService=d;this.searcher=f;this.crawling=h;this.explorer=new b.SearchResultExplorer(this.registry,this.commandService)}h.prototype={_renderSearchResult:function(a,b,e,h,j){var k=!1,t=[];
d.empty(d.node(b));if(h.response.numFound>0)for(var r=0;r<h.response.docs.length;r++){var s=h.response.docs[r];if(!s.Directory){k||(k=!0);var v=s.Location;t.push({linkLocation:i.toUrl("edit/edit.html")+"#"+v,location:v,path:s.Path?s.Path:v,name:s.Name,lastModified:s.LastModified})}}this.explorer.setCrawling(a);var w=this,a=new f.SearchResultModel(this.registry,this.explorer.fileClient,t,h.response.numFound,e,{onMatchNumberChanged:function(a){w.explorer.renderer.replaceFileElement(a)}});this.explorer.setResult(b,
a);j?this.explorer.incrementalRender():this.explorer.startUp()},_search:function(a,b){this.crawling=b.regEx||b.caseSensitive;var f=d.node(this.resultsId),h=this;d.empty(d.node("pageNavigationActions"));d.empty(d.node("pageActions"));if(typeof b.keyword==="undefined")d.empty(f);else if(this.crawling)d.empty(f),f.appendChild(document.createTextNode("")),f=new e.SearchCrawler(this.registry,this.fileService,b,{childrenLocation:this.searcher.getChildrenLocation()}),f.search(function(d,e){h._renderSearchResult(!0,
a,b,d,e)});else{d.empty(f);this.registry.getService("orion.page.message").setProgressMessage(j["Searching..."]);try{this.registry.getService("orion.page.progress").progress(this.fileService.search(b),"Searching "+b.keyword).then(function(d){this.registry.getService("orion.page.message").setProgressMessage("");this._renderSearchResult(!1,a,b,d)}.bind(this),function(a){a=k.formatMessage(j["${0}. Try your search again."],a&&a.error?a.error:"Error");this.registry.getService("orion.page.message").setProgressResult({Message:a,
Severity:"Error"})}.bind(this))}catch(i){d.empty(f),f.appendChild(document.createTextNode("")),typeof i==="string"&&i.indexOf("search")>-1?(f=new e.SearchCrawler(this.registry,this.fileService,b,{childrenLocation:this.searcher.getChildrenLocation()}),f.search(function(d,e){h._renderSearchResult(!0,a,b,d,e)})):this.registry.getService("orion.page.message").setErrorMessage(i)}}},loadResults:function(a){this._search(d.node(this.resultsId),a)}};h.prototype.constructor=h;return{SearchResultsGenerator:h}});
define('built-search.js',"i18n!orion/search/nls/messages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/dialogs,orion/commandRegistry,orion/searchOutliner,orion/searchClient,orion/fileClient,orion/operationsClient,orion/searchResults,orion/globalCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/webui/littlelib".split(","),function(j,k,i,d,b,f,a,e,h,g,c,l,m,n,p,t,r,s){function v(a,b,c,d,e){a=!c||c===""||c==="root"?e.getSearchRootLocation():c;d=t.copySearchParams(d);
d.resource=a;b.href=t.generateSearchHref(d)}function w(a,b,c,d,e,f,g,h){var i=g.resource,k=g.replace?j["Replace All Matches"]:j["Search Results"];i?i===b.fileServiceRootURL(i)?(d.setRootLocationbyURL(i),d.setLocationbyURL(i),n.setPageTarget({task:"Search",title:k,serviceRegistry:a,commandService:c,searchService:d,fileService:b,breadcrumbRootName:b.fileServiceName(i),makeBreadcrumbLink:function(a,c){v(b,a,c,g,d)}}),d.setChildrenLocationbyURL(i),f.loadSearchParams(g),e.loadResults(g)):h.progress(b.read(i,
!0),"Loading file metadata "+i).then(function(h){n.setPageTarget({task:"Search",title:k,target:h,serviceRegistry:a,fileService:b,commandService:c,searchService:d,breadcrumbRootName:"Search",makeBreadcrumbLink:function(a,c){v(b,a,c,g,d)}});f.loadSearchParams(g);e.loadResults(g)}.bind(this),function(a){window.console.error("Error loading file metadata: "+a.message)}.bind(this)):(n.setPageTarget({task:"Search",title:k,serviceRegistry:a,commandService:c,searchService:d,fileService:b,breadcrumbRootName:"Search",
makeBreadcrumbLink:function(a,c){v(b,a,c,g,d)}}),f.loadSearchParams(g),e.loadResults(g))}d.startup().then(function(d){var i=d.serviceRegistry,d=d.preferences;new a.DialogService(i);var j=new l.OperationsClient(i);new b.StatusReportingService(i,j,"statusPane","notifications","notificationArea");var k=new e.CommandRegistry({}),v=new f.ProgressService(i,j,k);new h.SavedSearches({serviceRegistry:i});var E=new c.FileClient(i);new p.ContentTypeRegistry(i);var D=new g.Searcher({serviceRegistry:i,commandService:k,
fileService:E});new h.SearchOutliner({parent:"searchProgress",serviceRegistry:i,commandService:k});var y=new h.SearchBuilder({parent:"searchBuilder",searcher:D,serviceRegistry:i,commandService:k});n.generateBanner("orion-searchResults",i,k,d,D,D,null,!1);var B=new m.SearchResultsGenerator(i,"results",k,E,D,!1),A=function(){var a=s.node("filterBox");a&&s.empty(a);a=r.matchResourceParameters();t.convertSearchParams(a);w(i,E,k,D,B,y,a,v);if(a=document.getElementById("pageActions"))k.destroy(a),k.renderCommands(a.id,
a,D,D,"button")};window.addEventListener("hashchange",function(){A()},!0);A()})});