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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*
 * Copyright 2012, Mozilla Foundation and contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*******************************************************************************
 * @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:
 *     Kris De Volder (VMWare) - 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).
 *******************************************************************************/

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

/*

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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:
 Kris De Volder (VMWare) - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 Kris De Volder (VMWare) - 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, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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) 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:
 Kris De Volder (VMWare) - 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) 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 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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:
 Kris De Volder (VMWare) - initial API and implementation
*/
(function(){function j(c,g,b,k,a,f){g[c]&&(b.push(c),(g[c]===!0||g[c]===1)&&k.push(a+c+"/"+f))}function i(c,g,b,k,a){g=k+g+"/"+a;require._fileExists(c.toUrl(g+".js"))&&b.push(g)}function h(c,g,b){for(var k in g)g.hasOwnProperty(k)&&(!c.hasOwnProperty(k)||b)?c[k]=g[k]:typeof g[k]==="object"&&h(c[k],g[k],b)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var g=c.config?c.config():{};return{version:"2.0.1+",load:function(b,k,a,f){f=f||{};if(f.locale)g.locale=f.locale;
var d=e.exec(b),l=d[1],c=d[4],o=d[5],n=c.split("-"),p=[],w={},q,v="";if(d[5])l=d[1],b=l+o;else{o=d[4];c=g.locale;if(!c)c=g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();n=c.split("-")}if(f.isBuild){p.push(b);i(k,"root",p,l,o);for(q=0;q<n.length;q++)f=n[q],v+=(v?"-":"")+f,i(k,v,p,l,o);k(p,function(){a()})}else k([b],function(f){var d=[],b;j("root",f,d,p,l,o);for(q=0;q<n.length;q++)b=n[q],v+=(v?"-":"")+b,j(v,f,d,p,l,o);k(p,function(){var b,
c,m;for(b=d.length-1;b>-1&&d[b];b--){m=d[b];c=f[m];if(c===!0||c===1)c=k(l+m+"/"+o);h(w,c)}a(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,i,h,e){var e=e||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,g=c.exec(j);if(g)if(i.defined(j))h(i(j));else if(e.isBuild||e.isTest)h({});else{var b=g[1],k=g[3]?g[2]:"",a=g[3]||g[2];i(["orion/bootstrap"],function(f){f.startup().then(function(f){var l=f.serviceRegistry,f=l.getServiceReferences("orion.i18n.message");if(k)f.some(function(a){return j===a.getProperty("name")?(l.getService(a).getMessageBundle().then(function(a){h(a)},function(){h({})}),
!0):!1})||h({});else{var m={},o;f.forEach(function(f){var d=f.getProperty("name");if((g=c.exec(d))&&b===g[1]&&a===(g[3]||g[2]))if(k=g[3]?g[2]:""){if((f=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&f.toLowerCase().indexOf(k.toLowerCase())===0)m[k]=!0,i.specified(d)||define(d,["orion/i18n!"+d],function(a){return a})}else o=f});i.specified(j)?h(m):o?l.getService(o).getMessageBundle().then(function(a){Object.keys(m).forEach(function(f){typeof a[f]==="undefined"&&
(a[f]=m[f])});define(j,[],a);h(a)},function(){define(j,[],m);h(m)}):(define(j,[],m),h(m))}})})}else h(null)}}});
define("orion/shell/nls/root/messages",{Shell:"Shell","Changed to: ":"Changed to: ","Initial directory: ":"Initial directory: ","${0} is not a directory":"${0} is not a directory","${0} was not found":"${0} was not found","Changes the current directory":"Changes the current directory","The name of the directory":"The name of the directory","Edits a file":"Edits a file","The name of the file":"The name of the file","Lists the files in the current directory":"Lists the files in the current directory",
"Prints the current directory location":"Prints the current directory location","Clears the shell screen":"Clears the shell screen","'${0}' is not valid":"'${0}' is not valid","Error: ${0}":"Error: ${0}",NoResponseFromServer:"No response from server for ${0}. Check your internet connection and try again.",ServerError:"Server error: ${0} returned ${1} ${2}",Succeeded:"Succeeded",Aborted:"Aborted","The name of the plug-in":"The name of the plug-in","The name of the contributed plug-in":"The name of the contributed plug-in",
"Lists all registered plug-ins":"Lists all registered plug-ins","Reloads a plug-in":"Reloads a plug-in","Disables a contributed plug-in":"Disables a contributed plug-in","Enables a contributed plug-in":"Enables a contributed plug-in","Uninstalls a contributed plug-in from the configuration":"Uninstalls a contributed plug-in from the configuration","Plug-in is already installed":"Plug-in is already installed","Invalid plug-in URL":"Invalid plug-in URL","Installs a plug-in from a URL":"Installs a plug-in from a URL",
"The plug-in URL":"The plug-in URL","Commands for working with plug-ins":"Commands for working with plug-ins","Are you sure you want to uninstall all contributed plug-ins?":"Are you sure you want to uninstall all contributed plug-ins?","Displays a plug-in's services":"Displays a plug-in's services","Commands for working with a service":"Commands for working with a service","Displays all plug-in contributions for a service":"Displays all plug-in contributions for a service","The service identifier":"The service identifier",
disabled:"disabled","Open Shell":"Open Shell","Open Shell page":"Open Shell page","'${0}' already exists":"'${0}' already exists","Source file service does not support binary read":"Source file service does not support binary read","Target file service does not support binary write":"Target file service does not support binary write","Cannot create file, it already exists as a directory":"Cannot create file, it already exists as a directory","Cannot create directory, it already exists as a file":"Cannot create directory, it already exists as a file",
"Wrote ${0}":"Wrote ${0}","Failed to write ${0}":"Failed to write ${0}","Cannot write ${0}, it is not a descendent of the output directory":"Cannot write ${0}, it is not a descendent of the output directory","The file or directory to re-direct output to":"The file or directory to re-direct output to"});
define("orion/shell/nls/messages",["orion/i18n!orion/shell/nls/messages","orion/shell/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/browserCompatibility",[],function(){function j(){for(var c=navigator.userAgent,g={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],k=0;k<b.length;k++){var a=b[k],f=c.match(a.regExp);if(f){g.browser=!0;g.version=f[1]>=a.minVersion;g.name=a.name;break}}return g}
function i(){try{return"localStorage"in window&&window.localStorage!==null}catch(c){return!1}}function h(c){alert(c);throw"unsupported browser";}var e=j();if(e.browser)e.version||h("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+e.name+".\n");else if(i()&&!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 i()||h("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:i,throwBrowserAlert:h}});
(function(j,i){typeof define==="function"&&define.amd?define("orion/Deferred",i):typeof exports==="object"?module.exports=i():(j.orion=j.orion||{},j.orion.Deferred=i())})(this,function(){function j(){for(var f;f=b.shift()||k.shift();)f();a=!1}function i(f,d){(d?k:b).push(f);a||(a=!0,d?setTimeout(j,0):j())}function h(a){return function(){a.apply(null,arguments)}}function e(){}function c(){var a=Error("Cancel");a.name="Cancel";return a}function g(){function a(){for(var f;f=k.shift();){var b=f.deferred,
c=l==="resolved"?"resolve":"reject";if(typeof f[c]==="function")try{var g=f[c](d);g&&typeof g.then==="function"?(b.cancel=g.cancel||e,g.then(h(b.resolve),h(b.reject),b.progress)):b.resolve(g)}catch(o){b.reject(o)}else b[c](d)}}var d,l,k=[],b=this;this.reject=function(c){l||(l="rejected",d=c,k.length&&i(a));return b.promise};this.resolve=function(c){l||(l="resolved",d=c,k.length&&i(a));return b.promise};this.progress=function(a){l||k.forEach(function(f){f.progress&&f.progress(a)});return b.promise};
this.cancel=function(){l||b.reject(c())};this.then=function(d,c,e){var d={resolve:d,reject:c,progress:e,deferred:new g},h=d.deferred,j=!1,t=function(){j||(j=!0,i(function(){var a=h.cancel===t?b.cancel:h.cancel;typeof a==="function"&&a()},!0))};h.cancel=t;k.push(d);l&&i(a,!0);return h.promise};this.promise=Object.create(Object.prototype,{then:{value:b.then},cancel:{get:function(){return b.cancel},set:function(a){b.cancel=a}}})}var b=[],k=[],a=!1;g.all=function(a,d){function l(a,f){e||(c[a]=f,--b===
0&&h.resolve(c))}function k(a,f){if(!e){if(d)try{l(a,d(f));return}catch(b){f=b}h.reject(f)}}var b=a.length,c=[],e=!1,h=new g;h.then(null,function(){e=!0;a.forEach(function(a){a.cancel&&a.cancel()})});b===0?h.resolve(c):a.forEach(function(a,f){a.then(l.bind(null,f),k.bind(null,f))});return h.promise};g.when=function(a,d,l,b){var k;if(!(a&&typeof a.then==="function"))k=new g,k.resolve(a),a=k.promise;return a.then(d,l,b)};return g});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(i){if(!i.type)throw Error("unspecified type");var h=this._namedListeners[i.type];h&&h.forEach(function(e){try{typeof e==="function"?e(i):e.handleEvent(i)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!i.defaultPrevented},addEventListener:function(i,h){if(typeof h==="function"||h.handleEvent)this._namedListeners[i]=this._namedListeners[i]||[],this._namedListeners[i].push(h)},
removeEventListener:function(i,h){var e=this._namedListeners[i];if(e)for(var c=0;c<e.length;c++)if(e[c]===h){e.length===1?delete this._namedListeners[i]:e.splice(c,1);break}}};j.prototype.constructor=j;j.attach=function(i){var h=new j;i.dispatchEvent=h.dispatchEvent.bind(h);i.addEventListener=h.addEventListener.bind(h);i.removeEventListener=h.removeEventListener.bind(h)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,i){function h(k,a,f){this._properties=f||{};this._properties["service.id"]=k;this._properties.objectClass=a;this._properties["service.names"]=a}function e(k,a,f){this._serviceId=k;this._serviceReference=a;this._internalRegistry=f}function c(k,a){function f(f){return function(){var d;try{if(!a())throw Error("Service was unregistered");var b=k[f].apply(k,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else d=new j,d.resolve(b)}catch(c){d=new j,d.reject(c)}return d.promise}}for(var d in k)typeof k[d]==="function"&&(this[d]=f(d))}function g(b,a){this.type=b;this.serviceReference=a}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new i;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var f=b._entries[a];if(!f)throw Error("already unregistered");var d=f.reference;b._serviceEventTarget.dispatchEvent(new g("unregistering",
d));b._entries[a]=null;d.getProperty("objectClass").forEach(function(a){for(var f=b._namedReferences[a],c=0;c<f.length;c++)if(f[c]===d){f.length===1?delete b._namedReferences[a]:f.splice(c,1);break}})},modifyService:function(a){a=b._entries[a];if(!a)throw Error("already unregistered");b._serviceEventTarget.dispatchEvent(new g("modified",a.reference))}}}h.prototype={getPropertyKeys:function(){var b=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&b.push(a);return b},getProperty:function(b){return this._properties[b]}};
h.prototype.constructor=h;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(b){var a=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;b.objectClass=a.objectClass;b["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
e.prototype.constructor=e;b.prototype={getService:function(b){var a;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(f){a=this._entries[f.getProperty("service.id")].service;return!!a},this);else if(b=this._entries[b.getProperty("service.id")])a=b.service;return a||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:[];var a=[];this._entries.forEach(function(f){f&&a.push(f.reference)});return a},registerService:function(b,a,f){if(typeof a===
"undefined"||a===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var d=this._entries.length,l=new h(d,b,f),m=this._namedReferences;b.forEach(function(a){m[a]=m[a]||[];m[a].push(l)});b=new c(a,this._internalRegistry.isRegistered.bind(null,d));this._entries.push({reference:l,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new g("registered",l));return new e(d,l,b)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,
a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(j){function i(h,e,c,g){var b=typeof c.response!=="undefined"?c.response:c.responseText,k;try{k=c.status}catch(a){k=0}h={args:e,response:b,responseText:typeof b==="string"?b:null,status:k,url:h,xhr:c};if(typeof g!=="undefined")h.error=g;return h}return function(h,e,c){var c=c||{},g=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new j,k=c.headers||{},a=c.log||!1,f;typeof k["X-Requested-With"]==="undefined"&&(k["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(h==="POST"||h==="PUT"))f=c.data;g.onprogress=function(a){a.xhr=g;b.progress(a)};g.onreadystatechange=function(){if(g.readyState===4){var f=i(e,c,g),d=g.status;200<=d&&d<400?b.resolve(f):(a&&typeof console!=="undefined"&&console.log(Error(g.statusText)),b.reject(f))}};try{g.open(h,e,!0);if(typeof c.responseType==="string")g.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof g.timeout==="number")g.timeout=c.timeout,g.addEventListener("timeout",function(){b.reject(i(e,
c,g,"Timeout exceeded"))});else{var d=setTimeout(function(){b.reject(i(e,c,g,"Timeout exceeded"))},c.timeout);b.then(clearTimeout.bind(null,d),clearTimeout.bind(null,d))}Object.keys(k).forEach(function(a){g.setRequestHeader(a,k[a])});g.send(f)}catch(l){b.reject(i(e,c,g,l))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,i,h){function e(a,d){this._name=a;this._providers=d;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function c(a,d){return{get:function(l,b){if(d===0)return null;var c=localStorage.getItem(a+l);if(c===null)return null;c=JSON.parse(c);return b||d===-1||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(l,b){if(d!==0){if(d!==-1)b._expires=(new Date).getTime()+1E3*d;
if(Object.keys(b).length===0)localStorage.removeItem(a+l);else{var c=JSON.stringify(b);localStorage.setItem(a+l,c);delete b._expires}}},remove:function(d){localStorage.removeItem(a+d)}}}function g(a){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var d=a.getServiceReferences("orion.core.preference.provider");if(d.length>0)this._service=a.getService(d[0])}return!!this._service}}function b(a){this._location=
a;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function k(){this._cache=new c("/orion/preferences/local",-1)}function a(a,d){this._userProvider=new g(a);this._localProvider=new k;d=d||"defaults.pref";d.indexOf("://")===-1&&(d=j.toUrl(d));this._defaultsProvider=new b(d);this._serviceRegistration=a.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var a=[],d=0;d<this._stores.length;++d){var b=this._stores[d];this._dirty.indexOf(b)!==-1&&
a.push(this._providers[d].put(this._name,b))}this._dirty=[];return i.all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var d=this._stores[a],b;for(b in d)d.hasOwnProperty(b)&&typeof this._cached[b]==="undefined"&&(this._cached[b]=
d[b])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,d){if(this._stores.length!==0){var b=this._stores[0];if(b[a]!==d)b[a]=d,this._cached=null,this._scheduleFlush(b)}},remove:function(a){for(var d=0;d<this._stores.length;++d){var b=this._stores[d];if(b.hasOwnProperty(a))return delete b[a],this._cached=null,this._scheduleFlush(b),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]=
{},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var d=this,b=[],c=0;c<this._providers.length;++c)b.push(this._providers[c].get(this._name,a).then(function(a){return function(f){d._stores[a]=f}}(c)));return i.all(b).then(function(){d._cached=null;d._getCached()})},flush:function(){this._flush()}};g.prototype={get:function(a,d){if(this._currentPromises[a])return this._currentPromises[a];var b=new i,c=null;
d?this._cache.remove(a):c=this._cache.get(a);if(c!==null)b.resolve(c);else{this._currentPromises[a]=b;var k=this;this._service.get(a).then(function(d){k._cache.set(a,d);delete k._currentPromises[a];b.resolve(d)},function(d){d.status===404?(d={},k._cache.set(a,d),delete k._currentPromises[a],b.resolve(d)):(delete k._currentPromises[a],b.resolve(k._cache.get(a,!0)||{}))})}return b},put:function(a,d){this._cache.set(a,d);return this._service.put(a,d)}};b.prototype={get:function(a,d){if(this._currentPromise)return this._currentPromise;
var b=new i,c=null;d?this._cache.remove(a):c=this._cache.get(a);if(c!==null)b.resolve(c);else{this._currentPromise=b;var k=this;h("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){d=JSON.parse(d.response);k._cache.set(a,d[a]||{});k._currentPromise=null;b.resolve(d[a]||{})},function(d){d.xhr.status===401||d.xhr.status===404?(k._cache.set(a,{}),k._currentPromise=null,b.resolve({})):(k._currentPromise=null,d=k._cache.get(a,!0),d!==null?b.resolve(d[a]||{}):b.resolve({}))})}return b},
put:function(){var a=new i;a.resolve();return a}};k.prototype={get:function(a){var d=new i,a=this._cache.get(a);a!==null?d.resolve(a):d.resolve({});return d},put:function(a,d){var b=new i;this._cache.set(a,d);b.resolve();return b}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(f,d,b){if(!d||typeof d!=="number"||d>7||d<1)b=d,d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",b,!1);if((a.USER_SCOPE&d)!==0)return"/orion/preferences/user"+
f;else if((a.LOCAL_SCOPE&d)!==0)return"/orion/preferences/local"+f;return"/orion/preferences/default"+f},getPreferences:function(f,d){if(!d||typeof d!=="number"||d>7||d<1)d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var b=[];a.USER_SCOPE&d&&this._userProvider.available()&&b.push(this._userProvider);a.LOCAL_SCOPE&d&&b.push(this._localProvider);a.DEFAULT_SCOPE&d&&b.push(this._defaultsProvider);var c=new e(f,b);return c.sync().then(function(){return c})},getSetting:function(a,d,b){for(var c,k=0;k<a.length;k++)if(a[k].label===
d)for(var g=0;g<a[k].data.length;g++)if(a[k].data[g].label===b){c=a[k].data[g].value;break}return c}};return{PreferencesService:a}});
(function(){function j(a){if(typeof a!=="string")throw new TypeError;}function i(a){return a?a.split("&"):[]}function h(a){return a.length===0?"":a.join("&")}function e(a){var d=/([^=]*)(?:=?)(.*)/.exec(a),a=d[1]?decodeURIComponent(d[1]):"",d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function c(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="="+encodeURIComponent(a[1]));return d}function g(a,d){var f="",b=[],c=0;return{next:function(){if(f!==a.query)f=a.query,b=i(f);if(c<b.length){var l=e(b[c++]);
switch(d){case "keys":return l[0];case "values":return l[1];case "keys+values":return[l[0],l[1]];default:throw new TypeError;}}throw z;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function k(a){var d=[];a.split("/").forEach(function(a){a===".."?d.pop():a!=="."&&d.push(a)});return d.join("/")}function a(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function f(d,f){if(typeof d!=="string")throw new TypeError;var d=a(d),b=m.exec(d);
if(!b)return null;var c={};c.scheme=b[1]||"";if(c.scheme&&!n.test(c.scheme))return null;var l=b[2];if(l&&(l=o.exec(l),c.userinfo=l[1],c.host=l[2],c.port=l[3],c.port&&!p.test(c.port)))return null;c.path=b[3];c.query=b[4];c.fragment=b[5];if(!c.scheme&&f&&(c.scheme=f.scheme,!c.host&&f.host))c.userinfo=f.userinfo,c.host=f.host,c.port=f.port,c.pathRelative=!0;if(c.pathRelative)if(c.path){if(c.path[0]!=="/")b=/^(.*\/)[^\/]*$/.exec(f.path)[1]||"/",c.path=b+c.path}else c.path=f.path;if(c.scheme)c.scheme=
c.scheme.toLowerCase();if(c.port)c.port=/[1-9]\d*$/.exec(c.port)[0];if(c.host&&c.path)c.path=k(c.path);return c}function d(a,d){var c;if(d){d=d.href||d;c=f(d);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=f(a,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var l=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?l:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(l){}var m=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,o=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,n=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,p=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,t=/^([^\s]*)$/,u=/^\S*$/,s=/([^:]*):?(.*)/,z=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),x={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){j(a);var d;i(this._url.query).some(function(f){f=e(f);if(f[0]===a)return d=f[1],!0});return d},enumerable:!0},set:{value:function(a,d){j(a);j(d);var f=i(this._url.query);f.some(function(b,l){var k=e(b);if(k[0]===a)return k[1]=d,f[l]=c(k),!0})||f.push(c([a,d]));this._url.query=h(f)},enumerable:!0},has:{value:function(a){j(a);return i(this._url.query).some(function(d){if(e(d)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){j(a);var d=i(this._url.query),f=d.filter(function(d){return e(d)[0]!==a});return f.length!==d.length?(this._url.query=h(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if(typeof a!=="function")throw new TypeError;var f=g(this._url,"keys+values");try{for(;;){var b=f.next();a.call(d,b[1],b[0],this)}}catch(c){if(c!==z)throw c;}},enumerable:!0},keys:{value:function(){return g(this._url,
"keys")},enumerable:!0},values:{value:function(){return g(this._url,"values")},enumerable:!0},items:{value:function(){return g(this._url,"keys+values")}},size:{get:function(){return i(this._url.query).length},enumerable:!0},getAll:{value:function(a){j(a);var d=[];i(this._url.query).forEach(function(f){f=e(f);f[0]===a&&d.push(f[1])});return d},enumerable:!0},append:{value:function(a,d){j(a);j(d);var f=i(this._url.query);f.push(c([a,d]));this._url.query=h(f)},enumerable:!0}});Object.defineProperties(d.prototype,
{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(a){j(a);this._input=a;this._url=f(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?
this._url.scheme+":":":"},set:function(a){j(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,n.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){j(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=s.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){j(a);if(this._url){var d=s.exec(this._userinfo),a=[encodeURIComponent(a||"")];
d[2]&&a.push(d[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=s.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){j(a);if(this._url){var d=[s.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},set:function(a){j(a);if(this._url&&(a=q.exec(a)))this._url.host=
a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){j(a);if(this._url&&w.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===x[this.protocol]&&(a="");return a},set:function(a){j(a);if(this._url&&p.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){j(a);if(this._url&&v.exec(a))this._url.host&&
a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?k(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){j(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),t.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){j(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),u.exec(a)))this._url.fragment=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(d,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(d,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=d})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(j,i){function h(a,f){var d=Object.keys(a),b=Object.keys(f);if(d.length!==b.length)return!1;d.sort();b.sort();for(var c=0,k=d.length;c<k;c++){var g=d[c];if(g!==b[c])return!1;var e=a[g],g=f[g];if(e!==g&&JSON.stringify(e)!==JSON.stringify(g))return!1}return!0}function e(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(f){}return a}function c(a){var f=null;return{key:function(d){return(f=
f||Object.keys(a))[d]},getItem:function(d){return a[d]},setItem:function(d,b){a[d]=b;f=null},removeItem:function(d){delete a[d];f=null},clear:function(){(f=f||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));f=null}}}function g(a,f){return{type:a,plugin:f}}function b(a,f,d){function b(a,f,c){if(!y)return(new j).reject(Error("plugin not connected"));var l=A++,k=new j;k.then(null,function(a){x==="active"&&a instanceof Error&&a.name==="Cancel"&&d.postMessage({id:l,cancel:a.message||"Cancel"},
y)});D[String(l)]=k;d.postMessage({id:l,serviceId:a,method:f,params:c},y);return k.promise}function c(a){var d={};if(a.methods&&(a.methods.forEach(function(f){d[f]=function(){var d=Array.prototype.slice.call(arguments);return x==="active"?b(a.serviceId,f,d):q.start({"transient":!0}).then(function(){return b(a.serviceId,f,d)})}}),d.addEventListener&&d.removeEventListener)){var f=new i;d.dispatchEvent=f.dispatchEvent.bind(f);var k=d.addEventListener;d.addEventListener=function(a,d){f._namedListeners[a]||
k(a);f.addEventListener(a,d)};var g=d.removeEventListener;d.removeEventListener=function(a,d){f.removeEventListener(a,d);f._namedListeners[a]&&g(a)}}return d}function k(d){var f=JSON.parse(JSON.stringify(d.properties));f.__plugin__=a;d=d.names||d.type||[];Array.isArray(d)||(d=[d]);f.objectClass=d;return f}function e(a){var f=c(a),b=k(a),b=d.registerService(a.names||a.type,f,b);r[a.serviceId]={registration:b,proxy:f}}function p(){d.persist(a,{created:v,headers:t,services:u,autostart:s,lastModified:z})}
function w(a){var f;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var b=a.params[0];H({headers:b.headers,services:b.services}).then(function(){C.resolve(q)})}else if("dispatchEvent"===a.method){var c=r[a.serviceId].proxy;c.dispatchEvent.apply(c,a.params)}else if("progress"===a.method)f=D[String(a.requestId)],f.progress.apply(f,a.params);else if("timeout"===a.method)C&&C.reject(a.error);else throw Error("Bad response method: "+a.method);else if(f=D[String(a.id)],delete D[String(a.id)],
a.error){var l=d.handleServiceError(q,a.error);f.reject(l)}else f.resolve(a.result)}catch(k){console.log("Plugin._responseHandler "+k)}}var q=this,f=f||{},v=f.created||(new Date).getTime(),t=f.headers||{},u=f.services||[],s=f.autostart,z=f.lastModified||0,x="installed",B,C,y,r={},A=0,D={},H;this._persist=p;this._resolve=function(){x="resolved";d.dispatchEvent(new g("resolved",q))};this._getAutostart=function(){return s};this._getCreated=function(){return v};this.getLocation=function(){return a};this.getHeaders=
function(){return JSON.parse(JSON.stringify(t))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return z};this.getServiceReferences=function(){var a=[];Object.keys(r).forEach(function(d){a.push(r[d].registration.getReference())});return a};this.getState=function(){return x};this.start=function(f){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));
if(B)return B.promise.then(this.start.bind(this,f));if(x==="active")return(new j).resolve();if(!f||!f["transient"]){var b=f&&f.lazy?"lazy":"started";b!==s&&(s=b,p())}b=d.getState();if(b!=="starting"&&b!=="active")return f["transient"]?(new j).reject(Error("start transient error")):(new j).resolve();if(x==="installed")try{this._resolve()}catch(c){return(new j).reject(c)}x==="resolved"&&u.forEach(function(a){e(a)});if(f&&f.lazy)return x!=="starting"&&(x="starting",d.dispatchEvent(new g("lazy activation",
q))),(new j).resolve();var l=new j;B=l;x="starting";d.dispatchEvent(new g("starting",q));C=new j;y=d.connect(a,w);C.then(function(){C=null;x="active";d.dispatchEvent(new g("started",q));B=null;l.resolve()},function(){C=null;x="stopping";d.dispatchEvent(new g("stopping",q));Object.keys(r).forEach(function(a){r[a].registration.unregister();delete r[a]});d.disconnect(y);y=null;x="resolved";B=null;d.dispatchEvent(new g("stopped",q));l.reject(Error("plugin activation error"))});return l.promise};this.stop=
function(a){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(B)return B.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==s)s="stopped",p();if(x!=="active"&&x!=="starting")return(new j).resolve();B=a=new j;x="stopping";d.dispatchEvent(new g("stopping",q));Object.keys(r).forEach(function(a){r[a].registration.unregister();delete r[a]});y&&(d.disconnect(y),y=null);x="resolved";B=null;d.dispatchEvent(new g("stopped",q));a.resolve();return a.promise};
H=function(f){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!f)return z===0&&(z=(new Date).getTime(),p()),d.loadManifest(a).then(H);var b=t,c=u,l=s;t=f.headers||{};u=f.services||{};s=f.autostart||s;f.lastModified?z=f.lastModified:(z=(new Date).getTime(),p());if(h(t,b)&&h(u,c)&&s===l)return(new j).resolve();if(x==="active"||x==="starting"){var m=[];Object.keys(u).forEach(function(a){var d=u[a];m.push(a);var f=r[a];if(f){if(h(d.methods,Object.keys(f.proxy))){var a=k(d),
b=f.registration.getReference(),c={};b.getPropertyKeys().forEach(function(a){c[a]=b.getProperty(a)});h(a,c)||f.registration.setProperties(a);return}f.registration.unregister();delete r[a]}e(d)});Object.keys(r).forEach(function(a){m.indexOf(a)===-1&&(r[a].registration.unregister(),delete r[a])})}x==="active"&&(d.disconnect(y),C=new j,y=d.connect(a,w),C.then(function(){C=null},function(){C=null;x="stopping";d.dispatchEvent(new g("stopping"),q);Object.keys(r).forEach(function(a){r[a].registration.unregister();
delete r[a]});d.disconnect(y);y=null;x="resolved";d.dispatchEvent(new g("stopped",q))}));return(new j).resolve()};this.update=function(a){return H(a).then(function(){d.dispatchEvent(new g("updated",q))})};this.uninstall=function(){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));d.removePlugin(this);x="uninstalled";d.dispatchEvent(new g("uninstalled",
q));return(new j).resolve()}}var k=/^http[s]?/i;return{Plugin:b,PluginRegistry:function(a,f){function d(a){var d=a.source;n.some(function(f){if(d===f.target){if(typeof f.useStructuredClone==="undefined")f.useStructuredClone=typeof a.data!=="string";f.handler(f.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var f=f||{},l=f.storage||localStorage;l.getItem||(l=c(l));var m="installed",h=[],n=[],p=new i,w={},q={registerService:a.registerService.bind(a),connect:function(a,d,b){function c(a){a=
Error(a);a.name="timeout";d({method:"timeout",error:a})}var l={handler:d,url:a},k=setTimeout(c.bind(null,"Load timeout for: "+a),b||15E3),g=document.createElement("iframe");g.name=a+"_"+(new Date).getTime();if(!f.visible)g.style.display="none",g.style.visibility="hidden";g.src=a;g.onload=function(){clearTimeout(k);setTimeout(c.bind(null,"Plugin handshake timeout for: "+a),5E3)};g.sandbox="allow-scripts allow-same-origin";document.body.appendChild(g);l.target=g.contentWindow;l.close=function(){g&&
(document.body.removeChild(g),g=null)};n.push(l);return l},disconnect:function(a){for(var d=0;d<n.length;d++)if(a===n[d]){n.splice(d,1);try{a.close()}catch(f){}break}},removePlugin:function(a){for(var d=0;d<h.length;d++)if(a===h[d]){h.splice(d,1);break}l.removeItem("plugin."+a.getLocation())},persist:function(a,d){l.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{p.dispatchEvent(a)}catch(d){console&&
console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new j,f=q.connect(a,function(a){f&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],q.disconnect(f),f=null,d.resolve(a)):"timeout"===a.method&&(q.disconnect(f),f=null,d.reject(a.error)))});return d.promise},getState:function(){return m},handleServiceError:function(a,d){if(d&&d.status===401){var f=a.getHeaders(),b=a.getName()||a.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+
b+"."));if(f.login)c.appendChild(document.createTextNode(" ")),b=document.createElement("a"),b.target="_blank",b.textContent="Login",b.href=f.login,k.test(b.href)?(c.appendChild(b),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+f.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(c)}}if(d.__isError){var l=d,d=Error(l.message);Object.keys(l).forEach(function(a){d[a]=l[a]});delete d.__isError}return d}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=q.getState;this.init=function(){if(!(m==="starting"||m==="active"||m==="stopping")){addEventListener("message",d,!1);for(var a=[],c=0,k=l.length;c<k;c++)a.push(l.key(c));a.forEach(function(a){if(a.indexOf("plugin.")===0){var d=a.substring(7),a=JSON.parse(l.getItem(a));a.created&&h.push(new b(d,a,q))}});
h.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});f.plugins&&Object.keys(f.plugins).forEach(function(a){a=e(a);if(!this.getPlugin(a)){var d=f.plugins[a],d=typeof d==="object"||{};d.autostart=d.autostart||f.defaultAutostart||"lazy";h.push(new b(a,d,q))}}.bind(this));m="starting"}};this.start=function(){m!=="starting"&&this.init();if(m!=="starting")return(new j).reject("Cannot start framework. Framework is already "+m+".");var a=[],d=(new Date).getTime();h.forEach(function(f){var b=
f._getAutostart();f.getLastModified()===0?a.push(f.update().then(function(){if("started"===b)return f.start({"transient":!0});if("lazy"===b)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===b?a.push(f.start({"transient":!0})):"lazy"===b?(a.push(f.start({lazy:!0,"transient":!0})),d>f.getLastModified()+864E5&&f.update()):f._resolve()});return j.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){m="active"})};this.stop=function(){if(m!=="starting"&&m!=="active")return(new j).reject("Cannot stop registry. Registry is already "+
m+".");m="stopping";var a=[];h.forEach(function(d){a.push(d.stop({"transient":!0}))});return j.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",d);m="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new j).reject("Cannot uninstall registry")};this.installPlugin=function(a,d){var a=e(a),f=this.getPlugin(a);if(f)return(new j).resolve(f);if(w[a])return w[a];if(d)return f=new b(a,d,q),h.push(f),
f._persist(),q.dispatchEvent(new g("installed",f)),(new j).resolve(f);var c=q.loadManifest(a).then(function(d){f=new b(a,d,q);h.push(f);f._persist();delete w[a];q.dispatchEvent(new g("installed",f));return f},function(d){delete w[a];throw d;});return w[a]=c};this.getPlugins=function(){return h.slice()};this.getPlugin=function(a){var d=null,a=e(a);h.some(function(f){if(a===f.getLocation())return d=f,!0});return d};this.addEventListener=p.addEventListener.bind(p);this.removeEventListener=p.removeEventListener.bind(p);
this.resolvePlugins=function(){var a=!0;h.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function j(e,c){function g(d){var f=d.getProperty("service.id"),b=this.addingService(d);b&&(k[f]=d,a[f]=b)}function b(d){var f=d.getProperty("service.id"),b=a[f];delete k[f];delete a[f];this.removedService(d,b)}this.serviceRegistry=e;var k={},a={},f=i,d,l;this.close=function(){if(f!==h)throw"Already closed";f=i;e.removeEventListener("registered",d);e.removeEventListener("unregistering",l);l=d=null;var a=this;this.getServiceReferences().forEach(function(d){b.call(a,
d)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return k.length?Object.keys(k).map(function(a){return k[a]}):null};this.open=function(){if(f!==i)throw"Already open";f=h;var a=this;d=function(d){if(d.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(g.call(a,d.serviceReference),typeof a.onServiceAdded==="function"))return a.onServiceAdded(d.serviceReference,a.serviceRegistry.getService(d.serviceReference))};l=function(d){d.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&b.call(a,d.serviceReference)};e.addEventListener("registered",d);e.addEventListener("unregistering",l);e.getServiceReferences(c).forEach(function(d){g.call(a,d)});if(typeof this.onOpen==="function")this.onOpen()}}var i=0,h=1;j.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(j,i){var h,e,c,g,b,k="pid";h=function(a,d,b){function c(a,f,b){f.forEach(function(c,l){try{var k=a[l].getProperty("__plugin__"),g=k&&d.getPlugin(k);(!k||g&&g.getState()==="active")&&f[l].updated(b)}catch(e){typeof console!=="undefined"&&console.log(e)}})}i.call(this,a,"orion.cm.managedservice");var g={},e={},h=function(d){var c=[];d.plugin.getServiceReferences().forEach(function(d){if(d.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var g=d.getProperty(k),d=a.getService(d);g&&d&&(g=(g=b._find(g))&&g.getProperties(),c.push(d.updated(g)))}});return j.all(c)};this.addingService=function(d){var b=d.getProperty(k),c=a.getService(d);if(!b||!c)return null;g[b]||(g[b]=[]);e[b]||(e[b]=[]);g[b].push(d);e[b].push(c);return c};this.onServiceAdded=function(a,d){var f=a.getProperty(k),f=b._find(f);c([a],[d],f&&f.getProperties())};this.onOpen=function(){d.addEventListener("started",h)};this.onClose=function(){d.removeEventListener("started",
h)};this.notifyUpdated=function(a){var d=a.getPid();c(g[d]||[],e[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();c(g[a]||[],e[a]||[],null)};this.removedService=function(a,d){var f=a.getProperty(k),b=g[f],c=e[f];b.length>1?b.splice(b.indexOf(a),1):delete g[f];c.length>1?c.splice(c.indexOf(d),1):delete e[f]}};e=function(){function a(d,f,b){this.store=new c(this,b);this.configAdmin=new g(this,this.store);this.tracker=new h(d,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(f){a.tracker.open();return f})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();g=function(){function a(d,f){this.factory=d;this.store=f}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var a="/cm/configurations";
c=function(){function f(d,f){this.factory=d;this.prefsService=f;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(a).then(function(a){c.pref=a;a.keys().forEach(function(d){if(!c.configs[d]){var f=a.get(d);typeof f==="object"&&f!==null&&Object.keys(f).length>0&&(f[k]=d,c.configs[d]=new b(c.factory,c,f))}})})}f.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var f=this._find(a);
f||(f=new b(this.factory,this,a),this.configs[a]=f);return f},list:function(){var a=this,f=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&b.getProperties()!==null&&f.push(b)});return f},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,f){this.pref.put(a,f.getProperties(!0)||{})}};return f}();b=function(){function a(d){for(var f={},b=Object.keys(d),c=0;c<b.length;c++){var k=b[c],g=d[k];f[k]=g instanceof Array?g.slice():g}return f}function d(d,b,c){this.factory=
d;this.store=b;if(c!==null&&typeof c==="object")this.pid=c[k],d=a(c),delete d[k],this.properties=d;else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}d.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(d){this._checkRemoved();var b=null;if(this.properties&&(b=a(this.properties),!d))b[k]=this.pid;return b},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(d){this._checkRemoved();d=a(d);delete d[k];this.properties=d;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return d}();return{ConfigurationAdminFactory:e}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,i,h,e,c,g){var b;return{startup:function(){if(b)return b;b=new i;var k=new h.ServiceRegistry,a=new e.PreferencesService(k);return a.getPreferences("/plugins").then(function(f){var d={plugins:{}};f.keys().forEach(function(a){var b=j.toUrl(a);d.plugins[b]=f[a]});var l=new c.PluginRegistry(k,d);return l.start().then(function(){if(k.getServiceReferences("orion.core.preference.provider").length>
0)return a.getPreferences("/plugins",a.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=j.toUrl(a);l.getPlugin(a)||d.push(l.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return i.all(d,function(a){console.log(a)})})}).then(function(){return(new g.ConfigurationAdminFactory(k,l,a)).getConfigurationAdmin().then(k.registerService.bind(k,"orion.cm.configadmin"))}).then(function(){var a=k.getService("orion.core.auth");
if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return d}}).then(function(){var d={serviceRegistry:k,preferences:a,pluginRegistry:l};b.resolve(d);return d})})}}});
define("orion/util",[],function(){var j=navigator.userAgent,i=parseFloat(j.split("MSIE")[1])||void 0,h=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,e=j.indexOf("Opera")!==-1,c=parseFloat(j.split("Chrome/")[1])||void 0,g=j.indexOf("Safari")!==-1&&!c,b=parseFloat(j.split("WebKit/")[1])||void 0,k=j.indexOf("Android")!==-1,a=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,f=a||j,d=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,m=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return d[(f<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:i,isFirefox:h,isOpera:e,isChrome:c,isSafari:g,isWebkit:b,isAndroid:k,isIPad:a,isIPhone:j,isIOS:f,isMac:d,isWindows:l,isLinux:m,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",[],function(){function j(b,a){a||(a=document);return a.querySelectorAll(b)}function i(b,a){var f=b.compareDocumentPosition(a);return b===a||Boolean(f&16)}function h(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var a=0;a<b.childNodes.length;a++){var f=h(b.childNodes[a]);if(f)return f}return null}function e(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var a=b.childNodes.length-1;a>=0;a--){var f=e(b.childNodes[a]);if(f)return f}return null}function c(b,
a){if(b.nodeType===3){var f=g.exec(b.nodeValue);f&&f.length>1&&a(b,f)}if(b.hasChildNodes())for(f=0;f<b.childNodes.length;f++)c(b.childNodes[f],a)}var g=/\$\{([^\}]+)\}/,b=[];return{$:function(b,a){a||(a=document);return a.querySelector(b)},$$:j,$$array:function(b,a){return Array.prototype.slice.call(j(b,a))},node:function(b){var a=b;typeof b==="string"&&(a=document.getElementById(b));return a},contains:i,bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.body.scrollLeft,top:b.top+
document.body.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:h,lastTabbable:e,stop:function(b){window.document.all?b.keyCode=0:(b.preventDefault(),b.stopPropagation())},processTextNodes:function(b,a){c(b,function(f,d){f.parentNode.replaceChild(document.createTextNode(a[d[1]]||d[1]),f)})},processDOMNodes:function(b,a){c(b,function(f,d){var b=a[d[1]];if(b){var c=document.createRange(),k=d.index;c.setStart(f,k);c.setEnd(f,
k+d[0].length);c.deleteContents();c.insertNode(b)}})},addAutoDismiss:function(c,a){b.length===0&&document.addEventListener("click",function(a){for(var d=[],c=0;c<b.length;c++){var k=b[c].dismiss,g=!1,e;if(b[c].excludeNodes.every(function(d){return d&&(g=document.compareDocumentPosition(document,d)!==1)&&i(d,a.target)?(e=d,!1):!0})){try{k()}catch(h){typeof console!=="undefined"&&console&&console.error(h&&h.message)}g=document.compareDocumentPosition(document,e)!==1}g&&d.push(b[c])}b=d},!0);b.push({excludeNodes:c,
dismiss:a})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(j,i){function h(e){this._init(e)}h.prototype={_init:function(e){this._dropdownNode=i.node(e.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=i.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=e.populate;var c=this;this._triggerNode.addEventListener("click",function(g){c.toggle()&&i.stop(g)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(g){if(g.keyCode===i.KEY.ENTER||g.keyCode===i.KEY.SPACE)c.toggle(),i.stop(g)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();if(e.length>0){if(!this._hookedAutoDismiss){var c=i.$$(".dropdownSubMenu",
this._dropdownNode);i.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(c)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();e[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var e=i.bounds(this._dropdownNode),c=i.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=
0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||!e.parentNode.style?e:this._boundingNode(e.parentNode)},close:function(e){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");e&&this._triggerNode.focus();return!0},getItems:function(){var e=[],c=this;i.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(g){g.parentNode.parentNode===c._dropdownNode&&
e.push(g)});return e},empty:function(){var e=this;i.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===e._dropdownNode&&c.parentNode.removeChild(c)})},_dropdownKeyDown:function(e){if(e.keyCode===i.KEY.UP||e.keyCode===i.KEY.DOWN||e.keyCode===i.KEY.RIGHT||e.keyCode===i.KEY.ENTER||e.keyCode===i.KEY.LEFT){var c=this.getItems(),g=document.activeElement;if(c.length&&c.length>0&&g){var b=c.indexOf(g);b<0&&(b=c.indexOf(g.parentNode));b>=0&&(e.keyCode===i.KEY.UP&&b>0?(b--,c[b].focus()):e.keyCode===
i.KEY.DOWN&&b<c.length-1?(b++,c[b].focus()):e.keyCode===i.KEY.ENTER||e.keyCode===i.KEY.RIGHT?g.classList.contains("dropdownTrigger")&&g.dropdown&&g.dropdown.open():e.keyCode===i.KEY.LEFT&&g.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),i.stop(e))}}else e.keyCode===i.KEY.ESCAPE&&(this.close(!0),i.stop(e))}};h.prototype.constructor=h;return{Dropdown:h}});
define("text",["module"],function(j){var i,h,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,g=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,k=b&&location.protocol&&location.protocol.replace(/\:/,""),a=b&&location.hostname,f=b&&(location.port||void 0),d=[],l=j.config&&j.config()||{};i={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),d=a.match(g);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,d,f;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(d=0;d<3;d+=1){f=e[d];try{a=new ActiveXObject(f)}catch(b){}if(a){e=[f];break}}return a},parseName:function(a){var d,
f,b=!1,c=a.indexOf(".");d=a.indexOf("./")===0||a.indexOf("../")===0;c!==-1&&(!d||c>1)?(d=a.substring(0,c),f=a.substring(c+1,a.length)):d=a;a=f||d;c=a.indexOf("!");c!==-1&&(b=a.substring(c+1)==="strip",a=a.substring(0,c),f?f=a:d=a);return{moduleName:d,ext:f,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,f,b){var c,l;c=i.xdRegExp.exec(a);if(!c)return!0;a=c[2];c=c[3];c=c.split(":");l=c[1];c=c[0];return(!a||a===d)&&(!c||c.toLowerCase()===f.toLowerCase())&&(!l&&!c||l===b)},finishLoad:function(a,
f,b,c){b=f?i.strip(b):b;l.isBuild&&(d[a]=b);c(b)},load:function(d,c,g,e){if(e.isBuild&&!e.inlineText)g();else{l.isBuild=e.isBuild;var h=i.parseName(d),e=h.moduleName+(h.ext?"."+h.ext:""),j=c.toUrl(e),v=l.useXhr||i.useXhr;!b||v(j,k,a,f)?i.get(j,function(a){i.finishLoad(d,h.strip,a,g)},function(a){g.error&&g.error(a)}):c([e],function(a){i.finishLoad(h.moduleName+"."+h.ext,h.strip,a,g)})}},write:function(a,f,b){if(d.hasOwnProperty(f)){var c=i.jsEscape(d[f]);b.asModule(a+"!"+f,"define(function () { return '"+
c+"';});\n")}},writeFile:function(a,d,f,b,c){var d=i.parseName(d),l=d.ext?"."+d.ext:"",k=d.moduleName+l,g=f.toUrl(d.moduleName+l)+".js";i.load(k,f,function(){var d=function(a){return b(g,a)};d.asModule=function(a,d){return b.asModule(a,g,d)};i.write(a,k,d,c)},c)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)h=require.nodeRequire("fs"),i.get=function(a,d){var f=h.readFileSync(a,"utf8");f.indexOf("\ufeff")===0&&(f=f.substring(1));d(f)};else if(l.env===
"xhr"||!l.env&&i.createXhr())i.get=function(a,d,f,b){var c=i.createXhr(),k;c.open("GET",a,!0);if(b)for(k in b)b.hasOwnProperty(k)&&c.setRequestHeader(k.toLowerCase(),b[k]);if(l.onXhr)l.onXhr(c,a);c.onreadystatechange=function(){var b;if(c.readyState===4)b=c.status,b>399&&b<600?(b=Error(a+" HTTP status: "+b),b.xhr=c,f(b)):d(c.responseText)};c.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")i.get=function(a,d){var f,b,c=new java.io.File(a),l=java.lang.System.getProperty("line.separator"),
c=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(c),"utf-8")),k="";try{f=new java.lang.StringBuffer;(b=c.readLine())&&b.length()&&b.charAt(0)===65279&&(b=b.substring(1));for(f.append(b);(b=c.readLine())!==null;)f.append(l),f.append(b);k=String(f.toString())}finally{c.close()}d(k)};return i});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(j,i){function h(e){this._init(e)}h.prototype={_init:function(e){this._node=i.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=e.hideDelay===void 0?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(b){b.target===c._node&&(c.show(),i.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",function(b){i.contains(c._node,b.target)&&(c.show(),i.stop(b))},!1);for(var g=0;g<e.length;g++)this._node.addEventListener(e[g],function(b){i.contains(c._node,b.target)&&c.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var e=this;i.addAutoDismiss([this._tip,this._node],function(){e.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),
this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(e._timeout)window.clearTimeout(e._timeout),e._timeout=null;e._tip.addEventListener("mouseout",function(c){i.contains(e._tip,c.target)&&(e.hide(),i.stop(c))},!1)},!1)}return this._tip},_positionTip:function(e,c){this._makeTipNode();e==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,b;for(b=i.bounds(g);g&&!b.width&&!b.height;g=g.parentNode)b=
i.bounds(g);var g=i.bounds(this._tipInner),k;switch(e){case "above":k=b.top-g.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":k=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":k=b.top-this._tailSize/2;b=b.left-g.width-this._tailSize-1;break;default:k=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var a=i.bounds(document.documentElement);if(k+g.height>a.height)if(c)k=a.height-g.height-1;else return!1;if(b+g.width>a.width)if(c)b=a.width-g.width-
1;else return!1;if(b<0)if(c)b=4;else return!1;if(k<0)if(c)k=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+e),e==="above"||e==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),e==="left"))this._tail.style.left=g.width+"px";this._tip.style.top=k+"px";this._tip.style.left=b+"px";this._tip.style.width=g.width+"px";this._tip.style.height=g.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var e=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var c=!1,g=0;!c&&g<e._position.length;)c=e._positionTip(e._position[g]),g++;c||e._positionTip(e._position[0],!0);e._tip.classList.add("tooltipShowing");e._afterShowing&&e._afterShowing()},this._showDelay)}},hide:function(e){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(e===void 0)e=this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},e)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipInner=this._tip=null}};h.prototype.constructor=h;return{Tooltip:h}});
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,i,h,e,c,g,b,k){function a(a,d){for(var f in d)if(d[f]&&d[f].keyBinding&&d[f].command&&d[f].keyBinding.match(a)){var b=d[f],c=b.keyBinding;if(!c.domScope||h.contains(h.node(c.domScope),a.target)){var l=b.invocation;if(l){var k=b.command;if(k.hrefCallback){h.stop(a);
f=k.hrefCallback.call(l.handler||window,l);f.then?f.then(function(a){window.open(a)}):window.open(f);break}else if(k.onClick||k.callback){h.stop(a);window.setTimeout(function(){(k.onClick||k.callback).call(l.handler||window,l)},0);break}}}}}function f(a,d,f){d.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(b=document.createElement("span"),d.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,
b.name=f,b.id=f,b.src=a.image,d.appendChild(b));return b}function d(a,d,f,b,c){this.commandRegistry=c;this.handler=a;this.items=d;this.userData=f;this.command=b;if(b.parameters)this.parameters=b.parameters.makeCopy();this.id=b.id}function l(a){this._init(a)}var m=null,o={};window.document.addEventListener("keydown",function(d){d=d||window.event;if(function(a){if(i.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===
90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(d)){if(d.target.contentEditable==="true")return;var f=d.target.nodeName.toLowerCase();if(f==="input")switch(d.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(f===
"textarea")return}f={};if(m){var b,c,l;c=Object.keys(o);for(b=0;b<c.length;b++)l=c[b],f[l]=o[l];var k=m();c=Object.keys(k);for(b=0;b<c.length;b++)l=c[b],f[l]=k[l]}else f=o;a(d,f)},!1);d.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var f=new d(this.handler,this.items,this.userData,this.command,this.commandRegistry);f.domNode=this.domNode;f.domParent=this.domParent;if(a)f.parameters=a.makeCopy();else if(this.parameters)f.parameters=
this.parameters.makeCopy();return f}};d.prototype.constructor=d;l.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||j.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,
d,f,b,c){this.getChoices(d,f,b).forEach(function(f){if(f.name){var b=document.createElement("li");a.appendChild(b);var l=document.createElement("span");l.tabIndex=0;l.role="menuitem";l.classList.add("dropdownMenuItem");var k=document.createTextNode(f.name);l.appendChild(k);b.appendChild(l);l.choice=f;l.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);l.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else c._generateMenuSeparator(a)})},getChoices:function(a,d,f){return this.choiceCallback?this.choiceCallback.call(d,a,f):null},makeChoiceCallback:function(a,d){return function(f){a.callback&&a.callback.call(a,d,f)}},hasImage:function(){return this.imageClass||this.image!==j.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:d,createDropdownMenu:function(a,d,b,l,k,g){a=h.node(a);if(!a)throw"no parent node was specified";
var m=document.createRange();m.selectNode(a);m=m.createContextualFragment(c);h.processTextNodes(m,{ButtonText:d});a.appendChild(m);a=a.lastChild;m=a.previousSibling;l?m.classList.add(l):(m.classList.add("orionButton"),m.classList.add("commandButton"));if(k){if(!g)m.textContent="",m.setAttribute("aria-label",d);f({spriteClass:"commandSprite",imageClass:k},m,d);m.classList.add("orionButton")}m.dropdown=new e.Dropdown({dropdown:a,populate:b});a.dropdown=m.dropdown;return{menuButton:m,menu:a,dropdown:m.dropdown}},
createCheckedMenuItem:function(a,d,f,c){a=h.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=l.createContextualFragment(b);h.processTextNodes(l,{ItemText:d});a.appendChild(l);a=h.$(".checkedMenuItem",a.lastChild);a.checked=f;a.addEventListener("change",c,!1)},createCommandItem:function(a,d,b,c,l,g,e){var m,g=g||!d.name&&d.hasImage();if(d.hrefCallback)m=document.createElement("a"),m.id=c,g&&d.hasImage()?f(d,m,c):(m.className="commandLink",m.appendChild(document.createTextNode(d.name))),
e=d.hrefCallback.call(b.handler,b),e.then?e.then(function(a){m.href=a}):m.href=e?e:"#";else{m=document.createElement("button");m.className="orionButton";g?d.hasImage()?(f(d,m,c),d.name&&m.setAttribute("aria-label",d.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),m.appendChild(document.createTextNode(d.name))):(m.classList.add("commandButton"),c=document.createTextNode(d.name),m.appendChild(c));var h=e||d.callback;if(h)d.onClick=h,m.addEventListener("click",function(){h.call(b.handler,
b)},!1)}a.nodeName.toLowerCase()==="ul"?(e=document.createElement("li"),a.appendChild(e),a=e):m.classList.add("commandMargins");a.appendChild(m);if(d.tooltip)m.commandTooltip=new k.Tooltip({node:m,text:d.tooltip,position:["above","below","right","left"]});l&&(o[d.id]={keyBinding:l,command:d,invocation:b});return m},createCommandMenuItem:function(a,d,f,b,c){var l,g=a.dropdown;if(d.hrefCallback)l=document.createElement("a"),l.appendChild(document.createTextNode(d.name)),c=d.hrefCallback.call(f.handler,
f),c.then?c.then(function(a){l.href=a}):l.href=c?c:"#";else{l=document.createElement("span");l.tabIndex=0;l.appendChild(document.createTextNode(d.name));var e=c||d.callback;if(e)d.onClick=e,l.addEventListener("click",function(){g.close(!0);e.call(f.handler,f)},!1)}if(d.tooltip)l.commandTooltip=new k.Tooltip({node:l,text:d.tooltip,position:["right","left","above","below"]});l.className="dropdownMenuItem";l.role="menuitem";c=document.createElement("li");a.appendChild(c);c.appendChild(l);b&&(o[d.id]=
{keyBinding:b,command:d,invocation:f});return l},setKeyBindingProvider:function(a){m=a},localKeyBindings:o,_testMethodProcessKey:a}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",
"Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error",
"no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,i){function h(c){var g="",b=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(g+=b?"Cmd+":"Ctrl+");c.mod2&&(g+="Shift+");c.mod3&&(g+="Alt+");c.mod4&&b&&(g+="Ctrl+");if(c.alphaKey)return g+c.alphaKey;if(c.type==="keypress")return g+c.keyCode;for(var k in i.KEY)if(typeof(i.KEY[k]==="number")&&i.KEY[k]===c.keyCode)return g+k;var a;switch(c.keyCode){case 59:a=c.mod2?":":";";break;case 61:a=c.mod2?"+":"=";break;case 188:a=
c.mod2?"<":",";break;case 190:a=c.mod2?">":".";break;case 191:a=c.mod2?"?":"/";break;case 192:a=c.mod2?"~":"`";break;case 219:a=c.mod2?"{":"[";break;case 220:a=c.mod2?"|":"\\";break;case 221:a=c.mod2?"}":"]";break;case 222:a=c.mod2?'"':"'"}return a?g+a:c.keyCode>=112&&c.keyCode<=123?g+"F"+(c.keyCode-111):g+String.fromCharCode(c.keyCode)}function e(c){var g=window.navigator.platform.indexOf("Mac")!==-1;return g&&c.metaKey||!g&&c.ctrlKey}return{getUserKeyString:function(c){for(var g="",c=c.getKeys(),
b=0;b<c.length;b++)b!==0&&(g+=" "),g+=h(c[b]);return g},getUserText:function(c,g,b,k,a,f,d,l,e){var h=!1,d=function(d){return function(l){if(!h){var j=i.node(c),n=j.value;if(j)if(d&&l.keyCode===i.KEY.ESCAPE){if(b)g.style.display="inline";h=!0;j.parentNode.removeChild(j);f&&f()}else if(!(d&&l.keyCode!==i.KEY.ENTER)){if(n.length===0||!e&&n===k){if(b)g.style.display="inline"}else a(n);h=!0;j.parentNode&&j.parentNode.removeChild(j);f&&f()}}}},j=document.createElement("input");j.id=c;j.value=k||"";g.parentNode.insertBefore(j,
g.nextSibling);j.classList.add("userEditBoxPrompt");if(b)g.style.display="none";j.addEventListener("keydown",d(!0),!1);j.addEventListener("blur",d(!1),!1);window.setTimeout(function(){j.focus();if(k){var a=i.node(c),d=l?k.indexOf(l):-1;if(d>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",d),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,d);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=d}else a.select()}},
0)},openInNewWindow:e,followLink:function(c,g){g&&e(g)?window.open(c):window.location=c},createButton:function(c,g){var b=document.createElement("button");b.className="orionButton commandButton commandMargins";b.addEventListener("click",function(b){g();i.stop(b)},!1);c&&b.appendChild(document.createTextNode(c));return b},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var j=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,i=/^http[s]?/i;return{matchResourceParameters:function(h){var h=h||window.location.toString(),e={resource:""},c=h.indexOf("#");if(c!==-1&&(h=h.substring(c+1),h.length!==0)){h=h.split(",");Object.defineProperty(e,"resourceRaw",{value:h[0]});e.resource=decodeURIComponent(h[0]);if(!e.resource.match(j))e.resource=encodeURI(e.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(c=1;c<h.length;c++){var g=
/([^=]*)(=?)(.*)/.exec(h[c]),b=decodeURIComponent(g[1]||""),g=decodeURIComponent(g[3]||"");b!==""&&b!=="resource"&&(e[b]=g)}}return e},validateURLScheme:function(h,e){var c=h;if(h.indexOf("://")===-1){var g=document.createElement("a");g.href=h;c=g.href}g=!1;return(g=e?e.some(function(b){return RegExp("^"+b+":","i").test(c)}):i.test(c))?h:(console.log("Illegal URL Scheme: '"+h+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function j(h,e){if(!i&&h)h.push({domNode:e}),e.tabIndex=-1,e.style.outline="none"}var i=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(h,e,c){h&&(h=h.getGridNavHolder(e,!0))&&j(h,c)},generateNavGrid:j,removeNavGrid:function(h,e){if(h)for(var c=0;c<h.length;c++)if(h[c].domNode===e){h.splice(c,1);break}}}});
define("orion/commandRegistry","require,orion/commands,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(j,i,h,e,c,g,b,k,a,f,d){function l(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function m(a,d){this.token=a;this.parameterName=d}function o(a,d,f,b,c){this.name=a;this.type=d;this.label=f;this.value=b;this.lines=c||1}function n(a,d,f){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=d&&d.clientCollect}l.prototype={_init:function(a){this._selectionService=a.selection;var d=this;i.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&
this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var f=this._urlBindings[d].urlBinding.match(a);if(f){var b=this._urlBindings[d],c=b.command,l=b.invocation;if(l&&l.parameters&&c.callback){l.parameters.setValue(f.parameterName,f.parameterValue);var k=this;window.setTimeout(function(){k._invoke(l)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,f,b){d?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback&&this._invoke(new i.CommandInvocation(f,
d,null,a,this),b):(d=this._urlBindings[a])&&d.command&&d.command.callback&&this._invoke(d.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,d,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,f))},confirm:function(a,d,f,b,c,l){var k=!1;if(this._parameterCollector&&!c){var g=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,c){var l=document.createElement("span");l.classList.add("parameterPrompt");l.textContent=d;a.appendChild(l);l=document.createElement("button");l.addEventListener("click",function(){k=!0;g._parameterCollector.close()},!1);c.appendChild(l);l.appendChild(document.createTextNode(f));l.className="dismissButton";var e=document.createElement("button");e.addEventListener("click",function(){k=!1;g._parameterCollector.close()},!1);c.appendChild(e);e.appendChild(document.createTextNode(b));e.className=
"dismissButton";return l},function(){l(k)}))return}k=window.confirm(d);l(k)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,d){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){var b=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a),!b)){var c=new f.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),b=c.contentContainer();b.classList.add("parameterPopup");var l=window.document.activeElement,k=this._parameterCollector.getFillFunction(a,function(){l&&l.focus();c.destroy()})(b);c.show();window.setTimeout(function(){k.focus();k.select()},0);b=!0}b||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||
window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function d(a){var f=a.invocation;if(f)if(a=a.command,a.hrefCallback)f=a.hrefCallback.call(f.handler||window,f),f.then?f.then(function(a){window.open(a)}):window.open(f);else if(a.onClick||a.callback)(a.onClick||a.callback).call(f.handler||window,f)}function f(a){return function(){d(a)}}var b=
{},c,l,k=[],g;for(g in this._activeBindings)(l=this._activeBindings[g])&&l.keyBinding&&l.command&&k.push(l);k.sort(function(a,d){return a.command.name.localeCompare(d.command.name)});for(g=0;g<k.length;g++)l=k[g],l.keyBinding.scopeName?(b[l.keyBinding.scopeName]||(b[l.keyBinding.scopeName]=[]),b[l.keyBinding.scopeName].push(l)):(c=h.getUserKeyString(l.keyBinding),a.createItem(c,l.command.name,f(l)));for(var e in b)b[e].length&&b[e].length>0&&(a.createHeader(e),b[e].forEach(function(d){c=h.getUserKeyString(d.keyBinding);
a.createItem(c,d.command.name,f(d))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var f=this;d.forEach(function(d){f._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,d,f,b,c,l,k,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];c&&(a=this._createEntryForPath(a,c));if(a[d]){if(b)a[d].title=b;if(f)a[d].position=f;if(k)a[d].imageClass=
k;if(g)a[d].tooltip=g;a[d].emptyGroupMessage=l}else a[d]={title:b,position:f,emptyGroupMessage:l,imageClass:k,tooltip:g,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){if(d.length>1)a[d]||(a[d]={position:0,children:{}}),a=a[d].children});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,
d,f,b,c,l,k){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[d]={position:f};l&&((f=this._commandList[d])?this._addBinding(f,"key",l,c):this._addPendingBinding(d,"key",l,c));k&&((f=this._commandList[d])?this._addBinding(f,"url",k,c):this._addPendingBinding(d,"url",k,c));a.sortedContributions=null},_addBinding:function(a,d,f,b){if(!a.id)throw Error("No command id: "+a);d==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:f,bindingOnly:b}:d==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:b})},_addPendingBinding:function(a,d,f,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,binding:f,bindingOnly:b})},_checkForTrailingSeparator:function(a,d,f){var b;if(d==="tool"||d==="button")if((b=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&b.classList.contains("commandSeparator"))return f?(a.removeChild(b),!1):!0;if(d===
"menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(b=a[a.length-1],f)b.parentNode.parentNode.removeChild(b.parentNode);else return!0;return!1},renderCommands:function(a,d,f,b,l,k,g){if(typeof a!=="string")throw"a scope id for rendering must be specified";d=c.node(d);if(!d)throw"no parent";var e=this._contributionsByScopeId[a];if(!f&&e){var f=e.localSelectionService||this._selectionService,m=this;f&&f.getSelections(function(f){m.renderCommands(a,
d,f,b,l,k)})}else e&&(this._render(this._contributionsByScopeId[a],d,f,b,l||"button",k,g),this._checkForTrailingSeparator(d,l,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,b,c,l,k,g,e){var m=a.sortedContributions;if(!m){var m=[],h=!1,o;for(o in a)if(!a.hasOwnProperty||a.hasOwnProperty(o)){var j=
a[o];if(j&&typeof j.position==="number")j.id=o,m.push(j),h=!0}if(h)m.sort(function(a,d){return a.position-d.position}),a.sortedContributions=m}var n=0,r=this;m.forEach(function(a){var m,h;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){m=a.children;var o;if(k==="tool"||k==="button")if(a.title)o=r._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip),e&&d.generateNavGrid(e,o.menuButton),window.setTimeout(function(){r._render(a.children,o.menu,
c,l,"menu",g,e);r._checkForTrailingSeparator(o.menu,"menu",!0);if(o.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!o.menuButton.emptyGroupTooltip)o.menuButton.emptyGroupTooltip=new f.Tooltip({node:o.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else e&&d.removeNavGrid(e,o.menuButton),o.menu.parentNode&&o.menu.parentNode.removeChild(o.menu),o.destroyButton&&o.destroyButton.parentNode&&o.destroyButton.parentNode.removeChild(o.destroyButton);
else o.menuButton.style.visibility="visible"},0);else{var j;b.childNodes.length>0&&!r._checkForTrailingSeparator(b,k)&&(j=r.generateSeparatorImage(b));r._render(m,b,c,l,k,g,e);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==j&&(j=r.generateSeparatorImage(b))}else if(a.title){if(j=r._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))r._render(m,j.menu,c,l,"menu",g,e),j.menu.childNodes.length===0&&j.destroyButton&&b.removeChild(j.destroyButton)}else b.childNodes.length>0&&r._generateMenuSeparator(b),
r._render(m,b,c,l,k,g,e),r._generateMenuSeparator(b)}else{var p=r._commandList[a.id];m=p?!0:!1;var z=null,z=null;if(p){h=new i.CommandInvocation(l,c,g,p,r);h.domParent=b;j=m&&(p.visibleWhen?p.visibleWhen(c):!0);if(r._activeBindings[p.id]&&r._activeBindings[p.id].keyBinding)z=r._activeBindings[p.id],z.invocation=j?h:null,z.bindingOnly&&(m=!1);if(r._urlBindings[p.id]&&r._urlBindings[p.id].urlBinding)z=r._urlBindings[p.id],z.invocation=j?h:null,z.bindingOnly&&(m=!1);m=m&&j}if(m)p.choiceCallback?(k===
"tool"||k==="button"?(m=b,j=!1,b.nodeName.toLowerCase()==="ul"&&(m=document.createElement("li"),b.appendChild(m))):(m=b,j=!0),r._createDropdownMenu(m,p.name,j,function(a){p.populateChoicesMenu(a,c,l,g,r)}.bind(p),p.imageClass,p.tooltip||p.title)):(h.handler=h.handler||this,h.domParent=b,j=function(){r._invoke(h)},k==="menu"?m=i.createCommandMenuItem(b,p,h,null,j):(m=k+p.id+n,m=i.createCommandItem(b,p,h,m,null,k==="tool",j)),d.generateNavGrid(e,m),h.domNode=m,n++)}})},_createDropdownMenu:function(a,
d,b,l,e,m){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var h,o=a;if(b)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(k),c.processTextNodes(m,{ButtonText:d}),a.appendChild(m),h=a.lastChild,a=h.lastChild,d=a.previousSibling,d.dropdown=new g.Dropdown({dropdown:a,populate:l}),a.dropdown=d.dropdown;else if(a.nodeName.toLowerCase()==="ul"&&(o=document.createElement("li"),a.appendChild(o),h=o),a=null,e&&(a="dropdownButtonWithIcon",m=m||d),m=e?m||d:m,l=i.createDropdownMenu(o,
d,l,a,e),d=l.menuButton,a=l.menu,m)d.commandTooltip=new f.Tooltip({node:d,text:m,position:["above","below","right","left"]});return{menuButton:d,menu:a,dropdown:d.dropdown,destroyButton:h}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");d.appendChild(f);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};l.prototype.constructor=l;m.prototype={match:function(a){a=e.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};o.prototype.constructor=o;n.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:
null},setValue:function(a,d){var f=this.parameterTable[a];if(f)f.value=d},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new o(d.name,d.type,d.label,d.value,d.lines);a.push(d)});var d=new n(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};n.prototype.constructor=
n;return{CommandRegistry:l,URLBinding:m,ParametersDescription:n,CommandParameter:o}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder","Choose a Folder":"Choose a Folder",
"Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
"Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to",
"Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location","Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer",
"Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content",Favorites:"Favorites","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:",
"Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});
define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,i){function h(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var e={};return{getMessageBundle:function(c){function g(){j(["i18n!"+c],function(a){if(a){var d=c;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+d,JSON.stringify(a));delete a._expires}b.resolve(a)})}if(e[c])return e[c];var b=new i;e[c]=
b;var k=h(c);if(k)return b.resolve(k),b;try{j([c],g)}catch(a){j(["orion/i18n!"+c],g)}return b},formatMessage:function(c){var g=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(b,c){return g[(c<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,i,h){function e(b,c,a){if(!b[c])throw c+j[" is not supported in this file system"];return b[c].apply(b,a)}function c(b,k,a,f){if(!b.readBlob)throw j["source file service does not support binary read"];if(!a.writeBlob)throw j["target file service does not support binary write"];if(k[k.length-1]!=="/")return e(b,"readBlob",[k]).then(function(d){return e(a,"writeBlob",[f,d])});var d=f.substring(0,
f.length-1),l=decodeURIComponent(d.substring(d.lastIndexOf("/")+1)),d=d.substring(0,d.lastIndexOf("/")+1);return e(a,"createFolder",[d,l]).then(function(){},function(){}).then(function(){return e(b,"fetchChildren",[k]).then(function(d){for(var l=[],k=0;k<d.length;++k){var g=d[k].Location,e=g;d[k].Directory&&(e=g.substring(0,g.length-1));e=decodeURIComponent(e.substring(e.lastIndexOf("/")+1));e=f+encodeURIComponent(e);d[k].Directory&&(e+="/");l[k]=c(b,g,a,e)}return i.all(l)})})}function g(b,c){function a(a){var d=
new i;d.reject(j["No Matching FileService for location:"]+a);return d}var f=b.getServiceReferences("orion.core.file"),d=f;if(c)for(var d=[],l=0;l<f.length;++l)c(f[l])&&d.push(f[l]);for(var g=[],e=[],n=[],p=[],w={fetchChildren:function(){var a=new i;a.resolve(p);return a},createWorkspace:function(){var a=new i;a.reject(j["no file service"]);return a},loadWorkspaces:function(){var a=new i;a.reject(j["no file service"]);return a},loadWorkspace:function(){var a=new i;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:j["File Servers"],Location:"/",Children:p,ChildrenLocation:"/"})},100);return a},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},f=0;f<d.length;++f)p[f]={Directory:!0,Length:0,LocalTimeStamp:0,Location:d[f].getProperty("top"),ChildrenLocation:d[f].getProperty("top"),Name:d[f].getProperty("Name")},l=d[f].getProperty("pattern")||".*",l[0]!=="^"&&(l="^"+l),g[f]=RegExp(l),e[f]=b.getService(d[f]),n[f]=d[f].getProperty("Name"),
d[f].getProperty("NameKey")&&d[f].getProperty("nls")&&h.getMessageBundle(d[f].getProperty("nls")).then(function(a,f){p[a].Name=f[d[a].getProperty("NameKey")];n[a]=f[d[a].getProperty("NameKey")]}.bind(this,f));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return e[0]?0:-1;for(var d=0;d<g.length;++d)if(g[d].test(a))return d;throw j["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?w:e[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?w.Name:n[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?w.Location:p[a].Location}}g.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return e(this._getService(b),"fetchChildren",arguments)},createWorkspace:function(b){return e(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return e(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,c,a,f){return e(this._getService(b),"createProject",arguments)},createFolder:function(b,c){return e(this._getService(b),"createFolder",arguments)},createFile:function(b,c){return e(this._getService(b),"createFile",arguments)},deleteFile:function(b){return e(this._getService(b),"deleteFile",arguments)},
moveFile:function(b,k,a){var f=this._getService(b),d=this._getService(k);if(f===d)return e(f,"moveFile",arguments);var l=b[b.length-1]==="/",g=k;g[g.length-1]!=="/"&&(g+="/");if(a)g+=encodeURIComponent(a);else{var h=b;l&&(h=h.substring(0,h.length-1));g+=h.substring(h.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return c(f,b,d,g).then(function(){return e(f,"deleteFile",[b])})},copyFile:function(b,k,a){var f=this._getService(b),d=this._getService(k);if(f===d)return e(f,"copyFile",arguments);
var l=b[b.length-1]==="/",g=k;g[g.length-1]!=="/"&&(g+="/");if(a)g+=encodeURIComponent(a);else{var h=b;l&&(h=h.substring(0,h.length-1));g+=h.substring(h.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return c(f,b,d,g)},read:function(b,c){return e(this._getService(b),"read",arguments)},write:function(b,c,a){return e(this._getService(b),"write",arguments)},remoteImport:function(b,c){return e(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,c){return e(this._getService(b),
"remoteExport",arguments)},search:function(b){return e(this._getService(b.resource),"search",arguments)}};g.prototype.constructor=g;return{FileClient:g}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search",
"Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/editor/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/URITemplate",[],function(){function j(a){this._text=a}function i(a,f){if(f==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(f==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(f==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+f);}function h(a,f,d){for(var b=[],c=0;c<a.length;c++)typeof a[c]!=="undefined"&&
b.push(i(a[c],f));return b.join(d)}function e(a,f,d,b){for(var c=Object.keys(a),k=[],g=0;g<c.length;g++)typeof a[c[g]]!=="undefined"&&k.push(i(c[g],f)+d+i(a[c[g]],f));return k.join(b)}function c(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=b[a[0]])?a=a.substring(1):this._operator=b.NUL;for(var f=[],d=a.split(","),c=0;c<d.length;c++){var g=d[c].match(k);if(g===null)throw Error("Bad VarSpec: "+a);f.push({name:g[1],explode:!!g[2],prefix:g[3]?parseInt(g[3],
10):-1})}this._varSpecList=f}function g(a){for(var f=[],d=0,b=a.indexOf("{",d);b!==-1;){f.push(new j(a.substring(d,b)));d=a.indexOf("}",b+1);if(d===-1)throw Error("Invalid template: "+a);f.push(new c(a.substring(b+1,d)));d+=1;b=a.indexOf("{",d)}f.push(new j(a.substring(d)));this._templateComponents=f}var b={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},k=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;j.prototype={expand:function(){return encodeURI(this._text)}};c.prototype={expand:function(a){for(var f=[],d=
0;d<this._varSpecList.length;d++){var b=this._varSpecList[d],c=b.name,k=a[c],g=typeof k;if(g!=="undefined"&&k!==null){var j=f.length===0?this._operator.first:this._operator.sep;if(g==="string")this._operator.named&&(j+=i(c,"U+R"),j+=k.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<k.length&&(k=k.substring(0,b.prefix)),j+=i(k,this._operator.allow);else if(Array.isArray(k))b.explode?j+=h(k,this._operator.allow,this._operator.sep):(this._operator.named&&(j+=i(c,"U+R"),j+=k.length===0?this._operator.ifemp:
"="),j+=h(k,this._operator.allow,","));else if(g==="object")b.explode?j+=e(k,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(j+=i(c,"U+R"),j+=Object.keys(k).length===0?this._operator.ifemp:"="),j+=e(k,this._operator.allow,",",","));else throw Error("bad param type: "+c+" : "+g);f.push(j)}}return f.join("")}};g.prototype={expand:function(a){for(var f=[],d=0;d<this._templateComponents.length;d++)f.push(this._templateComponents[d].expand(a));return f.join("")}};return g});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,i,h,e,c,g){function b(a,f,d){var b="";d&&(b="^");if(b=h.parse("/"+b+a.searchStr+"/"))d=b.pattern,b=b.flags,b.indexOf("i")===-1&&!f.caseSensitive&&(b+="i"),a.regExp={pattern:d,flags:b},a.wildCard=!0}var k={ALL_FILE_TYPE:"*.*"};k.doSearch=function(a,f,d,b){if(a){var c=!0;d==="*"&&(d="");d===""&&(c=b&&b.type!==k.ALL_FILE_TYPE);if(c){d!==""&&k.addRecentSearch(f,
d,b?b.regEx:!1);var a=a.createSearchParams(d,!1,!1,b),g=k.generateSearchHref(a);k.getOpenSearchPref(f,function(a){a?window.open(g):window.location=g})}}else window.alert(j["Can't search: no search service is available"])};k.generateSearchHelper=function(a,f){var d=a.keyword,c=d,g={};a.fileType&&a.fileType!==k.ALL_FILE_TYPE&&d===""&&(c="*."+a.fileType);if(a.regEx)g.searchStr=d,b(g,a,f);else{var e=d.indexOf("*")>-1,h=d.indexOf("?")>-1;e&&(d=d.split("*").join(".*"));h&&(d=d.split("?").join("."));!e&&
!h&&!a.nameSearch?(g.searchStr=a.caseSensitive?d.split("\\").join(""):d.split("\\").join("").toLowerCase(),g.wildCard=!1):(g.searchStr=a.caseSensitive?d:d.toLowerCase(),b(g,a,f),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:a,inFileQuery:g,displayedSearchTerm:c}};k.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"};k.copySearchParams=function(a,f){var d={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(f||b!=="replace"))d[b]=a[b];return d};k.generateSearchHref=function(a){var f=i.toUrl("search/search.html"),a=k.copySearchParams(a,!0),d=a.resource;a.resource=void 0;return(new g(f+"#{,resource,params*}")).expand({resource:d,params:a})};k.generateFindURLBinding=function(a,
f,d,b){a={find:f.searchStr,regEx:f.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof b==="string"?b:void 0,atLine:typeof d==="number"?d:void 0};return","+(new g("{,params*}")).expand({params:a})};k.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)};k.replaceRegEx=function(a,
f,d){return a.replace(RegExp(f.pattern,f.flags),d)};k.replaceStringLiteral=function(a,f,d){f=h.parse("/"+f+"/gim");return k.replaceRegEx(a,f,d)};k.searchOnelineLiteral=function(a,f,d){var b;b=0;for(var c=!1,g=[];;)if(b=f.indexOf(a.searchStr,b),b<0)break;else{g.push({startIndex:b,length:a.searchStrLength});c=!0;if(d)break;b+=a.searchStrLength}return c?g:null};k.findRegExp=function(a,f,d,b){if(!f)return null;d=d||"";d+=(d.indexOf("g")===-1?"g":"")+(d.indexOf("m")===-1?"m":"");var c=null;return(c=RegExp(f,
d).exec(a.substring(b)))&&{startIndex:c.index+b,length:c[0].length}};k.searchOnelineRegEx=function(a,f,d){for(var b=0,c=!1,g=[];;)if(b=k.findRegExp(f,a.regExp.pattern,a.regExp.flags,b)){g.push(b);c=!0;if(d)break;b=b.startIndex+b.length}else break;return c?g:null};k.generateNewContents=function(a,f,d,b,c,g){if(b&&f){if(!a)d.contents=[];for(var e=0;e<f.length;e++){for(var h=f[e],i=!1,j=!1,v=[],t,u=0,s=0;s<b.children.length;s++)if(b.children[s].lineNumber-1===e){u=s;for(i=0;i<b.children[s].matches.length;i++)b.children[s+
i].checked!==!1&&v.push(i);j=v.length>0;t=b.children[s].matches;i=!0;break}if(i){if(j){v=k.replaceCheckedMatches(h,c,t,v,g);h=v.replacedStr;for(i=0;i<b.children[u].matches.length;i++)b.children[u+i].newMatches=v.newMatches}else for(i=0;i<b.children[u].matches.length;i++)b.children[u+i].newMatches=b.children[u+i].matches;a?d.contents[e]=h:d.contents.push(h)}else a||d.contents.push(h)}}};k.generateMatchContext=function(a,f,d){var b=[],c=a*2+1,g;f.length<=c?(g=0,a=f.length-1):(g=d-a,g<0?(g=0,a=g+c-1):
(a=d+a,a>f.length-1&&(a=f.length-1,g=a-c+1)));for(c=g;c<=a;c++)b.push({context:f[c],current:c===d});return b};k.splitFile=function(a){for(var f=0,d=0,b=0,c=0,g=[];;){f!==-1&&f<=b&&(f=a.indexOf("\r",b));d!==-1&&d<=b&&(d=a.indexOf("\n",b));if(d===-1&&f===-1){g.push(a.substring(c));break}var k=1;f!==-1&&d!==-1?f+1===d?(k=2,b=d+1):b=(f<d?f:d)+1:b=f!==-1?f+1:d+1;g.push(a.substring(c,b-k));c=b}return g};k.searchWithinFile=function(a,f,d,b,c,g){d=k.splitFile(d);if(c)f.contents=d;if(f){f.children=[];for(var e=
b=0;e<d.length;e++){var h=d[e];if(h&&h.length>0){var i=g?h:h.toLowerCase();if(i=a.wildCard?k.searchOnelineRegEx(a,i):k.searchOnelineLiteral(a,i)){var j,v=e+1;if(c)for(var t=0;t<i.length;t++)j=t+1,j={parent:f,checked:f.checked,type:"detail",matches:i,lineNumber:v,matchNumber:j,name:h,location:f.location+"-"+v+"-"+j},f.children.push(j);else j={parent:f,context:k.generateMatchContext(2,d,e),checked:f.checked,type:"detail",matches:i,lineNumber:v,name:h,location:f.location+"-"+v},f.children.push(j);b+=
i.length}}}f.totalMatches=b}};k.replaceCheckedMatches=function(a,f,d,b,c){for(var g=0,k="",e=[],h=0;h<d.length;h++){g!==d[h].startIndex&&(k+=a.substring(g,d[h].startIndex));if(d[h].length)c=d[h].length;for(var g=!1,i=0;i<b.length;i++)if(b[i]===h){g=!0;break}g?(e.push({startIndex:k.length,length:f.length}),k+=f):(e.push({startIndex:k.length,length:c}),k+=a.substring(d[h].startIndex,d[h].startIndex+c));g=d[h].startIndex+c}g<a.length&&(k+=a.substring(g));return{replacedStr:k,newMatches:e}};k.fullPathNameByMeta=
function(a){var f=a.length,d="";if(f>0)for(f-=1;f>-1;f--)d=d+(d===""?"":"/")+a[f].Name;return d};k.path2FolderName=function(a,f,d){return a.substring(0,a.length-f.length-(d?0:1))};k._storeRecentSearch=function(a,f,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",f);d&&window.setTimeout(function(){d.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};k.addRecentSearch=function(a,f,d){typeof f==="string"&&f&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var c,
b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b){for(c in b)if(b[c].name===f)return;b.length>=20&&b.splice(19,b.length-20+1)}else b=[];b.splice(0,0,{name:f,regEx:d});k._storeRecentSearch(a,b)})};k.removeRecentSearch=function(a,f,d){typeof f==="string"&&f&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var c,b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b)for(c in b)if(b[c].name===f){b.splice(c,1);k._storeRecentSearch(a,
b,d);break}})};k.getSearches=function(a,f,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(f);typeof a==="string"&&(a=JSON.parse(a));a&&d&&d(a)})};k.getMixedSearches=function(a,f,d,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var c=a.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));f&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(d){var b=k.parseQueryStr(a.query);
c.some(function(a){return b.searchStrTitle===a.name})||c.push({name:b.searchStrTitle,label:a.name})}else c.push({name:null,label:a.name,value:a.query})}));c&&b&&b(c)})};k.getOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};k.setOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:b})})};return k});define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/contentTypes",[],function(){function j(c,b){function k(a,d,b,f){var b=d.filename.indexOf(b)>=0,c=d.extension.indexOf(f)>=0;if(b||c)if(!a||b&&a.extension.indexOf(f)>=0)return d;return a}for(var a=c&&c.split(".").pop(),f=null,d=0;d<b.length;d++){var l=b[d];k(f,l,c,a)===l&&(f=l)}return f}function i(g){this.serviceRegistry=g;this.map=function(b){function g(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var b=b.getServiceReferences(e).concat(b.getServiceReferences(c)),
a={},f=0;f<b.length;f++)for(var d=g(b[f].getProperty("contentTypes")),l=0;l<d.length;l++){var h=d[l];a[h.id]||(a[h.id]={id:h.id,name:h.name,image:h.image,"extends":h["extends"],extension:g(h.extension),filename:g(h.filename)})}return a}(g);g.registerService(h,this)}var h="orion.core.contenttypes",e="orion.core.contenttype",c="orion.file.contenttype";i.prototype={getContentTypes:function(){var c=this.getContentTypesMap(),b=[],k;for(k in c)c.hasOwnProperty(k)&&b.push(c[k]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(c){return j(c.Name,this.getContentTypes())},getFilenameContentType:function(c){return j(c,this.getContentTypes())},getContentType:function(c){return this.map[c]||null},isExtensionOf:function(c,b){c=typeof c==="string"?this.getContentType(c):c;b=typeof b==="string"?this.getContentType(b):b;if(!c||!b)return!1;if(c.id===b.id)return!0;else for(var k=c,a={};k&&(k=this.getContentType(k["extends"]));){if(k.id===b.id)return!0;if(a[k.id])throw Error("Cycle: "+k.id);a[k.id]=!0}return!1},
isSomeExtensionOf:function(c,b){for(var k=0;k<b.length;k++)if(this.isExtensionOf(c,b[k]))return!0;return!1}};return{ContentTypeService:i,getFilenameContentType:j}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,i,h,e,c,g){function b(b,a,f,d){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=d&&d.searchOnName;this._buildSkeletonOnly=d&&d.buildSkeletonOnly;this._fetchChildrenCallBack=d&&d.fetchChildrenCallBack;this._searchParams=f;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(f);this._location=d&&d.location;this._childrenLocation=d&&d.childrenLocation?d.childrenLocation:this._location}b.prototype.search=function(b){var a=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=b;a.getContentTypes().then(function(a){this.contentTypesCache=a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};b.prototype.searchName=function(b,a){if(b)this.searchHelper=e.generateSearchHelper(b,!0);if(a)this.onSearchNameComplete=a;var f=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var d=0;d<this.fileSkeleton.length;d++){var c=this.fileSkeleton[d].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(f.push(this.fileSkeleton[d]),
f.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:f.length,docs:f}})}};b.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var f=this.registry.getService("orion.core.contenttypes"),d=this;b();f.getContentTypes().then(function(b){d.contentTypesCache=b;d._visitRecursively(d._childrenLocation).then(function(){d._buildingSkeleton=!1;a();d.searchHelper&&!d._buildSkeletonOnly&&d.searchName()})})};b.prototype._searchCompleted=function(){console.log("Search Completed.")};
b.prototype._searchFiles=function(){var b=[],a;if(this.fileLocations.length>0){a=this;for(var f=0;f<a.fileLocations.length;f++)b.push(a._sniffSearch(a.fileLocations[f]))}return g.all(b)};b.prototype._sort=function(b){b.sort(function(a,b){var d=a.Name&&a.Name.toLowerCase(),c=b.Name&&b.Name.toLowerCase();return d<c?-1:d>c?1:0})};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};b.prototype._visitRecursively=function(b){var a=[],f=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var d=f.registry.getService("orion.page.progress");return(d?d.progress(f.fileClient.fetchChildren(b),"Crawling search for children of "+b):f.fileClient.fetchChildren(b)).then(function(d){for(var b=0;b<d.length;b++)if(d[b].Directory!==void 0&&d[b].Directory===!1)if(f._searchOnName)a.push(f._buildSingleSkeleton(d[b]));else if(f._buildSkeletonOnly)a.push(f._buildSingleSkeleton(d[b]));
else{var k=c.getFilenameContentType(d[b].Name,f.contentTypesCache);k&&(k["extends"]==="text/plain"||k.id==="text/plain")&&f._onFileType(k)&&a.push(f._sniffSearch(d[b]))}else d[b].Location&&a.push(f._visitRecursively(d[b].ChildrenLocation));return g.all(a)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,
b,!0)};b.prototype._reportSingleHit=function(b){b.LastModified=b.LocalTimeStamp;this.fileLocations.push(b);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};b.prototype._sniffSearch=function(b){this._totalCounter++;var a=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(j["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(a.fileClient.read(b.Location),"Reading file "+b.Location).then(function(f){a._hitOnceWithinFile(f)&&a._reportSingleHit(b);a.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(j["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new g;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,i){function h(e){this._init(e)}h.prototype={_init:function(e){var c=e.parent,g=this,c=i.node(c);if(!c)throw j["no parent"];if(!e.model)throw j["no tree model"];if(!e.renderer)throw j["no renderer"];this._parent=c;this._treeModel=e.model;this._renderer=e.renderer;this._showRoot=e.showRoot===void 0?!1:e.showRoot;this._indent=e.indent===void 0?16:e.indent;this._onCollapse=e.onCollapse;this._labelColumnIndex=
e.labelColumnIndex===void 0?0:e.labelColumnIndex;this._id=e.id===void 0?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){g._showRoot?(b._depth=0,g._generate([b],0)):g._treeModel.getChildren(b,function(b){g._generate(b,0)})})},_generate:function(e,c){i.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(g);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(e,c);b.appendChild(this._bodyElement);g.appendChild(b);
this._parent.appendChild(g);this._rowsChanged()},_generateChildren:function(e,c,g){for(var b=0;b<e.length;b++){var k=document.createElement(this._tableRowElement);k.id=this._treeModel.getId(e[b]);this._renderer.rowCallback&&this._renderer.rowCallback(k);k._depth=c;k._item=e[b];this._renderer.render(e[b],k);k.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*c+"px";g?(this._bodyElement.insertBefore(k,g.nextSibling),g&&(g=k)):this._bodyElement.appendChild(k)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,c,g){var b=this._treeModel.getId(e),k;if(b===this._id)this._removeChildRows(b),this._generateChildren(c,0),this._rowsChanged();else{var a=i.node(b);a?(a._item=e,a&&(g||a._expanded)?(a._expanded=!0,this._removeChildRows(b),this._renderer.updateExpandVisuals(a,!0),c?(this._generateChildren(c,a._depth+1,a),this._rowsChanged()):(k=this,c=this._treeModel.getChildren(a._item,function(b){k._generateChildren(b,
a._depth+1,a);k._rowsChanged()}))):this._renderer.updateExpandVisuals(a,!1)):console.log(j["could not find table row "]+b)}},getItem:function(e){var c=i.node(e);return c&&c._item?c._item:e},toggle:function(e){var c=i.node(e);c&&(c._expanded?(this.collapse(e),this._renderer.updateExpandVisuals(c,!1)):(this.expand(e),this._renderer.updateExpandVisuals(c,!0)))},isExpanded:function(e){return(e=i.node(e))?e._expanded:!1},expand:function(e,c,g){var e=typeof e==="string"?e:this._treeModel.getId(e),b=i.node(e);
if(b&&!b._expanded){b._expanded=!0;var k=this;this._renderer.updateExpandVisuals(b,!0);this._treeModel.getChildren(b._item,function(a){k._generateChildren(a,b._depth+1,b);k._rowsChanged();c&&c.apply(k,g)})}},_removeChildRows:function(e){for(var c=e===this._id,g=!1,b=-1,k=[],a=i.$$array(".treeTableRow",this._parent),f=0;f<a.length;f++){var d=a[f];if(g)break;if(c)d._depth>b?k.push(d):g=!0;else if(d.id===e)c=!0,b=d._depth}for(e=0;e<k.length;e++)c=k[e],c.parentNode.removeChild(c)},collapse:function(e){var e=
typeof e==="string"?e:this._treeModel.getId(e),c=i.node(e);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};h.prototype.constructor=h;return{TableTree:h}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function i(h,e){this.firstLevelChildren=h;this.reset();this._init(e)}i.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var e=this._getChildren(h),e=e&&e.length>0;this.isExpanded&&e&&(e=this.isExpanded(h));return e},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(this._getChildren(h)[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(g){g&&c.setCursor(g)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(h){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(h&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var c=this;return this.forceExpandFunc(e,"last",function(g){g&&
c.setCursor(g)})}e&&this.setCursor(e);return e},_findSibling:function(h,e){for(var c=this.topLevel(h),g=this._getChildren(h.parent),g=c?this.firstLevelChildren:g,b=0;b<g.length;b++)if(g[b]===h)return b===0&&!e?c?null:h.parent:b===g.length-1&&e?c?null:this._findSibling(h.parent,e):e?g[b+1]:g[b-1];return null},_inParentChain:function(h,e){for(var c=h.parent;c;){if(c===e)return!0;c=c.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;
h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,e,c){this.setCursor(e);var g=[];for(g.push(e);;){if(this.iterate(h))g.push(this.cursor());else break;if(c===this.cursor())return g}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(h,e){var c=this.cursor(),
g=this._scan(!0,h,e);g||(g=this._scan(!1,h,e));this.setCursor(c);return g},iterate:function(h,e){return h?this._forward(e):this._backward(e)},iterateOnTop:function(h,e){var c=this._findSibling(this._getTopLevelParent(this.cursor()),h);c?this.setCursor(c):e&&this.firstLevelChildren.length>0&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){if(!this._cursor)return null;return this._inParentChain(this._cursor,h)?(this.setCursor(h),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return i}();return j});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(j,i,h){var j={},e=navigator.userAgent.indexOf("iPad")!==-1,c=window.navigator.platform.indexOf("Mac")!==-1;j.ExplorerNavHandler=function(){function g(b,c,a){this.explorer=b;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;var f=this._getEventListeningDiv();f.tabIndex=0;f.classList.add("selectionModelContainer");
var d=this;this._modelIterator=new h.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:a.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return d.explorer.renderer.isExpandable(a)}:function(a){return d.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,f){return d.explorer.forceExpandFunc(a,b,f)}:void 0});this._init(a);(!a||a.setFocus!==!1)&&f.focus();b=function(a){if(a.target===f){if(d.explorer.preventDefaultFunc&&d.explorer.preventDefaultFunc(a,
d._modelIterator.cursor()))return!0;if(a.keyCode===i.KEY.DOWN)return d.onDownArrow(a);else if(a.keyCode===i.KEY.UP)return d.onUpArrow(a);else if(a.keyCode===i.KEY.RIGHT)return d.onRightArrow(a);else if(a.keyCode===i.KEY.LEFT)return d.onLeftArrow(a);else if(a.keyCode===i.KEY.SPACE)return d.onSpace(a);else if(a.keyCode===i.KEY.ENTER)return d.onEnter(a)}};f.addEventListener("keydown",b,!1);this._listeners.push({type:"keydown",listener:b});b=function(){if(d.explorer.onFocus)d.explorer.onFocus(!1);else d.toggleCursor(null,
!1)};f.addEventListener("blur",b,!1);this._listeners.push({type:"blur",listener:b});b=function(){if(d.explorer.onFocus)d.explorer.onFocus(!0);else d.toggleCursor(null,!0)};f.addEventListener("focus",b,!1);this._listeners.push({type:"focus",listener:b});this._parentDiv=f}g.prototype={_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=
b.postDefaultFunc},_ctrlKeyOn:function(b){return c?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(b):i.node(this.explorer._parentId)},
isExpandable:function(b){return!b?!1:i.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(a){c._clearSelection();for(var f=0;f<a.length;f++)c._selections.push(a[f]);c._selections.length>0&&c.cursorOn(c._selections[0],!0,!1,b)})},refreshModel:function(b,c,a,f){this._currentColumn=
0;this.topIterationNodes=[];this.model=c;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(a)this.topIterationNodes=a;this._modelIterator.setTree(this.topIterationNodes);!f&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var b=this.model.getId(b),c=0;c<this._selections.length;c++)if(b===this.model.getId(this._selections[c]))return c;
return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},setSelection:function(b,c){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){if(!c||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b;else{var a=this._inSelection(b);a>=0?(this._checkRow(b,
!0),this._selections.splice(a,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,c){b||(b=this.currentModel());var a=this._getGridChildren(b);if(a&&a.length>1||c===0&&a){c!==0&&this.toggleCursor(b,!1);var f=this._currentColumn,d=!0;f+=c;f<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():d=!1),
f=d?a.length-1:this._currentColumn):f>=a.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():d=!1),f=d?0:this._currentColumn);this._currentColumn=f;c!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var c=
this._parentDiv,a;b&&b!==c&&(a=b.getAttribute("role"))!=="grid"&&a!=="tree"&&a!=="treegrid";)b=b.parentNode;return b===c?null:b},toggleCursor:function(b,c){var a=this.getRowDiv(b),f=this.getCurrentGrid(b);f?(a&&(c?a.classList.add("treeIterationCursorRow"):a.classList.remove("treeIterationCursorRow")),f.domNode&&(a=this.getAriaContainerElement(f.domNode),c?(f.domNode.classList.add("treeIterationCursor"),a&&a.setAttribute("aria-activedescendant",f.domNode.id)):f.domNode.classList.remove("treeIterationCursor"))):
a&&(c?a.classList.add("treeIterationCursorRow_Dotted"):a.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,c,a,f){var a=a===void 0?!1:a,d,g;if(b||c){if(g===this._modelIterator.cursor())return;d=this._modelIterator.cursor();g=b;this._modelIterator.setCursor(g)}else d=this._modelIterator.prevCursor(),g=this._modelIterator.cursor();if(d!==g||c)if(this.toggleCursor(d,!1),!c||g)if(this.moveColumn(null,0),this.toggleCursor(g,
!0),(b=this.getRowDiv())&&!f&&!this._visible(b)&&b.scrollIntoView(!a),this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,g)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],c=0;c<this._selections.length;c++)b.push(this.model.getId(this._selections[c]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),c=this._navDict.getValue(b);return c&&c.rowDomNode?c.rowDomNode:i.node(b)},iterate:function(b,
c,a){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,c)&&(this.cursorOn(null,!1,b),a&&this.setSelection(this.currentModel(),!0))},_checkRow:function(b,c){if(this.explorer.renderer._useCheckboxSelection){var a=this.getRowDiv(b);if(a){var f=i.node(this.explorer.renderer.getCheckBoxId(a.id)),d=c?!f.checked:!0;if(d!==f.checked)this.explorer.renderer.onCheck(a,f,d,!0)}}else this._select(b,c)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(b){return(b=i.node(b))?i.bounds(b).height:0},_visible:function(b){if(b.offsetWidth===0||b.offsetHeight===0)return!1;var c=0;c+=this._getToolBarHeight("staticBanner");c+=this._getToolBarHeight("titleArea");c+=this._getToolBarHeight("pageToolbar");var a=this._getEventListeningDiv(!0).getClientRects()[0],f=this._vpHeight();this._vpWidth();for(var c=a.top>c?a.top:
c,a=a.bottom<f?a.bottom:f,b=b.getClientRects(),f=0,d=b.length;f<d;f++){var g=b[f];if(g.top>=c&&g.top<=a&&g.bottom>=c&&g.bottom<=a)return!0}return!1},_select:function(b){b||(b=this._modelIterator.cursor());var c=this.getRowDiv(b);c&&(this._inSelection(b)<0?c.classList.add("checkedRow"):c.classList.remove("checkedRow"))},_onModelGrid:function(b,c){var a=this._getGridChildren(b);if(a)for(var f=0;f<a.length;f++)if(c.target===a[f].domNode)return!0;return!1},onClick:function(b,c){var a=i.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));
if(c.target!==a&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,c)))if(this.cursorOn(b,!0,!1,!0),e)this.setSelection(b,!0);else if(this._ctrlKeyOn(c))this.setSelection(b,!0);else if(c.shiftKey&&this._lastSelection){if(a=this._modelIterator.scan(this._lastSelection,b)){this._clearSelection(!0);for(var f=0;f<a.length;f++)this.setSelection(a[f],!0)}}else this.setSelection(b,!1)},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,
!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},_shouldMoveColumn:function(b){var c=this.currentModel(),a=this._getGridChildren(c);return a&&a.length>1?this.isExpandable(c)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,
-1),b.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&this.isExpanded(c))return this.explorer.myTree.collapse(c),b.preventDefault(),!0;this._modelIterator.topLevel(c)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(c.parent),this.setSelection(c.parent,!1))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var c=this._modelIterator.cursor();
if(!c)return!1;if(this.isExpandable(c)&&!this.isExpanded(c))return this.explorer.myTree.expand(c),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0);b.preventDefault()},onEnter:function(b){var c=this.getCurrentGrid(this._modelIterator.cursor());if(c)if(c.widget)if(typeof c.onClick==="function")c.onClick();else typeof c.widget.focus==="function"&&c.widget.focus();
else{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);c.domNode.dispatchEvent(a)}else if(this.explorer.renderer.getRowActionElement&&(c=this._modelIterator.cursor()))if(c=this.explorer.renderer.getRowActionElement(this.model.getId(c)),c.href)this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.href}};return g}();j.ExplorerNavDict=function(){function c(b){this._dict={};this._model=b}c.prototype={addRow:function(b,
c){this._dict[this._model.getId(b)]={model:b,rowDomNode:c}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,c){if(!b)return null;var a=this._model.getId(b);if(this._dict[a]){if(!this._dict[a].gridChildren&&c)this._dict[a].gridChildren=[];return this._dict[a].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);if(this._dict[b])this._dict[b].gridChildren=null}};return c}();return 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,i,h,e,c,g){var b={};b.Explorer=function(){function b(a,f,d,c){this.registry=a;this.renderer=d;this.selection=f;this.commandService=c;this.myTree=null}b.prototype={changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,b,d){a=this.getRow(a);if(d)return a=a.childNodes[d],a.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=b+"placeHolderRow",a.appendChild(d),{tempNode:d,refNode:d};if(a){d=document.createElement("tr");d.id=b+"placeHolderRow";var c=document.createElement("td");c.id=b+"placeHolderCol";d.appendChild(c);a.appendChild(d);d=h.node(b+"placeHolderRow");a=h.node(b+"placeHolderCol");if(d&&a)return{tempNode:d,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return h.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 c=a.length,g=0;g<c;g++)b._expandRecursively(a[g])})})}},createTree:function(a,b,d){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var g=a+"innerTree",k=h.node(g);k&&h.empty(k);if(b)b.rootId=g;this.model=b;this._parentId=a;this._treeOptions=d;if(!d||d&&!d.noSelection)this.selectionPolicy=d?d.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:g,
model:b,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:d?!!d.showRoot:!1,indent:d?d.indent:void 0,onCollapse:d?d.onCollapse:void 0,navHandlerFactory:d?d.navHandlerFactory:void 0,tableElement:d?d.tableElement:void 0,tableBodyElement:d?d.tableBodyElement:void 0,tableRowElement:d?d.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 d=a.getSelection(),c=0;c<d.length;c++){var g=a.getRowDiv(d[c]);g&&g.parentNode&&(g=this.getNavDict().getValue(this.model.getId(d[c])),g.model&&b.push(g.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=
a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(d){d instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,d):d.children&&d.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,
d.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,a){function c(d){return typeof d.getItemCount==="function"?d.getItemCount()>0?a?a(d):!0:!1:!1}var d=new g.Command({tooltip:j["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.expandAll()}}),e=new g.Command({tooltip:j["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(d);b.addCommand(e)};b.ExplorerModel=function(){function b(a,c,d){this.rootPath=a;this.fetchItems=c;this.idPrefix=d||""}b.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(d){a.Children=d;b(d)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,d=0;d<a.length;d++)b+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):a[d];return b}};return b}();b.ExplorerFlatModel=function(){function c(a,b,d){this.rootPath=a;this.fetchItems=b;this.root=d}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=
this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})}};c.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return c}();b.ExplorerRenderer=function(){function b(a,c){this.explorer=c;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.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;h.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,d,c,g){var d=d||"tool",e=document.createElement("td");e.id=b.id+"actionswrapper";c&&e.classList.add(c);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,e,a,this.explorer,d,null,g&&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 e},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var d=document.createElement("td"),c=document.createElement("span");c.id=this.getCheckBoxId(b.id);c.classList.add("core-sprite-check");c.classList.add("selectionCheckmarkSprite");c.rowId=b.id;if(this.getCheckedFunc)c.checked=this.getCheckedFunc(a),c.checked?(this._highlightSelection&&b.classList.add("checkedRow"),c.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),c.classList.remove("core-sprite-check_on"));d.appendChild(c);var g=this;c.addEventListener("click",function(a){g.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return d}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,d,c,g){(b.checked=d)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,d,c);this.explorer.getNavHandler()&&g&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var b;if(a&&this.explorer.getNavDict()){var d=[];for(b=0;b<a.length;b++){var c=this.explorer.getNavDict().getValue(a[b]);if(c&&c.rowDomNode&&
c.model&&(d.push(c.model),this._highlightSelection&&c.rowDomNode.classList.add("checkedRow"),c=h.node(this.getCheckBoxId(c.rowDomNode.id))))c.checked=!0,c.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,d=window.sessionStorage[a+
"expanded"];typeof d==="string"&&(d=d.length>0?JSON.parse(d):null);var c;if(d)for(c=0;c<d.length;c++)if(h.node(d[c])){this._expanded.push(d[c]);var g=this;this.tableTree.expand(d[c],function(){g._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 d=h.node(this.expandCollapseImageId(a.id));d&&(d.classList.add(b?this._expandImageClass:this._collapseImageClass),d.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,d,c){var g=document.createElement("span");g.id=this.expandCollapseImageId(a.id);b.appendChild(g);g.classList.add(this._twistieSpriteClass);g.classList.add(this._collapseImageClass);if(d){var e=document.createElement("span");b.appendChild(e);e.classList.add(c||"imageSprite");e.classList.add(d)}var k=
this;g.onclick=function(){k.tableTree.toggle(a.id);if(k.tableTree.isExpanded(a.id))k._expanded.push(a.id);else for(var d in k._expanded)if(k._expanded[d]===a.id){k._expanded.splice(d,1);break}(d=k._getUIStatePreferencePath())&&window.sessionStorage&&k._storeExpansions(d)};return g},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=
h.$$array(".treeTableRow"),b=0;b<a.length;b++){var d=a[b],c=h.node(d.id+"actionswrapper");this.commandService.destroy(c);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,c,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();b.SelectionRenderer=function(){function c(a,b){this._init(a);this.explorer=b}c.prototype=new b.ExplorerRenderer;
c.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),d=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&d.appendChild(this.initCheckboxColumn(a));for(var c=0,g=this.getCellHeaderElement(c);g;)g.innerHTML.length>0&&g.classList.add("navColumn"),d.appendChild(g),g=this.getCellHeaderElement(++c);b.appendChild(d);c>0&&a.appendChild(b)};c.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var d=
this.explorer.getNavDict();if(d){d.addRow(a,b);var c=this;b.addEventListener("click",function(d){if(c.explorer.getNavHandler())c.explorer.getNavHandler().onClick(a,d)},!1)}if(d=this.getCheckboxColumn(a,b))d.classList.add("checkColumn"),b.appendChild(d);for(var d=0,g=this.getCellElement(d,a,b);g;)b.appendChild(g),d===0?this.getPrimColumnStyle?g.classList.add(this.getPrimColumnStyle()):g.classList.add("navColumn"):this.getSecondaryColumnStyle?g.classList.add(this.getSecondaryColumnStyle()):g.classList.add("secondaryColumn"),
g=this.getCellElement(++d,a,b)};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();b.SimpleFlatModel=function(){function c(a,b,d){this.items=a;this.getKey=d;this.idPrefix=b;this.root={children:a}}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(a){a(this.root)};c.prototype.destroy=function(){};c.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),b="",d=0;d<a.length;d++)b+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):
a[d];return this.idPrefix+b};c.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return c}();return b});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(j,i,h,e,c){function g(){return(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function b(b,a){var f=b.getServiceReferences(a||"orion.page.link"),d=h.matchResourceParameters(window.location.href),l={OrionHome:g(),Location:d.resource},m=[];f.forEach(function(a){var d={};a.getPropertyKeys().forEach(function(b){d[b]=a.getProperty(b)});if(d.uriTemplate&&
d.nls&&(d.name||d.nameKey)){var b=new i;c.getMessageBundle(d.nls).then(function(a){var c=new e(d.uriTemplate),c=window.decodeURIComponent(c.expand(l)),c=h.validateURLScheme(c);d.href=c;d.textContent=d.nameKey?a[d.nameKey]:d.name;b.resolve(d)});m.push(b)}else if(d.uriTemplate&&d.name){var f=new e(d.uriTemplate),f=window.decodeURIComponent(f.expand(l)),f=h.validateURLScheme(f);d.href=f;d.textContent=d.name;m.push((new i).resolve(d))}});return i.all(m)}return{createPageLinks:function(c,a){return b(c,
a).then(function(a){a.sort(function(a,b){var c=a.textContent&&a.textContent.toLowerCase(),f=b.textContent&&b.textContent.toLowerCase();return c<f?-1:c>f?1:0});return a.map(function(a){var b=a.href,a=a.textContent,c=document.createElement("a");c.href=b;c.target="_self";c.classList.add("targetSelector");c.textContent=a;return c})})},getPageLinksInfo:b,getOrionHome:g}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(j,i,h,e,c,g,b,k,a){var f={},d=a.getOrionHome();f._cloneItemWithoutChildren=function o(a){if(a===null||typeof a!=="object")return a;var d=a.constructor(),b;for(b in a)b!=="children"&&b!=="Children"&&(d[b]=o(a[b]));return d};f._getOpenWithNavCommandExtensions=function(a){function d(a,b){for(var c=a.getServiceReferences("orion.navigate.openWith"),
f=[],g=0;g<c.length;g++){var e=c[g];e.getProperty("editor")===b.id&&(e=e.getProperty("contentType"),e instanceof Array?f=f.concat(e):e!==null&&typeof e!=="undefined"&&f.push(e))}return f}for(var b=function(){for(var d=a.getServiceReferences("orion.edit.editor"),b=[],c=0;c<d.length;c++){var f=d[c],g=f.getProperty("id");b.push({id:g,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate")})}return b}(),
c=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),f=[],g=0;g<b.length;g++){var e=b[g],k=c&&c.editor===e.id,l=d(a,e);l.length&&f.push({properties:{name:e.name||e.id,nameKey:e.nameKey,id:"eclipse.openWithCommand."+e.id,tooltip:e.name,tooltipKey:e.nameKey,contentType:l,uriTemplate:e.uriTemplate,nls:e.nls,forceSingleItem:!0,isEditor:k?"default":"editor"},service:{}})}return f};f._makeValidator=function(a,
b,f,e){function k(a,d,b,c){var f=b.match,g;if(d.indexOf("|")>=0)return g=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),k(a,g,b,c)?!0:k(a,d,b,c);else if(d.indexOf(":")>=0)return g=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[g]?k(a[g],d,b,c):!1;else{a:{g=!1;var e;if(typeof a[d]!=="undefined"){if(typeof f==="undefined")e=a[d],g=!0;else if(typeof f==="string"){if(!typeof(a[d]==="string")){b=!1;break a}if(b.variableName){if(f=RegExp(f).exec(a[d]))g=f[0],e=b.variableMatchPosition===
"before"?a[d].substring(0,f.index):b.variableMatchPosition==="after"?a[d].substring(f.index+g.length):b.variableMatchPosition==="only"?g:a[d],g=!0}else{b=RegExp(f).test(a[d]);break a}}else a[d]===f&&(e=a[d],g=!0);if(g&&b.variableName&&(c[b.variableName]=e,c.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)d=!1,b.replacements[a].pattern?c[b.variableName]=c[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):d=!0,d&&window.console.log("Invalid replacements specified in validation property.  "+
b.replacements[a]);b=g}else b=!1}return b}}return{info:a,validationFunction:function(d){typeof e==="function"&&(d=e.call(this,d));if(d){if(Array.isArray(d)){if((this.info.forceSingleItem||this.info.uriTemplate)&&d.length!==1)return!1;if(d.length<1)return!1}else d=[d];for(var b=0;b<d.length;b++){var g;a:{var l=d[b],h=f;if(this.info.validationProperties)for(g=0;g<this.info.validationProperties.length;g++){var i=this.info.validationProperties[g];if(typeof i.source!=="undefined"){if(!k(l,i.source,i,this)){g=
!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");g=!1;break a}}if(this.info.contentType&&h){i=!1;if(l=c.getFilenameContentType(l.Name,h))for(g=0;g<this.info.contentType.length;g++)if(l.id===this.info.contentType[g]){i=!0;break}g=i}else g=!0}if(!g)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);if(this.info.validationProperties)for(c=
0;c<this.info.validationProperties.length;c++){var f=this.info.validationProperties[c];f.source&&f.variableName&&(this.itemCached===a&&this[f.variableName]||k(a,f.source,f,this),a[f.variableName]?window.console.log("Variable name "+f.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[f.variableName]=this[f.variableName])}b.OrionHome=d;a=new g(this.info.uriTemplate);return window.decodeURIComponent(a.expand(b))}return null}}};f._createCommandOptions=
function(a,d,c,g,e,k){function l(b,h){var i=f._makeValidator(a,c,g,k);b.visibleWhen=i.validationFunction.bind(i);if(e)if(i.generatesURI.bind(i)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return i.getURI.bind(i)(a)};else{var j=a;b.callback=function(a){var g;if(j.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,g=f._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){g=[];for(var e=0;e<a.items.length;e++)g.push(f._cloneItemWithoutChildren(a.items[e]))}else g=
f._cloneItemWithoutChildren(a.items);if(c)var k=c.getService("orion.page.progress");d.run?k?k.progress(d.run(g),"Running command: "+b.name):d.run(g):c&&(k?k.progress(c.getService(d).run(g),"Running command: "+b.name):c.getService(d).run(g))}}h.resolve(b)}var h=new i;a.nls?b.getMessageBundle(a.nls).then(function(d){l({name:a.nameKey?d[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?d[a.tooltipKey]:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},h)}):l({name:a.name,image:a.image,
id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},h);return h};f.getOpenWithCommands=function(a){var d=[],b;for(b in a._commandList){var c=a._commandList[b];c.isEditor&&d.push(c)}return d};var l;f.createAndPlaceFileCommandsExtension=function(a,d,b,c,g,e){var k=!!e;return f.createFileCommands(a,null,e?"all":void 0,k).then(function(a){d._addedOpenWithCommands=k;var f=!1,e=!1;a.forEach(function(a){d.addCommand(a);g&&!f&&(f=!0,d.addCommandGroup(b,"eclipse.fileCommandExtensions",
1E3,null,g));g&&!e&&(e=!0,d.addCommandGroup(b,"eclipse.openWith",1E3,"Open With",g+"/eclipse.fileCommandExtensions"));this.isEditor?d.registerCommandContribution(b,a.id,c+this.index,g?g+"/eclipse.fileCommandExtensions/eclipse.openWith":null):d.registerCommandContribution(b,a.id,c+this.index,g?g+"/eclipse.fileCommandExtensions":null)});return{}})};f.createFileCommands=function(a,d,b,c){var b=b===void 0?"global":b,c=c===void 0?!0:c,g=a.getServiceReferences("orion.navigate.command"),e=[];if(b==="all"||
b==="global")for(var k=0;k<g.length;k++)if(g[k].getProperty("id")!=="orion.navigateFromMetadata"){for(var j=a.getService(g[k]),s={},z=g[k].getPropertyKeys(),x=0;x<z.length;x++)s[z[x]]=g[k].getProperty(z[x]);(b==="all"||s.forceSingleItem&&s.showGlobally)&&e.push({properties:s,service:j})}return i.when(function(){var b=a.getService("orion.core.contenttypes")||d;return l||i.when(b.getContentTypes(),function(a){return l=a})}(),function(){e=c?e.concat(f._getOpenWithNavCommandExtensions(a,l)):e;var d=e.map(function(d){var b=
d.properties;return f._createCommandOptions(b,d.service,a,l,!0).then(function(a){a=new h.Command(a);if(b.isEditor)a.isEditor=b.isEditor;return a})});return i.all(d,function(a){return{_error:a}}).then(function(a){return a})})};f.createOpenWithCommands=function(a,d,b){return b&&b._addedOpenWithCommands?(new i).resolve(f.getOpenWithCommands(b)):f.createFileCommands(a,d,"none",!0)};return f});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(j,i,h,e,c,g){function b(a,b,d,c,e,k,h){var j;if(b.Directory)j=document.createElement("a"),j.className="navlinkonpage",j.href=a+"#"+b.ChildrenLocation,j.appendChild(document.createTextNode(b.Name));else{e||(e=g.getOpenWithCommands(d));if(!k)for(a=0;a<e.length;a++)e[a].isEditor===
"default"&&(k=e[a]);j=document.createElement("a");j.className="navlink targetSelector";h&&typeof h==="object"&&Object.keys(h).forEach(function(a){j[a]=h[a]});j.appendChild(document.createTextNode(b.Name));for(var w=b.Location,q=!1,a=0;a<e.length;a++)if(d=e[a],d.visibleWhen(b)){w=d.hrefCallback({items:b});q=!0;break}i.when(c.getFileContentType(b),function(a){var d;if(d=!q)if(d=k){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":d=
!0;break a}d=!1}d=!d}d&&(w=k.hrefCallback({items:b}));d=j;var c=b.Location,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=c;g.classList.add("thumbnail");break;default:a&&a.image?(g=document.createElement("img"),g.src=a.image,g.classList.add("thumbnail")):(g=document.createElement("span"),g.className="core-sprite-file_model modelDecorationSprite")}d.firstChild?d.insertBefore(g,d.firstChild):
d.appendChild(g);j.href=w})}return j}function k(a,b,d,c){this.explorer=b;this.commandService=d;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}k.prototype=new e.SelectionRenderer;k.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};k.prototype.tableCallback=function(a){a.setAttribute("aria-label",j.Navigator);a.setAttribute("role","presentation")};k.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
k.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"}};k.prototype.setTarget=function(a){this.target=a};k.prototype.createFolderNode=function(a){var c;this.showFolderLinks?c=b(this.folderLink||"",a,this.commandService,this.contentTypeService):(c=document.createElement("span"),c.textContent=a.Name);return c};k.prototype.showFolderLinks=!0;k.prototype.getCellElement=function(a,f,d){switch(a){case 0:var a=
document.createElement("td"),e=document.createElement("span");e.id=d.id+"MainCol";e.setAttribute("role","presentation");a.appendChild(e);a.setAttribute("role","presentation");e.className="mainNavColumn";var k;if(f.Directory)this.getExpandImage(d,e),k=this.createFolderNode(f),e.appendChild(k),this.explorer._makeDropTarget(f,k),this.explorer._makeDropTarget(f,d);else{if(!this.openWithCommands){this.openWithCommands=g.getOpenWithCommands(this.commandService);for(k=0;k<this.openWithCommands.length;k++)if(this.openWithCommands[k].isEditor===
"default")this.defaultEditor=this.openWithCommands[k]}k=b("",f,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});e.appendChild(k)}if(k)k.id=d.id+"NameLink",k.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),f,k),k.setAttribute("role","link"),k.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,f,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;d=document.createElement("td");
if(f.LocalTimeStamp)d.textContent=(new Date(f.LocalTimeStamp)).toLocaleString();return d;case 2:if(this.oneColumn)return null;d=document.createElement("td");if(!f.Directory&&typeof f.Length==="number")f=parseInt(f.Length,10)/1024,d.textContent=Math.ceil(f).toLocaleString()+" KB";d.style.textAlign="right";return d}};k.prototype.constructor=k;return{NavigatorRenderer:k,createLink:b}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(j,i,h,e,c,g,b,k,a){function f(a,d){this.serviceRegistry=a;this.commandRegistry=d;this.openWithCommands=null}function d(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new f(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}f.prototype.makeRenderFunction=function(d,c,f,g,p){var w=this.serviceRegistry,q=this.commandRegistry;this.openWithCommands=this.openWithCommands||k.createOpenWithCommands(w,d,q);var v=this;return function(k,u,w){a.when(v.openWithCommands,function(a){if(w)h.empty(c),a=document.createElement("div"),a.appendChild(document.createTextNode(j["Search failed."])),c.appendChild(a),typeof g==="function"&&g(c);else{var v=
function(){function a(d,b){var c=b.folderName?b.folderName:b.path,f=document.createElement("span");f.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+c+" "));d.appendChild(f)}var d={};return function(b,c){var f=c.name;if(d.hasOwnProperty(f)){a(b,c);var g=d[f];typeof g==="function"&&(d[f]=null,g())}else d[f]=function(){a(b,c)}}}(),B=!1;h.empty(c);if(k&&k.length>0){var C=document.createElement("table");C.setAttribute("role","presentation");for(var y=0;y<k.length;y++){var r=
k[y],A;if(!B&&(B=!0,f))A=C.insertRow(0).insertCell(0),A.textContent=f;A=C.insertRow(-1).insertCell(0);A.colspan=2;p&&p(A);var D={Name:r.name,Directory:r.directory,Location:r.path||r.location},D=b.createLink(i.toUrl("navigate/table.html"),D,q,d,a,null,{"aria-describedby":(r.folderName?r.folderName:r.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});r.LineNumber&&D.appendChild(document.createTextNode(" (Line "+r.LineNumber+")"));A.appendChild(D);v(A,r)}c.appendChild(C);typeof g===
"function"&&g(c)}!B&&u&&(a=e.formatMessage(j["No matches found for ${0}"],u),h.empty(c),c.appendChild(document.createTextNode(a)),typeof g==="function"&&g(c))}})}};d.prototype={search:function(a,d,b){var f=function(a){for(var d=[],b=0;b<a.response.docs.length;b++){var f=a.response.docs[b];d.push({name:f.Name,path:f.Location,folderName:c.path2FolderName(f.Path?f.Path:f.Location,f.Name),directory:f.Directory,lineNumber:f.LineNumber})}return d};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,
function(a){b(f(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(d){var c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);b(f(d),c)},function(a){b(null,null,a)})}catch(e){typeof e==="string"&&e.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(a){b(f(a),null)}):typeof e==="string"&&e.indexOf("search")>-1&&!a.nameSearch?(new g.SearchCrawler(this.registry,this._fileService,
a,{childrenLocation:this.getChildrenLocation()})).search(function(a){b(f(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(e)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,d){console.error(a);h.empty(d);d.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,d){var b="",c=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);d&&a&&a.Parents&&a.Parents.length>
0?c=d.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(c=a);if(c)this.setLocationbyURL(c.Location),b=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;c=h.node("search");b||(b="");if(c&&c.placeholder){c.value="";var f=e.formatMessage(j["Search ${0}"],b);c.placeholder=f.length>30?f.substring(0,27)+"...":e.formatMessage(j["Search ${0}"],
b)}if(c&&c.title)c.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,d,b,c){b=b?this.getSearchRootLocation():this.getSearchLocation();return d?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:c&&c.sort?c.sort:"Path asc",rows:c&&c.rows?c.rows:40,start:0,caseSensitive:c?c.caseSensitive:void 0,regEx:c?c.regEx:void 0,fileType:c?c.fileType:void 0,keyword:a,replace:c?c.replace:void 0}}};d.prototype.constructor=d;return{Searcher:d}});
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,i,h){return{slideoutHTMLFragment:function(e){var c=document.createElement("div");c.innerHTML=h;var g=i.$("#slideContainer",c);g.id=e+g.id;g=i.$("#pageCommandParameters",c);g.id=e+g.id;g=i.$("#pageCommandDismiss",c);g.id=e+g.id;return c.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(j){function i(e,c,g,b,k,a){this.type=a||"keydown";this.keyCode=typeof e==="string"&&this.type==="keydown"?e.toUpperCase().charCodeAt(0):e;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=k!==void 0&&k!==null?k:!1}function h(e){this.keys=e}i.prototype={getKeys:function(){return[this]},match:function(e,c){if(c!==void 0){if(c!==0)return!1}else if(e instanceof Array){if(e.length>1)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(j.isOpera?e.which:e.charCode!==void 0?e.charCode:e.keyCode)?this.mod1!==(j.isMac?e.metaKey:e.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==e.shiftKey?!1:this.mod3!==e.altKey?!1:j.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e?!1:this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0}};h.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(e,c){var g=this.keys;if(c!==void 0)return c>g.length?!1:g[c].match(e)?c===g.length-1?!0:c+1:!1;else{e instanceof Array||(e=[e]);if(e.length>g.length)return!1;var b;for(b=0;b<e.length;b++)if(!g[b].match(e[b]))return!1;return b===g.length?!0:b}},equals:function(e){if(!e.keys)return!1;if(e.keys.length!==this.keys.length)return!1;for(var c=0;c<e.keys.length;c++)if(!e.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:i,KeyStroke:i,
KeySequence:h}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,i,h){function e(c,g){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=g}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&h.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&h.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,g,b){typeof c==="string"&&(c=h.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var e=g(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!e)return!1;this._activeElements.focusNode=e;c=h.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){g=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=j.Close;g.appendChild(c);var a=this;c.addEventListener("click",function(){a.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(c,g){h.$$array("input",g).forEach(function(b){b.type==="checkbox"?c.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&c.parameters.setValue(b.parameterName,b.value.trim())});h.$$array("textArea",g).forEach(function(b){c.parameters.setValue(b.parameterName,b.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,g){var b=this;return function(e,a){var f=null,d=function(){g&&g();b.close()},l=function(a){a.keyCode===h.KEY.ENTER&&b._collectAndCall(c,e);if(a.keyCode===h.KEY.ESCAPE||a.keyCode===h.KEY.ENTER)d(),h.stop(a)};c.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 c=a.name+"parameterCollector",g=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=c,g.appendChild(b),l=function(a){a.keyCode===h.KEY.ESCAPE&&(d(),h.stop(a))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=c,g.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=c,
g.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;f||(f=b);b.addEventListener("keydown",l,!1)});var i=a;if(!i)i=document.createElement("span"),i.className="layoutRight parametersDismiss",e.appendChild(i);var o=function(a,d){var b=document.createElement("button");d.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};
if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,o(j.More,i).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,e);d()},!1);o(j.Submit,i).addEventListener("click",function(){b._collectAndCall(c,e);d()},!1);i=o(null,i);i.id="closebox";i.classList.add("imageSprite");i.classList.add("core-sprite-close");i.title=j.Close;i.addEventListener("click",function(){d()},!1);return f}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,i){function h(e){this._init(e)}h.prototype={_init:function(e){var c=i.node(e.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents){e=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,c):e.href=j.toUrl("navigate/table.html")+"#"+c}else e=document.createElement("span");i.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(e){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(e));return c},addSegmentHref:function(e,c){this._makeHref?this._makeHref(e,c.Location,c):e.href=j.toUrl("navigate/table.html")+"#"+c.ChildrenLocation},buildSegments:function(e,c){if(this._resource.Parents){var g=this._resource.Parents.slice(0),b,k;g&&(g=g.slice(0),c==="reverse"&&(g=g.reverse().slice(0)),g.forEach(function(a){e?(k=e,e=null):k=a.Name;b=this.buildSegment(k);
this.path+=a.Name;this.addSegmentHref(b,a);b.include=!1;this.segments.push(b)}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},refresh:function(){(this.crumbs=i.node(this._id))?i.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id=
"dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(e){this.crumbs.appendChild(e)},addTitle:function(e,c){var g=c||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(g)),e.classList.add("breadcrumb"),e.classList.add("currentLocation"),
this.append(e))},finalSegment:function(e,c){e=document.createElement("span");c?e.appendChild(document.createTextNode(c)):e.appendChild(document.createTextNode(this._resource.Name));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)},firstSegment:function(e){if(e)this.append(e),this._resource&&this._resource.Parents?(e.classList.add("breadcrumb"),this.addDivider()):(e.href="",e.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){e.include===
!0&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=e.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;
if(c)this.addTitle(e,c);else if(this.finalSegment(e,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(e)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(e,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(e),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,
c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};h.prototype.constructor=h;return{BreadCrumbs:h}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(j,i){function h(e){this._init(e)}h.prototype={_init:function(e){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=i.node(e.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=i.node(e.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=i.node(e.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=e.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(e.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=e.closeByDefault;this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display=
"block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(e){this._resizeListeners.push(e)},_initializeFromStoredSettings:function(){var e=localStorage.getItem(this._prefix+"/toggleState");this._closed=e?e==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(e=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(e,10);else{if(this._closeByDefault)this._splitTop=150}else if(e=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(e,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(e){var c=i.bounds(this.$node),g=i.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(e||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);e=this._splitTop;this.$node.parentNode.style.position==="relative"&&(e=this._splitTop-g.top);this.$sideNode.style.height=e+"px";this.$sideNode.style.bottom=e-1+"px";this.$sideNode.style.display="block";this.$node.style.top=e+"px"}else{this._splitWidth=c.width;if(e||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);e=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(e=this._splitLeft-g.left);this.$sideNode.style.width=
e+"px";this.$sideNode.style.right=e-1+"px";this.$sideNode.style.display="block";this.$node.style.left=e+"px"}this._resize()},_resize:function(e){var e=e||0,c=i.bounds(this.$node.parentNode),g=i.bounds(this.$node);this._vertical?this.$mainNode.style.height=c.height-(g.top-c.top+g.height)+"px":this.$mainNode.style.width=c.width-(g.left-c.left+g.width)+"px";var b=this;window.setTimeout(function(){b._notifyResizeListeners(b.$mainNode)},e);window.setTimeout(function(){b._notifyResizeListeners(b.$sideNode)},
e)},_notifyResizeListeners:function(e){for(var c=0;c<this._resizeListeners.length;c++)this._resizeListeners[c](e)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=
0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},_removeAnimation:function(){var e=this;window.setTimeout(function(){e.$sideNode.classList.remove("sidePanelLayoutAnimation");e.$mainNode.classList.remove("mainPanelLayoutAnimation");e.$node.classList.remove("splitLayoutAnimation");e._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");
this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(e){if(e.target===this._thumb)return i.stop(e),this._thumbDown(e);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),
i.stop(e)},_mouseMove:function(e){if(this._tracking){var c=i.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=e.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var g=this._splitTop;this.$node.parentNode.style.position==="relative"&&(g=this._splitTop-c.top);this.$node.style.top=g+"px"}else{this._splitLeft=e.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>c.left+c.width-
5)this._splitLeft=c.left+c.width-5;g=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(g=this._splitLeft-c.left);this.$node.style.left=g+"px"}this._adjustToSplitPosition(!0);i.stop(e)}},_mouseUp:function(e){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),i.stop(e)}};h.prototype.constructor=h;return{Splitter:h}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(j){return{makeRelative:function(i){if(!i)return i;var h=window.location.protocol+"//"+window.location.host;return i.indexOf(h)===0?i.substring(h.length):i},isAtRoot:function(i){if(!i)return!1;if(i==="/workspace")return!0;var h=new URL(j.toUrl("workspace"),window.location.href);return(new URL(i,window.location.href)).href.indexOf(h.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(j,i,h){function e(c){this._favorites=[];h.attach(this);this._init(c);this._initializeFavorites()}e.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(c){for(var c=Array.isArray(c)?
c:[c],g=0;g<c.length;g++){var b=c[g],e=b.ChildrenLocation?b.ChildrenLocation:b.Location,e=i.makeRelative(e);this.addFavorite(b.Name,e,b.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,!1,!0)},addFavorite:function(c,g,b){this._favorites.push({name:c,path:g,directory:b,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var g in this._favorites)if(this._favorites[g].path===
c){this._favorites.splice(g,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,g){var b=!1,e;for(e in this._favorites)if(this._favorites[e].path===c){var a=this._favorites[e];if(a.name!==g)a.name=g,b=!0}b&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(c){for(var g in this._favorites)if(this._favorites[g].path===c)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var g;
if(!c)return this._favorites;var b="";for(g=0;g<c.length;g++){var e=c.charAt(g);b+=e==="*"?".*":e==="?"?".?":this._SPECIAL_CHARS.indexOf(e)>=0?"\\"+e:e}b+=".*";c=RegExp(b);b=[];for(g in this._favorites)this._favorites[g].name.search(c)===0&&b.push(this._favorites[g]);return b},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){var b,g=g.get("navigate");typeof g==="string"&&(g=JSON.parse(g));if(g)for(b in g)g[b].isFavorite=
!0,c._favorites.push(g[b]);c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){g.put("navigate",c)})},_sorter:function(c,g){var b=c.name.toLowerCase(),e=g.name.toLowerCase();return b>e?1:b<e?-1:0},getFavorites:function(){return{navigator:this._favorites}}};e.prototype.constructor=e;return{FavoritesService:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(i,h){this._preferences=i;this._themeData=h;var e=h.getThemeStorageInfo(),c=i.listenForChangedSettings(e.storage,2,function(g){g.key===c&&this.apply()}.bind(this))}j.prototype={_initialize:function(i,h,e){var c=e.get(i.styleset);c||(c=h.getStyles(),e.put(i.styleset,JSON.stringify(c)));(h=e.get("selected"))&&(h=JSON.parse(h));if(!h||h[i.selectedKey]===void 0)h=h||{},h[i.selectedKey]=i.defaultTheme,e.put("selected",JSON.stringify(h))},
apply:function(){this.setTheme()},getTheme:function(i){var h=this._themeData,e=h.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,h,c);var g=JSON.parse(c.get("selected")),c=JSON.parse(c.get(e.styleset)),b;if(c)for(var k=0;k<c.length;k++)if(c[k].name===g[e.selectedKey]){b=c[k];break}i({style:b,styles:c})}.bind(this))},setTheme:function(i,h){var e=this._themeData,c=e.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(g){this._initialize(c,
e,g);var b=JSON.parse(g.get("selected"));i||(i=b[c.selectedKey]);b[c.selectedKey]=i;g.put("selected",JSON.stringify(b));h?g.put(c.styleset,JSON.stringify(h)):h=JSON.parse(g.get(c.styleset));for(g=0;g<h.length;g++)if(h[g].name===b[c.selectedKey]){e.processSettings(h[g]);break}}.bind(this))},setFontSize:function(i){var h=this._themeData,e=h.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,h,c);var g=JSON.parse(c.get("selected")),b=JSON.parse(c.get(e.styleset)),
k;if(b)for(var a=0;a<b.length;a++)b[a].fontSize=i,b[a].name===g[e.selectedKey]&&(k=b[a]);c.put(e.styleset,JSON.stringify(b));h.processSettings(k)}.bind(this))}};return{ThemePreferences:j}});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(i){var h=j.prototype,e;for(e in h)h.hasOwnProperty(e)&&(i[e]=h[e])};j.prototype={addEventListener:function(i,h,e){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[i];c||(c=this._eventTypes[i]={level:0,listeners:[]});c.listeners.push({listener:h,useCapture:e})},dispatchEvent:function(i){var h=i.type;this._dispatchEvent("pre"+h,i);this._dispatchEvent(h,i);this._dispatchEvent("post"+h,i)},_dispatchEvent:function(i,
h){var e=this._eventTypes?this._eventTypes[i]:null;if(e){var c=e.listeners;try{if(e.level++,c)for(var g=0,b=c.length;g<b;g++)if(c[g]){var k=c[g].listener;typeof k==="function"?k.call(this,h):k.handleEvent&&typeof k.handleEvent==="function"&&k.handleEvent(h)}}finally{if(e.level--,e.compact&&e.level===0){for(g=c.length-1;g>=0;g--)c[g]||c.splice(g,1);c.length===0&&delete this._eventTypes[i];e.compact=!1}}}},isListening:function(i){return!this._eventTypes?!1:this._eventTypes[i]!==void 0},removeEventListener:function(i,
h,e){if(this._eventTypes){var c=this._eventTypes[i];if(c){for(var g=c.listeners,b=0,k=g.length;b<k;b++){var a=g[b];if(a&&a.listener===h&&a.useCapture===e){c.level!==0?(g[b]=null,c.compact=!0):g.splice(b,1);break}}g.length===0&&delete this._eventTypes[i]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,i,h){function e(c){c=c||{};this._document=c.document||document}var c={};e.getTheme=function(g){var g=g||"default",b=c[g];b||(b=c[g]=new e);return b};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,b){var e=this,a=e._themeClass;e._themeClass=c;this._load(c,b,function(){e.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:e.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,b){function e(b,d,k){d&&(a.push("."+c+" ."+b+" {"),a.push("\t"+(k?"background-color":"color")+": "+d+";"),a.push("}"))}var a=[];a.push("");a.push("."+c+" {");b.fontFamily&&a.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&a.push("\tfont-size: "+b.fontSize+";");b.fontSize&&a.push("\tcolor: "+b.text+";");a.push("}");a.push("."+c+".textview {");b.background&&a.push("\tbackground-color: "+b.background+";");a.push("}");e("ruler.annotations",b.annotationRuler,!0);e("ruler.lines",
b.annotationRuler,!0);e("ruler.folding",b.annotationRuler,!0);e("ruler.overview",b.overviewRuler,!0);e("rulerLines",b.lineNumber,!1);e("rulerLines.even",b.lineNumberEven,!1);e("rulerLines.odd",b.lineNumberOdd,!1);e("annotationLine.currentLine",b.currentLine,!0);e("entity-name-tag",b.keyword,!1);e("entity-other-attribute-name",b.attribute,!1);e("string-quoted",b.string,!1);e("line_caret",b.currentLine,!0);e("token_keyword",b.keyword,!1);e("token_string",b.string,!1);e("token_singleline_comment",b.comment,
!1);e("token_multiline_comment",b.comment,!1);e("token_doc_comment",b.comment,!1);e("token_doc_html_markup",b.comment,!1);return a.join("\n")},_createStyle:function(c,b,e,a){var f=this._document,c="orion-theme-"+c,d=f.getElementById(c);if(d){if(a||d.firstChild.data===b)return;d.removeChild(d.firstChild);d.appendChild(f.createTextNode(b))}else a?(d=h.createElement(f,"link"),d.rel="stylesheet",d.type="text/css",d.href=b,d.addEventListener("load",function(){e()})):(d=h.createElement(f,"style"),d.appendChild(f.createTextNode(b))),
d.id=c,(f.getElementsByTagName("head")[0]||f.documentElement).appendChild(d);a||e()},_load:function(c,b,e){if(c)if(typeof b==="string")this._createStyle(c,b,e);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!j.toUrl)this._createStyle(c,b,e,!0);else{var a=this;j(["text!"+b],function(b){a._createStyle(c,b,e,!1)})}else e()}};i.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
define("orion/widgets/themes/ThemeClass",[],function(){function j(i){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=i;this.classString="."+i+"{ "}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 i(){}i.prototype.navbar="#333";i.prototype.button="#777777";i.prototype.location="#EFEFEF";i.prototype.selection="FEC";i.prototype.sidepanel="#FBFBFB";i.prototype.mainpanel="white";i.prototype.navtext="#bfbfbf";i.prototype.content="#3087B3";i.prototype.search="#444";i.prototype.toolpanel="white";i.prototype.writeNavigationStyle=function(){var h="",e=[],c=new j.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";e.push(c);c=new j.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="15px";c.style.padding="10px";c.style.paddingRight="3px";e.push(c);c=new j.ThemeClass("a");c.style.textDecoration="none";c.style.color=this.content;e.push(c);c=new j.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;e.push(c);c=new j.ThemeClass("primaryNav");
c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";e.push(c);c=new j.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign="baseline";c.style.textDecoration="none";e.push(c);c=new j.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";e.push(c);for(var g in e)h+=
e[g].toString();return h};i.prototype.writeLocationStyle=function(){var h="",e=[],c=new j.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";e.push(c);c=new j.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration=
"none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";e.push(c);c=new j.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";e.push(c);c=new j.ThemeClass("breadcrumbSeparator");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2";c.style.fontWeight="bold";e.push(c);c=new j.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color="#f1f1f2";c.style.textDecoration=
"none";c.style.textWrap="normal";c.style.lineHeight="10pt";e.push(c);c=new j.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";e.push(c);c=new j.ThemeClass("navlinkonpage");c.style.color=this.content;e.push(c);c=new j.ThemeClass("progressPane_running");c.style.background="url(../images/progress_running_dark.gif) no-repeat center";c.style.width="16px";c.style.height="16px";e.push(c);
for(var g in e)h+=e[g].toString();return h};i.prototype.writeButtonStyle=function(){var h="",e=[],c=new j.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="baseline";c.style.cursor="pointer";c.style.display="inline-block";c.style.padding="5px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="8pt";c.style.userSelect="none";e.push(c);c=new j.ThemeClass("commandButton:over");
c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";e.push(c);c=new j.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";e.push(c);c=new j.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";e.push(c);
for(var g in e)h+=e[g].toString();return h};i.prototype.writeMainStyle=function(){var h="",e=[],c=new j.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height="12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding=
"0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(c);c=new j.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline="none";e.push(c);c=new j.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";e.push(c);c=new j.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=
this.content;e.push(c);c=new j.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";c.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";e.push(c);c=new j.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;e.push(c);c=new j.ThemeClass("mainToolbar");c.style.background=this.toolpanel;
c.style.height="34px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="2px";e.push(c);for(var g in e)h+=e[g].toString();return h};i.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};i.prototype.getSheet=function(h){h.navbar.value?(this.navbar=h.navbar.value,this.button=h.button.value,this.location=h.location.value,this.selection=h.selection.value,this.sidepanel=
h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=h.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:i}});
define("orion/widgets/themes/container/ThemeData",["orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(j,i){function h(){}function e(){this.styles=[];var c=new h;c.name="Orion";c.navbar="#333";c.button="#EFEFEF";c.location="#efefef";c.selection="FEC";c.sidepanel="#FBFBFB";c.mainpanel="white";c.toolpanel="white";c.navtext="#bfbfbf";c.content="#3087B3";c.search="#444";c.breadcrumb="#3087B3";c.separator="#333";this.styles.push(c);c=new h;c.name="Green Zone";c.navbar=
"seagreen";c.button="lavender";c.location="darkseagreen";c.selection="moccasin";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="darkgreen";c.search="darkgreen";c.breadcrumb="#3087B3";c.separator="seagreen";this.styles.push(c);c=new h;c.name="Pretty In Pink";c.navbar="plum";c.button="lavender";c.location="pink";c.selection="lavender";c.sidepanel="seashell";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="mediumorchid";c.search="violet";
c.breadcrumb="#3087B3";c.separator="plum";this.styles.push(c);c=new h;c.name="Blue Monday";c.navbar="cornflowerblue";c.button="lavender";c.location="skyblue";c.selection="lavender";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="royalblue";c.search="royalblue";c.breadcrumb="#3087B3";c.separator="cornflowerblue";this.styles.push(c);c=new h;c.name="Vanilla Skies";c.navbar="sandybrown";c.button="lemmonchiffon";c.location="cornsilk";c.selection="lemonchiffon";
c.sidepanel="white";c.mainpanel="white";c.toolpanel="white";c.navtext="lemonchiffon";c.content="chocolate";c.search="moccasin";c.breadcrumb="#3087B3";c.separator="sandybrown";this.styles.push(c);c=new h;c.name="Beetlejuice";c.navbar="indigo";c.button="slateblue";c.location="darkslateblue";c.selection="silver";c.sidepanel="lavender";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="mediumslateblue";c.search="#444";c.breadcrumb="#3087B3";c.separator="indigo";this.styles.push(c);
c=new h;c.name="Red";c.navbar="#CD2127";c.button="#777777";c.location="#D85F56";c.selection="lightcoral";c.sidepanel="#EFDAB2";c.mainpanel="#FDFADD";c.toolpanel="#FDFADD";c.navtext="#FBFBFB";c.content="darkred";c.search="#D85F56";c.breadcrumb="darkred";c.separator="#CD2127";this.styles.push(c)}function c(){return this.styles}h.prototype.name="Orion";h.prototype.navbar="#333";h.prototype.button="#EFEFEF";h.prototype.location="#333";h.prototype.breadcrumb="#3087B3";h.prototype.separator="#333";h.prototype.selection=
"FEC";h.prototype.sidepanel="#FBFBFB";h.prototype.mainpanel="white";h.prototype.toolpanel="white";h.prototype.navtext="#bfbfbf";h.prototype.content="#3087B3";h.prototype.search="#444";e.prototype.styles=[];e.prototype.getStyles=c;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};e.prototype.getViewData=function(){for(var c={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},b=0;b<3;b++)c.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)c.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)c.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+b*20,x2:165,y2:124+b*20,x3:160,y3:127+b*20,family:"navbar",fill:"#333"});
c.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return c};e.prototype.processSettings=function(c){var b=new i.ThemeSheetWriter;(new j.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(c))};return{ThemeData:e,getStyles:c}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Populating favorites...":"Populating favorites...",Favorite:"Favorite","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'."});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(j,i,h,e){function c(c){this._displaySignOut=!0;this._init(c)}c.prototype={_init:function(c){this._dropdownNode=h.node(c.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=c.dropdown;this._serviceRegistry=c.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=c.noSeparator;this._dropDownItemClass=
c.dropDownItemClass;this._keyAssistClass=c.keyAssistClass;if(c.signOut!==void 0)this._displaySignOut=c.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(c){var b=0,e;for(e in c)c.hasOwnProperty(e)&&b++;return b},_makeMenuItem:function(c,b){var e=document.createElement("span");e.role="menuitem";
e.tabIndex=0;var a=document.createTextNode(c);e.appendChild(a);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&e.classList.add(this._dropDownItemClass):e.classList.add("dropdownMenuItem");e.addEventListener("click",b,!1);e.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&b()},!1);return e},_renderAuthenticatedService:function(c){var b=this,e=this.authenticatedServices[c].authService;if(e&&e.logout&&this._displaySignOut){var a=document.createElement("li"),
f=this._makeMenuItem(j["Sign Out"],function(){e.logout().then(function(){b.addUserItem(c,e,b.authenticatedServices[c].label);localStorage.removeItem(c);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var f=localStorage.key(a);f&&f.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(f)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});a.appendChild(f);this._dropdownNode.appendChild(a)}},renderServices:function(){function c(a){k[a]||
(k[a]=b.createDocumentFragment());return k[a]}var b=document,k=[];e.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(a){this._dropdown?this._dropdown.empty():this._dropdownNode&&h.empty(this._dropdownNode);a.forEach(function(a){var d=c(typeof a.category==="number"?a.category:1),f=b.createElement("li"),e=b.createElement("a");e.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&e.classList.add(this._dropDownItemClass):e.classList.add("dropdownMenuItem");
e.href=a.href;e.textContent=a.textContent;f.appendChild(e);d.appendChild(f)}.bind(this));if(this.keyAssistFunction){var a=document.createElement("li"),f=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem");a.appendChild(f);c(0).appendChild(a)}var d=this;k.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<k.length-1&&!this._noSeparator){var c=
document.createElement("li");c.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");c.appendChild(f);a.appendChild(c)}d._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var e in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(e)&&this._renderAuthenticatedService(e,0)}.bind(this))},setKeyAssist:function(c){this.keyAssistFunction=c;this.renderServices()},addUserItem:function(c,b,e,a){a?(this.unauthenticatedServices[c]&&
delete this.unauthenticatedServices[c],this.authenticatedServices[c]={authService:b,label:e,data:a}):(this.authenticatedServices[c]&&delete this.authenticatedServices[c],this.unauthenticatedServices[c]=this.unauthenticatedServices[c]?{authService:b,label:e,pending:this.unauthenticatedServices[c].pending}:{authService:b,label:e});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(j,i,h,e){function c(){}c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var c=document.body;this.$frameParent=c;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(c);b=b.createContextualFragment(this.CONTAINERTEMPLATE);c.appendChild(b);this.$frame=c.lastChild;this.title&&h.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=h.$("#closeDialog",this.$frame);var e=this;this.$close.addEventListener("click",function(){e.hide()},!1);this.$parent=h.$(".dialogContent",this.$frame);
b=document.createRange();b.selectNode(this.$parent);c=b.createContextualFragment(this.TEMPLATE);this.messages&&h.processTextNodes(c,this.messages);this.$parent.appendChild(c);this.$buttonContainer=h.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===h.KEY.ESCAPE?e.hide():a.keyCode===h.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 c=this;this.buttons.forEach(function(b){var k=e.createButton(b.text,b.callback);if(b.id)k.id=b.id,c["$"+k.id]=k;if(b.isDefault)c._defaultCallback=b.callback,c._defaultButton=k;c.$buttonContainer.appendChild(k)})}},_makeModal:function(){var c=this;this.$frame.addEventListener("blur",function(a){c.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!h.contains(c.$frame,
a.target);if(b)for(var f=0;f<c.$$modalExclusions.length;f++)if(h.contains(c.$$modalExclusions[f],a.target)){b=!1;break}b&&(window.setTimeout(function(){(c.$lastFocusedElement||c.$parent).focus()},0),h.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,e=!1;this._addedBackdrop=[];for(var a=0;a<b.length;a++){for(var f=0;f<this.$$modalExclusions.length;f++)if(h.contains(this.$$modalExclusions[f],
b[a])){e=!0;break}!e&&b[a]!==c.$frame&&b[a].classList&&!b[a].classList.contains("tooltipContainer")&&(f=b[a],f.classList.contains("modalBackdrop")||(f.classList.add("modalBackdrop"),this._addedBackdrop.push(f)))}(b=h.lastTabbable(this.$buttonContainer)||h.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.TAB){var b=c._getFirstFocusField();b&&b!==a.target&&b.focus();h.stop(a)}},!1)},_addChildDialog:function(c){this.$$modalExclusions.push(c.$frame||c.$parent)},
_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var e=c.childNodes[b];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 c=this;this.keepAlive||
window.setTimeout(function(){c.destroy()},0)},show:function(c){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=h.bounds(this.$frame),e=h.bounds(document.documentElement),a;c?(a=h.bounds(c),c=a.top+a.height+4,a=a.left+4,c+b.height>e.height&&(c=Math.max(0,e.height-b.height-4)),a+b.width>e.width&&(a=Math.max(0,e.width-b.width-4))):(a=Math.max(0,(e.width-b.width)/2),c=Math.max(0,(e.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=c+"px";this.$frame.style.left=
a+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return h.firstTabbable(this.$parent)||this._defaultButton||h.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(c){c.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",
this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};c.prototype.constructor=c;return{Dialog:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(j,i,h,e,c,g,b){function k(a){this._init(a)}k.prototype=new b.Dialog;k.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+
e.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';k.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 h.ContentTypeService(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(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._favService=a.favoriteService;if(!this._favService)throw Error(j["Missing required argument: favService"]);this._initialize()};k.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",j.Search);this.$fileName.addEventListener("input",function(){b._time=
+new Date;b._timeoutId&&clearTimeout(b._timeoutId);b._timeoutId=setTimeout(b.checkSearch.bind(b),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var e=c.$("a",b.$results);e&&(c.stop(a),window.open(e.href),b.hide())}},!1);a.addEventListener("keydown",function(a){var e,g,k,h,i;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)g=c.$$array("a",b.$results),e=c.$$array("a",b.$favresults),k=document.activeElement,i=g.indexOf(k),h=e.indexOf(k),a.keyCode===c.KEY.DOWN?
h>=0?(h<e.length-1?e[h+1]:g.length>0?g[0]:e[0]).focus():i>=0?(i<g.length-1?g[i+1]:e.length>0?e[0]:g[0]).focus():(g.length>0||e.length>0)&&(-1<e.length-1?e[0]:g[0]).focus():h>=0?(k=b.$fileName,(h>0?e[h-1]:k).focus()):i>=0?(k=b.$fileName,(i>0?g[i-1]:e.length>0?e[e.length-1]:k).focus()):g.length>0?g[g.length-1].focus():e.length>0&&e[e.length-1].focus(),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new i.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(j["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$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()};k.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(j["Populating favorites&#x2026;"]));c.empty(this.$favresults);this.$favresults.appendChild(a);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());
this._favService.addEventListener("favoritesChanged",this.showFavorites())};k.prototype.showFavorites=function(){var a=this;return function(b){if(b.navigator)b=b.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(b);if(b&&b.length>0)b=document.createElement("div"),b.style.borderBottom="1px dashed #BBBBBB",b.style.padding="5px",a.$favresults.appendChild(b)}};k.prototype.showFavoritesImage=function(a){var b=new Image;
b.classList.add("modelDecorationSprite");b.classList.add("core-sprite-favorite");b.src=e.toUrl("images/none.png");b.title=j.Favorite;a.appendChild(b);b.style.verticalAlign="middle"};k.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)};k.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._searcher.createSearchParams(a,
this._nameSearch,this._searchOnRoot),d=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=d;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:g.formatMessage(j["Searching for occurrences of"],a)));c.empty(this.$results);this.$results.appendChild(e);this._searcher.search(b,!1,function(){d===this.currentSearch&&d.apply(null,arguments)}.bind(this))}};k.prototype.decorateResult=
function(a){for(var b=this,a=c.$$array("a",a),d=0;d<a.length;d++){var e=a[d];e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()},!1);e.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&b.hide()},!1)}};k.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};k.prototype._afterHiding=function(){this._onHide&&this._onHide()};k.prototype.constructor=k;return{OpenResourceDialog:k}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<div class="centralNavigation" id="centralNavigation" tabindex="0" role="button" style="margin-top:0;"></div>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=3.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility:hidden;">\n</div>\n<div class="layoutRight" style="padding-left:7px;margin-left:4px;margin-top:6px;" id="settingsTab" style="visibility:hidden;">\n\t<button class="layoutRight core-sprite-wrench imageSprite" id="settingsAction" aria-live="off" style="visibility:hidden;"></button>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/objects",[],function(){return{mixin:function(j){Array.prototype.slice.call(arguments,1).forEach(function(i){for(var h=Object.keys(i),e=0;e<h.length;e++){var c=h[e];j[c]=i[c]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(j,i){function h(e,c,g){this.CLEAR_PANEL=g!==null?g:!0;this.OPEN="false";g="";e.nodeType?this.node=e:(g=e+"_",e=document.getElementById(e),this.node=e.nodeType?e:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=g+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=g+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=g+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(c.icon)this.node.className=this.node.className+" "+c.icon,this.node.onclick=this.click.bind(this);else{if(c.label)e=document.getElementById(this.navLabelId),e.textContent=c.label,e.onclick=this.click.bind(this);if(c.caret)document.getElementById(this.arrowId).className=c.caret}this._dropdownNode=i.node(this.navDropDownId);this._triggerNode=i.node(this.navLabelId)}j.mixin(h.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var e=document.getElementById(this.navDropDownId);e.style.display==="none"?this.updateContent(this.getContentNode(),function(){e.style.display="";this._positionDropdown();this.handle=i.addAutoDismiss([this.node,e],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(e){document.getElementById(this.navDropDownId).innerHTML=e},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(e,c){c()},toggleLabel:function(e){document.getElementById(this.navLabelId).style.display=e?"":"none";document.getElementById(this.arrowId).style.display=e?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var e=i.bounds(this._dropdownNode),c=i.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||
!e.parentNode.style?e:this._boundingNode(e.parentNode)},destroy:function(){if(this.node)i.empty(this.node),this.node=this.select=null}});return h});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(j){function i(){}j.mixin(i.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">Main Pages</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">Related Links</span><nav><ul id="relatedLinks"></ul></nav></section></div>',getContentPane:function(){return this.templateString}});
return i});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(j,
i,h,e,c,g,b,k,a,f,d,l,m,o,n,p,w,q,v,t,u,s,z,x,B,C,y,r,A,D,H,I,N){function R(a,b){if(a.getLabel)return a.getLabel();else{var c=new s;c.resolve(b.properties.name);return c}}function ba(a){l.node("progressPane").setAttribute("aria-label",j["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function ca(a,b){var c=a.getServiceReferences("orion.core.auth");K=[];for(var d=J.createMenuGenerator.apply(this,arguments),f=0;f<c.length;f++){var e=
c[f],g=a.getService(e);R(g,e).then(function(a){g.getKey().then(function(b){K.push(b);g.getUser().then(function(c){d.addUserItem(b,g,a,c)},function(c,f){d.addUserItem(b,g,a,f)});window.addEventListener("storage",function(){W[b]!==localStorage.getItem(b)&&(W[b]=localStorage.getItem(b),g.getUser().then(function(c){d.addUserItem(b,g,a,c)},function(){d.addUserItem(b,g,a)}))},!1)})})}}function L(a,b,c,d,f){var e=arguments,h,l=a&&a.getServiceReferences("orion.page.link.related");l&&l.length!==0&&s.when(function(){if(h)return h;
var b=a.getService("orion.core.contenttypes");b||(b=new w.ContentTypeService(a),b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return h=a})}(),function(){var i;if(J.beforeGenerateRelatedLinks.apply(this,e)){for(var j=[],m=0;m<l.length;m++){var o={},n,t=l[m].getPropertyKeys();for(n=0;n<t.length;n++)o[t[n]]=l[m].getProperty(t[n]);if(o.id){var q=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(b)){var c=new g.CommandInvocation(b,b,null,a,d);J.addRelatedLinkCommand(a,
c)}else typeof f==="function"&&(i||(i=f()),s.when(i,function(c){c&&b===aa&&(!a.visibleWhen||a.visibleWhen(c))&&J.addRelatedLinkCommand(a,new g.CommandInvocation(c,c,null,a,d))}))},p=null;n=null;if(c.indexOf(o.id)<0)if((o.nls&&o.nameKey||o.name)&&o.uriTemplate)n=k._createCommandOptions(o,l[m],a,h,!0),j.push(n),n.then(function(a){a=new g.Command(a);q(a)});else{if(!p&&(p=d.findCommand(o.id))){q(p);continue}if(!p){var D=a.getServiceReferences("orion.navigate.command");for(n=0;n<D.length;n++)if(D[n].getProperty("id")===
o.id){for(var o={},t=D[n].getPropertyKeys(),u=0;u<t.length;u++)o[t[u]]=D[n].getProperty(t[u]);n=k._createCommandOptions(o,D[n],a,h,!0);j.push(n);n.then(function(a){p=new g.Command(a);q(p)});break}}}}}s.all(j,function(a){return a}).then(function(){J.afterGenerateRelatedLinks.apply(this,e)})}})}function da(a){var b=l.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function U(a){var b={},c=null;typeof a==="string"&&(a=l.node(a));a||(a=l.node("pageActions"));for(var d=a;d&&
d.classList;){if(d.classList.contains("toolComposite")){c=d;break}d=d.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(c&&(b.slideContainer=l.$(".slideParameters",c),b.parameterArea=l.$(".parameters",c),b.dismissArea=l.$(".parametersDismiss",c),b.notifications=l.$("#notificationArea",c),c.parentNode&&(b.toolbarTarget=l.$(".toolbarTarget",c.parentNode),b.toolbarTarget)))a=l.bounds(c),b.toolbarTargetY=a.height+1;return b}function V(a){if(a.toolbarTarget&&a.toolbarTargetY){var b=
0,c;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(c=l.bounds(a.notifications),b+=c.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(c=l.bounds(a.slideContainer),b+=c.height);b>0&&(b+=8);a.toolbarTarget.style.top=a.toolbarTargetY+b+"px";a.toolbarTarget.style.bottom=0}}var c=function(a){var b=document.createElement("a");b.href=a;return b.href}(i.toUrl("auth/NotifyAuthentication.html")),W={},J={createMenuGenerator:I.createMenuGenerator||
function(a,b){if(l.node("userMenu")){var c=l.node("userDropdown"),d=new o.Dropdown({dropdown:c}),c=new z.UserMenu({dropdownNode:c,dropdown:d,serviceRegistry:a}),d=l.node("userTrigger");new n.Tooltip({node:d,text:j.Options,position:["below","left"]});var d=document.getElementById("userTrigger"),f=d.className;f+=" imageSprite core-sprite-silhouette";d.className=f;c.setKeyAssist(b);return c}},beforeGenerateRelatedLinks:I.beforeGenerateRelatedLinks||function(){var a=l.node("relatedLinks");l.empty(a);
return!0},addRelatedLinkCommand:I.addRelatedLinkCommand||function(a,b){var c=l.node("relatedLinks");g.createCommandMenuItem(c,a,b).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:I.afterGenerateRelatedLinks||function(){},afterSetPageTarget:I.afterSetPageTarget||function(){},generateNavigationMenu:I.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new n.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new A("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),b=new D;a.addContent(b.getContentPane())},afterGenerateBanner:I.afterGenerateBanner||function(){}},K=[],aa,T=[],F,M=null;return{addSettings:function(a){(new A("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(c,d,f,k,o,n,q){function D(){this.create();this._filterString=""}function v(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=l.$$array(".targetSelector"),c=0;c<b.length;c++)b[c].target=a}},{pid:"nav.config"})}(new t.ThemePreferences(k,new u.ThemeData)).apply();var s=l.node(c);if(!s)throw j["could not find banner parent, id was "]+c;var w=document.createRange();w.selectNode(s);w=w.createContextualFragment(C);l.processTextNodes(w,j);s.firstChild?s.insertBefore(w,s.firstChild):s.appendChild(w);s=l.node("home");s.href=i.toUrl("navigate/table.html");s.setAttribute("aria-label",
j["Orion Home"]);l.node("progressPane").src=i.toUrl("images/none.png");if(s=l.node("pageToolbar"))s.classList.add("toolbarLayout"),s.innerHTML=r+h.slideoutHTMLFragment("mainToolbar");(s=l.node("closeNotifications"))&&s.setAttribute("aria-label",j["Close notification"]);if(s=l.node("footer"))s.innerHTML=y,l.processTextNodes(s,j);f.setParameterCollector(new b.CommandParameterCollector(U,V));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&(a=d.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);J.generateNavigationMenu.apply(this,arguments);var I=l.node("navigationlinks");I&&x.createPageLinks(d,"orion.page.link").then(function(a){a.forEach(function(a){var b=document.createElement("li");b.appendChild(a);I.appendChild(b)})});if(s=l.$(".split")){var w=l.$(".sidePanelLayout"),z=l.$(".mainPanelLayout");if(w&&z)M={side:w,main:z},M.splitter=new m.Splitter({node:s,sidePanel:w,mainPanel:z,toggle:!0,closeByDefault:s.style&&s.style.left==="0%"}),s=new g.Command({name:j["Toggle side panel"],
tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){M.splitter.toggleSidePanel()}}),f.addCommand(s),f.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new e.KeyBinding("o",!0)),q&&M.splitter.addResizeListener(function(a){q&&a===z&&(a=q.getTextView())&&a.resize()})}s=new g.Command({name:j["Make Favorite"],tooltip:j["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?
a:[a];if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=d.getService("orion.core.favorite"),c=d.getService("orion.page.progress"),f=function(a){return function(f){f?d.getService("orion.page.message").setMessage(a.Name+j[" is already a favorite."],2E3):c.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},e=0;e<a.length;e++){var g=a[e];c.progress(b.hasFavorite(g.ChildrenLocation||g.Location),
"Checking favorite "+g.Name).then(f(g))}}});f.addCommand(s);var N=!1,R=function(a,b,c){if(!N){var d=b.getService("orion.core.favorite"),f=b.getService("orion.page.progress");d||(d=new p.FavoritesService({serviceRegistry:b}),d=b.getService("orion.core.favorite"));var e=new B.OpenResourceDialog({searcher:a,progress:f,searchRenderer:a.defaultRenderer,favoriteService:d,onHide:function(){N=!1;c&&c.getTextView()&&c.getTextView().focus()}});window.setTimeout(function(){N=!0;e.show()},0)}},s=new g.Command({name:j["Find File Named..."],
tooltip:j["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){R(o,d,q)}});f.addCommand(s);f.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));s=new g.Command({name:j["Toggle banner and footer"],tooltip:j["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=l.node("banner"),b=l.node("footer"),c=l.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",b.style.visibility="visible",c.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",c.classList.add("content-fixedHeight-maximized"));q&&q.getTextView()&&q.getTextView().resize();return!0}});f.addCommand(s);f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));s=new g.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return i.toUrl("help/about.html")}});
f.addCommand(s);f.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new e.KeyBinding(112,!0,!0));s=new g.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return i.toUrl("operations/list.html")}});f.addCommand(s);f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));D.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var b=this._keyAssistInput=document.createElement("input");b.classList.add("keyAssistInput");b.type="text";b.placeholder=j["Filter bindings"];a.appendChild(b);var c=this._keyAssistContents=document.createElement("div");c.classList.add("keyAssistContents");if(H.isIOS||H.isAndroid)c.style.overflowY="auto";a.appendChild(c);var d=this._keyAssistTable=document.createElement("table");
d.tabIndex=0;d.classList.add("keyAssistList");c.appendChild(d);document.body.appendChild(a);b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("input",function(){this.filterChanged()}.bind(this));c.addEventListener(H.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));
l.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(q&&q.getTextView()){var b=q.getTextView(),c=b.getActions(!0).filter(function(a){return(a=b.getActionDescription(a))&&a.name});c.sort(function(a,c){return b.getActionDescription(a).name.localeCompare(b.getActionDescription(c).name)});this.createHeader(j.Editor);for(var d=function(a){return function(){b.focus();
return b.invokeAction(a)}},e={},g,k=0;k<c.length;k++)for(var h=c[k],i=b.getActionDescription(h),m=b.getKeyBindings(h),o=0;o<m.length;o++){g=m[o];var n=a.getUserKeyString(g);g.scopeName?(e[g.scopeName]||(e[g.scopeName]=[]),e[g.scopeName].push({bindingString:n,name:i.name,execute:d(h)})):this.createItem(n,i.name,d(h))}for(var t in e)if(e[t].length){this.createHeader(t);for(c=0;c<e[t].length;c++)g=e[t][c],this.createItem(g.bindingString,g.name,g.execute)}}this.createHeader(j.Global);f.showKeyBindings(this)},
createItem:function(a,b,c){if(this._filterString){var d=this._filterString.toLowerCase(),f;d!==this._filterString?(d=this._filterString,f=function(a){return a}):f=function(a){return a.toLowerCase()};if(f(b).indexOf(d)===-1&&f(a).indexOf(d)===-1&&f(this._lastHeader).indexOf(d)===-1)return}var e=this._keyAssistTable.insertRow(-1);e.id="keyAssist-keyBinding-"+this._idCount++;e.setAttribute("role","menuitem");e._execute=c;e.classList.add("keyAssistItem");e.addEventListener("click",function(a){this._selectedRow=
e;this.execute();a.preventDefault()}.bind(this));c=e.insertCell(-1);c.classList.add("keyAssistName");c.appendChild(document.createTextNode(b));c=e.insertCell(-1);c.classList.add("keyAssistAccel");c.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var b=this._keyAssistTable.insertRow(-1);b.classList.add("keyAssistSection");var b=b.insertCell(-1),c=document.createElement("h2");c.appendChild(document.createTextNode(a));b.appendChild(c)},execute:function(){window.setTimeout(function(){this.hide();
var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){var a=document.activeElement,b=this._keyAssistDiv,a=b===a||(b.compareDocumentPosition(a)&16)!==0;b.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var b=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(b.length===0)this._selectedIndex=-1;else{var c=this._selectedIndex;c+=a?1:-1;c%=b.length;c<0&&(c=b.length-1);if(this._selectedIndex!==-1)a=b[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=c;if(this._selectedIndex!==-1){this._selectedRow=
a=b[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var b=a.getBoundingClientRect(),d=this._keyAssistContents,f=d.getBoundingClientRect();a.offsetTop<d.scrollTop?c===0?d.scrollTop=0:a.scrollIntoView(!0):b.bottom>f.bottom&&a.scrollIntoView(!1)}}},show:function(){this._previousActiveElement=document.activeElement;this.createContents();this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px";this._keyAssistDiv.style.display="block";this._keyAssistInput.value=this._filterString;this._keyAssistInput.focus();this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var b=0,b=H.isIE||H.isOpera?-a.wheelDelta:H.isFirefox?a.detail*40:-a.wheelDeltaY,c=this._keyAssistContents,d=c.scrollTop;c.scrollTop+=b;if(d!==c.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var L=new D,A=new g.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){L.isVisible()?L.hide():L.show();return!0}});f.addCommand(A);f.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));s=function(){q.getTextView().setKeyBinding(new e.KeyBinding(191,!1,!0,!H.isMac,H.isMac),A.id);q.getTextView().setAction(A.id,A.callback,A)};q&&(q.getTextView()?
s():q.addEventListener("TextViewInstalled",s));da(f);ca(d,A.callback);ba(d);window.addEventListener("hashchange",function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){v(d)},0);J.afterGenerateBanner.apply(this,arguments)},getToolbarElements:U,getMainSplitter:function(){return M},layoutToolbarElements:V,setPageTarget:function(a){var b,c,f=a.breadcrumbRootName,e=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(c=f?f+" ":"",c+=a.fileService.fileServiceName(a.target.Location),f=null),b=a.name||a.target.Name,aa=a.target,L(e,a.target,T,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(f=f||a.task||a.name),b=a.name,L(e,{NoTarget:""},T,a.commandService,a.makeAlternate));(F=a.title)||(F=b?b+" - "+a.task:a.task);window.document.title=F;J.afterSetPageTarget.apply(this,arguments);if(b=l.node("location")){l.empty(b);var g=e&&new N.FileClient(e),e=a.breadcrumbTarget||a.target,g=g&&e&&e.Location?g.fileServiceRootURL(e.Location):
null;new d.BreadCrumbs({container:b,resource:e,rootSegmentName:f,workspaceRootSegmentName:c,workspaceRootURL:g,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(F)F.charAt(0)==="*"&&!a&&(F=F.substring(1)),a&&F.charAt(0)!=="*"&&(F="*"+F),window.document.title=F;var b=l.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){T=a},notifyAuthenticationSite:c}});
define("util/legacy",["require","exports","module"],function(){if(!(typeof window==="undefined"||typeof document==="undefined")){if(window.console==null)window.console={};"debug,log,warn,error,trace,group,groupEnd".split(",").forEach(function(j){window.console[j]||(window.console[j]=function(){})});!("classList"in document.documentElement)&&Object.defineProperty&&typeof HTMLElement!=="undefined"&&Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function j(e){return function(c){var g=
i.className.split(/\s+/),b=g.indexOf(c);e(g,b,c);i.className=g.join(" ")}}var i=this,h={add:j(function(e,c,g){~c||e.push(g)}),remove:j(function(e,c){~c&&e.splice(c,1)}),toggle:j(function(e,c,g){~c?e.splice(c,1):e.push(g)}),contains:function(e){return!!~i.className.split(/\s+/).indexOf(e)},item:function(e){return i.className.split(/\s+/)[e]||null}};Object.defineProperty(h,"length",{get:function(){return i.className.split(/\s+/).length}});return h}});if(!String.prototype.trimLeft)String.prototype.trimLeft=
function(){return String(this).replace(/\s*$/,"")};if(!Function.prototype.bind)Function.prototype.bind=function(j){if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var i=Array.prototype.slice.call(arguments,1),h=this,e=function(){},c=function(){return h.apply(this instanceof e&&j?this:j,i.concat(Array.prototype.slice.call(arguments)))};e.prototype=this.prototype;c.prototype=new e;return c}}});
define("util/promise",["require","exports","module"],function(j,i,h){function e(a){return{then:function(b){b(a)}}}function c(a){return{then:function(b,c){c(a)}}}function g(a){return function(b){try{return a(b)}catch(d){return c(d)}}}function b(a){var f=[],d,a=a||a===null?a:Object.prototype,k={promise:Object.create(a,{then:{value:function(k,h){function l(a){j.resolve(k(a))}function i(a){j.resolve(h(a))}var j=b(a),k=k?g(k):e,h=h?g(h):c;f?f.push([l,i]):d.then(l,i);return j.promise}}}),resolve:function(a){if(f){for(d=
a&&typeof a.then==="function"?a:e(a);f.length;)d.then.apply(d,f.shift());f=null}},reject:function(a){k.resolve(c(a))}};return k}function k(a,c){var d=b(c);d.resolve(a);return d.promise}h.metadata={stability:"unstable"};i.defer=b;i.resolve=k;i.reject=function(a,c){var d=b(c);d.reject(a);return d.promise};j=function(){function a(a){return c.apply(c,a)}function b(a,c){return a.then(function(a){return k(c).then(function(b){return a.concat([b])})})}var c=Function.call,e=Array.prototype.concat;return function(c,
d){return function(){return e.apply([c,this],arguments).reduce(b,k([],d)).then(a)}}}();i.promised=j});
define("util/util",["require","exports","module","util/promise"],function(j,i){function h(b,c){for(var a=0;a<c.length;a++)if(b===c[a])return a;return-1}function e(b,c){var a=b.getAttribute("data-command");a||(a=b.querySelector("*[data-command]").getAttribute("data-command"));a?c(a):console.warn("Missing data-command for "+util.findCssSelector(b))}i.createEvent=function(b){var c=[],a=!1,f=[],d=void 0,e=function(b){if(a)f.push(b);else for(var d=0;d<c.length;d++){var e=c[d];e.func.call(e.scope,b)}};
e.add=function(a,b){c.push({func:a,scope:b})};e.remove=function(a,d){var f=!1;c=c.filter(function(b){(b=b.func===a&&b.scope===d)&&(f=!0);return!b});f||console.warn("Handler not found. Attached to "+b)};e.removeAll=function(){c=[]};e.holdFire=function(){a=!0};e.resumeFire=function(){if(a!==!0)throw Error("Event not held: "+b);a=!1;if(f.length!==0){if(f.length===1)e(f[0]);else{var c=f[0],g=f[f.length-1];d?e(d(c,g,f)):e(g)}f=[]}};Object.defineProperty(e,"eventCombiner",{set:function(a){if(typeof a!==
"function")throw Error("eventCombiner is not a function");d=a},enumerable:!0});return e};var c=j("util/promise");i.promised=function(){function b(b){return a.apply(a,b)}function e(a,b){return a.then(function(a){return c.resolve(b).then(function(b){return a.concat([b])})})}var a=Function.call,f=Array.prototype.concat;return function(a,g){return function(){return f.apply([a,this],arguments).reduce(e,c.resolve([],g)).then(b)}}}();i.all=i.promised(Array);i.synchronize=function(b){if(b==null||typeof b.then!==
"function")return b;var c=void 0,a=void 0;b.then(function(b){c=!1;a=b},function(b){c=!0;a=b});if(c===void 0)throw Error("non synchronizable promise");if(c)throw a;return a};i.promiseEach=function(b,e,a){if(b.length===0)return c.resolve([]);var f=c.defer(),d=function(g){var h=[],i=e.call(a,b[g]);c.resolve(i).then(function(a){h[g]=a;a=g+1;a>=b.length?f.resolve(h):d(a)}).then(null,function(a){f.reject(a)})};d(0);return f.promise};i.NS_XHTML="http://www.w3.org/1999/xhtml";i.NS_XUL="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
i.createElement=function(b,c){return i.isXmlDocument(b)?b.createElementNS(i.NS_XHTML,c):b.createElement(c)};i.clearElement=function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)};var g=/^\s*$/;i.removeWhitespace=function(b,c){for(var a=0;a<b.childNodes.length;){var f=b.childNodes.item(a);f.nodeType===3&&g.test(f.textContent)?b.removeChild(f):(c&&f.nodeType===1&&i.removeWhitespace(f,c),a++)}};i.importCss=function(b,c,a){if(b){c=c||document;if(!a){a=0;if(b.length!=0)for(var f=0;f<b.length;f++){var d=
b.charCodeAt(f),a=(a<<5)-a+d;a&=a}a="hash-"+a}if(f=c.getElementById(a))return f.tagName.toLowerCase()!=="style"&&console.error("Warning: importCss passed id="+a+", but that pre-exists (and isn't a style tag)"),f;f=i.createElement(c,"style");f.id=a;f.appendChild(c.createTextNode(b));(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(f);return f}};i.setTextContent=function(b,c){i.clearElement(b);var a=b.ownerDocument.createTextNode(c);b.appendChild(a)};i.setContents=function(b,c){if(typeof HTMLElement!==
"undefined"&&c instanceof HTMLElement)i.clearElement(b),b.appendChild(c);else if("innerHTML"in b)b.innerHTML=c;else try{var a=b.ownerDocument.documentElement.namespaceURI;if(!a)a=i.NS_XHTML;i.clearElement(b);for(var f=b.ownerDocument.createRange().createContextualFragment('<div xmlns="'+a+'">'+c+"</div>").firstChild;f.hasChildNodes();)b.appendChild(f.firstChild)}catch(d){throw console.error("Bad XHTML",d),console.trace(),d;}};i.toDom=function(b,c){var a=i.createElement(b,"div");i.setContents(a,c);
return a.children[0]};i.isXmlDocument=function(b){b=b||document;return b.contentType&&b.contentType!="text/html"?!0:b.xmlVersion!=null?!0:!1};i.findCssSelector=function(b){var c=b.ownerDocument;if(b.id&&c.getElementById(b.id)===b)return"#"+b.id;var a=b.tagName.toLowerCase();if(a==="html")return"html";if(a==="head")return"head";if(a==="body")return"body";b.parentNode==null&&console.log("danger: "+a);var f,d;if(b.classList.length>0)for(var e=0;e<b.classList.length;e++){f="."+b.classList.item(e);d=c.querySelectorAll(f);
if(d.length===1)return f;f=a+f;d=c.querySelectorAll(f);if(d.length===1)return f;d=h(b,b.parentNode.children)+1;f=f+":nth-child("+d+")";d=c.querySelectorAll(f);if(d.length===1)return f}d=h(b,b.parentNode.children)+1;return f=i.findCssSelector(b.parentNode)+" > "+a+":nth-child("+d+")"};i.createUrlLookup=function(b){return function(c){try{return j("text!gcli/ui/"+c)}catch(a){if(b.filename)return b.filename+c;var f=b.id.split("/").pop()+".js";return b.uri.substr(-f.length)!==f?(console.error("Can't work out path from module.uri/module.id"),
c):b.uri?b.uri.substr(0,b.uri.length-f.length-1)+"/"+c:f+"/"+c}}};i.updateCommand=function(b,c){e(b,function(a){c.update(a)})};i.executeCommand=function(b,c){e(b,function(a){c.exec({visible:!0,typed:a})})};i.KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,
DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,
DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,
DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}});
define("gcli/nls/strings",["require","exports","module"],function(j,i){i.root={canonDescNone:"(No description)",cliEvalJavascript:"Enter JavaScript directly",cliUnusedArg:"Too many arguments",cliOptions:"Available Options",fieldSelectionSelect:"Select a %S\u2026",fieldArrayAdd:"Add",fieldArrayDel:"Delete",fieldMenuMore:"More matches, keep typing",jstypeParseScope:"Scope lost",jstypeParseMissing:"Can't find property '%S'",jstypeBeginSyntax:"Syntax error",jstypeBeginUnterm:"Unterminated string literal",
jstypeParseError:"Error",typesNumberNan:'Can\'t convert "%S" to a number.',typesNumberMax:"%1$S is greater than maximum allowed: %2$S.",typesNumberMin:"%1$S is smaller than minimum allowed: %2$S.",typesNumberNotInt2:'Can\'t convert "%S" to an integer.',typesSelectionNomatch:"Can't use '%S'.",nodeParseSyntax:"Syntax error in CSS query",nodeParseMultiple:"Too many matches (%S)",nodeParseNone:"No matches",helpDesc:"Get help on the available commands",helpManual:"Provide help either on a specific command (if a search string is provided and an exact match is found) or on the available commands (if a search string is not provided, or if no exact match is found).",
helpSearchDesc:"Search string",helpSearchManual3:"search string to use in narrowing down the displayed commands. Regular expressions not supported.",helpManSynopsis:"Synopsis",helpManDescription:"Description",helpManParameters:"Parameters",helpManNone:"None",helpListAll:"Available Commands:",helpListPrefix:"Commands starting with '%1$S':",helpListNone:"No commands starting with '%1$S'",helpManRequired:"required",helpManOptional:"optional",subCommands:"Sub-Commands",subCommandsNone:"None",prefDesc:"Commands to control settings",
prefManual:"Commands to display and alter preferences both for GCLI and the surrounding environment",prefListDesc:"Display available settings",prefListManual:"Display a list of preferences, optionally filtered when using the 'search' parameter",prefListSearchDesc:"Filter the list of settings displayed",prefListSearchManual:"Search for the given string in the list of available preferences",prefShowDesc:"Display setting value",prefShowManual:"Display the value of a given preference",prefShowSettingDesc:"Setting to display",
prefShowSettingManual:"The name of the setting to display",prefSetDesc:"Alter a setting",prefSetManual:"Alter preferences defined by the environment",prefSetSettingDesc:"Setting to alter",prefSetSettingManual:"The name of the setting to alter.",prefSetValueDesc:"New value for setting",prefSetValueManual:"The new value for the specified setting",prefSetCheckHeading:"This might void your warranty!",prefSetCheckBody:"Changing these advanced settings can be harmful to the stability, security, and performance of this application. You should only continue if you are sure of what you are doing.",
prefSetCheckGo:"I'll be careful, I promise!",prefResetDesc:"Reset a setting",prefResetManual:"Reset the value of a setting to the system defaults",prefResetSettingDesc:"Setting to reset",prefResetSettingManual:"The name of the setting to reset to the system default value",prefOutputFilter:"Filter",prefOutputName:"Name",prefOutputValue:"Value",introDesc:"Show the opening message",introManual:"Redisplay the message that is shown to new users until they click the 'Got it!' button",introTextOpening2:"This command line is designed for developers. It focuses on speed of input over JavaScript syntax and a rich display over monospace output.",
introTextCommands:"For a list of commands type",introTextKeys2:", or to show/hide command hints press",introTextF1Escape:"F1/Escape",introTextGo:"Got it!",hideIntroDesc:"Show the initial welcome message",eagerHelperDesc:"How eager are the tooltips",allowSetDesc:"Has the user enabled the 'pref set' command?"}});
define("util/l10n",["require","exports","module","gcli/nls/strings"],function(j,i){function h(a,b){return a.replace(/\{[^}]*\}/g,function(a){a=a.slice(1,-1);if(b==null)return console.log("Missing swaps while looking up '"+a+"'"),"";var c=b[a];c==null&&(console.log("Can't find '"+a+"' in "+JSON.stringify(b)),c="");return c})}function e(a,b){var c=0,a=a.replace(/%S/g,function(){return b[c++]});return a=a.replace(/%([0-9])\$S/g,function(a,c){return b[c-1]})}function c(){if(!k){var a=navigator.language||
navigator.userLanguage;b.some(function(b){return b.locales.indexOf(a)!==-1?(k=b,!0):!1});k||(console.error("Failed to find plural rule for "+a),k=b[0])}return k}var g={};i.registerStringsSource=function(a){var b=j(a).root;Object.keys(b).forEach(function(c){g[c]?console.error("Key '"+c+"' (loaded from "+a+") already exists. Ignoring."):g[c]=b[c]},this)};j("gcli/nls/strings");i.registerStringsSource("gcli/nls/strings");i.unregisterStringsSource=function(a){a=j(a).root;Object.keys(a).forEach(function(a){delete g[a]},
this)};i.getPreferredLocales=function(){var a=(typeof navigator!=="undefined"?(navigator.language||navigator.userLanguage).toLowerCase():"en-us").split("-"),b=a.map(function(b,c){return a.slice(0,a.length-c).join("-")});b.push("root");return b};i.lookup=function(a){var b=g[a];if(b==null)throw Error("No i18n key: "+a);return b};i.propertyLookup=typeof Proxy!=="undefined"?Proxy.create({get:function(a,b){return i.lookup(b)}}):g;i.lookupSwap=function(a,b){var c=i.lookup(a);return h(c,b)};i.lookupFormat=
function(a,b){var c=i.lookup(a);return e(c,b)};i.lookupPlural=function(a,b,d){var e=c().get(b),a=i.lookup(a)[e],d=d||{};d.ord=b;return h(a,d)};var b=[{locales:"fa,fa-ir,id,ja,ja-jp-mac,ka,ko,ko-kr,th,th-th,tr,tr-tr,zh,zh-tw,zh-cn".split(","),numForms:1,get:function(){return 0}},{locales:"af,af-za,as,ast,bg,br,bs,bs-ba,ca,cy,cy-gb,da,de,de-de,de-ch,en,en-gb,en-us,en-za,el,el-gr,eo,es,es-es,es-ar,es-cl,es-mx,et,et-ee,eu,fi,fi-fi,fy,fy-nl,gl,gl-gl,he,hu,hu-hu,hy,hy-am,it,it-it,kk,ku,lg,mai,ml,ml-in,mn,nb,nb-no,no,no-no,nl,nn,nn-no,no,no-no,nb,nb-no,nso,nso-za,pa,pa-in,pt,pt-pt,rm,rm-ch,si,si-lk,son,son-ml,sq,sq-al,sv,sv-se,vi,vi-vn,zu,zu-za".split(","),
numForms:2,get:function(a){return a!=1?1:0}},{locales:"ak,ak-gh,bn,bn-in,bn-bd,fr,fr-fr,gu,gu-in,kn,kn-in,mr,mr-in,oc,oc-oc,or,or-in,pt-br,ta,ta-in,ta-lk,te,te-in".split(","),numForms:2,get:function(a){return a>1?1:0}},{locales:["lv"],numForms:3,get:function(a){return a%10==1&&a%100!=11?1:a!=0?2:0}},{locales:["gd","gd-gb"],numForms:4,get:function(a){return a==1||a==11?0:a==2||a==12?1:a>0&&a<20?2:3}},{locales:["ro","ro-ro"],numForms:3,get:function(a){return a==1?0:a==0||a%100>0&&a%100<20?1:2}},{locales:["lt"],
numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&(a%100<10||a%100>=20)?2:1}},{locales:"be,be-by,hr,hr-hr,ru,ru-ru,sr,sr-rs,sr-cs,uk".split(","),numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["cs","sk"],numForms:3,get:function(a){return a==1?0:a>=2&&a<=4?1:2}},{locales:["pl"],numForms:3,get:function(a){return a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["sl"],numForms:4,get:function(a){return a%100==1?
0:a%100==2?1:a%100==3||a%100==4?2:3}},{locales:["ga-ie","ga-ie","ga","en-ie"],numForms:5,get:function(a){return a==1?0:a==2?1:a>=3&&a<=6?2:a>=7&&a<=10?3:4}},{locales:["ar"],numForms:6,get:function(a){return a==0?5:a==1?0:a==2?1:a%100>=3&&a%100<=10?2:a%100>=11&&a%100<=99?3:4}},{locales:["mt"],numForms:4,get:function(a){return a==1?0:a==0||a%100>0&&a%100<=10?1:a%100>10&&a%100<20?2:3}},{locales:["mk","mk-mk"],numForms:3,get:function(a){return a%10==1?0:a%10==2?1:2}},{locales:["is"],numForms:2,get:function(a){return a%
10==1&&a%100!=11?0:1}}],k});
define("gcli/argument",["require","exports","module"],function(j,i){function h(a,b,c){a===void 0?this.suffix=this.prefix=this.text="":(this.text=a,this.prefix=b!==void 0?b:"",this.suffix=c!==void 0?c:"")}function e(){this.suffix=this.prefix=this.text=""}function c(a,b,f){this.text=a!==void 0?a:"";this.prefix=b!==void 0?b:"";this.suffix=f!==void 0?f:"";c._moveSpaces(this)}function g(a,b,c){if(!Array.isArray(a))throw Error("args is not an array of Arguments");this.args=b===void 0?a:a.slice(b,c);a=h.merge(this.args);
this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function b(a){this.arg=a;this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function k(){this.suffix=this.prefix=this.text=""}function a(a,b,c){typeof a==="string"?(this.valueArg=this.nameArg=null,this.text=a,this.prefix=b,this.suffix=c):b==null?(this.nameArg=a,this.valueArg=null,this.text="",this.prefix=this.nameArg.toString(),this.suffix=""):(this.nameArg=a,this.valueArg=b,this.text=this.valueArg.text,this.prefix=this.nameArg.toString()+
this.valueArg.prefix,this.suffix=this.valueArg.suffix)}function f(){this.args=[]}h.prototype.type="Argument";h.prototype.merge=function(a){return new h(this.text+this.suffix+a.prefix+a.text,this.prefix,a.suffix)};h.prototype.beget=function(a){var b=this.text,c=this.prefix,f=this.suffix;if(a.text!=null&&(b=a.text,!a.dontQuote)){var e=b.indexOf(" ")>=0||b.length==0,g=/['"]$/.test(c);e&&!g&&(c+="'",f="'"+f)}a.prefixSpace&&c.charAt(0)!==" "&&(c=" "+c);a.prefixPostSpace&&c.charAt(c.length-1)!==" "&&(c+=
" ");a.suffixSpace&&f.charAt(f.length-1)!==" "&&(f+=" ");return b===this.text&&f===this.suffix&&c===this.prefix?this:new (a.type||h)(b,c,f)};h.prototype.assign=function(a){this.assignment=a};h.prototype.getArgs=function(){return[this]};h.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof h)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};h.prototype.toString=function(){return this.prefix+this.text+this.suffix};h.merge=function(a,b,c){for(var c=c===void 0?
a.length:c,f,b=b===void 0?0:b;b<c;b++){var e=a[b];f=f?f.merge(e):e}return f};Object.defineProperty(h.prototype,"_summaryJson",{get:function(){return"<"+this.prefix+":"+this.text+":"+this.suffix+"> (a="+(this.assignment==null?"null":this.assignment.param.name)+", t="+this.type+")"},enumerable:!0});i.Argument=h;e.prototype=Object.create(h.prototype);e.prototype.type="BlankArgument";i.BlankArgument=e;c.prototype=Object.create(h.prototype);c.prototype.type="ScriptArgument";c._moveSpaces=function(a){for(;a.text.charAt(0)===
" ";)a.prefix+=" ",a.text=a.text.substring(1);for(;a.text.charAt(a.text.length-1)===" ";)a.suffix=" "+a.suffix,a.text=a.text.slice(0,-1)};c.prototype.beget=function(a){a.type=c;a=h.prototype.beget.call(this,a);c._moveSpaces(a);return a};i.ScriptArgument=c;g.prototype=Object.create(h.prototype);g.prototype.type="MergedArgument";g.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},this);this.assignment=a};g.prototype.getArgs=function(){return this.args};g.prototype.equals=function(a){return this===
a?!0:a==null||!(a instanceof g)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};i.MergedArgument=g;b.prototype=Object.create(h.prototype);b.prototype.type="TrueNamedArgument";b.prototype.assign=function(a){this.arg&&this.arg.assign(a);this.assignment=a};b.prototype.getArgs=function(){return[this.arg]};b.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof b)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};b.prototype.beget=function(a){a.text&&
console.error("Can't change text of a TrueNamedArgument",this,a);a.type=b;a=h.prototype.beget.call(this,a);a.arg=new h(a.text,a.prefix,a.suffix);return a};i.TrueNamedArgument=b;k.prototype=Object.create(h.prototype);k.prototype.type="FalseNamedArgument";k.prototype.getArgs=function(){return[]};k.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof k)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};i.FalseNamedArgument=k;a.prototype=Object.create(h.prototype);
a.prototype.type="NamedArgument";a.prototype.assign=function(a){this.nameArg.assign(a);this.valueArg!=null&&this.valueArg.assign(a);this.assignment=a};a.prototype.getArgs=function(){return this.valueArg?[this.nameArg,this.valueArg]:[this.nameArg]};a.prototype.equals=function(b){return this===b?!0:b==null?!1:!(b instanceof a)?!1:this.text===b.text&&this.prefix===b.prefix&&this.suffix===b.suffix};a.prototype.beget=function(b){b.type=a;var b=h.prototype.beget.call(this,b),c=/^([\s]*)([^\s]*)([\s]*['"]?)$/.exec(b.prefix);
this.valueArg==null&&b.text===""?(b.nameArg=new h(c[2],c[1],c[3]),b.valueArg=null):(b.nameArg=new h(c[2],c[1],""),b.valueArg=new h(b.text,c[3],b.suffix));return b};i.NamedArgument=a;f.prototype=Object.create(h.prototype);f.prototype.type="ArrayArgument";f.prototype.addArgument=function(a){this.args.push(a)};f.prototype.addArguments=function(a){Array.prototype.push.apply(this.args,a)};f.prototype.getArguments=function(){return this.args};f.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},
this);this.assignment=a};f.prototype.getArgs=function(){return this.args};f.prototype.equals=function(a){if(this===a)return!0;if(a==null)return!1;if(a.type!=="ArrayArgument")return!1;if(this.args.length!==a.args.length)return!1;for(var b=0;b<this.args.length;b++)if(!this.args[b].equals(a.args[b]))return!1;return!0};f.prototype.toString=function(){return"{"+this.args.map(function(a){return a.toString()},this).join(",")+"}"};i.ArrayArgument=f});
define("gcli/types","require,exports,module,util/promise,gcli/argument,gcli/argument".split(","),function(j,i){function h(b,c,f,e,g){this.value=b;this.arg=c;if(c==null)throw Error("Missing arg");if(g!=null){b=typeof g==="function"?g():g;if(typeof b.then!=="function")throw Error("predictions is not a promise");b.then(function(a){if(!Array.isArray(a))throw Error("prediction resolves to non array");},console.error)}this._status=f||a.VALID;this.message=e;this.predictions=g}function e(b,c){this.arg=c;
this.conversions=b;this.value=b.map(function(a){return a.value},this);this._status=a.combine(b.map(function(a){return a.getStatus()}));this.message="";this.predictions=[]}function c(){}var g=j("util/promise"),b=j("gcli/argument").Argument,k=j("gcli/argument").BlankArgument,a={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},ERROR:{toString:function(){return"ERROR"},valueOf:function(){return 2}},
combine:function(){for(var b=a.VALID,c=0;c<arguments.length;c++){var f=arguments[c];Array.isArray(f)&&(f=a.combine.apply(null,f));f>b&&(b=f)}return b}};i.Status=a;h.prototype.assign=function(a){this.arg.assign(a)};h.prototype.isDataProvided=function(){return this.arg.type!=="BlankArgument"};h.prototype.equals=function(a){return this===a?!0:a==null?!1:this.valueEquals(a)&&this.argEquals(a)};h.prototype.valueEquals=function(a){return this.value===a.value};h.prototype.argEquals=function(a){return a==
null?!1:this.arg.equals(a.arg)};h.prototype.getStatus=function(){return this._status};h.prototype.toString=function(){return this.arg.toString()};h.prototype.getPredictions=function(){return typeof this.predictions==="function"?this.predictions():g.resolve(this.predictions||[])};h.prototype.constrainPredictionIndex=function(a){return a==null?g.resolve():this.getPredictions().then(function(b){if(b.length!==0)return a%=b.length,a<0&&(a=b.length+a),a}.bind(this))};h.maxPredictions=11;i.Conversion=h;
e.prototype=Object.create(h.prototype);e.prototype.assign=function(a){this.conversions.forEach(function(b){b.assign(a)},this);this.assignment=a};e.prototype.getStatus=function(a){return a&&a.conversion?a.conversion.getStatus():this._status};e.prototype.isDataProvided=function(){return this.conversions.length>0};e.prototype.valueEquals=function(a){if(!(a instanceof e))throw Error("Can't compare values with non ArrayConversion");if(this.value===a.value)return!0;if(this.value.length!==a.value.length)return!1;
for(var b=0;b<this.conversions.length;b++)if(!this.conversions[b].valueEquals(a.conversions[b]))return!1;return!0};e.prototype.toString=function(){return"[ "+this.conversions.map(function(a){return a.toString()},this).join(", ")+" ]"};i.ArrayConversion=e;c.prototype.stringify=function(){throw Error("Not implemented");};c.prototype.parse=function(){throw Error("Not implemented");};c.prototype.parseString=function(a){return this.parse(new b(a))};c.prototype.name=void 0;c.prototype.increment=function(){};
c.prototype.decrement=function(){};c.prototype.getBlank=function(){return new h(void 0,new k,a.INCOMPLETE,"")};c.prototype.getType=function(){return this};i.Type=c;var f={};i.getTypeNames=function(){return Object.keys(f)};i.registerType=function(a){if(typeof a==="object")if(a instanceof c){if(!a.name)throw Error("All registered types must have a name");f[a.name]=a}else throw Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw Error("All registered types must have a name");
f[a.prototype.name]=a}else throw Error("Unknown type: "+a);};i.registerTypes=function(a){Object.keys(a).forEach(function(b){var c=a[b];c.name=b;a.registerType(c)})};i.deregisterType=function(a){delete f[a.name]};i.getType=function(a){var b;if(typeof a==="string")return b=f[a],typeof b==="function"&&(b=new b({})),b;if(typeof a==="object"){if(!a.name)throw Error("Missing 'name' member to typeSpec");b=f[a.name];typeof b==="function"&&(b=new b(a));return b}throw Error("Can't extract type from "+a);}});
define("gcli/types/spell",["require","exports","module"],function(j,i){i.correct=function(h,e){if(e.length!==0){var c={},g;e.forEach(function(b){var e=h.length,a=b.length,f=Array(e+1),d=Array(e+1),g=Array(e+1),i,j;for(i=0;i<=e;i++)d[i]=i*1;for(j=1;j<=a;j++){f[0]=j*1;for(i=1;i<=e;i++)f[i]=Math.min(f[i-1]+1,d[i]+1,d[i-1]+(h[i-1]===b[j-1]?0:2)),i>1&&j>1&&h[i-1]===b[j-2]&&b[j-1]===h[i-2]&&(f[i]=Math.min(f[i],g[i-2]+1));i=g;g=d;d=f;f=i}c[b]=d[e]});g=e.sort(function(b,e){return c[b]!==c[e]?c[b]-c[e]:b<
e});if(c[g[0]]<=4)return g[0]}}});
define("gcli/types/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/spell,gcli/argument".split(","),function(j,i){function h(a){a&&Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function e(a,b){if(n&&!b){var c=g.defer();setTimeout(function(){g.resolve(a).then(function(a){typeof a==="function"&&(a=e(a(),b));c.resolve(a)})},500);return c.promise}return g.resolve(a).then(function(a){return typeof a==="function"?e(a(),b):
a})}function c(a){if(!Array.isArray(a))throw Error("SelectionType has no lookup or data");return a.map(function(a){return{name:a,value:a}},this)}var g=j("util/promise"),b=j("util/util"),k=j("util/l10n"),a=j("gcli/types"),f=j("gcli/types").Type,d=j("gcli/types").Status,l=j("gcli/types").Conversion,m=j("gcli/types/spell"),o=j("gcli/argument").BlankArgument;i.startup=function(){a.registerType(h)};i.shutdown=function(){a.unregisterType(h)};h.prototype=Object.create(f.prototype);h.prototype.stringify=
function(a){if(a==null)return"";if(this.stringifyProperty!=null)return a[this.stringifyProperty];try{var c=null;b.synchronize(this.getLookup()).some(function(b){return b.value===a?(c=b.name,!0):!1},this);return c}catch(d){return a.toString()}};h.prototype.clearCache=function(){delete this._cachedLookup};h.prototype.getLookup=function(){if(this._cachedLookup!=null)return this._cachedLookup;var a;this.lookup==null?a=e(this.data,this.neverForceAsync).then(c):(a=typeof this.lookup==="function"?this.lookup.bind(this):
this.lookup,a=e(a,this.neverForceAsync));if(this.cacheable&&!n)this._cachedLookup=a;return a};var n=!1;h.prototype._findPredictions=function(a){return g.resolve(this.getLookup()).then(function(b){var c=[],d,f,e=l.maxPredictions,g=a.text.toLowerCase();if(a.suffix.length>0){for(d=0;d<b.length&&c.length<e;d++)f=b[d],f.name===a.text&&this._addToPredictions(c,f,a);return c}for(d=0;d<b.length;d++)if(f=b[d],f._gcliLowerName==null)f._gcliLowerName=f.name.toLowerCase();for(d=0;d<b.length&&c.length<e;d++)f=
b[d],f.name===a.text&&this._addToPredictions(c,f,a);for(d=0;d<b.length&&c.length<e;d++)f=b[d],f._gcliLowerName.indexOf(g)===0&&!f.value.hidden&&c.indexOf(f)===-1&&this._addToPredictions(c,f,a);if(c.length<e/2)for(d=0;d<b.length&&c.length<e;d++)f=b[d],f._gcliLowerName.indexOf(g)!==-1&&!f.value.hidden&&c.indexOf(f)===-1&&this._addToPredictions(c,f,a);if(c.length===0){var h=[];b.forEach(function(a){a.value.hidden||h.push(a.name)});var k=m.correct(g,h);k&&b.forEach(function(a){a.name===k&&c.push(a)},
this)}return c}.bind(this))};h.prototype._addToPredictions=function(a,b){a.push(b)};h.prototype.parse=function(a){return this._findPredictions(a).then(function(b){if(b.length===0){var c=k.lookupFormat("typesSelectionNomatch",[a.text]);return new l(void 0,a,d.ERROR,c,g.resolve(b))}this.noMatch&&this.noMatch();return b[0].name===a.text?new l(b[0].value,a,d.VALID,"",g.resolve(b)):new l(void 0,a,d.INCOMPLETE,"",g.resolve(b))}.bind(this))};h.prototype.getBlank=function(){var a=function(){return g.resolve(this.getLookup()).then(function(a){return a.filter(function(a){return!a.value.hidden}).slice(0,
l.maxPredictions-1)},console.error)}.bind(this);return new l(void 0,new o,d.INCOMPLETE,"",a)};h.prototype.decrement=function(a){var c=b.synchronize(this.getLookup()),a=this._findValue(c,a);a===-1&&(a=0);a++;a>=c.length&&(a=0);return c[a].value};h.prototype.increment=function(a){var c=b.synchronize(this.getLookup()),a=this._findValue(c,a);a===-1&&(a=1);a--;a<0&&(a=c.length-1);return c[a].value};h.prototype._findValue=function(a,b){for(var c=-1,d=0;d<a.length;d++)if(a[d].value===b){c=d;break}return c};
h.prototype.name="selection";i.SelectionType=h});
define("gcli/types/basic","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/selection,gcli/argument,gcli/argument".split(","),function(j,i){function h(){}function e(a){this._allowFloat=!!a.allowFloat;if(a){if(this._min=a.min,this._max=a.max,this._step=a.step||1,!this._allowFloat&&(this._isFloat(this._min)||this._isFloat(this._max)||this._isFloat(this._step)))throw Error("allowFloat is false, but non-integer values given in type spec");}else this._step=
1}function c(){}function g(a){if(typeof a.delegateType!=="function")throw Error("Instances of DelegateType need typeSpec.delegateType to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function b(){}function k(a){if(!a.subtype)console.error("Array.typeSpec is missing subtype. Assuming string."+JSON.stringify(a)),a.subtype="string";Object.keys(a).forEach(function(b){this[b]=a[b]},this);this.subtype=l.getType(this.subtype)}var a=j("util/promise"),f=j("util/util"),
d=j("util/l10n"),l=j("gcli/types"),m=j("gcli/types").Type,o=j("gcli/types").Status,n=j("gcli/types").Conversion,p=j("gcli/types").ArrayConversion,w=j("gcli/types/selection").SelectionType,q=j("gcli/argument").BlankArgument,v=j("gcli/argument").ArrayArgument;i.startup=function(){l.registerType(h);l.registerType(e);l.registerType(c);l.registerType(b);l.registerType(g);l.registerType(k)};i.shutdown=function(){l.unregisterType(h);l.unregisterType(e);l.unregisterType(c);l.unregisterType(b);l.unregisterType(g);
l.unregisterType(k)};h.prototype=Object.create(m.prototype);h.prototype.stringify=function(a){return a==null?"":a.toString()};h.prototype.parse=function(b){return b.text==null||b.text===""?a.resolve(new n(void 0,b,o.INCOMPLETE,"")):a.resolve(new n(b.text,b))};h.prototype.name="string";i.StringType=h;e.prototype=Object.create(m.prototype);e.prototype.stringify=function(a){return a==null?"":""+a};e.prototype.getMin=function(){if(this._min){if(typeof this._min==="function")return this._min();if(typeof this._min===
"number")return this._min}};e.prototype.getMax=function(){if(this._max){if(typeof this._max==="function")return this._max();if(typeof this._max==="number")return this._max}};e.prototype.parse=function(b){if(b.text.replace(/^\s*-?/,"").length===0)return a.resolve(new n(void 0,b,o.INCOMPLETE,""));if(!this._allowFloat&&b.text.indexOf(".")!==-1){var c=d.lookupFormat("typesNumberNotInt2",[b.text]);return a.resolve(new n(void 0,b,o.ERROR,c))}c=this._allowFloat?parseFloat(b.text):parseInt(b.text,10);if(isNaN(c))return c=
d.lookupFormat("typesNumberNan",[b.text]),a.resolve(new n(void 0,b,o.ERROR,c));var f=this.getMax();if(f!=null&&c>f)return c=d.lookupFormat("typesNumberMax",[c,f]),a.resolve(new n(void 0,b,o.ERROR,c));f=this.getMin();return f!=null&&c<f?(c=d.lookupFormat("typesNumberMin",[c,f]),a.resolve(new n(void 0,b,o.ERROR,c))):a.resolve(new n(c,b))};e.prototype.decrement=function(a){if(typeof a!=="number"||isNaN(a))return this.getMax()||1;a-=this._step;a=Math.ceil(a/this._step)*this._step;return this._boundsCheck(a)};
e.prototype.increment=function(a){if(typeof a!=="number"||isNaN(a))return a=this.getMin(),a!=null?a:0;a+=this._step;a=Math.floor(a/this._step)*this._step;return this.getMax()==null?a:this._boundsCheck(a)};e.prototype._boundsCheck=function(a){var b=this.getMin();if(b!=null&&a<b)return b;b=this.getMax();return b!=null&&a>b?b:a};e.prototype._isFloat=function(a){return typeof a==="number"&&isFinite(a)&&a%1!==0};e.prototype.name="number";i.NumberType=e;c.prototype=Object.create(w.prototype);c.prototype.lookup=
[{name:"false",value:!1},{name:"true",value:!0}];c.prototype.parse=function(b){return b.type==="TrueNamedArgument"?a.resolve(new n(!0,b)):b.type==="FalseNamedArgument"?a.resolve(new n(!1,b)):w.prototype.parse.call(this,b)};c.prototype.stringify=function(a){return a==null?"":""+a};c.prototype.getBlank=function(){return new n(!1,new q,o.VALID,"",a.resolve(this.lookup))};c.prototype.name="boolean";i.BooleanType=c;g.prototype.delegateType=function(){throw Error("Not implemented");};g.prototype=Object.create(m.prototype);
g.prototype.stringify=function(a){return this.delegateType().stringify(a)};g.prototype.parse=function(a){return this.delegateType().parse(a)};g.prototype.decrement=function(a){var b=this.delegateType();return b.decrement?b.decrement(a):void 0};g.prototype.increment=function(a){var b=this.delegateType();return b.increment?b.increment(a):void 0};g.prototype.getType=function(){return this.delegateType()};Object.defineProperty(g.prototype,"isImportant",{get:function(){return this.delegateType().isImportant},
enumerable:!0});g.prototype.name="delegate";i.DelegateType=g;b.prototype=Object.create(m.prototype);b.prototype.stringify=function(){return""};b.prototype.parse=function(b){return a.resolve(new n(void 0,b))};b.prototype.name="blank";i.BlankType=b;k.prototype=Object.create(m.prototype);k.prototype.stringify=function(a){return a==null?"":a.join(" ")};k.prototype.parse=function(a){if(a.type!=="ArrayArgument")throw console.error("non ArrayArgument to ArrayType.parse",a),Error("non ArrayArgument to ArrayType.parse");
var b=function(a){return this.subtype.parse(a).then(function(b){return a.conversion=b}.bind(this),console.error)}.bind(this),b=a.getArguments().map(b);return f.all(b).then(function(b){return new p(b,a)})};k.prototype.getBlank=function(){return new p([],new v)};k.prototype.name="array";i.ArrayType=k});
define("gcli/canon","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection".split(","),function(j,i){function h(a,c){if(a==null)return c?b.lookup(c):a;if(typeof a==="string")return a;if(typeof a==="object"){if(a.key)return b.lookup(a.key);var d=b.getPreferredLocales(),f;d.some(function(b){f=a[b];return f!=null});if(f!=null)return f;console.error("Can't find locale in descriptions: locales="+JSON.stringify(d)+", description="+JSON.stringify(a));
return"(No description)"}return b.lookup(c)}function e(a){Object.keys(a).forEach(function(b){this[b]=a[b]},this);if(!this.name)throw Error("All registered commands must have a name");if(this.params==null)this.params=[];if(!Array.isArray(this.params))throw Error("command.params must be an array in "+this.name);this.hasNamedParameters=!1;this.description="description"in this?this.description:void 0;this.description=h(this.description,"canonDescNone");this.manual="manual"in this?this.manual:void 0;this.manual=
h(this.manual);var b=this.params;this.params=[];var d=!1;if(this.returnType==null)this.returnType="string";b.forEach(function(a){if(a.group)a.params.forEach(function(b){b=new c(b,this,a.group);this.params.push(b);if(!b.isPositionalAllowed)this.hasNamedParameters=!0},this),d=!0;else if(d)throw Error("Parameters can't come after param groups. Ignoring "+this.name+"/"+a.name);else{var b=new c(a,this,null);this.params.push(b);if(!b.isPositionalAllowed)this.hasNamedParameters=!0}},this)}function c(b,c,
d){this.command=c||{name:"unnamed"};this.paramSpec=b;this.name=this.paramSpec.name;this.type=this.paramSpec.type;this.groupName=d;if(!this.name)throw Error("In "+this.command.name+": all params must have a name");b=this.type;this.type=k.getType(b);if(this.type==null)throw console.error("Known types: "+k.getTypeNames().join(", ")),Error("In "+this.command.name+"/"+this.name+": can't find type for: "+JSON.stringify(b));if(this.type instanceof f&&this.paramSpec.defaultValue!==void 0)throw Error("In "+
this.command.name+"/"+this.name+": boolean parameters can not have a defaultValue. Ignoring");if(this._defaultValue!=null)try{this.type.parseString(this.type.stringify(this.paramSpec.defaultValue)).then(function(b){b.getStatus()!==a.VALID&&console.error("In "+this.command.name+"/"+this.name+": Error round tripping defaultValue. status = "+b.getStatus())}.bind(this),console.error)}catch(e){throw Error("In "+this.command.name+"/"+this.name+": "+e);}if(!this.isPositionalAllowed&&this.paramSpec.defaultValue===
void 0&&this.type.getBlank==null&&!(this.type instanceof f))throw Error("In "+this.command.name+"/"+this.name+": Missing defaultValue for optional parameter.");}j("util/promise");var g=j("util/util"),b=j("util/l10n"),k=j("gcli/types"),a=j("gcli/types").Status,f=j("gcli/types/basic").BooleanType;j("gcli/types/selection");i.Command=e;Object.defineProperty(c.prototype,"defaultValue",{get:function(){if(!("_defaultValue"in this))this._defaultValue=this.paramSpec.defaultValue!==void 0?this.paramSpec.defaultValue:
this.type.getBlank().value;return this._defaultValue},enumerable:!0});c.prototype.isKnownAs=function(a){return a==="--"+this.name?!0:!1};c.prototype.getBlank=function(){return this.type.getBlank()};Object.defineProperty(c.prototype,"manual",{get:function(){return h(this.paramSpec.manual||void 0)},enumerable:!0});Object.defineProperty(c.prototype,"description",{get:function(){return h(this.paramSpec.description||void 0,"canonDescNone")},enumerable:!0});Object.defineProperty(c.prototype,"isDataRequired",
{get:function(){return this.defaultValue===void 0},enumerable:!0});Object.defineProperty(c.prototype,"hidden",{get:function(){return this.paramSpec.hidden},enumerable:!0});Object.defineProperty(c.prototype,"isPositionalAllowed",{get:function(){return this.groupName==null},enumerable:!0});i.Parameter=c;var d={},l=[],m={};i.addCommand=function(a){d[a.name]!=null&&(delete d[a.name],l=l.filter(function(b){return b!==a.name}));var b=new e(a);d[a.name]=b;l.push(a.name);l.sort();m[a.name]=a;i.onCanonChange();
return b};i.removeCommand=function(a){var b=typeof a==="string"?a:a.name;if(!d[b])return!1;delete d[b];delete m[b];l=l.filter(function(a){return a!==b});i.onCanonChange();return!0};i.getCommand=function(a){return d[a]||void 0};i.getCommands=function(){return Object.keys(d).map(function(a){return d[a]},this)};i.getCommandNames=function(){return l.slice(0)};i.getCommandSpecs=function(){return m};i.onCanonChange=g.createEvent("canon.onCanonChange");i.CommandOutputManager=function(){this.onOutput=g.createEvent("CommandOutputManager.onOutput")}});
define("gcli/types/command","require,exports,module,util/promise,util/l10n,gcli/canon,gcli/types,gcli/types/selection,gcli/types,gcli/types".split(","),function(j,i){function h(a){this.requisition=a.requisition;this.isIncompleteName=a.isIncompleteName;this.stringifyProperty="name";this.neverForceAsync=!0}function e(){this.stringifyProperty="name";this.neverForceAsync=!0}var c=j("util/promise"),g=j("util/l10n"),b=j("gcli/canon"),k=j("gcli/types"),a=j("gcli/types/selection").SelectionType,f=j("gcli/types").Status,
d=j("gcli/types").Conversion;i.startup=function(){k.registerType(e);k.registerType(h)};i.shutdown=function(){k.unregisterType(e);k.unregisterType(h)};h.prototype=Object.create(a.prototype);h.prototype.name="param";h.prototype.lookup=function(){var a=[],b=this.requisition.commandAssignment.value;b!=null&&b.params.forEach(function(b){var c=this.requisition.getAssignment(b.name).arg;!b.isPositionalAllowed&&c.type==="BlankArgument"&&a.push({name:"--"+b.name,value:b})},this);return a};h.prototype.parse=
function(b){if(this.isIncompleteName)return a.prototype.parse.call(this,b);else{var e=g.lookup("cliUnusedArg");return c.resolve(new d(void 0,b,f.ERROR,e))}};e.prototype=Object.create(a.prototype);e.prototype.name="command";e.prototype.lookup=function(){var a=b.getCommands();a.sort(function(a,b){return a.name.localeCompare(b.name)});return a.map(function(a){return{name:a.name,value:a}},this)};e.prototype._addToPredictions=function(a,b,c){(c.text.length!==0||b.name.indexOf(" ")===-1)&&a.push(b)};e.prototype.parse=
function(a){var b=function(){return this._findPredictions(a)}.bind(this);return this._findPredictions(a).then(function(c){if(c.length===0)return c=g.lookupFormat("typesSelectionNomatch",[a.text]),new d(void 0,a,f.ERROR,c,b);var e=c[0].value;return c.length===1?e.name===a.text&&typeof e.exec==="function"?new d(e,a,f.VALID,""):new d(void 0,a,f.INCOMPLETE,"",b):c[0].name===a.text?new d(e,a,f.VALID,"",b):new d(void 0,a,f.INCOMPLETE,"",b)}.bind(this))}});
define("gcli/types/javascript","require,exports,module,util/promise,util/l10n,gcli/types".split(","),function(j,i){var h,e;function c(){}function g(a){return a.indexOf("moz")===0||a.indexOf("webkit")===0||a.indexOf("ms")===0}var b=j("util/promise"),k=j("util/l10n"),a=j("gcli/types"),f=a.Conversion,d=a.Type,l=a.Status;i.startup=function(){a.registerType(c)};i.shutdown=function(){a.unregisterType(c)};var m=void 0;typeof window!=="undefined"&&(m=window);i.setGlobalObject=function(a){m=a};i.getGlobalObject=
function(){return m};i.unsetGlobalObject=function(){m=void 0};c.prototype=Object.create(d.prototype);c.prototype.stringify=function(a){return a==null?"":a};c.MAX_COMPLETION_MATCHES=10;c.prototype.parse=function(a){var d=a.text,i=m;if(d==="")return b.resolve(new f(void 0,a,l.INCOMPLETE));if(!isNaN(parseFloat(d))&&isFinite(d))return b.resolve(new f(d,a));if(d.trim().match(/(null|undefined|NaN|Infinity|true|false)/))return b.resolve(new f(d,a));var j=this._findCompletionBeginning(d);if(j.err)return b.resolve(new f(d,
a,l.ERROR,j.err));if(j.state===h)return b.resolve(new f(d,a));if(j.state!==e)return b.resolve(new f(d,a,l.INCOMPLETE,""));var j=d.substring(j.startPos).split("."),o,n=void 0;if(j.length>1){o=j.pop().trimLeft();for(var p=0;p<j.length;p++){n=j[p].trim();if(i==null)return b.resolve(new f(d,a,l.ERROR,k.lookup("jstypeParseScope")));if(n==="")return b.resolve(new f(d,a,l.INCOMPLETE,""));if(this._isSafeProperty(i,n))return b.resolve(new f(d,a));try{i=i[n]}catch(w){return b.resolve(new f(d,a,l.VALID,""))}}}else o=
j[0].trimLeft();if(n&&!n.match(/^[0-9A-Za-z]*$/))return b.resolve(new f(d,a));if(i==null)return j=k.lookupFormat("jstypeParseMissing",[n]),b.resolve(new f(d,a,l.ERROR,j));if(!o.match(/^[0-9A-Za-z]*$/))return b.resolve(new f(d,a));if(this._isIteratorOrGenerator(i))return b.resolve(new f(d,a));var j=o.length,C=j===0?d:d.slice(0,-j),y=l.INCOMPLETE,j="",r={},A=0,n=i;try{for(;n!=null&&Object.keys(r).length<c.MAX_COMPLETION_MATCHES;)Object.keys(n).forEach(function(a){a.indexOf(o)===0&&!(a in r)&&(r[a]=
{prop:a,distUpPrototypeChain:A})}),A++,n=Object.getPrototypeOf(n)}catch(D){return b.resolve(new f(d,a,l.INCOMPLETE,""))}r=Object.keys(r).map(function(a){if(a===o)y=l.VALID;return r[a]});r.sort(function(a,b){return a.distUpPrototypeChain!==b.distUpPrototypeChain?a.distUpPrototypeChain-b.distUpPrototypeChain:g(a.prop)?g(b.prop)?a.prop.localeCompare(b.prop):1:g(b.prop)?-1:a.prop.localeCompare(b.prop)});r.length>c.MAX_COMPLETION_MATCHES&&(r=r.slice(0,c.MAX_COMPLETION_MATCHES-1));n=r.map(function(a){var b,
c=!0;if(this._isSafeProperty(i,a.prop))b="(property getter)";else try{var d=i[a.prop];typeof d==="function"?b="(function)":typeof d==="boolean"||typeof d==="number"?(b="= "+d,c=!1):typeof d==="string"?(d.length>40&&(d=d.substring(0,37)+"\u2026"),b="= '"+d+"'",c=!1):b="("+typeof d+")"}catch(f){b="("+k.lookup("jstypeParseError")+")"}return{name:C+a.prop,value:{name:C+a.prop,description:b},description:b,incomplete:c}},this);if(n.length===0)y=l.ERROR,j=k.lookupFormat("jstypeParseMissing",[o]);n.length===
1&&y===l.VALID&&(n=[]);return b.resolve(new f(d,a,y,j,b.resolve(n)))};e=0;h=1;var o="{[(".split(""),n="}])".split(""),p={"{":"}","[":"]","(":")"},w=/[a-zA-Z0-9.]/;c.prototype._findCompletionBeginning=function(a){for(var b=[],c=e,d=0,f,g=!1,i=0;i<a.length;i++)switch(f=a[i],w.test(f)||(g=!0),c){case e:if(f==='"')c=3;else if(f==="'")c=2;else if(f===";")d=i+1;else if(f===" ")d=i+1;else if(o.indexOf(f)!=-1)b.push({token:f,start:d}),d=i+1;else if(n.indexOf(f)!=-1){d=b.pop();if(!d||p[d.token]!=f)return{err:k.lookup("jstypeBeginSyntax")};
d=f==="}"?i+1:d.start}break;case 3:if(f==="\\")i++;else if(f==="\n")return{err:k.lookup("jstypeBeginUnterm")};else f==='"'&&(c=e);break;case 2:if(f==="\\")i++;else if(f==="\n")return{err:k.lookup("jstypeBeginUnterm")};else f==="'"&&(c=e)}c===e&&g&&(c=h);return{state:c,startPos:d}};c.prototype._isIteratorOrGenerator=function(a){if(a===null)return!1;if(typeof aObject==="object"){if(typeof a.__iterator__==="function"||a.constructor&&a.constructor.name==="Iterator")return!0;try{var b=a.toString();if(typeof a.next===
"function"&&b.indexOf("[object Generator")===0)return!0}catch(c){}}return!1};c.prototype._isSafeProperty=function(a,b){if(typeof a!=="object")return!1;for(var c=void 0;a;){try{if(c=Object.getOwnPropertyDescriptor(a,b))break}catch(d){return d.name==="NS_ERROR_XPC_BAD_CONVERT_JS"||d.name==="NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"?!1:!0}a=Object.getPrototypeOf(a)}return!c?!1:!c.get?!1:typeof c.get!=="function"||"prototype"in c.get};c.prototype.name="javascript";i.JavascriptType=c});
define("util/host",["require","exports","module"],function(j,i){function h(e,c){if(!e.__gcliHighlighting){e.__gcliHighlighting=!0;var g=e.style.background;e.style.background=c?"green":"red";setTimeout(function(){e.style.background=g;delete e.__gcliHighlighting},500)}}i.flashNodes=function(e,c){e.style?h(e,c):Array.prototype.forEach.call(e,function(e){h(e,c)})};i.exec=function(e,c){var g=JSON.stringify(c),b=new XMLHttpRequest;b.open("POST","/exec/",!0);b.setRequestHeader("Content-Type","application/json; charset=utf-8");
b.setRequestHeader("Content-Length",g.length);b.onreadystatechange=function(){b.readyState==4&&(b.status>=300||b.status<200?e.reject(b.responseText):e.resolve(b.responseText))};b.send(g)};i.func=function(e,c){var g=JSON.stringify(c),b=new XMLHttpRequest;b.open("POST","/func/",!0);b.setRequestHeader("Content-Type","application/json; charset=utf-8");b.setRequestHeader("Content-Length",g.length);b.onreadystatechange=function(){b.readyState==4&&(b.status>=300||b.status<200?e.reject(JSON.parse(b.responseText)):
e.resolve(JSON.parse(b.responseText)))};b.send(g)}});
define("gcli/types/node","require,exports,module,util/promise,util/host,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/argument".split(","),function(j,i){function h(){}function e(a){if("allowEmpty"in a&&typeof a.allowEmpty!=="boolean")throw Error("Legal values for allowEmpty are [true|false]");this.allowEmpty=a.allowEmpty}var c=j("util/promise"),g=j("util/host"),b=j("util/l10n"),k=j("gcli/types"),a=j("gcli/types").Type,f=j("gcli/types").Status,d=j("gcli/types").Conversion,l=j("gcli/argument").BlankArgument;
i.startup=function(){k.registerType(h);k.registerType(e)};i.shutdown=function(){k.unregisterType(h);k.unregisterType(e)};var m=void 0;typeof document!=="undefined"&&(m=document);i._empty=[];i.setDocument=function(a){m=a;if(m!=null)i._empty=m.querySelectorAll("x>:root")};i.unsetDocument=function(){m=void 0;i._empty=void 0};i.getDocument=function(){return m};h.prototype=Object.create(a.prototype);h.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};h.prototype.parse=function(a){if(a.text===
"")return c.resolve(new d(void 0,a,f.INCOMPLETE));var e;try{e=m.querySelectorAll(a.text)}catch(h){return c.resolve(new d(void 0,a,f.ERROR,b.lookup("nodeParseSyntax")))}if(e.length===0)return c.resolve(new d(void 0,a,f.INCOMPLETE,b.lookup("nodeParseNone")));if(e.length===1)return e=e.item(0),e.__gcliQuery=a.text,g.flashNodes(e,!0),c.resolve(new d(e,a,f.VALID,""));g.flashNodes(e,!1);e=b.lookupFormat("nodeParseMultiple",[e.length]);return c.resolve(new d(void 0,a,f.ERROR,e))};h.prototype.name="node";
e.prototype=Object.create(a.prototype);e.prototype.getBlank=function(){return new d(i._empty,new l,f.VALID)};e.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};e.prototype.parse=function(a){if(a.text==="")return c.resolve(new d(void 0,a,f.INCOMPLETE));var e;try{e=m.querySelectorAll(a.text)}catch(h){return c.resolve(new d(void 0,a,f.ERROR,b.lookup("nodeParseSyntax")))}if(e.length===0&&!this.allowEmpty)return c.resolve(new d(void 0,a,f.INCOMPLETE,b.lookup("nodeParseNone")));
g.flashNodes(e,!1);return c.resolve(new d(e,a,f.VALID,""))};e.prototype.name="nodelist"});
define("gcli/types/resource","require,exports,module,util/promise,gcli/types,gcli/types/selection".split(","),function(j,i){function h(a,b,c,d){this.name=a;this.type=b;this.inline=c;this.element=d}function e(a){this.name=a.href;if(!this.name)this.name=a.ownerNode.id?"css#"+a.ownerNode.id:"inline-css";this.inline=a.href==null;this.type=h.TYPE_CSS;this.element=a}function c(a){this.name=a.src;if(!this.name)this.name=a.id?"script#"+a.id:"inline-script";this.inline=a.src===""||a.src==null;this.type=h.TYPE_SCRIPT;
this.element=a}function g(a,b){var c={};a.forEach(function(a){c[a.name]==null&&(c[a.name]=[]);c[a.name].push(a)});Object.keys(c).forEach(function(a){a=c[a];a.length>1&&b(a)})}function b(a){this.include=a.include;if(this.include!==h.TYPE_SCRIPT&&this.include!==h.TYPE_CSS&&this.include!=null)throw Error("invalid include property: "+this.include);}var k=j("util/promise"),a=j("gcli/types"),f=j("gcli/types/selection").SelectionType;i.startup=function(){a.registerType(b)};i.shutdown=function(){a.unregisterType(b);
i.clearResourceCache()};i.clearResourceCache=function(){l.clear()};var d=void 0;typeof document!=="undefined"&&(d=document);i.setDocument=function(a){d=a};i.unsetDocument=function(){l.clear();d=void 0};i.getDocument=function(){return d};h.prototype.getContents=function(){throw Error("not implemented");};h.TYPE_SCRIPT="text/javascript";h.TYPE_CSS="text/css";e.prototype=Object.create(h.prototype);e.prototype.loadContents=function(a){a(this.element.ownerNode.innerHTML)};e._getAllStyles=function(){var a=
[];if(d==null)return a;Array.prototype.forEach.call(d.styleSheets,function(b){e._getStyle(b,a)});g(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};e._getStyle=function(a,b){var c=l.get(a);c||(c=new e(a),l.add(a,c));b.push(c);try{Array.prototype.forEach.call(a.cssRules,function(a){a.type==CSSRule.IMPORT_RULE&&a.styleSheet&&e._getStyle(a.styleSheet,b)},this)}catch(d){}};c.prototype=Object.create(h.prototype);c.prototype.loadContents=function(a){if(this.inline)a(this.element.innerHTML);
else{var b=new XMLHttpRequest;b.onreadystatechange=function(){b.readyState===b.DONE&&a(b.responseText)};b.open("GET",this.element.src,!0);b.send()}};c._getAllScripts=function(){if(d==null)return[];var a=d.querySelectorAll("script"),a=Array.prototype.map.call(a,function(a){var b=l.get(a);b||(b=new c(a),l.add(a,b));return b});g(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};b.prototype=Object.create(f.prototype);b.prototype.getLookup=function(){var a=[];this.include!==
h.TYPE_SCRIPT&&Array.prototype.push.apply(a,e._getAllStyles());this.include!==h.TYPE_CSS&&Array.prototype.push.apply(a,c._getAllScripts());return k.resolve(a.map(function(a){return{name:a.name,value:a}}))};b.prototype.name="resource";var l={_cached:[],get:function(a){for(var b=0;b<l._cached.length;b++)if(l._cached[b].node===a)return l._cached[b].resource;return null},add:function(a,b){l._cached.push({node:a,resource:b})},clear:function(){l._cached=[]}}});
define("gcli/settings",["require","exports","module","util/util","gcli/types"],function(j,i){function h(){}function e(a,b,e,g){this.name=a;this.type=b;this.description=e;this._defaultValue=g;this.onChange=c.createEvent("Setting.onChange");this.setDefault()}var c=j("util/util"),g=j("gcli/types"),b={},k={},a;i.setDefaults=function(a){Object.keys(a).forEach(function(b){k[b]===void 0&&(k[b]=a[b])})};i.startup=function(){a=new h;a.load(k)};i.shutdown=function(){};i.getAll=function(a){var c=[];Object.keys(b).forEach(function(e){(a==
null||e.indexOf(a)!==-1)&&c.push(b[e])}.bind(this));c.sort(function(a,b){return a.name.localeCompare(b.name)}.bind(this));return c};i.addSetting=function(a){var c=g.getType(a.type),a=new e(a.name,c,a.description,a.defaultValue);b[a.name]=a;i.onChange({added:a.name});return a};i.getSetting=function(a){return b[a]};i.removeSetting=function(a){a=typeof nameOrPrefSpec==="string"?a:a.name;delete b[a];i.onChange({removed:a})};i.onChange=c.createEvent("Settings.onChange");h.prototype.load=function(a){if(typeof localStorage!==
"undefined"){var b=localStorage.getItem("gcli-settings");if(b!=null){var c=JSON.parse(b);Object.keys(c).forEach(function(b){a[b]=c[b]})}}};h.prototype.save=function(a){typeof localStorage!=="undefined"&&(a=JSON.stringify(a),localStorage.setItem("gcli-settings",a))};i.LocalSettingStorage=h;e.prototype.setDefault=function(){this.value=this._defaultValue};Object.defineProperty(e.prototype,"value",{get:function(){return k[this.name]},set:function(b){k[this.name]=b;a.save(k);this.onChange({setting:this,
value:b})},enumerable:!0})});
define("gcli/types/setting","require,exports,module,gcli/settings,gcli/types,gcli/types/selection,gcli/types/basic".split(","),function(j,i){function h(){c.onChange.add(function(){this.clearCache()},this)}function e(){}var c=j("gcli/settings"),g=j("gcli/types"),b=j("gcli/types/selection").SelectionType,k=j("gcli/types/basic").DelegateType;i.startup=function(){g.registerType(h);g.registerType(e)};i.shutdown=function(){g.unregisterType(h);g.unregisterType(e)};var a=null;h.prototype=new b({cacheable:!0});
h.prototype.lookup=function(){return c.getAll().map(function(a){return{name:a.name,value:a}})};h.prototype.noMatch=function(){a=null};h.prototype.stringify=function(c){a=c;return b.prototype.stringify.call(this,c)};h.prototype.parse=function(c){c=b.prototype.parse.call(this,c);c.then(function(b){a=b.value});return c};h.prototype.name="setting";e.prototype=Object.create(k.prototype);e.prototype.delegateType=function(){return a!=null?a.type:g.getType("blank")};e.prototype.name="settingValue"});
define("util/domtemplate",["require","exports","module"],function(j,i){function h(c,g,b){b=new e(b||{});b.processNode(c,g);return b}function e(c){c==null&&(c={allowEval:!0});this.options=c;this.stack=c.stack&&Array.isArray(c.stack)?c.stack:typeof c.stack==="string"?[c.stack]:[];this.nodes=[]}e.prototype._templateRegion=/\$\{([^}]*)\}/g;e.prototype._splitSpecial=/\uF001|\uF002/;e.prototype._isPropertyScript=/^[_a-zA-Z0-9.]*$/;e.prototype.processNode=function(c,e){typeof c==="string"&&(c=document.getElementById(c));
e==null&&(e={});this.stack.push(c.nodeName+(c.id?"#"+c.id:""));var b=!1;try{if(c.attributes&&c.attributes.length){if(c.hasAttribute("foreach")){this._processForEach(c,e);return}if(c.hasAttribute("if")&&!this._processIf(c,e))return;this.nodes.push(e.__element);e.__element=c;for(var b=!0,h=Array.prototype.slice.call(c.attributes),a=0;a<h.length;a++){var f=h[a].value,d=h[a].name;this.stack.push(d);try{if(d==="save")f=this._stripBraces(f),this._property(f,e,c),c.removeAttribute("save");else if(d.substring(0,
2)==="on")if(f.substring(0,2)==="${"&&f.slice(-1)==="}"&&f.indexOf("${",2)===-1){var f=this._stripBraces(f),i=this._property(f,e);if(typeof i==="function"){c.removeAttribute(d);var j=c.hasAttribute("capture"+d.substring(2));c.addEventListener(d.substring(2),i,j);j&&c.removeAttribute("capture"+d.substring(2))}else c.setAttribute(d,i)}else c.setAttribute(d,this._processString(f,e));else{c.removeAttribute(d);d.charAt(0)==="_"&&(d=d.substring(1));var o;f.indexOf("${")===0&&f.charAt(f.length-1)==="}"?
(o=this._envEval(f.slice(2,-1),e,f))&&typeof o.then==="function"?(c.setAttribute(d,""),o.then(function(a){c.setAttribute(d,a)}.bind(this)).then(null,console.error)):(this.options.blankNullUndefined&&o==null&&(o=""),c.setAttribute(d,o)):c.setAttribute(d,this._processString(f,e))}}finally{this.stack.pop()}}}for(var n=Array.prototype.slice.call(c.childNodes),h=0;h<n.length;h++)this.processNode(n[h],e);c.nodeType===3&&this._processTextNode(c,e)}finally{if(b)e.__element=this.nodes.pop();this.stack.pop()}};
e.prototype._processString=function(c,e){return c.replace(this._templateRegion,function(b){b=this._envEval(b.slice(2,-1),e,c);return this.options.blankNullUndefined&&b==null?"":b}.bind(this))};e.prototype._processIf=function(c,e){this.stack.push("if");try{var b=c.getAttribute("if"),h=this._stripBraces(b),a=!0;try{a=!!this._envEval(h,e,b)}catch(f){this._handleError("Error with '"+h+"'",f),a=!1}a||c.parentNode.removeChild(c);c.removeAttribute("if");return a}finally{this.stack.pop()}};e.prototype._processForEach=
function(c,e){this.stack.push("foreach");try{var b=c.getAttribute("foreach"),h=b,a="param";if(h.charAt(0)==="$")h=this._stripBraces(h);else var f=h.split(" in "),a=f[0].trim(),h=this._stripBraces(f[1].trim());c.removeAttribute("foreach");try{this._handleAsync(this._envEval(h,e,b),c,function(b,d){this._processForEachLoop(b,c,d,e,a)}.bind(this)),c.parentNode.removeChild(c)}catch(d){this._handleError("Error with '"+h+"'",d)}}finally{this.stack.pop()}};e.prototype._processForEachLoop=function(c,e,b,h,
a){if(Array.isArray(c))c.forEach(function(c,f){this._processForEachMember(c,e,b,h,a,""+f)},this);else for(var f in c)c.hasOwnProperty(f)&&this._processForEachMember(f,e,b,h,a,f)};e.prototype._processForEachMember=function(c,e,b,h,a,f){this.stack.push(f);try{this._handleAsync(c,b,function(b,c){h[a]=b;if(c.parentNode!=null)if(e.nodeName.toLowerCase()==="loop")for(var f=0;f<e.childNodes.length;f++){var i=e.childNodes[f].cloneNode(!0);c.parentNode.insertBefore(i,c);this.processNode(i,h)}else i=e.cloneNode(!0),
i.removeAttribute("foreach"),c.parentNode.insertBefore(i,c),this.processNode(i,h);delete h[a]}.bind(this))}finally{this.stack.pop()}};e.prototype._processTextNode=function(c,e){var b=c.data,b=b.replace(this._templateRegion,"\uf001$$$1\uf002"),b=b.split(this._splitSpecial);b.length>1&&(b.forEach(function(b){b===null||b===void 0||b===""||(b.charAt(0)==="$"&&(b=this._envEval(b.slice(1),e,c.data)),this._handleAsync(b,c,function(a,b){var c=b.ownerDocument;a==null&&(a=this.options.blankNullUndefined?"":
""+a);typeof a.cloneNode==="function"?(a=this._maybeImportNode(a,c),b.parentNode.insertBefore(a,b)):typeof a.item==="function"&&a.length?Array.prototype.slice.call(a,0).forEach(function(a){a=this._maybeImportNode(a,c);b.parentNode.insertBefore(a,b)}.bind(this)):(a=c.createTextNode(a.toString()),b.parentNode.insertBefore(a,b))}.bind(this)))},this),c.parentNode.removeChild(c))};e.prototype._maybeImportNode=function(c,e){return c.ownerDocument===e?c:e.importNode(c,!0)};e.prototype._handleAsync=function(c,
e,b){if(c!=null&&typeof c.then==="function"){var h=e.ownerDocument.createElement("span");e.parentNode.insertBefore(h,e);c.then(function(a){b(a,h);h.parentNode!=null&&h.parentNode.removeChild(h)}.bind(this)).then(null,function(a){console.error(a.stack)})}else b(c,e)};e.prototype._stripBraces=function(c){return!c.match(this._templateRegion)?(this._handleError("Expected "+c+" to match ${...}"),c):c.slice(2,-1)};e.prototype._property=function(c,e,b){try{typeof c==="string"&&(c=c.split("."));var h=e[c[0]];
if(c.length===1)return b!==void 0&&(e[c[0]]=b),typeof h==="function"?h.bind(e):h;return!h?(this._handleError('"'+c[0]+'" is undefined'),null):this._property(c.slice(1),h,b)}catch(a){return this._handleError("Path error with '"+c+"'",a),"${"+c+"}"}};e.prototype._envEval=function(c,e,b){try{if(this.stack.push(b.replace(/\s+/g," ")),this._isPropertyScript.test(c))return this._property(c,e);else{if(!this.options.allowEval)return this._handleError("allowEval is not set, however '"+c+"' can not be resolved using a simple property path."),
"${"+c+"}";with(e)return eval(c)}}catch(h){return this._handleError("Template error evaluating '"+c+"'",h),"${"+c+"}"}finally{this.stack.pop()}};e.prototype._handleError=function(c,e){this._logError(c+" (In: "+this.stack.join(" > ")+")");e&&this._logError(e)};e.prototype._logError=function(c){console.log(c)};if(typeof i!=="undefined")i.template=h});
define("gcli/ui/view",["require","exports","module","util/util","util/domtemplate"],function(j,i){var h=j("util/util"),e=j("util/domtemplate");i.createView=function(c){if(c.html==null)throw Error("options.html is missing");return{isView:!0,appendTo:function(c,b){b===!0&&h.clearElement(c);c.appendChild(this.toDom(c.ownerDocument))},toDom:function(g){c.css&&h.importCss(c.css,g,c.cssId);g=h.toDom(g,c.html);e.template(g,c.data||{},c.options||{});return g}}}});
define("gcli/cli","require,exports,module,util/promise,util/util,util/l10n,gcli/ui/view,gcli/canon,gcli/canon,gcli/types,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument".split(","),function(j,i){function h(a,b){this.param=a;this.conversion=void 0;this.paramIndex=b;this.onAssignmentChange=f.createEvent("Assignment.onAssignmentChange")}function e(){var a={name:"__command",type:"command"},
b=this;Object.defineProperty(a,"description",{get:function(){var a=b.value;return a&&a.description?a.description:"The command to execute"},enumerable:!0});this.param=new m.Parameter(a);this.paramIndex=-1;this.onAssignmentChange=f.createEvent("CommandAssignment.onAssignmentChange")}function c(a,b){this.param=new m.Parameter({name:"__unassigned",description:d.lookup("cliOptions"),type:{name:"param",requisition:a,isIncompleteName:b.text.charAt(0)==="-"}});this.paramIndex=-1;this.onAssignmentChange=f.createEvent("UnassignedAssignment.onAssignmentChange");
this.conversion=f.synchronize(this.param.type.parse(b));this.conversion.assign(this)}function g(a,b,c){this.environment=a;this.document=b;if(this.document==null)try{this.document=document}catch(d){}this.commandOutputManager=c||new o;this.commandAssignment=new e;a=this.setAssignment(this.commandAssignment,null,{skipArgUpdate:!0});f.synchronize(a);this._assignments={};this.assignmentCount=0;this._args=[];this._unassigned=[];this._structuralChangeInProgress=!1;this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged,
this);this.commandAssignment.onAssignmentChange.add(this._assignmentChanged,this);this.onAssignmentChange=f.createEvent("Requisition.onAssignmentChange");this.onTextChange=f.createEvent("Requisition.onTextChange")}function b(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c===" "||c==='"'||c==="'"||c==="{"||c==="}"||c==="\\")return!1}return!0}function k(b){b=b||{};this.command=b.command||"";this.args=b.args||{};this.typed=b.typed||"";this.canonical=b.canonical||"";this.hidden=b.hidden===!0?!0:
!1;this.data=void 0;this.error=this.completed=!1;this.start=new Date;this.deferred=a.defer();this.then=this.deferred.promise.then;this.onClose=f.createEvent("Output.onClose");this.onChange=f.createEvent("Output.onChange")}var a=j("util/promise"),f=j("util/util"),d=j("util/l10n"),l=j("gcli/ui/view"),m=j("gcli/canon"),o=j("gcli/canon").CommandOutputManager,n=j("gcli/types").Status,p=j("gcli/types").Conversion,w=j("gcli/types/basic").ArrayType,q=j("gcli/types/basic").StringType,v=j("gcli/types/basic").BooleanType,
t=j("gcli/types/basic").NumberType,u=j("gcli/argument").Argument,s=j("gcli/argument").ArrayArgument,z=j("gcli/argument").NamedArgument,x=j("gcli/argument").TrueNamedArgument,B=j("gcli/argument").MergedArgument,C=j("gcli/argument").ScriptArgument,y;i.startup=function(){y=m.addCommand(A)};i.shutdown=function(){m.removeCommand(A.name);y=void 0};Object.defineProperty(h.prototype,"arg",{get:function(){return this.conversion.arg},enumerable:!0});Object.defineProperty(h.prototype,"value",{get:function(){return this.conversion.value},
enumerable:!0});h.prototype.getMessage=function(){return this.conversion.message?this.conversion.message:""};h.prototype.getPredictions=function(){return this.conversion.getPredictions()};h.prototype.getPredictionAt=function(b){b==null&&(b=0);return this.isInName()?a.resolve(void 0):this.getPredictions().then(function(a){if(a.length!==0)return b%=a.length,b<0&&(b=a.length+b),a[b]}.bind(this),console.error)};h.prototype.isInName=function(){return this.conversion.arg.type==="NamedArgument"&&this.conversion.arg.prefix.slice(-1)!==
" "};h.prototype.ensureVisibleArgument=function(){if(this.conversion.arg.type!=="BlankArgument")return!1;var a=this.conversion.arg.beget({text:"",prefixSpace:this.param instanceof e});this.conversion=f.synchronize(this.param.type.parse(a));this.conversion.assign(this);return!0};h.prototype.getStatus=function(a){return this.param.isDataRequired&&!this.conversion.isDataProvided()?n.INCOMPLETE:!this.param.isDataRequired&&this.arg.type==="BlankArgument"?n.VALID:this.conversion.getStatus(a)};h.prototype.toString=
function(){return this.conversion.toString()};Object.defineProperty(h.prototype,"_summaryJson",{get:function(){var a="<async>";this.getPredictions().then(function(b){a=b.length},console.log);return{param:this.param.name+"/"+this.param.type.name,defaultValue:this.param.defaultValue,arg:this.conversion.arg._summaryJson,value:this.value,message:this.getMessage(),status:this.getStatus().toString(),predictionCount:a}},enumerable:!0});i.Assignment=h;var r=eval;i.setEvalFunction=function(a){r=a};i.unsetEvalFunction=
function(){r=void 0};var A={name:"{",params:[{name:"javascript",type:"javascript",description:""}],hidden:!0,returnType:"object",description:{key:"cliEvalJavascript"},exec:function(a){return r(a.javascript)},evalRegexp:/^\s*{\s*/};e.prototype=Object.create(h.prototype);e.prototype.getStatus=function(a){return n.combine(h.prototype.getStatus.call(this,a),this.conversion.value&&this.conversion.value.exec?n.VALID:n.INCOMPLETE)};i.CommandAssignment=e;c.prototype=Object.create(h.prototype);c.prototype.getStatus=
function(){return this.conversion.getStatus()};g.prototype.destroy=function(){this.commandAssignment.onAssignmentChange.remove(this._commandAssignmentChanged,this);this.commandAssignment.onAssignmentChange.remove(this._assignmentChanged,this);delete this.document;delete this.environment};g.prototype._assignmentChanged=function(a){if(!(a.oldConversion!=null&&a.conversion.valueEquals(a.oldConversion))&&!this._structuralChangeInProgress&&(this.onAssignmentChange(a),!a.conversion.argEquals(a.oldConversion)))this.onTextChange()};
g.prototype._commandAssignmentChanged=function(a){if(!a.conversion.valueEquals(a.oldConversion)){this._assignments={};if(a=this.commandAssignment.value)for(var b=0;b<a.params.length;b++){var c=a.params[b],d=new h(c,b),e=this.setAssignment(d,null,{skipArgUpdate:!0});f.synchronize(e);d.onAssignmentChange.add(this._assignmentChanged,this);this._assignments[c.name]=d}this.assignmentCount=Object.keys(this._assignments).length}};g.prototype.getAssignment=function(a){return this._assignments[typeof a===
"string"?a:Object.keys(this._assignments)[a]]||void 0};g.prototype._getFirstBlankPositionalAssignment=function(){var a=null;Object.keys(this._assignments).some(function(b){b=this.getAssignment(b);return b.arg.type==="BlankArgument"&&b.param.isPositionalAllowed?(a=b,!0):!1},this);return a};g.prototype.getParameterNames=function(){return Object.keys(this._assignments)};g.prototype.cloneAssignments=function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)};g.prototype.getStatus=
function(){var a=n.VALID;if(this._unassigned.length!==0){var b=!0;this._unassigned.forEach(function(a){a.param.type.isIncompleteName||(b=!1)});a=b?n.INCOMPLETE:n.ERROR}this.getAssignments(!0).forEach(function(b){b=b.getStatus();b>a&&(a=b)},this);if(a===n.INCOMPLETE)a=n.ERROR;return a};g.prototype.getArgsObject=function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.conversion.isDataProvided()?b.value:b.param.defaultValue},this);return a};g.prototype.getAssignments=function(a){var b=
[];a===!0&&b.push(this.commandAssignment);Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b};g.prototype.setAssignment=function(b,c,d){function f(a){var c=b.conversion;b.conversion=a;b.conversion.assign(b);if(!b.conversion.equals(c))b.onAssignmentChange({assignment:b,conversion:b.conversion,oldConversion:c})}d=d||{};if(d.skipArgUpdate!==!0)for(var e=b.arg.getArgs(),g=c.getArgs(),h=Math.max(e.length,g.length),k=0;k<h;k++)if(k>=e.length||e[k].type==="BlankArgument")this._args.push(g[k]);
else{var i=this._args.indexOf(e[k]);if(i===-1)throw console.error("Couldn't find ",e[k]," in ",this._args),Error("Couldn't find "+e[k]);if(k>=g.length)this._args.splice(i,1);else{if(d.matchPadding){if(g[k].prefix.length===0&&this._args[i].prefix.length!==0)g[k].prefix=this._args[i].prefix;if(g[k].suffix.length===0&&this._args[i].suffix.length!==0)g[k].suffix=this._args[i].suffix}this._args[i]=g[k]}}if(c==null)f(b.param.type.getBlank());else if(typeof c.getStatus==="function")f(c);else return b.param.type.parse(c).then(function(a){f(a)}.bind(this),
console.error);return a.resolve(void 0)};g.prototype.setBlankArguments=function(){this.getAssignments().forEach(function(a){a=this.setAssignment(a,null,{skipArgUpdate:!0});f.synchronize(a)},this)};g.prototype.complete=function(a,b){var d=this.getAssignmentAt(a.start);return d.getPredictionAt(b).then(function(a){var b=[];this.onTextChange.holdFire();if(a==null)d.arg.suffix.slice(-1)!==" "&&d.getStatus()===n.VALID&&b.push(this._addSpace(d)),d.isInName()&&(a=d.conversion.arg.beget({prefixPostSpace:!0}),
a=this.setAssignment(d,a),b.push(a));else{var e=d.arg.beget({text:a.name,dontQuote:d===this.commandAssignment}),e=this.setAssignment(d,e);a.incomplete||(e=e.then(function(){return this._addSpace(d).then(function(){if(d instanceof c)return this.update(this.toString())}.bind(this))}.bind(this)));b.push(e)}return f.all(b).then(function(){this.onTextChange();this.onTextChange.resumeFire()}.bind(this))}.bind(this))};g.prototype._assertArgsAssigned=function(){this._args.forEach(function(a){a.assignment==
null&&console.log("No assignment for "+a)},this)};g.prototype._addSpace=function(b){var c=b.conversion.arg.beget({suffixSpace:!0});return c!==b.conversion.arg?this.setAssignment(b,c):a.resolve(void 0)};g.prototype.decrement=function(a){var b=a.param.type.decrement(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),f.synchronize(a))};g.prototype.increment=function(a){var b=a.param.type.increment(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),
b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),f.synchronize(a))};g.prototype.toCanonicalString=function(){var a=[],b=this.commandAssignment.value?this.commandAssignment.value.name:this.commandAssignment.arg.text;a.push(b);Object.keys(this._assignments).forEach(function(b){var b=this._assignments[b],c=b.param.type;b.value!==b.param.defaultValue&&(a.push(" "),a.push(c.stringify(b.value)))},this);b==="{"&&this.getAssignment(0).arg.suffix.indexOf("}")===-1&&a.push(" }");return a.join("")};
g.prototype.createInputArgTrace=function(){if(!this._args)throw Error("createInputMap requires a command line. See source.");var a=[],b;this._args.forEach(function(c){for(b=0;b<c.prefix.length;b++)a.push({arg:c,character:c.prefix[b],part:"prefix"});for(b=0;b<c.text.length;b++)a.push({arg:c,character:c.text[b],part:"text"});for(b=0;b<c.suffix.length;b++)a.push({arg:c,character:c.suffix[b],part:"suffix"})});return a};g.prototype.toString=function(){return this._args?this._args.map(function(a){return a.toString()}).join(""):
this.toCanonicalString()};g.prototype.typedEndsWithSeparator=function(){if(this._args){var a=this._args.slice(-1)[0];return a.suffix.slice(-1)===" "?!0:a.text===""&&a.suffix===""&&a.prefix.slice(-1)===" "}return this.toCanonicalString().slice(-1)===" "};g.prototype.getInputStatusMarkup=function(a){for(var b=this.createInputArgTrace(),a=b[a===0?0:a-1],c=[],d=0;d<b.length;d++){var f=b[d],g=f.arg,h=n.VALID;if(f.part==="text"&&(h=g.assignment.getStatus(g),h===n.INCOMPLETE)){var k=a.arg.assignment.arg.type===
"NamedArgument",k=a.part==="text"||k&&a.part==="suffix";if((g.assignment!==a.arg.assignment||!k)&&!(g.assignment instanceof e))h=n.ERROR}c.push({status:h,string:f.character})}for(d=0;d<c.length-1;)c[d].status===c[d+1].status?(c[d].string+=c[d+1].string,c.splice(d+1,1)):d++;return c};g.prototype.getAssignmentAt=function(a){if(!this._args)throw console.trace(),Error("Missing args");if(a===0)return this.commandAssignment;var b=[],c,d;for(c=0;c<this._args.length;c++){var f=this._args[c],e=f.assignment;
for(d=0;d<f.prefix.length;d++)b.push(e);for(d=0;d<f.text.length;d++)b.push(e);if(f.assignment.arg.type!=="NamedArgument")this._args.length>c+1?e=this._args[c+1].assignment:(d=this._getFirstBlankPositionalAssignment(),d!=null&&(e=d));for(d=0;d<f.suffix.length;d++)b.push(e)}b=b[a-1];if(!b)throw Error("Missing assignment. cursor="+a+" text="+this.toString());return b};g.prototype.exec=function(a){var b=null,c=null,d=!1;a&&a.hidden&&(d=!0);if(a)if(typeof input==="string")this.update(a);else if(typeof a.typed===
"string")this.update(a.typed);else if(a.command!=null)(b=m.getCommand(a.command))||console.error("Command not found: "+a.command),c=a.args;if(!b)b=this.commandAssignment.value,c=this.getArgsObject();if(!b)throw Error("Unknown command");a=this.toString();A.evalRegexp.test(a)&&(a=a.replace(A.evalRegexp,""),a=a.replace(/\s*}\s*$/,""));var f=new k({command:b,args:c,typed:a,canonical:this.toCanonicalString(),hidden:d});this.commandOutputManager.onOutput({output:f});var d=function(a){f.complete(a,!1)},
a=function(a){f.complete(a,!0)},e=function(a){f.changed(a)};try{var g=i.createExecutionContext(this);this._then(b.exec(c,g),d,a,e)}catch(h){console.error(h),a(h)}this.clear();return f};g.prototype.updateExec=function(a,b){return this.update(a).then(function(){return this.exec(b)}.bind(this))};g.prototype.clear=function(){this._structuralChangeInProgress=!0;var a=new u("","","");this._args=[a];this.setAssignment(this.commandAssignment,f.synchronize(this.commandAssignment.param.type.parse(a)),{skipArgUpdate:!0});
this._structuralChangeInProgress=!1;this.onTextChange()};g.prototype._then=function(a,b,c,d){var f=null;if(a!=null&&typeof a.then==="function")f=a.then;else if(a!=null&&a.promise!=null&&typeof a.promise.then==="function")f=a.promise.then;f!=null?f(b,c,d):b(a)};g.prototype.update=function(a){this._structuralChangeInProgress=!0;this._args=this._tokenize(a);var b=this._args.slice(0);return this._split(b).then(function(){return this._assign(b).then(function(){this._structuralChangeInProgress=!1;this.onTextChange()}.bind(this))}.bind(this))};
Object.defineProperty(g.prototype,"_summaryJson",{get:function(){var a={$args:this._args.map(function(a){return a._summaryJson}),_command:this.commandAssignment._summaryJson,_unassigned:this._unassigned.forEach(function(a){return a._summaryJson})};Object.keys(this._assignments).forEach(function(b){a[b]=this.getAssignment(b)._summaryJson}.bind(this));return a},enumerable:!0});g.prototype._tokenize=function(a){function c(a){return a.replace(/\uF000/g," ").replace(/\uF001/g,"'").replace(/\uF002/g,'"').replace(/\uF003/g,
"{").replace(/\uF004/g,"}")}if(a==null||a.length===0)return[new u("","","")];if(b(a))return[new u(a,"","")];for(var d=1,a=a.replace(/\\\\/g,"\\").replace(/\\b/g,"\u0008").replace(/\\f/g,"\u000c").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\u000b").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\ /g,"\uf000").replace(/\\'/g,"\uf001").replace(/\\"/g,"\uf002").replace(/\\{/g,"\uf003").replace(/\\}/g,"\uf004"),f=0,e=0,g="",h=[],k=0;;){var i=a[f];switch(d){case 1:i===
"'"?(g=a.substring(e,f+1),d=3,e=f+1):i==='"'?(g=a.substring(e,f+1),d=4,e=f+1):i==="{"?(g=a.substring(e,f+1),d=5,k++,e=f+1):/ /.test(i)||(g=a.substring(e,f),d=2,e=f);break;case 2:i===" "&&(d=c(a.substring(e,f)),h.push(new u(d,g,"")),d=1,e=f,g="");break;case 3:i==="'"&&(d=c(a.substring(e,f)),h.push(new u(d,g,i)),d=1,e=f+1,g="");break;case 4:i==='"'&&(d=c(a.substring(e,f)),h.push(new u(d,g,i)),d=1,e=f+1,g="");break;case 5:i==="{"?k++:i==="}"&&(k--,k===0&&(d=c(a.substring(e,f)),h.push(new C(d,g,i)),d=
1,e=f+1,g=""))}f++;if(f>=a.length){d===1?f!==e&&(a=a.substring(e,f),(f=h[h.length-1])?f.suffix+=a:h.push(new u("",a,""))):d===5?(d=c(a.substring(e,f+1)),h.push(new C(d,g,""))):(d=c(a.substring(e,f+1)),h.push(new u(d,g,"")));break}}return h};g.prototype._split=function(a){var b={skipArgUpdate:!0},c=void 0;if(a[0].type==="ScriptArgument")return c=new p(y,new C),this.setAssignment(this.commandAssignment,c,b);for(var d=1,e=this.commandAssignment.param.type;d<=a.length;){c=d===1?a[0]:new B(a,0,d);c=f.synchronize(e.parse(c));
if(!c.value||c.value.exec)break;d++}for(e=0;e<d;e++)a.shift();return this.setAssignment(this.commandAssignment,c,b)};g.prototype._addUnassignedArgs=function(a){a.forEach(function(a){this._unassigned.push(new c(this,a))}.bind(this))};g.prototype._assign=function(a){var b={skipArgUpdate:!0};this._unassigned=[];var d=[];if(!this.commandAssignment.value)return this._addUnassignedArgs(a),f.all(d);if(a.length===0)return this.setBlankArguments(),f.all(d);if(this.assignmentCount===0)return this._addUnassignedArgs(a),
f.all(d);if(this.assignmentCount===1){var e=this.getAssignment(0);if(e.param.type instanceof q){var g=a.length===1?a[0]:new B(a);d.push(this.setAssignment(e,g,b));return f.all(d)}}var h=this.getParameterNames(),k={};this.getAssignments(!1).forEach(function(c){for(var f=0;f<a.length;)if(c.param.isKnownAs(a[f].text)){var e=a.splice(f,1)[0];h=h.filter(function(a){return a!==c.param.name});if(c.param.type instanceof v)e=new x(e);else{var g=null;f+1<=a.length&&(g=a.splice(f,1)[0]);e=new z(e,g)}c.param.type instanceof
w?(g=k[c.param.name],g||(g=new s,k[c.param.name]=g),g.addArgument(e)):d.push(this.setAssignment(c,e,b))}else f++},this);h.forEach(function(f){f=this.getAssignment(f);if(f.param.isPositionalAllowed)if(f.param.type instanceof w){var e=k[f.param.name];e||(e=new s,k[f.param.name]=e);e.addArguments(a);a=[]}else a.length===0?d.push(this.setAssignment(f,null,b)):(e=a.splice(0,1)[0],(f.param.type instanceof t?/-[-a-zA-Z_]/.test(e.text):e.text.charAt(0)==="-")?this._unassigned.push(new c(this,e)):d.push(this.setAssignment(f,
e,b)));else d.push(this.setAssignment(f,null,b))},this);Object.keys(k).forEach(function(a){var c=this.getAssignment(a);d.push(this.setAssignment(c,k[a],b))},this);this._addUnassignedArgs(a);return f.all(d)};i.Requisition=g;k.prototype.changed=function(a,b){this.data=a;b=b||{};b.output=this;this.onChange(b)};k.prototype.complete=function(a,b,c){this.end=new Date;this.duration=this.end.getTime()-this.start.getTime();this.completed=!0;this.error=b;this.changed(a,c);b?this.deferred.reject():this.deferred.resolve()};
k.prototype.toDom=function(a){f.clearElement(a);var b=a.ownerDocument,c=this.data;if(c!=null){var d;typeof HTMLElement!=="undefined"&&c instanceof HTMLElement?d=c:c.isView?d=c.toDom(b):(this.command.returnType==="terminal"?Array.isArray(c)?(d=f.createElement(b,"div"),c.forEach(function(){var a=f.createElement(b,"textarea");a.classList.add("gcli-row-subterminal");a.readOnly=!0;d.appendChild(a)})):(d=f.createElement(b,"textarea"),d.classList.add("gcli-row-terminal"),d.readOnly=!0):d=f.createElement(b,
"p"),this.command.returnType==="string"?d.textContent=c:f.setContents(d,c.toString()));for(var c=d.querySelectorAll("*[href]"),e=0;e<c.length;e++)c[e].setAttribute("target","_blank");a.appendChild(d)}};k.prototype.toString=function(a){return this.data.isView?this.data.toDom(a).textContent:typeof HTMLElement!=="undefined"&&this.data instanceof HTMLElement?this.data.textContent:this.data==null?"":this.data.toString()};i.Output=k;i.createExecutionContext=function(b){return{exec:b.exec.bind(b),update:b.update.bind(b),
updateExec:b.updateExec.bind(b),document:b.document,environment:b.environment,createView:l.createView,defer:function(){return a.defer()},createPromise:function(){return a.defer()}}}});define("text!gcli/ui/intro.html",[],function(){return'\n<div>\n  <p>${l10n.introTextOpening2}</p>\n\n  <p>\n    ${l10n.introTextCommands}\n    <span class="gcli-out-shortcut" onclick="${onclick}"\n        ondblclick="${ondblclick}" data-command="help">help</span>${l10n.introTextKeys2}\n    <code>${l10n.introTextF1Escape}</code>.\n  </p>\n\n  <button onclick="${onGotIt}" if="${showHideButton}">${l10n.introTextGo}</button>\n</div>'});
define("gcli/ui/intro","require,exports,module,util/util,util/l10n,gcli/settings,gcli/ui/view,gcli/cli,text!gcli/ui/intro.html".split(","),function(j,i){var h=j("util/util"),e=j("util/l10n"),c=j("gcli/settings"),g=j("gcli/ui/view"),b=j("gcli/cli").Output,k={name:"hideIntro",type:"boolean",description:e.lookup("hideIntroDesc"),defaultValue:!1},a;i.startup=function(){a=c.addSetting(k)};i.shutdown=function(){c.removeSetting(k);a=void 0};i.maybeShowIntro=function(c,d){if(!a.value){var e=new b;c.onOutput({output:e});
var g=this.createView(d);e.complete(g)}};i.createView=function(b,c){return g.createView({html:j("text!gcli/ui/intro.html"),options:{stack:"intro.html"},data:{l10n:e.propertyLookup,onclick:function(a){h.updateCommand(a.currentTarget,b)},ondblclick:function(a){h.executeCommand(a.currentTarget,b)},showHideButton:c!=null,onGotIt:function(){a.value=!0;c.onClose()}}})}});
define("gcli/ui/focus","require,exports,module,util/util,util/l10n,gcli/settings,gcli/canon".split(","),function(j,i){function h(a,b){a=a||{};this._document=b.document||document;this._requisition=b.requisition;this._debug=a.debug||!1;this._blurDelay=a.blurDelay||150;this._window=this._document.defaultView;this._requisition.commandOutputManager.onOutput.add(this._outputted,this);this._blurDelayTimeout=null;this._monitoredElements=[];this._recentOutput=this._helpRequested=this._hasFocus=this._isError=
!1;this.onVisibilityChange=e.createEvent("FocusManager.onVisibilityChange");this._focused=this._focused.bind(this);this._document.addEventListener("focus",this._focused,!0);k.onChange.add(this._eagerHelperChanged,this);this.isOutputVisible=this.isTooltipVisible=void 0;this._checkShow()}var e=j("util/util"),c=j("util/l10n"),g=j("gcli/settings");j("gcli/canon");var b={name:"eagerHelper",type:{name:"selection",lookup:[{name:"never",value:1},{name:"sometimes",value:2},{name:"always",value:3}]},defaultValue:2,
description:c.lookup("eagerHelperDesc"),ignoreTypeDifference:!0},k;i.startup=function(){k=g.addSetting(b)};i.shutdown=function(){g.removeSetting(b);k=void 0};h.prototype.destroy=function(){k.onChange.remove(this._eagerHelperChanged,this);this._document.removeEventListener("focus",this._focused,!0);this._requisition.commandOutputManager.onOutput.remove(this._outputted,this);for(var a=0;a<this._monitoredElements.length;a++){var b=this._monitoredElements[a];console.error("Hanging monitored element: ",
b.element);b.element.removeEventListener("focus",b.onFocus,!0);b.element.removeEventListener("blur",b.onBlur,!0)}if(this._blurDelayTimeout)this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;delete this._focused;delete this._document;delete this._window;delete this._requisition};h.prototype.addMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.addMonitoredElement("+(b||"unknown")+")");var c={element:a,where:b,onFocus:function(){this._reportFocus(b)}.bind(this),
onBlur:function(){this._reportBlur(b)}.bind(this)};a.addEventListener("focus",c.onFocus,!0);a.addEventListener("blur",c.onBlur,!0);this._document.activeElement===a&&this._reportFocus(b);this._monitoredElements.push(c)};h.prototype.removeMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.removeMonitoredElement("+(b||"unknown")+")");this._monitoredElements=this._monitoredElements.filter(function(b){return b.element===a?(a.removeEventListener("focus",b.onFocus,!0),a.removeEventListener("blur",
b.onBlur,!0),!1):!0})};h.prototype.updatePosition=function(a){this.onVisibilityChange({tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible,dimensions:a})};h.prototype._outputted=function(){this._recentOutput=!0;this._helpRequested=!1;this._checkShow()};h.prototype._focused=function(){this._reportBlur("document")};h.prototype._reportFocus=function(a){this._debug&&console.log("FocusManager._reportFocus("+(a||"unknown")+")");if(this._blurDelayTimeout)this._debug&&console.log("FocusManager.cancelBlur"),
this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;if(!this._hasFocus)this._hasFocus=!0;this._checkShow()};h.prototype._reportBlur=function(a){this._debug&&console.log("FocusManager._reportBlur("+a+")");if(this._hasFocus)this._blurDelayTimeout?this._debug&&console.log("FocusManager.blurPending"):this._blurDelayTimeout=this._window.setTimeout(function(){this._debug&&console.log("FocusManager.blur");this._hasFocus=!1;this._checkShow();this._blurDelayTimeout=null}.bind(this),
this._blurDelay)};h.prototype._eagerHelperChanged=function(){this._checkShow()};h.prototype.onInputChange=function(){this._recentOutput=!1;this._checkShow()};h.prototype.helpRequest=function(){this._debug&&console.log("FocusManager.helpRequest");this._helpRequested=!0;this._recentOutput=!1;this._checkShow()};h.prototype.removeHelp=function(){this._debug&&console.log("FocusManager.removeHelp");this._recentOutput=this._helpRequested=this._isError=this._importantFieldFlag=!1;this._checkShow()};h.prototype.setImportantFieldFlag=
function(a){this._debug&&console.log("FocusManager.setImportantFieldFlag",a);this._importantFieldFlag=a;this._checkShow()};h.prototype.setError=function(a){this._debug&&console.log("FocusManager._isError",a);this._isError=a;this._checkShow()};h.prototype._checkShow=function(){var a=!1,b={tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible},c=this._shouldShowTooltip();if(this.isTooltipVisible!==c.visible)b.tooltipVisible=this.isTooltipVisible=c.visible,a=!0;c=this._shouldShowOutput();
if(this.isOutputVisible!==c.visible)b.outputVisible=this.isOutputVisible=c.visible,a=!0;a&&(this._debug&&console.log("FocusManager.onVisibilityChange",b),this.onVisibilityChange(b))};h.prototype._shouldShowTooltip=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:k.value===1?{visible:!1,reason:"eagerHelperNever"}:k.value===3?{visible:!0,reason:"eagerHelperAlways"}:this._isError?{visible:!0,reason:"isError"}:this._helpRequested?{visible:!0,reason:"helpRequested"}:this._importantFieldFlag?
{visible:!0,reason:"importantFieldFlag"}:{visible:!1,reason:"default"}};h.prototype._shouldShowOutput=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:this._recentOutput?{visible:!0,reason:"recentOutput"}:{visible:!1,reason:"default"}};i.FocusManager=h});
define("gcli/ui/fields","require,exports,module,util/promise,util/util,util/util,gcli/types/basic".split(","),function(j,i){function h(a,b){this.type=a;this.document=b.document;this.requisition=b.requisition}function e(a,b){h.call(this,a,b);this.element=g.createElement(this.document,"div");this.onFieldChange=g.createEvent("BlankField.onFieldChange")}var c=j("util/promise"),g=j("util/util"),b=j("util/util").KeyEvent,k=j("gcli/types/basic").BlankType;h.prototype.element=void 0;h.prototype.destroy=function(){delete this.messageElement};
h.prototype.setConversion=function(){throw Error("Field should not be used directly");};h.prototype.getConversion=function(){throw Error("Field should not be used directly");};h.prototype.setMessageElement=function(a){this.messageElement=a};h.prototype.setMessage=function(a){this.messageElement&&g.setTextContent(this.messageElement,a||"")};h.prototype.onInputChange=function(a){c.resolve(this.getConversion()).then(function(c){this.onFieldChange({conversion:c});this.setMessage(c.message);a.keyCode===
b.DOM_VK_RETURN&&this.requisition.exec()}.bind(this),console.error)};h.prototype.isImportant=!1;h.claim=function(){throw Error("Field should not be used directly");};h.TOOLTIP_MATCH=5;h.TOOLTIP_DEFAULT=4;h.MATCH=3;h.DEFAULT=2;h.BASIC=1;h.NO_MATCH=0;i.Field=h;var a=[];i.addField=function(b){if(typeof b!=="function")throw console.error("addField erroring on ",b),Error("addField requires a Field constructor");a.push(b)};i.removeField=function(a){if(typeof a!=="string")fields=fields.filter(function(b){return b!==
a}),delete fields[a];else if(a instanceof h)removeField(a.name);else throw console.error("removeField erroring on ",a),Error("removeField requires an instance of Field");};i.getField=function(b,c){var g,k=-1;a.forEach(function(a){var c=a.claim(b);c>k&&(k=c,g=a)});if(!g)throw console.error("Unknown field type ",b," in ",a),Error("Can't find field for "+b);return c.tooltip&&k<h.TOOLTIP_DEFAULT?new e(b,c):new g(b,c)};e.prototype=Object.create(h.prototype);e.claim=function(a){return a instanceof k?h.MATCH:
h.NO_MATCH};e.prototype.setConversion=function(a){this.setMessage(a.message)};e.prototype.getConversion=function(){return this.type.parse(new Argument)};i.addField(e)});
define("gcli/ui/fields/basic","require,exports,module,util/util,util/l10n,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function h(a,b){t.call(this,a,b);this.arg=new f;this.element=k.createElement(this.document,"input");this.element.type="text";this.element.classList.add("gcli-field");this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",
this.onInputChange,!1);this.onFieldChange=k.createEvent("StringField.onFieldChange")}function e(a,b){t.call(this,a,b);this.arg=new f;this.element=k.createElement(this.document,"input");this.element.type="number";if(this.type.max)this.element.max=this.type.max;if(this.type.min)this.element.min=this.type.min;if(this.type.step)this.element.step=this.type.step;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",this.onInputChange,!1);this.onFieldChange=k.createEvent("NumberField.onFieldChange")}
function c(a,b){t.call(this,a,b);this.name=b.name;this.named=b.named;this.element=k.createElement(this.document,"input");this.element.type="checkbox";this.element.id="gcliForm"+this.name;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=k.createEvent("BooleanField.onFieldChange")}function g(a,b){t.call(this,a,b);this.options=b;this.requisition.onAssignmentChange.add(this.update,this);this.element=k.createElement(this.document,
"div");this.update();this.onFieldChange=k.createEvent("DelegateField.onFieldChange")}function b(b,c){t.call(this,b,c);this.options=c;this._onAdd=this._onAdd.bind(this);this.members=[];this.element=k.createElement(this.document,"div");this.element.classList.add("gcli-array-parent");this.addButton=k.createElement(this.document,"button");this.addButton.classList.add("gcli-array-member-add");this.addButton.addEventListener("click",this._onAdd,!1);this.addButton.textContent=a.lookup("fieldArrayAdd");this.element.appendChild(this.addButton);
this.container=k.createElement(this.document,"div");this.container.classList.add("gcli-array-members");this.element.appendChild(this.container);this.onInputChange=this.onInputChange.bind(this);this.onFieldChange=k.createEvent("ArrayField.onFieldChange")}var k=j("util/util"),a=j("util/l10n"),f=j("gcli/argument").Argument,d=j("gcli/argument").TrueNamedArgument,l=j("gcli/argument").FalseNamedArgument,m=j("gcli/argument").ArrayArgument,o=j("gcli/types").ArrayConversion,n=j("gcli/types/basic").StringType,
p=j("gcli/types/basic").NumberType,w=j("gcli/types/basic").BooleanType,q=j("gcli/types/basic").DelegateType,v=j("gcli/types/basic").ArrayType,t=j("gcli/ui/fields").Field,u=j("gcli/ui/fields");i.startup=function(){u.addField(h);u.addField(e);u.addField(c);u.addField(g);u.addField(b)};i.shutdown=function(){u.removeField(h);u.removeField(e);u.removeField(c);u.removeField(g);u.removeField(b)};h.prototype=Object.create(t.prototype);h.prototype.destroy=function(){t.prototype.destroy.call(this);this.element.removeEventListener("keyup",
this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};h.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};h.claim=function(a){return a instanceof n?t.MATCH:t.BASIC};e.prototype=Object.create(t.prototype);e.claim=function(a){return a instanceof p?t.MATCH:t.NO_MATCH};e.prototype.destroy=
function(){t.prototype.destroy.call(this);this.element.removeEventListener("keyup",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};e.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};e.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};c.prototype=Object.create(t.prototype);c.claim=function(a){return a instanceof w?
t.MATCH:t.NO_MATCH};c.prototype.destroy=function(){t.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};c.prototype.setConversion=function(a){this.element.checked=a.value;this.setMessage(a.message)};c.prototype.getConversion=function(){return this.type.parse(this.named?this.element.checked?new d(new f(" --"+this.name)):new l:new f(" "+this.element.checked))};g.prototype=Object.create(t.prototype);
g.prototype.update=function(){var a=this.type.delegateType();if(a!==this.subtype)this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.subtype=a,this.field=u.getField(a,this.options),this.field.onFieldChange.add(this.fieldChanged,this),k.clearElement(this.element),this.element.appendChild(this.field.element)};g.claim=function(a){return a instanceof q?t.MATCH:t.NO_MATCH};g.prototype.destroy=function(){t.prototype.destroy.call(this);this.requisition.onAssignmentChange.remove(this.update,
this);delete this.element;delete this.document;delete this.onInputChange};g.prototype.setConversion=function(a){this.field.setConversion(a)};g.prototype.getConversion=function(){return this.field.getConversion()};Object.defineProperty(g.prototype,"isImportant",{get:function(){return this.field.isImportant},enumerable:!0});b.prototype=Object.create(t.prototype);b.claim=function(a){return a instanceof v?t.MATCH:t.NO_MATCH};b.prototype.destroy=function(){t.prototype.destroy.call(this);this.addButton.removeEventListener("click",
this._onAdd,!1)};b.prototype.setConversion=function(a){k.clearElement(this.container);this.members=[];a.conversions.forEach(function(a){this._onAdd(null,a)},this)};b.prototype.getConversion=function(){for(var a=[],b=new m,c=0;c<this.members.length;c++)Promise.resolve(this.members[c].field.getConversion()).then(function(c){a.push(c);b.addArgument(c.arg)}.bind(this),console.error);return new o(a,b)};b.prototype._onAdd=function(b,c){var d=k.createElement(this.document,"div");d.classList.add("gcli-array-member");
this.container.appendChild(d);var f=u.getField(this.type.subtype,this.options);f.onFieldChange.add(function(){Promise.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)},this);c&&f.setConversion(c);d.appendChild(f.element);var e=k.createElement(this.document,"button");e.classList.add("gcli-array-member-del");e.addEventListener("click",this._onDel,!1);e.textContent=a.lookup("fieldArrayDel");d.appendChild(e);d={element:d,
field:f,parent:this};d.onDelete=function(){this.parent.container.removeChild(this.element);this.parent.members=this.parent.members.filter(function(a){return a!==this});this.parent.onInputChange()}.bind(d);e.addEventListener("click",d.onDelete,!1);this.members.push(d)}});define("text!gcli/ui/fields/menu.css",[],function(){return"\n.gcli-menu {\n  width: 100%;\n  overflow: hidden;\n  font-size: 90%;\n}\n\n.gcli-menu-field {\n  border: 1px solid #aaa;\n  border-top: 0;\n  border-bottom-right-radius: 5px;\n  border-bottom-left-radius: 5px;\n  max-height: 300px;\n  margin: 0 3px;\n  padding: 0;\n}\n\n.gcli-menu-template {\n  border-collapse: collapse;\n  width: 100%;\n}\n\n.gcli-menu-option {\n  overflow: hidden;\n  white-space: nowrap;\n  cursor: pointer;\n}\n\n.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #f8f8f8, #ccc);\n  background-color: #ddd;\n}\n\n.gcli-menu-name {\n  padding: 2px 3px;\n  -moz-padding-start: 8px;\n  -webkit-padding-start: 8px;\n}\n\n.gcli-menu-desc {\n  color: #777;\n  padding: 0 3px;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}\n\n.gcli-menu-highlight,\n.gcli-menu-highlight.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #eee, #b8b8b8);\n  background-color: #c8c8c8;\n}\n\n.gcli-menu-typed {\n  color: #FF6600;\n}\n\n.gcli-menu-more {\n  font-size: 80%;\n  text-align: right;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}"});
define("text!gcli/ui/fields/menu.html",[],function(){return'\n<div>\n  <table class="gcli-menu-template" aria-live="polite">\n    <tr class="gcli-menu-option" foreach="item in ${items}"\n        onclick="${onItemClickInternal}" title="${item.manual}">\n      <td class="gcli-menu-name">${item.name}</td>\n      <td class="gcli-menu-desc">${item.description}</td>\n    </tr>\n  </table>\n  <div class="gcli-menu-more" if="${items.hasMore}">${l10n.fieldMenuMore}</div>\n</div>'});
define("gcli/ui/fields/menu","require,exports,module,util/util,util/l10n,util/domtemplate,gcli/argument,gcli/types,gcli/canon,text!gcli/ui/fields/menu.css,text!gcli/ui/fields/menu.html".split(","),function(j,i){function h(a){a=a||{};this.document=a.document||document;this.type=a.type;if(!this.document)throw Error("No document");this.element=c.createElement(this.document,"div");this.element.classList.add(a.menuClass||"gcli-menu");a&&a.field&&this.element.classList.add(a.menuFieldClass||"gcli-menu-field");
f!=null&&c.importCss(f,this.document,"gcli-menu");this.template=c.toDom(this.document,d);this.templateOptions={blankNullUndefined:!0,stack:"menu.html"};this.items=null;this.onItemClick=c.createEvent("Menu.onItemClick")}function e(a,b,c){return typeof Proxy==="undefined"?a:Proxy.create({get:function(d,f){var e=a[f];if(f!=="name")return e;var g=e.indexOf(b);if(g===-1)return e;var h=e.substr(0,g),e=e.substr(g+b.length),g=c.createElement("span");g.appendChild(c.createTextNode(h));h=c.createElement("span");
h.classList.add("gcli-menu-typed");h.appendChild(c.createTextNode(b));g.appendChild(h);g.appendChild(c.createTextNode(e));return g}})}var c=j("util/util"),g=j("util/l10n"),b=j("util/domtemplate"),k=j("gcli/argument").Argument,a=j("gcli/types").Conversion;j("gcli/canon");var f=j("text!gcli/ui/fields/menu.css"),d=j("text!gcli/ui/fields/menu.html");h.prototype.l10n=g.propertyLookup;h.prototype.destroy=function(){delete this.element;delete this.template;delete this.document};h.prototype.onItemClickInternal=
function(a){a=a.currentTarget.querySelector(".gcli-menu-name").textContent;a=new k(a);a.suffix=" ";this.onItemClick({arg:a})};h.prototype.show=function(d,f){this.items=d.filter(function(a){return a.hidden===void 0||a.hidden!==!0}.bind(this));if(f)this.items=this.items.map(function(a){return e(a,f,this.template.ownerDocument)}.bind(this));if(this.items.length===0)this.element.style.display="none";else{if(this.items.length>=a.maxPredictions)this.items.splice(-1),this.items.hasMore=!0;var g=this.template.cloneNode(!0);
b.template(g,this,this.templateOptions);c.clearElement(this.element);this.element.appendChild(g);this.element.style.display="block"}};h.prototype.setChoiceIndex=function(a){for(var b=this.element.querySelectorAll(".gcli-menu-option"),c=0;c<b.length;c++)b[c].classList.remove("gcli-menu-highlight");a!=null&&(b.length<=a?console.error("Cant highlight "+a+". Only "+b.length+" options"):b.item(a).classList.add("gcli-menu-highlight"))};h.prototype.selectChoice=function(){var a=this.element.querySelector(".gcli-menu-highlight .gcli-menu-name");
if(!a)return!1;a=new k(a.textContent);a.suffix=" ";a.prefix=" ";this.onItemClick({arg:a});return!0};h.prototype.hide=function(){this.element.style.display="none"};h.prototype.setMaxHeight=function(a){this.element.style.maxHeight=a+"px"};i.Menu=h});
define("gcli/ui/fields/javascript","require,exports,module,util/util,util/promise,gcli/types,gcli/types,gcli/argument,gcli/types/javascript,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function h(a,c){d.call(this,a,c);this.onInputChange=this.onInputChange.bind(this);this.arg=new k("","{ "," }");this.element=e.createElement(this.document,"div");this.input=e.createElement(this.document,"input");this.input.type="text";this.input.addEventListener("keyup",this.onInputChange,
!1);this.input.classList.add("gcli-field");this.input.classList.add("gcli-field-javascript");this.element.appendChild(this.input);this.menu=new f({document:this.document,field:!0,type:a});this.element.appendChild(this.menu.element);this.setConversion(new b(void 0,new k(""),g.INCOMPLETE,""));this.onFieldChange=e.createEvent("JavascriptField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,this)}var e=j("util/util"),c=j("util/promise"),g=j("gcli/types").Status,b=j("gcli/types").Conversion,
k=j("gcli/argument").ScriptArgument,a=j("gcli/types/javascript").JavascriptType,f=j("gcli/ui/fields/menu").Menu,d=j("gcli/ui/fields").Field,l=j("gcli/ui/fields");i.startup=function(){l.addField(h)};i.shutdown=function(){l.removeField(h)};h.prototype=Object.create(d.prototype);h.claim=function(b){return b instanceof a?d.TOOLTIP_MATCH:d.NO_MATCH};h.prototype.destroy=function(){d.prototype.destroy.call(this);this.input.removeEventListener("keyup",this.onInputChange,!1);this.menu.onItemClick.remove(this.itemClicked,
this);this.menu.destroy();delete this.element;delete this.input;delete this.menu;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(b){this.arg=b.arg;this.input.value=b.arg.text;var c=0;if(this.type instanceof a){var d=b.arg.text.lastIndexOf(".");d!==-1&&(c=d)}this.setMessage(b.message);b.getPredictions().then(function(a){var b=[];a.forEach(function(a){a.hidden||b.push({name:a.name.substring(c),complete:a.name,description:a.description||""})},this);this.menu.show(b)}.bind(this),
console.error)};h.prototype.itemClicked=function(a){c.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};h.prototype.onInputChange=function(a){this.item=a.currentTarget.item;c.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};h.prototype.getConversion=function(){this.arg=new k(this.input.value,"{ "," }");return this.type.parse(this.arg)};
h.DEFAULT_VALUE="__JavascriptField.DEFAULT_VALUE"});
define("gcli/ui/fields/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/argument,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function h(a,d){l.call(this,a,d);this.items=[];this.element=g.createElement(this.document,"select");this.element.classList.add("gcli-field");this._addOption({name:b.lookupFormat("fieldSelectionSelect",[d.name])});c.resolve(this.type.getLookup()).then(function(a){a.forEach(this._addOption,
this)}.bind(this),console.error);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=g.createEvent("SelectionField.onFieldChange")}function e(a,b){l.call(this,a,b);this.onInputChange=this.onInputChange.bind(this);this.arg=new k;this.menu=new d({document:this.document,type:a});this.element=this.menu.element;this.onFieldChange=g.createEvent("SelectionTooltipField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,
this)}var c=j("util/promise"),g=j("util/util"),b=j("util/l10n"),k=j("gcli/argument").Argument;j("gcli/types");j("gcli/types");var a=j("gcli/types/basic").BooleanType,f=j("gcli/types/selection").SelectionType,d=j("gcli/ui/fields/menu").Menu,l=j("gcli/ui/fields").Field,m=j("gcli/ui/fields");i.startup=function(){m.addField(h);m.addField(e)};i.shutdown=function(){m.removeField(h);m.removeField(e)};h.prototype=Object.create(l.prototype);h.claim=function(b){return b instanceof a?l.BASIC:b instanceof f?
l.DEFAULT:l.NO_MATCH};h.prototype.destroy=function(){l.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){var b;this.items.forEach(function(c){if(c.value&&c.value===a.value)b=c.index},this);this.element.value=b;this.setMessage(a.message)};h.prototype.getConversion=function(){return this.type.parse(new k(this.items[this.element.value].name," "))};h.prototype._addOption=
function(a){a.index=this.items.length;this.items.push(a);var b=g.createElement(this.document,"option");b.textContent=a.name;b.value=a.index;this.element.appendChild(b)};e.prototype=Object.create(l.prototype);e.claim=function(a){return a.getType()instanceof f?l.TOOLTIP_MATCH:l.NO_MATCH};e.prototype.destroy=function(){l.prototype.destroy.call(this);this.menu.onItemClick.remove(this.itemClicked,this);this.menu.destroy();delete this.element;delete this.document;delete this.onInputChange};e.prototype.setConversion=
function(a){this.arg=a.arg;this.setMessage(a.message);a.getPredictions().then(function(b){this.menu.show(b.map(function(a){return a.value.description?a.value:a},this),a.arg.text)}.bind(this),console.error)};e.prototype.itemClicked=function(a){c.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};e.prototype.onInputChange=function(a){this.item=a.currentTarget.item;c.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});
this.setMessage(a.message)}.bind(this),console.error)};e.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.input.value});return this.type.parse(this.arg)};e.prototype.setChoiceIndex=function(a){this.menu.setChoiceIndex(a)};e.prototype.selectChoice=function(){return this.menu.selectChoice()};Object.defineProperty(e.prototype,"isImportant",{get:function(){return this.type.name!=="command"},enumerable:!0});e.DEFAULT_VALUE="__SelectionTooltipField.DEFAULT_VALUE"});
define("text!gcli/ui/tooltip.css",[],function(){return"\n.gcli-panel {\n  -moz-transition-property: opacity, height;\n  -moz-transition-duration: 0.5s, 2s;\n  overflow-y: auto;\n  overflow-x: hidden;\n  z-index: 2;\n  position: absolute;\n  max-height: 100%;\n  max-width: 350px;\n  left: 0;\n  bottom: 0;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n  margin-bottom: -3px;\n}\n\n.gcli-panel.gcli-panel-hide {\n  opacity: 0;\n  height: 0;\n}\n\n.gcli-panel-connector {\n  height: 10px;\n  margin-top: -1px;\n  margin-left: 20px;\n  width: 20px;\n  background: white;\n  border-left: 1px solid #999;\n  border-right: 1px solid #999;\n}\n\n.gcli-tt-description {\n  padding: 5px 10px 0;\n  font-size: 90%;\n}\n\n.gcli-tt-error {\n  font-size: 80%;\n  color: #900;\n  padding: 0 10px;\n}\n\n.gcli-field {\n  width: 100%;\n}\n\n.gcli-field-javascript {\n  margin-bottom: 0;\n}\n\n.gcli-tt {\n  box-shadow: 0 0 10px 1px #ddd;\n  border: 1px solid #999;\n  border-radius: 3px;\n  margin: 10px 0 0 0;\n  background: hsla(0, 100%, 100%, 0.95);\n  padding-bottom: 5px;\n}"});
define("text!gcli/ui/tooltip.html",[],function(){return'\n<div class="gcli-tt" aria-live="polite">\n  <div class="gcli-tt-description" save="${descriptionEle}">${description}</div>\n  ${field.element}\n  <div class="gcli-tt-error" save="${errorEle}">${assignment.conversion.message}</div>\n  <div class="gcli-tt-highlight" save="${highlightEle}"></div>\n</div>'});
define("gcli/ui/tooltip","require,exports,module,util/util,util/domtemplate,gcli/cli,gcli/ui/fields,text!gcli/ui/tooltip.css,text!gcli/ui/tooltip.html".split(","),function(j,i){function h(b,c){this.inputter=c.inputter;this.requisition=c.requisition;this.focusManager=c.focusManager;this.element=c.element;this.element.classList.add(b.tooltipClass||"gcli-tooltip");this.document=this.element.ownerDocument;if(this.panelElement=c.panelElement)this.panelElement.classList.add("gcli-panel-hide"),this.focusManager.onVisibilityChange.add(this.visibilityChanged,
this);this.focusManager.addMonitoredElement(this.element,"tooltip");this.fields=[];if(k!=null)this.style=e.importCss(k,this.document,"gcli-tooltip");this.template=e.toDom(this.document,a);this.templateOptions={blankNullUndefined:!0,stack:"tooltip.html"};this.inputter.onChoiceChange.add(this.choiceChanged,this);this.inputter.onAssignmentChange.add(this.assignmentChanged,this);this.assignment=void 0;this.assignmentChanged({assignment:this.inputter.assignment})}var e=j("util/util"),c=j("util/domtemplate"),
g=j("gcli/cli").CommandAssignment,b=j("gcli/ui/fields"),k=j("text!gcli/ui/tooltip.css"),a=j("text!gcli/ui/tooltip.html");h.prototype.destroy=function(){this.inputter.onAssignmentChange.remove(this.assignmentChanged,this);this.inputter.onChoiceChange.remove(this.choiceChanged,this);this.panelElement&&this.focusManager.onVisibilityChange.remove(this.visibilityChanged,this);this.focusManager.removeMonitoredElement(this.element,"tooltip");this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);
this.field.onFieldChange.remove(this.fieldChanged,this);this.field.destroy();delete this.errorEle;delete this.descriptionEle;delete this.highlightEle;delete this.document;delete this.element;delete this.panelElement;delete this.template};Object.defineProperty(h.prototype,"isMenuShowing",{get:function(){return this.focusManager.isTooltipVisible&&this.field!=null&&this.field.menu!=null},enumerable:!0});h.prototype.assignmentChanged=function(a){if(this.assignment!==a.assignment)this.assignment&&this.assignment.onAssignmentChange.remove(this.assignmentContentsChanged,
this),this.assignment=a.assignment,this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.field=b.getField(this.assignment.param.type,{document:this.document,name:this.assignment.param.name,requisition:this.requisition,required:this.assignment.param.isDataRequired,named:!this.assignment.param.isPositionalAllowed,tooltip:!0}),this.focusManager.setImportantFieldFlag(this.field.isImportant),this.field.onFieldChange.add(this.fieldChanged,this),this.assignment.onAssignmentChange.add(this.assignmentContentsChanged,
this),this.field.setConversion(this.assignment.conversion),this.highlightEle=this.descriptionEle=this.errorEle=void 0,a=this.template.cloneNode(!0),c.template(a,this,this.templateOptions),e.clearElement(this.element),this.element.appendChild(a),this.element.style.display="block",this.field.setMessageElement(this.errorEle),this._updatePosition()};h.prototype.choiceChanged=function(a){this.field&&this.field.setChoiceIndex&&this.assignment.conversion.constrainPredictionIndex(a.choice).then(function(a){this.field.setChoiceIndex(a)}.bind(this)).then(null,
console.error)};h.prototype.selectChoice=function(){return this.field&&this.field.selectChoice?this.field.selectChoice():!1};h.prototype.fieldChanged=function(a){this.requisition.setAssignment(this.assignment,a.conversion.arg,{matchPadding:!0});this.focusManager.setError(a.conversion.message!=null&&a.conversion.message!=="");this.document.defaultView.setTimeout(function(){this.inputter.focus()}.bind(this),10)};h.prototype.assignmentContentsChanged=function(a){a.conversion.arg.text!==a.oldConversion.arg.text&&
(this.field.setConversion(a.conversion),e.setTextContent(this.descriptionEle,this.description),this._updatePosition())};h.prototype._updatePosition=function(){var a=this.getDimensionsOfAssignment();if(this.panelElement)this.panelElement.style.left=a.start*10+"px";this.focusManager.updatePosition(a)};h.prototype.getDimensionsOfAssignment=function(){for(var a="",b=this.requisition.getAssignments(!0),c=0;c<b.length;c++){if(b[c]===this.assignment)break;a+=b[c].toString()}a+=this.assignment.arg.prefix;
b=a.length;a+=this.assignment.arg.text;return{start:b,end:a.length}};Object.defineProperty(h.prototype,"description",{get:function(){return this.assignment instanceof g&&this.assignment.value==null?"":this.assignment.param.manual||this.assignment.param.description},enumerable:!0});h.prototype.visibilityChanged=function(a){this.panelElement&&(a.tooltipVisible?this.panelElement.classList.remove("gcli-panel-hide"):this.panelElement.classList.add("gcli-panel-hide"))};i.Tooltip=h});
define("text!gcli/ui/output_view.css",[],function(){return"\n.gcli-row-in {\n  padding: 0 4px;\n  box-shadow: 0 -6px 10px -6px #ddd;\n  border-top: 1px solid #bbb;\n}\n\n.gcli-row-in > img {\n  cursor: pointer;\n}\n\n.gcli-row-hover {\n  display: none;\n  float: right;\n  padding: 2px 2px 0;\n}\n\n.gcli-row-in:hover > .gcli-row-hover {\n  display: inline;\n}\n\n.gcli-row-in:hover > .gcli-row-hover.gcli-row-hidden {\n  display: none;\n}\n\n.gcli-row-duration {\n  color: #666;\n}\n\n.gcli-row-prompt {\n  color: #00F;\n  font-weight: bold;\n  font-size: 120%;\n}\n\n.gcli-row-prompt.gcli-row-complete {\n  color: #060;\n}\n\n.gcli-row-prompt.gcli-row-error {\n  color: #F00;\n}\n\n.gcli-row-duration {\n  font-size: 80%;\n}\n\n.gcli-row-out {\n  margin: 0 10px 15px;\n  padding: 0 10px;\n  line-height: 1.2em;\n  font-size: 95%;\n}\n\n.gcli-row-out strong,\n.gcli-row-out b,\n.gcli-row-out th,\n.gcli-row-out h1,\n.gcli-row-out h2,\n.gcli-row-out h3 {\n  color: #000;\n}\n\n.gcli-row-out p {\n  margin: 5px 0;\n}\n\n.gcli-row-out a {\n  color: hsl(200,40%,40%);\n  text-decoration: none;\n}\n\n.gcli-row-out a:hover {\n  cursor: pointer;\n  border-bottom: 1px dotted hsl(200,40%,60%);\n}\n\n.gcli-row-out input[type=password],\n.gcli-row-out input[type=text],\n.gcli-row-out textarea {\n  font-size: 120%;\n  background: transparent;\n  padding: 3px;\n  border-radius: 3px;\n  border: 1px solid #bbb;\n}\n\n.gcli-row-out table,\n.gcli-row-out td,\n.gcli-row-out th {\n  border: 0;\n  padding: 0 2px;\n}\n\n.gcli-row-terminal,\n.gcli-row-subterminal {\n  border-radius: 3px;\n  border: 1px solid #ddd;\n}\n\n.gcli-row-terminal {\n  height: 200px;\n  width: 620px;\n  font-size: 80%;\n}\n\n.gcli-row-subterminal {\n  height: 150px;\n  width: 300px;\n  font-size: 75%;\n}\n\n.gcli-out-shortcut {\n  font-weight: normal;\n  border: 1px solid #999;\n  border-radius: 3px;\n  color: #666;\n  cursor: pointer;\n  padding: 0 3px 1px;\n  margin: 1px 4px;\n  display: inline-block;\n}\n\n.gcli-out-shortcut:before {\n  content: '\\bb';\n  padding-right: 2px;\n  color: hsl(25,78%,50%);\n  font-weight: bold;\n  font-size: 110%;\n}"});
define("text!gcli/ui/output_terminal.html",[],function(){return'\n<div class="gcli-row">\n  <\!-- The div for the input (i.e. what was typed) --\>\n  <div class="gcli-row-in" save="${elems.rowin}" aria-live="assertive"\n      onclick="${copyToInput}" ondblclick="${execute}">\n\n    <\!-- What the user actually typed --\>\n    <span save="${elems.prompt}" class="gcli-row-prompt ${elems.error ? \'gcli-row-error\' : \'\'} ${elems.completed ? \'gcli-row-complete\' : \'\'}">${prompt}</span>\n    <span class="gcli-row-in-typed">${outputData.canonical}</span>\n\n    <\!-- The extra details that appear on hover --\>\n    <span class="gcli-row-duration gcli-row-hover" save="${elems.duration}"></span>\n    <\!--\n    <img class="gcli-row-hover" onclick="${hideOutput}" save="${elems.hide}"\n        alt="Hide command output" _src="${url(\'images/minus.png\')}"/>\n    <img class="gcli-row-hover gcli-row-hidden" onclick="${showOutput}" save="${elems.show}"\n        alt="Show command output" _src="${url(\'images/plus.png\')}"/>\n    <img class="gcli-row-hover" onclick="${remove}"\n        alt="Remove this command from the history"\n        _src="${url(\'images/closer.png\')}"/>\n    --\>\n    <img style="float:right;" _src="${url(\'images/throbber.gif\')}" save="${elems.throb}"/>\n  </div>\n\n  <\!-- The div for the command output --\>\n  <div class="gcli-row-out" aria-live="assertive" save="${elems.rowout}">\n  </div>\n</div>'});
define("gcli/ui/output_terminal","require,exports,module,util/util,util/domtemplate,gcli/canon,text!gcli/ui/output_view.css,text!gcli/ui/output_terminal.html".split(","),function(j,i,h){function e(b,c){this.element=c.element;this.requisition=c.requisition;this.requisition.commandOutputManager.onOutput.add(this.outputted,this);var e=c.element.ownerDocument;if(k!=null)this.style=g.importCss(k,e,"gcli-output-view");this.template=g.toDom(e,a);this.templateOptions={allowEval:!0,stack:"output_terminal.html"}}
function c(a,c){this.outputData=a;this.outputTerminal=c;this.url=g.createUrlLookup(h);this.elems={rowin:null,rowout:null,hide:null,show:null,duration:null,throb:null,prompt:null};var e=this.outputTerminal.template.cloneNode(!0);b.template(e,this,this.outputTerminal.templateOptions);this.outputTerminal.element.appendChild(this.elems.rowin);this.outputTerminal.element.appendChild(this.elems.rowout);this.outputData.onClose.add(this.closed,this);this.outputData.onChange.add(this.changed,this)}var g=j("util/util"),
b=j("util/domtemplate");j("gcli/canon");var k=j("text!gcli/ui/output_view.css"),a=j("text!gcli/ui/output_terminal.html");e.prototype.destroy=function(){this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);this.requisition.commandOutputManager.onOutput.remove(this.outputted,this);delete this.requisition;delete this.element;delete this.template};e.prototype.outputted=function(a){if(!a.output.hidden)a.output.view=new c(a.output,this)};e.prototype.setHeight=function(a){this.element.style.height=
a+"px"};i.OutputTerminal=e;c.prototype.destroy=function(){this.outputData.onChange.remove(this.changed,this);this.outputData.onClose.remove(this.closed,this);this.outputTerminal.element.removeChild(this.elems.rowin);this.outputTerminal.element.removeChild(this.elems.rowout);delete this.outputData;delete this.outputTerminal;delete this.url;delete this.elems};Object.defineProperty(c.prototype,"prompt",{get:function(){return this.outputData.canonical?"\u00bb":""},enumerable:!0});c.prototype.copyToInput=
function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.update(this.outputData.typed)};c.prototype.execute=function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.updateExec(this.outputData.typed)};c.prototype.hideOutput=function(a){this.elems.rowout.style.display="none";this.elems.hide.classList.add("cmd_hidden");this.elems.show.classList.remove("cmd_hidden");a.stopPropagation()};c.prototype.showOutput=function(a){this.elems.rowout.style.display="block";this.elems.hide.classList.remove("cmd_hidden");
this.elems.show.classList.add("cmd_hidden");a.stopPropagation()};c.prototype.closed=function(){this.destroy()};c.prototype.changed=function(){var a=this.outputData.duration!=null?"completed in "+this.outputData.duration/1E3+" sec ":"",a=this.elems.rowout.ownerDocument.createTextNode(a);this.elems.duration.appendChild(a);this.outputData.completed&&this.elems.prompt.classList.add("gcli-row-complete");this.outputData.error&&this.elems.prompt.classList.add("gcli-row-error");this.outputData.toDom(this.elems.rowout);
this.outputTerminal.element.scrollTop=Math.max(this.outputTerminal.element.scrollHeight,this.outputTerminal.element.clientHeight)-this.outputTerminal.element.clientHeight;this.elems.throb.style.display=this.outputData.completed?"none":"block"};i.OutputView=c});
define("gcli/history",["require","exports","module"],function(j,i){function h(){this._buffer=[""];this._current=0}h.prototype.destroy=function(){delete this._buffer};h.prototype.add=function(e){this._buffer.splice(1,0,e);this._current=0};h.prototype.forward=function(){this._current>0&&this._current--;return this._buffer[this._current]};h.prototype.backward=function(){this._current<this._buffer.length-1&&this._current++;return this._buffer[this._current]};i.History=h});
define("text!gcli/ui/inputter.css",[],function(){return"\n.gcli-in-input,\n.gcli-in-complete,\n.gcli-prompt {\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}\n\n.gcli-in-input,\n.gcli-in-complete {\n  font-size: 110%;\n  font-weight: normal;\n  font-style: normal;\n  padding: 0 0 0 22px;\n  background-color: transparent;\n}\n\n.gcli-in-input {\n  color: #000;\n  border: 0;\n  box-shadow: 0 0 10px 1px #ddd;\n  border-top: 1px solid #999;\n}\n\n.gcli-in-complete {\n  position: absolute;\n  z-index: -1000;\n  color: transparent;\n  margin-top: -1px;\n  border-top: 1px solid transparent;\n}\n\n.gcli-prompt {\n  position: absolute;\n  z-index: -1001;\n  padding: 0 1px;\n  color: hsl(25,78%,50%);\n  font-size: 150%;\n  font-weight: bold;\n  line-height: 95%;\n}\n\n.gcli-in-incomplete {\n  border-bottom: 2px dotted #999;\n}\n\n.gcli-in-error {\n  border-bottom: 2px dotted #F00;\n}\n\n.gcli-in-ontab {\n  color: hsl(200,40%,70%);\n}\n\n.gcli-in-todo {\n  color: hsl(48,28%,76%);\n}\n\n.gcli-in-closebrace {\n  color: hsl(0,0%,80%);\n}\n\n.gcli-in-scratchlink {\n  float: right;\n  font-size: 85%;\n  color: #888;\n  padding-right: 10px;\n}"});
define("gcli/ui/inputter","require,exports,module,util/promise,util/util,util/util,gcli/types,gcli/history,text!gcli/ui/inputter.css".split(","),function(j,i){var h;function e(b,c){this.requisition=c.requisition;this.focusManager=c.focusManager;this.element=c.element;this.element.classList.add("gcli-in-input");this.element.spellcheck=!1;this.document=this.element.ownerDocument;this.scratchpad=b.scratchpad;if(f!=null)this.style=g.importCss(f,this.document,"gcli-inputter");this.lastTabDownAt=0;this._caretChange=
null;this.onKeyDown=this.onKeyDown.bind(this);this.onKeyUp=this.onKeyUp.bind(this);this.element.addEventListener("keydown",this.onKeyDown,!1);this.element.addEventListener("keyup",this.onKeyUp,!1);this.history=new a;this._scrollingThroughHistory=!1;this._choice=null;this.onChoiceChange=g.createEvent("Inputter.onChoiceChange");this.onMouseUp=this.onMouseUp.bind(this);this.element.addEventListener("mouseup",this.onMouseUp,!1);this.focusManager&&this.focusManager.addMonitoredElement(this.element,"input");
this._completed=d;this.requisition.onTextChange.add(this.textChanged,this);this.assignment=this.requisition.getAssignmentAt(0);this.onAssignmentChange=g.createEvent("Inputter.onAssignmentChange");this.onInputChange=g.createEvent("Inputter.onInputChange");this.onResize=g.createEvent("Inputter.onResize");this.onWindowResize=this.onWindowResize.bind(this);this.document.defaultView.addEventListener("resize",this.onWindowResize,!1);this.requisition.update(this.element.value||"")}var c=j("util/promise"),
g=j("util/util"),b=j("util/util").KeyEvent,k=j("gcli/types").Status,a=j("gcli/history").History,f=j("text!gcli/ui/inputter.css"),d=c.resolve(void 0);e.prototype.destroy=function(){this.document.defaultView.removeEventListener("resize",this.onWindowResize,!1);this.requisition.onTextChange.remove(this.textChanged,this);this.focusManager&&this.focusManager.removeMonitoredElement(this.element,"input");this.element.removeEventListener("mouseup",this.onMouseUp,!1);this.element.removeEventListener("keydown",
this.onKeyDown,!1);this.element.removeEventListener("keyup",this.onKeyUp,!1);this.history.destroy();this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);delete this.onMouseUp;delete this.onKeyDown;delete this.onKeyUp;delete this.onWindowResize;delete this.tooltip;delete this.document;delete this.element};e.prototype.onWindowResize=function(){if(this.element){var a=this.getDimensions();if(a)this.onResize(a)}};e.prototype.getDimensions=function(){if(this.element.getBoundingClientRect){for(var a,
b,c=this.element.parentNode;c&&c.nodeName!=="#document";){var d=this.document.defaultView.getComputedStyle(c,"");if(d&&(d=d.getPropertyValue("position"),d==="absolute"||d==="fixed")){b=c.getBoundingClientRect();a=b.top;b=b.left;break}c=c.parentNode}c=this.element.getBoundingClientRect();return{top:c.top-(a||0)+1,height:c.bottom-c.top-1,left:c.left-(b||0)+2,width:c.right-c.left}}};e.prototype.onMouseUp=function(){this._checkAssignment()};e.prototype.textChanged=function(){if(this.document){if(this._caretChange==
null)this._caretChange=h;var a=this.requisition.toString(),b=this.getInputState();b.typed=a;this._processCaretChange(b);if(this.element.value!==a)this.element.value=a;this.onInputChange({inputState:b})}};h=3;e.prototype._processCaretChange=function(a){var b,c;switch(this._caretChange){case 1:b=0;c=a.typed.length;break;case 2:c=b=a.typed.length;break;case h:b=a.cursor.start;do b++;while(b<a.typed.length&&a.typed[b-1]!==" ");c=b;break;default:b=a.cursor.start,c=a.cursor.end}b=b>a.typed.length?a.typed.length:
b;c=c>a.typed.length?a.typed.length:c;a={typed:a.typed,cursor:{start:b,end:c}};if(this.element.selectionStart!==b)this.element.selectionStart=b;if(this.element.selectionEnd!==c)this.element.selectionEnd=c;this._checkAssignment(b);this._caretChange=null;return a};e.prototype._checkAssignment=function(a){if(a==null)a=this.element.selectionStart;a=this.requisition.getAssignmentAt(a);if(this.assignment!==a)this.assignment=a,this.onAssignmentChange({assignment:this.assignment});if(this.focusManager)a=
this.assignment.conversion.message,this.focusManager.setError(a!=null&&a!=="")};e.prototype.setInput=function(a){return this.requisition.update(a)};e.prototype.setCursor=function(a){this._caretChange=0;this._processCaretChange({typed:this.element.value,cursor:a})};e.prototype.focus=function(){this.element.focus();this._checkAssignment()};e.prototype.onKeyDown=function(a){if(a.keyCode===b.DOM_VK_UP||a.keyCode===b.DOM_VK_DOWN)a.preventDefault();else if(!(a.keyCode===b.DOM_VK_F1||a.keyCode===b.DOM_VK_ESCAPE||
a.keyCode===b.DOM_VK_UP||a.keyCode===b.DOM_VK_DOWN)){if(this.focusManager)this.focusManager.onInputChange();if(a.keyCode===b.DOM_VK_TAB){this.lastTabDownAt=0;if(!a.shiftKey)a.preventDefault(),this.lastTabDownAt=a.timeStamp;if(a.metaKey||a.altKey||a.crtlKey)this.document.commandDispatcher?this.document.commandDispatcher.advanceFocus():this.element.blur()}}};e.prototype.onKeyUp=function(a){this.handleKeyUp(a).then(null,console.error)};e.prototype.handleKeyUp=function(a){if(this.focusManager&&a.keyCode===
b.DOM_VK_F1)return this.focusManager.helpRequest(),d;if(this.focusManager&&a.keyCode===b.DOM_VK_ESCAPE)return this.focusManager.removeHelp(),d;if(a.keyCode===b.DOM_VK_UP){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(-1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.backward());else if(this.assignment.getStatus()===k.VALID){if(this.requisition.increment(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(-1);
return d}if(a.keyCode===b.DOM_VK_DOWN){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.forward());else if(this.assignment.getStatus()===k.VALID){if(this.requisition.decrement(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(1);return d}if(a.keyCode===b.DOM_VK_RETURN)return this.requisition.getStatus()===
k.VALID?(this._scrollingThroughHistory=!1,this.history.add(this.element.value),this.requisition.exec()):this.tooltip.selectChoice()||this.focusManager.setError(!0),this._choice=null,d;if(a.keyCode===b.DOM_VK_TAB&&!a.shiftKey){if(this.element.value.length>0&&this.lastTabDownAt+1E3>a.timeStamp){this._caretChange=h;a=this.getInputState();this._processCaretChange(a);if(this._choice==null)this._choice=0;this._completed=this.requisition.complete(a.cursor,this._choice)}this.lastTabDownAt=0;this._scrollingThroughHistory=
!1;return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))}if(this.scratchpad&&this.scratchpad.shouldActivate(a))return this.scratchpad.activate(this.element.value)?this.requisition.update(""):d;this._scrollingThroughHistory=!1;this._caretChange=0;this._completed=this.requisition.update(this.element.value);return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))};e.prototype.changeChoice=
function(a){if(this._choice==null)this._choice=0;this._choice+=a;this.onChoiceChange({choice:this._choice})};e.prototype.getCurrentAssignment=function(){return this.requisition.getAssignmentAt(this.element.selectionStart)};e.prototype.getInputState=function(){var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};a.typed==null&&(a={typed:"",cursor:{start:0,end:0}});if(a.cursor.start==null)a.cursor.start=0;return a};i.Inputter=e});
define("text!gcli/ui/completer.html",[],function(){return'\n<div>\n  <loop foreach="member in ${statusMarkup}">\n    <span class="${member.className}">${member.string}</span>\n  </loop>\n  <span class="gcli-in-ontab">${directTabText}</span>\n  <span class="gcli-in-todo" foreach="param in ${emptyParameters}">${param}</span>\n  <span class="gcli-in-ontab">${arrowTabText}</span>\n  <span class="gcli-in-closebrace" if="${unclosedJs}">}</span>\n  <div class="gcli-in-scratchlink" if="${scratchLink}">${scratchLink}</div>\n</div>'});
define("gcli/ui/completer","require,exports,module,util/promise,util/util,util/domtemplate,text!gcli/ui/completer.html".split(","),function(j,i){function h(e,a){this.requisition=a.requisition;this.scratchpad=e.scratchpad;this.input={typed:"",cursor:{start:0,end:0}};this.choice=0;this.element=a.element;this.element.classList.add("gcli-in-complete");this.element.setAttribute("tabindex","-1");this.element.setAttribute("aria-live","polite");this.document=this.element.ownerDocument;this.inputter=a.inputter;
this.inputter.onInputChange.add(this.update,this);this.inputter.onAssignmentChange.add(this.update,this);this.inputter.onChoiceChange.add(this.update,this);if(this.autoResize=a.autoResize){this.inputter.onResize.add(this.resized,this);var f=this.inputter.getDimensions();f&&this.resized(f)}this.template=c.toDom(this.document,b);c.removeWhitespace(this.template,!0);this.update()}var e=j("util/promise"),c=j("util/util"),g=j("util/domtemplate"),b=j("text!gcli/ui/completer.html");h.prototype.destroy=function(){this.inputter.onInputChange.remove(this.update,
this);this.inputter.onAssignmentChange.remove(this.update,this);this.inputter.onChoiceChange.remove(this.update,this);this.autoResize&&this.inputter.onResize.remove(this.resized,this);delete this.document;delete this.element;delete this.template;delete this.inputter};h.prototype.resized=function(b){this.element.style.top=b.top+"px";this.element.style.height=b.height+"px";this.element.style.lineHeight=b.height+"px";this.element.style.left=b.left+"px";this.element.style.width=b.width+"px"};h.prototype.update=
function(b){this.choice=b&&b.choice!=null?b.choice:0;var b=this._getCompleterTemplateData(),a=this.template.cloneNode(!0);g.template(a,b,{stack:"completer.html"});for(c.clearElement(this.element);a.hasChildNodes();)this.element.appendChild(a.firstChild)};h.prototype._getCompleterTemplateData=function(){var b=e.defer(),a=e.defer(),c=e.defer(),d=this.inputter.getInputState(),g=this.requisition.getAssignmentAt(d.cursor.start),h=void 0;d.typed.trim().length!==0&&(h=g.getPredictionAt(this.choice));e.resolve(h).then(function(e){var h=
"",i="",j=[];if(d.typed.trim().length!==0){var m=g.arg;if(e){if(e=e.name,m=m.text,g.isInName()&&(e=" "+e),m!==e){var v=m.replace(/^\s*/,"");e.indexOf(v)===0&&d.cursor.start===d.typed.length?(v=m.match(/^(\s*)/)[0].length,h=e.slice(m.length-v)):i="\u21e5 "+e}}else m.type==="NamedArgument"&&m.text===""&&j.push("<"+g.param.type.name+">\u00a0")}h!==""?h+="\u00a0":this.requisition.typedEndsWithSeparator()||j.unshift("\u00a0");this.requisition.getAssignments().forEach(function(a){a.param.isPositionalAllowed&&
a.arg.toString().trim()===""&&(h!==""&&g===a||j.push(a.param.isDataRequired?"<"+a.param.name+">\u00a0":"["+a.param.name+"]\u00a0"))}.bind(this));var e=this.requisition.commandAssignment.value,t=!1;e&&e.hasNamedParameters&&e.params.forEach(function(a){var b=this.requisition.getAssignment(a.name).arg;!a.isPositionalAllowed&&!a.hidden&&b.type==="BlankArgument"&&(t=!0)},this);t&&j.push("[options]\u00a0");b.resolve(h);a.resolve(i);c.resolve(j)}.bind(this),console.error);return{statusMarkup:this._getStatusMarkup(d),
unclosedJs:this._getUnclosedJs(),scratchLink:this._getScratchLink(),directTabText:b.promise,arrowTabText:a.promise,emptyParameters:c.promise}};h.prototype._getStatusMarkup=function(b){b=this.requisition.getInputStatusMarkup(b.cursor.start);b.forEach(function(a){a.string=a.string.replace(/ /g,"\u00a0");a.className="gcli-in-"+a.status.toString().toLowerCase()},this);return b};h.prototype._getUnclosedJs=function(){var b=this.requisition.commandAssignment.value;return b&&b.name==="{"&&this.requisition.getAssignment(0).arg.suffix.indexOf("}")===
-1};h.prototype._getScratchLink=function(){var b=this.requisition.commandAssignment.value;return this.scratchpad&&b&&b.name==="{"?this.scratchpad.linkText:""};i.Completer=h});
define("gcli/ui/prompt",["require","exports","module"],function(j,i){function h(e,c){this.element=c.element;this.element.classList.add("gcli-prompt");this.element.appendChild(this.element.ownerDocument.createTextNode(e.promptChar||"\u00bb"));if(this.inputter=c.inputter){this.inputter.onResize.add(this.resized,this);var g=this.inputter.getDimensions();g&&this.resized(g)}}h.prototype.destroy=function(){this.inputter&&this.inputter.onResize.remove(this.resized,this);delete this.element};h.prototype.resized=
function(e){this.element.style.top=e.top+"px";this.element.style.height=e.height+"px";this.element.style.left=e.left+"px";this.element.style.width=e.width+"px"};i.Prompt=h});define("text!gcli/ui/display.css",[],function(){return"\n.gcli-output {\n  height: 100%;\n  overflow-x: hidden;\n  overflow-y: auto;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}"});define("text!gcli/ui/display.html",[],function(){return'\n<div class="gcli-panel" save="${panel}">\n  <div save="${tooltip}"></div>\n  <div class="gcli-panel-connector"></div>\n</div>'});
define("gcli/ui/display","require,exports,module,util/util,util/domtemplate,gcli/settings,gcli/canon,gcli/cli,gcli/ui/intro,gcli/ui/tooltip,gcli/ui/output_terminal,gcli/ui/inputter,gcli/ui/completer,gcli/ui/focus,gcli/ui/prompt,text!gcli/ui/display.css,text!gcli/ui/display.html".split(","),function(j,i){function h(h){var k=h.document||document;this.displayStyle=void 0;if(q!=null)this.displayStyle=g.importCss(q,k,"gcli-css-display");this.commandOutputManager=h.commandOutputManager;if(this.commandOutputManager==
null)this.commandOutputManager=new a;this.requisition=new f(h.environment||{},k,this.commandOutputManager);this.focusManager=new p(h,{document:k,requisition:this.requisition});this.inputElement=e(k,h.inputElement||null,"gcli-input");this.inputter=new o(h,{requisition:this.requisition,focusManager:this.focusManager,element:this.inputElement});this.completeElement=c(this.inputElement,h.completeElement||null,"gcli-row-complete");this.completer=new n(h,{requisition:this.requisition,inputter:this.inputter,
autoResize:this.completeElement.gcliCreated,element:this.completeElement});this.prompt=new w(h,{inputter:this.inputter,element:c(this.inputElement,h.promptElement||null,"gcli-prompt")});this.element=e(k,h.displayElement||null,"gcli-display");this.element.classList.add("gcli-display");this.template=g.toDom(k,v);this.elements={};b.template(this.template,this.elements,{stack:"display.html"});this.element.appendChild(this.template);this.tooltip=new l(h,{requisition:this.requisition,inputter:this.inputter,
focusManager:this.focusManager,element:this.elements.tooltip,panelElement:this.elements.panel});this.inputter.tooltip=this.tooltip;this.outputElement=g.createElement(k,"div");this.outputElement.classList.add("gcli-output");this.outputList=new m(h,{requisition:this.requisition,element:this.outputElement});this.element.appendChild(this.outputElement);d.maybeShowIntro(this.commandOutputManager,this.requisition)}function e(a,b,c){if(!b&&(b=a.getElementById(c),!b))throw Error("Missing element, id="+c);
return b}function c(a,b){var c=a.ownerDocument;if(!b&&(b=c.getElementById("gcli-row-complete"),!b))b=g.createElement(c,"div"),a.parentNode.insertBefore(b,a.nextSibling),b.gcliCreated=!0;return b}var g=j("util/util"),b=j("util/domtemplate"),k=j("gcli/settings"),a=j("gcli/canon").CommandOutputManager,f=j("gcli/cli").Requisition,d=j("gcli/ui/intro"),l=j("gcli/ui/tooltip").Tooltip,m=j("gcli/ui/output_terminal").OutputTerminal,o=j("gcli/ui/inputter").Inputter,n=j("gcli/ui/completer").Completer,p=j("gcli/ui/focus").FocusManager,
w=j("gcli/ui/prompt").Prompt,q=j("text!gcli/ui/display.css"),v=j("text!gcli/ui/display.html");i.createDisplay=function(a){a.settings!=null&&k.setDefaults(a.settings);var a=new h(a),b=a.requisition;return{exec:b.exec.bind(b),update:b.update.bind(b),updateExec:b.updateExec.bind(b),destroy:a.destroy.bind(a)}};h.prototype.destroy=function(){delete this.element;delete this.template;this.outputList.destroy();delete this.outputList;delete this.outputElement;this.tooltip.destroy();delete this.tooltip;this.prompt.destroy();
delete this.prompt;this.completer.destroy();delete this.completer;delete this.completeElement;this.inputter.destroy();delete this.inputter;delete this.inputElement;this.focusManager.destroy();delete this.focusManager;this.requisition.destroy();delete this.requisition;this.displayStyle&&this.displayStyle.parentNode.removeChild(this.displayStyle);delete this.displayStyle};i.Display=h});
define("gcli/index","require,exports,module,util/legacy,gcli/canon,gcli/canon,gcli/types/basic,gcli/types/command,gcli/types/javascript,gcli/types/node,gcli/types/resource,gcli/types/selection,gcli/types/setting,gcli/settings,gcli/cli,gcli/ui/intro,gcli/ui/focus,gcli/ui/fields/basic,gcli/ui/fields/javascript,gcli/ui/fields/selection,gcli/ui/display".split(","),function(j,i){j("util/legacy");i.addCommand=j("gcli/canon").addCommand;i.removeCommand=j("gcli/canon").removeCommand;j("gcli/types/basic").startup();
j("gcli/types/command").startup();j("gcli/types/javascript").startup();j("gcli/types/node").startup();j("gcli/types/resource").startup();j("gcli/types/selection").startup();j("gcli/types/setting").startup();j("gcli/settings").startup();j("gcli/cli").startup();j("gcli/ui/intro").startup();j("gcli/ui/focus").startup();j("gcli/ui/fields/basic").startup();j("gcli/ui/fields/javascript").startup();j("gcli/ui/fields/selection").startup();var h=j("gcli/ui/display");i.createDisplay=function(e){return h.createDisplay(e||
{})};i.createView=i.createDisplay});define("text!gcli/commands/help_man.html",[],function(){return'\n<div>\n  <h3>${command.name}</h3>\n\n  <h4 class="gcli-help-header">\n    ${l10n.helpManSynopsis}:\n    <span class="gcli-out-shortcut" onclick="${onclick}" data-command="${command.name}">\n      ${command.name}\n      <span foreach="param in ${command.params}">\n        ${param.defaultValue !== undefined ? \'[\' + param.name + \']\' : param.name}\n      </span>\n    </span>\n  </h4>\n\n  <h4 class="gcli-help-header">${l10n.helpManDescription}:</h4>\n\n  <p class="gcli-help-description">${describe(command)}</p>\n\n  <div if="${command.exec}">\n    <h4 class="gcli-help-header">${l10n.helpManParameters}:</h4>\n\n    <ul class="gcli-help-parameter">\n      <li if="${command.params.length === 0}">${l10n.helpManNone}</li>\n      <li foreach="param in ${command.params}">\n        ${param.name} <em>${getTypeDescription(param)}</em>\n        <br/>\n        ${describe(param)}\n      </li>\n    </ul>\n  </div>\n\n  <div if="${!command.exec}">\n    <h4 class="gcli-help-header">${l10n.subCommands}:</h4>\n\n    <ul class="gcli-help-${subcommands}">\n      <li if="${subcommands.length === 0}">${l10n.subcommandsNone}</li>\n      <li foreach="subcommand in ${subcommands}">\n        <strong>${subcommand.name}</strong>:\n        ${subcommand.description}\n        <span class="gcli-out-shortcut" data-command="help ${subcommand.name}"\n            onclick="${onclick}" ondblclick="${ondblclick}">\n          help ${subcommand.name}\n        </span>\n      </li>\n    </ul>\n  </div>\n\n</div>'});
define("text!gcli/commands/help_list.html",[],function(){return'\n<div>\n  <div if="${includeIntro}">\n    <h2>Welcome to GCLI</h2>\n    <p>GCLI is an experiment to create a highly usable JavaScript command line for developers.</p>\n    <p>\n      Useful links:\n      <a href=\'https://github.com/joewalker/gcli\'>Source</a> (Apache-2.0),\n      <a href=\'https://github.com/joewalker/gcli/blob/master/docs/index.md\'>Documentation</a> (for users/embedders),\n      <a href=\'https://wiki.mozilla.org/DevTools/Features/GCLI\'>Mozilla feature page</a> (for GCLI in the web console).\n    </p>\n  </div>\n\n  <h3>${heading}</h3>\n\n  <table>\n    <tr foreach="command in ${matchingCommands}">\n      <th class="gcli-help-name">${command.name}</th>\n      <td class="gcli-help-arrow">-</td>\n      <td>\n        ${command.description}\n        <span class="gcli-out-shortcut"\n            onclick="${onclick}" ondblclick="${ondblclick}"\n            data-command="help ${command.name}">help ${command.name}</span>\n      </td>\n    </tr>\n  </table>\n</div>'});
define("text!gcli/commands/help.css",[],function(){return"\n.gcli-help-name {\n  text-align: end;\n}\n\n.gcli-help-arrow {\n  color: #AAA;\n}\n\n.gcli-help-description {\n  margin: 0 20px;\n  padding: 0;\n}\n\n.gcli-help-parameter {\n  margin: 0 30px;\n  padding: 0;\n}\n\n.gcli-help-header {\n  margin: 10px 0 6px;\n}"});
define("gcli/commands/help","require,exports,module,util/util,util/l10n,gcli/canon,gcli/ui/view,text!gcli/commands/help_man.html,text!gcli/commands/help_list.html,text!gcli/commands/help.css".split(","),function(j,i){function h(a,d){var e=b.getCommands().filter(function(b){return b.hidden?!1:a.search&&b.name.indexOf(a.search)!==0?!1:!a.search&&b.name.indexOf(" ")!=-1?!1:!0});e.sort(function(a,b){return a.name.localeCompare(b.name)});var h;h=e.length===0?g.lookupFormat("helpListNone",[a.search]):a.search==
null?g.lookup("helpListAll"):g.lookupFormat("helpListPrefix",[a.search]);return{l10n:g.propertyLookup,includeIntro:a.search==null,matchingCommands:e,heading:h,onclick:function(a){c.updateCommand(a.currentTarget,d)},ondblclick:function(a){c.executeCommand(a.currentTarget,d)}}}function e(a,d){var e={l10n:g.propertyLookup,command:a,onclick:function(a){c.updateCommand(a.currentTarget,d)},ondblclick:function(a){c.executeCommand(a.currentTarget,d)},describe:function(a){return a.manual||a.description},getTypeDescription:function(a){var b=
"",b=a.defaultValue===void 0?g.lookup("helpManRequired"):a.defaultValue===null?g.lookup("helpManOptional"):a.defaultValue;return"("+a.type.name+", "+b+")"}};Object.defineProperty(e,"subcommands",{get:function(){var c=b.getCommands().filter(function(b){return b.name.indexOf(a.name)===0&&b.name!==a.name});c.sort(function(a,b){return a.name.localeCompare(b.name)});return c},enumerable:!0});return e}var c=j("util/util"),g=j("util/l10n"),b=j("gcli/canon"),k=j("gcli/ui/view");i.helpManHtml=j("text!gcli/commands/help_man.html");
i.helpListHtml=j("text!gcli/commands/help_list.html");i.helpCss=j("text!gcli/commands/help.css");var a={name:"help",description:g.lookup("helpDesc"),manual:g.lookup("helpManual"),params:[{name:"search",type:"string",description:g.lookup("helpSearchDesc"),manual:g.lookup("helpSearchManual3"),defaultValue:null}],returnType:"html",exec:function(a,c){var g=b.getCommand(a.search||void 0);return g?k.createView({html:i.helpManHtml,options:{allowEval:!0,stack:"help_man.html"},data:e(g,c),css:i.helpCss,cssId:"gcli-help"}):
k.createView({html:i.helpListHtml,options:{allowEval:!0,stack:"help_list.html"},data:h(a,c),css:i.helpCss,cssId:"gcli-help"})}};i.startup=function(){b.addCommand(a)};i.shutdown=function(){b.removeCommand(a)}});
define("orion/shell/Shell","i18n!orion/widgets/nls/messages,orion/i18nUtil,gcli/index,gcli/types,gcli/types/selection,gcli/argument,gcli/ui/fields,gcli/ui/fields/menu,util/util,gcli/settings,gcli/canon,gcli/cli,gcli/commands/help,util/promise".split(","),function(j,i,h,e,c,g,b,k,a,f,d,l,m,o){function n(){}n.prototype=Object.create(c.SelectionType.prototype);var p;p={CompletionStatus:{MATCH:0,PARTIAL:1,ERROR:2}};p.Shell=function(){function c(a){this._init(a.input,a.output)}c.prototype={clear:function(){for(var a=
document.getElementsByClassName("gcli-output")[0];a.hasChildNodes();)a.removeChild(a.lastChild);this.output(i.formatMessage(j["For a list of available commands type '${0}'."],"<b>help</b>"))},output:function(a){var b=new l.Output;this.commandOutputManager.onOutput({output:b});b.complete(a)},registerCommand:function(a){if(!a.exec)a.exec=a.callback;if(!a.params)a.params=a.parameters;var b=function(a){return function(b,c){var d=a(b,c);this.registeredTypes.forEach(function(a){a.prototype.lastParseTimestamp=
0});return d}.bind(this)}.bind(this);if(a.exec)a.exec=b(a.exec);h.addCommand(a)},registerType:function(a){a=function(a){function b(a){this.typeSpec=a}b.prototype=Object.create(n.prototype);b.prototype.name=a.getName();b.prototype.lastParseTimestamp=0;b.prototype.parse=function(b){var c=Object.getPrototypeOf(this),d=c.lastParseTimestamp;c.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse(b,this.typeSpec,{lastParseTimestamp:d}).then(function(a){var c=e.Status.VALID;if(a.status)switch(a.status){case p.CompletionStatus.ERROR:c=
e.Status.ERROR;break;case p.CompletionStatus.PARTIAL:c=e.Status.INCOMPLETE}var d=o.defer();d.resolve(a.predictions);return new e.Conversion(a.value,b,c,a.message,d.promise)})};b.prototype.lookup=function(){var b=Object.getPrototypeOf(this),c=b.lastParseTimestamp;b.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse(new g.Argument,this.typeSpec,{lastParseTimestamp:c}).then(function(a){return a.predictions})};if(a.stringify)b.prototype.stringify=function(b){return a.stringify(b,this.typeSpec)};
return b}(a);e.registerType(a);this.registeredTypes.push(a)},setFocusToInput:function(){this.inputText.focus()},setInputText:function(a){if(a)this.inputText.value=a.toString()},addField:function(){},_init:function(c,e){function g(c,d){b.Field.call(this,c,d);this.isImportant=!0;this.element=a.createElement(this.document,"div");this.element.className="orion";this.menu=new k.Menu({document:this.document,field:!0,type:c});this.menu.onItemClick=this.onItemClick.bind(this);this.element.appendChild(this.menu.element);
this.onFieldChange=a.createEvent("CustomField.fieldChanged");this.onInputChange=this.onInputChange.bind(this)}this.registeredTypes=[];var l=document.createElement("div");l.id="gcli-display";l.style.height="100%";l.style.width="100%";e.appendChild(l);this.inputText=document.createElement("input");this.inputText.type="text";this.inputText.id="gcli-input";this.inputText.style.width="100%";this.inputText.style.height="100%";c.appendChild(this.inputText);f.getSetting("hideIntro").value=!0;f.getSetting("eagerHelper").value=
2;setTimeout(function(){this.commandOutputManager=new d.CommandOutputManager;h.createDisplay({commandOutputManager:this.commandOutputManager});this.output(i.formatMessage(j["For a list of available commands type '${0}'."],"<b>help</b>"))}.bind(this),1);m.startup();m.helpListHtml=m.helpListHtml.replace('"${includeIntro}"',"${false}");g.prototype=Object.create(b.Field.prototype);g.prototype.destroy=function(){b.Field.prototype.destroy.call(this);this.menu.destroy();delete this.element;delete this.menu;
delete this.document;delete this.onInputChange};g.prototype.setConversion=function(a){this.setMessage(a.message);var b=[];a.getPredictions().forEach(function(a){a.hidden||b.push({name:a.name,complete:a.name,description:a.description||""})},this);this.menu.show(b);a.then&&a.then(function(){this.element&&this.setConversion(this.getConversion())}.bind(this))};g.prototype.onItemClick=function(a){a=a.conversion;this.onFieldChange({conversion:a});this.setMessage(a.message)};g.claim=function(a){return a instanceof
n?b.Field.MATCH+1:b.Field.NO_MATCH};b.addField(g)}};return c}();return p});
define("shell/shellPageFileService",["i18n!orion/shell/nls/messages","orion/bootstrap","orion/fileClient","orion/Deferred"],function(j,i,h,e){var c;c={};var g,b;i.startup().then(function(c){b=c.serviceRegistry;g=new h.FileClient(b)});c.ShellPageFileService=function(){function c(){this.currentDirectory=null;this.withNode(this.SEPARATOR,function(a){this.rootNode=a}.bind(this));this.currentRetrievals={}}c.prototype={SEPARATOR:"/",computePathString:function(a){if(a.Location===this.SEPARATOR)return this.SEPARATOR;
var b=this.SEPARATOR+g.fileServiceName(a.Location),c=a.Parents;if(c){b+=this.SEPARATOR;for(var e=c.length;--e>=0;)b+=c[e].Name,b+=this.SEPARATOR;b+=a.Name}a.Directory&&(b+=this.SEPARATOR);return b},createDirectory:function(a,b){return this._createResource(a,b,!0)},createFile:function(a,b){return this._createResource(a,b,!1)},ensureDirectory:function(a,b){var c=new e;typeof b!=="string"?b.Directory?c.resolve(b):c.reject(j["Cannot create directory, it already exists as a file"]):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(e){if(e)for(var g=0;g<e.length;g++)if(e[g].Name===b){e[g].Directory?c.resolve(e[g]):c.reject(j["Cannot create directory, it already exists as a file"]);return}this.createDirectory(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},ensureFile:function(a,b){var c=new e;typeof b!=="string"?b.Directory?c.reject(j["Cannot create file, it already exists as a directory"]):c.resolve(b):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(e){if(e)for(var g=0;g<e.length;g++)if(e[g].Name===b){e[g].Directory?c.reject(j["Cannot create file, it already exists as a directory"]):c.resolve(e[g]);return}this.createFile(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},getChild:function(a,b){if(b.length===0)return null;if(b===".")return a;if(b==="..")return this.getParent(a);if(!a.Children)return null;for(var c=0;c<a.Children.length;c++)if(a.Children[c].Name===
b)return a.Children[c];return null},getCurrentDirectory:function(){return this.currentDirectory},getDirectory:function(a,b){if(b.indexOf(this.SEPARATOR)===0)a=this.rootNode,b=b.substring(1);else if(!a){if(!this.currentDirectory)return null;a=this.currentDirectory}for(var c=b.substring(0,b.lastIndexOf(this.SEPARATOR)).split(this.SEPARATOR),e=a,g=0;g<c.length;g++)if(c[g].length>0&&(e=this.getChild(e,c[g]),!e||!e.Directory))return null;c=b.substring(b.lastIndexOf(this.SEPARATOR)+1);(c=this.getChild(e,
c))&&this._retrieveNode(c);e.Children||this._retrieveNode(e);return e},getParent:function(a){a.parent&&this._retrieveNode(a.parent);return a.parent},loadWorkspace:function(a){var c=b.getService("orion.page.progress");return c?c.progress(g.loadWorkspace(a),"Loading workspace "+a):g.loadWorkspace(a)},read:function(a){return g.read(a.Location,!1)},readBlob:function(a){var b=g._getService(a.Location);return!b.readBlob?(a=new e,a.reject(j["Source file service does not support binary read"]),a):b.readBlob(a.Location)},
setCurrentDirectory:function(a){this.currentDirectory=a;this._retrieveNode(a)},withChildren:function(a,c,d){if(a.Children)c&&c(a.Children);else if(a.ChildrenLocation){var e=b.getService("orion.page.progress");(e?e.progress(g.fetchChildren(a.ChildrenLocation),"Getting children of "+a.Name):g.fetchChildren(a.ChildrenLocation)).then(function(b){this._sort(b);var d=a.Parents?a.Parents.slice(0):[];d.unshift(a);for(var e=0;e<b.length;e++)b[e].parent=a,b[e].Parents=d;a.Children=b;c&&c(b)}.bind(this),function(a){d&&
d(a)})}else c&&c(null)},withNode:function(a,c,d){var e=b.getService("orion.page.progress");(e?e.progress(g.loadWorkspace(a),"Loading workspace "+a):g.loadWorkspace(a)).then(function(a){this._retrieveNode(a,c,d)}.bind(this),d)},write:function(a,b){return g.write(a.Location,b)},writeBlob:function(a,b){var c=g._getService(a.Location);return!c.writeBlob?(c=new e,c.reject(j["Target file service does not support binary write"]),c):c.writeBlob(a.Location,b)},_createResource:function(a,b,c){var h=a.Location+
this.SEPARATOR+b,k=new e,i=this.currentRetrievals[h]||[];i.push(k);if(i.length===1){this.currentRetrievals[h]=i;var j=function(a){if(c)a.Name=b;this.currentRetrievals[h].forEach(function(b){b.resolve(a)});delete this.currentRetrievals[h]}.bind(this),p=function(a){this.currentRetrievals[h].forEach(function(b){b.reject(a.responseText)});delete this.currentRetrievals[h]}.bind(this);c?a.Projects?g.createProject(a.Location,b).then(function(a){g.read(a.ContentLocation,!0).then(j,p)},p):g.createFolder(a.Location,
b).then(j,p):g.createFile(a.Location,b).then(j,p)}return k},_retrieveNode:function(a,c,d){if(a.parent&&a.Children)c&&c(a);else{var e=function(a,b,c){a.Directory&&!a.Children?this.withChildren(a,function(){b&&b(a)},c):b&&b(a)}.bind(this),h=function(a){if(a.Location!==this.SEPARATOR)if(a.Parents)if(a.Parents.length===0){var c=g.fileServiceRootURL(a.Location),d=b.getService("orion.page.progress");(d?d.progress(g.loadWorkspace(c),"Loading workspace "+c):g.loadWorkspace(c)).then(function(b){b.parent=this.rootNode;
a.parent=b}.bind(this))}else{a.parent=a.Parents[0];for(c=0;c<a.Parents.length-1;c++)a.Parents[c].parent=a.Parents[c+1],a.Parents[c].Directory=!0}else a.parent=this.rootNode}.bind(this);if(!a.Parents&&!a.Projects&&a.Location!==this.SEPARATOR&&a.Name!==g.fileServiceName(a.Location)){var k=b.getService("orion.page.progress");(k?k.progress(g.loadWorkspace(a.Location),"Loading workspace "+a.Location):g.loadWorkspace(a.Location)).then(function(b){a.Parents=b.Parents;h(a);e(a,c,d)})}else{if(a.ChildrenLocation)a.Directory=
!0;h(a);e(a,c,d)}}},_sort:function(a){a.sort(function(a,b){if(a.Directory!==b.Directory)return a.Directory?-1:1;var c=a.Name&&a.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return c<e?-1:c>e?1:0})}};return c}();return c});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(i){for(var h=/\[([^\]]*)\]\(([^\)]+)\)/g,e=h.exec(i),c=[],g=0;e;){if(e.length===3&&e[2].length>0){var b=new URL(e[2]);b.protocol!==":"&&j.validateURLScheme(b.href)&&(e.index>g&&c.push({segmentStr:i.substring(g,e.index)}),c.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),g=e.index+e[0].length)}e=h.exec(i)}if(g===0)return null;g<i.length-1&&c.push({segmentStr:i.substring(g)});return c},processURLSegments:function(i,
h){h.forEach(function(e){if(e.urlStr){var c=document.createElement("a");c.href=e.urlStr;c.appendChild(document.createTextNode(e.segmentStr))}else c=document.createElement("span"),c.textContent=e.segmentStr;i.appendChild(c)})}}});
define("shell/resultWriters",["orion/Deferred","orion/urlUtils"],function(j,i){var h;h={};h.FileBlobWriter=function(){function e(c,e){this.destination=c;this.shellPageFileService=e;this.blobs=[]}e.prototype={addBlob:function(c){this.blobs.push(c)},write:function(){var c=new j;this.shellPageFileService.ensureFile(null,this.destination).then(function(e){this.shellPageFileService.writeBlob(e,this.blobs[0]).then(function(){c.resolve()},function(b){c.reject(b)})}.bind(this),function(e){c.reject(e)});return c}};
return e}();h.FileStringWriter=function(){function e(c,e){this.destination=c;this.shellPageFileService=e;this.value=""}e.prototype={appendNewline:function(){this.value+="\n"},appendText:function(c){this.value+=c},write:function(){var c=new j;this.shellPageFileService.ensureFile(null,this.destination).then(function(e){this.shellPageFileService.write(e,this.value).then(function(){c.resolve()},function(b){c.reject(b)})}.bind(this),function(e){c.reject(e)});return c}};return e}();h.ShellBlobWriter=function(){function e(c){this.rootElement=
c;this.blobCount=0}e.prototype={addBlob:function(){this.blobCount++},write:function(){var c=new j,e=document.createElement("span");e.textContent="("+this.blobCount+" blobs)";this.rootElement.appendChild(e);c.resolve();return c}};return e}();h.ShellStringWriter=function(){function e(c){this.rootElement=c;this.tempRoot=document.createElement("div")}e.prototype={appendNewline:function(){this.tempRoot.appendChild(document.createElement("br"))},appendText:function(c){var e=document.createElement("span"),
b=i.detectValidURL(c);b?i.processURLSegments(e,b):e.textContent=c;this.tempRoot.appendChild(e)},write:function(){for(var c=new j,e=this.tempRoot.childNodes;e.length>0;)this.rootElement.appendChild(e[0]);c.resolve();return c}};return e}();return h});
define("shell/paramType-file",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred","shell/resultWriters"],function(j,i,h,e,c){function g(b,a,c,d){this.value=b;this.typeSpec=a;this.typedPath=c;this.shellPageFileService=d}var b;b={};g.prototype={getPluginRepresentation:function(){var b=new e;if(typeof this.value==="string")b.resolve({file:{path:this.value}});else{var a=this.typedPath.lastIndexOf(this.shellPageFileService.SEPARATOR,this.typedPath.length-2),c=a!==-1?
this.typedPath.substring(0,a):".",d=0,g=this.value.slice(0),h=[],i=function(a){a&&h.push(a);d===0&&g.length===0&&(this.typeSpec.multiple?b.resolve(h):b.resolve(h[0]))}.bind(this),j=function(){for(;g.length>0;){var a=g[0],b={isDirectory:a.Directory,path:c};a.recursePath&&a.recursePath.forEach(function(a){b.path+=this.shellPageFileService.SEPARATOR+a}.bind(this));b.path+=this.shellPageFileService.SEPARATOR+a.Name;a.Directory&&this.typeSpec.multiple&&this.typeSpec.recurse&&function(a){d++;this.shellPageFileService.withChildren(a,
function(b){d--;var c=a.recursePath?a.recursePath.slice(0):[];c.push(a.Name);b.forEach(function(a){a.recursePath=c});g.push.apply(g,b);g.length===b.length&&(b.length===0?i():j())},function(){d--;i()})}.call(this,a);g.splice(0,1);this.typeSpec.content&&!b.isDirectory?function(b){d++;this.shellPageFileService.readBlob(a).then(function(a){d--;b.blob=a;i(b)},function(){d--;i(b)})}.call(this,b):i(b)}}.bind(this);j()}return b},getValue:function(){return this.value},resourceExists:function(){return typeof this.value!==
"string"},stringify:function(){return this.typedPath}};b.ParamTypeFile=function(){function b(a){this.shellPageFileService=a}b.prototype={getName:function(){return"file"},parse:function(a,b){var c=new e;this._getPredictions(a.text).then(function(e){c.resolve(this._createCompletion(a.text,e,b))}.bind(this),function(a){c.error(a)});return c},processResult:function(a,b,d,e){var g=document.createElement("div"),k=0,i=function(b){this.callback=function(){var d=h.formatMessage(j["Wrote ${0}"],typeof b===
"string"?b:this.shellPageFileService.computePathString(b)),f=new c.ShellStringWriter(g);f.appendText(d);f.appendNewline();f.write();--k!==0||e?a.progress(g):a.resolve(g)}.bind(this);return this}.bind(this),p=function(b){this.callback=function(d){var f=h.formatMessage(j["Failed to write ${0}"],typeof b==="string"?b:this.shellPageFileService.computePathString(b));f+=" ["+d+"]";d=new c.ShellStringWriter(g);d.appendText(f);d.appendNewline();d.write();--k!==0||e?a.progress(g):a.resolve(g)}.bind(this);
return this}.bind(this),d=d||this.shellPageFileService.getCurrentDirectory();k++;this.shellPageFileService.ensureDirectory(null,d).then(function(a){k--;var d=b.getValue();b.isArray()||(d=[d]);d.forEach(function(b){k++;for(var d=b.path.split(this.shellPageFileService.SEPARATOR),e=0;e<d.length;){var f=d[e];if(f===".")d.splice(e,1);else if(f===".."){if(e===0){p(h.formatMessage(j["Cannot write ${0}, it is not a descendent of the output directory"],b.path));return}d.splice(e-- -1,2)}else e++}var g=function(a,
b,d){var e=d[0];d.splice(0,1);var f=this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+e;d.length===0?b.isDirectory?this.shellPageFileService.ensureDirectory(a,e).then(i(f).callback,p(f).callback):this.shellPageFileService.ensureFile(a,e).then(function(a){var d=new c.FileBlobWriter(a,this.shellPageFileService);d.addBlob(b.blob);d.write().then(i(a).callback,p(a).callback)}.bind(this),p(f).callback):this.shellPageFileService.ensureDirectory(a,e).then(function(a){g(a,
b,d)},p(this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+e).callback)}.bind(this);g(a,b,d)}.bind(this))}.bind(this),p(d).callback)},stringify:function(a){return!a?"":typeof a==="string"?a:a.stringify()},_createCompletion:function(a,b,c){if(!b)return{value:void 0,status:i.CompletionStatus.ERROR,message:h.formatMessage(j["'${0}' is not valid"],a),predictions:null};var e,k,o;if(c.exist===!1){var n;for(k=0;k<b.length;k++){var p=b[k];if(p.name===a){n=p;break}}n?(k=i.CompletionStatus.ERROR,
e=h.formatMessage(j["'${0}' already exists"],a)):(k=i.CompletionStatus.MATCH,o=new g(a,c,a,this.shellPageFileService));b=[]}else{var w=[];b.forEach(function(a){(a.value.Directory||c.file)&&w.push(a)});b=w;if(c.exist){var q=[];n=a.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&");n=n.replace(/\?/g,".");n=n.replace(/\*/g,".*");var v=RegExp("^"+n+"$");b.forEach(function(a){a.name.match(v)&&(a.value.Directory&&c.directory||!a.value.Directory&&c.file)&&q.push(a.value)});c.multiple&&q.length||q.length===1?(k=i.CompletionStatus.MATCH,
o=new g(q,c,a,this.shellPageFileService)):b.length?k=i.CompletionStatus.PARTIAL:(k=i.CompletionStatus.ERROR,e=h.formatMessage(j["'${0}' is not valid"],a))}else{for(k=0;k<b.length;k++)if(p=b[k],p.name===a){n=p;break}k=i.CompletionStatus.MATCH;o=n?new g([n.value],c,a,this.shellPageFileService):new g(a,c,a,this.shellPageFileService)}}return{value:o,status:k,message:e,predictions:b}},_find:function(a,b){for(var c=0;c<a.length;c++)if(b(a[c]))return a[c];return null},_getPredictions:function(a){var b=new e,
c=this.shellPageFileService.getDirectory(null,a);c?this.shellPageFileService.withChildren(c,function(e){var g=a.lastIndexOf(this.shellPageFileService.SEPARATOR)+1,h=a.substring(0,g),k=a.substring(g),i=k.length===0||k===".",g=[],j=[];i&&g.push({name:h+".",value:c,incomplete:!0});if(i||k==="..")(i=this.shellPageFileService.getParent(c))&&g.push({name:h+"..",value:i,incomplete:!0});k.trim().length===0&&h.length>0&&g.push({name:h,value:c,incomplete:!1});for(var k=k.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&"),
k=k.replace(/\?/g,"."),k=k.replace(/\*/g,".*"),i=RegExp("^"+k),q=0;q<e.length;q++){var v=e[q];if(v.Name.match(i)){var t=!v.Directory||v.Children&&v.Children.length===0,k=h+v.Name;v.Directory?g.push({name:k,value:v,incomplete:!t}):j.push({name:k,value:v,incomplete:!t})}}b.resolve(g.concat(j))}.bind(this),function(a){b.error(a)}):b.resolve(null);return b}};return b}();return b});
define("shell/paramType-plugin",["i18n!orion/shell/nls/messages","require","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(j,i,h,e,c){var g;g={};var b=function(){function b(a,c){this.plugins=a;this.urlsToExclude=c}b.prototype={name:"all",getPluginLocations:function(){var a=[];this.plugins.forEach(function(b){b=b.getLocation();(!this.urlsToExclude||!this.urlsToExclude[b])&&a.push(b)}.bind(this));return a},isAllPlugin:function(){return!0},start:function(a){return this._invokeOnAllPlugins("start",
a)},stop:function(){return this._invokeOnAllPlugins("stop")},uninstall:function(){return this._invokeOnAllPlugins("uninstall")},update:function(){return this._invokeOnAllPlugins("update")},_invokeOnAllPlugins:function(a,b){var d=this.urlsToExclude?[]:this.plugins;this.urlsToExclude&&this.plugins.forEach(function(a){this.urlsToExclude[a.getLocation()]||d.push(a)}.bind(this));var e=new c,g=d.length,h=0;d.forEach(function(c){c[a](b).then(function(){++h===g&&e.resolve()},function(a){e.reject(a)})});return e}};
return b}();g.ParamTypePlugin=function(){function g(a){this.pluginRegistry=a;a.addEventListener("installed",function(){this._initPluginsList()}.bind(this));a.addEventListener("uninstalled",function(){this._initPluginsList()}.bind(this));a.addEventListener("stopping",function(){this._sort(this.plugins)}.bind(this));a.addEventListener("lazy activation",function(){this._sort(this.plugins)}.bind(this));window.setTimeout(function(){this._computeDefaultPlugins();this._initPluginsList()}.bind(this),1)}g.prototype=
{getName:function(){return"plugin"},getPlugins:function(){return this.plugins.slice(0)},parse:function(a,b){var d=new c,e=this._getPredictions(a.text,b);d.resolve(this._createCompletion(a.text,e));return d},stringify:function(a){return a.name},_defaultPluginUrls:{},_computeDefaultPlugins:function(){var a=localStorage.getItem("/orion/preferences/default/plugins");a&&(a=JSON.parse(a),Object.keys(a).forEach(function(a){var b=this._defaultPluginUrls;a=i.toUrl(a);if(a.indexOf("://")===-1){var c=document.createElement("a");
c.href=a;a=c.href}b[a]=!0}.bind(this)))},_createCompletion:function(a,b){for(var c,g=0;g<b.length;g++){var k=b[g];if(k.name===a){c=k;break}}var i;c?g=h.CompletionStatus.MATCH:b&&b.length>0?g=h.CompletionStatus.PARTIAL:(g=h.CompletionStatus.ERROR,i=e.formatMessage(j["'${0}' is not valid"],a));return{value:c?c.value:void 0,status:g,message:i,predictions:b}},_formatLocationAsPluginName:function(a){var b=a.split("/"),b=b[b.length-1],b=b.split(".html")[0],b=b.replace(/([a-z])([A-Z])/,"$1 $2"),b=function(a){return a.toLowerCase().replace(/\b[a-z]/g,
function(a){return a.toUpperCase()})}(b),b=b.replace("plugin",""),b=b.replace("Plugin","");b===""&&(b=a);return b.trim()},_getPredictions:function(a,c){var d=[];this.plugins&&(this.plugins.forEach(function(b){(!c.excludeDefaultPlugins||!this._defaultPluginUrls[b.getLocation()])&&b.name.indexOf(a)===0&&d.push({name:b.name,value:b})}.bind(this)),c.multiple&&"all".indexOf(a)===0&&d.push({name:"all",value:new b(this.plugins,c.excludeDefaultPlugins?this._defaultPluginUrls:null)}));return d},_initPluginsList:function(){this.plugins=
[];this.pluginRegistry.getPlugins().forEach(function(a){var b=a.getLocation(),c=a.getHeaders();a.name=c.name||this._formatLocationAsPluginName(b);this.plugins.push(a)}.bind(this));this._sort(this.plugins)},_sort:function(a){a.sort(function(a,b){var c=a.getState(),c=c==="active"||c==="starting",e=b.getState();if(c!==(e==="active"||e==="starting"))return c?-1:1;c=a.name&&a.name.toLowerCase();e=b.name&&b.name.toLowerCase();return c<e?-1:c>e?1:0})}};return g}();return g});
define("shell/paramType-service",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(j,i,h,e){var c;c={};c.ParamTypeService=function(){function c(b){this.pluginRegistry=b;b.addEventListener("installed",function(){this._initServicesList()}.bind(this));b.addEventListener("uninstalled",function(){this._initServicesList()}.bind(this));window.setTimeout(function(){this._initServicesList()}.bind(this),1)}c.prototype={getName:function(){return"service"},parse:function(b){var c=
new e,a=this._getPredictions(b.text);c.resolve(this._createCompletion(b.text,a));return c},stringify:function(b){return b},_createCompletion:function(b,c){for(var a,e=0;e<c.length;e++){var d=c[e];if(d.name===b){a=d;break}}var g;a?e=i.CompletionStatus.MATCH:c&&c.length>0?e=i.CompletionStatus.PARTIAL:(e=i.CompletionStatus.ERROR,g=h.formatMessage(j["'${0}' is not valid"],b));return{value:a?a.value:void 0,status:e,message:g,predictions:c}},_getPredictions:function(b){var c=[];this.services&&this.services.forEach(function(a){a.indexOf(b)===
0&&c.push({name:a,value:a})});return c},_initServicesList:function(){var b={};this.pluginRegistry.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(a){a.getProperty("service.names").forEach(function(a){b[a]=!0})})});this.services=[];for(var c in b)this.services.push(c);this._sort(this.services)},_sort:function(b){b.sort(function(b,a){var c=b.toLowerCase(),d=a.toLowerCase();return c<d?-1:c>d?1:0})}};return c}();return c});
define("shell/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(j,i,h,e,c,g,b,k,a){var f={},d=a.getOrionHome();f._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var b=a.constructor(),c;for(c in a)c!=="children"&&c!=="Children"&&(b[c]=m(a[c]));return b};f._createOpenWithCommands=function(a){function b(a,c){for(var d=a.getServiceReferences("orion.navigate.openWith"),
e=[],f=0;f<d.length;f++){var g=d[f];g.getProperty("editor")===c.id&&(g=g.getProperty("contentType"),g instanceof Array?e=e.concat(g):g!==null&&typeof g!=="undefined"&&e.push(g))}return e}for(var c=function(){for(var b=a.getServiceReferences("orion.edit.editor"),c=[],d=0;d<b.length;d++){var e=b[d],f=e.getProperty("id");c.push({id:f,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate")})}return c}(),
d=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),e=[],f=0;f<c.length;f++){var g=c[f],h=d&&d.editor===g.id,k=b(a,g);k.length&&e.push({properties:{name:g.name||g.id,nameKey:g.nameKey,id:"eclipse.openWithCommand."+g.id,tooltip:g.name,tooltipKey:g.nameKey,contentType:k,uriTemplate:g.uriTemplate,nls:g.nls,forceSingleItem:!0,isEditor:h?"default":"editor"},service:{}})}return e};f._makeValidator=function(a,
b,e,f){function h(a,b,c,d){var e=c.match,f;if(b.indexOf("|")>=0)return f=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),h(a,f,c,d)?!0:h(a,b,c,d);else if(b.indexOf(":")>=0)return f=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[f]?h(a[f],b,c,d):!1;else{a:{f=!1;var g;if(a[b]){if(e)if(typeof e==="string"){if(!typeof(a[b]==="string")){c=!1;break a}if(c.variableName){if(e=RegExp(e).exec(a[b]))f=e[0],g=c.variableMatchPosition==="before"?a[b].substring(0,e.index):c.variableMatchPosition===
"after"?a[b].substring(e.index+f.length):c.variableMatchPosition==="only"?f:a[b],f=!0}else{c=RegExp(e).test(a[b]);break a}}else a[b]===e&&(g=a[b],f=!0);else g=a[b],f=!0;if(f&&c.variableName&&(d[c.variableName]=g,d.itemCached=a,c.replacements))for(a=0;a<c.replacements.length;a++)b=!1,c.replacements[a].pattern?d[c.variableName]=d[c.variableName].replace(RegExp(c.replacements[a].pattern),c.replacements[a].replacement||""):b=!0,b&&window.console.log("Invalid replacements specified in validation property.  "+
c.replacements[a]);c=f}else c=!1}return c}}return{info:a,validationFunction:function(b){typeof f==="function"&&(b=f.call(this,b));if(b){if(Array.isArray(b)){if((this.info.forceSingleItem||this.info.uriTemplate)&&b.length!==1)return!1;if(b.length<1)return!1}else b=[b];for(var d=0;d<b.length;d++){var g;a:{var k=b[d],i=e;if(this.info.validationProperties)for(g=0;g<this.info.validationProperties.length;g++){var j=this.info.validationProperties[g];if(j.source){if(!h(k,j.source,j,this)){g=!1;break a}}else{window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified.");g=!1;break a}}if(this.info.contentType&&i){j=!1;if(k=c.getFilenameContentType(k.Name,i))for(g=0;g<this.info.contentType.length;g++)if(k.id===this.info.contentType[g]){j=!0;break}g=j}else g=!0}if(!g)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);if(this.info.validationProperties)for(c=0;c<this.info.validationProperties.length;c++){var e=
this.info.validationProperties[c];e.source&&e.variableName&&(this.itemCached===a&&this[e.variableName]||h(a,e.source,e,this),a[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[e.variableName]=this[e.variableName])}b.OrionHome=d;a=new g(this.info.uriTemplate);return window.decodeURIComponent(a.expand(b))}return null}}};f._createCommandOptions=function(a,c,d,e,g,h){function k(b,i){var j=
f._makeValidator(a,d,e,h);b.visibleWhen=j.validationFunction.bind(j);if(g)if(j.generatesURI.bind(j)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return j.getURI.bind(j)(a)};else{var t=a;b.callback=function(a){var e;if(t.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,e=f._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){e=[];for(var g=0;g<a.items.length;g++)e.push(f._cloneItemWithoutChildren(a.items[g]))}else e=f._cloneItemWithoutChildren(a.items);
if(d)var h=d.getService("orion.page.progress");c.run?h?h.progress(c.run(e),"Running command: "+b.name):c.run(e):d&&(h?h.progress(d.getService(c).run(e),"Running command: "+b.name):d.getService(c).run(e))}}i.resolve(b)}var j=new i;a.nls?b.getMessageBundle(a.nls).then(function(b){k({name:a.nameKey?b[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?b[a.tooltipKey]:a.tooltip,isEditor:a.isEditor},j)}):k({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor},
j);return j};f.getOpenWithCommands=function(a){var b=[],c;for(c in a._commandList){var d=a._commandList[c];d.isEditor&&b.push(d)}return b};return f});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(j,i,h,e,c){function g(b,a,c,d,e){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=a;this.notificationContainerDomId=e;this.domId=c;this.progressDomId=d||c;this._hookedClose=!1;this._timer=null}var b;g.prototype={_init:function(){var b=i.node("closeNotifications");if(b&&!this._hookedClose)this._hookedClose=!0,
b.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=h.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,a,c){this._init();this.currentMessage=b;var d=i.node(this.domId);if(typeof c==="boolean"){var e=d.getAttribute("aria-live");d.setAttribute("aria-live",c?"polite":"off");window.setTimeout(function(){b===
this.currentMessage&&(i.empty(d),d.appendChild(document.createTextNode(b)),window.setTimeout(function(){d.setAttribute("aria-live",e)},100))}.bind(this),100)}else i.empty(d),d.appendChild(document.createTextNode(b));typeof a==="number"&&window.setTimeout(function(){b===this.currentMessage&&(i.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),a)},setErrorMessage:function(b){this.currentMessage=b;this._init();var a=b.responseText||b.message||b;if(typeof a==="string")try{a=JSON.parse(a)}catch(c){}var b=
a.Message||a,d="red";if(a.Severity)switch(a.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}a=document.createElement("span");a.style.color=d;a.appendChild(document.createTextNode(b));b=i.node(this.domId);i.empty(b);b.appendChild(a)},setProgressMessage:function(b){this._init();this.currentMessage=b;var a=document.createElement("span");a.classList.add("imageSprite");a.classList.add("progressIcon");a.classList.add("core-sprite-progress");var c=i.node(this.progressDomId);
i.empty(c);c.appendChild(a);c.appendChild(document.createTextNode(b));a=i.node(this.notificationContainerDomId);a.classList.remove("notificationHide");if(b&&b.length>0)a.classList.add("progressNormal"),a.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else a.classList.remove("notificationShow"),a.classList.add("notificationHide")},setProgressResult:function(b){this.currentMessage=b;var a=b.responseText||b;if(typeof a===
"string")try{a=JSON.parse(a)}catch(e){}this._init();var d=a.Message||a,g="core-sprite-information",h="progressInfo",j=document.createElement("span");j.classList.add("imageSprite");j.classList.add("progressIcon");b=[];if(a.Severity)switch(a.Severity){case "Warning":g="core-sprite-warning";h="progressWarning";b.push("progressInfo");b.push("progressError");b.push("progressNormal");break;case "Error":g="core-sprite-error";h="progressError";b.push("progressWarning");b.push("progressInfo");b.push("progressNormal");
break;default:b.push("progressWarning"),b.push("progressError"),b.push("progressNormal")}b.push("notificationHide");j.classList.add(g);var n=i.node(this.progressDomId),g=i.node(this.notificationContainerDomId);i.empty(n);n.appendChild(j);if(a.HTML)a=document.createElement("span"),a.innerHTML=d,n.appendChild(a);else{if(j=c.detectValidURL(d))d=document.createDocumentFragment(),c.processURLSegments(d,j),Array.prototype.forEach.call(i.$$("a",d),function(a){a.target="_blank"});else{if(a.Severity!=="Warning"&&
a.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);d=document.createTextNode(d)}n.appendChild(d)}if(h&&this.progressDomId!==this.domId){g.classList.add(h);for(h=0;h<b.length;h++)g.classList.remove(b[h])}g.classList.add("notificationShow")},showWhile:function(b,a){var c=this;if(a){c.setProgressMessage(a);var d=function(){a===c.currentMessage&&c.setProgressMessage("")};b.then(d,d)}return b},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(c,a){return new b(this,++this._lastProgressId,c,a)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",a=!0,c;for(c in this._progressMonitors)this._progressMonitors[c].status&&(a||(b+=", "),b+=this._progressMonitors[c].status,a=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;
this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};g.prototype.constructor=g;b=function(b,a,c,d){this.statusService=b;this.progressId=a;if(c){this.deferred=c;this.begin(d);var e=this;c.then(function(){e.done.bind(e)()},function(){e.done.bind(e)()})}};
b.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};b.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};b.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};b.prototype.constructor=b;return{StatusReportingService:g,ProgressMonitor:b}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(j,i){var h={root:i};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,i,h,e){function c(){}c.prototype={_initialize:function(c,b,i,a,f){this._tooltip=new e.Tooltip({node:c,hideDelay:f||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:i,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";c=document.createRange();c.selectNode(this.$parent);c=c.createContextualFragment(this.TEMPLATE);
this.messages&&h.processTextNodes(c,j);this.$parent.appendChild(c);var d=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===h.KEY.ESCAPE&&d.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var e=c.childNodes[b];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var b=
h.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,i,h,e){var c={};(function(){var g=!1;c.updateNavTools=function(b,c,a,e,d,i){var m=h.node(e);if(m)c.destroy(m);else throw j["could not find toolbar "]+e;c.renderCommands(e,m,i,a,"button");if(d&&(e=h.node(d)))c.destroy(e),c.renderCommands(d,e,null,a,"button");g||(g=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var e=h.node(d);
e&&(c.destroy(e),c.renderCommands(d,e,b.selections,a,"button"))}))};c.createOperationsCommands=function(b,c,a){function f(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var d=new e.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){a.removeCompletedOperations().then(function(){c.loadOperations.bind(c)()})},visibleWhen:function(){return!0}});b.addCommand(d);
d=new e.Command({name:j.Remove,tooltip:j["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],d=0;d<b.length;d++){var e=b[d];a.removeOperation.bind(a)(e.Location).then(function(){c.loadOperations.bind(c)()},function(){c.loadOperations.bind(c)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!f(a);for(var b in a)if(f(a[b]))return!1;return!0}});b.addCommand(d);
d=new e.Command({name:j.Cancel,tooltip:j["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return f(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!f(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(d)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,i,h,e,c){function g(b){this._options=b}g.prototype=new e.PopupDialog;g.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>';g.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};g.prototype._bindToDom=function(){this.$allOperationsLink.href=i.toUrl("operations/list.html");this._setOperationsVisibility()};g.prototype.setOperations=function(b,c){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(c[a]);this._renderOperations()};g.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(c){}var a={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==a.Message)a.DetailedMessage=b.DetailedMessage;return a};g.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};g.prototype._renderOperationsTable=function(b,c,a){h.empty(b);for(var e=0;e<c.length;e++){var d=c[e],g=document.createElement("tr"),i=document.createElement("td");i.style.paddingLeft="5px";i.style.paddingRight="5px";i.textContent=d.Name;g.appendChild(i);var o=document.createElement("div");i.appendChild(o);i=document.createElement("span");i.style.paddingRight="5px";i.classList.add("imageSprite");switch(d.type){case "Warning":i.classList.add("core-sprite-warning");i.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":i.classList.add("core-sprite-error");i.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":i.classList.add("core-sprite-start");i.setAttribute("aria-label",j["Operation is running."]);break;case "abort":i.classList.add("core-sprite-stop");i.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":i.classList.add("core-sprite-ok"),i.setAttribute("aria-label","Operation ok.")}o.appendChild(i);
i=document.createElement("span");i.classList.add("operationStatus");i.textContent=d.Name;o.appendChild(i);if(d.error){var n=d.error.Message||d.error;d.error.DetailedMessage&&d.error.DetailedMessage!==""&&(n+=": "+d.error.DetailedMessage);i.textContent=n;i.classList.remove("operationStatus");i.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",o,{operation:d,deferred:a[e]},this,"tool");b.appendChild(g)}this._setOperationsVisibility()};g.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"};g.prototype.constructor=g;return{OperationsDialog:g}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,i,h,e,c){function g(b,a){if(!this._progressPane){this._progressPane=e.node(b);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var f=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===e.KEY.ENTER)&&f._operationsDialog.show()})}}function b(b,a,c,d){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=d}g.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var c=
{},d;for(d in b)b[d].progressMonitor||(c[d]=b[d]);if(this._isEmpty(c))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 e="";for(d in c){var g=c[d];if(g.type&&(g.type==="loadstart"||g.type==="progress")){e="running";break}}switch(e){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(c,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};
g.prototype.constructon=g;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new g(b,this._commandRegistry)},progress:function(b,a,c){var d=this,e=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(a));b.then(function(){if(d._operations[e]){var g=d._operations[e];if(a)g.Name=a;d._lastOperation=g;g.type="loadend";if(c)g.progressMonitor=c;d.writeOperation.bind(d)(e,g,b);g.Location||d._removeOperationFromTheList.bind(d)(e)}},
function(g){if(d._operations[e]){var h=d._operations[e];if(a)h.Name=a;if(c)h.progressMonitor=c;d._lastOperation=h;h.type=g.canceled?"abort":"error";h.error=g;d.writeOperation.bind(d)(e,h,b);h.Location||d._removeOperationFromTheList.bind(d)(e)}},function(g){if(a)g.Name=a;if(c)g.progressMonitor=c;d.writeOperation.bind(d)(e,g,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];if(a.type&&a.type!=="loadstart"&&a.type!=="progress")(a=this._operations[b].progressMonitor)&&
a.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);var c=this;b.then(function(){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c.setProgressResult.bind(c)(a);
return a});return this.progress(b,a)},writeOperation:function(b,a,c){this._operations[b]=a;this._operationDeferrds[b]=c;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(a.Location,{Name:a.Name,expires:a.expires})});a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,i){function h(b,c,a){return b[c].apply(b,a)}function e(b){this._location=b}function c(){var b=new i;b.reject(j["No Matching OperationService for location:"]+this._location);return b}function g(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var c=b.getServiceReferences("orion.core.operation"),
a=0;a<c.length;a++){var f=b.getService(c[a]);this._services[a]=f;f=c[a].getProperty("pattern")||".*";f[0]!=="^"&&(f="^"+f);this._patterns[a]=RegExp(f)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];return new e(a)}}e.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};e.prototype.constructor=e;g.prototype={getOperations:function(){var b=
new i;if(this._operations)return b.resolve(this._operations),b;var c=this;this._preferenceService.getPreferences("/operations").then(function(a){c._operations=a;b.resolve(c._operations)});return b},getOperation:function(b){return h(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],c=this,a=0;a<this._services.length;a++){var e=this._patterns[a],d=new i;b[a]=d.promise;h(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
c.getOperations.bind(c)().then(function(c){for(var d=c.keys(),g=0;g<d.length;g++){var h=d[g];e.test(h)&&b.indexOf(h)<0&&c.remove(h)}a.resolve()})}}(d),function(a){return function(b){a.reject(b)}}(d))}return i.all(b)},removeOperation:function(b){var c=this;return h(this._getService(b),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(a){a.remove(b)})},function(a){return a},function(a){return a})}};g.prototype.constructor=g;return{OperationsClient:g}});
define('built-shellPage.js',"require,i18n!orion/shell/nls/messages,orion/browserCompatibility,orion/bootstrap,orion/commandRegistry,orion/fileClient,orion/searchClient,orion/globalCommands,orion/shell/Shell,orion/webui/treetable,shell/shellPageFileService,shell/paramType-file,shell/paramType-plugin,shell/paramType-service,orion/i18nUtil,shell/extensionCommands,orion/contentTypes,orion/pluginregistry,orion/PageUtil,orion/URITemplate,orion/Deferred,orion/status,orion/progress,orion/operationsClient,shell/resultWriters,orion/URL-shim".split(","),
function(j,i,h,e,c,g,b,k,a,f,d,l,m,o,n,p,w,q,v,t,u,s,z,x,B){function C(){var a=v.matchResourceParameters(window.location.href).resource;return a.length>0?a:null}function y(a,b){var c=(new t(ka)).expand({resource:a});b?window.location.replace(c):window.location.href=c}function r(a){for(var b=0;b<P.length;b++){var c=P[b];if(c.visibleWhen(a))return c.hrefCallback({items:a})}b=ia.getFileContentType(a);switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return a.Location}c=
null;for(b=0;b<P.length;b++)if(P[b].isEditor==="default"){c=P[b];break}return!c?a.Location:c.hrefCallback({items:a})}function A(a){var b=document.createElement("a");if(a.Directory)return b.href="#"+a.Location,b.className="shellPageDirectory",b.textContent=a.Name,b;b.href=r(a);b.target="_blank";b.textContent=a.Name;return b}function D(a,b){var c=document.createElement("span");c.appendChild(document.createTextNode(b?i["Initial directory: "]:i["Changed to: "]));var d=document.createElement("b");d.appendChild(document.createTextNode(a));
c.appendChild(d);return c}function H(a){a=a.directory.value[0];E.setCurrentDirectory(a);ga=!0;y(a.Location,!1);a=E.computePathString(a);return D(a,!1)}function I(a){a=r(a.file.getValue()[0]);window.open(a)}function N(a,b){var c=b.createPromise(),d=E.getCurrentDirectory(),d=d?d.Location:C()||Z;E.loadWorkspace(d).then(function(a){E.setCurrentDirectory(a);E.withChildren(a,function(a){for(var b=document.createElement("div"),d=0;d<a.length;d++)b.appendChild(A(a[d])),b.appendChild(document.createElement("br"));
c.resolve(b);setTimeout(function(){for(var a=O.querySelectorAll(".shellPageDirectory"),b=0;b<a.length;b++)a[b].setAttribute("target","_self"),a[b].className=""},1)},function(a){$(c,a)})},function(a){$(c,a)});return c}function R(a,b){var c=b.createPromise(),d=E.getCurrentDirectory();E.loadWorkspace(d.Location).then(function(a){var a=E.computePathString(a),b=document.createElement("b");b.appendChild(document.createTextNode(a));c.resolve(b)},function(a){$(c,a)});return c}function ba(a){var b=document.createElement("div");
a.plugin.getServiceReferences().forEach(function(a){var c={values:[]};a.getPropertyKeys().forEach(function(b){if(b==="service.names")c.name=a.getProperty(b).join();if(b==="id")c.id=a.getProperty(b);c.values.push({name:b,value:a.getProperty(b)})});if(c.name){c.elementId="serviceElement"+Y++;c.values.forEach(function(a){a.elementId="serviceElement"+Y++});var d=document.createElement("div");b.appendChild(d);var e=new ja,d=new f.TableTree({model:new ma(c),showRoot:!0,parent:d,renderer:e});e.tableTree=
d}});return b}function ca(){for(var a=X.getPlugins(),b=document.createElement("table"),c=0;c<a.length;c++){var d=document.createElement("tr");b.appendChild(d);var e=document.createElement("td");d.appendChild(e);d=document.createElement("b");e.appendChild(d);d.textContent=a[c].name;d=a[c].getState();if(d!=="active"&&d!=="starting")d=document.createElement("span"),e.appendChild(d),d.textContent=" ("+i.disabled+")"}return b}function L(a,b){var c=b.createPromise();a.plugin.stop().then(function(){c.resolve(i.Succeeded)},
function(a){c.resolve(a)});return c}function da(a,b){var c=b.createPromise();a.plugin.start({lazy:!0}).then(function(){c.resolve(i.Succeeded)},function(a){c.resolve(a)});return c}function U(a,b){var c=a.url.trim();if(/^\S+$/.test(c)){if(Q.getPlugin(c))return i["Plug-in is already installed"];var d=b.createPromise();Q.installPlugin(c).then(function(a){a.start({lazy:!0}).then(function(){S.getPreferences("/plugins").then(function(a){a.put(c,!0)});d.resolve(i.Succeeded)},function(a){d.resolve(a)})},function(a){d.resolve(a)});
return d}return i["Invalid plug-in URL"]}function V(a,b){var c=b.createPromise();a.plugin.update().then(function(){c.resolve(i.Succeeded)},function(a){c.resolve(a)});return c}function W(a,b){var c=b.createPromise();if(a.plugin.isAllPlugin){if(!window.confirm(i["Are you sure you want to uninstall all contributed plug-ins?"]))return i.Aborted;a.plugin.uninstall().then(function(){S.getPreferences("/plugins").then(function(b){for(var c=a.plugin.getPluginLocations(),d=0;d<c.length;d++)b.remove(c[d])}.bind(this));
c.resolve(i.Succeeded)},function(a){c.resolve(a)})}else{var d=a.plugin.getLocation();Q.getPlugin(d).uninstall().then(function(){S.getPreferences("/plugins").then(function(a){a.remove(d)}.bind(this));c.resolve(i.Succeeded)},function(a){c.resolve(a)})}return c}function J(a){var b=a.id.trim(),c=document.createElement("div");X.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(d){if(d.getProperty("service.names").indexOf(b)!==-1){var e={name:a.name,values:[]};d.getPropertyKeys().forEach(function(a){if(a===
"id")e.id=d.getProperty(a);e.values.push({name:a,value:d.getProperty(a)})});e.elementId="serviceElement"+Y++;e.values.forEach(function(a){a.elementId="serviceElement"+Y++});var g=document.createElement("div");c.appendChild(g);var h=new ja,g=new f.TableTree({model:new ma(e),showRoot:!0,parent:g,renderer:h});h.tableTree=g}})});return c}function K(a,b){typeof a!=="string"&&(a=a.xhr&&a.xhr.statusText?a.xhr.statusText:a.toString());a.split("\n").forEach(function(a){b.appendText(a);b.appendNewline()});
return b.write()}function aa(a,b,c,d){var e,f;c?f=new B.FileBlobWriter(c,E):(e=document.createElement("div"),f=new B.ShellBlobWriter(e));c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(a){f.addBlob(a)});f.write().then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new B.ShellStringWriter(e);K(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function T(a,b,c,d){var e,f;c?f=new B.FileStringWriter(c,E):(e=document.createElement("div"),f=new B.ShellStringWriter(e));
K(b.stringify(),f).then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new B.ShellStringWriter(e);K(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function F(a,b,c,d){var e=b.getType();e==="file"?fa.processResult(a,b,c,d):e==="blob"?aa(a,b,c,d):T(a,b,c,d)}function M(a,b,c,d,e){return typeof a.callback!=="function"?void 0:function(f){var g=new u,h=null;if(e)(h=f.output)&&(h=h.resourceExists()?h.getValue()[0]:h.getValue()),delete f.output;(function(a,
b){var c=Object.keys(a);if(c.length===0)b(a);else{var d=0;c.forEach(function(e){(function(e){(function(a,b){a&&a.getPluginRepresentation?a.getPluginRepresentation().then(function(a){b(a)}):b(a)})(a[e],function(f){a[e]=f;++d===c.length&&b(a)})})(e)})}})(f,function(e){var i=function(a){a=new la(a,d);F(g,a,h)},j=function(a){$(g,a)},k=function(a){if(a&&a.uriTemplate){var c=new t(a.uriTemplate);E.getCurrentDirectory();var c=c.expand({}),e=document.createElement("iframe");e.id=b;e.name=b;e.type="text/html";
e.sandbox="allow-scripts allow-same-origin";e.frameborder=1;e.src=c;e.className="delegatedUI";if(a.width)e.style.width=a.width;if(a.height)e.style.height=a.height;var a=document.getElementsByClassName("gcli-row-out"),f=a[a.length-1];f.appendChild(e);window.addEventListener("message",function oa(a){a.source===e.contentWindow&&typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===b&&(window.removeEventListener("message",oa,!1),a.error?j(a.error):(f.removeChild(e),
a.result?i(a.result):a.progress&&k(a.progress))))},!1)}else typeof g.progress==="function"&&(a=new la(a,d),F(g,a,h,!0))};c.progress(a.callback(e,{cwd:C()}),"Executing command "+function(a,b){var c=a,d;for(d in b)c+=" ",c+=b[d];return c}(b,f)).then(i,j,k)});return g}}function ha(a){return typeof a!=="function"?void 0:function(b,c,d){var e=new u;if(d)d.cwd=C();a(b,c,d).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}}var E,ea,O,fa,ga=!1,ia,P=[],G,Q,X,S,Y=0,Z=(new URL(j.toUrl("file"),
window.location.href)).pathname,ka=j.toUrl("shell/shellPage.html")+"#{,resource}",la=function(){function a(b,c){this.value=b;this.array=!1;if(c.indexOf("[")===0&&c.lastIndexOf("]")===c.length-1)this.array=!0,c=c.substring(1,c.length-1);this.type=c}a.prototype={getType:function(){return this.type},getValue:function(){return this.value},isArray:function(){return this.array},stringify:function(){if(this.type!=="string")return"("+(this.array?"[":"")+this.value+(this.array?"]":"")+")";if(!this.array)return this.value;
for(var a="",b=0;b<this.value.length;b++)a+=this.value[b],b!==this.value.length-1&&(a+="\n");return a}};return a}(),na=function(){function a(b,c,d){this.name=b;this.parseFn=c;this.stringifyFn=d}a.prototype={getName:function(){return this.name},parse:function(a,b,c){var d=new u;this.parseFn(a,b,c).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d},stringify:function(a,b){if(!this.stringifyFn)return a.name;var c=new u;this.stringifyFn(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)});
return c}};return a}(),ma=function(){function a(b){this.root=b}a.prototype={getRoot:function(a){a(this.root)},getChildren:function(a,b){b(a.values)},getId:function(a){return a.elementId}};return a}(),ja=function(){function a(){}a.prototype={getTwistieElementId:function(a){return a+"__expand"},initTable:function(){},labelColumnIndex:function(){return 0},render:function(a,b){b.className+=" treeTableRow";var c=document.createElement("td");b.appendChild(c);if(a.value)c=document.createElement("td"),b.appendChild(c),
c.textContent=a.name,c=document.createElement("td"),b.appendChild(c),c.textContent=a.value;else{var d=document.createElement("span");c.appendChild(d);c=document.createElement("span");c.id=this.getTwistieElementId(b.id);d.appendChild(c);c.className="modelDecorationSprite core-sprite-closedarrow";c.onclick=function(){this.tableTree.toggle(b.id)}.bind(this);c=document.createElement("td");b.appendChild(c);d=document.createElement("b");c.appendChild(d);d.textContent=a.name;if(a.id)d=document.createElement("span"),
c.appendChild(d),d.textContent=" ("+a.id+")";c.colSpan="2"}},updateExpandVisuals:function(a,b){var c=document.getElementById(this.getTwistieElementId(a.id));if(c){var d=c.className;b?(d+=" core-sprite-openarrow",d=d.replace(/\s?core-sprite-closedarrow/g,"")):(d+=" core-sprite-closedarrow",d=d.replace(/\s?core-sprite-openarrow/g,""));c.className=d}}};return a}(),$=function(a,b){var c=b;try{c=JSON.parse(b.responseText)}catch(d){}c&&c.Message?c=n.formatMessage(i["Error: ${0}"],c.Message):typeof b.url===
"string"&&(c=b.status===0?n.formatMessage(i.NoResponseFromServer,b.url):n.formatMessage(i.ServerError,b.url,b.status,b.statusText));var e=document.createElement("span");e.textContent=c;a.reject(e)};e.startup().then(function(e){Q=e.pluginRegistry;G=e.serviceRegistry;S=e.preferences;e=new c.CommandRegistry({});ea=new g.FileClient(G);var f=new b.Searcher({serviceRegistry:G,commandService:e,fileService:ea}),h=new x.OperationsClient(G);new s.StatusReportingService(G,h,"statusPane","notifications","notificationArea");
new z.ProgressService(G,h,e);k.generateBanner("orion-shellPage",G,e,S,f);k.setPageTarget({task:i.Shell,serviceRegistry:G,commandService:e});O=document.getElementById("shell-output");var e=document.getElementById("shell-input"),j=new a.Shell({input:e,output:O});O.onmousedown=function(a){O.onmouseup=null;if(a.button===0&&a.target.tagName.toUpperCase()==="DIV")O.onmouseup=function(b){O.onmouseup=null;b.target===a.target&&Math.abs(b.clientX-a.clientX)<=2&&Math.abs(b.clientY-a.clientY)<=2&&j.setFocusToInput()}};
var q=v.matchResourceParameters(window.location.href);if(q.command)j.setInputText(q.command),delete q.command,e=(new t(ka)).expand(q),window.location.href=e;j.setFocusToInput();E=new d.ShellPageFileService;var r=function(a,b){var c=function(a){y(a.Location,b);E.setCurrentDirectory(a);a=E.computePathString(a);j.output(D(a,!0))};a?E.loadWorkspace(a).then(c,function(){E.loadWorkspace(Z).then(c)}):E.loadWorkspace(Z).then(c)};q.resource&&q.resource.indexOf("projectfor=")===0?(e=q.resource.substring(11),
ea.read(e,!0).then(function(a){a.Directory===void 0?r(null,!0):a.Parents&&a.Parents.length>0?r(a.Parents[a.Parents.length-1].Location,!0):r(a.Location,!0)},function(){r(null,!0)})):r(C(),!0);fa=new l.ParamTypeFile(E);j.registerType(fa);X=new m.ParamTypePlugin(Q);j.registerType(X);e=new o.ParamTypeService(Q);j.registerType(e);j.registerCommand({name:"cd",description:i["Changes the current directory"],callback:H,parameters:[{name:"directory",type:{name:"file",directory:!0,exist:!0},description:i["The name of the directory"]}],
returnType:"html"});j.registerCommand({name:"edit",description:i["Edits a file"],callback:I,parameters:[{name:"file",type:{name:"file",file:!0,exist:!0},description:i["The name of the file"]}]});j.registerCommand({name:"ls",description:i["Lists the files in the current directory"],callback:N,returnType:"html"});j.registerCommand({name:"pwd",description:i["Prints the current directory location"],callback:R,returnType:"html"});j.registerCommand({name:"clear",description:i["Clears the shell screen"],
callback:function(){j.clear()}});j.registerCommand({name:"plugins",description:i["Commands for working with plug-ins"]});j.registerCommand({name:"plugins list",description:i["Lists all registered plug-ins"],callback:ca,returnType:"html"});j.registerCommand({name:"plugins install",description:i["Installs a plug-in from a URL"],callback:U,parameters:[{name:"url",type:"string",description:i["The plug-in URL"]}],returnType:"string"});j.registerCommand({name:"plugins uninstall",description:i["Uninstalls a contributed plug-in from the configuration"],
callback:W,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],returnType:"string"});j.registerCommand({name:"plugins reload",description:i["Reloads a plug-in"],callback:V,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!1},description:i["The name of the plug-in"]}],returnType:"string"});j.registerCommand({name:"plugins enable",description:i["Enables a contributed plug-in"],callback:da,
parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],returnType:"string"});j.registerCommand({name:"plugins disable",description:i["Disables a contributed plug-in"],callback:L,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],returnType:"string"});j.registerCommand({name:"plugins services",description:i["Displays a plug-in's services"],
callback:ba,parameters:[{name:"plugin",type:{name:"plugin",multiple:!1,excludeDefaultPlugins:!1},description:i["The name of the plug-in"]}],returnType:"html"});j.registerCommand({name:"service",description:i["Commands for working with a service"]});j.registerCommand({name:"service contributors",description:i["Displays all plug-in contributions for a service"],callback:J,parameters:[{name:"id",type:"service",description:i["The service identifier"]}],returnType:"html"});ia=new w.ContentTypeService(G);
G.getService("orion.core.contenttypes").getContentTypes().then(function(a){for(var b=p._createOpenWithCommands(G,a),c=function(a){P.push(a)},d=0;d<b.length;d++)p._createCommandOptions(b[d].properties,b[d].service,G,a,!0).then(c)});e=G.getServiceReferences("orion.shell.type");for(f=0;f<e.length;++f){var h=e[f],u=G.getService(h);u&&(h=new na(h.getProperty("name"),ha(u.parse),ha(u.stringify)),j.registerType(h))}for(var e=G.getServiceReferences("orion.shell.command"),A=G.getService("orion.page.progress"),
f=0;f<e.length;++f)if(h=e[f],u=G.getService(h)){for(var q=h.getProperty("parameters")||[],B,F=0;F<q.length;F++)if(q[F].name==="output"){B=!0;break}B||q.push({name:"output",type:{name:"file",file:!0,directory:!0},description:i["The file or directory to re-direct output to"],defaultValue:null});var K=h.getProperty("returnType")||"string";h.getProperty("nls")&&h.getProperty("descriptionKey")?n.getMessageBundle(h.getProperty("nls")).then(function(a,b){var c=a.getProperty("name");j.registerCommand({name:c,
description:b[a.getProperty("descriptionKey")],callback:M(u,c,A,K,!B),returnType:"html",parameters:q,manual:b[a.getProperty("manual")]})},h):(F=h.getProperty("name"),j.registerCommand({name:F,description:h.getProperty("description"),callback:M(u,F,A,K,!B),returnType:"html",parameters:q,manual:h.getProperty("manual")}))}window.addEventListener("hashchange",function(){if(ga)ga=!1;else{var a=window.location.hash.substring(1);a.length===0&&(a=Z);E.loadWorkspace(a).then(function(a){if(E.getCurrentDirectory().Location!==
a.Location){E.setCurrentDirectory(a);var b=E.computePathString(a);j.output(D(b,!1));y(a.Location,!1)}},function(){y(E.getCurrentDirectory().Location,!0)})}})})});