/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2012, 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:
     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, 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
*/
(function(){function k(c,d,h,b,a,l){d[c]&&(h.push(c),(!0===d[c]||1===d[c])&&b.push(a+c+"/"+l))}function g(c,d,h,b,a){d=b+d+"/"+a;require._fileExists(c.toUrl(d+".js"))&&h.push(d)}function n(c,d,h){for(var b in d)d.hasOwnProperty(b)&&(!c.hasOwnProperty(b)||h)?c[b]=d[b]:"object"===typeof d[b]&&n(c[b],d[b],h)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var m=c.config?c.config():{},m=m||{};return{version:"2.0.1+",load:function(c,b,a,l){l=l||{};l.locale&&(m.locale=
l.locale);var f=d.exec(c),e=f[1],p=f[4],s=f[5],q=p.split("-"),r=[],w={},u,z="";f[5]?(e=f[1],c=e+s):(s=f[4],p=m.locale,p||(p=m.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),q=p.split("-"));if(l.isBuild){r.push(c);g(b,"root",r,e,s);for(u=0;u<q.length;u++)l=q[u],z+=(z?"-":"")+l,g(b,z,r,e,s);b(r,function(){a()})}else b([c],function(l){var f=[],p;k("root",l,f,r,e,s);for(u=0;u<q.length;u++)p=q[u],z+=(z?"-":"")+p,k(z,l,f,r,e,s);b(r,function(){var p,
c,h;for(p=f.length-1;-1<p&&f[p];p--){h=f[p];c=l[h];if(!0===c||1===c)c=b(e+h+"/"+s);n(w,c)}a(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,g,n,d){d=d||{};var c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,m=c.exec(k);if(m){if(!g.defined||g.defined(k))try{n(g(k));return}catch(h){}if(d.isBuild||d.isTest)n({});else if(g.specified&&!g.specified("orion/bootstrap"))n({});else{var b=m[1],a=m[3]?m[2]:"",l=m[3]||m[2];g(["orion/bootstrap"],function(f){f.startup().then(function(e){var f=e.serviceRegistry;e=f.getServiceReferences("orion.i18n.message");if(a)e.some(function(a){return k===a.getProperty("name")?
(f.getService(a).getMessageBundle().then(function(a){n(a)},function(){n({})}),!0):!1})||n({});else{var h={},q;e.forEach(function(e){var f=e.getProperty("name");if((m=c.exec(f))&&b===m[1]&&l===(m[3]||m[2]))if(a=m[3]?m[2]:""){if((e=d.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===e.toLowerCase().indexOf(a.toLowerCase()))h[a]=!0,(!g.specified||!g.specified(f))&&define(f,["orion/i18n!"+f],function(a){return a})}else q=e});!g.specified||!g.specified(k)?q?
f.getService(q).getMessageBundle().then(function(a){Object.keys(h).forEach(function(e){"undefined"===typeof a[e]&&(a[e]=h[e])});define(k,[],a);n(a)},function(){define(k,[],h);n(h)}):(define(k,[],h),n(h)):n(h)}})})}}else n(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 the Shell page with this folder as the current directory.","'${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(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
(function(){function k(){for(var c=navigator.userAgent,d={browser:!1,version:!1},h=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],b=0;b<h.length;b++){var a=h[b],l=c.match(a.regExp);if(l){d.browser=
!0;d.version=l[1]>=a.minVersion;d.name=a.name;break}}return d}function g(){try{return"localStorage"in window&&null!==window.localStorage}catch(c){return!1}}function n(c){alert(c);throw Error("unsupported browser");}var d=k();if(d.browser)d.version||n("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.name+".\n");else if(g()&&!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 g()||n("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:k,supportsLocalStorage:g,throwBrowserAlert:n}})();define("orion/browserCompatibility",function(){});
(function(k,g){"function"===typeof define&&define.amd?define("orion/Deferred",g):"object"===typeof exports?module.exports=g():(k.orion=k.orion||{},k.orion.Deferred=g())})(this,function(){function k(){for(var b;b=c.shift();)b();m=!1}function g(b){c.push(b);m||(m=!0,h())}function n(b){return function(a){b(a)}}function d(){function b(){for(var a;a=c.shift();){var l=a.deferred,b="fulfilled"===p?"resolve":"reject";a=a[b];if("function"===typeof a)try{var f=a(e),h=f&&("object"===typeof f||"function"===typeof f)&&
f.then;if("function"===typeof h)if(f===l.promise)l.reject(new TypeError);else{var d=f.cancel;"function"===typeof d?l._parentCancel=d.bind(f):delete l._parentCancel;h.call(f,n(l.resolve),n(l.reject),n(l.progress))}else l.resolve(f)}catch(q){l.reject(q)}else l[b](e)}}function a(a){delete h._parentCancel;p="rejected";e=a;c.length&&g(b)}function l(f){function m(a){return function(e){(!p||"assumed"===p)&&a(e)}}delete h._parentCancel;try{var k=f&&("object"===typeof f||"function"===typeof f)&&f.then;if("function"===
typeof k)if(f===h)a(new TypeError);else{p="assumed";var n=f&&f.cancel;if("function"!==typeof n){var t=new d;f=t.promise;try{k(t.resolve,t.reject,t.progress)}catch(v){t.reject(v)}n=f.cancel;k=f.then}e=f;k.call(f,m(l),m(a));h._parentCancel=n.bind(f)}else p="fulfilled",e=f,c.length&&g(b)}catch(y){m(a)(y)}}function f(){var e=h._parentCancel;e?(delete h._parentCancel,e()):p||(e=Error("Cancel"),e.name="Cancel",a(e))}var e,p,c=[],h=this;this.resolve=function(a){p||l(a);return h};this.reject=function(e){p||
a(e);return h};this.progress=function(a){p||c.forEach(function(e){if(e.progress)try{e.progress(a)}catch(l){}});return h.promise};this.cancel=function(){h._parentCancel?setTimeout(f,0):f();return h};this.then=function(a,e,l){var f=new d;f._parentCancel=h.promise.cancel;c.push({resolve:a,reject:e,progress:l,deferred:f});("fulfilled"===p||"rejected"===p)&&g(b);return f.promise};this.promise={then:h.then,cancel:h.cancel}}var c=[],m=!1,h=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(k)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(k)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(k,0)}}();d.all=function(b,a){function l(a,l){c||(p[a]=l,0===--e&&h.resolve(p))}function f(e,b){if(!c){if(a)try{l(e,a(b));return}catch(f){b=f}h.reject(b)}}var e=b.length,p=[],c=!1,h=new d;h.then(void 0,function(){c=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===e?h.resolve(p):b.forEach(function(a,e){a.then(l.bind(void 0,e),f.bind(void 0,e))});return h.promise};d.when=function(b,a,l,f){var e;b&&"function"===typeof b.then||(e=new d,e.resolve(b),b=e.promise);return b.then(a,l,f)};return d});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var k=this._namedListeners[g.type];k&&k.forEach(function(d){try{"function"===typeof d?d(g):d.handleEvent(g)}catch(c){"undefined"!==typeof console&&console.log(c)}});return!g.defaultPrevented},addEventListener:function(g,k){if("function"===typeof k||k.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(k)},
removeEventListener:function(g,k){var d=this._namedListeners[g];if(d)for(var c=0;c<d.length;c++)if(d[c]===k){1===d.length?delete this._namedListeners[g]:d.splice(c,1);break}}};k.prototype.constructor=k;k.attach=function(g){var n=new k;g.dispatchEvent=n.dispatchEvent.bind(n);g.addEventListener=n.addEventListener.bind(n);g.removeEventListener=n.removeEventListener.bind(n)};return k});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(k,g){function n(b,a,l){this._properties=l||{};this._properties["service.id"]=b;this._properties.objectClass=a;this._properties["service.names"]=a}function d(b,a,l){this._serviceId=b;this._serviceReference=a;this._internalRegistry=l}function c(b,a){function l(e){return function(){var l;try{if(!a())throw Error("Service was unregistered");var f=b[e].apply(b,Array.prototype.slice.call(arguments));if(f&&"function"===typeof f.then)return f;
l=new k;l.resolve(f)}catch(c){l=new k,l.reject(c)}return l.promise}}for(var f in b)"function"===typeof b[f]&&(this[f]=l(f))}function m(b,a){this.type=b;this.serviceReference=a}function h(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new g;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var l=b._entries[a];if(!l)throw Error("Service has already been unregistered: "+a);var f=l.reference;b._serviceEventTarget.dispatchEvent(new m("unregistering",
f));b._entries[a]=null;f.getProperty("objectClass").forEach(function(a){for(var l=b._namedReferences[a],c=0;c<l.length;c++)if(l[c]===f){1===l.length?delete b._namedReferences[a]:l.splice(c,1);break}})},modifyService:function(a){var l=b._entries[a];if(!l)throw Error("Service not found while trying to send modified event: "+a);b._serviceEventTarget.dispatchEvent(new m("modified",l.reference))}}}n.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]}};n.prototype.constructor=n;d.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(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)}};d.prototype.constructor=d;h.prototype={getService:function(b){var a;if("string"===typeof b)(b=this._namedReferences[b])&&b.some(function(l){a=this._entries[l.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(l){l&&a.push(l.reference)});return a},registerService:function(b,a,l){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof b?b=[b]:Array.isArray(b)||(b=[]);var f=this._entries.length,e=new n(f,b,l),p=this._namedReferences;b.forEach(function(a){p[a]=p[a]||[];p[a].push(e)});b=new c(a,this._internalRegistry.isRegistered.bind(null,f));this._entries.push({reference:e,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new m("registered",
e));return new d(f,e,b)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};h.prototype.constructor=h;return{ServiceRegistry:h}});
define("orion/xhr",["orion/Deferred"],function(k){function g(g,d,c,m){var h="undefined"!==typeof c.response?c.response:c.responseText,b;try{b=c.status}catch(a){b=0}g={args:d,response:h,responseText:"string"===typeof h?h:null,status:b,url:g,xhr:c};"undefined"!==typeof m&&(g.error=m);return g}return function(n,d,c){c=c||{};var m=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,h=new k,b=c.headers||{},a=c.log||!1,l;"undefined"===typeof b["X-Requested-With"]&&(b["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof c.data&&("POST"===n||"PUT"===n))l=c.data;var f=!1,e=!1;h.promise.then(void 0,function(a){f=!0;!e&&(a instanceof Error&&"Cancel"===a.name)&&m.abort()});m.onabort=function(){e=!0;if(!f){var a=Error("Cancel");a.name="Cancel";h.reject(a)}};m.onload=function(){var e=g(d,c,m);200<=m.status&&400>m.status?h.resolve(e):(h.reject(e),a&&"undefined"!==typeof console&&console.log(Error(m.statusText)))};m.onerror=function(){var e=g(d,c,m);h.reject(e);a&&"undefined"!==typeof console&&console.log(Error(m.statusText))};
m.onprogress=function(a){a.xhr=m;h.progress(a)};try{m.open(n,d,!0);"string"===typeof c.responseType&&(m.responseType=c.responseType);if("number"===typeof c.timeout)if("number"===typeof m.timeout)m.timeout=c.timeout,m.addEventListener("timeout",function(a){h.reject(g(d,c,m,"Timeout exceeded"))});else{var p=setTimeout(function(){h.reject(g(d,c,m,"Timeout exceeded"))},c.timeout);h.promise.then(clearTimeout.bind(null,p),clearTimeout.bind(null,p))}Object.keys(b).forEach(function(a){m.setRequestHeader(a,
b[a])});m.send(l||null)}catch(s){h.reject(g(d,c,m,s))}return h.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(k,g,n){function d(a,b){this._name=a;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function c(a,b){return{get:function(e,p){if(0===b)return null;var c=localStorage.getItem(a+e);if(null===c)return null;c=JSON.parse(c);return p||-1===b||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(e,p){if(0!==b)if(-1!==b&&(p._expires=(new Date).getTime()+
1E3*b),0===Object.keys(p).length)localStorage.removeItem(a+e);else{var c=JSON.stringify(p);localStorage.setItem(a+e,c);delete p._expires}},remove:function(e){localStorage.removeItem(a+e)}}}function m(a){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=a.getServiceReferences("orion.core.preference.provider");0<b.length&&(this._service=a.getService(b[0]))}return!!this._service}}function h(a){this._location=
a;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function b(){this._cache=new c("/orion/preferences/local",-1)}function a(a,f){this._userProvider=new m(a);this._localProvider=new b;f=f||"defaults.pref";-1===f.indexOf("://")&&(f=k.toUrl(f));this._defaultsProvider=new h(f);this._serviceRegistration=a.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],b=0;b<this._stores.length;++b){var e=this._stores[b];-1!==this._dirty.indexOf(e)&&
a.push(this._providers[b].put(this._name,e));if(this._pendingDeletes[b]&&0<this._pendingDeletes[b].length){for(e=0;e<this._pendingDeletes[b].length;e++)a.push(this._providers[b].remove(this._name,this._pendingDeletes[b][e]));delete this._pendingDeletes[b]}}this._dirty=[];return g.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){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 b=this._stores[a],e;for(e in b)b.hasOwnProperty(e)&&"undefined"===typeof this._cached[e]&&(this._cached[e]=b[e])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(0!==this._stores.length){var e=this._stores[0];e[a]!==b&&(e[a]=b,this._cached=null,this._scheduleFlush(e))}},remove:function(a){for(var b=0;b<
this._stores.length;++b){var e=this._stores[b];if(e.hasOwnProperty(a))return delete e[a],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,e=[],p=0;p<this._providers.length;++p)e.push(this._providers[p].get(this._name,
a).then(function(a){return function(e){b._stores[a]=e}}(p)));return g.all(e).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};m.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var e=new g,p=null;b?this._cache.remove(a):p=this._cache.get(a);if(null!==p)e.resolve(p);else{this._currentPromises[a]=e;var c=this;this._service.get(a).then(function(b){c._cache.set(a,b);delete c._currentPromises[a];e.resolve(b)},function(b){404===b.status?
(b={},c._cache.set(a,b),delete c._currentPromises[a],e.resolve(b)):(delete c._currentPromises[a],e.resolve(c._cache.get(a,!0)||{}))})}return e},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)},remove:function(a,b){var e=this._cache.get(a);delete e[b];this._cache.set(a,e);return this._service.remove(a,b)}};h.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;var e=new g,c=null;b?this._cache.remove(a):c=this._cache.get(a);if(null!==c)e.resolve(c);else{this._currentPromise=
e;var h=this;n("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);h._cache.set(a,b[a]||{});h._currentPromise=null;e.resolve(b[a]||{})},function(b){401===b.xhr.status||404===b.xhr.status?(h._cache.set(a,{}),h._currentPromise=null,e.resolve({})):(h._currentPromise=null,b=h._cache.get(a,!0),null!==b?e.resolve(b[a]||{}):e.resolve({}))})}return e},put:function(a,b){var e=new g;e.resolve();return e},remove:function(a,b){var e=this._cache.get(a);
delete e[b];this.put(a,e)}};b.prototype={get:function(a){var b=new g;a=this._cache.get(a);null!==a?b.resolve(a):b.resolve({});return b},put:function(a,b){var e=new g;this._cache.set(a,b);e.resolve();return e},remove:function(a,b){var e=this._cache.get(a);delete e[b];this.put(a,e)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(b,f,e){if(!f||"number"!==typeof f||7<f||1>f)e=f,f=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
e,!1);return 0!==(a.USER_SCOPE&f)?"/orion/preferences/user"+b:0!==(a.LOCAL_SCOPE&f)?"/orion/preferences/local"+b:"/orion/preferences/default"+b},getPreferences:function(b,f){if(!f||"number"!==typeof f||7<f||1>f)f=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var e=[];a.USER_SCOPE&f&&this._userProvider.available()&&e.push(this._userProvider);a.LOCAL_SCOPE&f&&e.push(this._localProvider);a.DEFAULT_SCOPE&f&&e.push(this._defaultsProvider);var c=new d(b,e);return c.sync().then(function(){return c})},getSetting:function(a,
b,e){for(var c,h=0;h<a.length;h++)if(a[h].label===b)for(var d=0;d<a[h].data.length;d++)if(a[h].data[d].label===e){c=a[h].data[d].value;break}return c}};return{PreferencesService:a}});
(function(){function k(a){if("string"!==typeof a)throw new TypeError;}function g(a){return a?a.split("\x26"):[]}function n(a){return 0===a.length?"":a.join("\x26")}function d(a){var e=/([^=]*)(?:=?)(.*)/.exec(a);a=e[1]?decodeURIComponent(e[1]):"";e=e[2]?decodeURIComponent(e[2]):"";return[a,e]}function c(a){var e=encodeURIComponent(a[0]);a[1]&&(e+="\x3d"+encodeURIComponent(a[1]));return e}function m(a,e){var b="",l=[],f=0;return{next:function(){b!==a.query&&(b=a.query,l=g(b));if(f<l.length){var c=
d(l[f++]);switch(e){case "keys":return c[0];case "values":return c[1];case "keys+values":return[c[0],c[1]];default:throw new TypeError;}}throw J;}}}function h(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function b(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var e=[];a.split("/").forEach(function(a){".."===a?e.pop():"."!==a&&e.push(a)});return e.join("/")}function l(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function f(e,f){if("string"!==
typeof e)throw new TypeError;e=l(e);var c=q.exec(e);if(!c)return null;var p={};p.scheme=c[1]||"";if(p.scheme&&!w.test(p.scheme))return null;var h=c[2];if(h&&(h=r.exec(h),p.userinfo=h[1],p.host=h[2],p.port=h[3],p.port&&!u.test(p.port)))return null;p.path=c[3];p.query=c[4];p.fragment=c[5];!p.scheme&&f&&(p.scheme=f.scheme,!p.host&&f.host&&(p.userinfo=f.userinfo,p.host=f.host,p.port=f.port,p.pathRelative=!0));p.pathRelative&&(p.path?"/"!==p.path[0]&&(c=/^(.*\/)[^\/]*$/.exec(f.path)[1]||"/",p.path=c+p.path):
p.path=f.path);p.scheme&&(p.scheme=p.scheme.toLowerCase());p.port&&(p.port=b(p.port));p.host&&p.path&&(p.path=a(p.path));return p}function e(a,e){var b;if(e){e=e.href||e;b=f(e);if(!b||!b.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:b})}b=f(a,b);if(!b)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:b,writable:!0});var l=new h(this);Object.defineProperty(this,"query",{get:function(){return this._url?
l:null},enumerable:!0})}try{var p;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(p=new window.URL("http://www.w3.org?q")).protocol&&p.query)return}catch(s){}var q=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,r=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,z=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,y=/^([^\s]*)$/,H=/^\S*$/,A=/([^:]*):?(.*)/,J="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),E={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(h.prototype,{get:{value:function(a){k(a);var e;g(this._url.query).some(function(b){b=d(b);if(b[0]===a)return e=b[1],!0});return e},enumerable:!0},set:{value:function(a,e){k(a);k(e);var b=g(this._url.query);b.some(function(l,f){var p=d(l);if(p[0]===a)return p[1]=e,b[f]=c(p),!0})||b.push(c([a,e]));this._url.query=n(b)},enumerable:!0},has:{value:function(a){k(a);
return g(this._url.query).some(function(e){if(d(e)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){k(a);var e=g(this._url.query),b=e.filter(function(e){return d(e)[0]!==a});return b.length!==e.length?(this._url.query=n(b),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,e){if("function"!==typeof a)throw new TypeError;var b=m(this._url,"keys+values");try{for(;;){var l=b.next();a.call(e,l[1],l[0],this)}}catch(f){if(f!==J)throw f;
}},enumerable:!0},keys:{value:function(){return m(this._url,"keys")},enumerable:!0},values:{value:function(){return m(this._url,"values")},enumerable:!0},items:{value:function(){return m(this._url,"keys+values")}},size:{get:function(){return g(this._url.query).length},enumerable:!0},getAll:{value:function(a){k(a);var e=[];g(this._url.query).forEach(function(b){b=d(b);b[0]===a&&e.push(b[1])});return e},enumerable:!0},append:{value:function(a,e){k(a);k(e);var b=g(this._url.query);b.push(c([a,e]));this._url.query=
n(b)},enumerable:!0}});Object.defineProperties(e.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var e=a.scheme?a.scheme+":":"";a.host&&(e+="//",a.userinfo&&(e+=a.userinfo+"@"),e+=a.host,a.port&&(e+=":"+a.port));e+=a.path;a.query&&(e+="?"+a.query);a.fragment&&(e+="#"+a.fragment);a=e}else a=this._input;return a},set:function(a){k(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){k(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||w.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){k(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){k(a);if(this._url){var e=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];e[2]&&a.push(e[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){k(a);if(this._url){var e=[A.exec(this._userinfo)[1]||""];a&&e.push(encodeURIComponent(a));this._userinfo=e.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){k(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=b(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){k(a);this._url&&z.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===E[this.protocol]&&(a="");return a},set:function(a){k(a);this._url&&u.exec(a)&&(this._url.port=b(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(e){k(e);
this._url&&v.exec(e)&&(this._url.host&&(e&&"/"!==e[0])&&(e="/"+e),this._url.path=e?a(e):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){k(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),y.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){k(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),H.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((p=window.URL||window.webkitURL)&&p.createObjectURL)Object.defineProperty(e,"createObjectURL",{value:p.createObjectURL.bind(p),enumerable:!1}),Object.defineProperty(e,"revokeObjectURL",{value:p.revokeObjectURL.bind(p),enumerable:!1});window.URL=e})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(k,g){function n(a,b){var l=Object.keys(a),f=Object.keys(b);if(l.length!==f.length)return!1;l.sort();f.sort();for(var c=0,h=l.length;c<h;c++){var d=l[c];if(d!==f[c])return!1;var m=a[d],d=b[d];if(m!==d&&JSON.stringify(m)!==JSON.stringify(d))return!1}return!0}function d(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(b){}return a}function c(a){var b=null,l={key:function(l){return(b=
b||Object.keys(a))[l]},getItem:function(b){return a[b]},setItem:function(l,f){a[l]=f;b=null},removeItem:function(l){delete a[l];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}};Object.defineProperty(l,"length",{get:function(){return(b=b||Object.keys(a)).length}});return l}function m(a,b){if(b&&b instanceof XMLHttpRequest){var l,f;try{l=b.status,f=b.statusText}catch(c){l=0,f=""}return{status:l||0,statusText:f}}return b}function h(a){var b=a?JSON.parse(JSON.stringify(a,
m)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function b(a,b){this.type=a;this.plugin=b}function a(a,b){this.__objectId=a;this.__methods=b}function l(e,l,f){function c(a){K&&f.postMessage(a,K)}function d(e){if(!K)return(new k).reject(Error("plugin not connected"));e.id=String($++);var b=new k;R[e.id]=b;b.then(null,function(a){"active"===B&&(a instanceof Error&&"Cancel"===a.name)&&c({requestId:e.id,method:"cancel",params:a.message?[a.message]:
[]})});var l=Object.prototype.toString;e.params.forEach(function(f,c){if("[object Object]"===l.call(f)&&!(f instanceof a)){var p,h;for(p in f)"[object Function]"===l.call(f[p])&&(h=h||[],h.push(p));if(h){var d=Y++;S[d]=f;p=function(){delete S[d]};b.then(p,p);e.params[c]=new a(d,h)}}});f.postMessage(e,K);return b.promise}function m(a,e){a||0===a?c({id:a,result:null,error:e}):console.log(e)}function u(a,e,b,l){l.forEach(function(a,e){if(a&&"undefined"!==typeof a.__objectId){var b={};a.__methods.forEach(function(e){b[e]=
function(){return d({objectId:a.__objectId,method:e,params:Array.prototype.slice.call(arguments)})}});l[e]=b}});var f=void 0===typeof a?null:{id:a,result:null,error:null};try{var p=b.apply(e,l);f&&(p&&"function"===typeof p.then?(T[a]=p,p.then(function(e){delete T[a];f.result=e;c(f)},function(e){T[a]&&(delete T[a],f.error=h(e),c(f))},function(){c({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(f.result=p,c(f)))}catch(m){f&&(f.error=h(m),c(f))}}function z(a){try{if(a.method){var e=
a.method,b=a.params||[];if("serviceId"in a){var l=ca[a.serviceId];l||m(a.id,"service not found");e in l?u(a.id,l,l[e],b):m(a.id,"method not found")}else if("objectId"in a){var c=S[a.objectId];c||m(a.id,"object not found");e in c?u(a.id,c,c[e],b):m(a.id,"method not found")}else if("requestId"in a){var p=T[a.requestId];p&&("cancel"===e&&p.cancel)&&p.cancel.apply(p,b)}else if("responseId"in a){var h=R[a.responseId];h&&("progress"===e&&h.progress)&&h.progress.apply(h,b)}else if("plugin"===a.method){K.connected();
var d=a.params[0];U({headers:d.headers,services:d.services}).then(function(){G&&G.resolve(A)})}else if("timeout"===a.method)G&&G.reject(a.error);else throw Error("Bad method: "+a.method);}else{var r=R[String(a.id)];delete R[String(a.id)];if(a.error){var q=f.handleServiceError(A,a.error);r.reject(q)}else r.resolve(a.result)}}catch(g){console.log("Plugin._messageHandler "+g)}}function t(e){var b={};if(e.methods&&(e.methods.forEach(function(a){b[a]=function(){var b={serviceId:e.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===B?d(b):A.start({"transient":!0}).then(function(){return d(b)})}}),b.addEventListener&&b.removeEventListener)){var l=new g,f=Y++;S[f]={handleEvent:l.dispatchEvent.bind(l)};var c=new a(f,["handleEvent"]),p=b.addEventListener;b.addEventListener=function(a,e){l._namedListeners[a]||p(a,c);l.addEventListener(a,e)};var h=b.removeEventListener;b.removeEventListener=function(a,e){l.removeEventListener(a,e);l._namedListeners[a]||h(a,c)}}return b}function v(a){var b=JSON.parse(JSON.stringify(a.properties));
b.__plugin__=e;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);b.objectClass=a;return b}function y(a){var e=t(a),b=v(a),b=f.registerService(a.names||a.type,e,b);L[a.serviceId]={registration:b,proxy:e}}function H(){f.persist(e,{created:J,headers:E,services:C,autostart:x,lastModified:D})}var A=this;l=l||{};var J=l.created||(new Date).getTime(),E=l.headers||{},C=l.services||[],x=l.autostart,D=l.lastModified||0,B="installed",I,G,K,Q,L={},$=0,Y=0,T={},R={},S={},ca={},U;this._default=!1;this._persist=H;
this._resolve=function(){B="resolved";f.dispatchEvent(new b("resolved",A))};this._getAutostart=function(){return x};this._getCreated=function(){return J};this.getLocation=function(){return e};this.getHeaders=function(){return JSON.parse(JSON.stringify(E))};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 D};this.getServiceReferences=function(){var a=
[];Object.keys(L).forEach(function(e){a.push(L[e].registration.getReference())});return a};this.setParent=function(a){return Q!==a?(Q=a,A.stop({"transient":!0}).then(function(){if("started"===x)return A.start({"transient":!0});if("lazy"===x)return A.start({lazy:!0,"transient":!0})})):(new k).resolve()};this.getState=function(){return B};this.start=function(a){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if(I)return I.promise.then(this.start.bind(this,a));if("active"===
B)return(new k).resolve();if(!a||!a.transient){var l=a&&a.lazy?"lazy":"started";l!==x&&(x=l,H())}l=f.getState();if("starting"!==l&&"active"!==l)return a.transient?(new k).reject(Error("start transient error")):(new k).resolve();if("installed"===B)try{this._resolve()}catch(c){return(new k).reject(c)}"resolved"===B&&C.forEach(function(a){y(a)});if(a&&a.lazy)return"starting"!==B&&(B="starting",f.dispatchEvent(new b("lazy activation",A))),(new k).resolve();var p=new k;I=p;B="starting";f.dispatchEvent(new b("starting",
A));G=new k;K=f.connect(e,z,Q);G.then(function(){G=null;B="active";f.dispatchEvent(new b("started",A));I=null;p.resolve()},function(){G=null;B="stopping";f.dispatchEvent(new b("stopping",A));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});f.disconnect(K);K=null;B="resolved";I=null;f.dispatchEvent(new b("stopped",A));p.reject(Error("Failed to load plugin: "+e));A._default&&(D=0,H())});return p.promise};this.stop=function(a){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));
if(I)return I.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==x)x="stopped",H();if("active"!==B&&"starting"!==B)return(new k).resolve();I=a=new k;B="stopping";f.dispatchEvent(new b("stopping",A));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});K&&(f.disconnect(K),K=null);B="resolved";I=null;f.dispatchEvent(new b("stopped",A));a.resolve();return a.promise};U=function(a){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));
if(!a)return 0===D&&(D=(new Date).getTime(),H()),f.loadManifest(e).then(U,function(){A._default&&(D=0,H());console.log("Failed to load plugin: "+e)});var l=E,c=C,p=x;E=a.headers||{};C=a.services||[];x=a.autostart||x;a.lastModified?D=a.lastModified:(D=(new Date).getTime(),H());if(n(E,l)&&n(C,c)&&x===p)return(new k).resolve();if("active"===B||"starting"===B){var h=[];Object.keys(C).forEach(function(a){var e=C[a];h.push(a);var b=L[a];if(b){if(n(e.methods,Object.keys(b.proxy))){a=v(e);var l=b.registration.getReference(),
f={};l.getPropertyKeys().forEach(function(a){f[a]=l.getProperty(a)});n(a,f)||b.registration.setProperties(a);return}b.registration.unregister();delete L[a]}y(e)});Object.keys(L).forEach(function(a){-1===h.indexOf(a)&&(L[a].registration.unregister(),delete L[a])})}"active"===B&&(f.disconnect(K),G=new k,K=f.connect(e,z,Q),G.then(function(){G=null},function(){G=null;B="stopping";f.dispatchEvent(new b("stopping"),A);Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});f.disconnect(K);
K=null;B="resolved";f.dispatchEvent(new b("stopped",A))}));return(new k).resolve()};this.update=function(a){return U(a).then(function(){f.dispatchEvent(new b("updated",A))})};this.uninstall=function(){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if("active"===B||"starting"===B||"stopping"===B)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));f.removePlugin(this);B="uninstalled";f.dispatchEvent(new b("uninstalled",A));return(new k).resolve()}}
var f=/^http[s]?/i;return{Plugin:l,PluginRegistry:function(a,p){function h(a){var e=a.source;n.some(function(b){if(e===b.target){try{var l;if("undefined"===typeof b.useStructuredClone){var f="string"!==typeof a.data;l=f?a.data:JSON.parse(a.data);b.useStructuredClone=f}else l=b.useStructuredClone?a.data:JSON.parse(a.data);b.handler(l)}catch(c){}return!0}})}p=p||{};var m=p.storage||localStorage;m.getItem||(m=c(m));var r="installed",w,u=[],n=[],t=new g,v={},y={registerService:a.registerService.bind(a),
connect:function(a,e,b,l){function f(a){a=Error(a);a.name="timeout";e({method:"timeout",error:a})}var c={handler:e,url:a},p=setTimeout(f.bind(null,"Load timeout for: "+a),l||15E3),h=document.createElement("iframe");h.name=a+"_"+(new Date).getTime();h.src=a;h.onload=function(){clearTimeout(p);p=setTimeout(f.bind(null,"Plugin handshake timeout for: "+a),5E3)};h.sandbox="allow-scripts allow-same-origin";h.style.width=h.style.height="100%";h.frameBorder=0;(b||w).appendChild(h);c.target=h.contentWindow;
c.connected=function(){clearTimeout(p)};c.close=function(){clearTimeout(p);if(h){var a=h.parentNode;a&&a.removeChild(h);h=null}};n.push(c);return c},disconnect:function(a){for(var e=0;e<n.length;e++)if(a===n[e]){n.splice(e,1);try{a.close()}catch(b){}break}},removePlugin:function(a){for(var e=0;e<u.length;e++)if(a===u[e]){u.splice(e,1);break}m.removeItem("plugin."+a.getLocation())},persist:function(a,e){m.setItem("plugin."+a,JSON.stringify(e))},postMessage:function(a,e){e.target.postMessage(e.useStructuredClone?
a:JSON.stringify(a),e.url)},dispatchEvent:function(a){try{t.dispatchEvent(a)}catch(e){console&&console.log("PluginRegistry.dispatchEvent "+e)}},loadManifest:function(a){var e=new k,b=y.connect(a,function(a){b&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],y.disconnect(b),b=null,e.resolve(a)):"timeout"===a.method&&(y.disconnect(b),b=null,e.reject(a.error)))});return e.promise},getState:function(){return r},handleServiceError:function(a,e){if(e&&401===e.status){var b=a.getHeaders(),
l=a.getName()||a.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+l+"."));b.login&&(c.appendChild(document.createTextNode(" ")),l=document.createElement("a"),l.target="_blank",l.textContent="Login",l.href=b.login,f.test(l.href)?(c.appendChild(l),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(c)}}if(e.__isError){var p=
e;e=Error(p.message);Object.keys(p).forEach(function(a){e[a]=p[a]});delete e.__isError}return e}};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=y.getState;this.init=function(){if(!("starting"===r||"active"===r||"stopping"===r)){addEventListener("message",h,!1);for(var a=[],e=0,b=m.length;e<b;e++)a.push(m.key(e));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var e=a.substring(7);a=JSON.parse(m.getItem(a));a.created&&u.push(new l(e,a,y))}});u.sort(function(a,e){return a._getCreated()<e._getCreated()?-1:1});p.parent?w=p.parent:(w=document.createElement("div"),p.visible||(w.style.display="none",w.style.visibility="hidden"),document.body.appendChild(w));p.plugins&&Object.keys(p.plugins).forEach(function(a){a=d(a);var e=this.getPlugin(a);e?e._default=!0:(e=p.plugins[a],"object"!==typeof e&&(e={}),e.autostart=e.autostart||p.defaultAutostart||
"lazy",e=new l(a,e,y),e._default=!0,u.push(e))}.bind(this));r="starting"}};this.start=function(){"starting"!==r&&this.init();if("starting"!==r)return(new k).reject("Cannot start framework. Framework is already "+r+".");var a=[],e=(new Date).getTime();u.forEach(function(b){var l=b._getAutostart();0===b.getLastModified()?a.push(b.update().then(function(){if("started"===l)return b.start({"transient":!0});if("lazy"===l)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===l?a.push(b.start({"transient":!0})):
"lazy"===l?(a.push(b.start({lazy:!0,"transient":!0})),e>b.getLastModified()+864E5&&b.update()):b._resolve()});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){r="active"})};this.stop=function(){if("starting"!==r&&"active"!==r)return(new k).reject("Cannot stop registry. Registry is already "+r+".");r="stopping";var a=[];u.forEach(function(e){a.push(e.stop({"transient":!0}))});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!p.parent){var a=
w.parentNode;a&&a.removeChild(w)}w=null;removeEventListener("message",h);r="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new k).reject("Cannot uninstall registry")};this.installPlugin=function(a,e){a=d(a);var f=this.getPlugin(a);if(f)return(new k).resolve(f);if(v[a])return v[a];if(e)return f=new l(a,e,y),u.push(f),f._persist(),y.dispatchEvent(new b("installed",f)),(new k).resolve(f);var c=y.loadManifest(a).then(function(e){f=new l(a,
e,y);u.push(f);f._persist();delete v[a];y.dispatchEvent(new b("installed",f));return f},function(e){delete v[a];throw e;});return v[a]=c};this.getPlugins=function(){return u.slice()};this.getPlugin=function(a){var e=null;a=d(a);u.some(function(b){if(a===b.getLocation())return e=b,!0});return e};this.addEventListener=t.addEventListener.bind(t);this.removeEventListener=t.removeEventListener.bind(t);this.resolvePlugins=function(){var a=!0;u.forEach(function(e){a=a&&e._resolve()});return a}}}});
define("orion/objects",[],function(){function k(g){for(var k=Object.prototype.hasOwnProperty,d=1,c=arguments.length;d<c;d++){var m=arguments[d],h;for(h in m)k.call(m,h)&&(g[h]=m[h])}return g}return{clone:function(g){if(Array.isArray(g))return Array.prototype.slice.call(g);var n=Object.create(Object.getPrototypeOf(g));k(n,g);return n},mixin:k,toArray:function(g){return Array.isArray(g)?g:[g]}}});
define("orion/serviceTracker",[],function(){function k(d,c){function m(e){var l=e.getProperty("service.id"),f=this.addingService(e);f&&(b[l]=e,a[l]=f)}function h(e){var l=e.getProperty("service.id"),f=a[l];delete b[l];delete a[l];this.removedService(e,f)}this.serviceRegistry=d;var b={},a={},l=g,f,e;this.close=function(){if(l!==n)throw"Already closed";l=g;d.removeEventListener("registered",f);d.removeEventListener("unregistering",e);e=f=null;var a=this;this.getServiceReferences().forEach(function(e){h.call(a,
e)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(b);return!a.length?null:a.map(function(a){return b[a]})};this.open=function(){if(l!==g)throw"Already open";l=n;var a=this;f=function(e){if(-1!==e.serviceReference.getProperty("objectClass").indexOf(c)&&(m.call(a,e.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(e.serviceReference,a.serviceRegistry.getService(e.serviceReference))};e=function(e){-1!==e.serviceReference.getProperty("objectClass").indexOf(c)&&
h.call(a,e.serviceReference)};d.addEventListener("registered",f);d.addEventListener("unregistering",e);d.getServiceReferences(c).forEach(function(e){m.call(a,e);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(e,d.getService(e))});if("function"===typeof this.onOpen)this.onOpen()}}var g=0,n=1;k.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(d,c){}};return k});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(k,g,n,d){var c=n.PreferencesService,m,h,b,a,l=c.DEFAULT_SCOPE,f="pid",e="/cm/configurations";m=function(a,e,b){function l(a,b,f){b.forEach(function(l,c){try{var h=a[c].getProperty("__plugin__"),p=h&&e.getPlugin(h);(!h||p&&"active"===p.getState())&&b[c].updated(f)}catch(d){"undefined"!==typeof console&&console.log(d)}})}d.call(this,a,"orion.cm.managedservice");var c={},h={},m=function(e){var l=
[];e.plugin.getServiceReferences().forEach(function(e){if(-1!==e.getProperty("objectClass").indexOf("orion.cm.managedservice")){var c=e.getProperty(f);e=a.getService(e);c&&e&&(c=(c=b._find(c))&&c.getProperties(),l.push(e.updated(c)))}});return k.all(l)};this.addingService=function(e){var b=e.getProperty(f),l=a.getService(e);if(!b||!l)return null;c[b]||(c[b]=[]);h[b]||(h[b]=[]);c[b].push(e);h[b].push(l);return l};this.onServiceAdded=function(a,e){var c=a.getProperty(f),c=b._find(c);l([a],[e],c&&c.getProperties())};
this.onOpen=function(){e.addEventListener("started",m)};this.onClose=function(){e.removeEventListener("started",m)};this.notifyUpdated=function(a){var e=a.getPid();l(c[e]||[],h[e]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();l(c[a]||[],h[a]||[],null)};this.removedService=function(a,e){var b=a.getProperty(f),l=c[b],p=h[b];1<l.length?l.splice(l.indexOf(a),1):delete c[b];1<p.length?p.splice(p.indexOf(e),1):delete h[b]}};n=function(){function a(e,l,f){this.store=new h(this,f);this.configAdmin=
new b(this,this.store);this.tracker=new m(e,l,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(e){a.tracker.open();return e})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(e,b){this.factory=e;this.store=b}a.prototype={_prefName:e,_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},
getDefaultConfiguration:function(a){return this.store._find(a,l)},listConfigurations:function(){return this.store.list()}};return a}();h=function(){function b(a,f){this.factory=a;this.prefsService=f;this.pref=this.configs=this.defaultConfigs=null;var c=this;this.initPromise=k.all([this.prefsService.getPreferences(e,l),this.prefsService.getPreferences(e)]).then(function(a){var e=a[0];c.pref=a[1];c.defaultConfigs=c._toConfigs(e,!0);c.configs=c._toConfigs(c.pref,!1,e)})}b.prototype={_toConfigs:function(e,
b,l){var c=Object.create(null),h=this;e.keys().forEach(function(p){if(!c[p]){var d=e.get(p),m=l&&l.get(p);"object"===typeof d&&(null!==d&&0<Object.keys(d).length)&&(d[f]=p,c[p]=new a(h.factory,h,d,b,m))}});return c},_init:function(){return this.initPromise},_find:function(a,e){return e===c.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(e){var b=this._find(e),f=this._find(e,l);b||(b=f&&f.getProperties(!0),b=new a(this.factory,this,e,!1,b),this.configs[e]=b);return b},
list:function(){var a=this,e=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&null!==b.getProperties()&&e.push(b)});return e},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,e){var b=e.getProperties(!0)||{},f=this._find(a,l);if(f){var c=f.getProperties(!0);Object.keys(c).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a)&&b[a]===c[a]&&delete b[a]})}this.pref.put(a,b)}};return b}();a=function(){function a(e,b){b=g.clone(b);delete b[f];e.properties=b}
function e(b,l,c,h,d){this.factory=b;this.store=l;this.readOnly=h;if(null!==c&&"object"===typeof c)this.pid=c[f],a(this,c);else if("string"===typeof c)this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);if(d){var m=this;Object.keys(d).forEach(function(a){a===f||Object.prototype.hasOwnProperty.call(m.properties,a)||(m.properties[a]=d[a])})}}e.prototype={_checkReadOnly:function(){if(this.readOnly)throw Error("Configuration is read only");},_checkRemoved:function(){if(this.removed)throw Error("Configuration was removed");
},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var e=null;this.properties&&(e=g.clone(this.properties),a||(e[f]=this.pid));return e},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(e){this._checkReadOnly();this._checkRemoved();a(this,e);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+
this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:n}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(k,g,n,d,c,m){var h;return{startup:function(){if(h)return h;h=new g;var b=new n.ServiceRegistry,a=new d.PreferencesService(b);return a.getPreferences("/plugins").then(function(l){var f={plugins:{}};l.keys().forEach(function(a){var e=k.toUrl(a);f.plugins[e]=l[a]});var e=new c.PluginRegistry(b,f);return e.start().then(function(){if(0<b.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=k.toUrl(a);e.getPlugin(a)||b.push(e.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return g.all(b,function(a){console.log(a)})})}).then(function(){return(new m.ConfigurationAdminFactory(b,e,a)).getConfigurationAdmin().then(b.registerService.bind(b,"orion.cm.configadmin"))}).then(function(){var a=b.getService("orion.core.auth");if(a){var e=a.getUser().then(function(e){if(e)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),l=localStorage.getItem("lastLogin");if(!l||l<(new Date).getTime()-9E5)return e}}).then(function(){var l={serviceRegistry:b,preferences:a,pluginRegistry:e};h.resolve(l);return l})})}}});
define("orion/util",[],function(){var k=navigator.userAgent,g=-1!==k.indexOf("MSIE")||-1!==k.indexOf("Trident")?document.documentMode:void 0,n=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,d=-1!==k.indexOf("Opera")?parseFloat(k.split("Version/")[1]):void 0,c=parseFloat(k.split("Chrome/")[1])||void 0,m=-1!==k.indexOf("Safari")&&!c,h=parseFloat(k.split("WebKit/")[1])||void 0,b=-1!==k.indexOf("Android"),a=-1!==k.indexOf("iPad"),k=-1!==k.indexOf("iPhone"),l=a||k,f=-1!==navigator.platform.indexOf("Mac"),
e=-1!==navigator.platform.indexOf("Win"),p=-1!==navigator.platform.indexOf("Linux"),s="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var e=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})},createElement:function(a,e){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",e):a.createElement(e)},isIE:g,isFirefox:n,isOpera:d,isChrome:c,isSafari:m,isWebkit:h,isAndroid:b,isIPad:a,isIPhone:k,
isIOS:l,isMac:f,isWindows:e,isLinux:p,isTouch:s,platformDelimiter:e?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function g(a,b){b||(b=document);return b.querySelectorAll(a)}function n(a){var b=a.tabIndex;0===b&&k.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(b=-1);return b}function d(a){if(0<=n(a))return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var f=d(a.childNodes[b]);if(f)return f}return null}function c(a){if(0<=
n(a))return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;0<=b;b--){var f=c(a.childNodes[b]);if(f)return f}return null}function m(a,b){if(3===a.nodeType){var f=h.exec(a.nodeValue);f&&1<f.length&&b(a,f)}if(a.hasChildNodes())for(f=0;f<a.childNodes.length;f++)m(a.childNodes[f],b)}var h=/\$\{([^\}]+)\}/,b=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:g,$$array:function(a,b){return Array.prototype.slice.call(g(a,b))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var f=a.compareDocumentPosition(b);return Boolean(f&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:d,lastTabbable:c,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){m(a,function(a,e){a.parentNode.replaceChild(document.createTextNode(b[e[1]]||e[1]),a)})},processDOMNodes:function(a,b){m(a,function(a,e){var c=b[e[1]];if(c){var h=document.createRange(),d=e.index;h.setStart(a,d);h.setEnd(a,d+e[0].length);h.deleteContents();h.insertNode(c)}})},addAutoDismiss:function(a,l){function f(a){b.forEach(function(b){var l=!1,f=b.excludeNodes.some(function(b){return document.body.contains(b)?(l=!0,b.contains(a.target)):
!1});if(l&&!f)try{b.dismiss(a)}catch(c){"undefined"!==typeof console&&console&&console.error(c&&c.message)}});b=b.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===b&&(b=[],document.addEventListener("click",f,!0),k.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));b.push({excludeNodes:a,dismiss:l})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),f=0;f<b.length;f++)b[f].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){b=b.filter(function(b){return a!==b.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,g,n){function d(c){n.attach(this);this._init(c)}function c(c,b){var a=document.createElement(void 0===b?"span":b);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var l=document.createElement("span");l.appendChild(document.createTextNode(c));l.classList.add("dropdownCommandName");a.appendChild(l);l=document.createElement("li");l.appendChild(a);return l}function m(){var c=document.createElement("li");
c.classList.add("dropdownSeparator");return c}d.prototype={_init:function(c){this._dropdownNode=g.node(c.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=c.populate;this._selectionClass=c.selectionClass;this._parentDropdown=c.parentDropdown;this._positioningNode=c.positioningNode;if(!this._parentDropdown)for(var b=this._dropdownNode.parentNode;b&&document!==b;){if(b.classList&&b.classList.contains("dropdownMenu")){this._parentDropdown=b.dropdown;break}b=b.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=c.triggerNode?c.triggerNode:g.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!c.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(b){a.toggle(b)&&g.stop(b)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)a.toggle(),g.stop(b)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(c){var b=this;c.addEventListener("click",function(a){b.toggle(a)&&g.stop(a)},!1)},toggle:function(c){return this.isVisible()?this.close():this.open(c)},isVisible:function(){return this._isVisible},open:function(c){var b=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:c}),g.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?g.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),b=g.$$array(".dropdownSubMenu",this._dropdownNode),g.addAutoDismiss([this._triggerNode].concat(b),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(c),this._focusDropdownNode(),
b=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return b},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(c){if(this.close(!1)&&this._dropdownNode.contains(c.target))for(c=this._parentDropdown;c;)c.close(!1),c=c._parentDropdown},_positionDropdown:function(c){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{c=g.bounds(this._dropdownNode);
var b=g.bounds(document.body);if(c.left+c.width>b.left+b.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-c.width+"px";else{var a=g.bounds(this._boundingNode(this._triggerNode)),l=g.bounds(this._triggerNode);this._dropdownNode.style.left=l.left-a.left-c.width+l.width+"px"}c=c.top+c.height-(b.top+b.height);0<c&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-c)+"px")}},_boundingNode:function(c){var b=window.getComputedStyle(c,null);
return null===b||"absolute"===b.getPropertyValue("position")||!c.parentNode||c===document.body?c:this._boundingNode(c.parentNode)},close:function(c){var b=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),g.setFramesEnabled(!0),c&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),b=!0);return b},getItems:function(){var c=[],b=this;g.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===b._dropdownNode&&c.push(a)});c.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(l){a.dropdown?a.dropdown.open(l):(b._closeSelectedSubmenu(),g.stop(l));b._selectItem(a)}),a._hasDropdownMouseover=!0)});return c},empty:function(){var c=this;g.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===
c._dropdownNode&&b.parentNode.removeChild(b)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(c){if(c.keyCode===g.KEY.UP||c.keyCode===g.KEY.DOWN||c.keyCode===g.KEY.RIGHT||c.keyCode===g.KEY.ENTER||c.keyCode===g.KEY.LEFT){var b=this.getItems();if(b.length&&0<b.length){if(this._selectedItem){var a=b.indexOf(this._selectedItem);0>a&&(a=b.indexOf(this._selectedItem.parentNode));0<=a&&(c.keyCode===g.KEY.UP&&0<a?(a--,this._selectItem(b[a])):c.keyCode===g.KEY.DOWN&&a<b.length-1?(a++,this._selectItem(b[a])):
c.keyCode===g.KEY.ENTER||c.keyCode===g.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):c.keyCode===g.KEY.ENTER&&this._selectedItem.click():c.keyCode===g.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(b[0]);g.stop(c)}}else c.keyCode===
g.KEY.ESCAPE&&(this.close(!0),g.stop(c))},_selectItem:function(c){if(c=c||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=c,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(c){c!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=c)},_closeSelectedSubmenu:function(){for(var c=this._selectedSubmenu;c;)c.close(),
c=c._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&g.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(h,b){var a=c(h,b);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var c=m();this._dropdownNode.appendChild(c);return c}};d.prototype.constructor=d;return{Dropdown:d,appendKeyBindingString:function(c,b){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(b));c.appendChild(a)},
createMenuItem:c,createSeparator:m}});
define("text",["module"],function(k){var g,n,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,m=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,h="undefined"!==typeof location&&location.href,b=h&&location.protocol&&location.protocol.replace(/\:/,""),a=h&&location.hostname,l=h&&(location.port||void 0),f=[],e=k.config&&k.config()||{};g={version:"2.0.5",strip:function(a){if(a){a=a.replace(c,"");var e=a.match(m);e&&(a=e[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:e.createXhr||function(){var a,e,b;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(e=0;3>e;e+=1){b=d[e];try{a=new ActiveXObject(b)}catch(l){}if(a){d=[b];break}}return a},parseName:function(a){var e,
b,l=!1,f=a.indexOf(".");e=0===a.indexOf("./")||0===a.indexOf("../");-1!==f&&(!e||1<f)?(e=a.substring(0,f),b=a.substring(f+1,a.length)):e=a;a=b||e;f=a.indexOf("!");-1!==f&&(l="strip"===a.substring(f+1),a=a.substring(0,f),b?b=a:e=a);return{moduleName:e,ext:b,strip:l}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,e,b,l){var f,c;f=g.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");c=f[1];f=f[0];return(!a||a===e)&&(!f||f.toLowerCase()===b.toLowerCase())&&(!c&&!f||c===l)},finishLoad:function(a,
b,l,c){l=b?g.strip(l):l;e.isBuild&&(f[a]=l);c(l)},load:function(f,c,d,m){if(m.isBuild&&!m.inlineText)d();else{e.isBuild=m.isBuild;var k=g.parseName(f);m=k.moduleName+(k.ext?"."+k.ext:"");var n=c.toUrl(m),z=e.useXhr||g.useXhr;!h||z(n,b,a,l)?g.get(n,function(a){g.finishLoad(f,k.strip,a,d)},function(a){d.error&&d.error(a)}):c([m],function(a){g.finishLoad(k.moduleName+"."+k.ext,k.strip,a,d)})}},write:function(a,e,b,l){f.hasOwnProperty(e)&&(l=g.jsEscape(f[e]),b.asModule(a+"!"+e,"define(function () { return '"+
l+"';});\n"))},writeFile:function(a,e,b,l,f){e=g.parseName(e);var c=e.ext?"."+e.ext:"",d=e.moduleName+c,h=b.toUrl(e.moduleName+c)+".js";g.load(d,b,function(e){e=function(a){return l(h,a)};e.asModule=function(a,e){return l.asModule(a,h,e)};g.write(a,d,e,f)},f)}};if("node"===e.env||!e.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)n=require.nodeRequire("fs"),g.get=function(a,e){var b=n.readFileSync(a,"utf8");0===b.indexOf("\ufeff")&&(b=b.substring(1));e(b)};else if("xhr"===
e.env||!e.env&&g.createXhr())g.get=function(a,b,l,f){var c=g.createXhr(),d;c.open("GET",a,!0);if(f)for(d in f)f.hasOwnProperty(d)&&c.setRequestHeader(d.toLowerCase(),f[d]);if(e.onXhr)e.onXhr(c,a);c.onreadystatechange=function(e){4===c.readyState&&(e=c.status,399<e&&600>e?(e=Error(a+" HTTP status: "+e),e.xhr=c,l(e)):b(c.responseText))};c.send(null)};else if("rhino"===e.env||!e.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)g.get=function(a,e){var b,l,f=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),"utf-8")),d="";try{b=new java.lang.StringBuffer;(l=f.readLine())&&(l.length()&&65279===l.charAt(0))&&(l=l.substring(1));for(null!==l&&b.append(l);null!==(l=f.readLine());)b.append(c),b.append(l);d=String(b.toString())}finally{f.close()}e(d)};return g});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,g){function n(d){this._init(d)}n.prototype={_init:function(d){this._node=g.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=void 0===d.hideDelay?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var c=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(d){d.target===c._node&&(c.show(),g.stop(d))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===d.showDelay?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(d){g.contains(c._node,d.target)&&(c.show(),g.stop(d))},!1);this._leaveHandler=function(d){g.contains(c._node,d.target)&&c.hide()};for(var m=0;m<d.length;m++)this._node.addEventListener(d[m],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text){this._tipTextContent=document.createElement("div");this._tipTextContent.classList.add("textContent");this._tipInner.appendChild(this._tipTextContent);var d=document.createTextNode(this._text);this._tipTextContent.appendChild(d)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var c=this;g.addAutoDismiss([this._tip,this._node],function(){c.hide()});"mouseover"===this._trigger&&(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(d){c._timeout&&(window.clearTimeout(c._timeout),c._timeout=null);c._tip.addEventListener("mouseout",function(d){g.contains(c._tip,d.target)&&(c.hide(),g.stop(d))},
!1)},!1))}return this._tip},_positionTip:function(d,c){this._makeTipNode();"left"===d?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var m=this._node,h;for(h=g.bounds(m);m&&!h.width&&!h.height;m=m.parentNode)h=g.bounds(m);var m=g.bounds(this._tipInner),b;switch(d){case "above":b=h.top-m.height-this._tailSize-1;h=h.left-this._tailSize;break;case "below":b=h.top+h.height+this._tailSize+1;h=h.left-this._tailSize;break;case "left":b=h.top-this._tailSize/2;h=h.left-m.width-
this._tailSize-1;break;default:b=h.top-this._tailSize/2,h=h.left+h.width+this._tailSize+1}var a=g.bounds(document.documentElement);if(b+m.height>a.height)if(c)b=a.height-m.height-1;else return!1;if(h+m.width>a.width)if(c)h=a.width-m.width-1;else return!1;if(0>h)if(c)h=4;else return!1;if(0>b)if(c)b=4;else return!1;this._tail&&this._tail.previousPosition!==d&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
d),"above"===d||"left"===d?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=d);this._tip.style.top=b+"px";this._tip.style.left=h+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=window.setTimeout(this._showImmediately.bind(this),
this._showDelay):this._showImmediately()},_showImmediately:function(){for(var d=!1,c=0;!d&&c<this._position.length;)d=this._positionTip(this._position[c]),c++;d||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(d){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===d&&(d=this._hideDelay);var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");
c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},d)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);this._tip&&(document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null);if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var d=["mouseout","click"],c=0;c<d.length;c++)this._node.removeEventListener(d[c],
this._leaveHandler,!1)}}};n.prototype.constructor=n;return{Tooltip:n}});
define("orion/commands","orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/dropdowntriggerbuttonwitharrow.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(k,g,n,d,c,m,h,b){function a(a){var e=a.invocation;if(e){var b=a.command;if(b.hrefCallback)return a=b.hrefCallback.call(e.handler||window,e),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(e.commandRegistry)return e.commandRegistry._invoke(e),
!0;if(b.onClick||b.callback)return window.setTimeout(function(){(b.onClick||b.callback).call(e.handler||window,e)},0),!0}return!1}function l(e,b){for(var l in b)if(b[l]&&(b[l].keyBinding&&b[l].command)&&b[l].keyBinding.match(e)){var f=b[l],c=f.keyBinding;if((!c.domScope||g.contains(g.node(c.domScope),e.target))&&a(f)){g.stop(e);break}}}function f(){var a={};if(u){var e,b,l;b=Object.keys(z);for(e=0;e<b.length;e++)l=b[e],a[l]=z[l];var f=u();b=Object.keys(f);for(e=0;e<b.length;e++)l=b[e],a[l]=f[l]}else a=
z;return a}function e(a){l(a,f())}function p(a,b){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var l=a.target.nodeName.toLowerCase();if("input"===l)switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if("textarea"===l)return}b?b(a):e(a)}function s(){this._init()}
function q(a,e,b){e.classList.add("commandImage");var l;a.imageClass?a.addImageClassToElement?e.classList.add(a.imageClass):(l=document.createElement("span"),e.appendChild(l),l.classList.add(a.spriteClass),l.classList.add(a.imageClass)):(l=new Image,l.alt=a.name,l.name=b,l.id=b,l.src=a.image,e.appendChild(l));return l}function r(a,e,b,l,f){this.commandRegistry=f;this.handler=a;this.items=e;this.userData=b;this.command=l;l.parameters&&(this.parameters=l.parameters.makeCopy());this.id=l.id}function w(a){this._init(a)}
var u=null,z={};s.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(e){return p(e,function(e){var b=a.proxy,l=a.bindings;if(l&&b)for(var f=0;f<l.length;f++)l[f].match(e)&&(b.processKey({type:e.type,keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}),g.stop(e))})})}};window.document.addEventListener("keydown",p,!1);r.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var e=new r(this.handler,this.items,this.userData,this.command,this.commandRegistry);e.domNode=this.domNode;e.domParent=this.domParent;a?e.parameters=a.makeCopy():this.parameters&&(e.parameters=this.parameters.makeCopy());return e}};r.prototype.constructor=r;w.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.extraClass=a.extraClass;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,
e,b,l,f){b=this.getChoices(e,b,l);var c=b.some(function(a){return a.checked});b.forEach(function(b){if(b.name){var l=document.createElement("li");a.appendChild(l);var d=document.createElement("span");d.tabIndex=0;d.role="menuitem";d.classList.add("dropdownMenuItem");if(c){var h=document.createElement("span");h.classList.add("check");h.appendChild(document.createTextNode(b.checked?"\u25cf":""));d.appendChild(h)}h=document.createTextNode(b.name);d.appendChild(h);l.appendChild(d);d.choice=b;d.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1);d.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1)}else f._generateMenuSeparator(a)})},getChoices:function(a,e,b){return this.choiceCallback?this.choiceCallback.call(e,a,b):null},makeChoiceCallback:function(a,e){return function(b){a.callback&&a.callback.call(a,e,b)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};w.prototype.constructor=w;return{Command:w,CommandInvocation:r,createDropdownMenu:function(a,e,b,l,f,h,p,m,r){a=g.node(a);if(!a)throw"no parent node was specified";var k=document.createRange();k.selectNode(a);k=r?k.createContextualFragment(c):k.createContextualFragment(d);g.processTextNodes(k,{ButtonText:e});a.appendChild(k);a=a.lastChild;
var w;r?(r=a.previousSibling,w=r.lastChild):r=a.previousSibling;l?r.classList.add(l):(r.classList.add("orionButton"),r.classList.add("commandButton"));f&&(h||(r.textContent="",r.setAttribute("aria-label",e)),q({spriteClass:"commandSprite",imageClass:f},r,e),r.classList.add("orionButton"));r.dropdown=new n.Dropdown({dropdown:a,populate:b,selectionClass:p,skipTriggerEventListeners:!!w,positioningNode:m});a.dropdown=r.dropdown;return{menuButton:r,menu:a,dropdown:r.dropdown,dropdownArrow:w}},createCheckedMenuItem:function(a,
e,b,l){a=g.node(a);if(!a)throw"no parent node was specified";var f=document.createRange();f.selectNode(a);f=f.createContextualFragment(h);g.processTextNodes(f,{ItemText:e});a.appendChild(f);a=g.$(".checkedMenuItem",a.lastChild);a.checked=b;a.addEventListener("change",l,!1);return a},createCommandItem:function(a,e,l,f,c,d,h){var p;d=d||!e.name&&e.hasImage();if(e.hrefCallback)p=document.createElement("a"),p.id=f,d&&e.hasImage()?q(e,p,f):(p.className="commandLink",p.appendChild(document.createTextNode(e.name))),
h=e.hrefCallback.call(l.handler,l),h.then?h.then(function(a){p.href=a}):p.href=h?h:"#";else{p=document.createElement("button");p.className="orionButton";e.extraClass&&p.classList.add(e.extraClass);d?e.hasImage()?(q(e,p,f),e.name&&p.setAttribute("aria-label",e.name)):(p.classList.add("commandButton"),p.classList.add("commandMissingImageButton"),p.appendChild(document.createTextNode(e.name))):(p.classList.add("commandButton"),f=document.createTextNode(e.name),p.appendChild(f));var m=h||e.callback;m&&
(e.onClick=m,p.addEventListener("click",function(a){m.call(l.handler,l)},!1))}"ul"===a.nodeName.toLowerCase()?(h=document.createElement("li"),a.appendChild(h),a=h):p.classList.add("commandMargins");a.appendChild(p);e.tooltip&&(p.commandTooltip=new b.Tooltip({node:p,text:e.tooltip,position:["above","below","right","left"]}));c&&(z[e.id]={keyBinding:c,command:e,invocation:l});return p},createCommandMenuItem:function(a,e,l,f,c,d){var p,h,m=a.dropdown;if(e.hrefCallback)h=n.createMenuItem(e.name,"a"),
p=h.firstElementChild,c=e.hrefCallback.call(l.handler,l),c.then?c.then(function(a){p.href=a}):p.href=c?c:"#",p.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&p.click()},!1);else{h=n.createMenuItem(e.name);p=h.firstElementChild;var r=c||e.callback;r&&(e.onClick=r,p.addEventListener("click",function(a){m.close(!0);r.call(l.handler,l)},!1),p.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)a.preventDefault(),p.click()},
!1))}e.tooltip&&(p.commandTooltip=new b.Tooltip({node:p,text:e.tooltip,position:["above","below","right","left"]}));d&&n.appendKeyBindingString(p,d);a.appendChild(h);f&&(z[e.id]={keyBinding:f,command:e,invocation:l});return p},executeBinding:a,setKeyBindingProvider:function(a){u=a},localKeyBindings:z,CommandsProxy:s,getKeyBindings:f,processKey:e,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:l}});define("orion/explorers/navigationUtils",[],function(){function k(k,d,c,m){!g&&k&&(k.push({domNode:d}),d.tabIndex=-1,d.style.outline="none")}var g=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(g,d,c){g&&(g=g.getGridNavHolder(d,!0))&&k(g,c)},generateNavGrid:k,removeNavGrid:function(g,d){if(g)for(var c=0;c<g.length;c++)if(g[c].domNode===d){g.splice(c,1);break}}}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{hash:function(){var g=window.location.href.split("#")[1];return g?"#"+g:""},matchResourceParameters:function(g){g=g||window.location.toString();var k={resource:""},d=g.indexOf("#");if(-1!==d&&(g=g.substring(d+1),0!==g.length)){g=g.split(",");k.resource=decodeURIComponent(g[0]);for(d=1;d<g.length;d++){var c=/([^=]*)(=?)(.*)/.exec(g[d]),m=decodeURIComponent(c[1]||""),c=decodeURIComponent(c[3]||"");""!==m&&"resource"!==m&&(k[m]=c)}}return k},
validateURLScheme:function(g,n){var d=g;if(-1===g.indexOf("://")){var c=document.createElement("a");c.href=g;d=c.href}c=!1;if(c=n?n.some(function(c){return RegExp("^"+c+":","i").test(d)}):k.test(d))return g;console.log("Illegal URL Scheme: '"+g+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function g(d){var c="",m=-1!==navigator.platform.indexOf("Mac");m?(d.mod4&&(c+="\u2303"),d.mod3&&(c+="\u2325"),d.mod2&&(c+="\u21e7"),d.mod1&&(c+="\u2318")):(d.mod1&&(c+="Ctrl+"),d.mod2&&(c+="Shift+"),d.mod3&&(c+="Alt+"));if(d.alphaKey)return c+d.alphaKey;if("keypress"===d.type)return c+d.keyCode;for(var h in k.KEY)if(typeof("number"===k.KEY[h])&&k.KEY[h]===d.keyCode){if(m)switch(k.KEY[h]){case k.KEY.BKSPC:h="\u232b";break;case k.KEY.TAB:h=
"\u21e5";break;case k.KEY.ENTER:h="\u23ce";break;case k.KEY.ESCAPE:h="\u238b";break;case k.KEY.SPACE:h="\u2423";break;case k.KEY.PAGEUP:h="\u21de";break;case k.KEY.PAGEDOWN:h="\u21df";break;case k.KEY.END:h="\u21f2";break;case k.KEY.HOME:h="\u21f1";break;case k.KEY.DEL:h="\u2326"}switch(k.KEY[h]){case k.KEY.DOWN:h="\u2193";break;case k.KEY.UP:h="\u2191";break;case k.KEY.RIGHT:h="\u2192";break;case k.KEY.LEFT:h="\u2190"}return c+h}var b;switch(d.keyCode){case 59:b=d.mod2?":":";";break;case 61:b=d.mod2?
"+":"\x3d";break;case 188:b=d.mod2?"\x3c":",";break;case 190:b=d.mod2?"\x3e":".";break;case 191:b=d.mod2?"?":"/";break;case 192:b=d.mod2?"~":"`";break;case 219:b=d.mod2?"{":"[";break;case 220:b=d.mod2?"|":"\\";break;case 221:b=d.mod2?"}":"]";break;case 222:b=d.mod2?'"':"'"}return b?c+b:112<=d.keyCode&&123>=d.keyCode?c+"F"+(d.keyCode-111):c+String.fromCharCode(d.keyCode)}function n(d){var c=-1!==window.navigator.platform.indexOf("Mac");return c&&d.metaKey||!c&&d.ctrlKey}return{getUserKeyString:function(d){var c=
"";d=d.getKeys();for(var m=0;m<d.length;m++)0!==m&&(c+=" "),c+=g(d[m]);return c},getUserText:function(d){var c=d.id,m=d.refNode,h=d.hideRefNode,b=d.initialText,a=d.onComplete,l=d.onEditDestroy,f=d.selectTo,e=d.isInitialValid;d=d.insertAsChild;var p=!1,g=function(f){return function(d){if(!p){var g=k.node(c),q=g.value;g&&(f&&d.keyCode===k.KEY.ESCAPE?(h&&(m.style.display="inline"),p=!0,g.parentNode.removeChild(g),l&&l()):f&&d.keyCode!==k.KEY.ENTER||(0===q.length||!e&&q===b?h&&(m.style.display="inline"):
(a(q),h&&m.parentNode&&(m.style.display="inline")),p=!0,g.parentNode&&g.parentNode.removeChild(g),l&&l()))}}},q=document.createElement("input");q.id=c;q.value=b||"";d?m.appendChild(q):m.parentNode.insertBefore(q,m.nextSibling);q.classList.add("userEditBoxPrompt");h&&(m.style.display="none");q.addEventListener("keydown",g(!0),!1);q.addEventListener("blur",g(!1),!1);window.setTimeout(function(){q.focus();if(b){var a=k.node(c),e=f?b.indexOf(f):-1;0<e?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",e),a.select()):a.setSelectionRange?a.setSelectionRange(0,e):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=e):a.select()}},0)},openInNewWindow:n,followLink:function(d,c){c&&n(c)?window.open(d):window.location=d},createButton:function(d,c){var m=document.createElement("button");m.className="orionButton commandButton commandMargins";m.addEventListener("click",function(d){c();k.stop(d)},!1);d&&m.appendChild(document.createTextNode(d));return m},
createDropdownButton:function(d,c,m){},isFormElement:function(d){switch(d.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(k,g,n,d,c,m,h,b,a,l){function f(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function e(a,e){this.token=a;this.parameterName=e}function p(a,e,b){this.event=a;this.handler=e;this.capture=b||!1}function s(a,e,b,l,f,c){this.name=a;this.type=e;this.label=b;this.value=l;this.lines=f||1;this.eventListeners=Array.isArray(c)?c:c?[c]:[]}function q(a,e,b){this._storeParameters(a);this._hasOptionalParameters=e&&e.hasOptionalParameters;this._options=e;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=e&&e.clientCollect;this.getParameterElement=e&&e.getParameterElement;
this.getSubmitName=e&&e.getSubmitName}f.prototype={_init:function(a){this._selectionService=a.selection;var e=this;k.setKeyBindingProvider(function(){return e._activeBindings})},processURL:function(a){for(var e in this._urlBindings)if(this._urlBindings[e]&&this._urlBindings[e].urlBinding&&this._urlBindings[e].command){var b=this._urlBindings[e].urlBinding.match(a);if(b){var l=this._urlBindings[e],f=l.command,c=l.invocation;if(c&&c.parameters&&f.callback){c.parameters.setValue(b.parameterName,b.parameterValue);
var d=this;window.setTimeout(function(){d._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,e,b,l,f,c){if(e){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(e):1)&&a.callback)return e=new k.CommandInvocation(b,e,f,a,this),e.domParent=c,this._invoke(e,l)}else if((c=this._urlBindings[a])&&c.command&&c.command.callback)return this._invoke(c.invocation,l)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,e,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,e,b))},confirm:function(a,e,b,l,f,c){var d=!1;if(this._parameterCollector&&!f){var p=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,f){var c=document.createElement("span");c.classList.add("parameterPrompt");c.textContent=e;a.appendChild(c);c=document.createElement("button");c.addEventListener("click",function(a){d=!0;p._parameterCollector.close()},
!1);f.appendChild(c);c.appendChild(document.createTextNode(b));c.className="dismissButton";var h=document.createElement("button");h.addEventListener("click",function(a){d=!1;p._parameterCollector.close()},!1);f.appendChild(h);h.appendChild(document.createTextNode(l));h.className="dismissButton";return c},function(){c(d)}))return}d=window.confirm(e);c(d)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,e){return this._collectAndInvoke(a.makeCopy(e),!1)},_collectAndInvoke:function(a,e,b){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(e||a.parameters.shouldCollectParameters())){e=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a,b),!e)){var l=new h.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});e=
l.contentContainer();e.classList.add("parameterPopup");var f=window.document.activeElement,c=this._parameterCollector.getFillFunction(a,function(){f&&f.focus();l.destroy()},b)(e);l.show();window.setTimeout(function(){c.focus();c.select()},0);e=!0}if(!e)return a.command.callback.call(a.handler||window,a)}else return 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,
e){this._collectAndInvoke(a,!0,e)},showKeyBindings:function(a){function e(a){return function(){k.executeBinding(a)}}var b={},l,f,c=[],p;for(p in this._activeBindings)(f=this._activeBindings[p])&&(f.keyBinding&&f.command&&(f.command.name||f.command.tooltip))&&c.push(f);c.sort(function(a,e){return(a.command.name||a.command.tooltip).localeCompare(e.command.name||e.command.tooltip)});for(p=0;p<c.length;p++)f=c[p],f.keyBinding.scopeName?(b[f.keyBinding.scopeName]||(b[f.keyBinding.scopeName]=[]),b[f.keyBinding.scopeName].push(f)):
(l=d.getUserKeyString(f.keyBinding),a.createItem(l,f.command.name||f.command.tooltip,e(f)));for(var h in b)b[h].length&&0<b[h].length&&(a.createHeader(h),b[h].forEach(function(b){l=d.getUserKeyString(b.keyBinding);a.createItem(l,b.command.name||b.command.tooltip,e(b))}))},addCommand:function(a){this._commandList[a.id]=a;var e=this._pendingBindings[a.id];if(e){var b=this;e.forEach(function(e){b._addBinding(a,e.type,e.binding,e.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
e,b,l,f,c,d,p,h,m){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,f));a[e]?(l&&(a[e].title=l),b&&(a[e].position=b),d&&(a[e].imageClass=d),p&&(a[e].tooltip=p),h&&(a[e].selectionClass=h),!0===m?a[e].pretendDefaultActionId=!0:a[e].defaultActionId=m,a[e].emptyGroupMessage=c):(a[e]={title:l,position:b,emptyGroupMessage:c,imageClass:d,tooltip:p,selectionClass:h,defaultActionId:!0===m?null:m,pretendDefaultActionId:!0===
m,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,e){e&&e.split("/").forEach(function(e){1<e.length&&(a[e]||(a[e]={position:0,children:{}},a.sortedContributions=null),a=a[e].children)});return a},registerSelectionService:function(a,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=e},registerCommandContribution:function(a,e,b,l,f,c,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];l&&(a=this._createEntryForPath(a,l));a[e]={position:b};c&&((b=this._commandList[e])?this._addBinding(b,"key",c,f):this._addPendingBinding(e,"key",c,f));d&&((b=this._commandList[e])?this._addBinding(b,"url",d,f):this._addPendingBinding(e,"url",d,f));a.sortedContributions=null},unregisterCommandContribution:function(a,e,b){if(this._contributionsByScopeId[a]){delete this._commandList[e];delete this._activeBindings[e];delete this._urlBindings[e];delete this._pendingBindings[e];
var l=this._contributionsByScopeId[a];b&&b.split("/").forEach(function(a){1<a.length&&l[a]&&(l=l[a].children)});delete l[e];l.sortedContributions=null}},_addBinding:function(a,e,b,l){if(!a.id)throw Error("No command id: "+a);"key"===e?this._activeBindings[a.id]={command:a,keyBinding:b,bindingOnly:l}:"url"===e&&(this._urlBindings[a.id]={command:a,urlBinding:b,bindingOnly:l})},_addPendingBinding:function(a,e,b,l){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:e,
binding:b,bindingOnly:l})},_checkForTrailingSeparator:function(a,e,b){var l;if("tool"===e||"button"===e)if((l=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&l.classList.contains("commandSeparator"))return b?(a.removeChild(l),!1):!0;if("menu"===e&&(a=c.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(l=a[a.length-1],b)l.parentNode.parentNode.removeChild(l.parentNode);else return!0;return!1},renderCommands:function(a,e,b,l,f,d,p){if("string"!==
typeof a)throw"a scope id for rendering must be specified";e=c.node(e);if(!e)throw"no parent";var h=this._contributionsByScopeId[a];if(!b&&h){b=h.localSelectionService||this._selectionService;var m=this;b&&b.getSelections(function(b){m.renderCommands(a,e,b,l,f,d)})}else h&&(this._render(h,e,b,l,f||"button",d,p),this._checkForTrailingSeparator(e,f,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var e=a.firstChild;e.commandTooltip&&e.commandTooltip.destroy();e.emptyGroupTooltip&&
e.emptyGroupTooltip.destroy();this.destroy(e);a.removeChild(e)}},_render:function(a,e,b,l,f,c,p){var m=a.sortedContributions;if(!m){var m=[],q=!1,s;for(s in a)if(Object.prototype.hasOwnProperty.call(a,s)){var n=a[s];n&&"number"===typeof n.position&&(n.id=s,m.push(n),q=!0)}q&&(m.sort(function(a,e){return a.position-e.position}),a.sortedContributions=m)}var C=0,x=this;m.forEach(function(a){var m;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var q=
a.children;if("tool"===f||"button"===f)if(a.title){var r;a.defaultActionId&&((q=x._commandList[a.defaultActionId])&&(q.visibleWhen?q.visibleWhen(b):1)?(r=new k.CommandInvocation(l,b,c,q,x),r.domParent=e):a.pretendDefaultActionId=!0);q=x._createDropdownMenu(e,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,r,a.pretendDefaultActionId);p&&g.generateNavGrid(p,q.menuButton);q&&(x._render(a.children,q.menu,b,l,"menu",c,p),x._checkForTrailingSeparator(q.menu,"menu",!0),0===q.menu.childNodes.length?
a.emptyGroupMessage?q.menuButton.emptyGroupTooltip||(q.menuButton.emptyGroupTooltip=new h.Tooltip({node:q.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(p&&g.removeNavGrid(p,q.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(q.menu),a(q.menuButton),a(q.destroyButton)):q.menuButton.style.visibility="visible")}else{var s;0<e.childNodes.length&&!x._checkForTrailingSeparator(e,f)&&(s=x.generateSeparatorImage(e));x._render(q,e,
b,l,f,c,p);0<e.childNodes.length&&e.childNodes[e.childNodes.length-1]!==s&&(s=x.generateSeparatorImage(e))}else if(a.title){if(a=x._createDropdownMenu(e,a.title,!0,null,null,a.imageClass))x._render(q,a.menu,b,l,"menu",c,p),x._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&e.removeChild(a.destroyButton)}else 0<e.childNodes.length&&x._generateMenuSeparator(e),x._render(q,e,b,l,f,c,p),x._generateMenuSeparator(e)}else{var n=x._commandList[a.id],q=n?!0:!1;r=
a=null;if(n){m=new k.CommandInvocation(l,b,c,n,x);m.domParent=e;s=!1;try{s=q&&(n.visibleWhen?n.visibleWhen(b):!0)}catch(A){throw console.log(A),A;}x._activeBindings[n.id]&&x._activeBindings[n.id].keyBinding&&(a=x._activeBindings[n.id],a.invocation=s?m:null,a.bindingOnly&&(q=!1));x._urlBindings[n.id]&&x._urlBindings[n.id].urlBinding&&(r=x._urlBindings[n.id],r.invocation=s?m:null,r.bindingOnly&&(q=!1));q=q&&s}q&&(n.choiceCallback?("tool"===f||"button"===f?(a=e,q=!1,"ul"===e.nodeName.toLowerCase()&&
(a=document.createElement("li"),e.appendChild(a))):(a=e,q=!0),x._createDropdownMenu(a,n.name,q,function(a){n.populateChoicesMenu(a,b,l,c,x)}.bind(n),n.imageClass,n.tooltip||n.title,n.selectionClass,n.positioningNode)):(m.handler=m.handler||this,m.domParent=e,q=function(a){x._invoke(m)},"menu"===f?(r=null,a&&a.keyBinding&&(r=d.getUserKeyString(a.keyBinding)),a=k.createCommandMenuItem(e,n,m,null,q,r)):(a=f+n.id+C,a=k.createCommandItem(e,n,m,a,null,"tool"===f,q)),g.generateNavGrid(p,a),m.domNode=a,C++))}})},
_createDropdownMenu:function(a,e,b,f,d,p,q,g,s,n){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var E,C,x=a;if(b)p=document.createRange(),p.selectNode(a),p=p.createContextualFragment(l),c.processTextNodes(p,{ButtonText:e}),a.appendChild(p),C=a.lastChild,d=C.lastChild,e=d.previousSibling,e.dropdown=new m.Dropdown({dropdown:d,populate:f,parentDropdown:a.dropdown}),d.dropdown=e.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(x=document.createElement("li"),a.appendChild(x),C=x);a=null;d&&
(a="dropdownButtonWithIcon",p=p||e);p=d?p||e:p;var D=k.createDropdownMenu(x,e,f,a,d,!1,q,g,s||n);E=D.dropdownArrow;e=D.menuButton;if(E){s&&(s.domNode=D.menuButton);var B=this;e.onclick=function(a){var e=c.bounds(E);a.clientX>=e.left&&D.dropdown?D.dropdown.toggle(a):B._invoke(s)};D.dropdown&&(e.onkeydown=function(a){c.KEY.DOWN===a.keyCode&&(D.dropdown.toggle(a),c.stop(a))})}d=D.menu;var I;(f=s&&s.command&&(s.command.tooltip||s.command.name))?I=s.command.tooltip||s.command.name:f&&(I=p);I&&(e.commandTooltip=
new h.Tooltip({node:e,text:I,position:["above","below","right","left"]}))}return{menuButton:e,menu:d,dropdown:e.dropdown,destroyButton:C,dropdownArrow:E}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var e=document.createElement("li");e.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");e.appendChild(b);a.appendChild(e)}},generateSeparatorImage:function(a){var e;e="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(e);e.classList.add("core-sprite-sep");e.classList.add("imageSprite");e.classList.add("commandSeparator");return e}};f.prototype.constructor=f;e.prototype={match:function(a){a=n.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};e.prototype.constructor=e;p.prototype.constructor=p;s.prototype={optionsRequested:function(){return this.optionsRequested}};s.prototype.constructor=s;q.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var e=this.parameterTable={};a.forEach(function(a){e[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return null!==this.parameterTable},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,e){var b=this.parameterTable[a];
b&&(b.value=e)},forEach:function(a){for(var e in this.parameterTable)this.parameterTable[e].type&&this.parameterTable[e].name&&a(this.parameterTable[e])},makeCopy:function(){var a=[];this.forEach(function(e){e=new s(e.name,e.type,e.label,e.value,e.lines,e.eventListeners);a.push(e)});var e=new q(a,this._options,this.getParameters);e.clientCollect=this.clientCollect;return e},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=q;return{CommandRegistry:f,URLBinding:e,
ParametersDescription:q,CommandParameter:s,CommandEventListener:p}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.","Choose a Folder":"Choose a Folder",
"Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"File or zip archive":"File or zip archive","Import a file or zip archive from your local file system":"Import a file or zip archive from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}",
"Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root",
"Open With":"Open With","Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Import a file from a URL and optionally unzip it":"Import 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}?","Upload progress: ":"Upload progress: ","Uploading ":"Uploading ","Cancel upload":"Cancel upload","Uploading the following file failed: ":"Uploading the following file failed: ","Enter project name:":"Enter project name:","Creating project ":"Creating project ",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding.",
Download:"Download",Download_tooltips:"Download the file contents as the displayed name","Downloading...":"Reading file contents...","Download not supported":"Contents download is not supported in this browser."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/i18nUtil",["require","orion/Deferred"],function(k,g){function n(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 d={};return{getMessageBundle:function(c){function m(a){a?k(["i18n!"+c],function(a){if(a){var l=c;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+l,JSON.stringify(a));delete a._expires}b.resolve(a)}):h(Error(c))}function h(a){b.reject(a)}
if(d[c])return d[c];var b=new g;d[c]=b;var a=n(c);if(a)return b.resolve(a),b;try{k([c],m,h)}catch(l){k(["orion/i18n!"+c],m,h)}return b},formatMessage:function(c){var d=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(c,b){return d[(b<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(k,g,n){function d(c,b,a){if(!c[b])throw b+k[" is not supported in this file system"];return c[b].apply(c,a)}function c(h,b,a,l){if(!h.readBlob)throw k["source file service does not support binary read"];if(!a.writeBlob)throw k["target file service does not support binary write"];if("/"!==b[b.length-1])return d(h,"readBlob",[b]).then(function(e){return d(a,"writeBlob",[l,e])});var f=l.substring(0,
l.length-1),e=decodeURIComponent(f.substring(f.lastIndexOf("/")+1)),f=f.substring(0,f.lastIndexOf("/")+1);return d(a,"createFolder",[f,e]).then(function(){},function(){}).then(function(){return d(h,"fetchChildren",[b]).then(function(e){for(var b=[],f=0;f<e.length;++f){var d=e[f].Location,m=d;e[f].Directory&&(m=d.substring(0,d.length-1));m=decodeURIComponent(m.substring(m.lastIndexOf("/")+1));m=l+encodeURIComponent(m);e[f].Directory&&(m+="/");b[f]=c(h,d,a,m)}return g.all(b)})})}function m(c,b){function a(a){var e=
new g;e.reject(k["No Matching FileService for location:"]+a);return e}var l=c.getServiceReferences("orion.core.file"),f=l;if(b)for(var f=[],e=0;e<l.length;++e)b(l[e])&&f.push(l[e]);for(var d=[],m=[],q=[],r=[],w={fetchChildren:function(){var a=new g;a.resolve(r);return a},createWorkspace:function(){var a=new g;a.reject(k["no file service"]);return a},loadWorkspaces:function(){var a=new g;a.reject(k["no file service"]);return a},loadWorkspace:function(a){var e=new g;window.setTimeout(function(){e.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:k["File Servers"],Location:"/",Children:r,ChildrenLocation:"/"})},100);return e},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},l=0;l<f.length;++l)r[l]={Directory:!0,Length:0,LocalTimeStamp:0,Location:f[l].getProperty("top"),ChildrenLocation:f[l].getProperty("top"),Name:f[l].getProperty("Name")},e=f[l].getProperty("pattern")||f[l].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==e[0]&&(e=
"^"+e),d[l]=RegExp(e),m[l]=c.getService(f[l]),q[l]=f[l].getProperty("Name"),f[l].getProperty("NameKey")&&f[l].getProperty("nls")&&n.getMessageBundle(f[l].getProperty("nls")).then(function(a,e){r[a].Name=e[f[a].getProperty("NameKey")];q[a]=e[f[a].getProperty("NameKey")]}.bind(this,l));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return m[0]?0:-1;for(var e=0;e<d.length;++e)if(d[e].test(a))return e;throw k["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?w:m[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?w.Name:q[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?w.Location:r[a].Location}}m.prototype={getService:function(c){return this._getService(c)},fileServiceName:function(c){return this._getServiceName(c)},fileServiceRootURL:function(c){return this._getServiceRootURL(c)},fetchChildren:function(c){return d(this._getService(c),"fetchChildren",
arguments)},createWorkspace:function(c){return d(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(c){return d(this._getService(c),"loadWorkspace",arguments)},createProject:function(c,b,a,l){return d(this._getService(c),"createProject",arguments)},createFolder:function(c,b){return d(this._getService(c),"createFolder",arguments)},createFile:function(c,b){return d(this._getService(c),"createFile",
arguments)},deleteFile:function(c){return d(this._getService(c),"deleteFile",arguments)},moveFile:function(h,b,a){var l=this._getService(h),f=this._getService(b);if(l===f)return d(l,"moveFile",arguments);var e="/"===h[h.length-1],p=b;"/"!==p[p.length-1]&&(p+="/");if(a)p+=encodeURIComponent(a);else{var m=h;e&&(m=m.substring(0,m.length-1));p+=m.substring(m.lastIndexOf("/")+1)}e&&"/"!==p[p.length-1]&&(p+="/");return c(l,h,f,p).then(function(){return d(l,"deleteFile",[h])})},copyFile:function(h,b,a){var l=
this._getService(h),f=this._getService(b);if(l===f)return d(l,"copyFile",arguments);var e="/"===h[h.length-1],p=b;"/"!==p[p.length-1]&&(p+="/");if(a)p+=encodeURIComponent(a);else{var m=h;e&&(m=m.substring(0,m.length-1));p+=m.substring(m.lastIndexOf("/")+1)}e&&"/"!==p[p.length-1]&&(p+="/");return c(l,h,f,p)},read:function(c,b){return d(this._getService(c),"read",arguments)},readBlob:function(c){return d(this._getService(c),"readBlob",arguments)},write:function(c,b,a){return d(this._getService(c),"write",
arguments)},remoteImport:function(c,b){return d(this._getService(c),"remoteImport",arguments)},remoteExport:function(c,b){return d(this._getService(c),"remoteExport",arguments)},search:function(c){return d(this._getService(c.resource),"search",arguments)}};m.prototype.constructor=m;return{FileClient:m}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace...":"Replace...",
"Replace All":"Replace All","Show Replace":"Show Replace","Hide Replace":"Hide Replace","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","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","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","Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.",
Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","File name":"File name","Path name":"Path name",Save:"Save","Type filter text":"Type filter text","Scope Search":"Scoped Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.",
"Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",Scope:"Scope","Show previous search terms":"Show previous search terms","Show previous replace terms":"Show previous replace terms","Show replacement preview":"Show replacement preview",
"File name patterns (comma-separated)":"File name patterns (comma-separated)","(* \x3d any string, ? \x3d any character)":"(* \x3d any string, ? \x3d any character)","Choose a Folder":"Choose a Folder"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Editor":"Orion Markdown Editor","Orion Markdown Viewer":"Orion Markdown Viewer",
"Orion JSON Editor":"Orion JSON Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"2014-06-28_22-01-29","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* \x3d any string, ? \x3d any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/regex",[],function(){return{escape:function(k){return k.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(k){return(k=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(k))?{pattern:k[1],flags:k[2]}:null}}});
define("orion/URITemplate",[],function(){function k(a){this._text=a}function g(a){return a.replace("%25","%")}function n(a,e){if("U"===e)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===e)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(l,g);if("U+R-,"===e)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+e);}function d(a,e,b){for(var l=
[],c=0;c<a.length;c++)"undefined"!==typeof a[c]&&l.push(n(a[c],e));return l.join(b)}function c(a,e,b,l){for(var c=Object.keys(a),d=[],h=0;h<c.length;h++)"undefined"!==typeof a[c[h]]&&d.push(n(c[h],e)+b+n(a[c[h]],e));return d.join(l)}function m(l){if(0===l.length)throw Error("Invalid Expression: 0 length expression");(this._operator=b[l[0]])?l=l.substring(1):this._operator=b.NUL;for(var e=[],c=l.split(","),d=0;d<c.length;d++){var h=c[d].match(a);if(null===h)throw Error("Bad VarSpec: "+l);e.push({name:h[1],
explode:!!h[2],prefix:h[3]?parseInt(h[3],10):-1})}this._varSpecList=e}function h(a){for(var e=[],b=0,l=a.indexOf("{",b);-1!==l;){e.push(new k(a.substring(b,l)));b=a.indexOf("}",l+1);if(-1===b)throw Error("Invalid template: "+a);e.push(new m(a.substring(l+1,b)));b+=1;l=a.indexOf("{",b)}e.push(new k(a.substring(b)));this._templateComponents=e}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:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,l=/%25[0-9A-F][0-9A-F]/g;k.prototype={expand:function(a){return encodeURI(this._text)}};
m.prototype={expand:function(a){for(var e=[],b=0;b<this._varSpecList.length;b++){var l=this._varSpecList[b],h=l.name,m=a[h],g=typeof m;if("undefined"!==g&&null!==m){var k=0===e.length?this._operator.first:this._operator.sep;if("string"===g)this._operator.named&&(k+=n(h,"U+R"),k+=0===m.length?this._operator.ifemp:"\x3d"),-1!==l.prefix&&l.prefix<m.length&&(m=m.substring(0,l.prefix)),k+=n(m,this._operator.allow);else if(Array.isArray(m)){if(0===m.length)continue;l.explode?k+=d(m,this._operator.allow,
this._operator.sep):(l=d(m,this._operator.allow,","),this._operator.named&&(k+=n(h,"U+R"),k+=0===l.length?this._operator.ifemp:"\x3d"),k+=l)}else if("object"===g){if(0===Object.keys(m).length)continue;l.explode?k+=c(m,this._operator.allow,"\x3d",this._operator.sep):(l=c(m,this._operator.allow,",",","),this._operator.named&&(k+=n(h,"U+R"),k+=0===l.length?this._operator.ifemp:"\x3d"),k+=l)}else throw Error("bad param type: "+h+" : "+g);e.push(k)}}return e.join("")}};h.prototype={expand:function(a){for(var e=
[],b=0;b<this._templateComponents.length;b++)e.push(this._templateComponents[b].expand(a));return e.join("")}};return h});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(k,g,n,d,c,m){function h(a,b,f){var e="";f&&(e="^");if(e=n.parse("/"+e+a.searchStr+"/"))f=e.pattern,e=e.flags,-1===e.indexOf("i")&&!b.caseSensitive&&(e+="i"),a.regExp={pattern:f,flags:e},a.wildCard=!0}var b={ALL_FILE_TYPE:"*.*",doSearch:function(a,l,f,e){a?(l=f,f=!0,"*"===l&&(l=""),""===l&&(f=e&&e.type!==b.ALL_FILE_TYPE),f&&(a=a.createSearchParams(l,!1,
!1,e),a=b.generateSearchHref(a),window.location=a)):window.alert(k["Can't search: no search service is available"])},generateSearchHelper:function(a,l){var f=a.keyword,e=f,c={};a.fileType&&(a.fileType!==b.ALL_FILE_TYPE&&""===f)&&(e="*."+a.fileType);if(a.regEx)c.searchStr=f,h(c,a,l);else{var d=-1<f.indexOf("*"),m=-1<f.indexOf("?");d&&(f=f.split("*").join(".*"));m&&(f=f.split("?").join("."));!d&&!m&&!a.nameSearch?(c.searchStr=a.caseSensitive?f.split("\\").join(""):f.split("\\").join("").toLowerCase(),
c.wildCard=!1):(c.searchStr=a.caseSensitive?f:f.toLowerCase(),h(c,a,l),c.wildCard=!0)}c.searchStrLength=c.searchStr.length;return{params:a,inFileQuery:c,displayedSearchTerm:e}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.nameSearch&&(a.nameSearch=
"true"===a.nameSearch.toLowerCase());void 0!==a.fileNamePatterns&&(a.fileNamePatterns=b.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var b=void 0;a&&(a=a.trim(),a=a.replace(/^(\s*,\s*)+/g,""),a=a.replace(/([^\\]),(\s*,\s*)*/g,"$1/"),a=a.replace(/(\s*\/\s*)/g,"/"),a=a.replace(/\/\/+/g,"/"),a=a.replace(/\/+$/g,""),b=a.split("/"));return b},copySearchParams:function(a,b){var f={},e;for(e in a)if(void 0!==a[e]&&null!==a[e]&&(b||"replace"!==e))f[e]=a[e];return f},
generateSearchHref:function(a){var l=g.toUrl("search/search.html");a=b.copySearchParams(a,!0);var f=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new m(l+"#{,resource,params*}")).expand({resource:f,params:a}):(new m(l+"#{,resource}")).expand({resource:f})},generateFindURLBinding:function(a,b,f,e,c){a={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof e?e:void 0,atLine:"number"===typeof f?f:void 0};return c?a:","+
(new m("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,b,f){return a.replace(RegExp(b.pattern,b.flags),f)},replaceStringLiteral:function(a,l,f){l=n.parse("/"+l+"/gim");return b.replaceRegEx(a,l,f)},searchOnelineLiteral:function(a,b,f){var e;
e=0;for(var c=!1,d=[];!(e=b.indexOf(a.searchStr,e),0>e);){d.push({startIndex:e,length:a.searchStrLength});c=!0;if(f)break;e+=a.searchStrLength}return c?d:null},findRegExp:function(a,b,f,e){if(!b)return null;f=f||"";f+=(-1===f.indexOf("g")?"g":"")+(-1===f.indexOf("m")?"m":"");var c=null;return(c=RegExp(b,f).exec(a.substring(e)))&&{startIndex:c.index+e,length:c[0].length}},searchOnelineRegEx:function(a,l,f){for(var e=0,c=!1,d=[];;)if(e=b.findRegExp(l,a.regExp.pattern,a.regExp.flags,e)){d.push(e);c=
!0;if(f)break;e=e.startIndex+e.length}else break;return c?d:null},generateNewContents:function(a,l,f,e,c,d){if(e&&l){a||(f.contents=[]);for(var h=0;h<l.length;h++){for(var m=l[h],g=!1,k=!1,n=[],t,v=0,y=0;y<e.children.length;y++)if(e.children[y].lineNumber-1===h){v=y;for(g=0;g<e.children[y].matches.length;g++)!1!==e.children[y+g].checked&&n.push(g);k=0<n.length;t=e.children[y].matches;g=!0;break}if(g){if(k){n=b.replaceCheckedMatches(m,c,t,n,d);m=n.replacedStr;for(g=0;g<e.children[v].matches.length;g++)e.children[v+
g].newMatches=n.newMatches}else for(g=0;g<e.children[v].matches.length;g++)e.children[v+g].newMatches=e.children[v+g].matches;a?f.contents[h]=m:f.contents.push(m)}else a||f.contents.push(m)}}},generateMatchContext:function(a,b,f){var e=[],c=2*a+1,d;b.length<=c?(d=0,a=b.length-1):(d=f-a,0>d?(d=0,a=d+c-1):(a=f+a,a>b.length-1&&(a=b.length-1,d=a-c+1)));for(c=d;c<=a;c++)e.push({context:b[c],current:c===f});return e},splitFile:function(a){for(var b=0,f=0,e=0,c=0,d=[];;){-1!==b&&b<=e&&(b=a.indexOf("\r",
e));-1!==f&&f<=e&&(f=a.indexOf("\n",e));if(-1===f&&-1===b){d.push(a.substring(c));break}var h=1;-1!==b&&-1!==f?b+1===f?(h=2,e=f+1):e=(b<f?b:f)+1:e=-1!==b?b+1:f+1;d.push(a.substring(c,e-h));c=e}return d},searchWithinFile:function(a,l,f,e,c,d){f=b.splitFile(f);c&&(l.contents=f);if(l){l.children=[];for(var h=e=0;h<f.length;h++){var m=f[h];if(m&&0<m.length){var g=d?m:m.toLowerCase();if(g=a.wildCard?b.searchOnelineRegEx(a,g):b.searchOnelineLiteral(a,g)){var k,n=h+1;if(c)for(var t=0;t<g.length;t++)k=t+
1,k={parent:l,checked:l.checked,type:"detail",matches:g,lineNumber:n,matchNumber:k,name:m,location:l.location+"-"+n+"-"+k},l.children.push(k);else k={parent:l,context:b.generateMatchContext(2,f,h),checked:l.checked,type:"detail",matches:g,lineNumber:n,name:m,location:l.location+"-"+n},l.children.push(k);e+=g.length}}}l.totalMatches=e}},replaceCheckedMatches:function(a,b,f,e,c){for(var d=0,h="",m=[],g=0;g<f.length;g++){d!==f[g].startIndex&&(h+=a.substring(d,f[g].startIndex));f[g].length&&(c=f[g].length);
for(var d=!1,k=0;k<e.length;k++)if(e[k]===g){d=!0;break}d?(m.push({startIndex:h.length,length:b.length}),h+=b):(m.push({startIndex:h.length,length:c}),h+=a.substring(f[g].startIndex,f[g].startIndex+c));d=f[g].startIndex+c}d<a.length&&(h+=a.substring(d));return{replacedStr:h,newMatches:m}},fullPathNameByMeta:function(a){var b=a.length,f="";if(0<b)for(b-=1;-1<b;b--)f=f+(""===f?"":"/")+a[b].Name;return f},path2FolderName:function(a,b,f){return a.substring(0,a.length-b.length-(f?0:1))},getOpenSearchPref:function(a,
b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:b})})}};return b});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/contentTypes",[],function(){function k(a,b){if("string"!==typeof a)return null;for(var e=a&&a.split(".").pop(),c=null,d=0;d<b.length;d++){var h=b[d],m;a:{m=c;var g=h,k=e,n=0<=g.filename.indexOf(a),t;t=k.toLowerCase();t=-1!==g.extension.indexOf(t);if(n||t){if(!(t=!m))n&&(k=k.toLowerCase(),n=-1!==m.extension.indexOf(k)),t=n;if(t){m=g;break a}}}m===h&&(c=h)}return c}function g(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function n(a){return g(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function d(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:n(a.extension),filename:g(a.filename)}}function c(a){var b=Object.create(null);a.map(d).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a.id)||(b[a.id]=a)});return b}function m(l){if(l&&l.registerService){this.serviceRegistry=l;for(var f=l.getServiceReferences(b).concat(l.getServiceReferences(a)),e=[],d=0;d<f.length;d++)for(var m=g(f[d].getProperty("contentTypes")),k=0;k<m.length;k++)e.push(m[k]);
this.map=c(e);l.registerService(h,this)}else if(Array.isArray(l))this.serviceRegistry=null,this.map=c(l);else throw Error("Invalid parameter");}var h="orion.core.contentTypeRegistry",b="orion.core.contenttype",a="orion.file.contenttype";m.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&b.push(a[e]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return k(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return k(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a="string"===typeof a?this.getContentType(a):a;b="string"===typeof b?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;for(var e=a,c={};e&&(e=this.getContentType(e["extends"]));){if(e.id===b.id)return!0;if(c[e.id])throw Error("Cycle: "+e.id);c[e.id]=!0}return!1},isSomeExtensionOf:function(a,b){for(var e=0;e<b.length;e++)if(this.isExtensionOf(a,
b[e]))return!0;return!1}};return{ContentTypeRegistry:m,getFilenameContentType:k}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(k,g,n,d,c,m){function h(b,a,l,c){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=l;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(l);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._reportOnCancel=c&&c.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}h.prototype.search=function(b){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var b=this;this._visitRecursively(this._childrenLocation).then(function(){(!b._cancelled||b._reportOnCancel)&&b._reportResult();b._cancelled&&b._HandleStatus({name:"Cancel"})}.bind(b),function(a){b._reportResult();b._HandleStatus(a)}.bind(b))}.bind(this))};h.prototype.searchName=function(b,a){b&&(this._searchParams=
b,this.searchHelper=d.generateSearchHelper(b,!0));a&&(this.onSearchNameComplete=a);var l=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var c=0;c<this.fileSkeleton.length;c++){var e=this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,e,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,e,!0))if(l.push(this.fileSkeleton[c]),l.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:l.length,
docs:l}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};h.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var l=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var c=this;b();l.getContentTypes().then(function(e){c.contentTypesCache=e;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;a();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};h.prototype._sort=function(b){b.sort(function(a,
b){var c,e;if("Path asc"===this._searchParams.sort){c=a.Location&&a.Location.toLowerCase();c=d.path2FolderName(c,a.Name&&a.Name.toLowerCase(),!0);e=b.Location&&b.Location.toLowerCase();e=d.path2FolderName(e,b.Name&&b.Name.toLowerCase(),!0);if(c<e)return-1;if(c>e)return 1}return this._sortOnNameSingle(a,b)}.bind(this))};h.prototype._HandleStatus=function(b){this._statusService&&"Cancel"===b.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:k["Search cancelled by user"],
Severity:"Warning"}))};h.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};h.prototype._sortOnNameSingle=function(b,a){var l=b.Name&&b.Name.toLowerCase(),c=a.Name&&a.Name.toLowerCase();return l<c?-1:l>c?1:0};h.prototype._fileNameMatches=function(b){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return b.match(a)}));return a};h.prototype._visitRecursively=function(b){var a=[],l=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(l._progressService?this._progressService.progress(l.fileClient.fetchChildren(b),"Crawling search for children of "+b):l.fileClient.fetchChildren(b)).then(function(b){for(var e=0;e<b.length;e++)if(void 0!==b[e].Directory&&!1===b[e].Directory)if(l._searchOnName)a.push(l._buildSingleSkeleton(b[e]));else if(l._buildSkeletonOnly)a.push(l._buildSingleSkeleton(b[e]));
else{if(!l._cancelled){var d=c.getFilenameContentType(b[e].Name,l.contentTypesCache);if(d&&("text/plain"===d["extends"]||"text/plain"===d.id)&&l._fileNameMatches(b[e].Name))d=l._sniffSearch(b[e]),a.push(d),l._deferredArray.push(d)}}else if(b[e].Location)if(l._cancelled)break;else d=l._visitRecursively(b[e].ChildrenLocation),a.push(d),l._deferredArray.push(d);return m.all(a)})};h.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
d.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};h.prototype._reportSingleHit=function(b){this._cancelled||(b.LastModified=b.LocalTimeStamp,this.fileLocations.push(b),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};h.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};
h.prototype._sniffSearch=function(b){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:n.formatMessage(k["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(b.Location),"Reading file "+b.Location):a.fileClient.read(b.Location)).then(function(c){a._hitOnceWithinFile(c)&&
a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:n.formatMessage(k["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},k.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};h.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();b=new m;b.resolve(this._totalCounter);
return b};h.prototype.constructor=h;return{SearchCrawler:h}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,g){function n(d){this._init(d)}n.prototype={_init:function(d){var c=d.parent,m=this,c=g.node(c);if(!c)throw k["no parent"];if(!d.model)throw k["no tree model"];if(!d.renderer)throw k["no renderer"];this._parent=c;this._treeModel=d.model;this._onComplete=d.onComplete;this._renderer=d.renderer;this._showRoot=void 0===d.showRoot?!1:d.showRoot;this._indent=void 0===d.indent?16:d.indent;this._onCollapse=d.onCollapse;
this._labelColumnIndex=void 0===d.labelColumnIndex?0:d.labelColumnIndex;this._id=void 0===d.id?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._treeModel.getRoot(function(c){m._root=c;m._showRoot?(c._depth=0,m._generate([c],0)):m._treeModel.getChildren(c,function(b){m.destroyed||m._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,
c){g.empty(this._parent);var m=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(m);var h=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(h);h.id=this._id;this._tableStyle&&h.classList.add(this._tableStyle);this._renderer.initTable(h,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===d.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,c);h.appendChild(this._bodyElement);m.appendChild(h);this._parent.appendChild(m);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(d,c,m){for(var h=0;h<d.length;h++){var b=document.createElement(this._tableRowElement);b.id=this._treeModel.getId(d[h]);b._depth=c;b._item=d[h];this._renderer.render(d[h],b);var a=this._indent*c;b.childNodes[Math.min(b.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(b,d[h]);m?(this._bodyElement.insertBefore(b,m.nextSibling),m&&(m=b)):this._bodyElement.appendChild(b)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,c,m){var h=this._treeModel.getId(d),b;if(h===this._id)this._removeChildRows(h),this._generateChildren(c,0),this._rowsChanged();else if(h===
this._treeModel.getId(this._root)&&d.removeAll)this._removeAllRows(),this._generateChildren(c,0),this._rowsChanged();else{var a=g.node(h);a?(a._item=d,a&&(m||a._expanded)?(this._removeChildRows(h),c?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(c,a._depth+1,a),this._rowsChanged()):(b=this,this._renderer.updateExpandVisuals(a,"progress"),c=this._treeModel.getChildren(a._item,function(c){b.destroyed||(b._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,b._generateChildren(c,a._depth+1,a),b._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(k["could not find table row "]+h)}},getItem:function(d){var c=g.node(d);return c&&c._item?c._item:d},toggle:function(d){var c=g.node(d);c&&(c._expanded?this.collapse(d):this.expand(d))},isExpanded:function(d){d="string"===typeof d?d:this._treeModel.getId(d);return(d=g.node(d))?d._expanded:!1},expand:function(d,c,m){d="string"===typeof d?d:this._treeModel.getId(d);var h=g.node(d);if(h){var b=
this;h._expanded?c&&c.apply(b,m):(this._renderer.updateExpandVisuals(h,"progress"),this._treeModel.getChildren(h._item,function(a){b.destroyed||(b._renderer.updateExpandVisuals(h,!0),h._expanded||(h._expanded=!0,b._generateChildren(a,h._depth+1,h),b._rowsChanged()),c&&c.apply(b,m))}))}},_removeChildRows:function(d){for(var c=d===this._id,m=!1,h=-1,b=[],a=g.$$array(".treeTableRow",this._parent),l=0;l<a.length;l++){var f=a[l];if(m)break;c?f._depth>h?b.push(f):m=!0:f.id===d&&(c=!0,h=f._depth)}for(d=
0;d<b.length;d++)c=b[d],c.parentNode.removeChild(c)},_removeAllRows:function(){for(var d=g.$$array(".treeTableRow",this._parent),c=0;c<d.length;c++)d[c].parentNode.removeChild(d[c])},collapse:function(d){d="string"===typeof d?d:this._treeModel.getId(d);var c=g.node(d);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)},getIndent:function(){return this._indent}};n.prototype.constructor=
n;return{TableTree:n}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function g(g,d){this.firstLevelChildren=g;this.reset();this._init(d)}g.prototype={_init:function(g){g&&(this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc)},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var d=this._getChildren(g),d=d&&0<d.length;this.isExpanded&&d&&(d=this.isExpanded(g));return d},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(g=this._getChildren(g),this.setCursor(g[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&c.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(g){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(g&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var c=this;return this.forceExpandFunc(d,"last",function(d){d&&
c.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(g,d){for(var c=this.topLevel(g),m=this._getChildren(g.parent),m=c?this.firstLevelChildren:m,h=0;h<m.length;h++)if(m[h]===g)return 0===h&&!d?c?null:g.parent:h===m.length-1&&d?c?null:this._findSibling(g.parent,d):d?m[h+1]:m[h-1];return null},_inParentChain:function(g,d){for(var c=g.parent;c;){if(c===d)return!0;c=c.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,d,c){this.setCursor(d);var m=[];for(m.push(d);;){if(this.iterate(g))m.push(this.cursor());else break;if(c===this.cursor())return m}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(g,d){var c=this.cursor(),
m=this._scan(!0,g,d);m||(m=this._scan(!1,g,d));this.setCursor(c);return m},iterate:function(g,d){return g?this._forward(d):this._backward(d)},iterateOnTop:function(g,d){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):d&&0<this.firstLevelChildren.length&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){return!this._cursor?null:this._inParentChain(this._cursor,g)?(this.setCursor(g),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent)},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return g}();return k});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,g,n){var d={},c=-1!==navigator.userAgent.indexOf("iPad"),m=-1!==window.navigator.platform.indexOf("Mac");d.ExplorerNavHandler=function(){function d(b,a,c){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var f=this;this._modelIterator=
new g.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return f.explorer.renderer.isExpandable(a)}:function(a){return f.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,c){return f.explorer.forceExpandFunc(a,b,c)}:void 0});this._init(c);(!c||!1!==c.setFocus)&&b.focus();c=function(a){if(n.isFormElement(a.target)||f.explorer.preventDefaultFunc&&f.explorer.preventDefaultFunc(a,
f._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return f.onDownArrow(a);if(a.keyCode===k.KEY.UP)return f.onUpArrow(a);if(a.keyCode===k.KEY.RIGHT)return f.onRightArrow(a);if(a.keyCode===k.KEY.LEFT)return f.onLeftArrow(a);if(a.keyCode===k.KEY.SPACE)return f.onSpace(a);if(a.keyCode===k.KEY.ENTER)return f.onEnter(a)};b.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(a){if(f.explorer.onFocus)f.explorer.onFocus(!1);else f.toggleCursor(null,!1)};
b.addEventListener("blur",c,!1);this._listeners.push({type:"blur",listener:c});c=function(a){if(f.explorer.onFocus)f.explorer.onFocus(!0);else f.toggleCursor(null,!0)};b.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});this._parentDiv=b}d.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;b&&(this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc)},_ctrlKeyOn:function(b){return m?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&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b,a){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(f){c._clearSelection(a);for(var e=0;e<f.length;e++)c._selections.push(f[e]);0<c._selections.length?c.cursorOn(c._selections[0],
!0,!1,b):c.cursorOn(null,!1,!1,b);c._shiftSelectionAnchor&&0<=c._inSelection(c._shiftSelectionAnchor)||(c._shiftSelectionAnchor=null)})},refreshModel:function(b,a,c,f){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():c&&(this.topIterationNodes=c);this._modelIterator.setTree(this.topIterationNodes);!f&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){b=this.model.getId(b);for(var a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){this._selectionPolicy!==
b&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===b)&&this._toggleSelectionClass("disabledRow","readonlySelection"===b),this._selectionPolicy=b,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(b,a,c){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0):this._isRowSelectable(b)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),0<=a?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)),c&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(b,a){b||(b=this.currentModel());var c=this._getGridChildren(b);if(c&&1<c.length||
0===a&&c){0!==a&&this.toggleCursor(b,!1);var f=this._currentColumn,e=!0,f=f+a;0>f?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),f=e?c.length-1:this._currentColumn):f>=c.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),f=e?0:this._currentColumn);this._currentColumn=f;0!==a&&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))&&0<b.length?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=this._parentDiv,c;b&&b!==a&&"grid"!==(c=b.getAttribute("role"))&&"tree"!==c&&"treegrid"!==c;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var c=this.getRowDiv(b),f=this.getCurrentGrid(b);f?(c&&(a?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),f.domNode&&(c=this.getAriaContainerElement(f.domNode),
a?(f.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",f.domNode.id)):f.domNode.classList.remove("treeIterationCursor"))):c&&(a?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,c,f){var e,d;if(b||a){if(d===this._modelIterator.cursor())return;e=this._modelIterator.cursor();d=b;this._modelIterator.setCursor(d)}else e=this._modelIterator.prevCursor(),
d=this._modelIterator.cursor();if(e!==d||a)if(this.toggleCursor(e,!1),!a||d){this.moveColumn(null,0);this.toggleCursor(d,!0);if((b=this.getRowDiv())&&!f){f=b.parentNode;for(a=document.documentElement;f&&f!==a;){var h=window.getComputedStyle(f,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;f=f.parentNode}f&&(a=!0,b.offsetTop<=f.scrollTop?(a=!1,void 0===c&&(c=!1)):b.offsetTop+b.offsetHeight>=f.scrollTop+f.clientHeight&&(a=!1,void 0===c&&(c=!0)),a||b.scrollIntoView(!c))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,
d)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;b=this.model.getId(b);var a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:k.node(b)},iterate:function(b,a,c,f){var e=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(f){f=this.currentModel();for((e=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,c);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,c);e||(this.cursorOn(f,!0,!1,!0),this._setCursorOnItem(b,c))}else(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,c)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(c){(c=this.getRowDiv(c))&&(a?c.classList.add(b):c.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var c=this._inSelection(this._modelIterator.prevCursor()),
f=this._inSelection(this._modelIterator.cursor());0<=c&&0<=f?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var c=this.getRowDiv(b);if(c){var f=k.node(this.explorer.renderer.getCheckBoxId(c.id)),e=a?!f.checked:!0;if(e!==f.checked)this.explorer.renderer.onCheck(c,f,e,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var c=this.getRowDiv(b);c&&(0>this._inSelection(b)?c.classList.add("checkedRow"):c.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var c=this._getGridChildren(b);if(c)for(var f=0;f<c.length;f++)if(a.target===c[f].domNode)return!0;return!1},onClick:function(b,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(b)))k.stop(a);else{var l=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==l&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),c)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(l=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var f=0;f<l.length;f++)this.setSelection(l[f],!0)}}else this.setSelection(b,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&
!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=this.currentModel(),c=this._getGridChildren(a);return c&&1<c.length?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(c)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(a)),c.href&&(this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,
a),b.preventDefault(),!1},setIsNotSelectable:function(b,a){b.isNotSelectable=a},disableItem:function(b){var a=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var a=this.getRowDiv(b);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,
!1))}};return d}();d.ExplorerNavDict=function(){function c(b){this._dict={};this._model=b}c.prototype={addRow:function(b,a){var c=this._model.getId(b);this._dict[c]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var c=this._model.getId(b);return this._dict[c]?(!this._dict[c].gridChildren&&a&&(this._dict[c].gridChildren=[]),this._dict[c].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return c}();return d});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(k,g,n,d,c,m){var h={};h.Explorer=function(){function b(a,b,c,e){this.registry=a;this.renderer=c;this.selection=b;this.commandService=e;this.renderer&&(this.renderer.explorer=this);this.myTree=null}b.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceholder:function(a,b,c){var e=null;if(a=this.getRow(a)){var e=a.parentNode,d=document.createElement("tr");d.id=b+"placeHolderRow";d.classList.add("navRow");var h=document.createElement("td");h.id=b+"placeHolderCol";h.classList.add("navColumn");d.appendChild(h);
c?e.insertBefore(d,a.nextSibling):e.insertBefore(d,a);h.style.paddingLeft=a.firstChild.style.paddingLeft;e={wrapperNode:d,refNode:h,destroyFunction:function(){try{d&&d.parentNode&&d.parentNode.removeChild(d)}catch(a){}}}}return e},getRow:function(a){if(a=this.model.getId(a))return n.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){a=this._navHandler.getTopLevelNodes();
for(var 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(!(void 0===a||null===a))for(var e=a.length,c=0;c<e;c++)b._expandRecursively(a[c])})})}},createTree:function(a,b,f){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=a+"innerTree",
h=n.node(e);h&&n.empty(h);b&&(b.rootId=e);this.model=b;this._parentId=a;this._treeOptions=f;if(!f||f&&!f.noSelection)this.selectionPolicy=f?f.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:e,model:b,parent:a,onComplete:f?f.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:f?!!f.showRoot:!1,indent:f?f.indent:void 0,onCollapse:f?f.onCollapse:void 0,navHandlerFactory:f?f.navHandlerFactory:void 0,
tableElement:f?f.tableElement:void 0,tableBodyElement:f?f.tableBodyElement:void 0,tableRowElement:f?f.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var c=a.getSelection(),e=0;e<c.length;e++){var d=a.getRowDiv(c[e]);d&&d.parentNode&&
(d=this.getNavDict().getValue(this.model.getId(c[e])),d.model&&b.push(d.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){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new c.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();h.createExplorerCommands=function(b,a){function c(e){return"function"===
typeof e.getItemCount&&0<e.getItemCount()?a?a(e):!0:!1}var f=new m.Command({tooltip:k["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 m.Command({tooltip:k["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(f);b.addCommand(e)};h.ExplorerModel=function(){function b(a,b,c){this.rootPath=a;this.fetchItems=b;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return b}};return b}();h.ExplorerFlatModel=function(){function b(a,b,c){this.rootPath=a;this.fetchItems=b;this.root=c}b.prototype=new h.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};
return b}();h.ExplorerRenderer=function(){function b(a,b){this.explorer=b;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":"",this._cachePrefix=a.cachePrefix,a.getCheckedFunc&&(this.getCheckedFunc=
a.getCheckedFunc),a.onCheckedFunc&&(this.onCheckedFunc=a.onCheckedFunc),this._noRowHighlighting=a.noRowHighlighting,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;this.tableNode=a;n.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,e,d){c=c||"tool";var h=document.createElement("td");h.id=b.id+"actionswrapper";e&&h.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,c,null,d&&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 h},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(b.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=b.id;this.getCheckedFunc&&(e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&b.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on")));c.appendChild(e);var d=this;e.addEventListener("click",function(e){d.onCheck(b,e.target,e.target.checked?!1:!0,!0,!1,a)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,e,d,h){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,e,h);this.explorer.getNavHandler()&&
d&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&(b&&"cursorOnly"!==c.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var e=[],c=0;c<a.length;c++){var d=b.getValue(a[c]);if(d&&(d.rowDomNode&&d.model)&&(e.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=n.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+"expanded"];"string"===typeof c&&(c=0<c.length?JSON.parse(c):null);var e;if(c)for(e=0;e<c.length;e++)if(n.node(c[e])){this._expanded.push(c[e]);var d=this;this.tableTree.expand(c[e],function(){d._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,b){var c=n.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,e){var d=document.createElement("span");
d.id=this.expandCollapseImageId(a.id);b.appendChild(d);d.classList.add(this._twistieSpriteClass);d.classList.add(this._collapseImageClass);if(c){var h=document.createElement("span");b.appendChild(h);h.classList.add(e||"imageSprite");h.classList.add(c)}var m=this;d.onclick=function(e){if(!m.explorer.getNavHandler().isDisabled(a)){m.tableTree.toggle(a.id);if(m.tableTree.isExpanded(a.id))m._expanded.push(a.id),m.explorer.postUserExpand&&m.explorer.postUserExpand(a.id);else for(var b in m._expanded)if(m._expanded[b]===
a.id){m._expanded.splice(b,1);break}(e=m._getUIStatePreferencePath())&&window.sessionStorage&&m._storeExpansions(e)}};return d},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(n.$(".sectionTreeTable",this.tableNode.parentNode)||n.$(".treetable",this.tableNode.parentNode))&&n.$$array(".treeTableRow",this.tableNode).forEach(function(a,
b){var c=!(b%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",e="lightSectionTreeTableRow"===c?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(c);a.classList.remove(e)})},updateCommands:function(){if(this.commandService)for(var a=n.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],e=n.node(c.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();h.SelectionRenderer=function(){function b(a,b){this._init(a);this.explorer=b}b.prototype=new h.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var e=0,d=this.getCellHeaderElement(e);d;)0<
d.innerHTML.length&&d.classList.add("navColumn"),c.appendChild(d),d=this.getCellHeaderElement(++e);b.appendChild(c);0<e&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var c=this.explorer.getNavDict();if(c){"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");c.addRow(a,b);var e=this;b.addEventListener("click",function(b){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,
b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c)}for(var c=0,d=this.getCellElement(c,a,b);d;)b.appendChild(d),0===c?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle(a)):d.classList.add("navColumn"):this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),d=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,b,c){};return b}();
h.SimpleFlatModel=function(){function b(a,b,c){this.items=a;this.getKey=c;this.idPrefix=b;this.root={children:a}}b.prototype=new h.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return h});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(k,g,n,d,c,m,h){function b(){return k.toUrl?(new URL(k.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var b={};a.getPropertyKeys().forEach(function(e){"objectClass"!==e&&("service.names"!==e&&"service.id"!==e&&"__plugin__"!==e)&&(b[e]=a.getProperty(e))});return b}function l(a){return c.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function f(e,c){var f=e.getServiceReferences(c||"orion.page.link"),h=n.matchResourceParameters(window.location.href),m={OrionHome:b(),Location:h.resource},p=[];f.forEach(function(b){b=a(b);if(b.uriTemplate&&(b.nls||b.name)){var e=(new d(b.uriTemplate)).expand(m),e=n.validateURLScheme(e);b.href=e;b.nls?p.push(l(b)):(b.textContent=b.name,p.push((new g).resolve(b)))}});return g.all(p)}function e(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function p(a){this.allPageLinks=a;this.allPageLinks.sort(s)}function s(a,b){var e=a.textContent&&a.textContent.toLowerCase(),c=b.textContent&&b.textContent.toLowerCase();return e<c?-1:e>c?1:0}var q;m.mixin(e.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});m.mixin(p.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var e=document.createElement("a");e.href=b;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var c;return!q?(c=[],b.getServiceReferences("orion.page.link.category").forEach(function(e){var f=a(e);if(f.id&&(f.name||f.nameKey))f.service=b.getService(e),f.nls?c.push(l(f)):(f.textContent=f.name,c.push((new g).resolve(f)))}),g.all(c).then(function(a){return q=new e(a)})):(new g).resolve(q)},
getPageLinksInfo:function(a,b){return f(a,b).then(function(a){return new p(a)})},getOrionHome:b}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/extensionCommands","require orion/Deferred orion/commands orion/regex orion/contentTypes orion/URITemplate orion/i18nUtil orion/URL-shim orion/PageLinks i18n!orion/edit/nls/messages".split(" "),function(k,g,n,d,c,m,h,b,a,l){function f(a){var b={};a.getPropertyKeys().forEach(function(e){b[e]=a.getProperty(e)});return b}var e={},p=a.getOrionHome();e._cloneItemWithoutChildren=function w(a){if(null===a||"object"!==typeof a)return a;var b=a.constructor(),e;for(e in a)"children"!==e&&"Children"!==
e&&(b[e]=w(a[e]));return b};e._getOpenWithNavCommandExtensions=function(a,b){function e(a,b){for(var c=a.getServiceReferences("orion.navigate.openWith"),f=[],l=[],d=0;d<c.length;d++){var h=c[d];if(h.getProperty("editor")===b.id){var m=h.getProperty("contentType");m instanceof Array?f=f.concat(m):f.push(m||"*/*");h=h.getProperty("excludedContentTypes");h instanceof Array?l=l.concat(h):null!==h&&"undefined"!==typeof h&&l.push(h)}}0===f.length&&(f=null);0===l.length&&(l=null);return{contentTypes:f,excludedContentTypes:l}}
for(var c=function(){for(var b=a.getServiceReferences("orion.edit.editor"),e=[],c=0;c<b.length;c++){var f=b[c],l=f.getProperty("id");e.push({id:l,"default":f.getProperty("default")||!1,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate"),validationProperties:f.getProperty("validationProperties")||[]})}return e}(),f=[],l,d=0;d<c.length;d++){var h=c[d],m=e(a,h),m={properties:{name:h.name||h.id,nameKey:h.nameKey,
id:"eclipse.openWithCommand."+h.id,contentType:m.contentTypes,excludedContentTypes:m.excludedContentTypes,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:h["default"]?"default":"editor",validationProperties:h.validationProperties},service:{}};"orion.editor"===h.id?l=m:f.push(m)}l&&f.push(l);return f};e._makeValidator=function(a,b,e,f){function l(a,b,e,c,f){var d=!1,h;if("!"===b.charAt(0))return"undefined"===typeof a[b.substring(1)];if("undefined"!==typeof a[b]){if("undefined"===typeof e)h=
a[b],d=!0;else if("string"===typeof e){if(!typeof("string"===a[b]))return!1;if(c.variableName){if(e=RegExp(e).exec(a[b]))d=e[0],h="before"===c.variableMatchPosition?a[b].substring(0,e.index):"after"===c.variableMatchPosition?a[b].substring(e.index+d.length):"only"===c.variableMatchPosition?d:a[b],d=!0}else return RegExp(e).test(a[b])}else a[b]===e&&(h=a[b],d=!0);b=c.variableName;c=c.replacements;if(d&&b&&(f[b]=h,f.itemCached=a,c)){if("string"!==typeof h)return window.console.log("Cannot replace "+
b+", value is not a string: "+h),d;for(a=0;a<c.length;a++){h=!1;if(c[a].pattern){e=c[a].pattern;var m=c[a].replacement||"";f[b]=f[b].replace(RegExp(e),m).replace(RegExp(e),m)}else h=!0;h&&window.console.log("Invalid replacements specified in validation property.  "+c[a])}}return d}return!1}function d(a,b,e,c){var f=e.match,h,m;if(0<=(h=b.indexOf("["))){if(0>(m=b.indexOf("]")))return!1;var p=b.substring(0,h),g;if(!(g=a[p])||!Array.isArray(g))return!1;h=b.substring(h+1,m);h=parseInt(h,10);if(isNaN(h))return!1;
0>h&&(h+=g.length);b=b.substring(m+1);b=p+":"+String(h)+b}return 0<=b.indexOf("|")?(h=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),d(a,h,e,c)?!0:d(a,b,e,c)):0<=b.indexOf(":")?(h=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[h]?d(a[h],b,e,c):!1):l(a,b,f,e,c)}function h(b,e,f){if(f.info.validationProperties)for(var l=0;l<f.info.validationProperties.length;l++){var m=f.info.validationProperties[l];if("undefined"!==typeof m.source){if(!d(b,m.source,m,f))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var l=!0,p=e?c.getFilenameContentType(b.Name,e):null,p=p||{id:"application/octet-stream"};f.info.excludedContentTypes&&e&&(l=f.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==p.id.search(a)?!1:!0}));l&&(f.info.contentType&&e)&&(l=f.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==p.id.search(a)?!0:!1}));return l}return{info:a,validationFunction:function(a){"function"===typeof f&&(a=f.call(this,
a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var b=0;b<a.length;b++)if(!h(a[b],e,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b[e]=a[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var c=this.info.validationProperties[e];
c.source&&c.variableName&&(this.itemCached===a&&this[c.variableName]||d(a,c.source,c,this),a[c.variableName]?window.console.log("Variable name "+c.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[c.variableName]=this[c.variableName])}b.OrionHome=p;return(new m(this.info.uriTemplate)).expand(b)}return null}}};var s=l.UnnamedCommand;e._createCommandOptions=function(a,b,c,f,l,d){function m(h,p){var g=e._makeValidator(a,c,f,d);h.visibleWhen=
g.validationFunction.bind(g);if(l)if(g.generatesURI.bind(g)())h.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return g.getURI.bind(g)(a)};else{var k=a;h.callback=function(a){var f;if(k.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,f=e._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){f=[];for(var l=0;l<a.items.length;l++)f.push(e._cloneItemWithoutChildren(a.items[l]))}else f=e._cloneItemWithoutChildren(a.items);if(c)var d=c.getService("orion.page.progress");
b.run?d?d.progress(b.run(f),"Running command: "+h.name):b.run(f):c&&(d?d.progress(c.getService(b).run(f),"Running command: "+h.name):c.getService(b).run(f))}}p.resolve(h)}var p=new g;if(a.nls){var k=function(b){var e;b?(e=a.tooltipKey&&b[a.tooltipKey],b=a.nameKey&&b[a.nameKey]||a.name||s,e=e||a.tooltip||""):(b=a.name||a.nameKey||s,e=a.tooltip||a.tooltipKey||"");m({name:b,image:a.image,id:a.id||a.name,tooltip:e,isEditor:a.isEditor,showGlobally:a.showGlobally},p)};h.getMessageBundle(a.nls).then(k,k.bind(this,
null))}else m({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},p);return p};e.getOpenWithCommand=function(a,b,c){var f;a=c||e.getOpenWithCommands(a);for(c=0;c<a.length;c++)if(a[c].visibleWhen(b)){var l="default"===a[c].isEditor;if(!f||l)if(f=a[c],l)break}return f};e.getOpenWithCommands=function(a){var b=[],e;for(e in a._commandList){var c=a._commandList[e];c.isEditor&&b.push(c)}return b};var q;e.createAndPlaceFileCommandsExtension=function(a,
b,c,f,d,h){return e.createFileCommands(a,null,h?"all":void 0,!!h,b).then(function(a){d&&0<a.length&&(b.addCommandGroup(c,"eclipse.openWith",1E3,l.OpenWith,d,null,null,null,"dropdownSelection"),b.addCommandGroup(c,"eclipse.fileCommandExtensions",1E3,l.OpenRelated,d));a.forEach(function(a){var e=null;d&&(e=a.isEditor?d+"/eclipse.openWith":d+"/eclipse.fileCommandExtensions");b.registerCommandContribution(c,a.id,f,e)});return{}})};e.createFileCommands=function(a,b,c,f,l){c=void 0===c?"global":c;f=void 0===
f?!0:f;var d=[];e._cachedFileCommands||e._createCachedFileCommands(a);("all"===c||"global"===c)&&e._cachedFileCommands.forEach(function(a){var b=a.properties;("all"===c||b.forceSingleItem&&b.showGlobally)&&d.push(a)});return g.when(function(){var e=a.getService("orion.core.contentTypeRegistry")||b;return q||g.when(e.getContentTypes(),function(a){return q=a})}(),function(){f&&(e._cachedOpenWithExtensions||(e._cachedOpenWithExtensions=e._getOpenWithNavCommandExtensions(a,q)),d=d.concat(e._cachedOpenWithExtensions),
l._addedOpenWithCommands=f);var b=d.map(function(b){var c=b.properties;b=b.service;var f=l.findCommand(c.id||c.name);return f?(new g).resolve(f):e._createCommandOptions(c,b,a,q,!0).then(function(a){a=new n.Command(a);l.addCommand(a);return a})});return g.all(b,function(a){return{_error:a}}).then(function(a){return a})})};e._createCachedFileCommands=function(a){var b=a.getServiceReferences("orion.navigate.command");e._cachedFileCommands=[];for(var c=0;c<b.length;c++)if("orion.navigateFromMetadata"!==
b[c].getProperty("id")){var l=a.getService(b[c]),d=f(b[c]);e._cachedFileCommands.push({properties:d,service:l})}};e.getFileCommandIds=function(){var a=[];if(e._cachedFileCommands)e._cachedFileCommands.length&&(a=e._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};e.createOpenWithCommands=function(a,b,c){return c&&c._addedOpenWithCommands?(new g).resolve(e.getOpenWithCommands(c)):e.createFileCommands(a,b,
"none",!0,c)};return e});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(k,g,n,d){function c(b,a,c){return 0<b?1===b?a+" ":b+" "+c+" ":""}function m(b){b=new Date(b);var a=(new Date).getTime()-b.getTime();b=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*b,l=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*l,f=Math.floor(a/1E3/60/60/24),a=a-864E5*f,e=Math.floor(a/1E3/60/60),d=Math.floor((a-36E5*e)/1E3/60),a=c(b,"a year","years"),h=
c(l,"a month","months"),m=c(f,"a day","days"),g=c(e,"an hour","hours"),d=c(d,"a minute","minutes"),k="";a?k=0<b?a:a+h:h?k=0<l?h:h+m:m?k=0<f?m:m+g:g?k=0<e?g:g+d:d&&(k=d);return k?k+"ago":"Just now"}function h(b){this._parentDomNode=n.node(b.parent);this._commitInfo=b.commitInfo}k.mixin(h.prototype,{destroy:function(){},_simpleMessage:function(b){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var c=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");c&&0<c.length&&(a=c[0]);10<b&&a.length>
b&&(a=a.substring(0,b-3)+"...")}return a},_generateMessageNode:function(b){var a;if(this._commitInfo.URL||this._commitInfo.SHA1){a=document.createElement("a");if(this._commitInfo.SHA1){var c=(new URL("commit",window.location.href)).href,c=decodeURIComponent(c);a.href=(new g(c+"{/SHA1}")).expand(this._commitInfo)}else a.href=this._commitInfo.URL;a.classList.add("commitInfolink")}else a=document.createElement("span");a.appendChild(document.createTextNode(b));return a},_requestPhotoURL:function(b,a){var c=
this,f=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);f.query.set("contributorUserId",b);d("GET",f.href,{timeout:15E3}).then(function(b){b=JSON.parse(b.response);a.src=b.photoURI},function(){c._useOtherPhotoURL(a)})},_useOtherPhotoURL:function(b){b.src=this._commitInfo.AvatarURL?this._commitInfo.AvatarURL:"https://www.gravatar.com/avatar/?d\x3dmm"},renderSimple:function(b){this._parentDomNode.appendChild(this._generateMessageNode(this._simpleMessage(b)))},
render:function(b,a){var c=this._commitInfo.Author&&this._commitInfo.Author.Date?m(this._commitInfo.Author.Date):"",f=this._simpleMessage(-1),e=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",d=b;d||(d="Commit");d="Last "+d;if(a){var h=document.createElement("div"),g=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,g):this._useOtherPhotoURL(g);g.classList.add("commitInfoAvatar");h.appendChild(g)}else h=
document.createElement("div"),h.classList.add("commitInfoLabelContainer"),h.appendChild(document.createTextNode(d.toUpperCase()));this._parentDomNode.appendChild(h);h=document.createElement("div");h.classList.add("commitInfoMessageContainer");g=document.createElement("div");g.classList.add("commitInfoAutorContainer");var k=document.createDocumentFragment(),w=document.createElement("span");w.appendChild(document.createTextNode(e));w.classList.add("navColumnBold");a?(e=document.createElement("span"),
e.appendChild(document.createTextNode(d)),e.classList.add("navColumnBold"),k.textContent=c?"${0} by ${1} "+c+".":"${0} by ${1}.",c=[e,w]):(k.textContent=c?"by ${0} "+c+".":"by ${0}.",c=[w]);n.processDOMNodes(k,c);g.appendChild(k);h.appendChild(g);c=document.createElement("div");c.classList.add("commitInfoMessageTextContainer");c.appendChild(this._generateMessageNode(f));h.appendChild(c);this._parentDomNode.appendChild(h)}});return{CommitInfoRenderer:h,calculateTime:m}});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/widgets/browse/commitInfoRenderer orion/webui/littlelib".split(" "),function(k,g,n,d,c,m,h,b,a){function l(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function f(a,b,e,f,d,k,n,y,H){b=m.clone(b);
var A;if(b.Directory)A=document.createElement("a"),A.className="navlinkonpage",f=!a?p:new h(a+"#{,resource,params*}"),A.href=f.expand({resource:b.ChildrenLocation}),b.Name&&A.appendChild(document.createTextNode(b.Name));else{d||(d=c.getOpenWithCommands(e));A=document.createElement("a");A.className="navlink targetSelector";k&&"object"===typeof k&&Object.keys(k).forEach(function(a){A[a]=k[a]});var J=null,E=null;if(J=y?y.holderDom:A)E=document.createElement("span"),E.className="core-sprite-file modelDecorationSprite thumbnail",
J.appendChild(E);b.Name&&A.appendChild(document.createTextNode(b.Name));var C=b.Location;n&&"object"===typeof n&&(b.params={},m.mixin(b.params,n));(a=c.getOpenWithCommand(e,b,d))&&(C=a.hrefCallback({items:b}));g.when(f.getFileContentType(b),function(a){if(J){var e=J,c=E;if(a){var f,d=a.imageClass,h=a.image;d?(f=document.createElement("span"),f.className+=d,f.classList.add("thumbnail")):h&&(f=document.createElement("img"),f.src=h,f.classList.add("thumbnail"));f&&e.replaceChild(f,c)}}A.href=C;H&&"function"===
typeof H.updateFileNode&&H.updateFileNode(b,A,l(a))})}A.addEventListener("click",function(){s=b}.bind(this),!1);return A}function e(a,b,e,c){this.explorer=b;this.commandService=e;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var p=new h("#{,resource,params*}"),s;e.prototype=new n.SelectionRenderer;e.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};e.prototype.tableCallback=function(a){a.setAttribute("aria-label",
k.Navigator);a.setAttribute("role","presentation")};e.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};e.prototype.emptyCallback=function(b){var e=document.createElement("tr"),c=document.createElement("td");c.colSpan=this.oneColumn?1:3;var f=document.createElement("div");f.classList.add("noFile");f.textContent=k.NoFile;var d=document.createElement("span");d.appendChild(document.createTextNode(k.File));a.processDOMNodes(f,[d]);c.appendChild(f);e.appendChild(c);b.appendChild(e)};
e.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};e.prototype.getCommitRenderer=function(a,e){return new b.CommitInfoRenderer({parent:a,commitInfo:e})};e.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};e.prototype.setTarget=function(a){this.target=a};e.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};e.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=f(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};e.prototype.updateFileNode=function(a,b,e){};e.prototype.showFolderLinks=!0;e.prototype.getCellElement=function(a,b,e){var l=b.LastCommit?2:1,h=b.LastCommit?3:2,m=b.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),l=document.createElement("span"),l.id=e.id+"MainCol",l.setAttribute("role","presentation"),a.appendChild(l),a.setAttribute("role","presentation"),l.className="mainNavColumn",b.Directory?(this.getExpandImage(e,l),h=this.createFolderNode(b),l.appendChild(h),this.explorer._makeDropTarget(b,h),this.explorer._makeDropTarget(b,e)):(this.openWithCommands||(this.openWithCommands=c.getOpenWithCommands(this.commandService)),h=f("",b,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),l.appendChild(h)),h&&(h.id=e.id+"NameLink",1===h.nodeType&&(d.addNavGrid(this.explorer.getNavDict(),b,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,l,b,this.explorer,"tool",null,!0),a;case l:if(this.oneColumn)return null;e=document.createElement("td");b.LocalTimeStamp&&(e.textContent=this.getDisplayTime(b.LocalTimeStamp));return e;case h:if(this.oneColumn)return null;
e=document.createElement("td");!b.Directory&&"number"===typeof b.Length&&(b=parseInt(b.Length,10)/1024,e.textContent=Math.ceil(b).toLocaleString()+" KB");e.style.textAlign="right";return e;case m:if(this.oneColumn||!b.LastCommit)return null;e=document.createElement("td");this.getCommitRenderer(e,b.LastCommit).renderSimple(60);return e}};e.prototype.constructor=e;return{NavigatorRenderer:e,isImage:l,getClickedItem:function(){return s},createLink:f}});
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(k,g,n,d,c,m,h,b,a){function l(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function f(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new l(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}l.prototype.makeRenderFunction=function(e,f,l,m,r){var w=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||b.createOpenWithCommands(w,e,u);var z=this;return function(b,w,y,H){a.when(z.openWithCommands,function(a){if(y)n.empty(f),a=document.createElement("div"),a.appendChild(document.createTextNode(k["Search failed."])),f.appendChild(a),"function"===typeof m&&m(f);else{var z=
function(){function a(b,e){var c=e.folderName?e.folderName:e.path,f=document.createElement("span");f.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+c+" "));b.appendChild(f)}var b={};return function(e,c){var f=c.name;if(b.hasOwnProperty(f)){a(e,c);var l=b[f];"function"===typeof l&&(b[f]=null,l())}else b[f]=function(){a(e,c)}}}(),E=!1;n.empty(f);if(b&&0<b.length){var C=document.createElement("table");C.setAttribute("role","presentation");for(var x=0;x<b.length;x++){var D=
b[x],B;E||(E=!0,l&&(B=C.insertRow(0).insertCell(0),B.textContent=l));B=C.insertRow(-1).insertCell(0);B.colspan=2;r&&r(B);var I={Name:D.name,Directory:D.directory,Location:D.path||D.location},G=null;"number"===typeof D.LineNumber&&(G={},G.line=D.LineNumber);if(H&&H.keyword&&!H.nameSearch){var K=c.generateSearchHelper(H),G=G||{};G.find=K.inFileQuery.searchStr;G.regEx=K.inFileQuery.wildCard?!0:void 0}I=h.createLink(g.toUrl("edit/edit.html"),I,u,e,a,{"aria-describedby":(D.folderName?D.folderName:D.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},G);D.LineNumber&&I.appendChild(document.createTextNode(" (Line "+D.LineNumber+")"));B.appendChild(I);z(B,D)}f.appendChild(C);"function"===typeof m&&m(f)}!E&&w&&(a=d.formatMessage(k["No matches found for ${0}"],w),n.empty(f),f.appendChild(document.createTextNode(a)),"function"===typeof m&&m(f))}})}};f.prototype={search:function(a,b,f){var l=function(a){for(var e=[],f=0;f<a.response.docs.length;f++){var l=a.response.docs[f],d=l.Location,h=c.path2FolderName(l.Path?
l.Path:l.Location,l.Name),m=h?h:d;(b?0<=m.indexOf(b):1)&&e.push({name:l.Name,path:d,folderName:h,directory:l.Directory,lineNumber:l.LineNumber})}return e};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){f(l(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);f(l(b),c,null,a)},function(a){f(null,
null,a,null)})}catch(d){"string"===typeof d&&-1<d.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){f(l(b),null,null,a)}):"string"===typeof d&&-1<d.indexOf("search")&&!a.nameSearch?(new m.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){f(l(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(d)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);n.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",f=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?f="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(f=a);f?(this.setLocationbyURL(f.Location),c=f.Name,this._childrenLocation=f.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);f=n.node("search");c||(c="");if(f&&f.placeholder){f.value="";var l=d.formatMessage(k["Search ${0}"],c);f.placeholder=30<l.length?l.substring(0,27)+"...":d.formatMessage(k["Search ${0}"],c)}f&&f.title&&(f.title=k["Type a keyword or wild card to search in "]+c)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,f){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:f&&f.sort?f.sort:"Path asc",rows:f&&f.rows?f.rows:40,start:0,caseSensitive:f?f.caseSensitive:void 0,regEx:f?f.regEx:void 0,fileType:f?f.fileType:void 0,fileNamePatterns:f&&f.fileNamePatterns?f.fileNamePatterns:void 0,keyword:a,replace:f?f.replace:void 0}}};f.prototype.constructor=f;return{Searcher:f}});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(k,g,n){return{slideoutHTMLFragment:function(d){var c=document.createElement("div");c.innerHTML=n;var m=g.$("#slideContainer",c);m.id=d+m.id;m=g.$("#pageCommandParameters",c);m.id=d+m.id;m=g.$("#pageCommandDismiss",c);m.id=d+m.id;return c.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(k){function g(d,c,m,h,b,a){this.type=a||"keydown";this.keyCode="string"===typeof d&&"keydown"===this.type?d.toUpperCase().charCodeAt(0):d;this.mod1=void 0!==c&&null!==c?c:!1;this.mod2=void 0!==m&&null!==m?m:!1;this.mod3=void 0!==h&&null!==h?h:!1;this.mod4=void 0!==b&&null!==b?b:!1}function n(d){this.keys=d}g.prototype={getKeys:function(){return[this]},match:function(d,c){if(void 0!==c){if(0!==c)return!1}else if(d instanceof Array){if(1<d.length)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(k.isOpera?d.which:void 0!==d.charCode?d.charCode:d.keyCode)?this.mod1!==(k.isMac?d.metaKey:d.ctrlKey)||"keydown"===this.type&&this.mod2!==d.shiftKey||this.mod3!==d.altKey||k.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d||this.keyCode!==d.keyCode||this.mod1!==d.mod1||this.mod2!==d.mod2||this.mod3!==d.mod3||this.mod4!==d.mod4||this.type!==d.type?!1:!0}};n.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(d,c){var m=this.keys;if(void 0!==c)return c>m.length?!1:m[c].match(d)?c===m.length-1?!0:c+1:!1;d instanceof Array||(d=[d]);if(d.length>m.length)return!1;var h;for(h=0;h<d.length;h++)if(!m[h].match(d[h]))return!1;return h===m.length?!0:h},equals:function(d){if(!d.keys||d.keys.length!==this.keys.length)return!1;for(var c=0;c<d.keys.length;c++)if(!d.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:g,KeyStroke:g,KeySequence:n}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(k,g,n){function d(c,d){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=d}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&n.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&n.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(c,d,h){"string"===typeof c&&(c=n.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=h;var b=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!b)return!1;this._activeElements.focusNode=b;c=n.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===c.length){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=k.Close;d.appendChild(c);var a=this;c.addEventListener("click",function(b){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);b&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){b.focus();b.select&&b.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,d){n.$$array("input",d).forEach(function(b){"checkbox"===b.type?c.parameters.setValue(b.parameterName,b.checked):"button"!==b.type&&c.parameters.setValue(b.parameterName,b.value.trim())});n.$$array("textArea",d).forEach(function(b){c.parameters.setValue(b.parameterName,b.value.trim())});var h=c.parameters.getParameterElement;h&&c.parameters.forEach(function(b){(b=h(b,d))&&("checkbox"===b.type?
c.parameters.setValue(b.parameterName,b.checked):"button"!==b.type?c.parameters.setValue(b.parameterName,b.value.trim()):"textarea"!==b.type&&c.parameters.setValue(b.parameterName,b.value.trim()))});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c,d){return c.parameters?(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c,null,d))):!1},getFillFunction:function(c,d,h){var b=this;return function(a,l){var f=
null,e=function(){d&&d();b.close()},p=function(f){f.keyCode===n.KEY.ENTER&&(b._collectAndCall(c,a),e(),n.stop(f));f.keyCode===n.KEY.ESCAPE&&("function"===typeof h&&h(),e(),n.stop(f))},g=c.parameters;g.forEach(function(b){var d=g.getParameterElement?g.getParameterElement(b,a):null,l=null;!d&&b.label&&(l=document.createElement("label"),l.classList.add("parameterInput"),l.setAttribute("for",b.name+"parameterCollector"),l.textContent=b.label,a.appendChild(l));var h=b.name+"parameterCollector",l=l||a;
"text"===b.type&&"number"===typeof b.lines&&1<b.lines?(d||(d=document.createElement("textarea"),d.rows=b.lines,d.type="textarea",d.id=h,l.appendChild(d)),p=function(a){a.keyCode===n.KEY.ESCAPE&&(e(),n.stop(a))}):"boolean"===b.type?(d||(d=document.createElement("input"),d.type="checkbox",d.id=h,l.appendChild(d)),b.value&&(d.checked=!0)):(d||(d=document.createElement("input"),d.type=b.type,d.id=h,l.appendChild(d)),b.value&&(d.value=b.value));d.classList.add("parameterInput");d.setAttribute("speech",
"speech");d.setAttribute("x-webkit-speech","x-webkit-speech");d.parameterName=b.name;f||(f=d);0<b.eventListeners.length&&b.eventListeners.forEach(function(a){d.addEventListener(a.event,function(b){return a.handler(b,c)},a.capture)});d.addEventListener("keydown",p,!1)});var q=l;q||(q=document.createElement("span"),q.classList.add("layoutRight"),q.classList.add("parametersDismiss"),a.appendChild(q));var r=function(a,b){var e=document.createElement("button");b.appendChild(e);a&&e.appendChild(document.createTextNode(a));
e.classList.add("dismissButton");return e};c.parameters.hasOptionalParameters()&&(c.parameters.optionsRequested=!1,r(k.More,q).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,a);e()},!1));r(g.getSubmitName?g.getSubmitName(c):k.Submit,q).addEventListener("click",function(){b._collectAndCall(c,a);e()},!1);q=r(null,q);q.id="closebox";q.classList.add("imageSprite");q.classList.add("core-sprite-close");q.title=k.Close;q.addEventListener("click",function(a){e();
"function"===typeof h&&h()},!1);return f}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(k,g){function n(d){this._init(d)}n.prototype={_init:function(d){var c=g.node(d.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this._makeFinalHref=
d.makeFinalHref;this._maxLength=d.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents&&!this._resource.skip){d=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,c):d.href=k.toUrl("edit/edit.html")+"#"+c}else d=document.createElement("span");g.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(d));return c},addSegmentHref:function(d,c){this._makeHref?this._makeHref(d,c.Location,c):d.href=k.toUrl("edit/edit.html")+"#"+c.ChildrenLocation},buildSegments:function(d,c){if(this._resource.Parents){var m=this._resource.Parents.slice(0),h,b;m&&(m=m.slice(0),"reverse"===c&&(m=m.reverse().slice(0)),
m.forEach(function(a){a.skip||(d?(b=d,d=null):b=a.Name,h=this.buildSegment(b),this.path+=a.Name,this.addSegmentHref(h,a),h.include=!1,this.segments.push(h))}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=g.node(this._id))?g.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(d){this.crumbs.appendChild(d)},addTitle:function(d,c){var m=c||document.title;0===this.crumbs.childNodes.length&&(d=document.createElement("span"),d.appendChild(document.createTextNode(m)),
d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,c){if(!this._resource.skip){var m;m=c?c:this._resource.Name;this._makeFinalHref?(d=this.buildSegment(m),this.addSegmentHref(d,this._resource)):(d=document.createElement("span"),d.appendChild(document.createTextNode(m)));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)}},firstSegment:function(d){d&&(this.append(d),this._resource&&this._resource.Parents&&!this._resource.skip?
(d.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(d.href=""),d.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){!0===d.include&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=this._container;d.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(this.finalSegment(d,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(d)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};n.prototype.constructor=n;return{BreadCrumbs:n}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(k,g,n){function d(c){k.attach(this);this._init(c)}d.prototype={_init:function(c){this._tracking=null;this._animationDelay=501;this._closeReversely=c.closeReversely;this.$node=n.node(c.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=n.node(c.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=n.node(c.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=c.vertical||!1;var d=this.$node.classList;d.add("split");d.add(this._vertical?"splitVerticalLayout":"splitLayout");d=this.$sideNode.classList;d.add("hasSplit");d.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");d=this.$mainNode.classList;d.add("hasSplit");d.add(this._vertical?"mainPanelVerticalLayout":"mainPanelLayout");this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");c.toggle&&(this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),
this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout"));this._closeByDefault="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof c.closeByDefault&&(this._closeByDefault=c.closeByDefault);this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display=
"block";g.isIOS||g.isAndroid?(this.$node.addEventListener("touchstart",this._touchStart.bind(this),!1),this._thumb&&this._thumb.addEventListener("touchstart",this._touchStart.bind(this),!1),this.$node.addEventListener("touchmove",this._touchMove.bind(this),!1),this.$node.addEventListener("touchend",this._touchEnd.bind(this),!1)):(this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1),window.addEventListener("mouseup",this._mouseUp.bind(this),!1));window.addEventListener("resize",this._resize.bind(this),
!1)},isClosed:function(){return this._closed},getOrientation:function(){return this._vertical?"vertical":"horizontal"},setOrientation:function(c){c="vertical"===c;c!==this._vertical&&(this._vertical=c,c=this.$node.classList,c.toggle("splitLayout"),c.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",c=this.$sideNode.classList,c.toggle("sidePanelLayout"),c.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",c=this.$mainNode.classList,c.toggle("mainPanelLayout"),c.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(c=this._thumb.classList,c.toggle("splitThumbLayout"),c.toggle("splitVerticalThumbLayout")),this._initializeFromStoredSettings(),this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition())},toggleSidePanel:function(){this._thumbDown()},
openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(c){this.addEventListener("resize",function(d){c(d.node)})},_initializeFromStoredSettings:function(){var c=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof c?"closed"===c:this._closeByDefault;var c=n.bounds(this.$node.parentNode),d=n.bounds(this.$node),h;this._vertical?(h=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(h,10),this._splitTop>c.top+c.height-d.height&&
(this._splitTop=c.top+c.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(h=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(h,10),this._splitLeft>c.left+c.width-d.width&&(this._splitLeft=c.left+c.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var c=n.bounds(this.$node),d=n.bounds(this.$node.parentNode);return this.vertical?c.top-d.top:c.left-d.left},
_adjustToSplitPosition:function(c){var d=n.bounds(this.$node),h=n.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(c||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);c=this._splitTop;c=this._splitTop-h.top;this.$sideNode.style.height=c+"px";this.$sideNode.style.display="block";this.$node.style.top=c+"px"}else{this._splitWidth=d.width;if(c||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);c=this._splitLeft;c=this._splitLeft-h.left;this.$sideNode.style.width=c+"px";this.$sideNode.style.display="block";this.$node.style.left=c+"px"}this._resize()},_resize:function(c,d,h){c=c||0;var b=n.bounds(this.$node.parentNode),a=n.bounds(this.$node);this._vertical?(void 0===h&&(h=a.top-b.top),h+=a.height,this.$mainNode.style.top=h+"px"):(void 0===d&&(d=a.left-b.left),d+=a.width,this.$mainNode.style.left=d+"px");var l=this;window.setTimeout(function(){l._notifyResizeListeners(l.$mainNode);
l._notifyResizeListeners(l.$sideNode)},c)},_notifyResizeListeners:function(c){this.dispatchEvent({type:"resize",node:c})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(c,d){c||this._addAnimation();var h=this._splitTop,b=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(h=b=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=n.bounds(this.$node.parentNode),
l=n.bounds(this.$node);this._vertical?h=a.height-l.height:b=a.width-l.width}else h=b=0;this._vertical?(this.$sideNode.style.height=h+"px",this.$node.style.top=h+"px"):(this.$sideNode.style.width=b+"px",this.$node.style.left=b+"px");this._resize(this._animationDelay,b,h);c||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var f=this;window.setTimeout(function(){f._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var c=
this;window.setTimeout(function(){c.$sideNode.classList.remove(c._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");c.$mainNode.classList.remove(c._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");c.$node.classList.remove(c._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?
"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_down:function(){this.$node.classList.add("splitTracking");this.$mainNode.classList.add("panelTracking");this.$sideNode.classList.add("panelTracking")},_move:function(c,d){var h=n.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d;this._splitTop<h.top+5?this._splitTop=h.top+5:this._splitTop>h.top+h.height-5&&(this._splitTop=h.top+
h.height-5);var b=this._splitTop,b=this._splitTop-h.top;this.$node.style.top=b+"px"}else this._splitLeft=c,this._splitLeft<h.left+5?this._splitLeft=h.left+5:this._splitLeft>h.left+h.width-5&&(this._splitLeft=h.left+h.width-5),b=this._splitLeft,b=this._splitLeft-h.left,this.$node.style.left=b+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(c){if(c.target===
this._thumb)return n.stop(c),this._thumbDown();this._tracking||(this._down(c),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),n.setFramesEnabled(!1),n.stop(c))},_mouseMove:function(c){this._tracking&&this._move(c.clientX,c.clientY)},_mouseUp:function(c){this._tracking&&(n.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),n.stop(c))},_touchStart:function(c){if(1===c.touches.length){n.stop(c);if(c.target===
this._thumb)return this._thumbDown();this._down(c);this._touching=!0}},_touchMove:function(c){this._touching&&(c=c.touches,1===c.length&&(c=c[0],this._move(c.clientX,c.clientY)))},_touchEnd:function(c){0===c.touches.length&&(this._touching=!1,this._up())}};d.prototype.constructor=d;return{Splitter:d,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(k,g,n){function d(c){this.commandRegistry=c.commandRegistry;this.create();this._filterString="";this._providers=[]}d.prototype={addProvider:function(c){this._providers.push(c)},create:function(){var c=this._keyAssistDiv=document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");c.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");
d.classList.add("keyAssistInput");d.type="text";d.placeholder=k["Filter bindings"];c.appendChild(d);var h=this._keyAssistContents=document.createElement("div");h.classList.add("keyAssistContents");if(n.isIOS||n.isAndroid)h.style.overflowY="auto";c.appendChild(h);var b=this._keyAssistTable=document.createElement("table");b.tabIndex=0;b.classList.add("keyAssistList");h.appendChild(b);document.body.appendChild(c);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(a){this.filterChanged()}.bind(this));h.addEventListener(n.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&this.hide()}.bind(this));g.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){g.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var c=this._idCount=
this._keyAssistContents.scrollTop=0;c<this._providers.length;c++)this._providers[c].showKeyBindings(this);this.createHeader(k.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(c,d,h){if(this._filterString){var b=this._filterString.toLowerCase(),a;b!==this._filterString?(b=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(d).indexOf(b)&&-1===a(c).indexOf(b)&&-1===a(this._lastHeader).indexOf(b))return}var l=this._keyAssistTable.insertRow(-1);
l.id="keyAssist-keyBinding-"+this._idCount++;l.setAttribute("role","menuitem");l._execute=h;l.classList.add("keyAssistItem");l.addEventListener("click",function(a){this._selectedRow=l;this.execute();a.preventDefault()}.bind(this));h=l.insertCell(-1);h.classList.add("keyAssistName");h.appendChild(document.createTextNode(d));h=l.insertCell(-1);h.classList.add("keyAssistAccel");h.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var d=this._keyAssistTable.insertRow(-1);
d.classList.add("keyAssistSection");var d=d.insertCell(-1),h=document.createElement("h2");h.appendChild(document.createTextNode(c));d.appendChild(h)},execute:function(){window.setTimeout(function(){this.hide();var c=this._selectedRow;this._selectedRow=null;c&&c._execute&&c._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var c=this._keyAssistInput.value;this._filterString!==c&&(this._filterString=
c,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var c=document.activeElement,d=this._keyAssistDiv,c=d===c||0!==(d.compareDocumentPosition(c)&16);d.style.display="none";c&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(c){c=this._providers.indexOf(c);-1!==c&&this._providers.splice(c,
1)},select:function(c){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===d.length)this._selectedIndex=-1;else{var h=this._selectedIndex,h=(h+(c?1:-1))%d.length;0>h&&(h=d.length-1);-1!==this._selectedIndex&&(c=d[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=h;if(-1!==this._selectedIndex){this._selectedRow=c=d[this._selectedIndex];c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();
var d=c.getBoundingClientRect(),b=this._keyAssistContents,a=b.getBoundingClientRect();c.offsetTop<b.scrollTop?0===h?b.scrollTop=0:c.scrollIntoView(!0):d.bottom>a.bottom&&c.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(c){if(40===c.keyCode)this.select(!0);else if(38===c.keyCode)this.select(!1);else if(13===c.keyCode)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var d=0,d=n.isIE||n.isOpera?-c.wheelDelta:n.isFirefox?40*c.detail:-c.wheelDeltaY,h=this._keyAssistContents,b=h.scrollTop;h.scrollTop+=d;if(b!==h.scrollTop)return c.preventDefault&&c.preventDefault(),!1}};return{KeyAssistPanel:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function k(g,k){this._preferences=g;this._themeData=k;var d=k.getThemeStorageInfo();this._themeVersion=d.version;var c=g.listenForChangedSettings(d.storage,2,function(d){d.key===c&&this.apply()}.bind(this))}k.prototype={_initialize:function(g,k,d){var c,m;void 0===this._themeVersion||d.get("version")===this._themeVersion?(c=d.get(g.styleset),(m=d.get("selected"))&&(m=JSON.parse(m))):m=c=null;c||(c=k.getStyles(),d.put(g.styleset,JSON.stringify(c)));
if(!m||void 0===m[g.selectedKey])m=m||{},m[g.selectedKey]=g.defaultTheme,d.put("selected",JSON.stringify(m));d.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(g){var k=this._themeData,d=k.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,k,c);var m=JSON.parse(c.get("selected"));c=JSON.parse(c.get(d.styleset));var h;if(c)for(var b=0;b<c.length;b++)if(c[b].name===m[d.selectedKey]){h=c[b];break}g({style:h,styles:c})}.bind(this))},
setTheme:function(g,k){var d=this._themeData,c=d.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(m){this._initialize(c,d,m);var h=JSON.parse(m.get("selected"));g||(g=h[c.selectedKey]);h[c.selectedKey]=g;m.put("selected",JSON.stringify(h));k?m.put(c.styleset,JSON.stringify(k)):k=JSON.parse(m.get(c.styleset));for(var b=0;b<k.length;b++)if(k[b].name===h[c.selectedKey]){d.processSettings(k[b]);break}m.put("version",this._themeVersion)}.bind(this))},setFontSize:function(g){var k=
this._themeData,d=k.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,k,c);var m=JSON.parse(c.get("selected")),h=JSON.parse(c.get(d.styleset)),b;if(h)for(var a=0;a<h.length;a++)h[a].fontSize=g,h[a].name===m[d.selectedKey]&&(b=h[a]);c.put(d.styleset,JSON.stringify(h));k.processSettings(b)}.bind(this))}};return{ThemePreferences:k}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
DeleteUser:"Delete User Profile as well as workspaces and projects",DeleteUserComfirmation:"WARNING: This will permanently delete your user profile as well all your work!","Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value",
"JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item","Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",
general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",
Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",
showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",
autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair \x3cAngle\x3e Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: ",splitEditors:"Split Editors",splitOrientation:"Split Orientation",horizontal:"Horizontal",vertical:"Vertical"});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/editor/eventTarget",[],function(){function k(){}k.addMixin=function(g){var n=k.prototype,d;for(d in n)n.hasOwnProperty(d)&&(g[d]=n[d])};k.prototype={addEventListener:function(g,k,d){this._eventTypes||(this._eventTypes={});var c=this._eventTypes[g];c||(c=this._eventTypes[g]={level:0,listeners:[]});c.listeners.push({listener:k,useCapture:d})},dispatchEvent:function(g){var k=g.type;this._dispatchEvent("pre"+k,g);this._dispatchEvent(k,g);this._dispatchEvent("post"+k,g)},_dispatchEvent:function(g,
k){var d=this._eventTypes?this._eventTypes[g]:null;if(d){var c=d.listeners;try{if(d.level++,c)for(var m=0,h=c.length;m<h;m++)if(c[m]){var b=c[m].listener;"function"===typeof b?b.call(this,k):b.handleEvent&&"function"===typeof b.handleEvent&&b.handleEvent(k)}}finally{if(d.level--,d.compact&&0===d.level){for(m=c.length-1;0<=m;m--)c[m]||c.splice(m,1);0===c.length&&delete this._eventTypes[g];d.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:void 0!==this._eventTypes[g]},removeEventListener:function(g,
k,d){if(this._eventTypes){var c=this._eventTypes[g];if(c){for(var m=c.listeners,h=0,b=m.length;h<b;h++){var a=m[h];if(a&&a.listener===k&&a.useCapture===d){0!==c.level?(m[h]=null,c.compact=!0):m.splice(h,1);break}}0===m.length&&delete this._eventTypes[g]}}}};return{EventTarget:k}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(k,g,n){function d(c){c=c||{};this._document=c.document||document}var c={};d.getTheme=function(m){m=m||"default";var h=c[m];h||(h=c[m]=new d);return h};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,d){var b=this,a=b._themeClass;b._themeClass=c;this._load(c,d,function(){b.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:b.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,d){function b(b,d,e){d&&(a.push("."+c+" ."+b+" {"),a.push("\t"+(e?"background-color":"color")+": "+d+";"),a.push("}"))}var a=[];a.push("");a.push("."+c+" {");d.fontFamily&&a.push("\tfont-family: "+d.fontFamily+";");d.fontSize&&a.push("\tfont-size: "+d.fontSize+";");d.fontSize&&a.push("\tcolor: "+d.text+";");a.push("}");a.push("."+c+".textview {");d.background&&a.push("\tbackground-color: "+d.background+";");a.push("}");a.push("."+c+" .textviewLeftRuler {");d.leftRuler&&
a.push("\tborder-right: 1px solid "+d.leftRuler+";");a.push("}");a.push("."+c+" .textviewRightRuler {");d.rightRuler&&a.push("\tborder-left: 1px solid "+d.rightRuler+";");a.push("}");b("ruler.annotations",d.annotationRuler,!0);b("ruler.lines",d.annotationRuler,!0);b("ruler.folding",d.annotationRuler,!0);b("ruler.overview",d.overviewRuler,!0);b("rulerLines",d.lineNumber,!1);b("rulerLines.even",d.lineNumberEven,!1);b("rulerLines.odd",d.lineNumberOdd,!1);b("annotationLine.currentLine",d.currentLine,
!0);b("entity-name-tag",d.keyword,!1);b("entity-other-attribute-name",d.attribute,!1);b("string-quoted",d.string,!1);b("meta.annotation.currentLine",d.currentLine,!0);b("keyword",d.keyword,!1);b("string",d.string,!1);b("constant",d.constant,!1);b("comment",d.comment,!1);b("comment.block.documentation",d.comment,!1);b("keyword.other.documentation.markup",d.comment,!1);b("keyword.other.documentation.markup",d.comment,!1);return a.join("\n")},_createStyle:function(c,d,b,a){var l=this._document;c="orion-theme-"+
c;var f=l.getElementById(c);if(f){if(a||f.firstChild.data===d)return;f.removeChild(f.firstChild);f.appendChild(l.createTextNode(d))}else a?(f=n.createElement(l,"link"),f.rel="stylesheet",f.type="text/css",f.href=d,f.addEventListener("load",function(){b()})):(f=n.createElement(l,"style"),f.appendChild(l.createTextNode(d))),f.id=c,(l.getElementsByTagName("head")[0]||l.documentElement).appendChild(f);a||b()},_load:function(c,d,b){if(c)if("string"===typeof d)this._createStyle(c,d,b);else if(d=d.href,
".css"!==d.substring(d.length-4)&&(d+=".css"),/^\//.test(d)||/[a-zA-Z0-9]+:\/\//i.test(d)||!k.toUrl)this._createStyle(c,d,b,!0);else{var a=this;k(["text!"+d],function(d){a._createStyle(c,d,b,!1)})}else b()}};g.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function k(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}k.prototype.className=null;k.prototype.classString=void 0;k.prototype.style=void 0;k.prototype.closeString=" }\n";k.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:k}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(k){function g(){}g.prototype.navbar="white";g.prototype.button="#777777";g.prototype.location="#EFEFEF";g.prototype.selection="#cedce7";g.prototype.sidepanel="#F7F7F7";g.prototype.mainpanel="white";g.prototype.navtext="#bfbfbf";g.prototype.content="#3087B3";g.prototype.search="#444";g.prototype.toolpanel="white";g.prototype.writeNavigationStyle=function(){var g="",d=[],c=new k.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";d.push(c);c=new k.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="16px";c.style.padding="10px";c.style.paddingLeft="6px";c.style.paddingRight="2px";c.style.borderBottom="none";c.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";c.style.zIndex="100";d.push(c);c=new k.ThemeClass("a");c.style.textDecoration="none";c.style.color=
this.content;d.push(c);c=new k.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;c.style.verticalAlign="bottom";d.push(c);c=new k.ThemeClass("primaryNav");c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";d.push(c);c=new k.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";d.push(c);c=new k.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";d.push(c);for(var m in d)g+=d[m].toString();return g};g.prototype.writeLocationStyle=function(){var g="",d=[],c=new k.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";d.push(c);c=new k.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";d.push(c);c=new k.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";d.push(c);c=new k.ThemeClass("breadcrumbSeparator");c.style.fontSize=
"8pt";c.style.textDecoration="none";c.style.color=this.separator;c.style.fontWeight="bold";d.push(c);c=new k.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color=this.breadcrumb;c.style.textDecoration="none";c.style.textWrap="normal";c.style.lineHeight="10pt";d.push(c);c=new k.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";d.push(c);c=new k.ThemeClass("navlinkonpage");
c.style.color=this.content;c.style.verticalAlign="middle";d.push(c);this.bannerProgress&&(c=new k.ThemeClass("topRowBanner .progressPane_running"),c.style.borderColor=this.bannerProgress,d.push(c));for(var m in d)g+=d[m].toString();return g};g.prototype.writeButtonStyle=function(){var g="",d=[],c=new k.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="middle";c.style.cursor="pointer";
c.style.display="inline-block";c.style.padding="4px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="9pt";c.style.userSelect="none";d.push(c);c=new k.ThemeClass("commandButton:over");c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";d.push(c);c=new k.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";d.push(c);c=new k.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";d.push(c);for(var m in d)g+=d[m].toString();return g};g.prototype.writeMainStyle=function(){var g="",d=[],c=new k.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";d.push(c);c=new k.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline=
"none";d.push(c);c=new k.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";d.push(c);c=new k.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=this.content;d.push(c);c=new k.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;d.push(c);c=new k.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;d.push(c);c=new k.ThemeClass("mainToolbar");c.style.background=this.toolpanel;d.push(c);
for(var m in d)g+=d[m].toString();return g};g.prototype.render=function(g){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};g.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=
g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value,this.bannerProgress=g.bannerProgress.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel,this.bannerProgress=g.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:g}});define("orion/widgets/themes/ThemeVersion",[],function(){return"6.1"});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter","orion/widgets/themes/ThemeVersion"],function(k,g,n,d){function c(){}function m(){this.styles=[];var b=new c;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";
b.separator="#333";b.bannerProgress="whitesmoke";this.styles.push(b);b=new c;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new c;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";
b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress=
"#F2F2F2";this.styles.push(b);b=new c;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";
b.bannerProgress="#F2F2F2";this.styles.push(b);b=new c;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function h(){return this.styles}c.prototype.name="Orion";c.prototype.navbar="#404648";c.prototype.button="#EFEFEF";c.prototype.location=
"#333";c.prototype.breadcrumb="#3087B3";c.prototype.separator="#333";c.prototype.selection="FEC";c.prototype.sidepanel="#FBFBFB";c.prototype.mainpanel="white";c.prototype.toolpanel="white";c.prototype.navtext="#bfbfbf";c.prototype.content="#3087B3";c.prototype.search="#444";c.prototype.bannerProgress="white";m.prototype.styles=[];m.prototype.getStyles=h;m.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:d}};
m.prototype.getViewData=function(){var b={top:10,left:10,width:350,height:350};b.shapes=[{type:"RECTANGLE",name:k["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:k["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:k["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:k["Tool Panel"],x:150,y:71,width:209,height:30,
family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:k["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:k.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:k.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},
{type:"TEXT",name:k.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:k.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:k["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:k.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:k["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:k["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:k["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],x1:150,
y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:k["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:k["Navigation Text"],label:"Navigator",
x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var a=0;3>a;a++)b.shapes.push({type:"TEXT",name:k.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)b.shapes.push({type:"TEXT",name:k.Content,label:"Item",
x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)b.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+20*a,x2:165,y2:124+20*a,x3:160,y3:127+20*a,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};m.prototype.processSettings=function(b){var a=new n.ThemeSheetWriter;(new g.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:m,getStyles:h}});
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"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",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 (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links",Yes:"Yes",No:"No","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(k){function g(g,d,c){this.elements=c;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className=
"UAContainer-body";this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);!0===d?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className=
"UAModalBackground",document.body.appendChild(this.backdrop),document.body.appendChild(this.container),k.addAutoDismiss([this.container],this.destroy.bind(this))):g.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}g.prototype.elementNode=null;g.prototype.switchesContainer=null;g.prototype.switches=null;g.prototype.radioButtons=null;g.prototype.chosenSwitch=
null;g.prototype.addElement=function(g){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+g.image+'" id\x3d"'+g.label+'ImageNode" alt\x3d"'+g.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+g.label+'LabelNode" \x3e'+g.label+"\x3c/span\x3e\x3c/span\x3e";d.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;
document.getElementById(g.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};d.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var c=this;d.onclick=function(){c.showMedia(g)};this.elementNode.appendChild(d)};g.prototype.clearElements=function(){this.elementNode.innerHTML=""};g.prototype.showMedia=function(g){this.clearElements();this.addElement(g);
var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+g.media+'" alt\x3d"'+g.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};g.prototype.createSwitch=
function(g){var d;d=g?g.label+"switch":"indexSwitch";var c=document.createElement("span");c.className="workingSpan";c.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+d+'"\x3e\x3c/div\x3e';var m=this;c.onclick=g?function(){m.showMedia(g)}:function(){m.initialize();m.chosenSwitch.firstChild.className="circle";m.chosenSwitch=c;m.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(c);return this.radioButtons[this.radioButtons.length]=c};g.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};g.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return g});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(k,g,n,d){function c(){}var m=null;c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_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&&n.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=n.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(b){a.hide()},!1);this.$parent=n.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
c=b.createContextualFragment(this.TEMPLATE);this.messages&&n.processTextNodes(c,this.messages);this.$parent.appendChild(c);this.$buttonContainer=n.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===n.KEY.ESCAPE?a.hide():b.keyCode===n.KEY.ENTER&&"function"===typeof a._defaultCallback&&a._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_makeButtons:function(){if(this.$buttonContainer&&
Array.isArray(this.buttons)){var c=this;this.buttons.forEach(function(b){var a=d.createButton(b.text,b.callback);b.id&&(a.id=b.id,c["$"+a.id]=a);b.isDefault&&(c._defaultCallback=b.callback,c._defaultButton=a);c.$buttonContainer.appendChild(a)})}},_makeModal:function(c){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!n.contains(b.$frame,a.target);if(c)for(var d=0;d<b.$$modalExclusions.length;d++)if(n.contains(b.$$modalExclusions[d],
a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),n.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);c=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var d=0;d<c.length;d++){for(var f=0;f<this.$$modalExclusions.length;f++)if(n.contains(this.$$modalExclusions[f],c[d])){a=!0;break}!a&&(c[d]!==b.$frame&&c[d].classList&&!c[d].classList.contains("tooltipContainer"))&&
(f=c[d],f.classList.contains("modalBackdrop")||(f.classList.add("modalBackdrop"),this._addedBackdrop.push(f)))}(c=n.lastTabbable(this.$buttonContainer)||n.lastTabbable(this.$parent))&&c.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();n.stop(a)}},!1)},_addChildDialog:function(c){this.$$modalExclusions.push(c.$frame||c.$parent)},_inModalExclusion:function(c){return this.$$modalExclusions.some(function(b){return c.$frame===b||
c.$parent===b})},_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var a=c.childNodes[b];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(c){!c&&m===this&&(m=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");n.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},0)},show:function(c){if(this.modal)if(this._makeModal(),m){if(!m._inModalExclusion(this)){this.hide(!0);return}}else m=this;"function"===typeof this._beforeShowing&&this._beforeShowing();n.setFramesEnabled(!1);var b=n.bounds(this.$frame),a=n.bounds(document.documentElement),d;c?(d=n.bounds(c),c=d.top+d.height+4,d=d.left+4,c+b.height>a.height&&(c=Math.max(0,a.height-b.height-4)),d+b.width>a.width&&(d=Math.max(0,
a.width-b.width-4))):(d=Math.max(0,(a.width-b.width)/2),c=Math.max(0,(a.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=c+"px";this.$frame.style.left=d+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return n.firstTabbable(this.$parent)||this._defaultButton||n.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(m===this&&(m=null),n.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&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/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(k,g,n,d,c,m,h){function b(a){this._displaySignOut=!0;this._init(a)}b.prototype={_init:function(a){this._dropdownNode=n.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;void 0!==a.signOut&&(this._displaySignOut=a.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;
return b},_makeMenuItem:function(a,b){var c=h.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&c.classList.add(this._dropDownItemClass);c.addEventListener("click",b,!1);c.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&b()},!1);return c},_renderAuthenticatedService:function(a,b){var c=this,e=this.authenticatedServices[a].authService;if(e&&e.logout&&this._displaySignOut){var d=this._makeMenuItem(k["Sign Out"],
function(){e.logout().then(function(){c.addUserItem(a,e,c.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;0<=b;b--){var d=localStorage.key(b);d&&0===d.indexOf("/orion/preferences/user")&&localStorage.removeItem(d)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(d.parentNode)}},renderServices:function(){function a(a){c[a]||(c[a]=b.createDocumentFragment());return c[a]}
var b=document,c=[],e=this._serviceRegistry;d.getPageLinksInfo(e,"orion.page.link.user").then(function(d){this._dropdown?this._dropdown.empty():this._dropdownNode&&n.empty(this._dropdownNode);d.getAllLinks().forEach(function(e){var c,d;if(e.category&&(d=/user\.(\d+)/.exec(e.category)))c=parseInt(d[1],10);if("number"!==typeof c||isNaN(c))c=1;c=a(c);d=b.createElement("li");var f=b.createElement("a");f.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&f.classList.add(this._dropDownItemClass):
f.classList.add("dropdownMenuItem");f.href=e.href;f.textContent=e.textContent;d.appendChild(f);c.appendChild(d);f.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&f.click()},!1)}.bind(this));this.keyAssistFunction&&(d=this._makeMenuItem(k["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem"),d=d.parentNode,a(0).appendChild(d));
if(d=e.getServiceReferences("orion.page.getstarted")[0])d=d.getProperty("data"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)).parentNode,a(0).appendChild(d);var g=this;c.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<c.length-1&&!this._noSeparator){var e=h.createSeparator();a.appendChild(e)}g._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var m in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(m)&&this._renderAuthenticatedService(m,
0)}.bind(this))},getStartedDialog:function(a){new c(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,c,e){e?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:c,data:e}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:c,pending:this.unauthenticatedServices[a].pending}:
{authService:b,label:c});this.renderServices()}};b.prototype.constructor=b;return{UserMenu:b}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(k,g,n,d,c,m,h){function b(a){this._init(a)}b.prototype=new h.Dialog;b.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+d.toUrl("../../../images/progress_running.gif")+
'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';b.prototype._init=function(a){this.title=a.title||k["Find File Named"];this.modal=!0;this.messages=k;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new n.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;void 0!==a.nameSearch&&(this._nameSearch=a.nameSearch);this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(k["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(k["Missing required argument: searchRenderer"]);this._initialize()};b.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",k["FileName FolderName"]):this.$fileName.setAttribute("placeholder",k.Search);this.$fileName.addEventListener("input",function(a){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),(m.isMac?a.metaKey:a.ctrlKey)?window.open(e.href):(window.location.href=e.href,b.hide()))}},!1);a.addEventListener("keydown",function(a){var e,d,h;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)e=c.$$array("a",b.$results),d=document.activeElement,h=e.indexOf(d),a.keyCode===c.KEY.DOWN?0<=h?(d.classList.remove("treeIterationCursor"),e=h<e.length-1?e[h+1]:e[0],e.focus(),
e.classList.add("treeIterationCursor")):0<e.length&&(e=e[0],e.focus(),e.classList.add("treeIterationCursor")):0<=h?(d.classList.remove("treeIterationCursor"),d=b.$fileName,e=0<h?e[h-1]:d,e.focus(),0<h&&e.classList.add("treeIterationCursor")):0<e.length&&(e[e.length-1].focus(),e[e.length-1].classList.add("treeIterationCursor")),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new g.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(k["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)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};b.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)};b.prototype._detectFolderKeyword=function(a){var b,c=a,e=null;if(this._nameSearch&&(b=/(\S+)\s*(.*)/,(a=b.exec(a))&&3===a.length))a[1]&&
(c=a[1]),a[2]&&(e=a[2]);return{keyword:c,folderKeyword:e}};b.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._detectFolderKeyword(a),d=this._searcher.createSearchParams(b.keyword,this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var h=document.createElement("div");h.appendChild(document.createTextNode(this._nameSearch?k["Searching..."]:m.formatMessage(k["Searching for occurrences of"],
a)));c.empty(this.$results);this.$results.appendChild(h);this._searcher.search(d,b.folderKeyword,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};b.prototype.decorateResult=function(a){function b(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&d.hide()}var d=this;a=c.$$array("a",a);for(var e=0;e<a.length;e++)a[e].addEventListener("click",b,!1)};b.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};b.prototype._afterHiding=function(){this._onHide&&this._onHide()};
b.prototype.constructor=b;return{OpenResourceDialog:b}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(k,g){function n(d,c,m){if(d=g.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=m=m||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=m.selectionClass;d=document.createElement("div");d.classList.add("dropdownMenu");d.classList.add("dropdownMenuOpen");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=
d;if(c=g.node(c))this._triggerNode=c;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");m.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(c){c.keyCode===g.KEY.ESCAPE&&this.clearPanel()}.bind(this))}k.mixin(n.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){g.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=g.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",g.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(d){this._dropdownMenu.innerHTML=d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,c){c()},_positionDropdown:function(){this._dropdownMenu.style.right="";var d=g.bounds(this._dropdownMenu),c=g.bounds(document.body);d.left+d.width>c.left+c.width&&(d=g.bounds(this._boundingNode(this._triggerNode)),c=g.bounds(this._triggerNode),this._dropdownMenu.style.right=d.width-(c.left-d.left+c.width)+"px")},_boundingNode:function(d){var c=window.getComputedStyle(d,
null);return null===c||"absolute"===c.getPropertyValue("position")||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(g.setFramesEnabled(!0),g.empty(this._parent),this._parent=this.select=null)}});return n});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(k,g){function n(g,h){this._parentNode=k.node(g);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=k.node(h);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(d)||c;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var d="sideMenuNavigation",c="open";n.prototype=
{constructor:n.prototype.constructor,setCategories:function(c){this._categoryInfos=c.getCategoryIDs().map(function(d){return c.getCategory(d)}).sort(function(c,b){var a=c.order||100,d=b.order||100;return a<d?-1:d<a?1:c.textContent.localeCompare(b.textContent)})},setPageLinks:function(c){this._categorizedPageLinks={};c.getAllLinks().forEach(function(c){var b=c.category;this._categorizedPageLinks[b]=this._categorizedPageLinks[b]||[];this._categorizedPageLinks[b].push({title:c.textContent,order:c.order||
100,href:c.href})},this)},setRelatedLinks:function(c,d){this._categorizedRelatedLinks={};c.forEach(function(b){var a=b.relatedLink,c=b.command;b=b.invocation;if(!d||-1===d.indexOf(a.id)){var f=a.category;this._categorizedRelatedLinks[f]=this._categorizedRelatedLinks[f]||[];this._categorizedRelatedLinks[f].push({title:c.name,order:a.order||100,href:c.hrefCallback.call(b.handler,b)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var c=new URL(window.location.href);this._currentCategory=c.hash="";Object.keys(this._categorizedPageLinks).some(function(b){if(this._categorizedPageLinks[b].some(function(a){var b=new URL(a.href);a.hash="";return c.href===b.href}))return this._currentCategory=b,!0},this);var d=document.createElement("ul");d.classList.add("sideMenuList");this._categoryInfos.forEach(function(b){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
b.id&&a.classList.add("sideMenuItemActive");a.categoryId=b.id;a.categoryName=b.textContent||b.id;var c=document.createElement("a");c.classList.add("submenu-trigger");if("string"===typeof b.imageDataURI&&0===b.imageDataURI.indexOf("data:image")){var f=document.createElement("img");f.width="16";f.height="16";f.src=b.imageDataURI;c.appendChild(f)}else c.classList.add(b.imageClass||"core-sprite-blank-menu-item");a.appendChild(c);d.appendChild(a);this._categorizedAnchors[b.id]=c},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(d);this._show=n.prototype._show};window.setTimeout(function(){this._show()}.bind(this),1E3)}"closed"===this._state?(this._contentNode.style.left="0",this._renderTimeout&&(window.clearTimeout(this._renderTimeout),this._renderTimeout=null),this._renderTimeout=window.setTimeout(function(){this._parentNode.style.display="none";this._renderTimeout=null}.bind(this),301),this._parentNode.classList.add("animating")):(this._renderTimeout&&(window.clearTimeout(this._renderTimeout),
this._renderTimeout=null),this._parentNode.classList.remove("animating"),this._parentNode.style.display="block",this._parentNode.style.width="40px",this._contentNode.style.left="40px")},hide:function(){localStorage.setItem(d,"closed");this._contentNode.style.left="0"},toggle:function(){var g=this._contentNode;g&&g.classList.add("content-fixedHeight-animation");this._state="open"===this._state?"closed":"open";this._state===c?localStorage.removeItem(d):localStorage.setItem(d,this._state);this.render()},
_updateCategoryAnchors:function(){var c=[];Object.keys(this._categorizedRelatedLinks).forEach(function(d){("git"===d||d.match(/-scm$/))&&c.push(d)});Object.keys(this._categorizedAnchors).forEach(function(d){var b=this._categorizedAnchors[d],a=[];d===this._currentCategory?(b.parentElement.style.display="",b.href="",b.onclick=function(){return!1},b.title=b.parentElement.categoryName):(this._categorizedPageLinks[d]&&a.push.apply(a,this._categorizedPageLinks[d]),this._categorizedRelatedLinks[d]&&a.push.apply(a,
this._categorizedRelatedLinks[d]),0===a.length||0!==c.length&&("git"===d||d.match(/-scm$/))&&-1===c.indexOf(d)?(b.href="",b.title=b.parentElement.categoryName,b.parentElement.style.display="none"):(b.parentElement.style.display="",a.sort(function(a,b){return a.order<b.order?-1:b.order<a.order?1:a.title.localeCompare(b.title)}),d=a.shift(),b.href=d.href,b.title=d.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var c=g.matchResourceParameters().resource,d=(new URL(c,window.location.href)).href;this._categoryInfos.forEach(function(b){if(b.service&&b.service.getNotifications){var a=this._categorizedAnchors[b.id].parentElement;b.service.getNotifications(d).then(function(b){if(c===g.matchResourceParameters().resource){var d="";b.forEach(function(a){"info"===a.level&&!d?d="info":"warn"===a.level&&(!d||"info"===d)?d="warn":"error"===a.level&&"error"!==d&&(d="error")});d?a.setAttribute("level",d):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return n});
define("orion/globalCommands","i18n!orion/nls/messages require orion/commonHTMLFragments orion/keyBinding orion/EventTarget orion/commandRegistry orion/commands orion/parameterCollectors orion/extensionCommands orion/uiUtils orion/keyBinding orion/breadcrumbs orion/webui/littlelib orion/webui/splitter orion/webui/dropdown orion/webui/tooltip orion/contentTypes orion/URITemplate orion/keyAssist orion/PageUtil orion/widgets/themes/ThemePreferences orion/widgets/themes/container/ThemeData orion/Deferred orion/widgets/UserMenu orion/PageLinks orion/webui/dialogs/OpenResourceDialog text!orion/banner/banner.html text!orion/banner/footer.html text!orion/banner/toolbar.html orion/widgets/input/DropDownMenu orion/util orion/customGlobalCommands orion/fileClient orion/webui/SideMenu orion/objects".split(" "),function(k,
g,n,d,c,m,h,b,a,l,f,e,p,s,q,r,w,u,z,t,v,y,H,A,J,E,C,x,D,B,I,G,K,Q,L){function $(a,b){if(a.getLabel)return a.getLabel();var e=new H;e.resolve(b.properties.name);return e}function Y(a){p.node("progressPane").setAttribute("aria-label",k["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function T(a,b){var e=a.getServiceReferences("orion.core.auth");aa=[];var c=O.createMenuGenerator.apply(this,arguments);if(c)for(var d=0;d<
e.length;d++){var f=e[d],l=a.getService(f);$(l,f).then(function(a){l.getKey().then(function(b){aa.push(b);l.getUser().then(function(e){c.addUserItem(b,l,a,e)},function(e,d){c.addUserItem(b,l,a,d)});window.addEventListener("storage",function(e){fa[b]!==localStorage.getItem(b)&&(fa[b]=localStorage.getItem(b),l.getUser().then(function(e){c.addUserItem(b,l,a,e)},function(e){c.addUserItem(b,l,a)}))},!1)})})}}function R(a){return a}function S(b,e,c,d,f){function l(){if(s)return s;var a=b.getService("orion.core.contentTypeRegistry");
a||(a=new w.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return s=a})}function g(a){for(var b={},e=a.getPropertyKeys(),c,d=0;d<e.length;d++)c=e[d],b[c]=a.getProperty(c);return b}function p(a,b){var e=null;a.some(function(a){return b===a.getProperty("id")?!!(e=a):!1});return e}function m(a){var b=a.command;return!b.visibleWhen||b.visibleWhen(e)?(a.invocation=new h.CommandInvocation(e,e,null,b,d),(new H).resolve(a)):"function"===
typeof f?(r||(r=f()),H.when(r,function(c){if(c&&e===ba&&(!b.visibleWhen||b.visibleWhen(c)))return a.invocation=new h.CommandInvocation(c,c,null,b,d),a})):(new H).resolve()}function k(a,b,e){return e?(new H).resolve({relatedLink:a,command:e}):b.then(function(b){return{relatedLink:a,command:new h.Command(b)}})}var q=arguments,s,r,n=b&&b.getServiceReferences("orion.page.link.related");if(n&&0!==n.length){var I=this;H.when(l(),function(){if(O.beforeGenerateRelatedLinks.apply(I,q)){var e=b.getServiceReferences("orion.navigate.command"),
f=[];n.forEach(function(c){var l=g(c);if(l.id){var h;if((l.nls&&l.nameKey||l.name)&&l.uriTemplate)h=a._createCommandOptions(l,c,b,s,!0),f.push(k(l,h,null));else if(h=p(e,l.id)){var m=g(h);c={};L.mixin(c,m,l);(l=d.findCommand(l.id))?f.push(k(c,null,l)):(h=a._createCommandOptions(m,h,b,s,!0),f.push(k(c,h,null)))}}});H.all(f,R).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return H.all(a.map(m),R).then(function(b){var e=[];b=b.filter(function(b,c){if(b)return!0;
e.push(a[c]);return!1});O.addRelatedLinkCommands.call(I,d,b,e,c);O.afterGenerateRelatedLinks.apply(I,q)})})}})}}function ca(a){var b=p.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function U(a){var b=window.getComputedStyle(a,null);return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:U(a.parentNode)}function ea(a){var b={},e=null;"string"===typeof a&&(a=p.node(a));a||(a=p.node("pageActions"));for(var c=a;c&&c.classList;){if(c.classList.contains("toolComposite")){e=
c;break}c=c.parentNode}a.classList.contains("commandMarker")&&(b.commandNode=a);e||(e=p.node("pageToolbar"));e&&(b.slideContainer=p.$(".slideParameters",e),b.parameterArea=p.$(".parameters",e),b.dismissArea=p.$(".parametersDismiss",e),b.notifications=p.$("#notificationArea",e),e.parentNode&&(b.toolbarTarget=p.$(".toolbarTarget",e.parentNode),b.toolbarTarget&&(a=p.bounds(b.toolbarTarget),c=p.bounds(U(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-c.top,b.toolbar=e)));return b}function W(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var b=p.bounds(a),e=p.bounds(a.parentNode);a.style.left=(e.width-b.width)/2+"px";a.style.top="0"}}m=function(a){var b=document.createElement("a");b.href=a;return b.href}(g.toUrl("auth/NotifyAuthentication.html"));var fa={},O={createMenuGenerator:G.createMenuGenerator||function(a,b){if(p.node("userMenu")){var e=p.node("userDropdown"),c=new q.Dropdown({dropdown:e}),e=new A.UserMenu({dropdownNode:e,dropdown:c,
serviceRegistry:a}),c=p.node("userTrigger");new r.Tooltip({node:c,text:k.Options,position:["below","left"]});var c=document.getElementById("userTrigger"),d=c.className;c.className=d+" imageSprite core-sprite-silhouette";e.setKeyAssist(b);return e}},beforeGenerateRelatedLinks:G.beforeGenerateRelatedLinks||function(a,b,e,c,d){return!0},addRelatedLinkCommands:G.addRelatedLinkCommands||function(a,b,e,c){this.sideMenu&&this.sideMenu.setRelatedLinks(b,c)},afterGenerateRelatedLinks:G.afterGenerateRelatedLinks||
function(a,b,e,c,d){},afterSetPageTarget:G.afterSetPageTarget||function(a){},generateNavigationMenu:G.generateNavigationMenu||function(a,b,e,c,d,f,l){if(a=p.node("sideMenu"))b=p.node("centralNavigation"),new r.Tooltip({node:b,text:k.CentralNavTooltip,position:["right"]}),this.sideMenu=new Q(a,p.node("pageContent")),b.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=p.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:G.afterGenerateNavigationMenu||
function(a,b,e,c,d,f,l){},afterGenerateBanner:G.afterGenerateBanner||function(a,b,e,c,d,f,l){}},aa=[],ba,X=[],F,V=null,N=null,P=new c;return{generateBanner:function(a,e,c,f,l,m,q,r){function w(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var b=p.$$array(".targetSelector"),e=0;e<b.length;e++)b[e].target=a}},{pid:"nav.config"})}(new v.ThemePreferences(f,new y.ThemeData)).apply();var t=p.node(a);
if(!t)throw k["could not find banner parent, id was "]+a;var u=document.createRange();u.selectNode(t);u=u.createContextualFragment(C);p.processTextNodes(u,k);t.firstChild?t.insertBefore(u,t.firstChild):t.appendChild(u);t=p.node("home");t.href=g.toUrl("edit/edit.html");t.setAttribute("aria-label",k["Orion Home"]);p.node("progressPane").src=h.NO_IMAGE;if(t=p.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=D+n.slideoutHTMLFragment("mainToolbar");(t=p.node("closeNotifications"))&&t.setAttribute("aria-label",
k["Close notification"]);if(17>=I.isFirefox&&(t=p.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=p.node("footer"))t.innerHTML=x,p.processTextNodes(t,k);c.setParameterCollector(new b.CommandParameterCollector(ea,W));document.addEventListener("keydown",function(a){a.keyCode===p.KEY.ESCAPE&&(a=e.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);t=J.getCategoriesInfo(e);
u=J.getPageLinksInfo(e,"orion.page.link");H.all([t,u]).then(function(a){if(this.sideMenu){var b=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(b);this.sideMenu.render()}}.bind(this));if(t=p.$(".split")){var u=p.$(".sidePanelLayout"),G=p.$(".mainPanelLayout");u&&G&&(V={side:u,main:G},V.splitter=new s.Splitter({node:t,sidePanel:u,mainPanel:G,toggle:!0,closeByDefault:r}),t=new h.Command({name:k["Toggle side panel"],tooltip:k["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){V.splitter.toggleSidePanel()}}),c.addCommand(t),c.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("l",I.isMac?!1:!0,!0,!1,I.isMac?!0:!1)))}var K=!1,Q=function(a,b){if(!K){var e=b.getService("orion.page.progress"),c=new E.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,onHide:function(){K=!1}});window.setTimeout(function(){K=!0;c.show()},0)}},t=new h.Command({name:k["Find File Named..."],tooltip:k["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){Q(l,e)}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));var A=!1,t=function(){if(A)return!1;var a=p.node("banner"),b=p.node("footer"),e=p.node("sideMenu"),c=p.$(".content-fixedHeight"),d="hidden"===a.style.visibility;d?(a.style.visibility="visible",b.style.visibility="visible",c.classList.remove("content-fixedHeight-maximized"),e&&e.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",c.classList.add("content-fixedHeight-maximized"),e&&e.classList.add("sideMenu-maximized"));P.dispatchEvent({type:"toggleTrim",maximized:!d});return!0};window.orionNoTrim?(t(),A=!0,this.sideMenu.hide()):(t=new h.Command({name:k["Toggle banner and footer"],tooltip:k["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:t}),c.addCommand(t),c.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0)));
t=new h.Command({name:k["System Configuration Details"],tooltip:k["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return g.toUrl("help/about.html")}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));t=new h.Command({name:k["Background Operations"],tooltip:k["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return g.toUrl("operations/list.html")}});c.addCommand(t);
c.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));N=new z.KeyAssistPanel({commandRegistry:c});t=new h.Command({name:k["Show Keys"],tooltip:k["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){N.isVisible()?N.hide():N.show();return!0}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));ca(c);T(e,t.callback);Y(e);window.addEventListener("hashchange",
function(){c.processURL(window.location.href)},!1);window.setTimeout(function(){w(e)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:ea,getMainSplitter:function(){return V},getKeyAssist:function(){return N},getGlobalEventTarget:function(){return P},layoutToolbarElements:W,setPageTarget:function(a){var b,c,d=a.breadcrumbRootName,f=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(c=(d?d+" ":"")+a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,ba=a.target,S.call(this,f,a.target,X,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,S.call(this,f,{NoTarget:""},X,a.commandService,a.makeAlternate));(F=a.title)||(F=b?b+" - "+a.task:a.task);window.document.title=F;O.afterSetPageTarget.apply(this,arguments);if(b=a.breadCrumbContainer?p.node(a.breadCrumbContainer):p.node("location"))if(p.empty(b),a.staticBreadcrumb)new e.BreadCrumbs({container:b,
rootSegmentName:d});else{var l=f&&new K.FileClient(f),f=a.breadcrumbTarget||a.target,l=l&&f&&f.Location?l.fileServiceRootURL(f.Location):null;new e.BreadCrumbs({container:b,resource:f,rootSegmentName:d,workspaceRootSegmentName:c,workspaceRootURL:l,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){F&&("*"===F.charAt(0)&&!a&&(F=F.substring(1)),a&&"*"!==F.charAt(0)&&(F="*"+F),window.document.title=F);var b=p.node("dirty");b&&(b.textContent=a?"*":"")},
setPageCommandExclusions:function(a){X=a},notifyAuthenticationSite:m}});
define("util/legacy",["require","exports","module"],function(k,g,n){"undefined"===typeof window||"undefined"===typeof document||(null==window.console&&(window.console={}),"debug log warn error trace group groupEnd".split(" ").forEach(function(d){window.console[d]||(window.console[d]=function(){})}),!("classList"in document.documentElement)&&(Object.defineProperty&&"undefined"!==typeof HTMLElement)&&Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function d(d){return function(b){var a=
c.className.split(/\s+/),l=a.indexOf(b);d(a,l,b);c.className=a.join(" ")}}var c=this,g={add:d(function(c,b,a){~b||c.push(a)}),remove:d(function(c,b){~b&&c.splice(b,1)}),toggle:d(function(c,b,a){~b?c.splice(b,1):c.push(a)}),contains:function(d){return!!~c.className.split(/\s+/).indexOf(d)},item:function(d){return c.className.split(/\s+/)[d]||null}};Object.defineProperty(g,"length",{get:function(){return c.className.split(/\s+/).length}});return g}}),String.prototype.trimLeft||(String.prototype.trimLeft=
function(){return String(this).replace(/\s*$/,"")}),Function.prototype.bind||(Function.prototype.bind=function(d){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var c=Array.prototype.slice.call(arguments,1),g=this,h=function(){},b=function(){return g.apply(this instanceof h&&d?this:d,c.concat(Array.prototype.slice.call(arguments)))};h.prototype=this.prototype;b.prototype=new h;return b}))});
define("util/promise",["require","exports","module"],function(k,g,n){function d(a){return{then:function(b){b(a)}}}function c(a){return{then:function(b,c){c(a)}}}function m(a){return function(b){try{return a(b)}catch(d){return c(d)}}}function h(a){var b=[],f;a=a||null===a?a:Object.prototype;var e={promise:Object.create(a,{then:{value:function(e,g){function k(a){n.resolve(e(a))}function r(a){n.resolve(g(a))}var n=h(a);e=e?m(e):d;g=g?m(g):c;b?b.push([k,r]):f.then(k,r);return n.promise}}}),resolve:function(a){if(b){for(f=
a&&"function"===typeof a.then?a:d(a);b.length;)f.then.apply(f,b.shift());b=null}},reject:function(a){e.resolve(c(a))}};return e}function b(a,b){var c=h(b);c.resolve(a);return c.promise}n.metadata={stability:"unstable"};g.defer=h;g.resolve=b;g.reject=function(a,b){var c=h(b);c.reject(a);return c.promise};k=function(){function a(a){return d.apply(d,a)}function c(a,e){return a.then(function(a){return b(e).then(function(b){return a.concat([b])})})}var d=Function.call,e=Array.prototype.concat;return function(d,
f){return function(){return e.apply([d,this],arguments).reduce(c,b([],f)).then(a)}}}();g.promised=k});
define("util/util",["require","exports","module","util/promise"],function(k,g,n){function d(b,a){for(var c=0;c<a.length;c++)if(b===a[c])return c;return-1}function c(b,a){var c=b.getAttribute("data-command");c||(c=b.querySelector("*[data-command]").getAttribute("data-command"));c?a(c):console.warn("Missing data-command for "+util.findCssSelector(b))}g.createEvent=function(b){var a=[],c=!1,d=[],e=void 0,h=function(b){if(c)d.push(b);else for(var e=0;e<a.length;e++){var h=a[e];h.func.call(h.scope,b)}};
h.add=function(b,e){a.push({func:b,scope:e})};h.remove=function(e,c){var d=!1;a=a.filter(function(a){(a=a.func===e&&a.scope===c)&&(d=!0);return!a});d||console.warn("Handler not found. Attached to "+b)};h.removeAll=function(){a=[]};h.holdFire=function(){c=!0};h.resumeFire=function(){if(!0!==c)throw Error("Event not held: "+b);c=!1;if(0!==d.length){if(1===d.length)h(d[0]);else{var a=d[0],g=d[d.length-1];e?h(e(a,g,d)):h(g)}d=[]}};Object.defineProperty(h,"eventCombiner",{set:function(a){if("function"!==
typeof a)throw Error("eventCombiner is not a function");e=a},enumerable:!0});return h};var m=k("util/promise");g.promised=function(){function b(a){return c.apply(c,a)}function a(a,b){return a.then(function(a){return m.resolve(b).then(function(b){return a.concat([b])})})}var c=Function.call,d=Array.prototype.concat;return function(e,c){return function(){return d.apply([e,this],arguments).reduce(a,m.resolve([],c)).then(b)}}}();g.all=g.promised(Array);g.synchronize=function(b){if(null==b||"function"!==
typeof b.then)return b;var a=void 0,c=void 0;b.then(function(b){a=!1;c=b},function(b){a=!0;c=b});if(void 0===a)throw Error("non synchronizable promise");if(a)throw c;return c};g.promiseEach=function(b,a,c){if(0===b.length)return m.resolve([]);var d=m.defer(),e=function(h){var g=[],k=a.call(c,b[h]);m.resolve(k).then(function(a){g[h]=a;a=h+1;a>=b.length?d.resolve(g):e(a)}).then(null,function(a){d.reject(a)})};e(0);return d.promise};g.NS_XHTML="http://www.w3.org/1999/xhtml";g.NS_XUL="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
g.createElement=function(b,a){return g.isXmlDocument(b)?b.createElementNS(g.NS_XHTML,a):b.createElement(a)};g.clearElement=function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)};var h=/^\s*$/;g.removeWhitespace=function(b,a){for(var c=0;c<b.childNodes.length;){var d=b.childNodes.item(c);3===d.nodeType&&h.test(d.textContent)?b.removeChild(d):(a&&1===d.nodeType&&g.removeWhitespace(d,a),c++)}};g.importCss=function(b,a,c){if(b){a=a||document;if(!c){c=0;if(0!=b.length)for(var d=0;d<b.length;d++){var e=
b.charCodeAt(d);c=(c<<5)-c+e;c&=c}c="hash-"+c}if(d=a.getElementById(c))return"style"!==d.tagName.toLowerCase()&&console.error("Warning: importCss passed id\x3d"+c+", but that pre-exists (and isn't a style tag)"),d;d=g.createElement(a,"style");d.id=c;d.appendChild(a.createTextNode(b));(a.getElementsByTagName("head")[0]||a.documentElement).appendChild(d);return d}};g.setTextContent=function(b,a){g.clearElement(b);var c=b.ownerDocument.createTextNode(a);b.appendChild(c)};g.setContents=function(b,a){if("undefined"!==
typeof HTMLElement&&a instanceof HTMLElement)g.clearElement(b),b.appendChild(a);else if("innerHTML"in b)b.innerHTML=a;else try{var c=b.ownerDocument.documentElement.namespaceURI;c||(c=g.NS_XHTML);g.clearElement(b);for(var d=b.ownerDocument.createRange().createContextualFragment('\x3cdiv xmlns\x3d"'+c+'"\x3e'+a+"\x3c/div\x3e").firstChild;d.hasChildNodes();)b.appendChild(d.firstChild)}catch(e){throw console.error("Bad XHTML",e),console.trace(),e;}};g.toDom=function(b,a){var c=g.createElement(b,"div");
g.setContents(c,a);return c.children[0]};g.isXmlDocument=function(b){b=b||document;return b.contentType&&"text/html"!=b.contentType||null!=b.xmlVersion?!0:!1};g.findCssSelector=function(b){var a=b.ownerDocument;if(b.id&&a.getElementById(b.id)===b)return"#"+b.id;var c=b.tagName.toLowerCase();if("html"===c)return"html";if("head"===c)return"head";if("body"===c)return"body";null==b.parentNode&&console.log("danger: "+c);var f,e;if(0<b.classList.length)for(var h=0;h<b.classList.length;h++){f="."+b.classList.item(h);
e=a.querySelectorAll(f);if(1===e.length)return f;f=c+f;e=a.querySelectorAll(f);if(1===e.length)return f;e=d(b,b.parentNode.children)+1;f=f+":nth-child("+e+")";e=a.querySelectorAll(f);if(1===e.length)return f}e=d(b,b.parentNode.children)+1;return f=g.findCssSelector(b.parentNode)+" \x3e "+c+":nth-child("+e+")"};g.createUrlLookup=function(b){return function(a){try{return k("text!gcli/ui/"+a)}catch(c){if(b.filename)return b.filename+a;var d=b.id.split("/").pop()+".js";return b.uri.substr(-d.length)!==
d?(console.error("Can't work out path from module.uri/module.id"),a):b.uri?b.uri.substr(0,b.uri.length-d.length-1)+"/"+a:d+"/"+a}}};g.updateCommand=function(b,a){c(b,function(b){a.update(b)})};g.executeCommand=function(b,a){c(b,function(b){a.exec({visible:!0,typed:b})})};g.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(k,g,n){g.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(k,g,n){function d(a,b){return a.replace(/\{[^}]*\}/g,function(a){a=a.slice(1,-1);if(null==b)return console.log("Missing swaps while looking up '"+a+"'"),"";var c=b[a];null==c&&(console.log("Can't find '"+a+"' in "+JSON.stringify(b)),c="");return c})}function c(a,b){var e=0;a=a.replace(/%S/g,function(){return b[e++]});return a=a.replace(/%([0-9])\$S/g,function(a,e){return b[e-1]})}function m(){if(!a){var c=navigator.language||
navigator.userLanguage;b.some(function(b){return-1!==b.locales.indexOf(c)?(a=b,!0):!1});a||(console.error("Failed to find plural rule for "+c),a=b[0])}return a}var h={};g.registerStringsSource=function(a){var b=k(a).root;Object.keys(b).forEach(function(e){h[e]?console.error("Key '"+e+"' (loaded from "+a+") already exists. Ignoring."):h[e]=b[e]},this)};k("gcli/nls/strings");g.registerStringsSource("gcli/nls/strings");g.unregisterStringsSource=function(a){a=k(a).root;Object.keys(a).forEach(function(a){delete h[a]},
this)};g.getPreferredLocales=function(){var a=("undefined"!==typeof navigator?(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};g.lookup=function(a){var b=h[a];if(null==b)throw Error("No i18n key: "+a);return b};g.propertyLookup="undefined"!==typeof Proxy?Proxy.create({get:function(a,b){return g.lookup(b)}}):h;g.lookupSwap=function(a,b){var e=g.lookup(a);return d(e,b)};g.lookupFormat=
function(a,b){var e=g.lookup(a);return c(e,b)};g.lookupPlural=function(a,b,e){var c=m().get(b);a=g.lookup(a)[c];e=e||{};e.ord=b;return d(a,e)};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(a){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 1!=a?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 1<a?1:0}},{locales:["lv"],numForms:3,get:function(a){return 1==a%10&&11!=a%100?1:0!=a?2:0}},{locales:["gd","gd-gb"],numForms:4,get:function(a){return 1==a||11==a?0:2==a||12==a?1:0<a&&20>a?2:3}},{locales:["ro","ro-ro"],numForms:3,get:function(a){return 1==a?0:0==a||0<a%100&&20>a%100?1:2}},{locales:["lt"],
numForms:3,get:function(a){return 1==a%10&&11!=a%100?0:2<=a%10&&(10>a%100||20<=a%100)?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 1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2}},{locales:["cs","sk"],numForms:3,get:function(a){return 1==a?0:2<=a&&4>=a?1:2}},{locales:["pl"],numForms:3,get:function(a){return 1==a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2}},{locales:["sl"],numForms:4,get:function(a){return 1==a%100?
0:2==a%100?1:3==a%100||4==a%100?2:3}},{locales:["ga-ie","ga-ie","ga","en-ie"],numForms:5,get:function(a){return 1==a?0:2==a?1:3<=a&&6>=a?2:7<=a&&10>=a?3:4}},{locales:["ar"],numForms:6,get:function(a){return 0==a?5:1==a?0:2==a?1:3<=a%100&&10>=a%100?2:11<=a%100&&99>=a%100?3:4}},{locales:["mt"],numForms:4,get:function(a){return 1==a?0:0==a||0<a%100&&10>=a%100?1:10<a%100&&20>a%100?2:3}},{locales:["mk","mk-mk"],numForms:3,get:function(a){return 1==a%10?0:2==a%10?1:2}},{locales:["is"],numForms:2,get:function(a){return 1==
a%10&&11!=a%100?0:1}}],a});
define("gcli/argument",["require","exports","module"],function(k,g,n){function d(a,b,c){void 0===a?this.suffix=this.prefix=this.text="":(this.text=a,this.prefix=void 0!==b?b:"",this.suffix=void 0!==c?c:"")}function c(){this.suffix=this.prefix=this.text=""}function m(a,b,c){this.text=void 0!==a?a:"";this.prefix=void 0!==b?b:"";this.suffix=void 0!==c?c:"";m._moveSpaces(this)}function h(a,b,c){if(!Array.isArray(a))throw Error("args is not an array of Arguments");this.args=void 0===b?a:a.slice(b,c);a=
d.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 a(){this.suffix=this.prefix=this.text=""}function l(a,b,c){"string"===typeof a?(this.valueArg=this.nameArg=null,this.text=a,this.prefix=b,this.suffix=c):null==b?(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=[]}d.prototype.type="Argument";d.prototype.merge=function(a){return new d(this.text+this.suffix+a.prefix+a.text,this.prefix,a.suffix)};d.prototype.beget=function(a){var b=this.text,c=this.prefix,f=this.suffix;if(null!=a.text&&(b=a.text,!a.dontQuote)){var l=0<=b.indexOf(" ")||0==b.length,h=/['"]$/.test(c);l&&!h&&(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||d)(b,c,f)};d.prototype.assign=function(a){this.assignment=a};d.prototype.getArgs=function(){return[this]};d.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof d)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};d.prototype.toString=function(){return this.prefix+this.text+this.suffix};d.merge=function(a,
b,c){c=void 0===c?a.length:c;var d;for(b=void 0===b?0:b;b<c;b++){var f=a[b];d=d?d.merge(f):f}return d};Object.defineProperty(d.prototype,"_summaryJson",{get:function(){return"\x3c"+this.prefix+":"+this.text+":"+this.suffix+"\x3e (a\x3d"+(null==this.assignment?"null":this.assignment.param.name)+", t\x3d"+this.type+")"},enumerable:!0});g.Argument=d;c.prototype=Object.create(d.prototype);c.prototype.type="BlankArgument";g.BlankArgument=c;m.prototype=Object.create(d.prototype);m.prototype.type="ScriptArgument";
m._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)};m.prototype.beget=function(a){a.type=m;a=d.prototype.beget.call(this,a);m._moveSpaces(a);return a};g.ScriptArgument=m;h.prototype=Object.create(d.prototype);h.prototype.type="MergedArgument";h.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},this);this.assignment=a};h.prototype.getArgs=function(){return this.args};
h.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof h)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};g.MergedArgument=h;b.prototype=Object.create(d.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:null==a||!(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=d.prototype.beget.call(this,a);a.arg=new d(a.text,a.prefix,a.suffix);return a};g.TrueNamedArgument=b;a.prototype=Object.create(d.prototype);a.prototype.type="FalseNamedArgument";a.prototype.getArgs=function(){return[]};a.prototype.equals=function(b){return this===b?!0:null==b||!(b instanceof a)?!1:this.text===b.text&&this.prefix===b.prefix&&this.suffix===b.suffix};g.FalseNamedArgument=
a;l.prototype=Object.create(d.prototype);l.prototype.type="NamedArgument";l.prototype.assign=function(a){this.nameArg.assign(a);null!=this.valueArg&&this.valueArg.assign(a);this.assignment=a};l.prototype.getArgs=function(){return this.valueArg?[this.nameArg,this.valueArg]:[this.nameArg]};l.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof l)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};l.prototype.beget=function(a){a.type=l;a=d.prototype.beget.call(this,
a);var b=/^([\s]*)([^\s]*)([\s]*['"]?)$/.exec(a.prefix);null==this.valueArg&&""===a.text?(a.nameArg=new d(b[2],b[1],b[3]),a.valueArg=null):(a.nameArg=new d(b[2],b[1],""),a.valueArg=new d(a.text,b[3],a.suffix));return a};g.NamedArgument=l;f.prototype=Object.create(d.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(null==a||"ArrayArgument"!==a.type||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(",")+"}"};g.ArrayArgument=f});
define("gcli/types","require exports module util/promise gcli/argument gcli/argument".split(" "),function(k,g,n){function d(a,b,c,d,f){this.value=a;this.arg=b;if(null==b)throw Error("Missing arg");if(null!=f){a="function"===typeof f?f():f;if("function"!==typeof a.then)throw Error("predictions is not a promise");a.then(function(a){if(!Array.isArray(a))throw Error("prediction resolves to non array");},console.error)}this._status=c||l.VALID;this.message=d;this.predictions=f}function c(a,b){this.arg=
b;this.conversions=a;this.value=a.map(function(a){return a.value},this);this._status=l.combine(a.map(function(a){return a.getStatus()}));this.message="";this.predictions=[]}function m(){}var h=k("util/promise"),b=k("gcli/argument").Argument,a=k("gcli/argument").BlankArgument,l={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 a=l.VALID,b=0;b<arguments.length;b++){var c=arguments[b];Array.isArray(c)&&(c=l.combine.apply(null,c));c>a&&(a=c)}return a}};g.Status=l;d.prototype.assign=function(a){this.arg.assign(a)};d.prototype.isDataProvided=function(){return"BlankArgument"!==this.arg.type};d.prototype.equals=function(a){return this===a?!0:null==a?!1:this.valueEquals(a)&&this.argEquals(a)};d.prototype.valueEquals=function(a){return this.value===a.value};d.prototype.argEquals=function(a){return null==
a?!1:this.arg.equals(a.arg)};d.prototype.getStatus=function(a){return this._status};d.prototype.toString=function(){return this.arg.toString()};d.prototype.getPredictions=function(){return"function"===typeof this.predictions?this.predictions():h.resolve(this.predictions||[])};d.prototype.constrainPredictionIndex=function(a){return null==a?h.resolve():this.getPredictions().then(function(b){if(0!==b.length)return a%=b.length,0>a&&(a=b.length+a),a}.bind(this))};d.maxPredictions=11;g.Conversion=d;c.prototype=
Object.create(d.prototype);c.prototype.assign=function(a){this.conversions.forEach(function(b){b.assign(a)},this);this.assignment=a};c.prototype.getStatus=function(a){return a&&a.conversion?a.conversion.getStatus():this._status};c.prototype.isDataProvided=function(){return 0<this.conversions.length};c.prototype.valueEquals=function(a){if(!(a instanceof c))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};c.prototype.toString=function(){return"[ "+this.conversions.map(function(a){return a.toString()},this).join(", ")+" ]"};g.ArrayConversion=c;m.prototype.stringify=function(a){throw Error("Not implemented");};m.prototype.parse=function(a){throw Error("Not implemented");};m.prototype.parseString=function(a){return this.parse(new b(a))};m.prototype.name=void 0;m.prototype.increment=function(a){};m.prototype.decrement=
function(a){};m.prototype.getBlank=function(){return new d(void 0,new a,l.INCOMPLETE,"")};m.prototype.getType=function(){return this};g.Type=m;var f={};g.getTypeNames=function(){return Object.keys(f)};g.registerType=function(a){if("object"===typeof a)if(a instanceof m){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("function"===typeof a){if(!a.prototype.name)throw Error("All registered types must have a name");f[a.prototype.name]=
a}else throw Error("Unknown type: "+a);};g.registerTypes=function(a){Object.keys(a).forEach(function(b){var c=a[b];c.name=b;a.registerType(c)})};g.deregisterType=function(a){delete f[a.name]};g.getType=function(a){var b;if("string"===typeof a)return b=f[a],"function"===typeof b&&(b=new b({})),b;if("object"===typeof a){if(!a.name)throw Error("Missing 'name' member to typeSpec");b=f[a.name];"function"===typeof b&&(b=new b(a));return b}throw Error("Can't extract type from "+a);}});
define("gcli/types/spell",["require","exports","module"],function(k,g,n){g.correct=function(d,c){if(0!==c.length){var g={},h;c.forEach(function(b){var a=d.length,c=b.length,f=Array(a+1),e=Array(a+1),h=Array(a+1),k,q;for(k=0;k<=a;k++)e[k]=1*k;for(q=1;q<=c;q++){f[0]=1*q;for(k=1;k<=a;k++)f[k]=Math.min(f[k-1]+1,e[k]+1,e[k-1]+(d[k-1]===b[q-1]?0:2)),1<k&&(1<q&&d[k-1]===b[q-2]&&b[q-1]===d[k-2])&&(f[k]=Math.min(f[k],h[k-2]+1));k=h;h=e;e=f;f=k}g[b]=e[a]});h=c.sort(function(b,a){return g[b]!==g[a]?g[b]-g[a]:
b<a});if(4>=g[h[0]])return h[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(k,g,n){function d(a){a&&Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function c(a,b){if(q&&!b){var e=h.defer();setTimeout(function(){h.resolve(a).then(function(a){"function"===typeof a&&(a=c(a(),b));e.resolve(a)})},500);return e.promise}return h.resolve(a).then(function(a){return"function"===typeof a?c(a(),
b):a})}function m(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 h=k("util/promise"),b=k("util/util"),a=k("util/l10n"),l=k("gcli/types");n=k("gcli/types").Type;var f=k("gcli/types").Status,e=k("gcli/types").Conversion,p=k("gcli/types/spell"),s=k("gcli/argument").BlankArgument;g.startup=function(){l.registerType(d)};g.shutdown=function(){l.unregisterType(d)};d.prototype=Object.create(n.prototype);d.prototype.stringify=
function(a){if(null==a)return"";if(null!=this.stringifyProperty)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(e){return a.toString()}};d.prototype.clearCache=function(){delete this._cachedLookup};d.prototype.getLookup=function(){if(null!=this._cachedLookup)return this._cachedLookup;var a;null==this.lookup?a=c(this.data,this.neverForceAsync).then(m):(a="function"===typeof this.lookup?this.lookup.bind(this):
this.lookup,a=c(a,this.neverForceAsync));this.cacheable&&!q&&(this._cachedLookup=a);return a};var q=!1;d.prototype._findPredictions=function(a,b){return h.resolve(this.getLookup()).then(function(c){var d=[],f,l,h=e.maxPredictions,g=a.text.toLowerCase();if(b||0<a.suffix.length){var m;for(f=0;f<c.length&&d.length<h;f++)if(l=c[f],l.name===a.text){if(!l.value.exec){m=!0;d=[];break}this._addToPredictions(d,l,a)}if(!m)return d}for(f=0;f<c.length;f++)l=c[f],null==l._gcliLowerName&&(l._gcliLowerName=l.name.toLowerCase());
for(f=0;f<c.length&&d.length<h;f++)l=c[f],l.name===a.text&&this._addToPredictions(d,l,a);for(f=0;f<c.length&&d.length<h;f++)l=c[f],0===l._gcliLowerName.indexOf(g)&&!l.value.hidden&&-1===d.indexOf(l)&&this._addToPredictions(d,l,a);if(d.length<h/2)for(f=0;f<c.length&&d.length<h;f++)l=c[f],-1!==l._gcliLowerName.indexOf(g)&&!l.value.hidden&&-1===d.indexOf(l)&&this._addToPredictions(d,l,a);if(0===d.length){var k=[];c.forEach(function(a){a.value.hidden||k.push(a.name)});var q=p.correct(g,k);q&&c.forEach(function(a){a.name===
q&&d.push(a)},this)}return d}.bind(this))};d.prototype._addToPredictions=function(a,b,c){a.push(b)};d.prototype.parse=function(b){return this._findPredictions(b).then(function(c){if(0===c.length){var d=a.lookupFormat("typesSelectionNomatch",[b.text]);return new e(void 0,b,f.ERROR,d,h.resolve(c))}this.noMatch&&this.noMatch();return c[0].name===b.text?new e(c[0].value,b,f.VALID,"",h.resolve(c)):new e(void 0,b,f.INCOMPLETE,"",h.resolve(c))}.bind(this))};d.prototype.getBlank=function(){var a=function(){return h.resolve(this.getLookup()).then(function(a){return a.filter(function(a){return!a.value.hidden}).slice(0,
e.maxPredictions-1)},console.error)}.bind(this);return new e(void 0,new s,f.INCOMPLETE,"",a)};d.prototype.decrement=function(a){var c=b.synchronize(this.getLookup());a=this._findValue(c,a);-1===a&&(a=0);a++;a>=c.length&&(a=0);return c[a].value};d.prototype.increment=function(a){var c=b.synchronize(this.getLookup());a=this._findValue(c,a);-1===a&&(a=1);a--;0>a&&(a=c.length-1);return c[a].value};d.prototype._findValue=function(a,b){for(var c=-1,e=0;e<a.length;e++)if(a[e].value===b){c=e;break}return c};
d.prototype.name="selection";g.SelectionType=d});
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(k,g,n){function d(a){}function c(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 m(a){}function h(a){if("function"!==typeof a.delegateType)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(a){}function a(a){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=p.getType(this.subtype)}var l=k("util/promise"),f=k("util/util"),
e=k("util/l10n"),p=k("gcli/types");n=k("gcli/types").Type;var s=k("gcli/types").Status,q=k("gcli/types").Conversion,r=k("gcli/types").ArrayConversion,w=k("gcli/types/selection").SelectionType,u=k("gcli/argument").BlankArgument,z=k("gcli/argument").ArrayArgument;g.startup=function(){p.registerType(d);p.registerType(c);p.registerType(m);p.registerType(b);p.registerType(h);p.registerType(a)};g.shutdown=function(){p.unregisterType(d);p.unregisterType(c);p.unregisterType(m);p.unregisterType(b);p.unregisterType(h);
p.unregisterType(a)};d.prototype=Object.create(n.prototype);d.prototype.stringify=function(a){return null==a?"":a.toString()};d.prototype.parse=function(a){return null==a.text||""===a.text?l.resolve(new q(void 0,a,s.INCOMPLETE,"")):l.resolve(new q(a.text,a))};d.prototype.name="string";g.StringType=d;c.prototype=Object.create(n.prototype);c.prototype.stringify=function(a){return null==a?"":""+a};c.prototype.getMin=function(){if(this._min){if("function"===typeof this._min)return this._min();if("number"===
typeof this._min)return this._min}};c.prototype.getMax=function(){if(this._max){if("function"===typeof this._max)return this._max();if("number"===typeof this._max)return this._max}};c.prototype.parse=function(a){if(0===a.text.replace(/^\s*-?/,"").length)return l.resolve(new q(void 0,a,s.INCOMPLETE,""));if(!this._allowFloat&&-1!==a.text.indexOf(".")){var b=e.lookupFormat("typesNumberNotInt2",[a.text]);return l.resolve(new q(void 0,a,s.ERROR,b))}b=this._allowFloat?parseFloat(a.text):parseInt(a.text,
10);if(isNaN(b))return b=e.lookupFormat("typesNumberNan",[a.text]),l.resolve(new q(void 0,a,s.ERROR,b));var c=this.getMax();if(null!=c&&b>c)return b=e.lookupFormat("typesNumberMax",[b,c]),l.resolve(new q(void 0,a,s.ERROR,b));c=this.getMin();return null!=c&&b<c?(b=e.lookupFormat("typesNumberMin",[b,c]),l.resolve(new q(void 0,a,s.ERROR,b))):l.resolve(new q(b,a))};c.prototype.decrement=function(a){if("number"!==typeof a||isNaN(a))return this.getMax()||1;a-=this._step;a=Math.ceil(a/this._step)*this._step;
return this._boundsCheck(a)};c.prototype.increment=function(a){if("number"!==typeof a||isNaN(a))return a=this.getMin(),null!=a?a:0;a+=this._step;a=Math.floor(a/this._step)*this._step;return null==this.getMax()?a:this._boundsCheck(a)};c.prototype._boundsCheck=function(a){var b=this.getMin();if(null!=b&&a<b)return b;b=this.getMax();return null!=b&&a>b?b:a};c.prototype._isFloat=function(a){return"number"===typeof a&&isFinite(a)&&0!==a%1};c.prototype.name="number";g.NumberType=c;m.prototype=Object.create(w.prototype);
m.prototype.lookup=[{name:"false",value:!1},{name:"true",value:!0}];m.prototype.parse=function(a){return"TrueNamedArgument"===a.type?l.resolve(new q(!0,a)):"FalseNamedArgument"===a.type?l.resolve(new q(!1,a)):w.prototype.parse.call(this,a)};m.prototype.stringify=function(a){return null==a?"":""+a};m.prototype.getBlank=function(){return new q(!1,new u,s.VALID,"",l.resolve(this.lookup))};m.prototype.name="boolean";g.BooleanType=m;h.prototype.delegateType=function(){throw Error("Not implemented");};
h.prototype=Object.create(n.prototype);h.prototype.stringify=function(a){return this.delegateType().stringify(a)};h.prototype.parse=function(a){return this.delegateType().parse(a)};h.prototype.decrement=function(a){var b=this.delegateType();return b.decrement?b.decrement(a):void 0};h.prototype.increment=function(a){var b=this.delegateType();return b.increment?b.increment(a):void 0};h.prototype.getType=function(){return this.delegateType()};Object.defineProperty(h.prototype,"isImportant",{get:function(){return this.delegateType().isImportant},
enumerable:!0});h.prototype.name="delegate";g.DelegateType=h;b.prototype=Object.create(n.prototype);b.prototype.stringify=function(a){return""};b.prototype.parse=function(a){return l.resolve(new q(void 0,a))};b.prototype.name="blank";g.BlankType=b;a.prototype=Object.create(n.prototype);a.prototype.stringify=function(a){return null==a?"":a.join(" ")};a.prototype.parse=function(a){if("ArrayArgument"!==a.type)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 r(b,a)})};a.prototype.getBlank=function(a){return new r([],new z)};a.prototype.name="array";g.ArrayType=a});
define("gcli/canon","require exports module util/promise util/util util/l10n gcli/types gcli/types gcli/types/basic gcli/types/selection".split(" "),function(k,g,n){function d(a,c){if(null==a)return c?b.lookup(c):a;if("string"===typeof a)return a;if("object"===typeof a){if(a.key)return b.lookup(a.key);var e=b.getPreferredLocales(),d;e.some(function(b){d=a[b];return null!=d});if(null!=d)return d;console.error("Can't find locale in descriptions: locales\x3d"+JSON.stringify(e)+", description\x3d"+JSON.stringify(a));
return"(No description)"}return b.lookup(c)}function c(a){Object.keys(a).forEach(function(b){this[b]=a[b]},this);if(!this.name)throw Error("All registered commands must have a name");null==this.params&&(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=d(this.description,"canonDescNone");this.manual="manual"in this?this.manual:void 0;this.manual=
d(this.manual);var b=this.params;this.params=[];var c=!1;null==this.returnType&&(this.returnType="string");b.forEach(function(a){if(a.group)a.params.forEach(function(b){b=new m(b,this,a.group);this.params.push(b);b.isPositionalAllowed||(this.hasNamedParameters=!0)},this),c=!0;else{if(c)throw Error("Parameters can't come after param groups. Ignoring "+this.name+"/"+a.name);var b=new m(a,this,null);this.params.push(b);b.isPositionalAllowed||(this.hasNamedParameters=!0)}},this)}function m(b,c,e){this.command=
c||{name:"unnamed"};this.paramSpec=b;this.name=this.paramSpec.name;this.type=this.paramSpec.type;this.groupName=e;if(!this.name)throw Error("In "+this.command.name+": all params must have a name");b=this.type;this.type=a.getType(b);if(null==this.type)throw console.error("Known types: "+a.getTypeNames().join(", ")),Error("In "+this.command.name+"/"+this.name+": can't find type for: "+JSON.stringify(b));if(this.type instanceof f&&void 0!==this.paramSpec.defaultValue)throw Error("In "+this.command.name+
"/"+this.name+": boolean parameters can not have a defaultValue. Ignoring");if(null!=this._defaultValue)try{var d=this.type.stringify(this.paramSpec.defaultValue);this.type.parseString(d).then(function(a){a.getStatus()!==l.VALID&&console.error("In "+this.command.name+"/"+this.name+": Error round tripping defaultValue. status \x3d "+a.getStatus())}.bind(this),console.error)}catch(h){throw Error("In "+this.command.name+"/"+this.name+": "+h);}if(!this.isPositionalAllowed&&void 0===this.paramSpec.defaultValue&&
null==this.type.getBlank&&!(this.type instanceof f))throw Error("In "+this.command.name+"/"+this.name+": Missing defaultValue for optional parameter.");}k("util/promise");var h=k("util/util"),b=k("util/l10n"),a=k("gcli/types"),l=k("gcli/types").Status,f=k("gcli/types/basic").BooleanType;k("gcli/types/selection");g.Command=c;Object.defineProperty(m.prototype,"defaultValue",{get:function(){"_defaultValue"in this||(this._defaultValue=void 0!==this.paramSpec.defaultValue?this.paramSpec.defaultValue:this.type.getBlank().value);
return this._defaultValue},enumerable:!0});m.prototype.isKnownAs=function(a){return a==="--"+this.name?!0:!1};m.prototype.getBlank=function(){return this.type.getBlank()};Object.defineProperty(m.prototype,"manual",{get:function(){return d(this.paramSpec.manual||void 0)},enumerable:!0});Object.defineProperty(m.prototype,"description",{get:function(){return d(this.paramSpec.description||void 0,"canonDescNone")},enumerable:!0});Object.defineProperty(m.prototype,"isDataRequired",{get:function(){return void 0===
this.defaultValue},enumerable:!0});Object.defineProperty(m.prototype,"hidden",{get:function(){return this.paramSpec.hidden},enumerable:!0});Object.defineProperty(m.prototype,"isPositionalAllowed",{get:function(){return null==this.groupName},enumerable:!0});g.Parameter=m;var e={},p=[],s={};g.addCommand=function(a){null!=e[a.name]&&(delete e[a.name],p=p.filter(function(b){return b!==a.name}));var b=new c(a);e[a.name]=b;p.push(a.name);p.sort();s[a.name]=a;g.onCanonChange();return b};g.removeCommand=
function(a){var b="string"===typeof a?a:a.name;if(!e[b])return!1;delete e[b];delete s[b];p=p.filter(function(a){return a!==b});g.onCanonChange();return!0};g.getCommand=function(a){return e[a]||void 0};g.getCommands=function(){return Object.keys(e).map(function(a){return e[a]},this)};g.getCommandNames=function(){return p.slice(0)};g.getCommandSpecs=function(){return s};g.onCanonChange=h.createEvent("canon.onCanonChange");g.CommandOutputManager=function(){this.onOutput=h.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(k,g,n){function d(a){this.requisition=a.requisition;this.isIncompleteName=a.isIncompleteName;this.stringifyProperty="name";this.neverForceAsync=!0}function c(){this.stringifyProperty="name";this.neverForceAsync=!0}var m=k("util/promise"),h=k("util/l10n"),b=k("gcli/canon"),a=k("gcli/types"),l=k("gcli/types/selection").SelectionType,f=k("gcli/types").Status,
e=k("gcli/types").Conversion;g.startup=function(){a.registerType(c);a.registerType(d)};g.shutdown=function(){a.unregisterType(c);a.unregisterType(d)};d.prototype=Object.create(l.prototype);d.prototype.name="param";d.prototype.lookup=function(){var a=[],b=this.requisition.commandAssignment.value;null!=b&&b.params.forEach(function(b){var c=this.requisition.getAssignment(b.name).arg;!b.isPositionalAllowed&&"BlankArgument"===c.type&&a.push({name:"--"+b.name,value:b})},this);return a};d.prototype.parse=
function(a,b){if(this.isIncompleteName)return l.prototype.parse.call(this,a);var c=h.lookup("cliUnusedArg");if(b){var d=b.commandAssignment.conversion;d.getStatus()===f.ERROR&&d.message&&(c=d.message)}return m.resolve(new e(void 0,a,f.ERROR,c))};c.prototype=Object.create(l.prototype);c.prototype.name="command";c.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)};c.prototype._addToPredictions=
function(a,b,c){(0!==c.text.length||-1===b.name.indexOf(" "))&&a.push(b)};c.prototype.parse=function(a,b){var c=function(){return this._findPredictions(a,b)}.bind(this);return this._findPredictions(a,b).then(function(b){if(0===b.length)return b=h.lookupFormat("typesSelectionNomatch",[a.text]),new e(void 0,a,f.ERROR,b,c);var d=b[0].value;return 1===b.length?d.name===a.text&&"function"===typeof d.exec?new e(d,a,f.VALID,""):new e(void 0,a,f.INCOMPLETE,"",c):b[0].name===a.text?new e(d,a,f.VALID,"",c):
new e(void 0,a,f.INCOMPLETE,"",c)}.bind(this))}});
define("gcli/types/javascript","require exports module util/promise util/l10n gcli/types".split(" "),function(k,g,n){function d(a){}function c(a){return 0===a.indexOf("moz")||0===a.indexOf("webkit")||0===a.indexOf("ms")}var m=k("util/promise"),h=k("util/l10n"),b=k("gcli/types"),a=b.Conversion;k=b.Type;var l=b.Status;g.startup=function(){b.registerType(d)};g.shutdown=function(){b.unregisterType(d)};var f=void 0;"undefined"!==typeof window&&(f=window);g.setGlobalObject=function(a){f=a};g.getGlobalObject=
function(){return f};g.unsetGlobalObject=function(){f=void 0};d.prototype=Object.create(k.prototype);d.prototype.stringify=function(a){return null==a?"":a};d.MAX_COMPLETION_MATCHES=10;d.prototype.parse=function(b){var g=b.text,k=f;if(""===g)return m.resolve(new a(void 0,b,l.INCOMPLETE));if(!isNaN(parseFloat(g))&&isFinite(g)||g.trim().match(/(null|undefined|NaN|Infinity|true|false)/))return m.resolve(new a(g,b));var p=this._findCompletionBeginning(g);if(p.err)return m.resolve(new a(g,b,l.ERROR,p.err));
if(p.state===e.COMPLEX)return m.resolve(new a(g,b));if(p.state!==e.NORMAL)return m.resolve(new a(g,b,l.INCOMPLETE,""));var p=g.substring(p.startPos).split("."),q,n=void 0;if(1<p.length){q=p.pop().trimLeft();for(var s=0;s<p.length;s++){n=p[s].trim();if(null==k)return m.resolve(new a(g,b,l.ERROR,h.lookup("jstypeParseScope")));if(""===n)return m.resolve(new a(g,b,l.INCOMPLETE,""));if(this._isSafeProperty(k,n))return m.resolve(new a(g,b));try{k=k[n]}catch(r){return m.resolve(new a(g,b,l.VALID,""))}}}else q=
p[0].trimLeft();if(n&&!n.match(/^[0-9A-Za-z]*$/))return m.resolve(new a(g,b));if(null==k)return p=h.lookupFormat("jstypeParseMissing",[n]),m.resolve(new a(g,b,l.ERROR,p));if(!q.match(/^[0-9A-Za-z]*$/)||this._isIteratorOrGenerator(k))return m.resolve(new a(g,b));var p=q.length,J=0===p?g:g.slice(0,-p),E=l.INCOMPLETE,p="",C={},x=0,n=k;try{for(;null!=n&&Object.keys(C).length<d.MAX_COMPLETION_MATCHES;)Object.keys(n).forEach(function(a){0===a.indexOf(q)&&!(a in C)&&(C[a]={prop:a,distUpPrototypeChain:x})}),
x++,n=Object.getPrototypeOf(n)}catch(D){return m.resolve(new a(g,b,l.INCOMPLETE,""))}C=Object.keys(C).map(function(a){a===q&&(E=l.VALID);return C[a]});C.sort(function(a,b){return a.distUpPrototypeChain!==b.distUpPrototypeChain?a.distUpPrototypeChain-b.distUpPrototypeChain:c(a.prop)?c(b.prop)?a.prop.localeCompare(b.prop):1:c(b.prop)?-1:a.prop.localeCompare(b.prop)});C.length>d.MAX_COMPLETION_MATCHES&&(C=C.slice(0,d.MAX_COMPLETION_MATCHES-1));n=C.map(function(a){var b,c=!0;if(this._isSafeProperty(k,
a.prop))b="(property getter)";else try{var e=k[a.prop];"function"===typeof e?b="(function)":"boolean"===typeof e||"number"===typeof e?(b="\x3d "+e,c=!1):"string"===typeof e?(40<e.length&&(e=e.substring(0,37)+"\u2026"),b="\x3d '"+e+"'",c=!1):b="("+typeof e+")"}catch(d){b="("+h.lookup("jstypeParseError")+")"}return{name:J+a.prop,value:{name:J+a.prop,description:b},description:b,incomplete:c}},this);0===n.length&&(E=l.ERROR,p=h.lookupFormat("jstypeParseMissing",[q]));1===n.length&&E===l.VALID&&(n=[]);
return m.resolve(new a(g,b,E,p,m.resolve(n)))};var e={NORMAL:0,COMPLEX:1,QUOTE:2,DQUOTE:3},p=["{","[","("],s=["}","]",")"],q={"{":"}","[":"]","(":")"},r=/[a-zA-Z0-9.]/;d.prototype._findCompletionBeginning=function(a){for(var b=[],c=e.NORMAL,d=0,f,l=!1,g=0;g<a.length;g++)switch(f=a[g],r.test(f)||(l=!0),c){case e.NORMAL:if('"'===f)c=e.DQUOTE;else if("'"===f)c=e.QUOTE;else if(";"===f)d=g+1;else if(" "===f)d=g+1;else if(-1!=p.indexOf(f))b.push({token:f,start:d}),d=g+1;else if(-1!=s.indexOf(f)){d=b.pop();
if(!d||q[d.token]!=f)return{err:h.lookup("jstypeBeginSyntax")};d="}"===f?g+1:d.start}break;case e.DQUOTE:if("\\"===f)g++;else{if("\n"===f)return{err:h.lookup("jstypeBeginUnterm")};'"'===f&&(c=e.NORMAL)}break;case e.QUOTE:if("\\"===f)g++;else{if("\n"===f)return{err:h.lookup("jstypeBeginUnterm")};"'"===f&&(c=e.NORMAL)}}c===e.NORMAL&&l&&(c=e.COMPLEX);return{state:c,startPos:d}};d.prototype._isIteratorOrGenerator=function(a){if(null===a)return!1;if("object"===typeof aObject){if("function"===typeof a.__iterator__||
a.constructor&&"Iterator"===a.constructor.name)return!0;try{var b=a.toString();if("function"===typeof a.next&&0===b.indexOf("[object Generator"))return!0}catch(c){}}return!1};d.prototype._isSafeProperty=function(a,b){if("object"!==typeof a)return!1;for(var c=void 0;a;){try{if(c=Object.getOwnPropertyDescriptor(a,b))break}catch(e){return"NS_ERROR_XPC_BAD_CONVERT_JS"===e.name||"NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"===e.name?!1:!0}a=Object.getPrototypeOf(a)}return!c||!c.get?!1:"function"!==typeof c.get||"prototype"in
c.get};d.prototype.name="javascript";g.JavascriptType=d});
define("util/host",["require","exports","module"],function(k,g,n){function d(c,d){if(!c.__gcliHighlighting){c.__gcliHighlighting=!0;var h=c.style.background;c.style.background=d?"green":"red";setTimeout(function(){c.style.background=h;delete c.__gcliHighlighting},500)}}g.flashNodes=function(c,g){c.style?d(c,g):Array.prototype.forEach.call(c,function(c){d(c,g)})};g.exec=function(c,d){var h=JSON.stringify(d),b=new XMLHttpRequest;b.open("POST","/exec/",!0);b.setRequestHeader("Content-Type","application/json; charset\x3dutf-8");
b.setRequestHeader("Content-Length",h.length);b.onreadystatechange=function(a){4==b.readyState&&(300<=b.status||200>b.status?c.reject(b.responseText):c.resolve(b.responseText))};b.send(h)};g.func=function(c,d){var h=JSON.stringify(d),b=new XMLHttpRequest;b.open("POST","/func/",!0);b.setRequestHeader("Content-Type","application/json; charset\x3dutf-8");b.setRequestHeader("Content-Length",h.length);b.onreadystatechange=function(a){4==b.readyState&&(300<=b.status||200>b.status?c.reject(JSON.parse(b.responseText)):
c.resolve(JSON.parse(b.responseText)))};b.send(h)}});
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(k,g,n){function d(a){}function c(a){if("allowEmpty"in a&&"boolean"!==typeof a.allowEmpty)throw Error("Legal values for allowEmpty are [true|false]");this.allowEmpty=a.allowEmpty}var m=k("util/promise"),h=k("util/host"),b=k("util/l10n"),a=k("gcli/types");n=k("gcli/types").Type;var l=k("gcli/types").Status,f=k("gcli/types").Conversion,e=k("gcli/argument").BlankArgument;
g.startup=function(){a.registerType(d);a.registerType(c)};g.shutdown=function(){a.unregisterType(d);a.unregisterType(c)};var p=void 0;"undefined"!==typeof document&&(p=document);g._empty=[];g.setDocument=function(a){p=a;null!=p&&(g._empty=p.querySelectorAll("x\x3e:root"))};g.unsetDocument=function(){p=void 0;g._empty=void 0};g.getDocument=function(){return p};d.prototype=Object.create(n.prototype);d.prototype.stringify=function(a){return null==a?"":a.__gcliQuery||"Error"};d.prototype.parse=function(a){if(""===
a.text)return m.resolve(new f(void 0,a,l.INCOMPLETE));var c;try{c=p.querySelectorAll(a.text)}catch(e){return m.resolve(new f(void 0,a,l.ERROR,b.lookup("nodeParseSyntax")))}if(0===c.length)return m.resolve(new f(void 0,a,l.INCOMPLETE,b.lookup("nodeParseNone")));if(1===c.length)return c=c.item(0),c.__gcliQuery=a.text,h.flashNodes(c,!0),m.resolve(new f(c,a,l.VALID,""));h.flashNodes(c,!1);c=b.lookupFormat("nodeParseMultiple",[c.length]);return m.resolve(new f(void 0,a,l.ERROR,c))};d.prototype.name="node";
c.prototype=Object.create(n.prototype);c.prototype.getBlank=function(){return new f(g._empty,new e,l.VALID)};c.prototype.stringify=function(a){return null==a?"":a.__gcliQuery||"Error"};c.prototype.parse=function(a){if(""===a.text)return m.resolve(new f(void 0,a,l.INCOMPLETE));var c;try{c=p.querySelectorAll(a.text)}catch(e){return m.resolve(new f(void 0,a,l.ERROR,b.lookup("nodeParseSyntax")))}if(0===c.length&&!this.allowEmpty)return m.resolve(new f(void 0,a,l.INCOMPLETE,b.lookup("nodeParseNone")));
h.flashNodes(c,!1);return m.resolve(new f(c,a,l.VALID,""))};c.prototype.name="nodelist"});
define("gcli/types/resource","require exports module util/promise gcli/types gcli/types/selection".split(" "),function(k,g,n){function d(a,b,c,e){this.name=a;this.type=b;this.inline=c;this.element=e}function c(a){this.name=a.href;this.name||(this.name=a.ownerNode.id?"css#"+a.ownerNode.id:"inline-css");this.inline=null==a.href;this.type=d.TYPE_CSS;this.element=a}function m(a){this.name=a.src;this.name||(this.name=a.id?"script#"+a.id:"inline-script");this.inline=""===a.src||null==a.src;this.type=d.TYPE_SCRIPT;
this.element=a}function h(a,b){var c={};a.forEach(function(a){null==c[a.name]&&(c[a.name]=[]);c[a.name].push(a)});Object.keys(c).forEach(function(a){a=c[a];1<a.length&&b(a)})}function b(a){this.include=a.include;if(this.include!==d.TYPE_SCRIPT&&this.include!==d.TYPE_CSS&&null!=this.include)throw Error("invalid include property: "+this.include);}var a=k("util/promise"),l=k("gcli/types");k=k("gcli/types/selection").SelectionType;g.startup=function(){l.registerType(b)};g.shutdown=function(){l.unregisterType(b);
g.clearResourceCache()};g.clearResourceCache=function(){e.clear()};var f=void 0;"undefined"!==typeof document&&(f=document);g.setDocument=function(a){f=a};g.unsetDocument=function(){e.clear();f=void 0};g.getDocument=function(){return f};d.prototype.getContents=function(){throw Error("not implemented");};d.TYPE_SCRIPT="text/javascript";d.TYPE_CSS="text/css";c.prototype=Object.create(d.prototype);c.prototype.loadContents=function(a){a(this.element.ownerNode.innerHTML)};c._getAllStyles=function(){var a=
[];if(null==f)return a;Array.prototype.forEach.call(f.styleSheets,function(b){c._getStyle(b,a)});h(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};c._getStyle=function(a,b){var d=e.get(a);d||(d=new c(a),e.add(a,d));b.push(d);try{Array.prototype.forEach.call(a.cssRules,function(a){a.type==CSSRule.IMPORT_RULE&&a.styleSheet&&c._getStyle(a.styleSheet,b)},this)}catch(f){}};m.prototype=Object.create(d.prototype);m.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()}};m._getAllScripts=function(){if(null==f)return[];var a=f.querySelectorAll("script"),a=Array.prototype.map.call(a,function(a){var b=e.get(a);b||(b=new m(a),e.add(a,b));return b});h(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};b.prototype=Object.create(k.prototype);b.prototype.getLookup=function(){var b=[];this.include!==
d.TYPE_SCRIPT&&Array.prototype.push.apply(b,c._getAllStyles());this.include!==d.TYPE_CSS&&Array.prototype.push.apply(b,m._getAllScripts());return a.resolve(b.map(function(a){return{name:a.name,value:a}}))};b.prototype.name="resource";var e={_cached:[],get:function(a){for(var b=0;b<e._cached.length;b++)if(e._cached[b].node===a)return e._cached[b].resource;return null},add:function(a,b){e._cached.push({node:a,resource:b})},clear:function(){e._cached=[]}}});
define("gcli/settings",["require","exports","module","util/util","gcli/types"],function(k,g,n){function d(){}function c(a,b,c,d){this.name=a;this.type=b;this.description=c;this._defaultValue=d;this.onChange=m.createEvent("Setting.onChange");this.setDefault()}var m=k("util/util"),h=k("gcli/types"),b={},a={},l;g.setDefaults=function(b){Object.keys(b).forEach(function(c){void 0===a[c]&&(a[c]=b[c])})};g.startup=function(){l=new d;l.load(a)};g.shutdown=function(){};g.getAll=function(a){var c=[];Object.keys(b).forEach(function(d){(null==
a||-1!==d.indexOf(a))&&c.push(b[d])}.bind(this));c.sort(function(a,b){return a.name.localeCompare(b.name)}.bind(this));return c};g.addSetting=function(a){var e=h.getType(a.type);a=new c(a.name,e,a.description,a.defaultValue);b[a.name]=a;g.onChange({added:a.name});return a};g.getSetting=function(a){return b[a]};g.removeSetting=function(a){a="string"===typeof nameOrPrefSpec?a:a.name;delete b[a];g.onChange({removed:a})};g.onChange=m.createEvent("Settings.onChange");d.prototype.load=function(a){if("undefined"!==
typeof localStorage){var b=localStorage.getItem("gcli-settings");if(null!=b){var c=JSON.parse(b);Object.keys(c).forEach(function(b){a[b]=c[b]})}}};d.prototype.save=function(a){"undefined"!==typeof localStorage&&(a=JSON.stringify(a),localStorage.setItem("gcli-settings",a))};g.LocalSettingStorage=d;c.prototype.setDefault=function(){this.value=this._defaultValue};Object.defineProperty(c.prototype,"value",{get:function(){return a[this.name]},set:function(b){a[this.name]=b;l.save(a);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(k,g,n){function d(a){m.onChange.add(function(a){this.clearCache()},this)}function c(a){}var m=k("gcli/settings"),h=k("gcli/types"),b=k("gcli/types/selection").SelectionType;k=k("gcli/types/basic").DelegateType;g.startup=function(){h.registerType(d);h.registerType(c)};g.shutdown=function(){h.unregisterType(d);h.unregisterType(c)};var a=null;d.prototype=new b({cacheable:!0});
d.prototype.lookup=function(){return m.getAll().map(function(a){return{name:a.name,value:a}})};d.prototype.noMatch=function(){a=null};d.prototype.stringify=function(c){a=c;return b.prototype.stringify.call(this,c)};d.prototype.parse=function(c){c=b.prototype.parse.call(this,c);c.then(function(b){a=b.value});return c};d.prototype.name="setting";c.prototype=Object.create(k.prototype);c.prototype.delegateType=function(){return null!=a?a.type:h.getType("blank")};c.prototype.name="settingValue"});
define("util/domtemplate",["require","exports","module"],function(k,g,n){function d(d,h,b){b=new c(b||{});b.processNode(d,h);return b}function c(c){null==c&&(c={allowEval:!0});this.options=c;c.stack&&Array.isArray(c.stack)?this.stack=c.stack:this.stack="string"===typeof c.stack?[c.stack]:[];this.nodes=[]}c.prototype._templateRegion=/\$\{([^}]*)\}/g;c.prototype._splitSpecial=/\uF001|\uF002/;c.prototype._isPropertyScript=/^[_a-zA-Z0-9.]*$/;c.prototype.processNode=function(c,d){"string"===typeof c&&
(c=document.getElementById(c));null==d&&(d={});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,d);return}if(c.hasAttribute("if")&&!this._processIf(c,d))return;this.nodes.push(d.__element);d.__element=c;for(var b=!0,a=Array.prototype.slice.call(c.attributes),l=0;l<a.length;l++){var f=a[l].value,e=a[l].name;this.stack.push(e);try{if("save"===e)f=this._stripBraces(f),this._property(f,d,c),c.removeAttribute("save");
else if("on"===e.substring(0,2))if("${"===f.substring(0,2)&&"}"===f.slice(-1)&&-1===f.indexOf("${",2)){var f=this._stripBraces(f),g=this._property(f,d);if("function"===typeof g){c.removeAttribute(e);var k=c.hasAttribute("capture"+e.substring(2));c.addEventListener(e.substring(2),g,k);k&&c.removeAttribute("capture"+e.substring(2))}else c.setAttribute(e,g)}else c.setAttribute(e,this._processString(f,d));else{c.removeAttribute(e);"_"===e.charAt(0)&&(e=e.substring(1));var n;0===f.indexOf("${")&&"}"===
f.charAt(f.length-1)?(n=this._envEval(f.slice(2,-1),d,f))&&"function"===typeof n.then?(c.setAttribute(e,""),n.then(function(a){c.setAttribute(e,a)}.bind(this)).then(null,console.error)):(this.options.blankNullUndefined&&null==n&&(n=""),c.setAttribute(e,n)):c.setAttribute(e,this._processString(f,d))}}finally{this.stack.pop()}}}for(var r=Array.prototype.slice.call(c.childNodes),a=0;a<r.length;a++)this.processNode(r[a],d);3===c.nodeType&&this._processTextNode(c,d)}finally{b&&(d.__element=this.nodes.pop()),
this.stack.pop()}};c.prototype._processString=function(c,d){return c.replace(this._templateRegion,function(b){b=this._envEval(b.slice(2,-1),d,c);return this.options.blankNullUndefined&&null==b?"":b}.bind(this))};c.prototype._processIf=function(c,d){this.stack.push("if");try{var b=c.getAttribute("if"),a=this._stripBraces(b),l=!0;try{l=!!this._envEval(a,d,b)}catch(f){this._handleError("Error with '"+a+"'",f),l=!1}l||c.parentNode.removeChild(c);c.removeAttribute("if");return l}finally{this.stack.pop()}};
c.prototype._processForEach=function(c,d){this.stack.push("foreach");try{var b=c.getAttribute("foreach"),a=b,l="param";if("$"===a.charAt(0))a=this._stripBraces(a);else var f=a.split(" in "),l=f[0].trim(),a=this._stripBraces(f[1].trim());c.removeAttribute("foreach");try{var e=this._envEval(a,d,b);this._handleAsync(e,c,function(a,b){this._processForEachLoop(a,c,b,d,l)}.bind(this));c.parentNode.removeChild(c)}catch(g){this._handleError("Error with '"+a+"'",g)}}finally{this.stack.pop()}};c.prototype._processForEachLoop=
function(c,d,b,a,l){if(Array.isArray(c))c.forEach(function(c,f){this._processForEachMember(c,d,b,a,l,""+f)},this);else for(var f in c)c.hasOwnProperty(f)&&this._processForEachMember(f,d,b,a,l,f)};c.prototype._processForEachMember=function(c,d,b,a,l,f){this.stack.push(f);try{this._handleAsync(c,b,function(b,c){a[l]=b;if(null!=c.parentNode)if("loop"===d.nodeName.toLowerCase())for(var f=0;f<d.childNodes.length;f++){var g=d.childNodes[f].cloneNode(!0);c.parentNode.insertBefore(g,c);this.processNode(g,
a)}else g=d.cloneNode(!0),g.removeAttribute("foreach"),c.parentNode.insertBefore(g,c),this.processNode(g,a);delete a[l]}.bind(this))}finally{this.stack.pop()}};c.prototype._processTextNode=function(c,d){var b=c.data,b=b.replace(this._templateRegion,"\uf001$$$1\uf002"),b=b.split(this._splitSpecial);1<b.length&&(b.forEach(function(a){null===a||(void 0===a||""===a)||("$"===a.charAt(0)&&(a=this._envEval(a.slice(1),d,c.data)),this._handleAsync(a,c,function(a,b){var c=b.ownerDocument;null==a&&(a=this.options.blankNullUndefined?
"":""+a);"function"===typeof a.cloneNode?(a=this._maybeImportNode(a,c),b.parentNode.insertBefore(a,b)):"function"===typeof a.item&&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))};c.prototype._maybeImportNode=function(c,d){return c.ownerDocument===d?c:d.importNode(c,!0)};c.prototype._handleAsync=function(c,
d,b){if(null!=c&&"function"===typeof c.then){var a=d.ownerDocument.createElement("span");d.parentNode.insertBefore(a,d);c.then(function(c){b(c,a);null!=a.parentNode&&a.parentNode.removeChild(a)}.bind(this)).then(null,function(a){console.error(a.stack)})}else b(c,d)};c.prototype._stripBraces=function(c){return!c.match(this._templateRegion)?(this._handleError("Expected "+c+" to match ${...}"),c):c.slice(2,-1)};c.prototype._property=function(c,d,b){try{"string"===typeof c&&(c=c.split("."));var a=d[c[0]];
return 1===c.length?(void 0!==b&&(d[c[0]]=b),"function"===typeof a?a.bind(d):a):!a?(this._handleError('"'+c[0]+'" is undefined'),null):this._property(c.slice(1),a,b)}catch(l){return this._handleError("Path error with '"+c+"'",l),"${"+c+"}"}};c.prototype._envEval=function(c,d,b){try{this.stack.push(b.replace(/\s+/g," "));if(this._isPropertyScript.test(c))return this._property(c,d);if(!this.options.allowEval)return this._handleError("allowEval is not set, however '"+c+"' can not be resolved using a simple property path."),
"${"+c+"}";with(d)return eval(c)}catch(a){return this._handleError("Template error evaluating '"+c+"'",a),"${"+c+"}"}finally{this.stack.pop()}};c.prototype._handleError=function(c,d){this._logError(c+" (In: "+this.stack.join(" \x3e ")+")");d&&this._logError(d)};c.prototype._logError=function(c){console.log(c)};"undefined"!==typeof g&&(g.template=d)});
define("gcli/ui/view",["require","exports","module","util/util","util/domtemplate"],function(k,g,n){var d=k("util/util"),c=k("util/domtemplate");g.createView=function(g){if(null==g.html)throw Error("options.html is missing");return{isView:!0,appendTo:function(c,b){!0===b&&d.clearElement(c);c.appendChild(this.toDom(c.ownerDocument))},toDom:function(h){g.css&&d.importCss(g.css,h,g.cssId);h=d.toDom(h,g.html);c.template(h,g.data||{},g.options||{});return h}}}});
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(k,g,n){function d(a,b){this.param=a;this.conversion=void 0;this.paramIndex=b;this.onAssignmentChange=f.createEvent("Assignment.onAssignmentChange")}function c(){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 s.Parameter(a);this.paramIndex=-1;this.onAssignmentChange=f.createEvent("CommandAssignment.onAssignmentChange")}function m(a,b){this.param=new s.Parameter({name:"__unassigned",description:e.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,a));this.conversion.assign(this)}function h(a,b,e){this.environment=a;this.document=b;if(null==this.document)try{this.document=document}catch(d){}this.commandOutputManager=e||new q;this.commandAssignment=new c;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 a(a){a=a||{};this.command=a.command||"";this.args=a.args||{};this.typed=a.typed||"";this.canonical=a.canonical||"";this.hidden=!0===a.hidden?!0:
!1;this.data=void 0;this.error=this.completed=!1;this.start=new Date;this.deferred=l.defer();this.then=this.deferred.promise.then;this.onClose=f.createEvent("Output.onClose");this.onChange=f.createEvent("Output.onChange")}var l=k("util/promise"),f=k("util/util"),e=k("util/l10n"),p=k("gcli/ui/view"),s=k("gcli/canon"),q=k("gcli/canon").CommandOutputManager,r=k("gcli/types").Status,w=k("gcli/types").Conversion,u=k("gcli/types/basic").ArrayType,z=k("gcli/types/basic").StringType,t=k("gcli/types/basic").BooleanType,
v=k("gcli/types/basic").NumberType,y=k("gcli/argument").Argument,H=k("gcli/argument").ArrayArgument,A=k("gcli/argument").NamedArgument,J=k("gcli/argument").TrueNamedArgument,E=k("gcli/argument").MergedArgument,C=k("gcli/argument").ScriptArgument,x;g.startup=function(){x=s.addCommand(B)};g.shutdown=function(){s.removeCommand(B.name);x=void 0};Object.defineProperty(d.prototype,"arg",{get:function(){return this.conversion.arg},enumerable:!0});Object.defineProperty(d.prototype,"value",{get:function(){return this.conversion.value},
enumerable:!0});d.prototype.getMessage=function(){return this.conversion.message?this.conversion.message:""};d.prototype.getPredictions=function(){return this.conversion.getPredictions()};d.prototype.getPredictionAt=function(a){null==a&&(a=0);return this.isInName()?l.resolve(void 0):this.getPredictions().then(function(b){if(0!==b.length)return a%=b.length,0>a&&(a=b.length+a),b[a]}.bind(this),console.error)};d.prototype.isInName=function(){return"NamedArgument"===this.conversion.arg.type&&" "!==this.conversion.arg.prefix.slice(-1)};
d.prototype.ensureVisibleArgument=function(){if("BlankArgument"!==this.conversion.arg.type)return!1;var a=this.conversion.arg.beget({text:"",prefixSpace:this.param instanceof c});this.conversion=f.synchronize(this.param.type.parse(a));this.conversion.assign(this);return!0};d.prototype.getStatus=function(a){return this.param.isDataRequired&&!this.conversion.isDataProvided()?r.INCOMPLETE:!this.param.isDataRequired&&"BlankArgument"===this.arg.type?r.VALID:this.conversion.getStatus(a)};d.prototype.toString=
function(){return this.conversion.toString()};Object.defineProperty(d.prototype,"_summaryJson",{get:function(){var a="\x3casync\x3e";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});g.Assignment=d;var D=eval;g.setEvalFunction=function(a){D=a};g.unsetEvalFunction=
function(){D=void 0};var B={name:"{",params:[{name:"javascript",type:"javascript",description:""}],hidden:!0,returnType:"object",description:{key:"cliEvalJavascript"},exec:function(a,b){return D(a.javascript)},evalRegexp:/^\s*{\s*/};c.prototype=Object.create(d.prototype);c.prototype.getStatus=function(a){return r.combine(d.prototype.getStatus.call(this,a),this.conversion.value&&this.conversion.value.exec?r.VALID:r.INCOMPLETE)};g.CommandAssignment=c;m.prototype=Object.create(d.prototype);m.prototype.getStatus=
function(a){return this.conversion.getStatus()};h.prototype.destroy=function(){this.commandAssignment.onAssignmentChange.remove(this._commandAssignmentChanged,this);this.commandAssignment.onAssignmentChange.remove(this._assignmentChanged,this);delete this.document;delete this.environment};h.prototype._assignmentChanged=function(a){if(!(null!=a.oldConversion&&a.conversion.valueEquals(a.oldConversion))&&!this._structuralChangeInProgress&&(this.onAssignmentChange(a),!a.conversion.argEquals(a.oldConversion)))this.onTextChange()};
h.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],e=new d(c,b),l=this.setAssignment(e,null,{skipArgUpdate:!0});f.synchronize(l);e.onAssignmentChange.add(this._assignmentChanged,this);this._assignments[c.name]=e}this.assignmentCount=Object.keys(this._assignments).length}};h.prototype.getAssignment=function(a){a="string"===typeof a?a:Object.keys(this._assignments)[a];
return this._assignments[a]||void 0};h.prototype._getFirstBlankPositionalAssignment=function(){var a=null;Object.keys(this._assignments).some(function(b){b=this.getAssignment(b);return"BlankArgument"===b.arg.type&&b.param.isPositionalAllowed?(a=b,!0):!1},this);return a};h.prototype.getParameterNames=function(){return Object.keys(this._assignments)};h.prototype.cloneAssignments=function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)};h.prototype.getStatus=
function(){var a=r.VALID;if(0!==this._unassigned.length){var b=!0;this._unassigned.forEach(function(a){a.param.type.isIncompleteName||(b=!1)});a=b?r.INCOMPLETE:r.ERROR}this.getAssignments(!0).forEach(function(b){b=b.getStatus();b>a&&(a=b)},this);a===r.INCOMPLETE&&(a=r.ERROR);return a};h.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};h.prototype.getAssignments=function(a){var b=
[];!0===a&&b.push(this.commandAssignment);Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b};h.prototype.setAssignment=function(a,b,c){function e(b){var c=a.conversion;a.conversion=b;a.conversion.assign(a);if(!a.conversion.equals(c))a.onAssignmentChange({assignment:a,conversion:a.conversion,oldConversion:c})}c=c||{};if(!0!==c.skipArgUpdate)for(var d=a.arg.getArgs(),f=b.getArgs(),h=Math.max(d.length,f.length),g=0;g<h;g++)if(g>=d.length||"BlankArgument"===
d[g].type)this._args.push(f[g]);else{var k=this._args.indexOf(d[g]);if(-1===k)throw console.error("Couldn't find ",d[g]," in ",this._args),Error("Couldn't find "+d[g]);g>=f.length?this._args.splice(k,1):(c.matchPadding&&(0===f[g].prefix.length&&0!==this._args[k].prefix.length&&(f[g].prefix=this._args[k].prefix),0===f[g].suffix.length&&0!==this._args[k].suffix.length&&(f[g].suffix=this._args[k].suffix)),this._args[k]=f[g])}if(null==b)e(a.param.type.getBlank());else if("function"===typeof b.getStatus)e(b);
else return a.param.type.parse(b).then(function(a){e(a)}.bind(this),console.error);return l.resolve(void 0)};h.prototype.setBlankArguments=function(){this.getAssignments().forEach(function(a){a=this.setAssignment(a,null,{skipArgUpdate:!0});f.synchronize(a)},this)};h.prototype.complete=function(a,b){var c=this.getAssignmentAt(a.start);return c.getPredictionAt(b).then(function(a){var b=[];this.onTextChange.holdFire();if(null==a)" "!==c.arg.suffix.slice(-1)&&c.getStatus()===r.VALID&&b.push(this._addSpace(c)),
c.isInName()&&(a=c.conversion.arg.beget({prefixPostSpace:!0}),a=this.setAssignment(c,a),b.push(a));else{var e=c.arg.beget({text:a.name,dontQuote:c===this.commandAssignment}),e=this.setAssignment(c,e);a.incomplete||(e=e.then(function(){return this._addSpace(c).then(function(){if(c instanceof m)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))};h.prototype._assertArgsAssigned=
function(){this._args.forEach(function(a){null==a.assignment&&console.log("No assignment for "+a)},this)};h.prototype._addSpace=function(a){var b=a.conversion.arg.beget({suffixSpace:!0});return b!==a.conversion.arg?this.setAssignment(a,b):l.resolve(void 0)};h.prototype.decrement=function(a){var b=a.param.type.decrement(a.conversion.value);null!=b&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),f.synchronize(a))};h.prototype.increment=function(a){var b=a.param.type.increment(a.conversion.value);
null!=b&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),f.synchronize(a))};h.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){b=this._assignments[b];var c=b.param.type;b.value!==b.param.defaultValue&&(a.push(" "),a.push(c.stringify(b.value)))},this);"{"===b&&-1===this.getAssignment(0).arg.suffix.indexOf("}")&&
a.push(" }");return a.join("")};h.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};h.prototype.toString=function(){return this._args?
this._args.map(function(a){return a.toString()}).join(""):this.toCanonicalString()};h.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)};h.prototype.getInputStatusMarkup=function(a){var b=this.createInputArgTrace();a=b[0===a?0:a-1];for(var e=[],d=0;d<b.length;d++){var f=b[d],l=f.arg,h=r.VALID;if("text"===f.part&&(h=l.assignment.getStatus(l),
h===r.INCOMPLETE)){var g="NamedArgument"===a.arg.assignment.arg.type,g="text"===a.part||g&&"suffix"===a.part;if((l.assignment!==a.arg.assignment||!g)&&!(l.assignment instanceof c))h=r.ERROR}e.push({status:h,string:f.character})}for(d=0;d<e.length-1;)e[d].status===e[d+1].status?(e[d].string+=e[d+1].string,e.splice(d+1,1)):d++;return e};h.prototype.getAssignmentAt=function(a){if(!this._args)throw console.trace(),Error("Missing args");if(0===a)return this.commandAssignment;var b=[],c,e;for(c=0;c<this._args.length;c++){var d=
this._args[c],f=d.assignment;for(e=0;e<d.prefix.length;e++)b.push(f);for(e=0;e<d.text.length;e++)b.push(f);"NamedArgument"!==d.assignment.arg.type&&(this._args.length>c+1?f=this._args[c+1].assignment:(e=this._getFirstBlankPositionalAssignment(),null!=e&&(f=e)));for(e=0;e<d.suffix.length;e++)b.push(f)}b=b[a-1];if(!b)throw Error("Missing assignment. cursor\x3d"+a+" text\x3d"+this.toString());return b};h.prototype.exec=function(b){var c=null,e=null,d=!1;b&&b.hidden&&(d=!0);b&&("string"===typeof input?
this.update(b):"string"===typeof b.typed?this.update(b.typed):null!=b.command&&((c=s.getCommand(b.command))||console.error("Command not found: "+b.command),e=b.args));c||(c=this.commandAssignment.value,e=this.getArgsObject());if(!c)throw Error("Unknown command");b=this.toString();B.evalRegexp.test(b)&&(b=b.replace(B.evalRegexp,""),b=b.replace(/\s*}\s*$/,""));var f=new a({command:c,args:e,typed:b,canonical:this.toCanonicalString(),hidden:d});this.commandOutputManager.onOutput({output:f});d=function(a){f.complete(a,
!1)};b=function(a){f.complete(a,!0)};var l=function(a){f.changed(a)};try{var h=g.createExecutionContext(this),k=c.exec(e,h);this._then(k,d,b,l)}catch(m){console.error(m),b(m)}this.clear();return f};h.prototype.updateExec=function(a,b){return this.update(a).then(function(){return this.exec(b)}.bind(this))};h.prototype.clear=function(){this._structuralChangeInProgress=!0;var a=new y("","","");this._args=[a];a=f.synchronize(this.commandAssignment.param.type.parse(a));this.setAssignment(this.commandAssignment,
a,{skipArgUpdate:!0});this._structuralChangeInProgress=!1;this.onTextChange()};h.prototype._then=function(a,b,c,e){var d=null;null!=a&&"function"===typeof a.then?d=a.then:null!=a&&(null!=a.promise&&"function"===typeof a.promise.then)&&(d=a.promise.then);null!=d?d(b,c,e):b(a)};h.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(h.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});h.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(null==a||0===a.length)return[new y("","","")];if(b(a))return[new y(a,"","")];var e=1;a=a.replace(/\\\\/g,"\\").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\ /g,"\uf000").replace(/\\'/g,"\uf001").replace(/\\"/g,"\uf002").replace(/\\{/g,"\uf003").replace(/\\}/g,"\uf004");
for(var d=0,f=0,l="",h=[],g=0;;){var k=a[d];switch(e){case 1:"'"===k?(l=a.substring(f,d+1),e=3,f=d+1):'"'===k?(l=a.substring(f,d+1),e=4,f=d+1):"{"===k?(l=a.substring(f,d+1),e=5,g++,f=d+1):/ /.test(k)||(l=a.substring(f,d),e=2,f=d);break;case 2:" "===k&&(e=c(a.substring(f,d)),h.push(new y(e,l,"")),e=1,f=d,l="");break;case 3:"'"===k&&(e=c(a.substring(f,d)),h.push(new y(e,l,k)),e=1,f=d+1,l="");break;case 4:'"'===k&&(e=c(a.substring(f,d)),h.push(new y(e,l,k)),e=1,f=d+1,l="");break;case 5:"{"===k?g++:"}"===
k&&(g--,0===g&&(e=c(a.substring(f,d)),h.push(new C(e,l,k)),e=1,f=d+1,l=""))}d++;if(d>=a.length){1===e?d!==f&&(a=a.substring(f,d),(d=h[h.length-1])?d.suffix+=a:h.push(new y("",a,""))):5===e?(e=c(a.substring(f,d+1)),h.push(new C(e,l,""))):(e=c(a.substring(f,d+1)),h.push(new y(e,l,"")));break}}return h};h.prototype._split=function(a){var b={skipArgUpdate:!0},c=void 0;if("ScriptArgument"===a[0].type)return c=new w(x,new C),this.setAssignment(this.commandAssignment,c,b);for(var e=1,d=this.commandAssignment.param.type;e<=
a.length;){c=1===e?a[0]:new E(a,0,e);c=f.synchronize(d.parse(c,1===e&&1<a.length));if(!c.value||c.value.exec)break;e++}for(d=0;d<e;d++)a.shift();return this.setAssignment(this.commandAssignment,c,b)};h.prototype._addUnassignedArgs=function(a){a.forEach(function(a){this._unassigned.push(new m(this,a))}.bind(this))};h.prototype._assign=function(a){var b={skipArgUpdate:!0};this._unassigned=[];var c=[];if(!this.commandAssignment.value)return this._addUnassignedArgs(a),f.all(c);if(0===a.length)return this.setBlankArguments(),
f.all(c);if(0===this.assignmentCount)return this._addUnassignedArgs(a),f.all(c);if(1===this.assignmentCount){var e=this.getAssignment(0);if(e.param.type instanceof z){var d=1===a.length?a[0]:new E(a);c.push(this.setAssignment(e,d,b));return f.all(c)}}var l=this.getParameterNames(),h={};this.getAssignments(!1).forEach(function(e){for(var d=0;d<a.length;)if(e.param.isKnownAs(a[d].text)){var f=a.splice(d,1)[0];l=l.filter(function(a){return a!==e.param.name});if(e.param.type instanceof t)f=new J(f);else{var g=
null;d+1<=a.length&&(g=a.splice(d,1)[0]);f=new A(f,g)}e.param.type instanceof u?(g=h[e.param.name],g||(g=new H,h[e.param.name]=g),g.addArgument(f)):c.push(this.setAssignment(e,f,b))}else d++},this);l.forEach(function(e){e=this.getAssignment(e);if(e.param.isPositionalAllowed)if(e.param.type instanceof u){var d=h[e.param.name];d||(d=new H,h[e.param.name]=d);d.addArguments(a);a=[]}else 0===a.length?c.push(this.setAssignment(e,null,b)):(d=a.splice(0,1)[0],(e.param.type instanceof v?/-[-a-zA-Z_]/.test(d.text):
"-"===d.text.charAt(0))?this._unassigned.push(new m(this,d)):c.push(this.setAssignment(e,d,b)));else c.push(this.setAssignment(e,null,b))},this);Object.keys(h).forEach(function(a){var e=this.getAssignment(a);c.push(this.setAssignment(e,h[a],b))},this);this._addUnassignedArgs(a);return f.all(c)};g.Requisition=h;a.prototype.changed=function(a,b){this.data=a;b=b||{};b.output=this;this.onChange(b)};a.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()};a.prototype.toDom=function(a){f.clearElement(a);var b=a.ownerDocument,c=this.data;if(null!=c){var e;"undefined"!==typeof HTMLElement&&c instanceof HTMLElement?e=c:c.isView?e=c.toDom(b):("terminal"===this.command.returnType?Array.isArray(c)?(e=f.createElement(b,"div"),c.forEach(function(){var a=f.createElement(b,"textarea");a.classList.add("gcli-row-subterminal");a.readOnly=!0;e.appendChild(a)})):(e=
f.createElement(b,"textarea"),e.classList.add("gcli-row-terminal"),e.readOnly=!0):e=f.createElement(b,"p"),"string"===this.command.returnType?e.textContent=c:f.setContents(e,c.toString()));for(var c=e.querySelectorAll("*[href]"),d=0;d<c.length;d++)c[d].setAttribute("target","_blank");a.appendChild(e)}};a.prototype.toString=function(a){return this.data.isView?this.data.toDom(a).textContent:"undefined"!==typeof HTMLElement&&this.data instanceof HTMLElement?this.data.textContent:null==this.data?"":this.data.toString()};
g.Output=a;g.createExecutionContext=function(a){return{exec:a.exec.bind(a),update:a.update.bind(a),updateExec:a.updateExec.bind(a),document:a.document,environment:a.environment,createView:p.createView,defer:function(){return l.defer()},createPromise:function(){return l.defer()}}}});define("text!gcli/ui/intro.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cp\x3e${l10n.introTextOpening2}\x3c/p\x3e\n\n  \x3cp\x3e\n    ${l10n.introTextCommands}\n    \x3cspan class\x3d"gcli-out-shortcut" onclick\x3d"${onclick}"\n        ondblclick\x3d"${ondblclick}" data-command\x3d"help"\x3ehelp\x3c/span\x3e${l10n.introTextKeys2}\n    \x3ccode\x3e${l10n.introTextF1Escape}\x3c/code\x3e.\n  \x3c/p\x3e\n\n  \x3cbutton onclick\x3d"${onGotIt}" if\x3d"${showHideButton}"\x3e${l10n.introTextGo}\x3c/button\x3e\n\x3c/div\x3e'});
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(k,g,n){var d=k("util/util"),c=k("util/l10n"),m=k("gcli/settings"),h=k("gcli/ui/view"),b=k("gcli/cli").Output,a={name:"hideIntro",type:"boolean",description:c.lookup("hideIntroDesc"),defaultValue:!1},l;g.startup=function(){l=m.addSetting(a)};g.shutdown=function(){m.removeSetting(a);l=void 0};g.maybeShowIntro=function(a,c){if(!l.value){var d=new b;a.onOutput({output:d});
var h=this.createView(c);d.complete(h)}};g.createView=function(a,b){return h.createView({html:k("text!gcli/ui/intro.html"),options:{stack:"intro.html"},data:{l10n:c.propertyLookup,onclick:function(b){d.updateCommand(b.currentTarget,a)},ondblclick:function(b){d.executeCommand(b.currentTarget,a)},showHideButton:null!=b,onGotIt:function(a){l.value=!0;b.onClose()}}})}});
define("gcli/ui/focus","require exports module util/util util/l10n gcli/settings gcli/canon".split(" "),function(k,g,n){function d(a,d){a=a||{};this._document=d.document||document;this._requisition=d.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=c.createEvent("FocusManager.onVisibilityChange");this._focused=this._focused.bind(this);this._document.addEventListener("focus",this._focused,!0);b.onChange.add(this._eagerHelperChanged,this);this.isOutputVisible=this.isTooltipVisible=void 0;this._checkShow()}var c=k("util/util");n=k("util/l10n");var m=k("gcli/settings");k("gcli/canon");var h={name:"eagerHelper",type:{name:"selection",lookup:[{name:"never",value:1},{name:"sometimes",value:2},{name:"always",value:3}]},defaultValue:2,
description:n.lookup("eagerHelperDesc"),ignoreTypeDifference:!0},b;g.startup=function(){b=m.addSetting(h)};g.shutdown=function(){m.removeSetting(h);b=void 0};d.prototype.destroy=function(){b.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 c=this._monitoredElements[a];console.error("Hanging monitored element: ",
c.element);c.element.removeEventListener("focus",c.onFocus,!0);c.element.removeEventListener("blur",c.onBlur,!0)}this._blurDelayTimeout&&(this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null);delete this._focused;delete this._document;delete this._window;delete this._requisition};d.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)};d.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})};d.prototype.updatePosition=function(a){this.onVisibilityChange({tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible,dimensions:a})};d.prototype._outputted=function(a){this._recentOutput=!0;this._helpRequested=!1;this._checkShow()};d.prototype._focused=function(){this._reportBlur("document")};d.prototype._reportFocus=function(a){this._debug&&console.log("FocusManager._reportFocus("+(a||"unknown")+")");this._blurDelayTimeout&&(this._debug&&console.log("FocusManager.cancelBlur"),
this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null);this._hasFocus||(this._hasFocus=!0);this._checkShow()};d.prototype._reportBlur=function(a){this._debug&&console.log("FocusManager._reportBlur("+a+")");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))};d.prototype._eagerHelperChanged=function(){this._checkShow()};d.prototype.onInputChange=function(){this._recentOutput=!1;this._checkShow()};d.prototype.helpRequest=function(){this._debug&&console.log("FocusManager.helpRequest");this._helpRequested=!0;this._recentOutput=!1;this._checkShow()};d.prototype.removeHelp=function(){this._debug&&console.log("FocusManager.removeHelp");this._recentOutput=this._helpRequested=this._isError=this._importantFieldFlag=!1;this._checkShow()};d.prototype.setImportantFieldFlag=
function(a){this._debug&&console.log("FocusManager.setImportantFieldFlag",a);this._importantFieldFlag=a;this._checkShow()};d.prototype.setError=function(a){this._debug&&console.log("FocusManager._isError",a);this._isError=a;this._checkShow()};d.prototype._checkShow=function(){var a=!1,b={tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible},c=this._shouldShowTooltip();this.isTooltipVisible!==c.visible&&(b.tooltipVisible=this.isTooltipVisible=c.visible,a=!0);c=this._shouldShowOutput();
this.isOutputVisible!==c.visible&&(b.outputVisible=this.isOutputVisible=c.visible,a=!0);a&&(this._debug&&console.log("FocusManager.onVisibilityChange",b),this.onVisibilityChange(b))};d.prototype._shouldShowTooltip=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:1===b.value?{visible:!1,reason:"eagerHelperNever"}:3===b.value?{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"}};d.prototype._shouldShowOutput=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:this._recentOutput?{visible:!0,reason:"recentOutput"}:{visible:!1,reason:"default"}};g.FocusManager=d});
define("gcli/ui/fields","require exports module util/promise util/util util/util gcli/types/basic".split(" "),function(k,g,n){function d(a,b){this.type=a;this.document=b.document;this.requisition=b.requisition}function c(a,b){d.call(this,a,b);this.element=h.createElement(this.document,"div");this.onFieldChange=h.createEvent("BlankField.onFieldChange")}var m=k("util/promise"),h=k("util/util"),b=k("util/util").KeyEvent,a=k("gcli/types/basic").BlankType;d.prototype.element=void 0;d.prototype.destroy=
function(){delete this.messageElement};d.prototype.setConversion=function(a){throw Error("Field should not be used directly");};d.prototype.getConversion=function(){throw Error("Field should not be used directly");};d.prototype.setMessageElement=function(a){this.messageElement=a};d.prototype.setMessage=function(a){this.messageElement&&h.setTextContent(this.messageElement,a||"")};d.prototype.onInputChange=function(a){m.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)};d.prototype.isImportant=!1;d.claim=function(){throw Error("Field should not be used directly");};d.TOOLTIP_MATCH=5;d.TOOLTIP_DEFAULT=4;d.MATCH=3;d.DEFAULT=2;d.BASIC=1;d.NO_MATCH=0;g.Field=d;var l=[];g.addField=function(a){if("function"!==typeof a)throw console.error("addField erroring on ",a),Error("addField requires a Field constructor");l.push(a)};g.removeField=function(a){if("string"!==typeof a)fields=
fields.filter(function(b){return b!==a}),delete fields[a];else if(a instanceof d)removeField(a.name);else throw console.error("removeField erroring on ",a),Error("removeField requires an instance of Field");};g.getField=function(a,b){var h,g=-1;l.forEach(function(b){var c=b.claim(a);c>g&&(g=c,h=b)});if(!h)throw console.error("Unknown field type ",a," in ",l),Error("Can't find field for "+a);return b.tooltip&&g<d.TOOLTIP_DEFAULT?new c(a,b):new h(a,b)};c.prototype=Object.create(d.prototype);c.claim=
function(b){return b instanceof a?d.MATCH:d.NO_MATCH};c.prototype.setConversion=function(a){this.setMessage(a.message)};c.prototype.getConversion=function(){return this.type.parse(new Argument)};g.addField(c)});
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(k,g,n){function d(b,c){v.call(this,b,c);this.arg=new f;this.element=a.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=a.createEvent("StringField.onFieldChange")}function c(b,c){v.call(this,b,c);this.arg=new f;this.element=a.createElement(this.document,"input");this.element.type="number";this.type.max&&(this.element.max=this.type.max);this.type.min&&(this.element.min=this.type.min);this.type.step&&(this.element.step=this.type.step);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",this.onInputChange,!1);this.onFieldChange=a.createEvent("NumberField.onFieldChange")}
function m(b,c){v.call(this,b,c);this.name=c.name;this.named=c.named;this.element=a.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=a.createEvent("BooleanField.onFieldChange")}function h(b,c){v.call(this,b,c);this.options=c;this.requisition.onAssignmentChange.add(this.update,this);this.element=a.createElement(this.document,
"div");this.update();this.onFieldChange=a.createEvent("DelegateField.onFieldChange")}function b(b,c){v.call(this,b,c);this.options=c;this._onAdd=this._onAdd.bind(this);this.members=[];this.element=a.createElement(this.document,"div");this.element.classList.add("gcli-array-parent");this.addButton=a.createElement(this.document,"button");this.addButton.classList.add("gcli-array-member-add");this.addButton.addEventListener("click",this._onAdd,!1);this.addButton.textContent=l.lookup("fieldArrayAdd");this.element.appendChild(this.addButton);
this.container=a.createElement(this.document,"div");this.container.classList.add("gcli-array-members");this.element.appendChild(this.container);this.onInputChange=this.onInputChange.bind(this);this.onFieldChange=a.createEvent("ArrayField.onFieldChange")}var a=k("util/util"),l=k("util/l10n"),f=k("gcli/argument").Argument,e=k("gcli/argument").TrueNamedArgument,p=k("gcli/argument").FalseNamedArgument,s=k("gcli/argument").ArrayArgument,q=k("gcli/types").ArrayConversion,r=k("gcli/types/basic").StringType,
w=k("gcli/types/basic").NumberType,u=k("gcli/types/basic").BooleanType,z=k("gcli/types/basic").DelegateType,t=k("gcli/types/basic").ArrayType,v=k("gcli/ui/fields").Field,y=k("gcli/ui/fields");g.startup=function(){y.addField(d);y.addField(c);y.addField(m);y.addField(h);y.addField(b)};g.shutdown=function(){y.removeField(d);y.removeField(c);y.removeField(m);y.removeField(h);y.removeField(b)};d.prototype=Object.create(v.prototype);d.prototype.destroy=function(){v.prototype.destroy.call(this);this.element.removeEventListener("keyup",
this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};d.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};d.claim=function(a){return a instanceof r?v.MATCH:v.BASIC};c.prototype=Object.create(v.prototype);c.claim=function(a){return a instanceof w?v.MATCH:v.NO_MATCH};c.prototype.destroy=
function(){v.prototype.destroy.call(this);this.element.removeEventListener("keyup",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};c.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};c.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};m.prototype=Object.create(v.prototype);m.claim=function(a){return a instanceof u?
v.MATCH:v.NO_MATCH};m.prototype.destroy=function(){v.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};m.prototype.setConversion=function(a){this.element.checked=a.value;this.setMessage(a.message)};m.prototype.getConversion=function(){var a;a=this.named?this.element.checked?new e(new f(" --"+this.name)):new p:new f(" "+this.element.checked);return this.type.parse(a)};h.prototype=Object.create(v.prototype);
h.prototype.update=function(){var b=this.type.delegateType();b!==this.subtype&&(this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.subtype=b,this.field=y.getField(b,this.options),this.field.onFieldChange.add(this.fieldChanged,this),a.clearElement(this.element),this.element.appendChild(this.field.element))};h.claim=function(a){return a instanceof z?v.MATCH:v.NO_MATCH};h.prototype.destroy=function(){v.prototype.destroy.call(this);this.requisition.onAssignmentChange.remove(this.update,
this);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){this.field.setConversion(a)};h.prototype.getConversion=function(){return this.field.getConversion()};Object.defineProperty(h.prototype,"isImportant",{get:function(){return this.field.isImportant},enumerable:!0});b.prototype=Object.create(v.prototype);b.claim=function(a){return a instanceof t?v.MATCH:v.NO_MATCH};b.prototype.destroy=function(){v.prototype.destroy.call(this);this.addButton.removeEventListener("click",
this._onAdd,!1)};b.prototype.setConversion=function(b){a.clearElement(this.container);this.members=[];b.conversions.forEach(function(a){this._onAdd(null,a)},this)};b.prototype.getConversion=function(){for(var a=[],b=new s,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 q(a,b)};b.prototype._onAdd=function(b,c){var e=a.createElement(this.document,"div");e.classList.add("gcli-array-member");
this.container.appendChild(e);var d=y.getField(this.type.subtype,this.options);d.onFieldChange.add(function(){Promise.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)},this);c&&d.setConversion(c);e.appendChild(d.element);var f=a.createElement(this.document,"button");f.classList.add("gcli-array-member-del");f.addEventListener("click",this._onDel,!1);f.textContent=l.lookup("fieldArrayDel");e.appendChild(f);e={element:e,
field:d,parent:this};e.onDelete=function(){this.parent.container.removeChild(this.element);this.parent.members=this.parent.members.filter(function(a){return a!==this});this.parent.onInputChange()}.bind(e);f.addEventListener("click",e.onDelete,!1);this.members.push(e)}});define("text!gcli/ui/fields/menu.css",[],function(){return"\n.gcli-menu {\n  width: 100%;\n  overflow: hidden;\n  font-size: 90%;\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.gcli-menu-template {\n  border-collapse: collapse;\n  width: 100%;\n}\n.gcli-menu-option {\n  overflow: hidden;\n  white-space: nowrap;\n  cursor: pointer;\n}\n.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #f8f8f8, #ccc);\n  background-color: #ddd;\n}\n.gcli-menu-name {\n  padding: 2px 3px;\n  -moz-padding-start: 8px;\n  -webkit-padding-start: 8px;\n}\n.gcli-menu-desc {\n  color: #777;\n  padding: 0 3px;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\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.gcli-menu-typed {\n  color: #FF6600;\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\x3cdiv\x3e\n  \x3ctable class\x3d"gcli-menu-template" aria-live\x3d"polite"\x3e\n    \x3ctr class\x3d"gcli-menu-option" foreach\x3d"item in ${items}"\n        onclick\x3d"${onItemClickInternal}" title\x3d"${item.manual}"\x3e\n      \x3ctd class\x3d"gcli-menu-name"\x3e${item.name}\x3c/td\x3e\n      \x3ctd class\x3d"gcli-menu-desc"\x3e${item.description}\x3c/td\x3e\n    \x3c/tr\x3e\n  \x3c/table\x3e\n  \x3cdiv class\x3d"gcli-menu-more" if\x3d"${items.hasMore}"\x3e${l10n.fieldMenuMore}\x3c/div\x3e\n\x3c/div\x3e'});
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(k,g,n){function d(a){a=a||{};this.document=a.document||document;this.type=a.type;if(!this.document)throw Error("No document");this.element=m.createElement(this.document,"div");this.element.classList.add(a.menuClass||"gcli-menu");a&&a.field&&this.element.classList.add(a.menuFieldClass||"gcli-menu-field");
null!=l&&m.importCss(l,this.document,"gcli-menu");this.template=m.toDom(this.document,f);this.templateOptions={blankNullUndefined:!0,stack:"menu.html"};this.items=null;this.onItemClick=m.createEvent("Menu.onItemClick")}function c(a,b,c){return"undefined"===typeof Proxy?a:Proxy.create({get:function(d,f){var l=a[f];if("name"!==f)return l;var h=l.indexOf(b);if(-1===h)return l;var g=l.substr(0,h),l=l.substr(h+b.length),h=c.createElement("span");h.appendChild(c.createTextNode(g));g=c.createElement("span");
g.classList.add("gcli-menu-typed");g.appendChild(c.createTextNode(b));h.appendChild(g);h.appendChild(c.createTextNode(l));return h}})}var m=k("util/util");n=k("util/l10n");var h=k("util/domtemplate"),b=k("gcli/argument").Argument,a=k("gcli/types").Conversion;k("gcli/canon");var l=k("text!gcli/ui/fields/menu.css"),f=k("text!gcli/ui/fields/menu.html");d.prototype.l10n=n.propertyLookup;d.prototype.destroy=function(){delete this.element;delete this.template;delete this.document};d.prototype.onItemClickInternal=
function(a){a=a.currentTarget.querySelector(".gcli-menu-name").textContent;a=new b(a);a.suffix=" ";this.onItemClick({arg:a})};d.prototype.show=function(b,d){this.items=b.filter(function(a){return void 0===a.hidden||!0!==a.hidden}.bind(this));d&&(this.items=this.items.map(function(a){return c(a,d,this.template.ownerDocument)}.bind(this)));if(0===this.items.length)this.element.style.display="none";else{this.items.length>=a.maxPredictions&&(this.items.splice(-1),this.items.hasMore=!0);var f=this.template.cloneNode(!0);
h.template(f,this,this.templateOptions);m.clearElement(this.element);this.element.appendChild(f);this.element.style.display="block"}};d.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");null!=a&&(b.length<=a?console.error("Cant highlight "+a+". Only "+b.length+" options"):b.item(a).classList.add("gcli-menu-highlight"))};d.prototype.selectChoice=function(){var a=this.element.querySelector(".gcli-menu-highlight .gcli-menu-name");
if(!a)return!1;a=new b(a.textContent);a.suffix=" ";a.prefix=" ";this.onItemClick({arg:a});return!0};d.prototype.hide=function(){this.element.style.display="none"};d.prototype.setMaxHeight=function(a){this.element.style.maxHeight=a+"px"};g.Menu=d});
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(k,g,n){function d(d,l){e.call(this,d,l);this.onInputChange=this.onInputChange.bind(this);this.arg=new a("","{ "," }");this.element=c.createElement(this.document,"div");this.input=c.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:d});this.element.appendChild(this.menu.element);var g=new b(void 0,new a(""),h.INCOMPLETE,"");this.setConversion(g);this.onFieldChange=c.createEvent("JavascriptField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,this)}var c=k("util/util"),m=k("util/promise"),h=k("gcli/types").Status,b=k("gcli/types").Conversion,
a=k("gcli/argument").ScriptArgument,l=k("gcli/types/javascript").JavascriptType,f=k("gcli/ui/fields/menu").Menu,e=k("gcli/ui/fields").Field,p=k("gcli/ui/fields");g.startup=function(){p.addField(d)};g.shutdown=function(){p.removeField(d)};d.prototype=Object.create(e.prototype);d.claim=function(a){return a instanceof l?e.TOOLTIP_MATCH:e.NO_MATCH};d.prototype.destroy=function(){e.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};d.prototype.setConversion=function(a){this.arg=a.arg;this.input.value=a.arg.text;var b=0;if(this.type instanceof l){var c=a.arg.text.lastIndexOf(".");-1!==c&&(b=c)}this.setMessage(a.message);a.getPredictions().then(function(a){var c=[];a.forEach(function(a){a.hidden||c.push({name:a.name.substring(b),complete:a.name,description:a.description||""})},this);this.menu.show(c)}.bind(this),
console.error)};d.prototype.itemClicked=function(a){m.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};d.prototype.onInputChange=function(a){this.item=a.currentTarget.item;m.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};d.prototype.getConversion=function(){this.arg=new a(this.input.value,"{ "," }");return this.type.parse(this.arg)};
d.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(k,g,n){function d(a,c){p.call(this,a,c);this.items=[];this.element=h.createElement(this.document,"select");this.element.classList.add("gcli-field");this._addOption({name:b.lookupFormat("fieldSelectionSelect",[c.name])});m.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=h.createEvent("SelectionField.onFieldChange")}function c(b,c){p.call(this,b,c);this.onInputChange=this.onInputChange.bind(this);this.arg=new a;this.menu=new e({document:this.document,type:b});this.element=this.menu.element;this.onFieldChange=h.createEvent("SelectionTooltipField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,
this)}var m=k("util/promise"),h=k("util/util"),b=k("util/l10n"),a=k("gcli/argument").Argument;k("gcli/types");k("gcli/types");var l=k("gcli/types/basic").BooleanType,f=k("gcli/types/selection").SelectionType,e=k("gcli/ui/fields/menu").Menu,p=k("gcli/ui/fields").Field,s=k("gcli/ui/fields");g.startup=function(){s.addField(d);s.addField(c)};g.shutdown=function(){s.removeField(d);s.removeField(c)};d.prototype=Object.create(p.prototype);d.claim=function(a){return a instanceof l?p.BASIC:a instanceof f?
p.DEFAULT:p.NO_MATCH};d.prototype.destroy=function(){p.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){var b;this.items.forEach(function(c){c.value&&c.value===a.value&&(b=c.index)},this);this.element.value=b;this.setMessage(a.message)};d.prototype.getConversion=function(){return this.type.parse(new a(this.items[this.element.value].name," "))};d.prototype._addOption=
function(a){a.index=this.items.length;this.items.push(a);var b=h.createElement(this.document,"option");b.textContent=a.name;b.value=a.index;this.element.appendChild(b)};c.prototype=Object.create(p.prototype);c.claim=function(a){return a.getType()instanceof f?p.TOOLTIP_MATCH:p.NO_MATCH};c.prototype.destroy=function(){p.prototype.destroy.call(this);this.menu.onItemClick.remove(this.itemClicked,this);this.menu.destroy();delete this.element;delete this.document;delete this.onInputChange};c.prototype.setConversion=
function(a){this.arg=a.arg;this.setMessage(a.message);a.getPredictions().then(function(b){b=b.map(function(a){return a.value.description?a.value:a},this);this.menu.show(b,a.arg.text)}.bind(this),console.error)};c.prototype.itemClicked=function(a){m.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};c.prototype.onInputChange=function(a){this.item=a.currentTarget.item;m.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});
this.setMessage(a.message)}.bind(this),console.error)};c.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.input.value});return this.type.parse(this.arg)};c.prototype.setChoiceIndex=function(a){this.menu.setChoiceIndex(a)};c.prototype.selectChoice=function(){return this.menu.selectChoice()};Object.defineProperty(c.prototype,"isImportant",{get:function(){return"command"!==this.type.name},enumerable:!0});c.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.gcli-panel.gcli-panel-hide {\n  opacity: 0;\n  height: 0;\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.gcli-tt-description {\n  padding: 5px 10px 0;\n  font-size: 90%;\n}\n.gcli-tt-error {\n  font-size: 80%;\n  color: #900;\n  padding: 0 10px;\n}\n.gcli-field {\n  width: 100%;\n}\n.gcli-field-javascript {\n  margin-bottom: 0;\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\x3cdiv class\x3d"gcli-tt" aria-live\x3d"polite"\x3e\n  \x3cdiv class\x3d"gcli-tt-description" save\x3d"${descriptionEle}"\x3e${description}\x3c/div\x3e\n  ${field.element}\n  \x3cdiv class\x3d"gcli-tt-error" save\x3d"${errorEle}"\x3e${assignment.conversion.message}\x3c/div\x3e\n  \x3cdiv class\x3d"gcli-tt-highlight" save\x3d"${highlightEle}"\x3e\x3c/div\x3e\n\x3c/div\x3e'});
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(k,g,n){function d(b,e){this.inputter=e.inputter;this.requisition=e.requisition;this.focusManager=e.focusManager;this.element=e.element;this.element.classList.add(b.tooltipClass||"gcli-tooltip");this.document=this.element.ownerDocument;if(this.panelElement=e.panelElement)this.panelElement.classList.add("gcli-panel-hide"),this.focusManager.onVisibilityChange.add(this.visibilityChanged,
this);this.focusManager.addMonitoredElement(this.element,"tooltip");this.fields=[];null!=a&&(this.style=c.importCss(a,this.document,"gcli-tooltip"));this.template=c.toDom(this.document,l);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 c=k("util/util"),m=k("util/domtemplate"),
h=k("gcli/cli").CommandAssignment,b=k("gcli/ui/fields"),a=k("text!gcli/ui/tooltip.css"),l=k("text!gcli/ui/tooltip.html");d.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(d.prototype,"isMenuShowing",{get:function(){return this.focusManager.isTooltipVisible&&null!=this.field&&null!=this.field.menu},enumerable:!0});d.prototype.assignmentChanged=function(a){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),m.template(a,this,this.templateOptions),c.clearElement(this.element),this.element.appendChild(a),this.element.style.display="block",this.field.setMessageElement(this.errorEle),this._updatePosition())};d.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)};d.prototype.selectChoice=function(a){return this.field&&this.field.selectChoice?this.field.selectChoice():!1};d.prototype.fieldChanged=function(a){this.requisition.setAssignment(this.assignment,a.conversion.arg,{matchPadding:!0});this.focusManager.setError(null!=a.conversion.message&&""!==a.conversion.message);this.document.defaultView.setTimeout(function(){this.inputter.focus()}.bind(this),10)};d.prototype.assignmentContentsChanged=function(a){a.conversion.arg.text===a.oldConversion.arg.text&&
a.conversion.message===a.oldConversion.message||(this.field.setConversion(a.conversion),c.setTextContent(this.descriptionEle,this.description),this._updatePosition())};d.prototype._updatePosition=function(){var a=this.getDimensionsOfAssignment();this.panelElement&&(this.panelElement.style.left=10*a.start+"px");this.focusManager.updatePosition(a)};d.prototype.getDimensionsOfAssignment=function(){for(var a="",b=this.requisition.getAssignments(!0),c=0;c<b.length&&b[c]!==this.assignment;c++)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(d.prototype,"description",{get:function(){return this.assignment instanceof h&&null==this.assignment.value?"":this.assignment.param.manual||this.assignment.param.description},enumerable:!0});d.prototype.visibilityChanged=function(a){this.panelElement&&(a.tooltipVisible?this.panelElement.classList.remove("gcli-panel-hide"):this.panelElement.classList.add("gcli-panel-hide"))};g.Tooltip=
d});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.gcli-row-in \x3e img {\n  cursor: pointer;\n}\n.gcli-row-hover {\n  display: none;\n  float: right;\n  padding: 2px 2px 0;\n}\n.gcli-row-in:hover \x3e .gcli-row-hover {\n  display: inline;\n}\n.gcli-row-in:hover \x3e .gcli-row-hover.gcli-row-hidden {\n  display: none;\n}\n.gcli-row-duration {\n  color: #666;\n}\n.gcli-row-prompt {\n  color: #00F;\n  font-weight: bold;\n  font-size: 120%;\n}\n.gcli-row-prompt.gcli-row-complete {\n  color: #060;\n}\n.gcli-row-prompt.gcli-row-error {\n  color: #F00;\n}\n.gcli-row-duration {\n  font-size: 80%;\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.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.gcli-row-out p {\n  margin: 5px 0;\n}\n.gcli-row-out a {\n  color: hsl(200,40%,40%);\n  text-decoration: none;\n}\n.gcli-row-out a:hover {\n  cursor: pointer;\n  border-bottom: 1px dotted hsl(200,40%,60%);\n}\n.gcli-row-out input[type\x3dpassword],\n.gcli-row-out input[type\x3dtext],\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.gcli-row-out table,\n.gcli-row-out td,\n.gcli-row-out th {\n  border: 0;\n  padding: 0 2px;\n}\n.gcli-row-terminal,\n.gcli-row-subterminal {\n  border-radius: 3px;\n  border: 1px solid #ddd;\n}\n.gcli-row-terminal {\n  height: 200px;\n  width: 620px;\n  font-size: 80%;\n}\n.gcli-row-subterminal {\n  height: 150px;\n  width: 300px;\n  font-size: 75%;\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.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\x3cdiv class\x3d"gcli-row"\x3e\n  \x3c!-- The div for the input (i.e. what was typed) --\x3e\n  \x3cdiv class\x3d"gcli-row-in" save\x3d"${elems.rowin}" aria-live\x3d"assertive"\n      onclick\x3d"${copyToInput}" ondblclick\x3d"${execute}"\x3e\n\n    \x3c!-- What the user actually typed --\x3e\n    \x3cspan save\x3d"${elems.prompt}" class\x3d"gcli-row-prompt ${elems.error ? \'gcli-row-error\' : \'\'} ${elems.completed ? \'gcli-row-complete\' : \'\'}"\x3e${prompt}\x3c/span\x3e\n    \x3cspan class\x3d"gcli-row-in-typed"\x3e${outputData.canonical}\x3c/span\x3e\n\n    \x3c!-- The extra details that appear on hover --\x3e\n    \x3cspan class\x3d"gcli-row-duration gcli-row-hover" save\x3d"${elems.duration}"\x3e\x3c/span\x3e\n    \x3c!--\n    \x3cimg class\x3d"gcli-row-hover" onclick\x3d"${hideOutput}" save\x3d"${elems.hide}"\n        alt\x3d"Hide command output" _src\x3d"${url(\'images/minus.png\')}"/\x3e\n    \x3cimg class\x3d"gcli-row-hover gcli-row-hidden" onclick\x3d"${showOutput}" save\x3d"${elems.show}"\n        alt\x3d"Show command output" _src\x3d"${url(\'images/plus.png\')}"/\x3e\n    \x3cimg class\x3d"gcli-row-hover" onclick\x3d"${remove}"\n        alt\x3d"Remove this command from the history"\n        _src\x3d"${url(\'images/closer.png\')}"/\x3e\n    --\x3e\n    \x3cimg style\x3d"float:right;" _src\x3d"${url(\'images/throbber.gif\')}" save\x3d"${elems.throb}"/\x3e\n  \x3c/div\x3e\n\n  \x3c!-- The div for the command output --\x3e\n  \x3cdiv class\x3d"gcli-row-out" aria-live\x3d"assertive" save\x3d"${elems.rowout}"\x3e\n  \x3c/div\x3e\n\x3c/div\x3e'});
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(k,g,n){function d(c,d){this.element=d.element;this.requisition=d.requisition;this.requisition.commandOutputManager.onOutput.add(this.outputted,this);var e=d.element.ownerDocument;null!=b&&(this.style=m.importCss(b,e,"gcli-output-view"));this.template=m.toDom(e,a);this.templateOptions={allowEval:!0,stack:"output_terminal.html"}}
function c(a,b){this.outputData=a;this.outputTerminal=b;this.url=m.createUrlLookup(n);this.elems={rowin:null,rowout:null,hide:null,show:null,duration:null,throb:null,prompt:null};var c=this.outputTerminal.template.cloneNode(!0);h.template(c,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 m=k("util/util"),
h=k("util/domtemplate");k("gcli/canon");var b=k("text!gcli/ui/output_view.css"),a=k("text!gcli/ui/output_terminal.html");d.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};d.prototype.outputted=function(a){a.output.hidden||(a.output.view=new c(a.output,this))};d.prototype.setHeight=function(a){this.element.style.height=
a+"px"};g.OutputTerminal=d;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(a){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(a){this.destroy()};c.prototype.changed=function(a){a=null!=this.outputData.duration?"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);
a=Math.max(this.outputTerminal.element.scrollHeight,this.outputTerminal.element.clientHeight);this.outputTerminal.element.scrollTop=a-this.outputTerminal.element.clientHeight;this.elems.throb.style.display=this.outputData.completed?"none":"block"};g.OutputView=c});
define("gcli/history",["require","exports","module"],function(k,g,n){function d(){this._buffer=[""];this._current=0}d.prototype.destroy=function(){delete this._buffer};d.prototype.add=function(c){this._buffer.splice(1,0,c);this._current=0};d.prototype.forward=function(){0<this._current&&this._current--;return this._buffer[this._current]};d.prototype.backward=function(){this._current<this._buffer.length-1&&this._current++;return this._buffer[this._current]};g.History=d});
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.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.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.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.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.gcli-in-incomplete {\n  border-bottom: 2px dotted #999;\n}\n.gcli-in-error {\n  border-bottom: 2px dotted #F00;\n}\n.gcli-in-ontab {\n  color: hsl(200,40%,70%);\n}\n.gcli-in-todo {\n  color: hsl(48,28%,76%);\n}\n.gcli-in-closebrace {\n  color: hsl(0,0%,80%);\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(k,g,n){function d(e,d){this.requisition=d.requisition;this.focusManager=d.focusManager;this.element=d.element;this.element.classList.add("gcli-in-input");this.element.spellcheck=!1;this.document=this.element.ownerDocument;this.scratchpad=e.scratchpad;null!=a&&(this.style=c.importCss(a,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 b;this._scrollingThroughHistory=!1;this._choice=null;this.onChoiceChange=c.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=l;this.requisition.onTextChange.add(this.textChanged,this);this.assignment=this.requisition.getAssignmentAt(0);this.onAssignmentChange=c.createEvent("Inputter.onAssignmentChange");this.onInputChange=c.createEvent("Inputter.onInputChange");this.onResize=c.createEvent("Inputter.onResize");this.onWindowResize=this.onWindowResize.bind(this);this.document.defaultView.addEventListener("resize",this.onWindowResize,!1);this.requisition.update(this.element.value||"")}n=k("util/promise");var c=
k("util/util"),m=k("util/util").KeyEvent,h=k("gcli/types").Status,b=k("gcli/history").History,a=k("text!gcli/ui/inputter.css"),l=n.resolve(void 0);d.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};d.prototype.onWindowResize=function(){if(this.element){var a=this.getDimensions();if(a)this.onResize(a)}};d.prototype.getDimensions=function(){if(this.element.getBoundingClientRect){for(var a,
b,c=this.element.parentNode;c&&"#document"!==c.nodeName;){var d=this.document.defaultView.getComputedStyle(c,"");if(d&&(d=d.getPropertyValue("position"),"absolute"===d||"fixed"===d)){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}}};d.prototype.onMouseUp=function(a){this._checkAssignment()};d.prototype.textChanged=function(){if(this.document){null==
this._caretChange&&(this._caretChange=f.TO_ARG_END);var a=this.requisition.toString(),b=this.getInputState();b.typed=a;this._processCaretChange(b);this.element.value!==a&&(this.element.value=a);this.onInputChange({inputState:b})}};var f={NO_CHANGE:0,SELECT_ALL:1,TO_END:2,TO_ARG_END:3};d.prototype._processCaretChange=function(a){var b,c;switch(this._caretChange){case f.SELECT_ALL:b=0;c=a.typed.length;break;case f.TO_END:c=b=a.typed.length;break;case f.TO_ARG_END: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}};this.element.selectionStart!==b&&(this.element.selectionStart=b);this.element.selectionEnd!==c&&(this.element.selectionEnd=c);this._checkAssignment(b);this._caretChange=null;return a};d.prototype._checkAssignment=function(a){null==a&&(a=this.element.selectionStart);a=this.requisition.getAssignmentAt(a);this.assignment!==
a&&(this.assignment=a,this.onAssignmentChange({assignment:this.assignment}));this.focusManager&&(a=this.assignment.conversion.message,this.focusManager.setError(null!=a&&""!==a))};d.prototype.setInput=function(a){return this.requisition.update(a)};d.prototype.setCursor=function(a){this._caretChange=f.NO_CHANGE;this._processCaretChange({typed:this.element.value,cursor:a})};d.prototype.focus=function(){this.element.focus();this._checkAssignment()};d.prototype.onKeyDown=function(a){if(a.keyCode===m.DOM_VK_UP||
a.keyCode===m.DOM_VK_DOWN)a.preventDefault();else if(!(a.keyCode===m.DOM_VK_F1||a.keyCode===m.DOM_VK_ESCAPE||a.keyCode===m.DOM_VK_UP||a.keyCode===m.DOM_VK_DOWN)){if(this.focusManager)this.focusManager.onInputChange();if(a.keyCode===m.DOM_VK_TAB&&(this.lastTabDownAt=0,a.shiftKey||(a.preventDefault(),this.lastTabDownAt=a.timeStamp),a.metaKey||a.altKey||a.crtlKey))this.document.commandDispatcher?this.document.commandDispatcher.advanceFocus():this.element.blur()}};d.prototype.onKeyUp=function(a){this.handleKeyUp(a).then(null,
console.error)};d.prototype.handleKeyUp=function(a){if(this.focusManager&&a.keyCode===m.DOM_VK_F1)return this.focusManager.helpRequest(),l;if(this.focusManager&&a.keyCode===m.DOM_VK_ESCAPE)return this.focusManager.removeHelp(),l;if(a.keyCode===m.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());if(this.assignment.getStatus()===
h.VALID){if(this.requisition.increment(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(-1)}return l}if(a.keyCode===m.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());if(this.assignment.getStatus()===h.VALID){if(this.requisition.decrement(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(1)}return l}if(a.keyCode===
m.DOM_VK_RETURN)return this.requisition.getStatus()===h.VALID?(this._scrollingThroughHistory=!1,this.history.add(this.element.value),this.requisition.exec()):this.tooltip.selectChoice()||this.focusManager.setError(!0),this._choice=null,l;if(a.keyCode===m.DOM_VK_TAB&&!a.shiftKey)return 0<this.element.value.length&&this.lastTabDownAt+1E3>a.timeStamp&&(this._caretChange=f.TO_ARG_END,a=this.getInputState(),this._processCaretChange(a),null==this._choice&&(this._choice=0),this._completed=this.requisition.complete(a.cursor,
this._choice)),this.lastTabDownAt=0,this._scrollingThroughHistory=!1,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(""):l;this._scrollingThroughHistory=!1;this._caretChange=f.NO_CHANGE;this._completed=this.requisition.update(this.element.value);return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))};
d.prototype.changeChoice=function(a){null==this._choice&&(this._choice=0);this._choice+=a;this.onChoiceChange({choice:this._choice})};d.prototype.getCurrentAssignment=function(){return this.requisition.getAssignmentAt(this.element.selectionStart)};d.prototype.getInputState=function(){var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};null==a.typed&&(a={typed:"",cursor:{start:0,end:0}});null==a.cursor.start&&(a.cursor.start=0);return a};g.Inputter=
d});define("text!gcli/ui/completer.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cloop foreach\x3d"member in ${statusMarkup}"\x3e\n    \x3cspan class\x3d"${member.className}"\x3e${member.string}\x3c/span\x3e\n  \x3c/loop\x3e\n  \x3cspan class\x3d"gcli-in-ontab"\x3e${directTabText}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-todo" foreach\x3d"param in ${emptyParameters}"\x3e${param}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-ontab"\x3e${arrowTabText}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-closebrace" if\x3d"${unclosedJs}"\x3e}\x3c/span\x3e\n  \x3cdiv class\x3d"gcli-in-scratchlink" if\x3d"${scratchLink}"\x3e${scratchLink}\x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/completer","require exports module util/promise util/util util/domtemplate text!gcli/ui/completer.html".split(" "),function(k,g,n){function d(a,c){this.requisition=c.requisition;this.scratchpad=a.scratchpad;this.input={typed:"",cursor:{start:0,end:0}};this.choice=0;this.element=c.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=c.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=c.autoResize){this.inputter.onResize.add(this.resized,this);var d=this.inputter.getDimensions();d&&this.resized(d)}this.template=m.toDom(this.document,b);m.removeWhitespace(this.template,!0);this.update()}var c=k("util/promise"),m=k("util/util"),h=k("util/domtemplate"),b=k("text!gcli/ui/completer.html");d.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};d.prototype.resized=function(a){this.element.style.top=a.top+"px";this.element.style.height=a.height+"px";this.element.style.lineHeight=a.height+"px";this.element.style.left=a.left+"px";this.element.style.width=a.width+"px"};d.prototype.update=
function(a){this.choice=a&&null!=a.choice?a.choice:0;a=this._getCompleterTemplateData();var b=this.template.cloneNode(!0);h.template(b,a,{stack:"completer.html"});for(m.clearElement(this.element);b.hasChildNodes();)this.element.appendChild(b.firstChild)};d.prototype._getCompleterTemplateData=function(){var a=c.defer(),b=c.defer(),d=c.defer(),e=this.inputter.getInputState(),h=this.requisition.getAssignmentAt(e.cursor.start),g=void 0;0!==e.typed.trim().length&&(g=h.getPredictionAt(this.choice));c.resolve(g).then(function(c){var g=
"",k="",m=[];if(0!==e.typed.trim().length){var n=h.arg;if(c){if(c=c.name,n=n.text,h.isInName()&&(c=" "+c),n!==c){var s=n.replace(/^\s*/,"");0===c.indexOf(s)&&e.cursor.start===e.typed.length?(s=n.match(/^(\s*)/)[0].length,g=c.slice(n.length-s)):k="\u21e5 "+c}}else"NamedArgument"===n.type&&""===n.text&&m.push("\x3c"+h.param.type.name+"\x3e\u00a0")}""!==g?g+="\u00a0":this.requisition.typedEndsWithSeparator()||m.unshift("\u00a0");this.requisition.getAssignments().forEach(function(a){a.param.isPositionalAllowed&&
""===a.arg.toString().trim()&&(""!==g&&h===a||m.push(a.param.isDataRequired?"\x3c"+a.param.name+"\x3e\u00a0":"["+a.param.name+"]\u00a0"))}.bind(this));c=this.requisition.commandAssignment.value;var v=!1;c&&c.hasNamedParameters&&c.params.forEach(function(a){var b=this.requisition.getAssignment(a.name).arg;!a.isPositionalAllowed&&(!a.hidden&&"BlankArgument"===b.type)&&(v=!0)},this);v&&m.push("[options]\u00a0");a.resolve(g);b.resolve(k);d.resolve(m)}.bind(this),console.error);return{statusMarkup:this._getStatusMarkup(e),
unclosedJs:this._getUnclosedJs(),scratchLink:this._getScratchLink(),directTabText:a.promise,arrowTabText:b.promise,emptyParameters:d.promise}};d.prototype._getStatusMarkup=function(a){a=this.requisition.getInputStatusMarkup(a.cursor.start);a.forEach(function(a){a.string=a.string.replace(/ /g,"\u00a0");a.className="gcli-in-"+a.status.toString().toLowerCase()},this);return a};d.prototype._getUnclosedJs=function(){var a=this.requisition.commandAssignment.value;return a&&"{"===a.name&&-1===this.requisition.getAssignment(0).arg.suffix.indexOf("}")};
d.prototype._getScratchLink=function(){var a=this.requisition.commandAssignment.value;return this.scratchpad&&a&&"{"===a.name?this.scratchpad.linkText:""};g.Completer=d});
define("gcli/ui/prompt",["require","exports","module"],function(k,g,n){function d(c,d){this.element=d.element;this.element.classList.add("gcli-prompt");var h=this.element.ownerDocument.createTextNode(c.promptChar||"\u00bb");this.element.appendChild(h);if(this.inputter=d.inputter)this.inputter.onResize.add(this.resized,this),(h=this.inputter.getDimensions())&&this.resized(h)}d.prototype.destroy=function(){this.inputter&&this.inputter.onResize.remove(this.resized,this);delete this.element};d.prototype.resized=
function(c){this.element.style.top=c.top+"px";this.element.style.height=c.height+"px";this.element.style.left=c.left+"px";this.element.style.width=c.width+"px"};g.Prompt=d});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\x3cdiv class\x3d"gcli-panel" save\x3d"${panel}"\x3e\n  \x3cdiv save\x3d"${tooltip}"\x3e\x3c/div\x3e\n  \x3cdiv class\x3d"gcli-panel-connector"\x3e\x3c/div\x3e\n\x3c/div\x3e'});
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(k,g,n){function d(a){var d=a.document||document;this.displayStyle=void 0;null!=z&&(this.displayStyle=h.importCss(z,d,"gcli-css-display"));this.commandOutputManager=a.commandOutputManager;null==this.commandOutputManager&&
(this.commandOutputManager=new l);this.requisition=new f(a.environment||{},d,this.commandOutputManager);this.focusManager=new w(a,{document:d,requisition:this.requisition});this.inputElement=c(d,a.inputElement||null,"gcli-input");this.inputter=new q(a,{requisition:this.requisition,focusManager:this.focusManager,element:this.inputElement});this.completeElement=m(this.inputElement,a.completeElement||null,"gcli-row-complete");this.completer=new r(a,{requisition:this.requisition,inputter:this.inputter,
autoResize:this.completeElement.gcliCreated,element:this.completeElement});this.prompt=new u(a,{inputter:this.inputter,element:m(this.inputElement,a.promptElement||null,"gcli-prompt")});this.element=c(d,a.displayElement||null,"gcli-display");this.element.classList.add("gcli-display");this.template=h.toDom(d,t);this.elements={};b.template(this.template,this.elements,{stack:"display.html"});this.element.appendChild(this.template);this.tooltip=new p(a,{requisition:this.requisition,inputter:this.inputter,
focusManager:this.focusManager,element:this.elements.tooltip,panelElement:this.elements.panel});this.inputter.tooltip=this.tooltip;this.outputElement=h.createElement(d,"div");this.outputElement.classList.add("gcli-output");this.outputList=new s(a,{requisition:this.requisition,element:this.outputElement});this.element.appendChild(this.outputElement);e.maybeShowIntro(this.commandOutputManager,this.requisition)}function c(a,b,c){if(!b&&(b=a.getElementById(c),!b))throw Error("Missing element, id\x3d"+
c);return b}function m(a,b,c){c=a.ownerDocument;b||(b=c.getElementById("gcli-row-complete"),b||(b=h.createElement(c,"div"),a.parentNode.insertBefore(b,a.nextSibling),b.gcliCreated=!0));return b}var h=k("util/util"),b=k("util/domtemplate"),a=k("gcli/settings"),l=k("gcli/canon").CommandOutputManager,f=k("gcli/cli").Requisition,e=k("gcli/ui/intro"),p=k("gcli/ui/tooltip").Tooltip,s=k("gcli/ui/output_terminal").OutputTerminal,q=k("gcli/ui/inputter").Inputter,r=k("gcli/ui/completer").Completer,w=k("gcli/ui/focus").FocusManager,
u=k("gcli/ui/prompt").Prompt,z=k("text!gcli/ui/display.css"),t=k("text!gcli/ui/display.html");g.createDisplay=function(b){null!=b.settings&&a.setDefaults(b.settings);b=new d(b);var c=b.requisition;return{exec:c.exec.bind(c),update:c.update.bind(c),updateExec:c.updateExec.bind(c),destroy:b.destroy.bind(b)}};d.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};g.Display=d});
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(k,g,n){k("util/legacy");g.addCommand=k("gcli/canon").addCommand;g.removeCommand=k("gcli/canon").removeCommand;k("gcli/types/basic").startup();
k("gcli/types/command").startup();k("gcli/types/javascript").startup();k("gcli/types/node").startup();k("gcli/types/resource").startup();k("gcli/types/selection").startup();k("gcli/types/setting").startup();k("gcli/settings").startup();k("gcli/cli").startup();k("gcli/ui/intro").startup();k("gcli/ui/focus").startup();k("gcli/ui/fields/basic").startup();k("gcli/ui/fields/javascript").startup();k("gcli/ui/fields/selection").startup();var d=k("gcli/ui/display");g.createDisplay=function(c){return d.createDisplay(c||
{})};g.createView=g.createDisplay});define("text!gcli/commands/help_man.html",[],function(){return'\n\x3cdiv\x3e\n  \x3ch3\x3e${command.name}\x3c/h3\x3e\n\n  \x3ch4 class\x3d"gcli-help-header"\x3e\n    ${l10n.helpManSynopsis}:\n    \x3cspan class\x3d"gcli-out-shortcut" onclick\x3d"${onclick}" data-command\x3d"${command.name}"\x3e\n      ${command.name}\n      \x3cspan foreach\x3d"param in ${command.params}"\x3e\n        ${param.defaultValue !\x3d\x3d undefined ? \'[\' + param.name + \']\' : param.name}\n      \x3c/span\x3e\n    \x3c/span\x3e\n  \x3c/h4\x3e\n\n  \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.helpManDescription}:\x3c/h4\x3e\n\n  \x3cp class\x3d"gcli-help-description"\x3e${describe(command)}\x3c/p\x3e\n\n  \x3cdiv if\x3d"${command.exec}"\x3e\n    \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.helpManParameters}:\x3c/h4\x3e\n\n    \x3cul class\x3d"gcli-help-parameter"\x3e\n      \x3cli if\x3d"${command.params.length \x3d\x3d\x3d 0}"\x3e${l10n.helpManNone}\x3c/li\x3e\n      \x3cli foreach\x3d"param in ${command.params}"\x3e\n        ${param.name} \x3cem\x3e${getTypeDescription(param)}\x3c/em\x3e\n        \x3cbr/\x3e\n        ${describe(param)}\n      \x3c/li\x3e\n    \x3c/ul\x3e\n  \x3c/div\x3e\n\n  \x3cdiv if\x3d"${!command.exec}"\x3e\n    \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.subCommands}:\x3c/h4\x3e\n\n    \x3cul class\x3d"gcli-help-${subcommands}"\x3e\n      \x3cli if\x3d"${subcommands.length \x3d\x3d\x3d 0}"\x3e${l10n.subcommandsNone}\x3c/li\x3e\n      \x3cli foreach\x3d"subcommand in ${subcommands}"\x3e\n        \x3cstrong\x3e${subcommand.name}\x3c/strong\x3e:\n        ${subcommand.description}\n        \x3cspan class\x3d"gcli-out-shortcut" data-command\x3d"help ${subcommand.name}"\n            onclick\x3d"${onclick}" ondblclick\x3d"${ondblclick}"\x3e\n          help ${subcommand.name}\n        \x3c/span\x3e\n      \x3c/li\x3e\n    \x3c/ul\x3e\n  \x3c/div\x3e\n\n\x3c/div\x3e'});
define("text!gcli/commands/help_list.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cdiv if\x3d"${includeIntro}"\x3e\n    \x3ch2\x3eWelcome to GCLI\x3c/h2\x3e\n    \x3cp\x3eGCLI is an experiment to create a highly usable JavaScript command line for developers.\x3c/p\x3e\n    \x3cp\x3e\n      Useful links:\n      \x3ca href\x3d\'https://github.com/joewalker/gcli\'\x3eSource\x3c/a\x3e (Apache-2.0),\n      \x3ca href\x3d\'https://github.com/joewalker/gcli/blob/master/docs/index.md\'\x3eDocumentation\x3c/a\x3e (for users/embedders),\n      \x3ca href\x3d\'https://wiki.mozilla.org/DevTools/Features/GCLI\'\x3eMozilla feature page\x3c/a\x3e (for GCLI in the web console).\n    \x3c/p\x3e\n  \x3c/div\x3e\n\n  \x3ch3\x3e${heading}\x3c/h3\x3e\n\n  \x3ctable\x3e\n    \x3ctr foreach\x3d"command in ${matchingCommands}"\x3e\n      \x3cth class\x3d"gcli-help-name"\x3e${command.name}\x3c/th\x3e\n      \x3ctd class\x3d"gcli-help-arrow"\x3e-\x3c/td\x3e\n      \x3ctd\x3e\n        ${command.description}\n        \x3cspan class\x3d"gcli-out-shortcut"\n            onclick\x3d"${onclick}" ondblclick\x3d"${ondblclick}"\n            data-command\x3d"help ${command.name}"\x3ehelp ${command.name}\x3c/span\x3e\n      \x3c/td\x3e\n    \x3c/tr\x3e\n  \x3c/table\x3e\n\x3c/div\x3e'});
define("text!gcli/commands/help.css",[],function(){return"\n.gcli-help-name {\n  text-align: end;\n}\n.gcli-help-arrow {\n  color: #AAA;\n}\n.gcli-help-description {\n  margin: 0 20px;\n  padding: 0;\n}\n.gcli-help-parameter {\n  margin: 0 30px;\n  padding: 0;\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(k,g,n){function d(a,c){var d=b.getCommands().filter(function(b){return b.hidden||a.search&&0!==b.name.indexOf(a.search)||!a.search&&-1!=b.name.indexOf(" ")?!1:!0});d.sort(function(a,b){return a.name.localeCompare(b.name)});var l;l=0===d.length?h.lookupFormat("helpListNone",[a.search]):null==
a.search?h.lookup("helpListAll"):h.lookupFormat("helpListPrefix",[a.search]);return{l10n:h.propertyLookup,includeIntro:null==a.search,matchingCommands:d,heading:l,onclick:function(a){m.updateCommand(a.currentTarget,c)},ondblclick:function(a){m.executeCommand(a.currentTarget,c)}}}function c(a,c){var d={l10n:h.propertyLookup,command:a,onclick:function(a){m.updateCommand(a.currentTarget,c)},ondblclick:function(a){m.executeCommand(a.currentTarget,c)},describe:function(a){return a.manual||a.description},
getTypeDescription:function(a){var b="",b=void 0===a.defaultValue?h.lookup("helpManRequired"):null===a.defaultValue?h.lookup("helpManOptional"):a.defaultValue;return"("+a.type.name+", "+b+")"}};Object.defineProperty(d,"subcommands",{get:function(){var c=b.getCommands().filter(function(b){return 0===b.name.indexOf(a.name)&&b.name!==a.name});c.sort(function(a,b){return a.name.localeCompare(b.name)});return c},enumerable:!0});return d}var m=k("util/util"),h=k("util/l10n"),b=k("gcli/canon"),a=k("gcli/ui/view");
g.helpManHtml=k("text!gcli/commands/help_man.html");g.helpListHtml=k("text!gcli/commands/help_list.html");g.helpCss=k("text!gcli/commands/help.css");var l={name:"help",description:h.lookup("helpDesc"),manual:h.lookup("helpManual"),params:[{name:"search",type:"string",description:h.lookup("helpSearchDesc"),manual:h.lookup("helpSearchManual3"),defaultValue:null}],returnType:"html",exec:function(f,e){var h=b.getCommand(f.search||void 0);return h?a.createView({html:g.helpManHtml,options:{allowEval:!0,
stack:"help_man.html"},data:c(h,e),css:g.helpCss,cssId:"gcli-help"}):a.createView({html:g.helpListHtml,options:{allowEval:!0,stack:"help_list.html"},data:d(f,e),css:g.helpCss,cssId:"gcli-help"})}};g.startup=function(){b.addCommand(l)};g.shutdown=function(){b.removeCommand(l)}});
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(k,g,n,d,c,m,h,b,a,l,f,e,p,s){function q(a){}q.prototype=Object.create(c.SelectionType.prototype);var r;r={CompletionStatus:{MATCH:0,PARTIAL:1,ERROR:2}};r.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(g.formatMessage(k["For a list of available commands type '${0}'."],"\x3cb\x3ehelp\x3c/b\x3e"))},output:function(a){var b=new e.Output;this.commandOutputManager.onOutput({output:b});b.complete(a)},registerCommand:function(a){a.exec||(a.exec=a.callback);a.params||(a.params=a.parameters);var b=function(a){return function(b,c){var e=a(b,c);this.registeredTypes.forEach(function(a){a.prototype.lastParseTimestamp=
0});return e}.bind(this)}.bind(this);a.exec&&(a.exec=b(a.exec));n.addCommand(a)},registerType:function(a){a=function(a){function b(a){this.typeSpec=a}b.prototype=Object.create(q.prototype);b.prototype.name=a.getName();b.prototype.lastParseTimestamp=0;b.prototype.parse=function(b){var c=Object.getPrototypeOf(this),e=c.lastParseTimestamp;c.lastParseTimestamp=Math.round((new Date).getTime()/1E3);c=JSON.parse(JSON.stringify(b));return a.parse(c,this.typeSpec,{lastParseTimestamp:e}).then(function(a){var c=
d.Status.VALID;if(a.status)switch(a.status){case r.CompletionStatus.ERROR:c=d.Status.ERROR;break;case r.CompletionStatus.PARTIAL:c=d.Status.INCOMPLETE}var e=s.defer();e.resolve(a.predictions);return new d.Conversion(a.value,b,c,a.message,e.promise)})};b.prototype.lookup=function(){var b=Object.getPrototypeOf(this),c=b.lastParseTimestamp;b.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse({prefix:"",suffix:"",text:""},this.typeSpec,{lastParseTimestamp:c}).then(function(a){return a.predictions})};
a.stringify&&(b.prototype.stringify=function(b){return a.stringify(b,this.typeSpec)});return b}(a);d.registerType(a);this.registeredTypes.push(a)},setFocusToInput:function(){this.inputText.focus()},setInputText:function(a){a&&(this.inputText.value=a.toString())},addField:function(a){},_init:function(c,e){function d(c,e){h.Field.call(this,c,e);this.isImportant=!0;this.element=a.createElement(this.document,"div");this.element.className="orion";this.menu=new b.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 m=document.createElement("div");m.id="gcli-display";m.style.height="100%";m.style.width="100%";e.appendChild(m);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);l.getSetting("hideIntro").value=!0;l.getSetting("eagerHelper").value=2;setTimeout(function(){this.commandOutputManager=new f.CommandOutputManager;n.createDisplay({commandOutputManager:this.commandOutputManager});this.output(g.formatMessage(k["For a list of available commands type '${0}'."],"\x3cb\x3ehelp\x3c/b\x3e"))}.bind(this),1);p.startup();p.helpListHtml=p.helpListHtml.replace('"${includeIntro}"',"${false}");d.prototype=Object.create(h.Field.prototype);d.prototype.destroy=
function(){h.Field.prototype.destroy.call(this);this.menu.destroy();delete this.element;delete this.menu;delete this.document;delete this.onInputChange};d.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))};d.prototype.onItemClick=function(a){a=
a.conversion;this.onFieldChange({conversion:a});this.setMessage(a.message)};d.claim=function(a){return a instanceof q?h.Field.MATCH+1:h.Field.NO_MATCH};h.addField(d)}};return c}();return r});
define("shell/shellPageFileService",["i18n!orion/shell/nls/messages","orion/bootstrap","orion/fileClient","orion/Deferred"],function(k,g,n,d){var c;c={};var m,h;g.startup().then(function(b){h=b.serviceRegistry;m=new n.FileClient(h)});c.ShellPageFileService=function(){function b(){this.currentDirectory=null;this.withNode(this.SEPARATOR,function(a){this.rootNode=a}.bind(this));this.currentRetrievals={}}b.prototype={SEPARATOR:"/",computePathString:function(a){if(a.Location===this.SEPARATOR)return this.SEPARATOR;
var b=this.SEPARATOR+m.fileServiceName(a.Location),c=a.Parents;if(c){for(var b=b+this.SEPARATOR,e=c.length;0<=--e;)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 d;"string"!==typeof b?b.Directory?c.resolve(b):c.reject(k["Cannot create directory, it already exists as a file"]):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(e){if(e)for(var d=0;d<e.length;d++)if(e[d].Name===b){e[d].Directory?c.resolve(e[d]):c.reject(k["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 d;"string"!==typeof b?b.Directory?c.reject(k["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 d=0;d<e.length;d++)if(e[d].Name===b){e[d].Directory?c.reject(k["Cannot create file, it already exists as a directory"]):c.resolve(e[d]);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(0===b.length)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(0===b.indexOf(this.SEPARATOR))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,d=0;d<c.length;d++)if(0<c[d].length&&(e=this.getChild(e,c[d]),!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 b=h.getService("orion.page.progress");return b?b.progress(m.loadWorkspace(a),"Loading workspace "+a):m.loadWorkspace(a)},read:function(a){return m.read(a.Location,!1)},readBlob:function(a){var b=m._getService(a.Location);return!b.readBlob?(a=new d,a.reject(k["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,b,c){if(a.Children)b&&b(a.Children);else if(a.ChildrenLocation){var e=h.getService("orion.page.progress");(e?e.progress(m.fetchChildren(a.ChildrenLocation),"Getting children of "+a.Name):m.fetchChildren(a.ChildrenLocation)).then(function(c){this._sort(c);var e=a.Parents?a.Parents.slice(0):[];(!a.parent||a.parent!==this.rootNode)&&e.unshift(a);for(var d=0;d<c.length;d++)c[d].parent=a,c[d].Parents=
e;a.Children=c;b&&b(c)}.bind(this),function(a){c&&c(a)})}else b&&b(null)},withNode:function(a,b,c){var e=h.getService("orion.page.progress");(e?e.progress(m.loadWorkspace(a),"Loading workspace "+a):m.loadWorkspace(a)).then(function(a){this._retrieveNode(a,b,c)}.bind(this),c)},write:function(a,b){return m.write(a.Location,b)},writeBlob:function(a,b){var c=m._getService(a.Location);return!c.writeBlob?(c=new d,c.reject(k["Target file service does not support binary write"]),c):c.writeBlob(a.Location,
b)},_createResource:function(a,b,c){var e=a.Location+this.SEPARATOR+b,h=new d,g=this.currentRetrievals[e]||[];g.push(h);if(1===g.length){this.currentRetrievals[e]=g;var k=function(a){c&&(a.Name=b);this.currentRetrievals[e].forEach(function(b){b.resolve(a)});delete this.currentRetrievals[e]}.bind(this),n=function(a){this.currentRetrievals[e].forEach(function(b){b.reject(a.responseText)});delete this.currentRetrievals[e]}.bind(this);c?a.Projects?m.createProject(a.Location,b).then(function(a){m.read(a.ContentLocation,
!0).then(k,n)},n):m.createFolder(a.Location,b).then(k,n):m.createFile(a.Location,b).then(k,n)}return h},_retrieveNode:function(a,b,c){if(a.parent&&a.Children)b&&b(a);else{var e=function(a,b,c){a.Directory&&!a.Children?this.withChildren(a,function(c){b&&b(a)},c):b&&b(a)}.bind(this),d=function(a,b,c){if(a.Location===this.SEPARATOR)b(a);else if(a.Parents)if(0===a.Parents.length){var e=m.fileServiceRootURL(a.Location),d=h.getService("orion.page.progress");(d?d.progress(m.loadWorkspace(e),"Loading workspace "+
e):m.loadWorkspace(e)).then(function(c){c.parent=this.rootNode;a.parent=c;b(a)}.bind(this),c)}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;b(a)}else a.parent=this.rootNode,b(a)}.bind(this);if(!a.Parents&&!a.Projects&&a.Location!==this.SEPARATOR&&a.Name!==m.fileServiceName(a.Location)){var g=h.getService("orion.page.progress");(g?g.progress(m.loadWorkspace(a.Location),"Loading workspace "+a.Location):m.loadWorkspace(a.Location)).then(function(h){a.Parents=
h.Parents;d(a,function(a){e(a,b,c)},function(d){e(a,b,c)})})}else a.ChildrenLocation&&(a.Directory=!0),d(a,function(a){e(a,b,c)},function(d){e(a,b,c)})}},_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(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0})}};return b}();return c});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(k){return{detectValidURL:function(g){for(var n=/\[([^\]]*)\]\(([^\)]+)\)/g,d=n.exec(g),c=[],m=0;d;){if(3===d.length&&0<d[2].length){var h=new URL(d[2]);":"!==h.protocol&&k.validateURLScheme(h.href)&&(d.index>m&&c.push({segmentStr:g.substring(m,d.index)}),c.push({segmentStr:0<d[1].length?d[1]:d[2],urlStr:d[2]}),m=d.index+d[0].length)}d=n.exec(g)}if(0===m)return null;m<g.length&&c.push({segmentStr:g.substring(m)});return c},processURLSegments:function(g,
k){k.forEach(function(d){if(d.urlStr){var c=document.createElement("a");c.href=d.urlStr;c.appendChild(document.createTextNode(d.segmentStr))}else c=document.createElement("span"),c.textContent=d.segmentStr;g.appendChild(c)})}}});
(function(){function k(b){this.tokens=[];this.tokens.links={};this.options=b||a.defaults;this.rules=l.normal;this.options.gfm&&(this.rules=this.options.tables?l.tables:l.gfm)}function g(b,c){this.options=c||a.defaults;this.links=b;this.rules=f.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?f.breaks:f.gfm:this.options.pedantic&&(this.rules=f.pedantic)}function n(a){try{var b=a.replace(/&([#\w]+);/g,function(a,b){b=b.toLowerCase();
if("colon"===b)return":";if("#"===b.charAt(0)){var c="x"===b.charAt(1)?parseInt(b.substring(2),16):parseInt(b.substring(1),10);return String.fromCharCode(c)}return""});if(0===decodeURIComponent(b).replace(/[^\w:]/g,"").toLowerCase().indexOf("javascript:"))return""}catch(c){return""}return a}function d(b){this.tokens=[];this.token=null;this.options=b||a.defaults}function c(a,b){return a.replace(!b?/&(?!#?\w+;)/g:/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,
"\x26#39;")}function m(a,b){a=a.source;b=b||"";return function q(c,d){if(!c)return RegExp(a,b);d=d.source||d;d=d.replace(/(^|[^\[])\^/g,"$1");a=a.replace(c,d);return q}}function h(){}function b(a){for(var b=1,c,d;b<arguments.length;b++)for(d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a}function a(e,f,h){if(h||"function"===typeof f){h||(h=f,f=null);f&&(f=b({},a.defaults,f));var g=f.highlight,l,m,n=0;try{l=k.lex(e,f)}catch(z){return h(z)}m=l.length;var t=function(a){var b,
c;!0!==a&&delete f.highlight;try{b=d.parse(l,f)}catch(e){c=e}f.highlight=g;return c?h(c):h(null,b)};if(!g||3>g.length)return t(!0);if(!m)return t();for(;n<l.length;n++)(function(a){return"code"!==a.type?--m||t():g(a.text,a.lang,function(b,c){if(null==c||c===a.text)return--m||t();a.text=c;a.escaped=!0;--m||t()})})(l[n])}else try{return f&&(f=b({},a.defaults,f)),d.parse(k.lex(e,f),f)}catch(v){v.message+="\nPlease report this to https://github.com/chjj/marked.";if((f||a.defaults).silent)return"\x3cp\x3eAn error occured:\x3c/p\x3e\x3cpre\x3e"+
c(v.message+"",!0)+"\x3c/pre\x3e";throw v;}}var l={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};l.item=m(l.item,"gm")(/bull/g,l.bullet)();l.list=m(l.list)(/bull/g,l.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();l._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b";l.html=m(l.html)("comment",/\x3c!--[\s\S]*?--\x3e/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,
l._tag)();l.paragraph=m(l.paragraph)("hr",l.hr)("heading",l.heading)("lheading",l.lheading)("blockquote",l.blockquote)("tag","\x3c"+l._tag)("def",l.def)();l.normal=b({},l);l.gfm=b({},l.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});l.gfm.paragraph=m(l.paragraph)("(?!","(?!"+l.gfm.fences.source.replace("\\1","\\2")+"|")();l.tables=b({},l.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});
k.rules=l;k.lex=function(a,b){return(new k(b)).lex(a)};k.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};k.prototype.token=function(a,b){a=a.replace(/^ +$/gm,"");for(var c,d,f,h,g,k,m;a;){if(f=this.rules.newline.exec(a))a=a.substring(f[0].length),1<f[0].length&&this.tokens.push({type:"space"});if(f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",
text:!this.options.pedantic?f.replace(/\n+$/,""):f});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2],style:"atx"});else if(b&&(f=this.rules.nptable.exec(a))){a=a.substring(f[0].length);g={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,
"").split("\n")};for(k=0;k<g.align.length;k++)/^ *-+: *$/.test(g.align[k])?g.align[k]="right":/^ *:-+: *$/.test(g.align[k])?g.align[k]="center":/^ *:-+ *$/.test(g.align[k])?g.align[k]="left":g.align[k]=null;for(k=0;k<g.cells.length;k++)g.cells[k]=g.cells[k].split(/ *\| */);this.tokens.push(g)}else if(f=this.rules.lheading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:"\x3d"===f[2]?1:2,text:f[1],style:"setext"});else if(f=this.rules.hr.exec(a))a=a.substring(f[0].length),
this.tokens.push({type:"hr"});else if(f=this.rules.blockquote.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"blockquote_start"}),f=f[0].replace(/^ *> ?/gm,""),this.token(f,b),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){a=a.substring(f[0].length);h=f[2];this.tokens.push({type:"list_start",ordered:1<h.length});f=f[0].match(this.rules.item);c=!1;m=f.length;for(k=0;k<m;k++)g=f[k],d=g.length,g=g.replace(/^ *([*+-]|\d+\.) +/,""),~g.indexOf("\n ")&&(d-=g.length,
g=!this.options.pedantic?g.replace(RegExp("^ {1,"+d+"}","gm"),""):g.replace(/^ {1,4}/gm,"")),this.options.smartLists&&k!==m-1&&(d=l.bullet.exec(f[k+1])[0],h!==d&&!(1<h.length&&1<d.length)&&(a=f.slice(k+1).join("\n")+a,k=m-1)),d=c||/\n\n(?!\s*$)/.test(g),k!==m-1&&(c="\n"===g[g.length-1],d||(d=c)),this.tokens.push({type:d?"loose_item_start":"list_item_start"}),this.token(g,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),
this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===f[1]||"script"===f[1],text:f[0]});else if(b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){a=a.substring(f[0].length);g={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(k=0;k<g.align.length;k++)/^ *-+: *$/.test(g.align[k])?
g.align[k]="right":/^ *:-+: *$/.test(g.align[k])?g.align[k]="center":/^ *:-+ *$/.test(g.align[k])?g.align[k]="left":g.align[k]=null;for(k=0;k<g.cells.length;k++)g.cells[k]=g.cells[k].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(g)}else if(b&&(f=this.rules.paragraph.exec(a)))a=a.substring(f[0].length),this.tokens.push({type:"paragraph",text:"\n"===f[1][f[1].length-1]?f[1].slice(0,-1):f[1]});else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"text",
text:f[0]});else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));}return this.tokens};var f={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:h,tag:/^\x3c!--[\s\S]*?--\x3e|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};f.link=m(f.link)("inside",f._inside)("href",f._href)();f.reflink=m(f.reflink)("inside",f._inside)();f.normal=b({},f);f.pedantic=b({},f.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});f.gfm=b({},f.normal,{escape:m(f.escape)("])","~|])")(),
url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:m(f.text)("]|","~]|")("|","|https?://|")()});f.breaks=b({},f.gfm,{br:m(f.br)("{2,}","*")(),text:m(f.gfm.text)("{2,}","*")()});g.rules=f;g.output=function(a,b,c){return(new g(b,c)).output(a)};g.prototype.output=function(a){for(var b="",d,f;a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),b+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),"@"===f[2]?(d=":"===f[1][6]?this.mangle(f[1].substring(7)):
this.mangle(f[1]),f=this.mangle("mailto:")+d):f=d=c(f[1]),b+='\x3ca href\x3d"'+f+'"\x3e'+d+"\x3c/a\x3e";else if(f=this.rules.url.exec(a))a=a.substring(f[0].length),f=d=c(f[1]),b+='\x3ca href\x3d"'+this.options.sanitize?n(f):f+'"\x3e'+d+"\x3c/a\x3e";else if(f=this.rules.tag.exec(a))a=a.substring(f[0].length),b+=this.options.sanitize?c(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),b+=this.outputLink(f,{href:this.options.sanitize?n(f[2]):f[2],title:f[3]});else if((f=this.rules.reflink.exec(a))||
(f=this.rules.nolink.exec(a)))a=a.substring(f[0].length),d=(f[2]||f[1]).replace(/\s+/g," "),d=this.links[d.toLowerCase()],!d||!d.href?(b+=f[0][0],a=f[0].substring(1)+a):(this.options.sanitize&&(d.href=n(d.href)),b+=this.outputLink(f,d));else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),b+="\x3cstrong\x3e"+this.output(f[2]||f[1])+"\x3c/strong\x3e";else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),b+="\x3cem\x3e"+this.output(f[2]||f[1])+"\x3c/em\x3e";else if(f=this.rules.code.exec(a))a=
a.substring(f[0].length),b+="\x3ccode\x3e"+c(f[2],!0)+"\x3c/code\x3e";else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),b+="\x3cbr\x3e";else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),b+="\x3cdel\x3e"+this.output(f[1])+"\x3c/del\x3e";else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),b+=c(this.smartypants(f[0]));else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));return b};g.prototype.outputLink=function(a,b){return"!"!==a[0][0]?'\x3ca href\x3d"'+c(b.href)+
'"'+(b.title?' title\x3d"'+c(b.title)+'"':"")+"\x3e"+this.output(a[1])+"\x3c/a\x3e":'\x3cimg src\x3d"'+c(b.href)+'" alt\x3d"'+c(a[1])+'"'+(b.title?' title\x3d"'+c(b.title)+'"':"")+"\x3e"};g.prototype.smartypants=function(a){return!this.options.smartypants?a:a.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};g.prototype.mangle=function(a){for(var b="",c=a.length,d=0,f;d<c;d++)f=a.charCodeAt(d),0.5<Math.random()&&(f="x"+
f.toString(16)),b+="\x26#"+f+";";return b};d.parse=function(a,b){return(new d(b)).parse(a)};d.prototype.parse=function(a){this.inline=new g(a.links,this.options);this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};d.prototype.next=function(){return this.token=this.tokens.pop()};d.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};d.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)};
d.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"\x3chr\x3e\n";case "heading":return"\x3ch"+this.token.depth+"\x3e"+this.inline.output(this.token.text)+"\x3c/h"+this.token.depth+"\x3e\n";case "code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);null!=a&&a!==this.token.text&&(this.token.escaped=!0,this.token.text=a)}this.token.escaped||(this.token.text=c(this.token.text,!0));return"\x3cpre\x3e\x3ccode"+(this.token.lang?
' class\x3d"'+this.options.langPrefix+c(this.token.lang)+'"':"")+"\x3e"+this.token.text+"\x3c/code\x3e\x3c/pre\x3e\n";case "table":var b,d,f,h,a="\x3cthead\x3e\n\x3ctr\x3e\n";for(d=0;d<this.token.header.length;d++)b=this.inline.output(this.token.header[d]),a+=this.token.align[d]?'\x3cth align\x3d"'+this.token.align[d]+'"\x3e'+b+"\x3c/th\x3e\n":"\x3cth\x3e"+b+"\x3c/th\x3e\n";a+="\x3c/tr\x3e\n\x3c/thead\x3e\n\x3ctbody\x3e\n";for(d=0;d<this.token.cells.length;d++){b=this.token.cells[d];a+="\x3ctr\x3e\n";
for(h=0;h<b.length;h++)f=this.inline.output(b[h]),a+=this.token.align[h]?'\x3ctd align\x3d"'+this.token.align[h]+'"\x3e'+f+"\x3c/td\x3e\n":"\x3ctd\x3e"+f+"\x3c/td\x3e\n";a+="\x3c/tr\x3e\n"}a+="\x3c/tbody\x3e\n";return"\x3ctable\x3e\n"+a+"\x3c/table\x3e\n";case "blockquote_start":for(a="";"blockquote_end"!==this.next().type;)a+=this.tok();return"\x3cblockquote\x3e\n"+a+"\x3c/blockquote\x3e\n";case "list_start":d=this.token.ordered?"ol":"ul";for(a="";"list_end"!==this.next().type;)a+=this.tok();return"\x3c"+
d+"\x3e\n"+a+"\x3c/"+d+"\x3e\n";case "list_item_start":for(a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return"\x3cli\x3e"+a+"\x3c/li\x3e\n";case "loose_item_start":for(a="";"list_item_end"!==this.next().type;)a+=this.tok();return"\x3cli\x3e"+a+"\x3c/li\x3e\n";case "html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case "paragraph":return"\x3cp\x3e"+this.inline.output(this.token.text)+"\x3c/p\x3e\n";
case "text":return"\x3cp\x3e"+this.parseText()+"\x3c/p\x3e\n"}};h.exec=h;a.options=a.setOptions=function(c){b(a.defaults,c);return a};a.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};a.Parser=d;a.parser=d.parse;a.Lexer=k;a.lexer=k.lex;a.InlineLexer=g;a.inlineLexer=g.output;a.parse=a;"object"===typeof exports?module.exports=a:"function"===typeof define&&define.amd?define("marked/marked",[],function(){return a}):
this.marked=a}).call(function(){return this||("undefined"!==typeof window?window:global)}());
define("shell/resultWriters",["orion/Deferred","orion/urlUtils","marked/marked"],function(k,g,n){var d;d={};d.FileBlobWriter=function(){function c(c,d){this.destination=c;this.shellPageFileService=d;this.blobs=[]}c.prototype={addBlob:function(c){this.blobs.push(c)},write:function(){var c=new k;this.shellPageFileService.ensureFile(null,this.destination).then(function(d){this.shellPageFileService.writeBlob(d,this.blobs[0]).then(function(){c.resolve()},function(b){c.reject(b)})}.bind(this),function(d){c.reject(d)});
return c}};return c}();d.FileStringWriter=function(){function c(c,d){this.destination=c;this.shellPageFileService=d}c.prototype={write:function(c){var d=new k;this.shellPageFileService.ensureFile(null,this.destination).then(function(b){this.shellPageFileService.write(b,c).then(function(){d.resolve()},function(a){d.reject(a)})}.bind(this),function(b){d.reject(b)});return d}};return c}();d.ShellBlobWriter=function(){function c(c){this.rootElement=c;this.blobCount=0}c.prototype={addBlob:function(c){this.blobCount++},
write:function(){var c=new k,d=document.createElement("span");d.textContent="("+this.blobCount+" blobs)";this.rootElement.appendChild(d);c.resolve();return c}};return c}();d.ShellStringWriter=function(){function c(c,d){this.rootElement=c;this.processMarkdown=d}c.prototype={write:function(c){var d=document.createElement("div");if(this.processMarkdown)d.innerHTML=n(c,{sanitize:!0,breaks:!0});else{this.rootElement.className+=" string-result-output";var b=g.detectValidURL(c);b?g.processURLSegments(d,
b):d.textContent=c}for(c=d.childNodes;0<c.length;)this.rootElement.appendChild(c[0]);c=new k;c.resolve();return c}};return c}();return d});
define("shell/paramType-file",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred","shell/resultWriters"],function(k,g,n,d,c){function m(b,a,c,d){this.value=b;this.typeSpec=a;this.typedPath=c;this.shellPageFileService=d}var h;h={};m.prototype={getPluginRepresentation:function(){var b=new d;if("string"===typeof this.value)b.resolve({file:{path:this.value}});else{var a=0,c=this.value.slice(0),f=[],e=function(d){d&&f.push(d);0===a&&0===c.length&&(this.typeSpec.multiple?
b.resolve(f):b.resolve(f[0]))}.bind(this),h=function(){for(;0<c.length;){var b=c[0],d=this.shellPageFileService.getCurrentDirectory(),f=d.Parents;if((!f||0===f.length)&&d.parent)f=[d.parent];f=f?f.slice(0):[];if(0<f.length)for(var g=f[f.length-1].parent;g;)f.push(g),g=g.parent;f.splice(0,0,d);d=f.length-1;g=b.Parents;if((!g||0===g.length)&&b.parent)g=[b.parent];g=g?g.slice(0):[];if(0<g.length)for(var k=g[g.length-1].parent;k;)g.push(k),k=k.parent;g.splice(0,0,b);for(k=g.length-1;0<=k&&0<=d;)if(g[k].Location===
f[d].Location)k--,d--;else break;f="";if(0===b.Location.indexOf(g[k+1].Location)){for(var m=0;m<=d;m++)f+=".."+this.shellPageFileService.SEPARATOR;f+=b.Location.substring(g[k+1].Location.length)}else f=b.Location;f={isDirectory:b.Directory,path:f.length?f:"."};b.Directory&&(this.typeSpec.multiple&&this.typeSpec.recurse)&&function(b){a++;this.shellPageFileService.withChildren(b,function(d){a--;if(0===d.length)e();else{var f=b.recursePath?b.recursePath.slice(0):[];f.push(b.Name);var g=function(b){a--;
c.push(b);1===c.length&&h()};d.forEach(function(b){b.recursePath=f;a++;b.parent?g(b):this.shellPageFileService.withNode(b.Location,g,function(b){a--;e()})}.bind(this))}}.bind(this),function(b){a--;e()})}.call(this,b);c.splice(0,1);this.typeSpec.content&&!f.isDirectory?function(c){a++;this.shellPageFileService.readBlob(b).then(function(b){a--;c.blob=b;e(c)},function(b){a--;e(c)})}.call(this,f):e(f)}}.bind(this);h()}return b},getValue:function(){return this.value},resourceExists:function(){return"string"!==
typeof this.value},stringify:function(){return this.typedPath}};h.ParamTypeFile=function(){function b(a){this.shellPageFileService=a}b.prototype={getName:function(){return"file"},parse:function(a,b){var c=new d;this._getPredictions(a.text).then(function(d){c.resolve(this._createCompletion(a.text,d,b))}.bind(this),function(a){c.error(a)});return c},processResult:function(a,b,d,e){var h=document.createElement("div"),g=0,m=function(b){this.callback=function(){var d=n.formatMessage(k["Wrote ${0}"],"string"===
typeof b?b:this.shellPageFileService.computePathString(b));(new c.ShellStringWriter(h)).write(d+"\n");0!==--g||e?a.progress(h):a.resolve(h)}.bind(this);return this}.bind(this),r=function(b){this.callback=function(d){var f=n.formatMessage(k["Failed to write ${0}"],"string"===typeof b?b:this.shellPageFileService.computePathString(b)),f=f+(" ["+d+"]");(new c.ShellStringWriter(h)).write(f+"\n");0!==--g||e?a.progress(h):a.resolve(h)}.bind(this);return this}.bind(this);d=d||this.shellPageFileService.getCurrentDirectory();
g++;this.shellPageFileService.ensureDirectory(null,d).then(function(a){g--;var d=b.getValue();b.isArray()||(d=[d]);d.forEach(function(b){g++;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(0===e){r(n.formatMessage(k["Cannot write ${0}, it is not a descendent of the output directory"],b.path));return}d.splice(e-- -1,2)}else e++}var h=function(a,b,d){var e=d[0];d.splice(0,1);var f=this.shellPageFileService.computePathString(a)+
this.shellPageFileService.SEPARATOR+e;0===d.length?b.isDirectory?this.shellPageFileService.ensureDirectory(a,e).then(m(f).callback,r(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(m(a).callback,r(a).callback)}.bind(this),r(f).callback):this.shellPageFileService.ensureDirectory(a,e).then(function(a){h(a,b,d)},r(this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+
e).callback)}.bind(this);h(a,b,d)}.bind(this))}.bind(this),r(d).callback)},stringify:function(a){return!a?"":"string"===typeof a?a:a.stringify()},_createCompletion:function(a,b,c){if(!b)return{value:void 0,status:g.CompletionStatus.ERROR,message:n.formatMessage(k["'${0}' is not valid"],a),predictions:null};var d,h,s;if(!1===c.exist){var q;for(h=0;h<b.length;h++){var r=b[h];if(r.name===a){q=r;break}}q?(h=g.CompletionStatus.ERROR,d=n.formatMessage(k["'${0}' already exists"],a)):(h=g.CompletionStatus.MATCH,
s=new m(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 u=[];q=a.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$\x26");q=q.replace(/\?/g,".");q=q.replace(/\*/g,".*");var z=RegExp("^"+q+"$");b.forEach(function(a){a.name.match(z)&&(a.value.Directory&&c.directory||!a.value.Directory&&c.file)&&u.push(a.value)});c.multiple&&u.length||1===u.length?(h=g.CompletionStatus.MATCH,s=new m(u,c,a,this.shellPageFileService)):b.length?
h=g.CompletionStatus.PARTIAL:(h=g.CompletionStatus.ERROR,d=n.formatMessage(k["'${0}' is not valid"],a))}else{for(h=0;h<b.length;h++)if(r=b[h],r.name===a){q=r;break}h=g.CompletionStatus.MATCH;s=q?new m([q.value],c,a,this.shellPageFileService):new m(a,c,a,this.shellPageFileService)}}return{value:s,status:h,message:d,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 d,c=this.shellPageFileService.getDirectory(null,
a);c?this.shellPageFileService.withChildren(c,function(d){var h=a.lastIndexOf(this.shellPageFileService.SEPARATOR)+1,g=a.substring(0,h),k=a.substring(h),m=0===k.length||"."===k,h=[],n=[];m&&h.push({name:g+".",value:c,incomplete:!0});if(m||".."===k)(m=this.shellPageFileService.getParent(c))&&h.push({name:g+"..",value:m,incomplete:!0});0===k.trim().length&&0<g.length&&h.push({name:g,value:c,incomplete:!1});for(var k=k.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$\x26"),k=k.replace(/\?/g,"."),k=k.replace(/\*/g,
".*"),m=RegExp("^"+k),u=0;u<d.length;u++){var z=d[u];if(z.Name.match(m)){var t=!z.Directory||z.Children&&0===z.Children.length,k=g+z.Name;z.Directory?h.push({name:k,value:z,incomplete:!t}):n.push({name:k,value:z,incomplete:!t})}}b.resolve(h.concat(n))}.bind(this),function(a){b.error(a)}):b.resolve(null);return b}};return b}();return h});
define("shell/paramType-plugin",["i18n!orion/shell/nls/messages","require","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(k,g,n,d,c){var m;m={};var h=function(){function b(a,b){this.plugins=a;this.urlsToExclude=b}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,h=d.length,g=0;d.forEach(function(c){c[a](b).then(function(){++g===h&&e.resolve()},function(a){e.reject(a)})});return e}};
return b}();m.ParamTypePlugin=function(){function b(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)}b.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=g.toUrl(a);if(-1===a.indexOf("://")){var c=document.createElement("a");
c.href=a;a=c.href}b[a]=!0}.bind(this)))},_createCompletion:function(a,b){for(var c,e=0;e<b.length;e++){var h=b[e];if(h.name===a){c=h;break}}var g;c?e=n.CompletionStatus.MATCH:b&&0<b.length?e=n.CompletionStatus.PARTIAL:(e=n.CompletionStatus.ERROR,g=d.formatMessage(k["'${0}' is not valid"],a));return{value:c?c.value:void 0,status:e,message:g,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,b){var c=[];this.plugins&&(this.plugins.forEach(function(d){(!b.excludeDefaultPlugins||!this._defaultPluginUrls[d.getLocation()])&&0===d.name.indexOf(a)&&c.push({name:d.name,value:d})}.bind(this)),b.multiple&&0==="all".indexOf(a)&&c.push({name:"all",value:new h(this.plugins,b.excludeDefaultPlugins?this._defaultPluginUrls:null)}));return c},_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="active"===c||"starting"===c,d=b.getState();if(c!==("active"===d||"starting"===d))return c?-1:1;c=a.name&&a.name.toLowerCase();d=b.name&&b.name.toLowerCase();return c<d?-1:c>d?1:0})}};return b}();return m});
define("shell/paramType-service",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(k,g,n,d){var c;c={};c.ParamTypeService=function(){function c(d){this.pluginRegistry=d;d.addEventListener("installed",function(){this._initServicesList()}.bind(this));d.addEventListener("uninstalled",function(){this._initServicesList()}.bind(this));window.setTimeout(function(){this._initServicesList()}.bind(this),1)}c.prototype={getName:function(){return"service"},parse:function(c){var b=
new d,a=this._getPredictions(c.text);b.resolve(this._createCompletion(c.text,a));return b},stringify:function(c){return c},_createCompletion:function(c,b){for(var a,d=0;d<b.length;d++){var f=b[d];if(f.name===c){a=f;break}}var e;a?d=g.CompletionStatus.MATCH:b&&0<b.length?d=g.CompletionStatus.PARTIAL:(d=g.CompletionStatus.ERROR,e=n.formatMessage(k["'${0}' is not valid"],c));return{value:a?a.value:void 0,status:d,message:e,predictions:b}},_getPredictions:function(c){var b=[];this.services&&this.services.forEach(function(a){0===
a.indexOf(c)&&b.push({name:a,value:a})});return b},_initServicesList:function(){var c={};this.pluginRegistry.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(a){a.getProperty("service.names").forEach(function(a){c[a]=!0})})});this.services=[];for(var b in c)this.services.push(b);this._sort(this.services)},_sort:function(c){c.sort(function(b,a){var c=b.toLowerCase(),d=a.toLowerCase();return c<d?-1:c>d?1:0})}};return c}();return c});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(k,g,n,d){function c(c,b,a,d,f){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=f;this.domId=a;this.progressDomId=d||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var m;c.prototype={_init:function(){var c=g.node("closeNotifications");if(c&&
!this._hookedClose){c.style.cursor="pointer";this._hookedClose=!0;var b=g.node(this.notificationContainerDomId);g.addAutoDismiss([b],function(){this._clickToDisMiss&&this.close()}.bind(this));c.addEventListener("click",function(){this.close()}.bind(this));b.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=g.$$("a",b))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var c=g.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&c?(c.innerHTML="",c.classList.remove("cancelButton"),c.classList.add("dismissButton"),c.classList.add("core-sprite-close"),c.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=n.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(c,b,a){this._init();this.currentMessage=c;var d=g.node(this.domId);
if("boolean"===typeof a){var f=d.getAttribute("aria-live");d.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){c===this.currentMessage&&(g.empty(d),d.appendChild(document.createTextNode(c)),window.setTimeout(function(){d.setAttribute("aria-live",f)},100))}.bind(this),100)}else g.empty(d),d.appendChild(document.createTextNode(c));"number"===typeof b&&window.setTimeout(function(){c===this.currentMessage&&(g.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(c){this._clickToDisMiss=
!0;this.currentMessage=c;this._init();var b=c.responseText||c.message||c;if("string"===typeof b)try{b=JSON.parse(b)}catch(a){}c=b.Message||b;var d="red";if(b.Severity)switch(b.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}b=document.createElement("span");b.style.color=d;b.appendChild(document.createTextNode(c));c=g.node(this.domId);g.empty(c);c.appendChild(b)},setProgressMessage:function(c){this._clickToDisMiss=!1;this._init();this.currentMessage=
c;var b=document.createElement("span");b.classList.add("progressIcon");var a=g.node(this.progressDomId);g.empty(a);a.appendChild(b);a.appendChild(document.createTextNode(c));b=g.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(c&&0<c.length)b.classList.add("progressNormal"),b.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();b.classList.remove("notificationShow");b.classList.add("notificationHide")}},
setCancelFunction:function(c){this._cancelFunc=c},setProgressResult:function(c,b){this._clickToDisMiss=!1;this._cancelMsg=b;this.currentMessage=c;var a=c.responseText||c;if("string"===typeof a)try{a=JSON.parse(a)}catch(l){}this._init();var f=a.Message||a.toString(),e=k.UnknownError,m="core-sprite-information",n="progressNormal",q=document.createElement("span");q.classList.add("imageSprite");q.classList.add("progressIcon");var r=[];if(a.Severity)switch(a.Severity){case "Warning":e=k.UnknownWarning;
m="core-sprite-warning";n="progressWarning";r.push("progressInfo");r.push("progressError");r.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";n="progressError";r.push("progressWarning");r.push("progressInfo");r.push("progressNormal");this._clickToDisMiss=!0;break;default:n="progressNormal",r.push("progressWarning"),r.push("progressError"),r.push("progressNormal")}r.push("notificationHide");q.classList.add(m);var w=g.node(this.progressDomId),m=g.node(this.notificationContainerDomId);
g.empty(w);w.appendChild(q);f===Object.prototype.toString()&&(f=e);a.HTML?(a=document.createElement("span"),a.innerHTML=f,w.appendChild(a)):((e=d.detectValidURL(f))?(f=document.createDocumentFragment(),d.processURLSegments(f,e),Array.prototype.forEach.call(g.$$("a",f),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!b)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
f=document.createTextNode(f)),w.appendChild(f));if(n&&this.progressDomId!==this.domId){m.classList.add(n);for(n=0;n<r.length;n++)m.classList.remove(r[n])}m.classList.add("notificationShow");if(r=g.node("closeNotifications"))this._cancelMsg?(r.classList.add("cancelButton"),r.classList.remove("dismissButton"),r.classList.remove("core-sprite-close"),r.classList.remove("imageSprite"),r.innerHTML=this._cancelMsg):(r.innerHTML="",r.classList.remove("cancelButton"),r.classList.add("dismissButton"),r.classList.add("core-sprite-close"),
r.classList.add("imageSprite"))},showWhile:function(c,b){var a=this;if(b){a.setProgressMessage(b);var d=function(){b===a.currentMessage&&a.setProgressMessage("")};c.then(d,d)}return c},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(c,b){return new m(this,++this._lastProgressId,c,b)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var c="",b=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(b||(c+=", "),c+=this._progressMonitors[a].status,
b=!1);this.setProgressMessage(c)}else this.setProgressMessage("")},_beginProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._renderOngoingMonitors()},_doneProgressMonitor:function(c){delete this._progressMonitors[c.progressId];this._progressMonitors.length--;c.status?this.setProgressResult(c.status):this._renderOngoingMonitors()}};c.prototype.constructor=
c;m=function(c,b,a,d){this.statusService=c;this.progressId=b;if(a){this.deferred=a;this.begin(d);var f=this;a.then(function(a,b){f.done.bind(f)()},function(a,b){f.done.bind(f)()})}};m.prototype.begin=function(c){this.status=c;this.statusService._beginProgressMonitor(this)};m.prototype.done=function(c){this.status=c;this.statusService._doneProgressMonitor(this)};m.prototype.worked=function(c){this.status=c;this.statusService._workedProgressMonitor(this)};m.prototype.constructor=m;return{StatusReportingService:c,
ProgressMonitor:m}});
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(k,g){var n={root:g};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(k,g,n,d){function c(){}c.prototype={_initialize:function(c,g,b,a,l){this._tooltip=new d.Tooltip({node:c,hideDelay:l||0,afterShowing:this._afterShowingFunction(g).bind(this),afterHiding:b,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&&n.processTextNodes(c,k);this.$parent.appendChild(c);var f=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&f.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(c){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.id&&(this["$"+b.id]=b);this._bindElements(b)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var d=
n.firstTabbable(this.$parent);d&&d.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(k,g,n,d){var c={};(function(){var g=!1;c.updateNavTools=function(c,b,a,d,f,e){var p=n.node(d);if(p)b.destroy(p);else throw k["could not find toolbar "]+d;b.renderCommands(d,p,e,a,"button");if(f&&(d=n.node(f)))b.destroy(d),b.renderCommands(f,d,null,a,"button");g||(g=!0,c.getService("orion.page.selection").addEventListener("selectionChanged",function(c){var d=n.node(f);
d&&(b.destroy(d),b.renderCommands(f,d,c.selections,a,"button"))}))};c.createOperationsCommands=function(c,b,a){function g(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var f=new d.Command({name:k["Remove Completed"],tooltip:k["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(c){a.removeCompletedOperations().then(function(a){b.loadOperations.bind(b)()})},visibleWhen:function(a){return!0}});c.addCommand(f);
f=new d.Command({name:k.Remove,tooltip:k["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){c=Array.isArray(c.items)?c.items:[c.items];for(var d=0;d<c.length;d++){var f=c[d];a.removeOperation.bind(a)(f.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!g(a);for(var b in a)if(g(a[b]))return!1;return!0}});c.addCommand(f);
f=new d.Command({name:k.Cancel,tooltip:k["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return g(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!g(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});c.addCommand(f)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(k,g,n,d,c){function m(c){this._options=c}m.prototype=new d.PopupDialog;m.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';m.prototype._init=
function(d){this._myOperations=[];this._operationsDeferreds=[];this._commandService=d.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(d.triggerNode)};m.prototype._bindToDom=function(c){this.$allOperationsLink.href=g.toUrl("operations/list.html");this._setOperationsVisibility()};m.prototype.setOperations=function(c,b){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(c)for(var a in c)this._myOperations.push(c[a]),this._operationsDeferreds.push(b[a]);this._renderOperations()};m.prototype.parseProgressResult=function(c){if(!c)return{};c=c.responseText||c;try{c=JSON.parse(c)}catch(b){}var a={Message:c.Message||c,Severity:c.Severity};c.DetailedMessage&&c.DetailedMessage!==a.Message&&(a.DetailedMessage=c.DetailedMessage);return a};m.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};m.prototype._renderOperationsTable=function(c,b,a){n.empty(c);for(var d=0;d<b.length;d++){var f=b[d],e=document.createElement("tr"),g=document.createElement("td");g.style.paddingLeft="5px";g.style.paddingRight="5px";g.textContent=f.Name;e.appendChild(g);var m=document.createElement("div");g.appendChild(m);g=document.createElement("span");g.style.paddingRight="5px";g.classList.add("imageSprite");switch(f.type){case "Warning":g.classList.add("core-sprite-warning");
g.setAttribute("aria-label",k["Operation resulted in a warning."]);break;case "error":g.classList.add("core-sprite-error");g.setAttribute("aria-label",k["Operation resulted in an error."]);break;case "loadstart":case "progress":g.classList.add("core-sprite-start");g.setAttribute("aria-label",k["Operation is running."]);break;case "abort":g.classList.add("core-sprite-stop");g.setAttribute("aria-label",k["Operation is canceled."]);break;case "load":case "loadend":g.classList.add("core-sprite-ok"),g.setAttribute("aria-label",
"Operation ok.")}m.appendChild(g);g=document.createElement("span");g.classList.add("operationStatus");g.textContent=f.Name;m.appendChild(g);if(f.error){var q=f.error.Message||f.error;f.error.DetailedMessage&&""!==f.error.DetailedMessage&&(q+=": "+f.error.DetailedMessage);g.textContent=q;g.classList.remove("operationStatus");g.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:f,deferred:a[d]},this,"tool");c.appendChild(e)}this._setOperationsVisibility()};
m.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};m.prototype.constructor=m;return{OperationsDialog:m}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(k,g,n,d,c){function m(b,a){if(!this._progressPane){this._progressPane=d.node(b);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var g=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===d.KEY.ENTER)&&g._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){g._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function h(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}m.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=k.Operations,this._progressPane.alt=k.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&&("loadstart"===g.type||"progress"===g.type)){e=
"running";break}}""===e&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==e;switch(e){case "running":this._progressPane.title=k["Operations running"];this._progressPane.alt=k["Operations running"];this._progressPane.setAttribute("aria-valuetext",k["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=k["Some operations finished with warning"];this._progressPane.alt=k["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=k["Some operations finished with error"];this._progressPane.alt=k["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(c,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};m.prototype.constructor=m;h.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new m(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(g){d._operations[e]&&
(g=d._operations[e],a&&(g.Name=a),d._lastOperation=g,g.type="loadend",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];a&&(h.Name=a);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){a&&(g.Name=a);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];a.type&&("loadstart"!==a.type&&"progress"!==a.type)&&((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,c){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var d=this;b.then(function(a){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c?d._serviceRegistry.getService("orion.page.message").setProgressMessage(""):d.setProgressResult.bind(d)(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)}};h.prototype.constructor=h;return{ProgressService:h}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(k,g){function n(c,b,a){return c[b].apply(c,a)}function d(c){this._location=c}function c(){var c=new g;c.reject(k["No Matching OperationService for location:"]+this._location);return c}function m(c){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=c.getService("orion.core.preference");for(var b=c.getServiceReferences("orion.core.operation"),
a=0;a<b.length;a++){var g=c.getService(b[a]);this._services[a]=g;g=b[a].getProperty("pattern")||".*";"^"!==g[0]&&(g="^"+g);this._patterns[a]=RegExp(g)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new d(a)}}d.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};d.prototype.constructor=d;m.prototype={getOperations:function(){var c=
new g;if(this._operations)return c.resolve(this._operations),c;var b=this;this._preferenceService.getPreferences("/operations").then(function(a){b._operations=a;c.resolve(b._operations)});return c},getOperation:function(c){return n(this._getService(c),"getOperation",arguments)},removeCompletedOperations:function(){for(var c=[],b=this,a=0;a<this._services.length;a++){var d=this._patterns[a],f=new g;c[a]=f.promise;n(this._services[a],"removeCompletedOperations").then(function(a){return function(c){Array.isArray(c)&&
b.getOperations.bind(b)().then(function(b){for(var f=b.keys(),g=0;g<f.length;g++){var h=f[g];d.test(h)&&0>c.indexOf(h)&&b.remove(h)}a.resolve()})}}(f),function(a){return function(b){a.reject(b)}}(f))}return g.all(c)},removeOperation:function(c){var b=this;return n(this._getService(c),"removeOperation",arguments).then(function(a){b.getOperations.bind(b)().then(function(a){a.remove(c)})},function(a){return a},function(a){return a})}};m.prototype.constructor=m;return{OperationsClient:m}});
define("shell/shellPage","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 orion/extensionCommands orion/contentTypes orion/pluginregistry orion/PageUtil orion/URITemplate orion/Deferred orion/status orion/progress orion/operationsClient shell/resultWriters orion/URL-shim".split(" "),
function(k,g,n,d,c,m,h,b,a,l,f,e,p,s,q,r,w,u,z,t,v,y,H,A,J,E){function C(){var a=z.matchResourceParameters(window.location.href).resource;return 0<a.length?a:null}function x(a,c){var d=(new t(na)).expand({resource:a.Location});c?window.location.replace(d):window.location.href=d;b.setPageTarget({task:g.Shell,serviceRegistry:M,commandService:N,target:a})}function D(a){var b=r.getOpenWithCommand(N,a);return b?b.hrefCallback({items:a}):null}function B(a){var b=document.createElement("a");if(a.Directory)return b.href=
"#"+a.Location,b.className="shellPageDirectory",b.textContent=a.Name,b;b.href=D(a);b.target="_blank";b.textContent=a.Name;return b}function I(a,b){var c=document.createElement("span");c.appendChild(document.createTextNode(b?g["Initial directory: "]:g["Changed to: "]));var d=document.createElement("b");d.appendChild(document.createTextNode(a));c.appendChild(d);return c}function G(a,b){var c=a.directory.value[0];F.setCurrentDirectory(c);la=!0;x(c,!1);c=F.computePathString(c);return I(c,!1)}function K(a){a=
D(a.file.getValue()[0]);window.open(a)}function Q(a,b){var c=b.createPromise(),d=F.getCurrentDirectory(),d=d?d.Location:C()||ia;F.loadWorkspace(d).then(function(a){F.setCurrentDirectory(a);F.withChildren(a,function(a){for(var b=document.createElement("div"),d=0;d<a.length;d++)b.appendChild(B(a[d])),b.appendChild(document.createElement("br"));c.resolve(b);setTimeout(function(){for(var a=P.querySelectorAll(".shellPageDirectory"),b=0;b<a.length;b++)a[b].setAttribute("target","_self"),a[b].className=
""},1)},function(a){ja(c,a)})},function(a){ja(c,a)});return c}function L(a,b){var c=b.createPromise(),d=F.getCurrentDirectory();F.loadWorkspace(d.Location).then(function(a){a=F.computePathString(a);var b=document.createElement("b");b.appendChild(document.createTextNode(a));c.resolve(b)},function(a){ja(c,a)});return c}function $(a,b){var c=document.createElement("div");a.plugin.getServiceReferences().forEach(function(a){var b={values:[]};a.getPropertyKeys().forEach(function(c){"service.names"===c&&
(b.name=a.getProperty(c).join());"id"===c&&(b.id=a.getProperty(c));b.values.push({name:c,value:a.getProperty(c)})});if(b.name){b.elementId="serviceElement"+ha++;b.values.forEach(function(a){a.elementId="serviceElement"+ha++});var d=document.createElement("div");c.appendChild(d);var e=new qa,d=new l.TableTree({model:new pa(b),showRoot:!0,parent:d,renderer:e});e.tableTree=d}});return c}function Y(a,b){for(var c=ga.getPlugins(),d=document.createElement("table"),e=0;e<c.length;e++){var f=document.createElement("tr");
d.appendChild(f);var h=document.createElement("td");f.appendChild(h);f=document.createElement("b");h.appendChild(f);f.textContent=c[e].name;f=c[e].getState();"active"!==f&&"starting"!==f&&(f=document.createElement("span"),h.appendChild(f),f.textContent=" ("+g.disabled+")")}return d}function T(a,b){var c=b.createPromise();a.plugin.stop().then(function(){c.resolve(g.Succeeded)},function(a){c.resolve(a)});return c}function R(a,b){var c=b.createPromise();a.plugin.start({lazy:!0}).then(function(){c.resolve(g.Succeeded)},
function(a){c.resolve(a)});return c}function S(a,b){var c=a.url.trim();if(/^\S+$/.test(c)){if(Z.getPlugin(c))return g["Plug-in is already installed"];var d=b.createPromise();Z.installPlugin(c).then(function(a){a.start({lazy:!0}).then(function(){da.getPreferences("/plugins").then(function(a){a.put(c,!0)});d.resolve(g.Succeeded)},function(a){d.resolve(a)})},function(a){d.resolve(a)});return d}return g["Invalid plug-in URL"]}function ca(a,b){var c=b.createPromise();a.plugin.update().then(function(){c.resolve(g.Succeeded)},
function(a){c.resolve(a)});return c}function U(a,b){var c=b.createPromise();if(a.plugin.isAllPlugin){if(!window.confirm(g["Are you sure you want to uninstall all contributed plug-ins?"]))return g.Aborted;a.plugin.uninstall().then(function(){da.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(g.Succeeded)},function(a){c.resolve(a)})}else{var d=a.plugin.getLocation();Z.getPlugin(d).uninstall().then(function(){da.getPreferences("/plugins").then(function(a){a.remove(d)}.bind(this));
c.resolve(g.Succeeded)},function(a){c.resolve(a)})}return c}function ea(a,b){var c=a.id.trim(),d=document.createElement("div");ga.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(b){if(-1!==b.getProperty("service.names").indexOf(c)){var e={name:a.name,values:[]};b.getPropertyKeys().forEach(function(a){"id"===a&&(e.id=b.getProperty(a));e.values.push({name:a,value:b.getProperty(a)})});e.elementId="serviceElement"+ha++;e.values.forEach(function(a){a.elementId="serviceElement"+
ha++});var f=document.createElement("div");d.appendChild(f);var g=new qa,f=new l.TableTree({model:new pa(e),showRoot:!0,parent:f,renderer:g});g.tableTree=f}})});return d}function W(a,b){"string"!==typeof a&&(a=a.xhr&&a.xhr.statusText?a.xhr.statusText:a.toString());return b.write(a)}function fa(a,b,c,d){var e,f;c?f=new J.FileBlobWriter(c,F):(e=document.createElement("div"),f=new J.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 J.ShellStringWriter(e);W(b,f).then(function(){a.reject(e)},function(b){a.reject()})})}function O(a,b,c,d){var e,f;c?f=new J.FileStringWriter(c,F):(e=document.createElement("div"),f=new J.ShellStringWriter(e));W(b.stringify(),f).then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new J.ShellStringWriter(e);W(b,f).then(function(){a.reject(e)},function(b){a.reject()})})}function aa(a,
b,c,d){var e=b.getType();"file"===e?ka.processResult(a,b,c,d):"blob"===e?fa(a,b,c,d):O(a,b,c,d)}function ba(a,b,c,d,e){return"function"!==typeof a.callback?void 0:function(f,g){var h=new v,k=null;e&&((k=f.output)&&(k=k.resourceExists()?k.getValue()[0]:k.getValue()),delete f.output);(function(a,b){var c=Object.keys(a);if(0===c.length)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 g=function(a){a=new oa(a,d);aa(h,a,k)},l=function(a){ja(h,a)},m=function(a){if(a&&a.uriTemplate){var c=new t(a.uriTemplate);F.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";a.width&&(e.style.width=a.width);a.height&&(e.style.height=a.height);a=document.getElementsByClassName("gcli-row-out");
var f=a[a.length-1];f.appendChild(e);window.addEventListener("message",function sa(a){a.source===e.contentWindow&&"string"===typeof a.data&&(a=JSON.parse(a.data),"orion.page.delegatedUI"===a.pageService&&a.source===b&&(window.removeEventListener("message",sa,!1),a.error?l(a.error):(f.removeChild(e),a.result?g(a.result):a.progress&&m(a.progress))))},!1)}else"function"===typeof h.progress&&(a=new oa(a,d),aa(h,a,k,!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(g,l,m)});return h}}function X(a){return"function"!==typeof a?void 0:function(b,c,d){var e=new v;d&&(d.cwd=C());a(b,c,d).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}}var F,V,N,P,ka,la=!1,ma,M,Z,ga,da,ha=0,ia=(new URL(k.toUrl("file"),window.location.href)).pathname,na=k.toUrl("shell/shellPage.html")+"#{,resource}",oa=function(){function a(b,c){this.value=b;this.array=!1;0===c.indexOf("[")&&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("string"!==this.type&&"markdown"!==this.type)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}(),ra=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 v;this.parseFn(a,b,c).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d},stringify:function(a,b){var c=new v;if(!this.stringifyFn)return a?a.name:"";this.stringifyFn(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)});return c}};return a}(),pa=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}(),qa=function(){function a(){}a.prototype={getTwistieElementId:function(a){return a+"__expand"},initTable:function(a){},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(a){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;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=(d+" core-sprite-openarrow").replace(/\s?core-sprite-closedarrow/g,""):(d+=" core-sprite-closedarrow",d=d.replace(/\s?core-sprite-openarrow/g,""));c.className=d}}};return a}(),ja=function(a,b){var c=b;try{c=JSON.parse(b.responseText)}catch(d){}c&&c.DetailedMessage?c=q.formatMessage(g["Error: ${0}"],c.DetailedMessage):c&&c.Message?c=q.formatMessage(g["Error: ${0}"],c.Message):"string"===typeof b.url&&(c=0===b.status?q.formatMessage(g.NoResponseFromServer,b.url):q.formatMessage(g.ServerError,
b.url,b.status,b.statusText));var e=document.createElement("span");e.textContent=c;a.reject(e)};d.startup().then(function(d){Z=d.pluginRegistry;M=d.serviceRegistry;da=d.preferences;N=new c.CommandRegistry({});V=new m.FileClient(M);d=new h.Searcher({serviceRegistry:M,commandService:N,fileService:V});var k=new A.OperationsClient(M);new y.StatusReportingService(M,k,"statusPane","notifications","notificationArea");new H.ProgressService(M,k,N);b.generateBanner("orion-shellPage",M,N,da,d);b.setPageTarget({task:g.Shell,
serviceRegistry:M,commandService:N});P=document.getElementById("shell-output");d=document.getElementById("shell-input");var l=new a.Shell({input:d,output:P});P.onmousedown=function(a){P.onmouseup=null;0===a.button&&"DIV"===a.target.tagName.toUpperCase()&&(P.onmouseup=function(b){P.onmouseup=null;b.target===a.target&&(2>=Math.abs(b.clientX-a.clientX)&&2>=Math.abs(b.clientY-a.clientY))&&l.setFocusToInput()})};var n=z.matchResourceParameters(window.location.href);n.command&&(l.setInputText(n.command),
delete n.command,d=(new t(na)).expand(n),window.location.href=d);l.setFocusToInput();F=new f.ShellPageFileService;(function(a,b){var c=function(a){x(a,b);F.setCurrentDirectory(a);a=F.computePathString(a);l.output(I(a,!0))};a?F.loadWorkspace(a).then(c,function(a){F.loadWorkspace(ia).then(c)}):F.loadWorkspace(ia).then(c)})(C(),!0);ka=new e.ParamTypeFile(F);l.registerType(ka);ga=new p.ParamTypePlugin(Z);l.registerType(ga);d=new s.ParamTypeService(Z);l.registerType(d);l.registerCommand({name:"cd",description:g["Changes the current directory"],
callback:G,parameters:[{name:"directory",type:{name:"file",directory:!0,exist:!0},description:g["The name of the directory"]}],returnType:"html"});l.registerCommand({name:"edit",description:g["Edits a file"],callback:K,parameters:[{name:"file",type:{name:"file",file:!0,exist:!0},description:g["The name of the file"]}]});l.registerCommand({name:"ls",description:g["Lists the files in the current directory"],callback:Q,returnType:"html"});l.registerCommand({name:"pwd",description:g["Prints the current directory location"],
callback:L,returnType:"html"});l.registerCommand({name:"clear",description:g["Clears the shell screen"],callback:function(a,b){l.clear()}});l.registerCommand({name:"plugins",description:g["Commands for working with plug-ins"]});l.registerCommand({name:"plugins list",description:g["Lists all registered plug-ins"],callback:Y,returnType:"html"});l.registerCommand({name:"plugins install",description:g["Installs a plug-in from a URL"],callback:S,parameters:[{name:"url",type:"string",description:g["The plug-in URL"]}],
returnType:"string"});l.registerCommand({name:"plugins uninstall",description:g["Uninstalls a contributed plug-in from the configuration"],callback:U,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:g["The name of the contributed plug-in"]}],returnType:"string"});l.registerCommand({name:"plugins reload",description:g["Reloads a plug-in"],callback:ca,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!1},description:g["The name of the plug-in"]}],
returnType:"string"});l.registerCommand({name:"plugins enable",description:g["Enables a contributed plug-in"],callback:R,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:g["The name of the contributed plug-in"]}],returnType:"string"});l.registerCommand({name:"plugins disable",description:g["Disables a contributed plug-in"],callback:T,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:g["The name of the contributed plug-in"]}],
returnType:"string"});l.registerCommand({name:"plugins services",description:g["Displays a plug-in's services"],callback:$,parameters:[{name:"plugin",type:{name:"plugin",multiple:!1,excludeDefaultPlugins:!1},description:g["The name of the plug-in"]}],returnType:"html"});l.registerCommand({name:"service",description:g["Commands for working with a service"]});l.registerCommand({name:"service contributors",description:g["Displays all plug-in contributions for a service"],callback:ea,parameters:[{name:"id",
type:"service",description:g["The service identifier"]}],returnType:"html"});ma=new w.ContentTypeRegistry(M);r.createOpenWithCommands(M,ma,N);d=M.getServiceReferences("orion.shell.type");for(k=0;k<d.length;++k){var u=d[k],v=M.getService(u);v&&(u=new ra(u.getProperty("name"),X(v.parse),X(v.stringify)),l.registerType(u))}d=M.getServiceReferences("orion.shell.command");for(var B=M.getService("orion.page.progress"),k=0;k<d.length;++k)if(u=d[k],v=M.getService(u)){for(var n=u.getProperty("parameters")||
[],D,E=0;E<n.length;E++)if("output"===n[E].name){D=!0;break}D||n.push({name:"output",type:{name:"file",file:!0,directory:!0},description:g["The file or directory to re-direct output to"],defaultValue:null});var J=u.getProperty("returnType")||"string";u.getProperty("nls")&&u.getProperty("descriptionKey")?q.getMessageBundle(u.getProperty("nls")).then(function(a,b){var c=a.getProperty("name");l.registerCommand({name:c,description:b[a.getProperty("descriptionKey")],callback:ba(v,c,B,J,!D),returnType:"html",
parameters:n,manual:b[a.getProperty("manual")]})},u):(E=u.getProperty("name"),l.registerCommand({name:E,description:u.getProperty("description"),callback:ba(v,E,B,J,!D),returnType:"html",parameters:n,manual:u.getProperty("manual")}))}window.addEventListener("hashchange",function(){if(la)la=!1;else{var a=z.hash().substring(1);0===a.length&&(a=ia);F.loadWorkspace(a).then(function(a){if(F.getCurrentDirectory().Location!==a.Location){F.setCurrentDirectory(a);var b=F.computePathString(a);l.output(I(b,
!1));x(a,!1)}},function(a){x(F.getCurrentDirectory(),!0)})}})})});
//@ sourceMappingURL=shellPage.js.map