/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


 Copyright (c) 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).


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: 
 IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: 
 IBM Corporation - initial API and implementation
 Adrian Aichner - regular expression capture group support in replace

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 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: 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
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function l(e,h,g,b,a,f){h[e]&&(g.push(e),(!0===h[e]||1===h[e])&&b.push(a+e+"/"+f))}function n(e,h,g,b,a){h=b+h+"/"+a;require._fileExists(e.toUrl(h+".js"))&&g.push(h)}function m(e,h,g){for(var b in h)h.hasOwnProperty(b)&&(!e.hasOwnProperty(b)||g)?e[b]=h[b]:"object"===typeof h[b]&&m(e[b],h[b],g)}var k=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(e){var h=e.config?e.config():{},h=h||{};return{version:"2.0.1+",load:function(g,b,a,f){f=f||{};f.locale&&(h.locale=
f.locale);var d=k.exec(g),p=d[1],e=d[4],u=d[5],t=e.split("-"),y=[],v={},x,s="";d[5]?(p=d[1],g=p+u):(u=d[4],e=h.locale,e||(e=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),t=e.split("-"));if(f.isBuild){y.push(g);n(b,"root",y,p,u);for(x=0;x<t.length;x++)f=t[x],s+=(s?"-":"")+f,n(b,s,y,p,u);b(y,function(){a()})}else b([g],function(d){var f=[],g;l("root",d,f,y,p,u);for(x=0;x<t.length;x++)g=t[x],s+=(s?"-":"")+g,l(s,d,f,y,p,u);b(y,function(){var r,
g,e;for(r=f.length-1;-1<r&&f[r];r--){e=f[r];g=d[e];if(!0===g||1===g)g=b(p+e+"/"+u);m(v,g)}a(v)})})}}})})();
define("orion/i18n",[],function(){return{load:function(l,n,m,k){k=k||{};var e=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=e.exec(l);if(h){if(!n.defined||n.defined(l))try{m(n(l));return}catch(g){}if(k.isBuild||k.isTest)m({});else if(n.specified&&!n.specified("orion/bootstrap"))m({});else{var b=h[1],a=h[3]?h[2]:"",f=h[3]||h[2];n(["orion/bootstrap"],function(d){d.startup().then(function(d){var g=d.serviceRegistry;d=g.getServiceReferences("orion.i18n.message");if(a)d.some(function(a){return l===a.getProperty("name")?
(g.getService(a).getMessageBundle().then(function(a){m(a)},function(){m({})}),!0):!1})||m({});else{var u={},t;d.forEach(function(d){var p=d.getProperty("name");if((h=e.exec(p))&&b===h[1]&&f===(h[3]||h[2]))if(a=h[3]?h[2]:""){if((d=k.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===d.toLowerCase().indexOf(a.toLowerCase()))u[a]=!0,(!n.specified||!n.specified(p))&&define(p,["orion/i18n!"+p],function(a){return a})}else t=d});!n.specified||!n.specified(l)?t?
g.getService(t).getMessageBundle().then(function(a){Object.keys(u).forEach(function(d){"undefined"===typeof a[d]&&(a[d]=u[d])});define(l,[],a);m(a)},function(){define(l,[],u);m(u)}):(define(l,[],u),m(u)):m(u)}})})}}else m(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"All Git Repositories",Repo:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit",SmartCommit:"Type a message here to commit...",SmartCountCommit:"Commit ${0} file(s)","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:",
RebaseProgress:"Commits (Rebase in progress)",RebaseProgressDetails:"Rebasing branch.\n\n\tUse Continue after resolving any conflicts;\n\tSkip to bypass the current patch;\n\tAbort to end the rebase at any time.","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ","Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged",ChangedFiles:"Changed Files","Recent commits on":"Recent commits on","Git Status":"Git Status",
"Go to Git Status":"Open the Git Status page for the repository containing this file or folder.","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",
Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes",
"Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Undo:"Undo",UndoTooltip:"Revert this commit, keeping all changed files and not making any changes to the working directory.",UndoConfirm:"The content of your active branch will be replaced with ${0}. All changes in the commit and working directory will be kept. Are you sure?",
Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration","Getting configuration of":"Getting configuration of ${0}"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories",
"Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!",
"Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches","tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits",GettingCurrentBranch:"Getting current branch for ${0}","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',
"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits","The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","View all configuration entries":"View all configuration entries",
"Unstaged addition":"Unstaged addition","Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch','Commits for "${0}" branch against':'Commits for "${0}" branch against',"Add Remote":"Add Remote","Remote Name:":"Remote Name:",
"Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Open the Git Repository page for this file or folder.","Clone Git Repository":"Clone Git Repository","Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:",SmartAmend:"Amend Previous Commit","ChangeId:":"ChangeId:",SmartChangeId:"Prepare for Gerrit",
"Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content",
"Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...",SelectAll:"Select All","Looking for the commit":"Looking for the commit","New Branch:":"New Branch:","No remote selected":"No remote selected","Enter a name...":"Enter a name...",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.",
"Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout this commit, creating a local branch based on its contents.","Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.",
"Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...","Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository",
"Are you sure?":"Are you sure?","You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Open the remote Git Log page for this file or folder.","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository",
"Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Open the local Git Log page for this file or folder.","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository",
ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","Password:":"Password:","User Name:":"User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",RebaseSTOPPED:". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing.",RebaseFAILED_WRONG_REPOSITORY_STATE:". Repository state is invalid (i.e. already during rebasing).",RebaseFAILED_UNMERGED_PATHS:". Repository contains unmerged paths.",RebaseFAILED_PENDING_CHANGES:". Repository contains pending changes. Please commit or stash them.",RebaseUNCOMMITTED_CHANGES:". There are uncommitted changes.","Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ",
"starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch","Push Branch":"Push Branch","Push commits without tags from your local branch into the remote branch":"Push commits without tags from your local branch into the remote branch",
"Push for Review":"Push for Review","Push commits to Gerrit Code Review":"Push commits to Gerrit Code Review","Force Push Branch":"Force Push Branch","Push commits without tags from your local branch into the remote branch overriding its current content":"Push commits without tags from your local branch into the remote branch overriding its current content","Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Choose the remote branch.":"Choose the remote branch.","Force Push All":"Force Push All",
"Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.","\x3c Previous Page":"\x3c Previous Page","Show previous page of git log":"Show previous page of git log",
"Show previous page of git tags":"Show previous page of git tags","Next Page \x3e":"Next Page \x3e","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository","Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick",
"Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred.","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch",
"Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository","Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ",
"Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?","Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:",
"Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Fetching previous commit message":"Fetching previous commit message","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes","Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",
"Show checked changes as a patch":"Show checked changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase",Discard:"Discard ${0} file(s)","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Getting git log":"Getting git log","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
Local:"local","Filter items":"Filter items","Filter remote branches":"Filter remote branches","Getting remote branches":"Getting remote branches ${0}","Getting branches":"Getting branches ${0}","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org",
"Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org","Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:",
"Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...","The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories",
"You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ","To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}",
"Problem while performing the action":"Problem while performing the action","Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.","URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",
". Could not revert into active branch":". Could not revert into active branch.",Login:"Login","Authentication required for: ${0}. ${1} and re-try the request.":"Authentication required for: ${0}. ${1} and re-try the request.","Remember my committer name and email:":"Remember my committer name and email:","Successfully edited ${0} to have value ${1}":"Successfully edited ${0} to have value ${1}","Successfully added ${0} with value ${1}":"Successfully added ${0} with value ${1}","Signed-off-by: ":"Signed-off-by: ",
"Change-Id: ":"Change-Id: ",REJECTED_NONFASTFORWARD:"Push is non-fastforward and was rejected. Use Fetch to see new commits that must be merged.","Commit and Push":"Commit and Push",Sync:"Sync",SyncTooltip:"Fetch from the remote branch. Rebase your commits by removing them from the local branch, starting the local branch again based on the latest state of the remote branch and applying each commit to the updated local branch. Push commits and tags from your local branch into the remote branch.",NoCommits:"No Commits",
Incoming:"Incoming",Outgoing:"Outgoing",Synchronized:"History",NoBranch:"No Branch",None:"None"});define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
(function(){function l(){for(var e=navigator.userAgent,h={browser:!1,version:!1},g=[{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<g.length;b++){var a=g[b],f=e.match(a.regExp);if(f){h.browser=
!0;h.version=f[1]>=a.minVersion;h.name=a.name;break}}return h}function n(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}function m(e){alert(e);throw Error("unsupported browser");}var k=l();if(k.browser)k.version||m("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+k.name+".\n");else if(n()&&!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 n()||m("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:l,supportsLocalStorage:n,throwBrowserAlert:m}})();define("orion/browserCompatibility",function(){});
(function(l,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(l.orion=l.orion||{},l.orion.Deferred=n())})(this,function(){function l(){for(var b;b=e.shift();)b();h=!1}function n(b){e.push(b);h||(h=!0,g())}function m(b){return function(a){b(a)}}function k(){function b(){for(var a;a=e.shift();){var d=a.deferred,f="fulfilled"===g?"resolve":"reject";a=a[f];if("function"===typeof a)try{var b=a(p),h=b&&("object"===typeof b||"function"===typeof b)&&
b.then;if("function"===typeof h)if(b===d.promise)d.reject(new TypeError);else{var k=b.cancel;"function"===typeof k?d._parentCancel=k.bind(b):delete d._parentCancel;h.call(b,m(d.resolve),m(d.reject),m(d.progress))}else d.resolve(b)}catch(t){d.reject(t)}else d[f](p)}}function a(a){delete h._parentCancel;g="rejected";p=a;e.length&&n(b)}function f(d){function v(a){return function(d){(!g||"assumed"===g)&&a(d)}}delete h._parentCancel;try{var l=d&&("object"===typeof d||"function"===typeof d)&&d.then;if("function"===
typeof l)if(d===h)a(new TypeError);else{g="assumed";var m=d&&d.cancel;if("function"!==typeof m){var w=new k;d=w.promise;try{l(w.resolve,w.reject,w.progress)}catch(z){w.reject(z)}m=d.cancel;l=d.then}p=d;l.call(d,v(f),v(a));h._parentCancel=m.bind(d)}else g="fulfilled",p=d,e.length&&n(b)}catch(C){v(a)(C)}}function d(){var d=h._parentCancel;d?(delete h._parentCancel,d()):g||(d=Error("Cancel"),d.name="Cancel",a(d))}var p,g,e=[],h=this;this.resolve=function(a){g||f(a);return h};this.reject=function(d){g||
a(d);return h};this.progress=function(a){g||e.forEach(function(d){if(d.progress)try{d.progress(a)}catch(f){}});return h.promise};this.cancel=function(){h._parentCancel?setTimeout(d,0):d();return h};this.then=function(a,d,f){var p=new k;p._parentCancel=h.promise.cancel;e.push({resolve:a,reject:d,progress:f,deferred:p});("fulfilled"===g||"rejected"===g)&&n(b);return p.promise};this.promise={then:h.then,cancel:h.cancel}}var e=[],h=!1,g=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(l)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(l)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(l,0)}}();k.all=function(b,a){function f(a,d){e||(g[a]=d,0===--p&&h.resolve(g))}function d(d,b){if(!e){if(a)try{f(d,a(b));return}catch(p){b=p}h.reject(b)}}var p=b.length,g=[],e=!1,h=new k;h.then(void 0,function(){e=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===p?h.resolve(g):b.forEach(function(a,b){a.then(f.bind(void 0,b),d.bind(void 0,b))});return h.promise};k.when=function(b,a,f,d){var p;b&&"function"===typeof b.then||(p=new k,p.resolve(b),b=p.promise);return b.then(a,f,d)};return k});
define("orion/EventTarget",[],function(){function l(){this._namedListeners={}}l.prototype={dispatchEvent:function(l){if(!l.type)throw Error("unspecified type");var m=this._namedListeners[l.type];m&&m.forEach(function(k){try{"function"===typeof k?k(l):k.handleEvent(l)}catch(e){"undefined"!==typeof console&&console.log(e)}});return!l.defaultPrevented},addEventListener:function(l,m){if("function"===typeof m||m.handleEvent)this._namedListeners[l]=this._namedListeners[l]||[],this._namedListeners[l].push(m)},
removeEventListener:function(l,m){var k=this._namedListeners[l];if(k)for(var e=0;e<k.length;e++)if(k[e]===m){1===k.length?delete this._namedListeners[l]:k.splice(e,1);break}}};l.prototype.constructor=l;l.attach=function(n){var m=new l;n.dispatchEvent=m.dispatchEvent.bind(m);n.addEventListener=m.addEventListener.bind(m);n.removeEventListener=m.removeEventListener.bind(m)};return l});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(l,n){function m(b,a,f){this._properties=f||{};this._properties["service.id"]=b;this._properties.objectClass=a;this._properties["service.names"]=a}function k(b,a,f){this._serviceId=b;this._serviceReference=a;this._internalRegistry=f}function e(b,a){function f(d){return function(){var f;try{if(!a())throw Error("Service was unregistered");var g=b[d].apply(b,Array.prototype.slice.call(arguments));if(g&&"function"===typeof g.then)return g;
f=new l;f.resolve(g)}catch(e){f=new l,f.reject(e)}return f.promise}}for(var d in b)"function"===typeof b[d]&&(this[d]=f(d))}function h(b,a){this.type=b;this.serviceReference=a}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new n;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var f=b._entries[a];if(!f)throw Error("Service has already been unregistered: "+a);var d=f.reference;b._serviceEventTarget.dispatchEvent(new h("unregistering",
d));b._entries[a]=null;d.getProperty("objectClass").forEach(function(a){for(var f=b._namedReferences[a],g=0;g<f.length;g++)if(f[g]===d){1===f.length?delete b._namedReferences[a]:f.splice(g,1);break}})},modifyService:function(a){var f=b._entries[a];if(!f)throw Error("Service not found while trying to send modified event: "+a);b._serviceEventTarget.dispatchEvent(new h("modified",f.reference))}}}m.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]}};m.prototype.constructor=m;k.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)}};k.prototype.constructor=k;g.prototype={getService:function(b){var a;if("string"===typeof b)(b=this._namedReferences[b])&&b.some(function(f){a=this._entries[f.getProperty("service.id")].service;return!!a},this);else if(b=this._entries[b.getProperty("service.id")])a=b.service;return a||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var a=[];this._entries.forEach(function(f){f&&a.push(f.reference)});return a},registerService:function(b,a,f){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof b?b=[b]:Array.isArray(b)||(b=[]);var d=this._entries.length,p=new m(d,b,f),g=this._namedReferences;b.forEach(function(a){g[a]=g[a]||[];g[a].push(p)});b=new e(a,this._internalRegistry.isRegistered.bind(null,d));this._entries.push({reference:p,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",
p));return new k(d,p,b)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};g.prototype.constructor=g;return{ServiceRegistry:g}});
define("orion/xhr",["orion/Deferred"],function(l){function n(l,k,e,h){var g="undefined"!==typeof e.response?e.response:e.responseText,b;try{b=e.status}catch(a){b=0}l={args:k,response:g,responseText:"string"===typeof g?g:null,status:b,url:l,xhr:e};"undefined"!==typeof h&&(l.error=h);return l}return function(m,k,e){e=e||{};var h=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,g=new l,b=e.headers||{},a=e.log||!1,f;"undefined"===typeof b["X-Requested-With"]&&(b["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof e.data&&("POST"===m||"PUT"===m))f=e.data;var d=!1,p=!1;g.promise.then(void 0,function(a){d=!0;!p&&(a instanceof Error&&"Cancel"===a.name)&&h.abort()});h.onabort=function(){p=!0;if(!d){var a=Error("Cancel");a.name="Cancel";g.reject(a)}};h.onload=function(){var d=n(k,e,h);200<=h.status&&400>h.status?g.resolve(d):(g.reject(d),a&&"undefined"!==typeof console&&console.log(Error(h.statusText)))};h.onerror=function(){var d=n(k,e,h);g.reject(d);a&&"undefined"!==typeof console&&console.log(Error(h.statusText))};
h.onprogress=function(a){a.xhr=h;g.progress(a)};try{h.open(m,k,!0);"string"===typeof e.responseType&&(h.responseType=e.responseType);if("number"===typeof e.timeout)if("number"===typeof h.timeout)h.timeout=e.timeout,h.addEventListener("timeout",function(a){g.reject(n(k,e,h,"Timeout exceeded"))});else{var q=setTimeout(function(){g.reject(n(k,e,h,"Timeout exceeded"))},e.timeout);g.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(b).forEach(function(a){h.setRequestHeader(a,
b[a])});h.send(f||null)}catch(u){g.reject(n(k,e,h,u))}return g.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(l,n,m){function k(a,d){this._name=a;this._providers=d;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function e(a,d){return{get:function(b,g){if(0===d)return null;var e=localStorage.getItem(a+b);if(null===e)return null;e=JSON.parse(e);return g||-1===d||e._expires&&e._expires>(new Date).getTime()?(delete e._expires,e):null},set:function(b,g){if(0!==d)if(-1!==d&&(g._expires=(new Date).getTime()+
1E3*d),0===Object.keys(g).length)localStorage.removeItem(a+b);else{var e=JSON.stringify(g);localStorage.setItem(a+b,e);delete g._expires}},remove:function(d){localStorage.removeItem(a+d)}}}function h(a){this._currentPromises={};this._cache=new e("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var d=a.getServiceReferences("orion.core.preference.provider");0<d.length&&(this._service=a.getService(d[0]))}return!!this._service}}function g(a){this._location=
a;this._currentPromise=null;this._cache=new e("/orion/preferences/default",3600)}function b(){this._cache=new e("/orion/preferences/local",-1)}function a(a,d){this._userProvider=new h(a);this._localProvider=new b;d=d||"defaults.pref";-1===d.indexOf("://")&&(d=l.toUrl(d));this._defaultsProvider=new g(d);this._serviceRegistration=a.registerService("orion.core.preference",this)}k.prototype={_flush:function(){for(var a=[],d=0;d<this._stores.length;++d){var b=this._stores[d];-1!==this._dirty.indexOf(b)&&
a.push(this._providers[d].put(this._name,b));if(this._pendingDeletes[d]&&0<this._pendingDeletes[d].length){for(b=0;b<this._pendingDeletes[d].length;b++)a.push(this._providers[d].remove(this._name,this._pendingDeletes[d][b]));delete this._pendingDeletes[d]}}this._dirty=[];return n.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 d=this._stores[a],b;for(b in d)d.hasOwnProperty(b)&&"undefined"===typeof this._cached[b]&&(this._cached[b]=d[b])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,d){if(0!==this._stores.length){var b=this._stores[0];b[a]!==d&&(b[a]=d,this._cached=null,this._scheduleFlush(b))}},remove:function(a){for(var d=0;d<
this._stores.length;++d){var b=this._stores[d];if(b.hasOwnProperty(a))return delete b[a],this._pendingDeletes[d]||(this._pendingDeletes[d]=[]),this._pendingDeletes[d].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 d=this,b=[],g=0;g<this._providers.length;++g)b.push(this._providers[g].get(this._name,
a).then(function(a){return function(f){d._stores[a]=f}}(g)));return n.all(b).then(function(){d._cached=null;d._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(a,d){if(this._currentPromises[a])return this._currentPromises[a];var b=new n,g=null;d?this._cache.remove(a):g=this._cache.get(a);if(null!==g)b.resolve(g);else{this._currentPromises[a]=b;var e=this;this._service.get(a).then(function(d){e._cache.set(a,d);delete e._currentPromises[a];b.resolve(d)},function(d){404===d.status?
(d={},e._cache.set(a,d),delete e._currentPromises[a],b.resolve(d)):(delete e._currentPromises[a],b.resolve(e._cache.get(a,!0)||{}))})}return b},put:function(a,d){this._cache.set(a,d);return this._service.put(a,d)},remove:function(a,d){var b=this._cache.get(a);delete b[d];this._cache.set(a,b);return this._service.remove(a,d)}};g.prototype={get:function(a,d){if(this._currentPromise)return this._currentPromise;var b=new n,g=null;d?this._cache.remove(a):g=this._cache.get(a);if(null!==g)b.resolve(g);else{this._currentPromise=
b;var e=this;m("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){d=JSON.parse(d.response);e._cache.set(a,d[a]||{});e._currentPromise=null;b.resolve(d[a]||{})},function(d){401===d.xhr.status||404===d.xhr.status?(e._cache.set(a,{}),e._currentPromise=null,b.resolve({})):(e._currentPromise=null,d=e._cache.get(a,!0),null!==d?b.resolve(d[a]||{}):b.resolve({}))})}return b},put:function(a,d){var b=new n;b.resolve();return b},remove:function(a,d){var b=this._cache.get(a);
delete b[d];this.put(a,b)}};b.prototype={get:function(a){var d=new n;a=this._cache.get(a);null!==a?d.resolve(a):d.resolve({});return d},put:function(a,d){var b=new n;this._cache.set(a,d);b.resolve();return b},remove:function(a,d){var b=this._cache.get(a);delete b[d];this.put(a,b)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(f,d,b){if(!d||"number"!==typeof d||7<d||1>d)b=d,d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
b,!1);return 0!==(a.USER_SCOPE&d)?"/orion/preferences/user"+f:0!==(a.LOCAL_SCOPE&d)?"/orion/preferences/local"+f:"/orion/preferences/default"+f},getPreferences:function(f,d){if(!d||"number"!==typeof d||7<d||1>d)d=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var b=[];a.USER_SCOPE&d&&this._userProvider.available()&&b.push(this._userProvider);a.LOCAL_SCOPE&d&&b.push(this._localProvider);a.DEFAULT_SCOPE&d&&b.push(this._defaultsProvider);var g=new k(f,b);return g.sync().then(function(){return g})},getSetting:function(a,
d,b){for(var g,e=0;e<a.length;e++)if(a[e].label===d)for(var h=0;h<a[e].data.length;h++)if(a[e].data[h].label===b){g=a[e].data[h].value;break}return g}};return{PreferencesService:a}});
(function(){function l(a){if("string"!==typeof a)throw new TypeError;}function n(a){return a?a.split("\x26"):[]}function m(a){return 0===a.length?"":a.join("\x26")}function k(a){var d=/([^=]*)(?:=?)(.*)/.exec(a);a=d[1]?decodeURIComponent(d[1]):"";d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function e(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="\x3d"+encodeURIComponent(a[1]));return d}function h(a,d){var f="",b=[],r=0;return{next:function(){f!==a.query&&(f=a.query,b=n(f));if(r<b.length){var g=
k(b[r++]);switch(d){case "keys":return g[0];case "values":return g[1];case "keys+values":return[g[0],g[1]];default:throw new TypeError;}}throw D;}}}function g(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 d=[];a.split("/").forEach(function(a){".."===a?d.pop():"."!==a&&d.push(a)});return d.join("/")}function f(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function d(d,r){if("string"!==
typeof d)throw new TypeError;d=f(d);var g=t.exec(d);if(!g)return null;var p={};p.scheme=g[1]||"";if(p.scheme&&!v.test(p.scheme))return null;var e=g[2];if(e&&(e=y.exec(e),p.userinfo=e[1],p.host=e[2],p.port=e[3],p.port&&!x.test(p.port)))return null;p.path=g[3];p.query=g[4];p.fragment=g[5];!p.scheme&&r&&(p.scheme=r.scheme,!p.host&&r.host&&(p.userinfo=r.userinfo,p.host=r.host,p.port=r.port,p.pathRelative=!0));p.pathRelative&&(p.path?"/"!==p.path[0]&&(g=/^(.*\/)[^\/]*$/.exec(r.path)[1]||"/",p.path=g+p.path):
p.path=r.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 p(a,f){var b;if(f){f=f.href||f;b=d(f);if(!b||!b.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:b})}b=d(a,b);if(!b)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:b,writable:!0});var r=new g(this);Object.defineProperty(this,"query",{get:function(){return this._url?
r:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(u){}var t=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,y=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,v=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,x=/^\d*$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,z=/^([^?#\s]*)$/,C=/^([^\s]*)$/,r=/^\S*$/,A=/([^:]*):?(.*)/,D="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),B={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(g.prototype,{get:{value:function(a){l(a);var d;n(this._url.query).some(function(f){f=k(f);if(f[0]===a)return d=f[1],!0});return d},enumerable:!0},set:{value:function(a,d){l(a);l(d);var f=n(this._url.query);f.some(function(b,r){var g=k(b);if(g[0]===a)return g[1]=d,f[r]=e(g),!0})||f.push(e([a,d]));this._url.query=m(f)},enumerable:!0},has:{value:function(a){l(a);
return n(this._url.query).some(function(d){if(k(d)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){l(a);var d=n(this._url.query),f=d.filter(function(d){return k(d)[0]!==a});return f.length!==d.length?(this._url.query=m(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if("function"!==typeof a)throw new TypeError;var f=h(this._url,"keys+values");try{for(;;){var b=f.next();a.call(d,b[1],b[0],this)}}catch(r){if(r!==D)throw r;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(a){l(a);var d=[];n(this._url.query).forEach(function(f){f=k(f);f[0]===a&&d.push(f[1])});return d},enumerable:!0},append:{value:function(a,d){l(a);l(d);var f=n(this._url.query);f.push(e([a,d]));this._url.query=
m(f)},enumerable:!0}});Object.defineProperties(p.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(a){l(a);this._input=a;this._url=d(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){l(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||v.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){l(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){l(a);if(this._url){var d=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];d[2]&&a.push(d[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){l(a);if(this._url){var d=[A.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){l(a);if(this._url&&(a=w.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){l(a);this._url&&s.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===B[this.protocol]&&(a="");return a},set:function(a){l(a);this._url&&x.exec(a)&&(this._url.port=b(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(d){l(d);
this._url&&z.exec(d)&&(this._url.host&&(d&&"/"!==d[0])&&(d="/"+d),this._url.path=d?a(d):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){l(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),C.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){l(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),r.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(p,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(p,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=p})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(l,n){function m(a,d){var f=Object.keys(a),b=Object.keys(d);if(f.length!==b.length)return!1;f.sort();b.sort();for(var g=0,e=f.length;g<e;g++){var h=f[g];if(h!==b[g])return!1;var k=a[h],h=d[h];if(k!==h&&JSON.stringify(k)!==JSON.stringify(h))return!1}return!0}function k(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(d){}return a}function e(a){var d=null,f={key:function(f){return(d=
d||Object.keys(a))[f]},getItem:function(d){return a[d]},setItem:function(f,b){a[f]=b;d=null},removeItem:function(f){delete a[f];d=null},clear:function(){(d=d||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));d=null}};Object.defineProperty(f,"length",{get:function(){return(d=d||Object.keys(a)).length}});return f}function h(a,d){if(d&&d instanceof XMLHttpRequest){var f,b;try{f=d.status,b=d.statusText}catch(g){f=0,b=""}return{status:f||0,statusText:b}}return d}function g(a){var d=a?JSON.parse(JSON.stringify(a,
h)):a;a instanceof Error&&(d.__isError=!0,d.message=d.message||a.message,d.name=d.name||a.name);return d}function b(a,d){this.type=a;this.plugin=d}function a(a,d){this.__objectId=a;this.__methods=d}function f(d,f,e){function h(a){I&&e.postMessage(a,I)}function k(d){if(!I)return(new l).reject(Error("plugin not connected"));d.id=String(V++);var f=new l;W[d.id]=f;f.then(null,function(a){"active"===F&&(a instanceof Error&&"Cancel"===a.name)&&h({requestId:d.id,method:"cancel",params:a.message?[a.message]:
[]})});var b=Object.prototype.toString;d.params.forEach(function(r,g){if("[object Object]"===b.call(r)&&!(r instanceof a)){var p,e;for(p in r)"[object Function]"===b.call(r[p])&&(e=e||[],e.push(p));if(e){var A=U++;T[A]=r;p=function(){delete T[A]};f.then(p,p);d.params[g]=new a(A,e)}}});e.postMessage(d,I);return f.promise}function v(a,d){a||0===a?h({id:a,result:null,error:d}):console.log(d)}function x(a,d,f,b){b.forEach(function(a,d){if(a&&"undefined"!==typeof a.__objectId){var f={};a.__methods.forEach(function(d){f[d]=
function(){return k({objectId:a.__objectId,method:d,params:Array.prototype.slice.call(arguments)})}});b[d]=f}});var r=void 0===typeof a?null:{id:a,result:null,error:null};try{var p=f.apply(d,b);r&&(p&&"function"===typeof p.then?(S[a]=p,p.then(function(d){delete S[a];r.result=d;h(r)},function(d){S[a]&&(delete S[a],r.error=g(d),h(r))},function(){h({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(r.result=p,h(r)))}catch(e){r&&(r.error=g(e),h(r))}}function s(a){try{if(a.method){var d=
a.method,f=a.params||[];if("serviceId"in a){var b=ba[a.serviceId];b||v(a.id,"service not found");d in b?x(a.id,b,b[d],f):v(a.id,"method not found")}else if("objectId"in a){var r=T[a.objectId];r||v(a.id,"object not found");d in r?x(a.id,r,r[d],f):v(a.id,"method not found")}else if("requestId"in a){var g=S[a.requestId];g&&("cancel"===d&&g.cancel)&&g.cancel.apply(g,f)}else if("responseId"in a){var p=W[a.responseId];p&&("progress"===d&&p.progress)&&p.progress.apply(p,f)}else if("plugin"===a.method){I.connected();
var D=a.params[0];X({headers:D.headers,services:D.services}).then(function(){H&&H.resolve(A)})}else if("timeout"===a.method)H&&H.reject(a.error);else throw Error("Bad method: "+a.method);}else{var q=W[String(a.id)];delete W[String(a.id)];if(a.error){var h=e.handleServiceError(A,a.error);q.reject(h)}else q.resolve(a.result)}}catch(k){console.log("Plugin._messageHandler "+k)}}function w(d){var f={};if(d.methods&&(d.methods.forEach(function(a){f[a]=function(){var f={serviceId:d.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===F?k(f):A.start({"transient":!0}).then(function(){return k(f)})}}),f.addEventListener&&f.removeEventListener)){var b=new n,r=U++;T[r]={handleEvent:b.dispatchEvent.bind(b)};var g=new a(r,["handleEvent"]),p=f.addEventListener;f.addEventListener=function(a,d){b._namedListeners[a]||p(a,g);b.addEventListener(a,d)};var e=f.removeEventListener;f.removeEventListener=function(a,d){b.removeEventListener(a,d);b._namedListeners[a]||e(a,g)}}return f}function z(a){var f=JSON.parse(JSON.stringify(a.properties));
f.__plugin__=d;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);f.objectClass=a;return f}function C(a){var d=w(a),f=z(a),f=e.registerService(a.names||a.type,d,f);J[a.serviceId]={registration:f,proxy:d}}function r(){e.persist(d,{created:D,headers:B,services:E,autostart:K,lastModified:L})}var A=this;f=f||{};var D=f.created||(new Date).getTime(),B=f.headers||{},E=f.services||[],K=f.autostart,L=f.lastModified||0,F="installed",G,H,I,P,J={},V=0,U=0,S={},W={},T={},ba={},X;this._default=!1;this._persist=r;
this._resolve=function(){F="resolved";e.dispatchEvent(new b("resolved",A))};this._getAutostart=function(){return K};this._getCreated=function(){return D};this.getLocation=function(){return d};this.getHeaders=function(){return JSON.parse(JSON.stringify(B))};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 L};this.getServiceReferences=function(){var a=
[];Object.keys(J).forEach(function(d){a.push(J[d].registration.getReference())});return a};this.setParent=function(a){return P!==a?(P=a,A.stop({"transient":!0}).then(function(){if("started"===K)return A.start({"transient":!0});if("lazy"===K)return A.start({lazy:!0,"transient":!0})})):(new l).resolve()};this.getState=function(){return F};this.start=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,a));if("active"===
F)return(new l).resolve();if(!a||!a.transient){var f=a&&a.lazy?"lazy":"started";f!==K&&(K=f,r())}f=e.getState();if("starting"!==f&&"active"!==f)return a.transient?(new l).reject(Error("start transient error")):(new l).resolve();if("installed"===F)try{this._resolve()}catch(g){return(new l).reject(g)}"resolved"===F&&E.forEach(function(a){C(a)});if(a&&a.lazy)return"starting"!==F&&(F="starting",e.dispatchEvent(new b("lazy activation",A))),(new l).resolve();var D=new l;G=D;F="starting";e.dispatchEvent(new b("starting",
A));H=new l;I=e.connect(d,s,P);H.then(function(){H=null;F="active";e.dispatchEvent(new b("started",A));G=null;D.resolve()},function(){H=null;F="stopping";e.dispatchEvent(new b("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});e.disconnect(I);I=null;F="resolved";G=null;e.dispatchEvent(new b("stopped",A));D.reject(Error("Failed to load plugin: "+d));A._default&&(L=0,r())});return D.promise};this.stop=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(G)return G.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==K)K="stopped",r();if("active"!==F&&"starting"!==F)return(new l).resolve();G=a=new l;F="stopping";e.dispatchEvent(new b("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});I&&(e.disconnect(I),I=null);F="resolved";G=null;e.dispatchEvent(new b("stopped",A));a.resolve();return a.promise};X=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(!a)return 0===L&&(L=(new Date).getTime(),r()),e.loadManifest(d).then(X,function(){A._default&&(L=0,r());console.log("Failed to load plugin: "+d)});var f=B,g=E,D=K;B=a.headers||{};E=a.services||[];K=a.autostart||K;a.lastModified?L=a.lastModified:(L=(new Date).getTime(),r());if(m(B,f)&&m(E,g)&&K===D)return(new l).resolve();if("active"===F||"starting"===F){var q=[];Object.keys(E).forEach(function(a){var d=E[a];q.push(a);var f=J[a];if(f){if(m(d.methods,Object.keys(f.proxy))){a=z(d);var b=f.registration.getReference(),
r={};b.getPropertyKeys().forEach(function(a){r[a]=b.getProperty(a)});m(a,r)||f.registration.setProperties(a);return}f.registration.unregister();delete J[a]}C(d)});Object.keys(J).forEach(function(a){-1===q.indexOf(a)&&(J[a].registration.unregister(),delete J[a])})}"active"===F&&(e.disconnect(I),H=new l,I=e.connect(d,s,P),H.then(function(){H=null},function(){H=null;F="stopping";e.dispatchEvent(new b("stopping"),A);Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});e.disconnect(I);
I=null;F="resolved";e.dispatchEvent(new b("stopped",A))}));return(new l).resolve()};this.update=function(a){return X(a).then(function(){e.dispatchEvent(new b("updated",A))})};this.uninstall=function(){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if("active"===F||"starting"===F||"stopping"===F)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));e.removePlugin(this);F="uninstalled";e.dispatchEvent(new b("uninstalled",A));return(new l).resolve()}}
var d=/^http[s]?/i;return{Plugin:f,PluginRegistry:function(a,g){function h(a){var d=a.source;s.some(function(f){if(d===f.target){try{var b;if("undefined"===typeof f.useStructuredClone){var g="string"!==typeof a.data;b=g?a.data:JSON.parse(a.data);f.useStructuredClone=g}else b=f.useStructuredClone?a.data:JSON.parse(a.data);f.handler(b)}catch(p){}return!0}})}g=g||{};var t=g.storage||localStorage;t.getItem||(t=e(t));var y="installed",v,m=[],s=[],w=new n,z={},C={registerService:a.registerService.bind(a),
connect:function(a,d,f,b){function g(a){a=Error(a);a.name="timeout";d({method:"timeout",error:a})}var p={handler:d,url:a},e=setTimeout(g.bind(null,"Load timeout for: "+a),b||15E3),q=document.createElement("iframe");q.name=a+"_"+(new Date).getTime();q.src=a;q.onload=function(){clearTimeout(e);e=setTimeout(g.bind(null,"Plugin handshake timeout for: "+a),5E3)};q.sandbox="allow-scripts allow-same-origin";q.style.width=q.style.height="100%";q.frameBorder=0;(f||v).appendChild(q);p.target=q.contentWindow;
p.connected=function(){clearTimeout(e)};p.close=function(){clearTimeout(e);if(q){var a=q.parentNode;a&&a.removeChild(q);q=null}};s.push(p);return p},disconnect:function(a){for(var d=0;d<s.length;d++)if(a===s[d]){s.splice(d,1);try{a.close()}catch(f){}break}},removePlugin:function(a){for(var d=0;d<m.length;d++)if(a===m[d]){m.splice(d,1);break}t.removeItem("plugin."+a.getLocation())},persist:function(a,d){t.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?
a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{w.dispatchEvent(a)}catch(d){console&&console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new l,f=C.connect(a,function(a){f&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],C.disconnect(f),f=null,d.resolve(a)):"timeout"===a.method&&(C.disconnect(f),f=null,d.reject(a.error)))});return d.promise},getState:function(){return y},handleServiceError:function(a,f){if(f&&401===f.status){var b=a.getHeaders(),
g=a.getName()||a.getLocation(),p=document.createElement("span");p.appendChild(document.createTextNode("Authentication required for: "+g+"."));b.login&&(p.appendChild(document.createTextNode(" ")),g=document.createElement("a"),g.target="_blank",g.textContent="Login",g.href=b.login,d.test(g.href)?(p.appendChild(g),p.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(p)}}if(f.__isError){var e=
f;f=Error(e.message);Object.keys(e).forEach(function(a){f[a]=e[a]});delete f.__isError}return f}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=C.getState;this.init=function(){if(!("starting"===y||"active"===y||"stopping"===y)){addEventListener("message",h,!1);for(var a=[],d=0,b=t.length;d<b;d++)a.push(t.key(d));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var d=a.substring(7);a=JSON.parse(t.getItem(a));a.created&&m.push(new f(d,a,C))}});m.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});g.parent?v=g.parent:(v=document.createElement("div"),g.visible||(v.style.display="none",v.style.visibility="hidden"),document.body.appendChild(v));g.plugins&&Object.keys(g.plugins).forEach(function(a){a=k(a);var d=this.getPlugin(a);d?d._default=!0:(d=g.plugins[a],"object"!==typeof d&&(d={}),d.autostart=d.autostart||g.defaultAutostart||
"lazy",d=new f(a,d,C),d._default=!0,m.push(d))}.bind(this));y="starting"}};this.start=function(){"starting"!==y&&this.init();if("starting"!==y)return(new l).reject("Cannot start framework. Framework is already "+y+".");var a=[],d=(new Date).getTime();m.forEach(function(f){var b=f._getAutostart();0===f.getLastModified()?a.push(f.update().then(function(){if("started"===b)return f.start({"transient":!0});if("lazy"===b)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===b?a.push(f.start({"transient":!0})):
"lazy"===b?(a.push(f.start({lazy:!0,"transient":!0})),d>f.getLastModified()+864E5&&f.update()):f._resolve()});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){y="active"})};this.stop=function(){if("starting"!==y&&"active"!==y)return(new l).reject("Cannot stop registry. Registry is already "+y+".");y="stopping";var a=[];m.forEach(function(d){a.push(d.stop({"transient":!0}))});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!g.parent){var a=
v.parentNode;a&&a.removeChild(v)}v=null;removeEventListener("message",h);y="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new l).reject("Cannot uninstall registry")};this.installPlugin=function(a,d){a=k(a);var g=this.getPlugin(a);if(g)return(new l).resolve(g);if(z[a])return z[a];if(d)return g=new f(a,d,C),m.push(g),g._persist(),C.dispatchEvent(new b("installed",g)),(new l).resolve(g);var p=C.loadManifest(a).then(function(d){g=new f(a,
d,C);m.push(g);g._persist();delete z[a];C.dispatchEvent(new b("installed",g));return g},function(d){delete z[a];throw d;});return z[a]=p};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var d=null;a=k(a);m.some(function(f){if(a===f.getLocation())return d=f,!0});return d};this.addEventListener=w.addEventListener.bind(w);this.removeEventListener=w.removeEventListener.bind(w);this.resolvePlugins=function(){var a=!0;m.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/objects",[],function(){function l(l){for(var m=Object.prototype.hasOwnProperty,k=1,e=arguments.length;k<e;k++){var h=arguments[k],g;for(g in h)m.call(h,g)&&(l[g]=h[g])}return l}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var m=Object.create(Object.getPrototypeOf(n));l(m,n);return m},mixin:l,toArray:function(l){return Array.isArray(l)?l:[l]}}});
define("orion/serviceTracker",[],function(){function l(k,e){function h(d){var f=d.getProperty("service.id"),g=this.addingService(d);g&&(b[f]=d,a[f]=g)}function g(d){var f=d.getProperty("service.id"),g=a[f];delete b[f];delete a[f];this.removedService(d,g)}this.serviceRegistry=k;var b={},a={},f=n,d,p;this.close=function(){if(f!==m)throw"Already closed";f=n;k.removeEventListener("registered",d);k.removeEventListener("unregistering",p);p=d=null;var a=this;this.getServiceReferences().forEach(function(d){g.call(a,
d)});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(f!==n)throw"Already open";f=m;var a=this;d=function(d){if(-1!==d.serviceReference.getProperty("objectClass").indexOf(e)&&(h.call(a,d.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(d.serviceReference,a.serviceRegistry.getService(d.serviceReference))};p=function(d){-1!==d.serviceReference.getProperty("objectClass").indexOf(e)&&
g.call(a,d.serviceReference)};k.addEventListener("registered",d);k.addEventListener("unregistering",p);k.getServiceReferences(e).forEach(function(d){h.call(a,d);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(d,k.getService(d))});if("function"===typeof this.onOpen)this.onOpen()}}var n=0,m=1;l.prototype={addingService:function(k){return this.serviceRegistry.getService(k)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(k,e){}};return l});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(l,n,m,k){var e=m.PreferencesService,h,g,b,a,f=e.DEFAULT_SCOPE,d="pid",p="/cm/configurations";h=function(a,f,b){function g(a,d,b){d.forEach(function(g,p){try{var e=a[p].getProperty("__plugin__"),q=e&&f.getPlugin(e);(!e||q&&"active"===q.getState())&&d[p].updated(b)}catch(h){"undefined"!==typeof console&&console.log(h)}})}k.call(this,a,"orion.cm.managedservice");var p={},e={},h=function(f){var g=
[];f.plugin.getServiceReferences().forEach(function(f){if(-1!==f.getProperty("objectClass").indexOf("orion.cm.managedservice")){var r=f.getProperty(d);f=a.getService(f);r&&f&&(r=(r=b._find(r))&&r.getProperties(),g.push(f.updated(r)))}});return l.all(g)};this.addingService=function(f){var b=f.getProperty(d),g=a.getService(f);if(!b||!g)return null;p[b]||(p[b]=[]);e[b]||(e[b]=[]);p[b].push(f);e[b].push(g);return g};this.onServiceAdded=function(a,f){var p=a.getProperty(d),p=b._find(p);g([a],[f],p&&p.getProperties())};
this.onOpen=function(){f.addEventListener("started",h)};this.onClose=function(){f.removeEventListener("started",h)};this.notifyUpdated=function(a){var d=a.getPid();g(p[d]||[],e[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();g(p[a]||[],e[a]||[],null)};this.removedService=function(a,f){var b=a.getProperty(d),g=p[b],A=e[b];1<g.length?g.splice(g.indexOf(a),1):delete p[b];1<A.length?A.splice(A.indexOf(f),1):delete e[b]}};m=function(){function a(d,f,p){this.store=new g(this,p);this.configAdmin=
new b(this,this.store);this.tracker=new h(d,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(d){a.tracker.open();return d})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(d,f){this.factory=d;this.store=f}a.prototype={_prefName:p,_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,f)},listConfigurations:function(){return this.store.list()}};return a}();g=function(){function b(a,d){this.factory=a;this.prefsService=d;this.pref=this.configs=this.defaultConfigs=null;var g=this;this.initPromise=l.all([this.prefsService.getPreferences(p,f),this.prefsService.getPreferences(p)]).then(function(a){var d=a[0];g.pref=a[1];g.defaultConfigs=g._toConfigs(d,!0);g.configs=g._toConfigs(g.pref,!1,d)})}b.prototype={_toConfigs:function(f,
b,g){var p=Object.create(null),e=this;f.keys().forEach(function(q){if(!p[q]){var h=f.get(q),k=g&&g.get(q);"object"===typeof h&&(null!==h&&0<Object.keys(h).length)&&(h[d]=q,p[q]=new a(e.factory,e,h,b,k))}});return p},_init:function(){return this.initPromise},_find:function(a,d){return d===e.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(d){var b=this._find(d),g=this._find(d,f);b||(b=g&&g.getProperties(!0),b=new a(this.factory,this,d,!1,b),this.configs[d]=b);return b},
list:function(){var a=this,d=[];this.pref.keys().forEach(function(f){(f=a._find(f))&&null!==f.getProperties()&&d.push(f)});return d},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,d){var b=d.getProperties(!0)||{},g=this._find(a,f);if(g){var p=g.getProperties(!0);Object.keys(p).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a)&&b[a]===p[a]&&delete b[a]})}this.pref.put(a,b)}};return b}();a=function(){function a(f,b){b=n.clone(b);delete b[d];f.properties=b}
function f(b,g,p,e,h){this.factory=b;this.store=g;this.readOnly=e;if(null!==p&&"object"===typeof p)this.pid=p[d],a(this,p);else if("string"===typeof p)this.pid=p,this.properties=null;else throw Error("Invalid pid/properties "+p);if(h){var k=this;Object.keys(h).forEach(function(a){a===d||Object.prototype.hasOwnProperty.call(k.properties,a)||(k.properties[a]=h[a])})}}f.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 f=null;this.properties&&(f=n.clone(this.properties),a||(f[d]=this.pid));return f},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(d){this._checkReadOnly();this._checkRemoved();a(this,d);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+
this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return f}();return{ConfigurationAdminFactory:m}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(l,n,m,k,e,h){var g;return{startup:function(){if(g)return g;g=new n;var b=new m.ServiceRegistry,a=new k.PreferencesService(b);return a.getPreferences("/plugins").then(function(f){var d={plugins:{}};f.keys().forEach(function(a){var b=l.toUrl(a);d.plugins[b]=f[a]});var p=new e.PluginRegistry(b,d);return p.start().then(function(){if(0<b.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=l.toUrl(a);p.getPlugin(a)||d.push(p.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return n.all(d,function(a){console.log(a)})})}).then(function(){return(new h.ConfigurationAdminFactory(b,p,a)).getConfigurationAdmin().then(b.registerService.bind(b,"orion.cm.configadmin"))}).then(function(){var a=b.getService("orion.core.auth");if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return d}}).then(function(){var d={serviceRegistry:b,preferences:a,pluginRegistry:p};g.resolve(d);return d})})}}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/util",[],function(){var l=navigator.userAgent,n=-1!==l.indexOf("MSIE")||-1!==l.indexOf("Trident")?document.documentMode:void 0,m=parseFloat(l.split("Firefox/")[1]||l.split("Minefield/")[1])||void 0,k=-1!==l.indexOf("Opera")?parseFloat(l.split("Version/")[1]):void 0,e=parseFloat(l.split("Chrome/")[1])||void 0,h=-1!==l.indexOf("Safari")&&!e,g=parseFloat(l.split("WebKit/")[1])||void 0,b=-1!==l.indexOf("Android"),a=-1!==l.indexOf("iPad"),l=-1!==l.indexOf("iPhone"),f=a||l,d=-1!==navigator.platform.indexOf("Mac"),
p=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),u="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return d[(f<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:n,isFirefox:m,isOpera:k,isChrome:e,isSafari:h,isWebkit:g,isAndroid:b,isIPad:a,isIPhone:l,
isIOS:f,isMac:d,isWindows:p,isLinux:q,isTouch:u,platformDelimiter:p?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(l){function n(a,f){f||(f=document);return f.querySelectorAll(a)}function m(a){var f=a.tabIndex;0===f&&l.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&&(f=-1);return f}function k(a){if(0<=m(a))return a;if(a.hasChildNodes())for(var f=0;f<a.childNodes.length;f++){var d=k(a.childNodes[f]);if(d)return d}return null}function e(a){if(0<=
m(a))return a;if(a.hasChildNodes())for(var f=a.childNodes.length-1;0<=f;f--){var d=e(a.childNodes[f]);if(d)return d}return null}function h(a,f){if(3===a.nodeType){var d=g.exec(a.nodeValue);d&&1<d.length&&f(a,d)}if(a.hasChildNodes())for(d=0;d<a.childNodes.length;d++)h(a.childNodes[d],f)}var g=/\$\{([^\}]+)\}/,b=null;return{$:function(a,f){f||(f=document);return f.querySelector(a)},$$:n,$$array:function(a,f){return Array.prototype.slice.call(n(a,f))},node:function(a){var f=a;"string"===typeof a&&(f=
document.getElementById(a));return f},contains:function(a,f){if(!a||!f)return!1;if(a===f)return!0;var d=a.compareDocumentPosition(f);return Boolean(d&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:k,lastTabbable:e,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,f){h(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(f[b[1]]||b[1]),a)})},processDOMNodes:function(a,f){h(a,function(a,b){var g=f[b[1]];if(g){var e=document.createRange(),h=b.index;e.setStart(a,h);e.setEnd(a,h+b[0].length);e.deleteContents();e.insertNode(g)}})},addAutoDismiss:function(a,f){function d(a){b.forEach(function(d){var f=!1,b=d.excludeNodes.some(function(d){return document.body.contains(d)?(f=!0,d.contains(a.target)):
!1});if(f&&!b)try{d.dismiss(a)}catch(g){"undefined"!==typeof console&&console&&console.error(g&&g.message)}});b=b.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===b&&(b=[],document.addEventListener("click",d,!0),l.isIOS&&document.addEventListener("touchend",function(a){function d(){a.target.removeEventListener("click",d)}0===a.touches.length&&a.target.addEventListener("click",d)},!1));b.push({excludeNodes:a,dismiss:f})},setFramesEnabled:function(a){for(var f=
document.getElementsByTagName("iframe"),d=0;d<f.length;d++)f[d].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){b=b.filter(function(f){return a!==f.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(l){var n,m,k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,h=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,g="undefined"!==typeof location&&location.href,b=g&&location.protocol&&location.protocol.replace(/\:/,""),a=g&&location.hostname,f=g&&(location.port||void 0),d=[],p=l.config&&l.config()||{};n={version:"2.0.5",strip:function(a){if(a){a=a.replace(e,"");var d=a.match(h);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,d,f;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(d=0;3>d;d+=1){f=k[d];try{a=new ActiveXObject(f)}catch(b){}if(a){k=[f];break}}return a},parseName:function(a){var d,
f,b=!1,g=a.indexOf(".");d=0===a.indexOf("./")||0===a.indexOf("../");-1!==g&&(!d||1<g)?(d=a.substring(0,g),f=a.substring(g+1,a.length)):d=a;a=f||d;g=a.indexOf("!");-1!==g&&(b="strip"===a.substring(g+1),a=a.substring(0,g),f?f=a:d=a);return{moduleName:d,ext:f,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,f,b){var g,p;g=n.xdRegExp.exec(a);if(!g)return!0;a=g[2];g=g[3];g=g.split(":");p=g[1];g=g[0];return(!a||a===d)&&(!g||g.toLowerCase()===f.toLowerCase())&&(!p&&!g||p===b)},finishLoad:function(a,
f,b,g){b=f?n.strip(b):b;p.isBuild&&(d[a]=b);g(b)},load:function(d,e,h,k){if(k.isBuild&&!k.inlineText)h();else{p.isBuild=k.isBuild;var l=n.parseName(d);k=l.moduleName+(l.ext?"."+l.ext:"");var m=e.toUrl(k),s=p.useXhr||n.useXhr;!g||s(m,b,a,f)?n.get(m,function(a){n.finishLoad(d,l.strip,a,h)},function(a){h.error&&h.error(a)}):e([k],function(a){n.finishLoad(l.moduleName+"."+l.ext,l.strip,a,h)})}},write:function(a,f,b,g){d.hasOwnProperty(f)&&(g=n.jsEscape(d[f]),b.asModule(a+"!"+f,"define(function () { return '"+
g+"';});\n"))},writeFile:function(a,d,f,b,g){d=n.parseName(d);var p=d.ext?"."+d.ext:"",e=d.moduleName+p,h=f.toUrl(d.moduleName+p)+".js";n.load(e,f,function(d){d=function(a){return b(h,a)};d.asModule=function(a,d){return b.asModule(a,h,d)};n.write(a,e,d,g)},g)}};if("node"===p.env||!p.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)m=require.nodeRequire("fs"),n.get=function(a,d){var f=m.readFileSync(a,"utf8");0===f.indexOf("\ufeff")&&(f=f.substring(1));d(f)};else if("xhr"===
p.env||!p.env&&n.createXhr())n.get=function(a,d,f,b){var g=n.createXhr(),e;g.open("GET",a,!0);if(b)for(e in b)b.hasOwnProperty(e)&&g.setRequestHeader(e.toLowerCase(),b[e]);if(p.onXhr)p.onXhr(g,a);g.onreadystatechange=function(b){4===g.readyState&&(b=g.status,399<b&&600>b?(b=Error(a+" HTTP status: "+b),b.xhr=g,f(b)):d(g.responseText))};g.send(null)};else if("rhino"===p.env||!p.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(a,d){var f,b,g=new java.io.File(a),p=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),e="";try{f=new java.lang.StringBuffer;(b=g.readLine())&&(b.length()&&65279===b.charAt(0))&&(b=b.substring(1));for(null!==b&&f.append(b);null!==(b=g.readLine());)f.append(p),f.append(b);e=String(f.toString())}finally{g.close()}d(e)};return n});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(l,n,m){return{slideoutHTMLFragment:function(k){var e=document.createElement("div");e.innerHTML=m;var h=n.$("#slideContainer",e);h.id=k+h.id;h=n.$("#pageCommandParameters",e);h.id=k+h.id;h=n.$("#pageCommandDismiss",e);h.id=k+h.id;return e.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(l){function n(k,e,h,g,b,a){this.type=a||"keydown";this.keyCode="string"===typeof k&&"keydown"===this.type?k.toUpperCase().charCodeAt(0):k;this.mod1=void 0!==e&&null!==e?e:!1;this.mod2=void 0!==h&&null!==h?h:!1;this.mod3=void 0!==g&&null!==g?g:!1;this.mod4=void 0!==b&&null!==b?b:!1}function m(k){this.keys=k}n.prototype={getKeys:function(){return[this]},match:function(k,e){if(void 0!==e){if(0!==e)return!1}else if(k instanceof Array){if(1<k.length)return!1;
k=k[0]}return k.type!==this.type?!1:this.keyCode===k.keyCode||this.keyCode===String.fromCharCode(l.isOpera?k.which:void 0!==k.charCode?k.charCode:k.keyCode)?this.mod1!==(l.isMac?k.metaKey:k.ctrlKey)||"keydown"===this.type&&this.mod2!==k.shiftKey||this.mod3!==k.altKey||l.isMac&&this.mod4!==k.ctrlKey?!1:!0:!1},equals:function(k){return!k||this.keyCode!==k.keyCode||this.mod1!==k.mod1||this.mod2!==k.mod2||this.mod3!==k.mod3||this.mod4!==k.mod4||this.type!==k.type?!1:!0}};m.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(k,e){var h=this.keys;if(void 0!==e)return e>h.length?!1:h[e].match(k)?e===h.length-1?!0:e+1:!1;k instanceof Array||(k=[k]);if(k.length>h.length)return!1;var g;for(g=0;g<k.length;g++)if(!h[g].match(k[g]))return!1;return g===h.length?!0:g},equals:function(k){if(!k.keys||k.keys.length!==this.keys.length)return!1;for(var e=0;e<k.keys.length;e++)if(!k.keys[e].equals(this.keys[e]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:m}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(l,n,m){function k(g){m.attach(this);this._init(g)}function e(g,b){var a=document.createElement(void 0===b?"span":b);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var f=document.createElement("span");f.appendChild(document.createTextNode(g));f.classList.add("dropdownCommandName");a.appendChild(f);f=document.createElement("li");f.appendChild(a);return f}function h(){var g=document.createElement("li");
g.classList.add("dropdownSeparator");return g}k.prototype={_init:function(g){this._dropdownNode=n.node(g.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=g.populate;this._selectionClass=g.selectionClass;this._parentDropdown=g.parentDropdown;this._positioningNode=g.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=g.triggerNode?g.triggerNode:n.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!g.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(f){a.toggle(f)&&n.stop(f)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(f){if(f.keyCode===n.KEY.ENTER||f.keyCode===n.KEY.SPACE)a.toggle(),n.stop(f)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(g){var b=this;g.addEventListener("click",function(a){b.toggle(a)&&n.stop(a)},!1)},toggle:function(g){return this.isVisible()?this.close():this.open(g)},isVisible:function(){return this._isVisible},open:function(g){var b=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:g}),n.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),b=n.$$array(".dropdownSubMenu",this._dropdownNode),n.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(g),this._focusDropdownNode(),
b=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return b},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(g){if(this.close(!1)&&this._dropdownNode.contains(g.target))for(g=this._parentDropdown;g;)g.close(!1),g=g._parentDropdown},_positionDropdown:function(g){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{g=n.bounds(this._dropdownNode);
var b=n.bounds(document.body);if(g.left+g.width>b.left+b.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-g.width+"px";else{var a=n.bounds(this._boundingNode(this._triggerNode)),f=n.bounds(this._triggerNode);this._dropdownNode.style.left=f.left-a.left-g.width+f.width+"px"}g=g.top+g.height-(b.top+b.height);0<g&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-g)+"px")}},_boundingNode:function(g){var b=window.getComputedStyle(g,null);
return null===b||"absolute"===b.getPropertyValue("position")||!g.parentNode||g===document.body?g:this._boundingNode(g.parentNode)},close:function(g){var b=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),g&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),b=!0);return b},getItems:function(){var g=[],b=this;n.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===b._dropdownNode&&g.push(a)});g.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(f){a.dropdown?a.dropdown.open(f):(b._closeSelectedSubmenu(),n.stop(f));b._selectItem(a)}),a._hasDropdownMouseover=!0)});return g},empty:function(){var g=this;n.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===
g._dropdownNode&&b.parentNode.removeChild(b)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(g){if(g.keyCode===n.KEY.UP||g.keyCode===n.KEY.DOWN||g.keyCode===n.KEY.RIGHT||g.keyCode===n.KEY.ENTER||g.keyCode===n.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&&(g.keyCode===n.KEY.UP&&0<a?(a--,this._selectItem(b[a])):g.keyCode===n.KEY.DOWN&&a<b.length-1?(a++,this._selectItem(b[a])):
g.keyCode===n.KEY.ENTER||g.keyCode===n.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):g.keyCode===n.KEY.ENTER&&this._selectedItem.click():g.keyCode===n.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(b[0]);n.stop(g)}}else g.keyCode===
n.KEY.ESCAPE&&(this.close(!0),n.stop(g))},_selectItem:function(g){if(g=g||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=g,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(g){g!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=g)},_closeSelectedSubmenu:function(){for(var g=this._selectedSubmenu;g;)g.close(),
g=g._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&n.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(g,b){var a=e(g,b);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var g=h();this._dropdownNode.appendChild(g);return g}};k.prototype.constructor=k;return{Dropdown:k,appendKeyBindingString:function(g,b){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(b));g.appendChild(a)},
createMenuItem:e,createSeparator:h}});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(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){this._node=n.node(k.node);if(!this._node)throw"no dom node for tooltip found";this._position=k.position||["right","above","below","left"];this._text=k.text;this._hideDelay=void 0===k.hideDelay?200:k.hideDelay;this._tailSize=k.tailSize||10;this._trigger=k.trigger||"mouseover";this._afterShowing=k.afterShowing;this._afterHiding=k.afterHiding;var e=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(g){g.target===e._node&&(e.show(),n.stop(g))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===k.showDelay?500:k.showDelay;k=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(g){n.contains(e._node,g.target)&&(e.show(),n.stop(g))},!1);this._leaveHandler=function(g){n.contains(e._node,g.target)&&e.hide()};for(var h=0;h<k.length;h++)this._node.addEventListener(k[h],
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 k=document.createTextNode(this._text);this._tipTextContent.appendChild(k)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var e=this;n.addAutoDismiss([this._tip,this._node],function(){e.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(h){e._timeout&&(window.clearTimeout(e._timeout),e._timeout=null);e._tip.addEventListener("mouseout",function(g){n.contains(e._tip,g.target)&&(e.hide(),n.stop(g))},
!1)},!1))}return this._tip},_positionTip:function(k,e){this._makeTipNode();"left"===k?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,g;for(g=n.bounds(h);h&&!g.width&&!g.height;h=h.parentNode)g=n.bounds(h);var h=n.bounds(this._tipInner),b;switch(k){case "above":b=g.top-h.height-this._tailSize-1;g=g.left-this._tailSize;break;case "below":b=g.top+g.height+this._tailSize+1;g=g.left-this._tailSize;break;case "left":b=g.top-this._tailSize/2;g=g.left-h.width-
this._tailSize-1;break;default:b=g.top-this._tailSize/2,g=g.left+g.width+this._tailSize+1}var a=n.bounds(document.documentElement);if(b+h.height>a.height)if(e)b=a.height-h.height-1;else return!1;if(g+h.width>a.width)if(e)g=a.width-h.width-1;else return!1;if(0>g)if(e)g=4;else return!1;if(0>b)if(e)b=4;else return!1;this._tail&&this._tail.previousPosition!==k&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
k),"above"===k||"left"===k?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=k);this._tip.style.top=b+"px";this._tip.style.left=g+"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 k=!1,e=0;!k&&e<this._position.length;)k=this._positionTip(this._position[e]),e++;k||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(k){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===k&&(k=this._hideDelay);var e=this;this._timeout=window.setTimeout(function(){e._tip.classList.remove("tooltipShowing");
e._tip.removeAttribute("style");e._afterHiding&&e._afterHiding()},k)}},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 k=["mouseout","click"],e=0;e<k.length;e++)this._node.removeEventListener(k[e],
this._leaveHandler,!1)}}};m.prototype.constructor=m;return{Tooltip:m}});
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(l,n,m,k,e,h,g,b){function a(a){var d=a.invocation;if(d){var f=a.command;if(f.hrefCallback)return a=f.hrefCallback.call(d.handler||window,d),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(d.commandRegistry)return d.commandRegistry._invoke(d),
!0;if(f.onClick||f.callback)return window.setTimeout(function(){(f.onClick||f.callback).call(d.handler||window,d)},0),!0}return!1}function f(d,f){for(var b in f)if(f[b]&&(f[b].keyBinding&&f[b].command)&&f[b].keyBinding.match(d)){var g=f[b],p=g.keyBinding;if((!p.domScope||n.contains(n.node(p.domScope),d.target))&&a(g)){n.stop(d);break}}}function d(){var a={};if(x){var d,f,b;f=Object.keys(s);for(d=0;d<f.length;d++)b=f[d],a[b]=s[b];var g=x();f=Object.keys(g);for(d=0;d<f.length;d++)b=f[d],a[b]=g[b]}else a=
s;return a}function p(a){f(a,d())}function q(a,d){a=a||window.event;if(function(a){if(l.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 f=a.target.nodeName.toLowerCase();if("input"===f)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"===f)return}d?d(a):p(a)}function u(){this._init()}
function t(a,d,f){d.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(b=document.createElement("span"),d.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,b.name=f,b.id=f,b.src=a.image,d.appendChild(b));return b}function y(a,d,f,b,g){this.commandRegistry=g;this.handler=a;this.items=d;this.userData=f;this.command=b;b.parameters&&(this.parameters=b.parameters.makeCopy());this.id=b.id}function v(a){this._init(a)}
var x=null,s={};u.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(d){return q(d,function(d){var f=a.proxy,b=a.bindings;if(b&&f)for(var g=0;g<b.length;g++)b[g].match(d)&&(f.processKey({type:d.type,keyCode:d.keyCode,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey}),n.stop(d))})})}};window.document.addEventListener("keydown",q,!1);y.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new y(this.handler,this.items,this.userData,this.command,this.commandRegistry);d.domNode=this.domNode;d.domParent=this.domParent;a?d.parameters=a.makeCopy():this.parameters&&(d.parameters=this.parameters.makeCopy());return d}};y.prototype.constructor=y;v.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,
d,f,b,g){f=this.getChoices(d,f,b);var p=f.some(function(a){return a.checked});f.forEach(function(f){if(f.name){var b=document.createElement("li");a.appendChild(b);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(p){var r=document.createElement("span");r.classList.add("check");r.appendChild(document.createTextNode(f.checked?"\u25cf":""));e.appendChild(r)}r=document.createTextNode(f.name);e.appendChild(r);b.appendChild(e);e.choice=f;e.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);e.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else g._generateMenuSeparator(a)})},getChoices:function(a,d,f){return this.choiceCallback?this.choiceCallback.call(d,a,f):null},makeChoiceCallback:function(a,d){return function(f){a.callback&&a.callback.call(a,d,f)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};v.prototype.constructor=v;return{Command:v,CommandInvocation:y,createDropdownMenu:function(a,d,f,b,g,p,h,q,u){a=n.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=u?l.createContextualFragment(e):l.createContextualFragment(k);n.processTextNodes(l,{ButtonText:d});a.appendChild(l);a=a.lastChild;
var y;u?(u=a.previousSibling,y=u.lastChild):u=a.previousSibling;b?u.classList.add(b):(u.classList.add("orionButton"),u.classList.add("commandButton"));g&&(p||(u.textContent="",u.setAttribute("aria-label",d)),t({spriteClass:"commandSprite",imageClass:g},u,d),u.classList.add("orionButton"));u.dropdown=new m.Dropdown({dropdown:a,populate:f,selectionClass:h,skipTriggerEventListeners:!!y,positioningNode:q});a.dropdown=u.dropdown;return{menuButton:u,menu:a,dropdown:u.dropdown,dropdownArrow:y}},createCheckedMenuItem:function(a,
d,f,b){a=n.node(a);if(!a)throw"no parent node was specified";var p=document.createRange();p.selectNode(a);p=p.createContextualFragment(g);n.processTextNodes(p,{ItemText:d});a.appendChild(p);a=n.$(".checkedMenuItem",a.lastChild);a.checked=f;a.addEventListener("change",b,!1);return a},createCommandItem:function(a,d,f,g,p,e,h){var q;e=e||!d.name&&d.hasImage();if(d.hrefCallback)q=document.createElement("a"),q.id=g,e&&d.hasImage()?t(d,q,g):(q.className="commandLink",q.appendChild(document.createTextNode(d.name))),
h=d.hrefCallback.call(f.handler,f),h.then?h.then(function(a){q.href=a}):q.href=h?h:"#";else{q=document.createElement("button");q.className="orionButton";d.extraClass&&q.classList.add(d.extraClass);e?d.hasImage()?(t(d,q,g),d.name&&q.setAttribute("aria-label",d.name)):(q.classList.add("commandButton"),q.classList.add("commandMissingImageButton"),q.appendChild(document.createTextNode(d.name))):(q.classList.add("commandButton"),g=document.createTextNode(d.name),q.appendChild(g));var k=h||d.callback;k&&
(d.onClick=k,q.addEventListener("click",function(a){k.call(f.handler,f)},!1))}"ul"===a.nodeName.toLowerCase()?(h=document.createElement("li"),a.appendChild(h),a=h):q.classList.add("commandMargins");a.appendChild(q);d.tooltip&&(q.commandTooltip=new b.Tooltip({node:q,text:d.tooltip,position:["above","below","right","left"]}));p&&(s[d.id]={keyBinding:p,command:d,invocation:f});return q},createCommandMenuItem:function(a,d,f,g,p,e){var h,q,k=a.dropdown;if(d.hrefCallback)q=m.createMenuItem(d.name,"a"),
h=q.firstElementChild,p=d.hrefCallback.call(f.handler,f),p.then?p.then(function(a){h.href=a}):h.href=p?p:"#",h.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&h.click()},!1);else{q=m.createMenuItem(d.name);h=q.firstElementChild;var u=p||d.callback;u&&(d.onClick=u,h.addEventListener("click",function(a){k.close(!0);u.call(f.handler,f)},!1),h.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)a.preventDefault(),h.click()},
!1))}d.tooltip&&(h.commandTooltip=new b.Tooltip({node:h,text:d.tooltip,position:["above","below","right","left"]}));e&&m.appendKeyBindingString(h,e);a.appendChild(q);g&&(s[d.id]={keyBinding:g,command:d,invocation:f});return h},executeBinding:a,setKeyBindingProvider:function(a){x=a},localKeyBindings:s,CommandsProxy:u,getKeyBindings:d,processKey:p,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:f}});define("orion/explorers/navigationUtils",[],function(){function l(l,k,e,h){!n&&l&&(l.push({domNode:k}),k.tabIndex=-1,k.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(m,k,e){m&&(m=m.getGridNavHolder(k,!0))&&l(m,e)},generateNavGrid:l,removeNavGrid:function(l,k){if(l)for(var e=0;e<l.length;e++)if(l[e].domNode===k){l.splice(e,1);break}}}});
define("orion/PageUtil",[],function(){var l=/^http[s]?/i;return{hash:function(){var l=window.location.href.split("#")[1];return l?"#"+l:""},matchResourceParameters:function(l){l=l||window.location.toString();var m={resource:""},k=l.indexOf("#");if(-1!==k&&(l=l.substring(k+1),0!==l.length)){l=l.split(",");m.resource=decodeURIComponent(l[0]);for(k=1;k<l.length;k++){var e=/([^=]*)(=?)(.*)/.exec(l[k]),h=decodeURIComponent(e[1]||""),e=decodeURIComponent(e[3]||"");""!==h&&"resource"!==h&&(m[h]=e)}}return m},
validateURLScheme:function(n,m){var k=n;if(-1===n.indexOf("://")){var e=document.createElement("a");e.href=n;k=e.href}e=!1;if(e=m?m.some(function(e){return RegExp("^"+e+":","i").test(k)}):l.test(k))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(l){function n(k){var e="",h=-1!==navigator.platform.indexOf("Mac");h?(k.mod4&&(e+="\u2303"),k.mod3&&(e+="\u2325"),k.mod2&&(e+="\u21e7"),k.mod1&&(e+="\u2318")):(k.mod1&&(e+="Ctrl+"),k.mod2&&(e+="Shift+"),k.mod3&&(e+="Alt+"));if(k.alphaKey)return e+k.alphaKey;if("keypress"===k.type)return e+k.keyCode;for(var g in l.KEY)if(typeof("number"===l.KEY[g])&&l.KEY[g]===k.keyCode){if(h)switch(l.KEY[g]){case l.KEY.BKSPC:g="\u232b";break;case l.KEY.TAB:g=
"\u21e5";break;case l.KEY.ENTER:g="\u23ce";break;case l.KEY.ESCAPE:g="\u238b";break;case l.KEY.SPACE:g="\u2423";break;case l.KEY.PAGEUP:g="\u21de";break;case l.KEY.PAGEDOWN:g="\u21df";break;case l.KEY.END:g="\u21f2";break;case l.KEY.HOME:g="\u21f1";break;case l.KEY.DEL:g="\u2326"}switch(l.KEY[g]){case l.KEY.DOWN:g="\u2193";break;case l.KEY.UP:g="\u2191";break;case l.KEY.RIGHT:g="\u2192";break;case l.KEY.LEFT:g="\u2190"}return e+g}var b;switch(k.keyCode){case 59:b=k.mod2?":":";";break;case 61:b=k.mod2?
"+":"\x3d";break;case 188:b=k.mod2?"\x3c":",";break;case 190:b=k.mod2?"\x3e":".";break;case 191:b=k.mod2?"?":"/";break;case 192:b=k.mod2?"~":"`";break;case 219:b=k.mod2?"{":"[";break;case 220:b=k.mod2?"|":"\\";break;case 221:b=k.mod2?"}":"]";break;case 222:b=k.mod2?'"':"'"}return b?e+b:112<=k.keyCode&&123>=k.keyCode?e+"F"+(k.keyCode-111):e+String.fromCharCode(k.keyCode)}function m(k){var e=-1!==window.navigator.platform.indexOf("Mac");return e&&k.metaKey||!e&&k.ctrlKey}return{getUserKeyString:function(k){var e=
"";k=k.getKeys();for(var h=0;h<k.length;h++)0!==h&&(e+=" "),e+=n(k[h]);return e},getUserText:function(k){var e=k.id,h=k.refNode,g=k.hideRefNode,b=k.initialText,a=k.onComplete,f=k.onEditDestroy,d=k.selectTo,p=k.isInitialValid;k=k.insertAsChild;var q=!1,u=function(d){return function(k){if(!q){var u=l.node(e),t=u.value;u&&(d&&k.keyCode===l.KEY.ESCAPE?(g&&(h.style.display="inline"),q=!0,u.parentNode.removeChild(u),f&&f()):d&&k.keyCode!==l.KEY.ENTER||(0===t.length||!p&&t===b?g&&(h.style.display="inline"):
(a(t),g&&h.parentNode&&(h.style.display="inline")),q=!0,u.parentNode&&u.parentNode.removeChild(u),f&&f()))}}},t=document.createElement("input");t.id=e;t.value=b||"";k?h.appendChild(t):h.parentNode.insertBefore(t,h.nextSibling);t.classList.add("userEditBoxPrompt");g&&(h.style.display="none");t.addEventListener("keydown",u(!0),!1);t.addEventListener("blur",u(!1),!1);window.setTimeout(function(){t.focus();if(b){var a=l.node(e),f=d?b.indexOf(d):-1;0<f?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",f),a.select()):a.setSelectionRange?a.setSelectionRange(0,f):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=f):a.select()}},0)},openInNewWindow:m,followLink:function(k,e){e&&m(e)?window.open(k):window.location=k},createButton:function(k,e){var h=document.createElement("button");h.className="orionButton commandButton commandMargins";h.addEventListener("click",function(g){e();l.stop(g)},!1);k&&h.appendChild(document.createTextNode(k));return h},
createDropdownButton:function(k,e,h){},isFormElement:function(k){switch(k.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(l,n,m,k,e,h,g,b,a,f){function d(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function p(a,d){this.token=a;this.parameterName=d}function q(a,d,f){this.event=a;this.handler=d;this.capture=f||!1}function u(a,d,f,b,g,p){this.name=a;this.type=d;this.label=f;this.value=b;this.lines=g||1;this.eventListeners=Array.isArray(p)?p:p?[p]:[]}function t(a,d,f){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=d&&d.clientCollect;this.getParameterElement=d&&d.getParameterElement;
this.getSubmitName=d&&d.getSubmitName}d.prototype={_init:function(a){this._selectionService=a.selection;var d=this;l.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var f=this._urlBindings[d].urlBinding.match(a);if(f){var b=this._urlBindings[d],g=b.command,p=b.invocation;if(p&&p.parameters&&g.callback){p.parameters.setValue(f.parameterName,f.parameterValue);
var e=this;window.setTimeout(function(){e._invoke(p)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,f,b,g,p){if(d){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback)return d=new l.CommandInvocation(f,d,g,a,this),d.domParent=p,this._invoke(d,b)}else if((p=this._urlBindings[a])&&p.command&&p.command.callback)return this._invoke(p.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,d,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,f))},confirm:function(a,d,f,b,g,p){var e=!1;if(this._parameterCollector&&!g){var r=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,g){var p=document.createElement("span");p.classList.add("parameterPrompt");p.textContent=d;a.appendChild(p);p=document.createElement("button");p.addEventListener("click",function(a){e=!0;r._parameterCollector.close()},
!1);g.appendChild(p);p.appendChild(document.createTextNode(f));p.className="dismissButton";var h=document.createElement("button");h.addEventListener("click",function(a){e=!1;r._parameterCollector.close()},!1);g.appendChild(h);h.appendChild(document.createTextNode(b));h.className="dismissButton";return p},function(){p(e)}))return}e=window.confirm(d);p(e)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,d,f){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){d=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(d=this._parameterCollector.collectParameters(a,f),!d)){var b=new g.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});d=
b.contentContainer();d.classList.add("parameterPopup");var p=window.document.activeElement,e=this._parameterCollector.getFillFunction(a,function(){p&&p.focus();b.destroy()},f)(d);b.show();window.setTimeout(function(){e.focus();e.select()},0);d=!0}if(!d)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,
d){this._collectAndInvoke(a,!0,d)},showKeyBindings:function(a){function d(a){return function(){l.executeBinding(a)}}var f={},b,g,p=[],e;for(e in this._activeBindings)(g=this._activeBindings[e])&&(g.keyBinding&&g.command&&(g.command.name||g.command.tooltip))&&p.push(g);p.sort(function(a,d){return(a.command.name||a.command.tooltip).localeCompare(d.command.name||d.command.tooltip)});for(e=0;e<p.length;e++)g=p[e],g.keyBinding.scopeName?(f[g.keyBinding.scopeName]||(f[g.keyBinding.scopeName]=[]),f[g.keyBinding.scopeName].push(g)):
(b=k.getUserKeyString(g.keyBinding),a.createItem(b,g.command.name||g.command.tooltip,d(g)));for(var r in f)f[r].length&&0<f[r].length&&(a.createHeader(r),f[r].forEach(function(f){b=k.getUserKeyString(f.keyBinding);a.createItem(b,f.command.name||f.command.tooltip,d(f))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var f=this;d.forEach(function(d){f._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
d,f,b,g,p,e,r,h,D){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,g));a[d]?(b&&(a[d].title=b),f&&(a[d].position=f),e&&(a[d].imageClass=e),r&&(a[d].tooltip=r),h&&(a[d].selectionClass=h),!0===D?a[d].pretendDefaultActionId=!0:a[d].defaultActionId=D,a[d].emptyGroupMessage=p):(a[d]={title:b,position:f,emptyGroupMessage:p,imageClass:e,tooltip:r,selectionClass:h,defaultActionId:!0===D?null:D,pretendDefaultActionId:!0===
D,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){1<d.length&&(a[d]||(a[d]={position:0,children:{}},a.sortedContributions=null),a=a[d].children)});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,d,f,b,g,p,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[d]={position:f};p&&((f=this._commandList[d])?this._addBinding(f,"key",p,g):this._addPendingBinding(d,"key",p,g));e&&((f=this._commandList[d])?this._addBinding(f,"url",e,g):this._addPendingBinding(d,"url",e,g));a.sortedContributions=null},unregisterCommandContribution:function(a,d,f){if(this._contributionsByScopeId[a]){delete this._commandList[d];delete this._activeBindings[d];delete this._urlBindings[d];delete this._pendingBindings[d];
var b=this._contributionsByScopeId[a];f&&f.split("/").forEach(function(a){1<a.length&&b[a]&&(b=b[a].children)});delete b[d];b.sortedContributions=null}},_addBinding:function(a,d,f,b){if(!a.id)throw Error("No command id: "+a);"key"===d?this._activeBindings[a.id]={command:a,keyBinding:f,bindingOnly:b}:"url"===d&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:b})},_addPendingBinding:function(a,d,f,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,
binding:f,bindingOnly:b})},_checkForTrailingSeparator:function(a,d,f){var b;if("tool"===d||"button"===d)if((b=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&b.classList.contains("commandSeparator"))return f?(a.removeChild(b),!1):!0;if("menu"===d&&(a=e.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(b=a[a.length-1],f)b.parentNode.parentNode.removeChild(b.parentNode);else return!0;return!1},renderCommands:function(a,d,f,b,g,p,h){if("string"!==
typeof a)throw"a scope id for rendering must be specified";d=e.node(d);if(!d)throw"no parent";var r=this._contributionsByScopeId[a];if(!f&&r){f=r.localSelectionService||this._selectionService;var A=this;f&&f.getSelections(function(f){A.renderCommands(a,d,f,b,g,p)})}else r&&(this._render(r,d,f,b,g||"button",p,h),this._checkForTrailingSeparator(d,g,!0))},destroy:function(a){a=e.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&
d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,d,f,b,p,e,h){var r=a.sortedContributions;if(!r){var r=[],A=!1,D;for(D in a)if(Object.prototype.hasOwnProperty.call(a,D)){var q=a[D];q&&"number"===typeof q.position&&(q.id=D,r.push(q),A=!0)}A&&(r.sort(function(a,d){return a.position-d.position}),a.sortedContributions=r)}var u=0,t=this;r.forEach(function(a){var r;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var A=
a.children;if("tool"===p||"button"===p)if(a.title){var q;a.defaultActionId&&((A=t._commandList[a.defaultActionId])&&(A.visibleWhen?A.visibleWhen(f):1)?(q=new l.CommandInvocation(b,f,e,A,t),q.domParent=d):a.pretendDefaultActionId=!0);A=t._createDropdownMenu(d,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,q,a.pretendDefaultActionId);h&&n.generateNavGrid(h,A.menuButton);A&&(t._render(a.children,A.menu,f,b,"menu",e,h),t._checkForTrailingSeparator(A.menu,"menu",!0),0===A.menu.childNodes.length?
a.emptyGroupMessage?A.menuButton.emptyGroupTooltip||(A.menuButton.emptyGroupTooltip=new g.Tooltip({node:A.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(h&&n.removeNavGrid(h,A.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(A.menu),a(A.menuButton),a(A.destroyButton)):A.menuButton.style.visibility="visible")}else{var D;0<d.childNodes.length&&!t._checkForTrailingSeparator(d,p)&&(D=t.generateSeparatorImage(d));t._render(A,d,
f,b,p,e,h);0<d.childNodes.length&&d.childNodes[d.childNodes.length-1]!==D&&(D=t.generateSeparatorImage(d))}else if(a.title){if(a=t._createDropdownMenu(d,a.title,!0,null,null,a.imageClass))t._render(A,a.menu,f,b,"menu",e,h),t._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&d.removeChild(a.destroyButton)}else 0<d.childNodes.length&&t._generateMenuSeparator(d),t._render(A,d,f,b,p,e,h),t._generateMenuSeparator(d)}else{var B=t._commandList[a.id],A=B?!0:!1;q=
a=null;if(B){r=new l.CommandInvocation(b,f,e,B,t);r.domParent=d;D=!1;try{D=A&&(B.visibleWhen?B.visibleWhen(f):!0)}catch(m){throw console.log(m),m;}t._activeBindings[B.id]&&t._activeBindings[B.id].keyBinding&&(a=t._activeBindings[B.id],a.invocation=D?r:null,a.bindingOnly&&(A=!1));t._urlBindings[B.id]&&t._urlBindings[B.id].urlBinding&&(q=t._urlBindings[B.id],q.invocation=D?r:null,q.bindingOnly&&(A=!1));A=A&&D}A&&(B.choiceCallback?("tool"===p||"button"===p?(a=d,A=!1,"ul"===d.nodeName.toLowerCase()&&
(a=document.createElement("li"),d.appendChild(a))):(a=d,A=!0),t._createDropdownMenu(a,B.name,A,function(a){B.populateChoicesMenu(a,f,b,e,t)}.bind(B),B.imageClass,B.tooltip||B.title,B.selectionClass,B.positioningNode)):(r.handler=r.handler||this,r.domParent=d,A=function(a){t._invoke(r)},"menu"===p?(q=null,a&&a.keyBinding&&(q=k.getUserKeyString(a.keyBinding)),a=l.createCommandMenuItem(d,B,r,null,A,q)):(a=p+B.id+u,a=l.createCommandItem(d,B,r,a,null,"tool"===p,A)),n.generateNavGrid(h,a),r.domNode=a,u++))}})},
_createDropdownMenu:function(a,d,b,p,q,k,u,r,A,D){a=e.node(a);if(!a||!e.contains(document.body,a))return null;var t,m,n=a;if(b)k=document.createRange(),k.selectNode(a),k=k.createContextualFragment(f),e.processTextNodes(k,{ButtonText:d}),a.appendChild(k),m=a.lastChild,q=m.lastChild,d=q.previousSibling,d.dropdown=new h.Dropdown({dropdown:q,populate:p,parentDropdown:a.dropdown}),q.dropdown=d.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(n=document.createElement("li"),a.appendChild(n),m=n);a=null;q&&
(a="dropdownButtonWithIcon",k=k||d);k=q?k||d:k;var L=l.createDropdownMenu(n,d,p,a,q,!1,u,r,A||D);t=L.dropdownArrow;d=L.menuButton;if(t){A&&(A.domNode=L.menuButton);var F=this;d.onclick=function(a){var d=e.bounds(t);a.clientX>=d.left&&L.dropdown?L.dropdown.toggle(a):F._invoke(A)};L.dropdown&&(d.onkeydown=function(a){e.KEY.DOWN===a.keyCode&&(L.dropdown.toggle(a),e.stop(a))})}q=L.menu;var G;(p=A&&A.command&&(A.command.tooltip||A.command.name))?G=A.command.tooltip||A.command.name:p&&(G=k);G&&(d.commandTooltip=
new g.Tooltip({node:d,text:G,position:["above","below","right","left"]}))}return{menuButton:d,menu:q,dropdown:d.dropdown,destroyButton:m,dropdownArrow:t}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");d.appendChild(f);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};d.prototype.constructor=d;p.prototype={match:function(a){a=m.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};p.prototype.constructor=p;q.prototype.constructor=q;u.prototype={optionsRequested:function(){return this.optionsRequested}};u.prototype.constructor=u;t.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[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,d){var f=this.parameterTable[a];
f&&(f.value=d)},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new u(d.name,d.type,d.label,d.value,d.lines,d.eventListeners);a.push(d)});var d=new t(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};t.prototype.constructor=t;return{CommandRegistry:d,URLBinding:p,
ParametersDescription:t,CommandParameter:u,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(l,n,m){function k(e,h){this._activeContainer=null;this._getElementsFunction=e;this._toolbarLayoutFunction=h}k.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&m.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&m.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(e,h,g){"string"===typeof e&&(e=m.node(e));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===e)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(e))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=g;var b=h(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!b)return!1;this._activeElements.focusNode=b;e=m.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===e.length){h=this._activeElements.dismissArea||
this._activeElements.parameterArea;e=document.createElement("button");e.id="closebox";e.className="imageSprite core-sprite-close dismissButton";e.title=l.Close;h.appendChild(e);var a=this;e.addEventListener("click",function(f){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(e,h){m.$$array("input",h).forEach(function(b){"checkbox"===b.type?e.parameters.setValue(b.parameterName,b.checked):"button"!==b.type&&e.parameters.setValue(b.parameterName,b.value.trim())});m.$$array("textArea",h).forEach(function(b){e.parameters.setValue(b.parameterName,b.value.trim())});var g=e.parameters.getParameterElement;g&&e.parameters.forEach(function(b){(b=g(b,h))&&("checkbox"===b.type?
e.parameters.setValue(b.parameterName,b.checked):"button"!==b.type?e.parameters.setValue(b.parameterName,b.value.trim()):"textarea"!==b.type&&e.parameters.setValue(b.parameterName,b.value.trim()))});e.command.callback&&e.command.callback.call(e.handler,e)},collectParameters:function(e,h){return e.parameters?(e.domNode&&e.domNode.classList.add("commandMarker"),this.open(e.domNode||e.domParent,this.getFillFunction(e,null,h))):!1},getFillFunction:function(e,h,g){var b=this;return function(a,f){var d=
null,p=function(){h&&h();b.close()},q=function(d){d.keyCode===m.KEY.ENTER&&(b._collectAndCall(e,a),p(),m.stop(d));d.keyCode===m.KEY.ESCAPE&&("function"===typeof g&&g(),p(),m.stop(d))},k=e.parameters;k.forEach(function(f){var b=k.getParameterElement?k.getParameterElement(f,a):null,g=null;!b&&f.label&&(g=document.createElement("label"),g.classList.add("parameterInput"),g.setAttribute("for",f.name+"parameterCollector"),g.textContent=f.label,a.appendChild(g));var h=f.name+"parameterCollector",g=g||a;
"text"===f.type&&"number"===typeof f.lines&&1<f.lines?(b||(b=document.createElement("textarea"),b.rows=f.lines,b.type="textarea",b.id=h,g.appendChild(b)),q=function(a){a.keyCode===m.KEY.ESCAPE&&(p(),m.stop(a))}):"boolean"===f.type?(b||(b=document.createElement("input"),b.type="checkbox",b.id=h,g.appendChild(b)),f.value&&(b.checked=!0)):(b||(b=document.createElement("input"),b.type=f.type,b.id=h,g.appendChild(b)),f.value&&(b.value=f.value));b.classList.add("parameterInput");b.setAttribute("speech",
"speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=f.name;d||(d=b);0<f.eventListeners.length&&f.eventListeners.forEach(function(a){b.addEventListener(a.event,function(d){return a.handler(d,e)},a.capture)});b.addEventListener("keydown",q,!1)});var t=f;t||(t=document.createElement("span"),t.classList.add("layoutRight"),t.classList.add("parametersDismiss"),a.appendChild(t));var y=function(a,d){var f=document.createElement("button");d.appendChild(f);a&&f.appendChild(document.createTextNode(a));
f.classList.add("dismissButton");return f};e.parameters.hasOptionalParameters()&&(e.parameters.optionsRequested=!1,y(l.More,t).addEventListener("click",function(){e.parameters.optionsRequested=!0;b._collectAndCall(e,a);p()},!1));y(k.getSubmitName?k.getSubmitName(e):l.Submit,t).addEventListener("click",function(){b._collectAndCall(e,a);p()},!1);t=y(null,t);t.id="closebox";t.classList.add("imageSprite");t.classList.add("core-sprite-close");t.title=l.Close;t.addEventListener("click",function(a){p();
"function"===typeof g&&g()},!1);return d}}};k.prototype.constructor=k;return{CommandParameterCollector:k}});define("orion/regex",[],function(){return{escape:function(l){return l.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(l){return(l=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(l))?{pattern:l[1],flags:l[2]}:null}}});
define("orion/contentTypes",[],function(){function l(a,d){if("string"!==typeof a)return null;for(var b=a&&a.split(".").pop(),g=null,e=0;e<d.length;e++){var h=d[e],k;a:{k=g;var l=h,m=b,n=0<=l.filename.indexOf(a),w;w=m.toLowerCase();w=-1!==l.extension.indexOf(w);if(n||w){if(!(w=!k))n&&(m=m.toLowerCase(),n=-1!==k.extension.indexOf(m)),w=n;if(w){k=l;break a}}}k===h&&(g=h)}return g}function n(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function m(a){return n(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function k(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:m(a.extension),filename:n(a.filename)}}function e(a){var d=Object.create(null);a.map(k).forEach(function(a){Object.prototype.hasOwnProperty.call(d,a.id)||(d[a.id]=a)});return d}function h(f){if(f&&f.registerService){this.serviceRegistry=f;for(var d=f.getServiceReferences(b).concat(f.getServiceReferences(a)),p=[],h=0;h<d.length;h++)for(var k=n(d[h].getProperty("contentTypes")),t=0;t<k.length;t++)p.push(k[t]);
this.map=e(p);f.registerService(g,this)}else if(Array.isArray(f))this.serviceRegistry=null,this.map=e(f);else throw Error("Invalid parameter");}var g="orion.core.contentTypeRegistry",b="orion.core.contenttype",a="orion.file.contenttype";h.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),d=[],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&d.push(a[b]);return d},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return l(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return l(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,d){a="string"===typeof a?this.getContentType(a):a;d="string"===typeof d?this.getContentType(d):d;if(!a||!d)return!1;if(a.id===d.id)return!0;for(var b=a,g={};b&&(b=this.getContentType(b["extends"]));){if(b.id===d.id)return!0;if(g[b.id])throw Error("Cycle: "+b.id);g[b.id]=!0}return!1},isSomeExtensionOf:function(a,d){for(var b=0;b<d.length;b++)if(this.isExtensionOf(a,
d[b]))return!0;return!1}};return{ContentTypeRegistry:h,getFilenameContentType:l}});
define("orion/URITemplate",[],function(){function l(a){this._text=a}function n(a){return a.replace("%25","%")}function m(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(f,n);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function k(a,f,b){for(var g=
[],e=0;e<a.length;e++)"undefined"!==typeof a[e]&&g.push(m(a[e],f));return g.join(b)}function e(a,f,b,g){for(var e=Object.keys(a),h=[],k=0;k<e.length;k++)"undefined"!==typeof a[e[k]]&&h.push(m(e[k],f)+b+m(a[e[k]],f));return h.join(g)}function h(d){if(0===d.length)throw Error("Invalid Expression: 0 length expression");(this._operator=b[d[0]])?d=d.substring(1):this._operator=b.NUL;for(var f=[],g=d.split(","),e=0;e<g.length;e++){var h=g[e].match(a);if(null===h)throw Error("Bad VarSpec: "+d);f.push({name:h[1],
explode:!!h[2],prefix:h[3]?parseInt(h[3],10):-1})}this._varSpecList=f}function g(a){for(var f=[],b=0,g=a.indexOf("{",b);-1!==g;){f.push(new l(a.substring(b,g)));b=a.indexOf("}",g+1);if(-1===b)throw Error("Invalid template: "+a);f.push(new h(a.substring(g+1,b)));b+=1;g=a.indexOf("{",b)}f.push(new l(a.substring(b)));this._templateComponents=f}var b={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\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]+))?$/,f=/%25[0-9A-F][0-9A-F]/g;l.prototype={expand:function(a){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var f=[],b=0;b<this._varSpecList.length;b++){var g=this._varSpecList[b],h=g.name,l=a[h],v=typeof l;if("undefined"!==v&&null!==l){var n=0===f.length?this._operator.first:this._operator.sep;if("string"===v)this._operator.named&&(n+=m(h,"U+R"),n+=0===l.length?this._operator.ifemp:"\x3d"),-1!==g.prefix&&g.prefix<l.length&&(l=l.substring(0,g.prefix)),n+=m(l,this._operator.allow);else if(Array.isArray(l)){if(0===l.length)continue;g.explode?n+=k(l,this._operator.allow,
this._operator.sep):(g=k(l,this._operator.allow,","),this._operator.named&&(n+=m(h,"U+R"),n+=0===g.length?this._operator.ifemp:"\x3d"),n+=g)}else if("object"===v){if(0===Object.keys(l).length)continue;g.explode?n+=e(l,this._operator.allow,"\x3d",this._operator.sep):(g=e(l,this._operator.allow,",",","),this._operator.named&&(n+=m(h,"U+R"),n+=0===g.length?this._operator.ifemp:"\x3d"),n+=g)}else throw Error("bad param type: "+h+" : "+v);f.push(n)}}return f.join("")}};g.prototype={expand:function(a){for(var f=
[],b=0;b<this._templateComponents.length;b++)f.push(this._templateComponents[b].expand(a));return f.join("")}};return g});
define("orion/i18nUtil",["require","orion/Deferred"],function(l,n){function m(e){if(e=localStorage.getItem("orion/messageBundle/"+e))if(e=JSON.parse(e),e._expires&&e._expires>(new Date).getTime())return delete e._expires,e;return null}var k={};return{getMessageBundle:function(e){function h(a){a?l(["i18n!"+e],function(a){if(a){var d=e;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+d,JSON.stringify(a));delete a._expires}b.resolve(a)}):g(Error(e))}function g(a){b.reject(a)}
if(k[e])return k[e];var b=new n;k[e]=b;var a=m(e);if(a)return b.resolve(a),b;try{l([e],h,g)}catch(f){l(["orion/i18n!"+e],h,g)}return b},formatMessage:function(e){var h=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(g,b){return h[(b<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(l,n,m,k,e,h,g){function b(){return l.toUrl?(new URL(l.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var d={};a.getPropertyKeys().forEach(function(f){"objectClass"!==f&&("service.names"!==f&&"service.id"!==f&&"__plugin__"!==f)&&(d[f]=a.getProperty(f))});return d}function f(a){return e.getMessageBundle(a.nls).then(function(d){a.textContent=
a.nameKey?d[a.nameKey]:a.name;return a},function(d){a.textContent=a.nameKey||a.name;return a})}function d(d,g){var e=d.getServiceReferences(g||"orion.page.link"),p=m.matchResourceParameters(window.location.href),h={OrionHome:b(),Location:p.resource},q=[];e.forEach(function(d){d=a(d);if(d.uriTemplate&&(d.nls||d.name)){var b=(new k(d.uriTemplate)).expand(h),b=m.validateURLScheme(b);d.href=b;d.nls?q.push(f(d)):(d.textContent=d.name,q.push((new n).resolve(d)))}});return n.all(q)}function p(a){var d=this.categories=
Object.create(null);a.forEach(function(a){d[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(u)}function u(a,d){var f=a.textContent&&a.textContent.toLowerCase(),b=d.textContent&&d.textContent.toLowerCase();return f<b?-1:f>b?1:0}var t;h.mixin(p.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var d=a.href;a=
a.textContent;var f=document.createElement("a");f.href=d;f.target="_self";f.classList.add("targetSelector");f.textContent=a;return f})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(d){var b;return!t?(b=[],d.getServiceReferences("orion.page.link.category").forEach(function(g){var e=a(g);if(e.id&&(e.name||e.nameKey))e.service=d.getService(g),e.nls?b.push(f(e)):(e.textContent=e.name,b.push((new n).resolve(e)))}),n.all(b).then(function(a){return t=new p(a)})):(new n).resolve(t)},
getPageLinksInfo:function(a,f){return d(a,f).then(function(a){return new q(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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
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(l,n,m,k,e,h,g,b,a,f){function d(a){var d={};a.getPropertyKeys().forEach(function(f){d[f]=a.getProperty(f)});return d}var p={},q=a.getOrionHome();p._cloneItemWithoutChildren=function v(a){if(null===a||"object"!==typeof a)return a;var d=a.constructor(),f;for(f in a)"children"!==f&&"Children"!==
f&&(d[f]=v(a[f]));return d};p._getOpenWithNavCommandExtensions=function(a,d){function f(a,d){for(var b=a.getServiceReferences("orion.navigate.openWith"),g=[],e=[],p=0;p<b.length;p++){var r=b[p];if(r.getProperty("editor")===d.id){var h=r.getProperty("contentType");h instanceof Array?g=g.concat(h):g.push(h||"*/*");r=r.getProperty("excludedContentTypes");r instanceof Array?e=e.concat(r):null!==r&&"undefined"!==typeof r&&e.push(r)}}0===g.length&&(g=null);0===e.length&&(e=null);return{contentTypes:g,excludedContentTypes:e}}
for(var b=function(){for(var d=a.getServiceReferences("orion.edit.editor"),f=[],b=0;b<d.length;b++){var g=d[b],e=g.getProperty("id");f.push({id:e,"default":g.getProperty("default")||!1,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||[]})}return f}(),g=[],e,p=0;p<b.length;p++){var h=b[p],D=f(a,h),D={properties:{name:h.name||h.id,nameKey:h.nameKey,
id:"eclipse.openWithCommand."+h.id,contentType:D.contentTypes,excludedContentTypes:D.excludedContentTypes,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:h["default"]?"default":"editor",validationProperties:h.validationProperties},service:{}};"orion.editor"===h.id?e=D:g.push(D)}e&&g.push(e);return g};p._makeValidator=function(a,d,f,b){function g(a,d,f,b,e){var p=!1,r;if("!"===d.charAt(0))return"undefined"===typeof a[d.substring(1)];if("undefined"!==typeof a[d]){if("undefined"===typeof f)r=
a[d],p=!0;else if("string"===typeof f){if(!typeof("string"===a[d]))return!1;if(b.variableName){if(f=RegExp(f).exec(a[d]))p=f[0],r="before"===b.variableMatchPosition?a[d].substring(0,f.index):"after"===b.variableMatchPosition?a[d].substring(f.index+p.length):"only"===b.variableMatchPosition?p:a[d],p=!0}else return RegExp(f).test(a[d])}else a[d]===f&&(r=a[d],p=!0);d=b.variableName;b=b.replacements;if(p&&d&&(e[d]=r,e.itemCached=a,b)){if("string"!==typeof r)return window.console.log("Cannot replace "+
d+", value is not a string: "+r),p;for(a=0;a<b.length;a++){r=!1;if(b[a].pattern){f=b[a].pattern;var h=b[a].replacement||"";e[d]=e[d].replace(RegExp(f),h).replace(RegExp(f),h)}else r=!0;r&&window.console.log("Invalid replacements specified in validation property.  "+b[a])}}return p}return!1}function p(a,d,f,b){var e=f.match,r,h;if(0<=(r=d.indexOf("["))){if(0>(h=d.indexOf("]")))return!1;var q=d.substring(0,r),k;if(!(k=a[q])||!Array.isArray(k))return!1;r=d.substring(r+1,h);r=parseInt(r,10);if(isNaN(r))return!1;
0>r&&(r+=k.length);d=d.substring(h+1);d=q+":"+String(r)+d}return 0<=d.indexOf("|")?(r=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),p(a,r,f,b)?!0:p(a,d,f,b)):0<=d.indexOf(":")?(r=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[r]?p(a[r],d,f,b):!1):g(a,d,e,f,b)}function r(d,f,b){if(b.info.validationProperties)for(var g=0;g<b.info.validationProperties.length;g++){var r=b.info.validationProperties[g];if("undefined"!==typeof r.source){if(!p(d,r.source,r,b))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var g=!0,h=f?e.getFilenameContentType(d.Name,f):null,h=h||{id:"application/octet-stream"};b.info.excludedContentTypes&&f&&(g=b.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!1:!0}));g&&(b.info.contentType&&f)&&(g=b.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!0:!1}));return g}return{info:a,validationFunction:function(a){"function"===typeof b&&(a=b.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 d=0;d<a.length;d++)if(!r(a[d],f,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},f;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(d[f]=a[f]);if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var b=this.info.validationProperties[f];
b.source&&b.variableName&&(this.itemCached===a&&this[b.variableName]||p(a,b.source,b,this),a[b.variableName]?window.console.log("Variable name "+b.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[b.variableName]=this[b.variableName])}d.OrionHome=q;return(new h(this.info.uriTemplate)).expand(d)}return null}}};var u=f.UnnamedCommand;p._createCommandOptions=function(a,d,f,b,e,h){function r(g,r){var q=p._makeValidator(a,f,b,h);g.visibleWhen=
q.validationFunction.bind(q);if(e)if(q.generatesURI.bind(q)())g.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return q.getURI.bind(q)(a)};else{var k=a;g.callback=function(a){var b;if(k.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,b=p._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){b=[];for(var e=0;e<a.items.length;e++)b.push(p._cloneItemWithoutChildren(a.items[e]))}else b=p._cloneItemWithoutChildren(a.items);if(f)var r=f.getService("orion.page.progress");
d.run?r?r.progress(d.run(b),"Running command: "+g.name):d.run(b):f&&(r?r.progress(f.getService(d).run(b),"Running command: "+g.name):f.getService(d).run(b))}}r.resolve(g)}var q=new n;if(a.nls){var k=function(d){var f;d?(f=a.tooltipKey&&d[a.tooltipKey],d=a.nameKey&&d[a.nameKey]||a.name||u,f=f||a.tooltip||""):(d=a.name||a.nameKey||u,f=a.tooltip||a.tooltipKey||"");r({name:d,image:a.image,id:a.id||a.name,tooltip:f,isEditor:a.isEditor,showGlobally:a.showGlobally},q)};g.getMessageBundle(a.nls).then(k,k.bind(this,
null))}else r({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},q);return q};p.getOpenWithCommand=function(a,d,f){var b;a=f||p.getOpenWithCommands(a);for(f=0;f<a.length;f++)if(a[f].visibleWhen(d)){var g="default"===a[f].isEditor;if(!b||g)if(b=a[f],g)break}return b};p.getOpenWithCommands=function(a){var d=[],f;for(f in a._commandList){var b=a._commandList[f];b.isEditor&&d.push(b)}return d};var t;p.createAndPlaceFileCommandsExtension=function(a,
d,b,g,e,h){return p.createFileCommands(a,null,h?"all":void 0,!!h,d).then(function(a){e&&0<a.length&&(d.addCommandGroup(b,"eclipse.openWith",1E3,f.OpenWith,e,null,null,null,"dropdownSelection"),d.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,f.OpenRelated,e));a.forEach(function(a){var f=null;e&&(f=a.isEditor?e+"/eclipse.openWith":e+"/eclipse.fileCommandExtensions");d.registerCommandContribution(b,a.id,g,f)});return{}})};p.createFileCommands=function(a,d,f,b,g){f=void 0===f?"global":f;b=void 0===
b?!0:b;var e=[];p._cachedFileCommands||p._createCachedFileCommands(a);("all"===f||"global"===f)&&p._cachedFileCommands.forEach(function(a){var d=a.properties;("all"===f||d.forceSingleItem&&d.showGlobally)&&e.push(a)});return n.when(function(){var f=a.getService("orion.core.contentTypeRegistry")||d;return t||n.when(f.getContentTypes(),function(a){return t=a})}(),function(){b&&(p._cachedOpenWithExtensions||(p._cachedOpenWithExtensions=p._getOpenWithNavCommandExtensions(a,t)),e=e.concat(p._cachedOpenWithExtensions),
g._addedOpenWithCommands=b);var d=e.map(function(d){var f=d.properties;d=d.service;var b=g.findCommand(f.id||f.name);return b?(new n).resolve(b):p._createCommandOptions(f,d,a,t,!0).then(function(a){a=new m.Command(a);g.addCommand(a);return a})});return n.all(d,function(a){return{_error:a}}).then(function(a){return a})})};p._createCachedFileCommands=function(a){var f=a.getServiceReferences("orion.navigate.command");p._cachedFileCommands=[];for(var b=0;b<f.length;b++)if("orion.navigateFromMetadata"!==
f[b].getProperty("id")){var g=a.getService(f[b]),e=d(f[b]);p._cachedFileCommands.push({properties:e,service:g})}};p.getFileCommandIds=function(){var a=[];if(p._cachedFileCommands)p._cachedFileCommands.length&&(a=p._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};p.createOpenWithCommands=function(a,d,f){return f&&f._addedOpenWithCommands?(new n).resolve(p.getOpenWithCommands(f)):p.createFileCommands(a,d,
"none",!0,f)};return p});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var e=n.node(k.container);if(!e)throw"no parent container";this._container=e;e.classList.remove("currentLocation");this._id=k.id||"eclipse.breadcrumbs";this._resource=k.resource||null;this._rootSegmentName=k.rootSegmentName;this._workspaceRootSegmentName=k.workspaceRootSegmentName;this._workspaceRootURL=k.workspaceRootURL;this._makeHref=k.makeHref;this._makeFinalHref=
k.makeFinalHref;this._maxLength=k.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var k;if(this._resource&&this._resource.Parents&&!this._resource.skip){k=document.createElement("a");var e=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(k,e):k.href=l.toUrl("edit/edit.html")+"#"+e}else k=document.createElement("span");n.empty(k);k.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return k}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(k){var e=document.createElement("a");e.classList.add("breadcrumb");e.appendChild(document.createTextNode(k));return e},addSegmentHref:function(k,e){this._makeHref?this._makeHref(k,e.Location,e):k.href=l.toUrl("edit/edit.html")+"#"+e.ChildrenLocation},buildSegments:function(k,e){if(this._resource.Parents){var h=this._resource.Parents.slice(0),g,b;h&&(h=h.slice(0),"reverse"===e&&(h=h.reverse().slice(0)),
h.forEach(function(a){a.skip||(k?(b=k,k=null):b=a.Name,g=this.buildSegment(b),this.path+=a.Name,this.addSegmentHref(g,a),g.include=!1,this.segments.push(g))}.bind(this)))}},addDivider:function(){var k=document.createElement("span");k.appendChild(document.createTextNode(" / "));this.path+="/";k.classList.add("breadcrumbSeparator");this.append(k)},refresh:function(){(this.crumbs=n.node(this._id))?n.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(k){this.crumbs.appendChild(k)},addTitle:function(k,e){var h=e||document.title;0===this.crumbs.childNodes.length&&(k=document.createElement("span"),k.appendChild(document.createTextNode(h)),
k.classList.add("breadcrumb"),k.classList.add("currentLocation"),this.append(k))},finalSegment:function(k,e){if(!this._resource.skip){var h;h=e?e:this._resource.Name;this._makeFinalHref?(k=this.buildSegment(h),this.addSegmentHref(k,this._resource)):(k=document.createElement("span"),k.appendChild(document.createTextNode(h)));k.classList.add("currentLocation");this.path+=this._resource.Name;this.append(k)}},firstSegment:function(k){k&&(this.append(k),this._resource&&this._resource.Parents&&!this._resource.skip?
(k.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(k.href=""),k.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(k){!0===k.include&&(this.append(k),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var k=this.segments.slice(0).reverse();k.forEach(function(e){this.append(e);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?e.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=k.reverse()}},measure:function(){var k=this._container;k.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:k.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var k=this.getNavigatorWorkspaceRootSegment(),e=this._rootSegmentName;e?this.addTitle(k,e):(this.finalSegment(k,e),this._resource&&this._resource.Parents&&(this.buildSegments(e,"reverse"),this.measureSegments(),this.firstSegment(k)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var k=this.getNavigatorWorkspaceRootSegment(),e=this._rootSegmentName;e?this.addTitle(k,e):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(k),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(k,e)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};m.prototype.constructor=m;return{BreadCrumbs:m}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(l,n,m){function k(e){l.attach(this);this._init(e)}k.prototype={_init:function(e){this._tracking=null;this._animationDelay=501;this._closeReversely=e.closeReversely;this.$node=m.node(e.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=m.node(e.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=m.node(e.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=e.vertical||!1;var h=this.$node.classList;h.add("split");h.add(this._vertical?"splitVerticalLayout":"splitLayout");h=this.$sideNode.classList;h.add("hasSplit");h.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");h=this.$mainNode.classList;h.add("hasSplit");h.add(this._vertical?"mainPanelVerticalLayout":"mainPanelLayout");this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");e.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 e.closeByDefault&&(this._closeByDefault=e.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";n.isIOS||n.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(e){e="vertical"===e;e!==this._vertical&&(this._vertical=e,e=this.$node.classList,e.toggle("splitLayout"),e.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",e=this.$sideNode.classList,e.toggle("sidePanelLayout"),e.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",e=this.$mainNode.classList,e.toggle("mainPanelLayout"),e.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(e=this._thumb.classList,e.toggle("splitThumbLayout"),e.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(e){this.addEventListener("resize",function(h){e(h.node)})},_initializeFromStoredSettings:function(){var e=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof e?"closed"===e:this._closeByDefault;var e=m.bounds(this.$node.parentNode),h=m.bounds(this.$node),g;this._vertical?(g=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(g,10),this._splitTop>e.top+e.height-h.height&&
(this._splitTop=e.top+e.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(g=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(g,10),this._splitLeft>e.left+e.width-h.width&&(this._splitLeft=e.left+e.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var e=m.bounds(this.$node),h=m.bounds(this.$node.parentNode);return this.vertical?e.top-h.top:e.left-h.left},
_adjustToSplitPosition:function(e){var h=m.bounds(this.$node),g=m.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=h.height;if(e||!this._splitTop)this._splitTop=h.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);e=this._splitTop;e=this._splitTop-g.top;this.$sideNode.style.height=e+"px";this.$sideNode.style.display="block";this.$node.style.top=e+"px"}else{this._splitWidth=h.width;if(e||!this._splitLeft)this._splitLeft=h.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);e=this._splitLeft;e=this._splitLeft-g.left;this.$sideNode.style.width=e+"px";this.$sideNode.style.display="block";this.$node.style.left=e+"px"}this._resize()},_resize:function(e,h,g){e=e||0;var b=m.bounds(this.$node.parentNode),a=m.bounds(this.$node);this._vertical?(void 0===g&&(g=a.top-b.top),g+=a.height,this.$mainNode.style.top=g+"px"):(void 0===h&&(h=a.left-b.left),h+=a.width,this.$mainNode.style.left=h+"px");var f=this;window.setTimeout(function(){f._notifyResizeListeners(f.$mainNode);
f._notifyResizeListeners(f.$sideNode)},e)},_notifyResizeListeners:function(e){this.dispatchEvent({type:"resize",node:e})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(e,h){e||this._addAnimation();var g=this._splitTop,b=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(g=b=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=m.bounds(this.$node.parentNode),
f=m.bounds(this.$node);this._vertical?g=a.height-f.height:b=a.width-f.width}else g=b=0;this._vertical?(this.$sideNode.style.height=g+"px",this.$node.style.top=g+"px"):(this.$sideNode.style.width=b+"px",this.$node.style.left=b+"px");this._resize(this._animationDelay,b,g);e||this._removeAnimation();h||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var d=this;window.setTimeout(function(){d._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var e=
this;window.setTimeout(function(){e.$sideNode.classList.remove(e._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");e.$mainNode.classList.remove(e._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");e.$node.classList.remove(e._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(e,h){var g=m.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=h;this._splitTop<g.top+5?this._splitTop=g.top+5:this._splitTop>g.top+g.height-5&&(this._splitTop=g.top+
g.height-5);var b=this._splitTop,b=this._splitTop-g.top;this.$node.style.top=b+"px"}else this._splitLeft=e,this._splitLeft<g.left+5?this._splitLeft=g.left+5:this._splitLeft>g.left+g.width-5&&(this._splitLeft=g.left+g.width-5),b=this._splitLeft,b=this._splitLeft-g.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(e){if(e.target===
this._thumb)return m.stop(e),this._thumbDown();this._tracking||(this._down(e),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),m.setFramesEnabled(!1),m.stop(e))},_mouseMove:function(e){this._tracking&&this._move(e.clientX,e.clientY)},_mouseUp:function(e){this._tracking&&(m.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),m.stop(e))},_touchStart:function(e){if(1===e.touches.length){m.stop(e);if(e.target===
this._thumb)return this._thumbDown();this._down(e);this._touching=!0}},_touchMove:function(e){this._touching&&(e=e.touches,1===e.length&&(e=e[0],this._move(e.clientX,e.clientY)))},_touchEnd:function(e){0===e.touches.length&&(this._touching=!1,this._up())}};k.prototype.constructor=k;return{Splitter:k,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(l,n,m){function k(e){this.commandRegistry=e.commandRegistry;this.create();this._filterString="";this._providers=[]}k.prototype={addProvider:function(e){this._providers.push(e)},create:function(){var e=this._keyAssistDiv=document.createElement("div");e.id="keyAssist";e.style.display="none";e.classList.add("keyAssistFloat");e.setAttribute("role","menu");var h=this._keyAssistInput=document.createElement("input");
h.classList.add("keyAssistInput");h.type="text";h.placeholder=l["Filter bindings"];e.appendChild(h);var g=this._keyAssistContents=document.createElement("div");g.classList.add("keyAssistContents");if(m.isIOS||m.isAndroid)g.style.overflowY="auto";e.appendChild(g);var b=this._keyAssistTable=document.createElement("table");b.tabIndex=0;b.classList.add("keyAssistList");g.appendChild(b);document.body.appendChild(e);h.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));h.addEventListener("input",function(a){this.filterChanged()}.bind(this));g.addEventListener(m.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&this.hide()}.bind(this));n.addAutoDismiss([e],function(){this.hide()}.bind(this))},createContents:function(){n.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var e=this._idCount=
this._keyAssistContents.scrollTop=0;e<this._providers.length;e++)this._providers[e].showKeyBindings(this);this.createHeader(l.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(e,h,g){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(h).indexOf(b)&&-1===a(e).indexOf(b)&&-1===a(this._lastHeader).indexOf(b))return}var f=this._keyAssistTable.insertRow(-1);
f.id="keyAssist-keyBinding-"+this._idCount++;f.setAttribute("role","menuitem");f._execute=g;f.classList.add("keyAssistItem");f.addEventListener("click",function(a){this._selectedRow=f;this.execute();a.preventDefault()}.bind(this));g=f.insertCell(-1);g.classList.add("keyAssistName");g.appendChild(document.createTextNode(h));g=f.insertCell(-1);g.classList.add("keyAssistAccel");g.appendChild(document.createTextNode(e))},createHeader:function(e){this._lastHeader=e;var h=this._keyAssistTable.insertRow(-1);
h.classList.add("keyAssistSection");var h=h.insertCell(-1),g=document.createElement("h2");g.appendChild(document.createTextNode(e));h.appendChild(g)},execute:function(){window.setTimeout(function(){this.hide();var e=this._selectedRow;this._selectedRow=null;e&&e._execute&&e._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var e=this._keyAssistInput.value;this._filterString!==e&&(this._filterString=
e,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var e=document.activeElement,h=this._keyAssistDiv,e=h===e||0!==(h.compareDocumentPosition(e)&16);h.style.display="none";e&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(e){e=this._providers.indexOf(e);-1!==e&&this._providers.splice(e,
1)},select:function(e){var h=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===h.length)this._selectedIndex=-1;else{var g=this._selectedIndex,g=(g+(e?1:-1))%h.length;0>g&&(g=h.length-1);-1!==this._selectedIndex&&(e=h[this._selectedIndex],e.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=g;if(-1!==this._selectedIndex){this._selectedRow=e=h[this._selectedIndex];e.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",e.id);this._keyAssistTable.focus();
var h=e.getBoundingClientRect(),b=this._keyAssistContents,a=b.getBoundingClientRect();e.offsetTop<b.scrollTop?0===g?b.scrollTop=0:e.scrollIntoView(!0):h.bottom>a.bottom&&e.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(e){if(40===e.keyCode)this.select(!0);else if(38===e.keyCode)this.select(!1);else if(13===e.keyCode)this.execute();else return;e.preventDefault()},_scrollWheel:function(e){var h=0,h=m.isIE||m.isOpera?-e.wheelDelta:m.isFirefox?40*e.detail:-e.wheelDeltaY,g=this._keyAssistContents,b=g.scrollTop;g.scrollTop+=h;if(b!==g.scrollTop)return e.preventDefault&&e.preventDefault(),!1}};return{KeyAssistPanel:k}});
define("orion/widgets/themes/ThemePreferences",[],function(){function l(l,m){this._preferences=l;this._themeData=m;var k=m.getThemeStorageInfo();this._themeVersion=k.version;var e=l.listenForChangedSettings(k.storage,2,function(h){h.key===e&&this.apply()}.bind(this))}l.prototype={_initialize:function(l,m,k){var e,h;void 0===this._themeVersion||k.get("version")===this._themeVersion?(e=k.get(l.styleset),(h=k.get("selected"))&&(h=JSON.parse(h))):h=e=null;e||(e=m.getStyles(),k.put(l.styleset,JSON.stringify(e)));
if(!h||void 0===h[l.selectedKey])h=h||{},h[l.selectedKey]=l.defaultTheme,k.put("selected",JSON.stringify(h));k.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(l){var m=this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(e){this._initialize(k,m,e);var h=JSON.parse(e.get("selected"));e=JSON.parse(e.get(k.styleset));var g;if(e)for(var b=0;b<e.length;b++)if(e[b].name===h[k.selectedKey]){g=e[b];break}l({style:g,styles:e})}.bind(this))},
setTheme:function(l,m){var k=this._themeData,e=k.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(h){this._initialize(e,k,h);var g=JSON.parse(h.get("selected"));l||(l=g[e.selectedKey]);g[e.selectedKey]=l;h.put("selected",JSON.stringify(g));m?h.put(e.styleset,JSON.stringify(m)):m=JSON.parse(h.get(e.styleset));for(var b=0;b<m.length;b++)if(m[b].name===g[e.selectedKey]){k.processSettings(m[b]);break}h.put("version",this._themeVersion)}.bind(this))},setFontSize:function(l){var m=
this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(e){this._initialize(k,m,e);var h=JSON.parse(e.get("selected")),g=JSON.parse(e.get(k.styleset)),b;if(g)for(var a=0;a<g.length;a++)g[a].fontSize=l,g[a].name===h[k.selectedKey]&&(b=g[a]);e.put(k.styleset,JSON.stringify(g));m.processSettings(b)}.bind(this))}};return{ThemePreferences:l}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/editor/eventTarget",[],function(){function l(){}l.addMixin=function(n){var m=l.prototype,k;for(k in m)m.hasOwnProperty(k)&&(n[k]=m[k])};l.prototype={addEventListener:function(l,m,k){this._eventTypes||(this._eventTypes={});var e=this._eventTypes[l];e||(e=this._eventTypes[l]={level:0,listeners:[]});e.listeners.push({listener:m,useCapture:k})},dispatchEvent:function(l){var m=l.type;this._dispatchEvent("pre"+m,l);this._dispatchEvent(m,l);this._dispatchEvent("post"+m,l)},_dispatchEvent:function(l,
m){var k=this._eventTypes?this._eventTypes[l]:null;if(k){var e=k.listeners;try{if(k.level++,e)for(var h=0,g=e.length;h<g;h++)if(e[h]){var b=e[h].listener;"function"===typeof b?b.call(this,m):b.handleEvent&&"function"===typeof b.handleEvent&&b.handleEvent(m)}}finally{if(k.level--,k.compact&&0===k.level){for(h=e.length-1;0<=h;h--)e[h]||e.splice(h,1);0===e.length&&delete this._eventTypes[l];k.compact=!1}}}},isListening:function(l){return!this._eventTypes?!1:void 0!==this._eventTypes[l]},removeEventListener:function(l,
m,k){if(this._eventTypes){var e=this._eventTypes[l];if(e){for(var h=e.listeners,g=0,b=h.length;g<b;g++){var a=h[g];if(a&&a.listener===m&&a.useCapture===k){0!==e.level?(h[g]=null,e.compact=!0):h.splice(g,1);break}}0===h.length&&delete this._eventTypes[l]}}}};return{EventTarget:l}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(l,n,m){function k(e){e=e||{};this._document=e.document||document}var e={};k.getTheme=function(h){h=h||"default";var g=e[h];g||(g=e[h]=new k);return g};k.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(e,g){var b=this,a=b._themeClass;b._themeClass=e;this._load(e,g,function(){b.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:b.getThemeClass()})})},onThemeChanged:function(e){return this.dispatchEvent(e)},
buildStyleSheet:function(e,g){function b(f,d,b){d&&(a.push("."+e+" ."+f+" {"),a.push("\t"+(b?"background-color":"color")+": "+d+";"),a.push("}"))}var a=[];a.push("");a.push("."+e+" {");g.fontFamily&&a.push("\tfont-family: "+g.fontFamily+";");g.fontSize&&a.push("\tfont-size: "+g.fontSize+";");g.fontSize&&a.push("\tcolor: "+g.text+";");a.push("}");a.push("."+e+".textview {");g.background&&a.push("\tbackground-color: "+g.background+";");a.push("}");a.push("."+e+" .textviewLeftRuler {");g.leftRuler&&
a.push("\tborder-right: 1px solid "+g.leftRuler+";");a.push("}");a.push("."+e+" .textviewRightRuler {");g.rightRuler&&a.push("\tborder-left: 1px solid "+g.rightRuler+";");a.push("}");b("ruler.annotations",g.annotationRuler,!0);b("ruler.lines",g.annotationRuler,!0);b("ruler.folding",g.annotationRuler,!0);b("ruler.overview",g.overviewRuler,!0);b("rulerLines",g.lineNumber,!1);b("rulerLines.even",g.lineNumberEven,!1);b("rulerLines.odd",g.lineNumberOdd,!1);b("annotationLine.currentLine",g.currentLine,
!0);b("entity-name-tag",g.keyword,!1);b("entity-other-attribute-name",g.attribute,!1);b("string-quoted",g.string,!1);b("meta.annotation.currentLine",g.currentLine,!0);b("keyword",g.keyword,!1);b("string",g.string,!1);b("constant",g.constant,!1);b("comment",g.comment,!1);b("comment.block.documentation",g.comment,!1);b("keyword.other.documentation.markup",g.comment,!1);b("keyword.other.documentation.markup",g.comment,!1);return a.join("\n")},_createStyle:function(e,g,b,a){var f=this._document;e="orion-theme-"+
e;var d=f.getElementById(e);if(d){if(a||d.firstChild.data===g)return;d.removeChild(d.firstChild);d.appendChild(f.createTextNode(g))}else a?(d=m.createElement(f,"link"),d.rel="stylesheet",d.type="text/css",d.href=g,d.addEventListener("load",function(){b()})):(d=m.createElement(f,"style"),d.appendChild(f.createTextNode(g))),d.id=e,(f.getElementsByTagName("head")[0]||f.documentElement).appendChild(d);a||b()},_load:function(e,g,b){if(e)if("string"===typeof g)this._createStyle(e,g,b);else if(g=g.href,
".css"!==g.substring(g.length-4)&&(g+=".css"),/^\//.test(g)||/[a-zA-Z0-9]+:\/\//i.test(g)||!l.toUrl)this._createStyle(e,g,b,!0);else{var a=this;l(["text!"+g],function(f){a._createStyle(e,f,b,!1)})}else b()}};n.EventTarget.addMixin(k.prototype);return{TextTheme:k}});
define("orion/widgets/themes/ThemeClass",[],function(){function l(l){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=l;this.classString="."+l+"{ "}l.prototype.className=null;l.prototype.classString=void 0;l.prototype.style=void 0;l.prototype.closeString=" }\n";l.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:l}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(l){function n(){}n.prototype.navbar="white";n.prototype.button="#777777";n.prototype.location="#EFEFEF";n.prototype.selection="#cedce7";n.prototype.sidepanel="#F7F7F7";n.prototype.mainpanel="white";n.prototype.navtext="#bfbfbf";n.prototype.content="#3087B3";n.prototype.search="#444";n.prototype.toolpanel="white";n.prototype.writeNavigationStyle=function(){var m="",k=[],e=new l.ThemeClass("orionPage");
e.style.backgroundColor="#fdfdfd";e.style.width="100%";e.style.height="100%";k.push(e);e=new l.ThemeClass("topRowBanner");e.style.margin="0";e.style.border="0";e.style.backgroundColor=this.navbar;e.style.height="16px";e.style.padding="10px";e.style.paddingLeft="6px";e.style.paddingRight="2px";e.style.borderBottom="none";e.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";e.style.zIndex="100";k.push(e);e=new l.ThemeClass("a");e.style.textDecoration="none";e.style.color=
this.content;k.push(e);e=new l.ThemeClass("navlink");e.style.display="inline-block";e.style.padding="2px";e.style.color=this.content;e.style.verticalAlign="bottom";k.push(e);e=new l.ThemeClass("primaryNav");e.style.color=this.navtext;e.style.fontSize="8pt";e.style.fontWeight="normal";e.style.paddingTop="0";e.style.verticalAlign="baseline";k.push(e);e=new l.ThemeClass("primaryNav a");e.style.fontSize="8pt";e.style.color=this.navtext;e.style.marginRight="6px";e.style.marginLeft="6px";e.style.verticalAlign=
"baseline";e.style.textDecoration="none";k.push(e);e=new l.ThemeClass("primaryNav a:hover");e.style.color="#bfbfbf";e.style.cursor="hand";e.style.color="white";e.style.fontWeight="normal";k.push(e);for(var h in k)m+=k[h].toString();return m};n.prototype.writeLocationStyle=function(){var m="",k=[],e=new l.ThemeClass("titleArea");e.style.margin="0";e.style.paddingTop="5px";e.style.border="0";e.style.background=this.location;e.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";e.style.borderBottom="1px solid "+this.location;e.style.minHeight="20px";k.push(e);e=new l.ThemeClass("breadcrumb");e.style.fontSize="8pt";e.style.textDecoration="none";e.style.color="#f1f1f2;";e.style.paddingTop="2px";k.push(e);e=new l.ThemeClass("a.breadcrumb:hover");e.style.textDecoration="none";e.style.borderBottom="1px dotted";e.style.color="#F58B0F";e.style.cursor="pointer";k.push(e);e=new l.ThemeClass("breadcrumbSeparator");e.style.fontSize=
"8pt";e.style.textDecoration="none";e.style.color=this.separator;e.style.fontWeight="bold";k.push(e);e=new l.ThemeClass("currentLocation");e.style.fontWeight="bold";e.style.fontSize="8pt";e.style.color=this.breadcrumb;e.style.textDecoration="none";e.style.textWrap="normal";e.style.lineHeight="10pt";k.push(e);e=new l.ThemeClass("a.currentLocation:hover");e.style.fontWeight="bold";e.style.fontSize="10pt";e.style.color="#666666";e.style.textDecoration="none";e.style.borderBottom="0";k.push(e);e=new l.ThemeClass("navlinkonpage");
e.style.color=this.content;e.style.verticalAlign="middle";k.push(e);this.bannerProgress&&(e=new l.ThemeClass("topRowBanner .progressPane_running"),e.style.borderColor=this.bannerProgress,k.push(e));for(var h in k)m+=k[h].toString();return m};n.prototype.writeButtonStyle=function(){var m="",k=[],e=new l.ThemeClass("commandButton");e.style.color="#666";e.style.border="1px solid #dedede";e.style.backgroundColor="#ddd";e.style.textAlign="center";e.style.verticalAlign="middle";e.style.cursor="pointer";
e.style.display="inline-block";e.style.padding="4px 6px";e.style.borderRadius="3px";e.style.lineHeight="12px";e.style.fontSize="9pt";e.style.userSelect="none";k.push(e);e=new l.ThemeClass("commandButton:over");e.style.backgroundColor="#e6e6e6";e.style.border="1px solid #808080";k.push(e);e=new l.ThemeClass("commandMenu");e.style.color="#222";e.style.display="inline-block";e.style.verticalAlign="baseline";e.style.margin="0";e.style.fontSize="8pt";e.style.fontWeight="normal";e.style.border="1px solid #dedede";
e.style.backgroundColor="#efefef";e.style.cursor="pointer";e.style.borderRadius="1px";k.push(e);e=new l.ThemeClass("commandMenuItem");e.style.border="0";e.style.padding="0";e.style.margin="0";k.push(e);for(var h in k)m+=k[h].toString();return m};n.prototype.writeMainStyle=function(){var m="",k=[],e=new l.ThemeClass("searchbox");e.style.backgroundImage="url(../images/core_sprites.png)";e.style.backgroundRepeat="no-repeat";e.style.backgroundPosition="4px -297px";e.style.width="12px";e.style.height=
"12px";e.style.backgroundColor=this.search;e.style.border="1px solid "+this.search;e.style.fontSize="11px";e.style.width="15em";e.style.height="16px";e.style.borderRadius="10px";e.style.color="#999";e.style.padding="0";e.style.paddingLeft="20px";e.style.marginLeft="5px";e.style.marginTop="6px !important";e.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";k.push(e);e=new l.ThemeClass("searchbox:focus");e.style.color="white";e.style.outline=
"none";k.push(e);e=new l.ThemeClass("checkedRow");e.style.cssText="background-color:"+this.selection+" !important;";k.push(e);e=new l.ThemeClass("navbar-item-selected");e.style.background=this.selection;e.style.color=this.content;k.push(e);e=new l.ThemeClass("auxpane");e.style.border="0";e.style.background=this.sidepanel;k.push(e);e=new l.ThemeClass("mainpane");e.style.background=this.mainpanel;e.style.border=0;k.push(e);e=new l.ThemeClass("mainToolbar");e.style.background=this.toolpanel;k.push(e);
for(var h in k)m+=k[h].toString();return m};n.prototype.render=function(l){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};n.prototype.getSheet=function(l){l.navbar.value?(this.navbar=l.navbar.value,this.button=l.button.value,this.location=l.location.value,this.selection=l.selection.value,this.sidepanel=l.sidepanel.value,this.mainpanel=l.mainpanel.value,this.navtext=l.navtext.value,this.search=
l.search.value,this.content=l.content.value,this.toolpanel=l.toolpanel.value,this.bannerProgress=l.bannerProgress.value):(this.navbar=l.navbar,this.button=l.button,this.location=l.location,this.selection=l.selection,this.sidepanel=l.sidepanel,this.mainpanel=l.mainpanel,this.navtext=l.navtext,this.search=l.search,this.content=l.content,this.toolpanel=l.toolpanel,this.bannerProgress=l.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:n}});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(l,n,m,k){function e(){}function h(){this.styles=[];var b=new e;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";
b.separator="#333";b.bannerProgress="whitesmoke";this.styles.push(b);b=new e;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new e;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";
b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress=
"#F2F2F2";this.styles.push(b);b=new e;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";
b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function g(){return this.styles}e.prototype.name="Orion";e.prototype.navbar="#404648";e.prototype.button="#EFEFEF";e.prototype.location=
"#333";e.prototype.breadcrumb="#3087B3";e.prototype.separator="#333";e.prototype.selection="FEC";e.prototype.sidepanel="#FBFBFB";e.prototype.mainpanel="white";e.prototype.toolpanel="white";e.prototype.navtext="#bfbfbf";e.prototype.content="#3087B3";e.prototype.search="#444";e.prototype.bannerProgress="white";h.prototype.styles=[];h.prototype.getStyles=g;h.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:k}};
h.prototype.getViewData=function(){var b={top:10,left:10,width:350,height:350};b.shapes=[{type:"RECTANGLE",name:l["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:l["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:l["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:l["Tool Panel"],x:150,y:71,width:209,height:30,
family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:l["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:l.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:l["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:l.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},
{type:"TEXT",name:l.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:l.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:l["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:l.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:l["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:l["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:l["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:150,
y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:l["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:l["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:l.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:l.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};h.prototype.processSettings=function(b){var a=new m.ThemeSheetWriter;(new n.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:h,getStyles:g}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(l){function n(m,k,e){this.elements=e;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===k?(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),l.addAutoDismiss([this.container],this.destroy.bind(this))):m.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}n.prototype.elementNode=null;n.prototype.switchesContainer=null;n.prototype.switches=null;n.prototype.radioButtons=null;n.prototype.chosenSwitch=
null;n.prototype.addElement=function(l){var k=document.createElement("span");k.className="UAContainer-icon";k.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+l.image+'" id\x3d"'+l.label+'ImageNode" alt\x3d"'+l.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+l.label+'LabelNode" \x3e'+l.label+"\x3c/span\x3e\x3c/span\x3e";k.onmouseover=function(){document.getElementById(l.label+"ImageNode").src=l.secondaryImage;
document.getElementById(l.label+"LabelNode").className="UALabel-live";k.className="UAContainer-icon-live"};k.onmouseout=function(){document.getElementById(l.label+"ImageNode").src=l.image;document.getElementById(l.label+"LabelNode").className="UALabel";k.className="UAContainer-icon"};var e=this;k.onclick=function(){e.showMedia(l)};this.elementNode.appendChild(k)};n.prototype.clearElements=function(){this.elementNode.innerHTML=""};n.prototype.showMedia=function(l){this.clearElements();this.addElement(l);
var k=document.createElement("span");k.className="UAContainer-media";k.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+l.media+'" alt\x3d"'+l.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(k);setTimeout(function(){k.style.opacity=1},100);l=document.getElementById(l.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=l.parentNode;l.className="chosenCircle"};n.prototype.createSwitch=
function(l){var k;k=l?l.label+"switch":"indexSwitch";var e=document.createElement("span");e.className="workingSpan";e.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+k+'"\x3e\x3c/div\x3e';var h=this;e.onclick=l?function(){h.showMedia(l)}:function(){h.initialize();h.chosenSwitch.firstChild.className="circle";h.chosenSwitch=e;h.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(e);return this.radioButtons[this.radioButtons.length]=e};n.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};n.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return n});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(l,n,m,k){function e(){}var h=null;e.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 g=
document.body;this.$frameParent=g;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(g);b=b.createContextualFragment(this.CONTAINERTEMPLATE);g.appendChild(b);this.$frame=g.lastChild;this.title&&m.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=m.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(f){a.hide()},!1);this.$parent=m.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
g=b.createContextualFragment(this.TEMPLATE);this.messages&&m.processTextNodes(g,this.messages);this.$parent.appendChild(g);this.$buttonContainer=m.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(f){f.keyCode===m.KEY.ESCAPE?a.hide():f.keyCode===m.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 g=this;this.buttons.forEach(function(b){var a=k.createButton(b.text,b.callback);b.id&&(a.id=b.id,g["$"+a.id]=a);b.isDefault&&(g._defaultCallback=b.callback,g._defaultButton=a);g.$buttonContainer.appendChild(a)})}},_makeModal:function(g){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!m.contains(b.$frame,a.target);if(d)for(var f=0;f<b.$$modalExclusions.length;f++)if(m.contains(b.$$modalExclusions[f],
a.target)){d=!1;break}d&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),m.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);g=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var f=0;f<g.length;f++){for(var d=0;d<this.$$modalExclusions.length;d++)if(m.contains(this.$$modalExclusions[d],g[f])){a=!0;break}!a&&(g[f]!==b.$frame&&g[f].classList&&!g[f].classList.contains("tooltipContainer"))&&
(d=g[f],d.classList.contains("modalBackdrop")||(d.classList.add("modalBackdrop"),this._addedBackdrop.push(d)))}(g=m.lastTabbable(this.$buttonContainer)||m.lastTabbable(this.$parent))&&g.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.TAB){var d=b._getFirstFocusField();d&&d!==a.target&&d.focus();m.stop(a)}},!1)},_addChildDialog:function(g){this.$$modalExclusions.push(g.$frame||g.$parent)},_inModalExclusion:function(g){return this.$$modalExclusions.some(function(b){return g.$frame===b||
g.$parent===b})},_bindElements:function(g){for(var b=0;b<g.childNodes.length;b++){var a=g.childNodes[b];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(g){!g&&h===this&&(h=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");m.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},0)},show:function(g){if(this.modal)if(this._makeModal(),h){if(!h._inModalExclusion(this)){this.hide(!0);return}}else h=this;"function"===typeof this._beforeShowing&&this._beforeShowing();m.setFramesEnabled(!1);var b=m.bounds(this.$frame),a=m.bounds(document.documentElement),f;g?(f=m.bounds(g),g=f.top+f.height+4,f=f.left+4,g+b.height>a.height&&(g=Math.max(0,a.height-b.height-4)),f+b.width>a.width&&(f=Math.max(0,
a.width-b.width-4))):(f=Math.max(0,(a.width-b.width)/2),g=Math.max(0,(a.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=g+"px";this.$frame.style.left=f+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return m.firstTabbable(this.$parent)||this._defaultButton||m.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(h===this&&(h=null),m.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(g){g.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)}};e.prototype.constructor=e;return{Dialog:e}});
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(l,n,m,k,e,h,g){function b(a){this._displaySignOut=!0;this._init(a)}b.prototype={_init:function(a){this._dropdownNode=m.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 f=0,d;for(d in a)a.hasOwnProperty(d)&&f++;
return f},_makeMenuItem:function(a,f){var d=g.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&d.classList.add(this._dropDownItemClass);d.addEventListener("click",f,!1);d.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&f()},!1);return d},_renderAuthenticatedService:function(a,f){var d=this,b=this.authenticatedServices[a].authService;if(b&&b.logout&&this._displaySignOut){var g=this._makeMenuItem(l["Sign Out"],
function(){b.logout().then(function(){d.addUserItem(a,b,d.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var f=localStorage.length-1;0<=f;f--){var g=localStorage.key(f);g&&0===g.indexOf("/orion/preferences/user")&&localStorage.removeItem(g)}b.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(g.parentNode)}},renderServices:function(){function a(a){d[a]||(d[a]=f.createDocumentFragment());return d[a]}
var f=document,d=[],b=this._serviceRegistry;k.getPageLinksInfo(b,"orion.page.link.user").then(function(e){this._dropdown?this._dropdown.empty():this._dropdownNode&&m.empty(this._dropdownNode);e.getAllLinks().forEach(function(d){var b,g;if(d.category&&(g=/user\.(\d+)/.exec(d.category)))b=parseInt(g[1],10);if("number"!==typeof b||isNaN(b))b=1;b=a(b);g=f.createElement("li");var e=f.createElement("a");e.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&e.classList.add(this._dropDownItemClass):
e.classList.add("dropdownMenuItem");e.href=d.href;e.textContent=d.textContent;g.appendChild(e);b.appendChild(g);e.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&e.click()},!1)}.bind(this));this.keyAssistFunction&&(e=this._makeMenuItem(l["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&e.classList.add(this._keyAssistClass):e.classList.add("key-assist-menuitem"),e=e.parentNode,a(0).appendChild(e));
if(e=b.getServiceReferences("orion.page.getstarted")[0])e=e.getProperty("data"),e=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,e)).parentNode,a(0).appendChild(e);var h=this;d.sort(function(a,d){return a-d}).forEach(function(a,f){if(f<d.length-1&&!this._noSeparator){var b=g.createSeparator();a.appendChild(b)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var k in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(k)&&this._renderAuthenticatedService(k,
0)}.bind(this))},getStartedDialog:function(a){new e(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,f,d,b){b?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:f,label:d,data:b}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:f,label:d,pending:this.unauthenticatedServices[a].pending}:
{authService:f,label:d});this.renderServices()}};b.prototype.constructor=b;return{UserMenu: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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(l,n,m,k,e,h){function g(a,f,d){var b="";d&&(b="^");if(b=m.parse("/"+b+a.searchStr+"/"))d=b.pattern,b=b.flags,-1===b.indexOf("i")&&!f.caseSensitive&&(b+="i"),a.regExp={pattern:d,flags:b},a.wildCard=!0}var b={ALL_FILE_TYPE:"*.*",doSearch:function(a,f,d,g){a?(f=d,d=!0,"*"===f&&(f=""),""===f&&(d=g&&g.type!==b.ALL_FILE_TYPE),d&&(a=a.createSearchParams(f,!1,
!1,g),a=b.generateSearchHref(a),window.location=a)):window.alert(l["Can't search: no search service is available"])},generateSearchHelper:function(a,f){var d=a.keyword,e=d,h={};a.fileType&&(a.fileType!==b.ALL_FILE_TYPE&&""===d)&&(e="*."+a.fileType);if(a.regEx)h.searchStr=d,g(h,a,f);else{var k=-1<d.indexOf("*"),l=-1<d.indexOf("?");k&&(d=d.split("*").join(".*"));l&&(d=d.split("?").join("."));!k&&!l&&!a.nameSearch?(h.searchStr=a.caseSensitive?d.split("\\").join(""):d.split("\\").join("").toLowerCase(),
h.wildCard=!1):(h.searchStr=a.caseSensitive?d:d.toLowerCase(),g(h,a,f),h.wildCard=!0)}h.searchStrLength=h.searchStr.length;return{params:a,inFileQuery:h,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 f=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,""),f=a.split("/"));return f},copySearchParams:function(a,f){var d={},b;for(b in a)if(void 0!==a[b]&&null!==a[b]&&(f||"replace"!==b))d[b]=a[b];return d},
generateSearchHref:function(a){var f=n.toUrl("search/search.html");a=b.copySearchParams(a,!0);var d=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new h(f+"#{,resource,params*}")).expand({resource:d,params:a}):(new h(f+"#{,resource}")).expand({resource:d})},generateFindURLBinding:function(a,f,d,b,g){a={find:f.searchStr,regEx:f.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof b?b:void 0,atLine:"number"===typeof d?d:void 0};return g?a:","+
(new h("{,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,f,d){return a.replace(RegExp(f.pattern,f.flags),d)},replaceStringLiteral:function(a,f,d){f=m.parse("/"+f+"/gim");return b.replaceRegEx(a,f,d)},searchOnelineLiteral:function(a,f,d){var b;
b=0;for(var g=!1,e=[];!(b=f.indexOf(a.searchStr,b),0>b);){e.push({startIndex:b,length:a.searchStrLength});g=!0;if(d)break;b+=a.searchStrLength}return g?e:null},findRegExp:function(a,f,d,b){if(!f)return null;d=d||"";d+=(-1===d.indexOf("g")?"g":"")+(-1===d.indexOf("m")?"m":"");var g=null;return(g=RegExp(f,d).exec(a.substring(b)))&&{startIndex:g.index+b,length:g[0].length}},searchOnelineRegEx:function(a,f,d){for(var g=0,e=!1,h=[];;)if(g=b.findRegExp(f,a.regExp.pattern,a.regExp.flags,g)){h.push(g);e=
!0;if(d)break;g=g.startIndex+g.length}else break;return e?h:null},generateNewContents:function(a,f,d,g,e,h){if(g&&f){a||(d.contents=[]);for(var k=0;k<f.length;k++){for(var l=f[k],m=!1,n=!1,s=[],w,z=0,C=0;C<g.children.length;C++)if(g.children[C].lineNumber-1===k){z=C;for(m=0;m<g.children[C].matches.length;m++)!1!==g.children[C+m].checked&&s.push(m);n=0<s.length;w=g.children[C].matches;m=!0;break}if(m){if(n){s=b.replaceCheckedMatches(l,e,w,s,h);l=s.replacedStr;for(m=0;m<g.children[z].matches.length;m++)g.children[z+
m].newMatches=s.newMatches}else for(m=0;m<g.children[z].matches.length;m++)g.children[z+m].newMatches=g.children[z+m].matches;a?d.contents[k]=l:d.contents.push(l)}else a||d.contents.push(l)}}},generateMatchContext:function(a,f,d){var b=[],g=2*a+1,e;f.length<=g?(e=0,a=f.length-1):(e=d-a,0>e?(e=0,a=e+g-1):(a=d+a,a>f.length-1&&(a=f.length-1,e=a-g+1)));for(g=e;g<=a;g++)b.push({context:f[g],current:g===d});return b},splitFile:function(a){for(var f=0,d=0,b=0,g=0,e=[];;){-1!==f&&f<=b&&(f=a.indexOf("\r",
b));-1!==d&&d<=b&&(d=a.indexOf("\n",b));if(-1===d&&-1===f){e.push(a.substring(g));break}var h=1;-1!==f&&-1!==d?f+1===d?(h=2,b=d+1):b=(f<d?f:d)+1:b=-1!==f?f+1:d+1;e.push(a.substring(g,b-h));g=b}return e},searchWithinFile:function(a,f,d,g,e,h){d=b.splitFile(d);e&&(f.contents=d);if(f){f.children=[];for(var k=g=0;k<d.length;k++){var l=d[k];if(l&&0<l.length){var m=h?l:l.toLowerCase();if(m=a.wildCard?b.searchOnelineRegEx(a,m):b.searchOnelineLiteral(a,m)){var n,s=k+1;if(e)for(var w=0;w<m.length;w++)n=w+
1,n={parent:f,checked:f.checked,type:"detail",matches:m,lineNumber:s,matchNumber:n,name:l,location:f.location+"-"+s+"-"+n},f.children.push(n);else n={parent:f,context:b.generateMatchContext(2,d,k),checked:f.checked,type:"detail",matches:m,lineNumber:s,name:l,location:f.location+"-"+s},f.children.push(n);g+=m.length}}}f.totalMatches=g}},replaceCheckedMatches:function(a,f,d,b,g){for(var e=0,h="",k=[],l=0;l<d.length;l++){e!==d[l].startIndex&&(h+=a.substring(e,d[l].startIndex));d[l].length&&(g=d[l].length);
for(var e=!1,m=0;m<b.length;m++)if(b[m]===l){e=!0;break}e?(k.push({startIndex:h.length,length:f.length}),h+=f):(k.push({startIndex:h.length,length:g}),h+=a.substring(d[l].startIndex,d[l].startIndex+g));e=d[l].startIndex+g}e<a.length&&(h+=a.substring(e));return{replacedStr:h,newMatches:k}},fullPathNameByMeta:function(a){var f=a.length,d="";if(0<f)for(f-=1;-1<f;f--)d=d+(""===d?"":"/")+a[f].Name;return d},path2FolderName:function(a,f,d){return a.substring(0,a.length-f.length-(d?0:1))},getOpenSearchPref:function(a,
f){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");f(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:f})})}};return b});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(l,n,m,k,e,h){function g(b,a,f,d){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=d&&d.searchOnName;this._buildSkeletonOnly=d&&d.buildSkeletonOnly;this._fetchChildrenCallBack=d&&d.fetchChildrenCallBack;this._searchParams=f;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:k.generateSearchHelper(f);this._location=d&&d.location;this._childrenLocation=d&&d.childrenLocation?d.childrenLocation:this._location;this._reportOnCancel=d&&d.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))}g.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 d=this;this._visitRecursively(this._childrenLocation).then(function(){(!d._cancelled||d._reportOnCancel)&&d._reportResult();d._cancelled&&d._HandleStatus({name:"Cancel"})}.bind(d),function(a){d._reportResult();d._HandleStatus(a)}.bind(d))}.bind(this))};g.prototype.searchName=function(b,a){b&&(this._searchParams=
b,this.searchHelper=k.generateSearchHelper(b,!0));a&&(this.onSearchNameComplete=a);var f=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var d=0;d<this.fileSkeleton.length;d++){var g=this.fileSkeleton[d].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?k.searchOnelineRegEx(this.searchHelper.inFileQuery,g,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,g,!0))if(f.push(this.fileSkeleton[d]),f.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:f.length,
docs:f}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};g.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var f=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var d=this;b();f.getContentTypes().then(function(f){d.contentTypesCache=f;d._visitRecursively(d._childrenLocation).then(function(){d._buildingSkeleton=!1;a();d.searchHelper&&!d._buildSkeletonOnly&&d.searchName()})})};g.prototype._sort=function(b){b.sort(function(a,
f){var d,b;if("Path asc"===this._searchParams.sort){d=a.Location&&a.Location.toLowerCase();d=k.path2FolderName(d,a.Name&&a.Name.toLowerCase(),!0);b=f.Location&&f.Location.toLowerCase();b=k.path2FolderName(b,f.Name&&f.Name.toLowerCase(),!0);if(d<b)return-1;if(d>b)return 1}return this._sortOnNameSingle(a,f)}.bind(this))};g.prototype._HandleStatus=function(b){this._statusService&&"Cancel"===b.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:l["Search cancelled by user"],
Severity:"Warning"}))};g.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};g.prototype._sortOnNameSingle=function(b,a){var f=b.Name&&b.Name.toLowerCase(),d=a.Name&&a.Name.toLowerCase();return f<d?-1:f>d?1:0};g.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};g.prototype._visitRecursively=function(b){var a=[],f=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(f._progressService?this._progressService.progress(f.fileClient.fetchChildren(b),"Crawling search for children of "+b):f.fileClient.fetchChildren(b)).then(function(d){for(var b=0;b<d.length;b++)if(void 0!==d[b].Directory&&!1===d[b].Directory)if(f._searchOnName)a.push(f._buildSingleSkeleton(d[b]));else if(f._buildSkeletonOnly)a.push(f._buildSingleSkeleton(d[b]));
else{if(!f._cancelled){var g=e.getFilenameContentType(d[b].Name,f.contentTypesCache);if(g&&("text/plain"===g["extends"]||"text/plain"===g.id)&&f._fileNameMatches(d[b].Name))g=f._sniffSearch(d[b]),a.push(g),f._deferredArray.push(g)}}else if(d[b].Location)if(f._cancelled)break;else g=f._visitRecursively(d[b].ChildrenLocation),a.push(g),f._deferredArray.push(g);return h.all(a)})};g.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
k.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};g.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))};g.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};
g.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:m.formatMessage(l["${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(f){a._hitOnceWithinFile(f)&&
a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:m.formatMessage(l["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},l.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};g.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();b=new h;b.resolve(this._totalCounter);
return b};g.prototype.constructor=g;return{SearchCrawler:g}});
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(l,n,m,k,e,h,g){function b(a){this._init(a)}b.prototype=new g.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"'+k.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||l["Find File Named"];this.modal=!0;this.messages=l;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new m.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(l["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(l["Missing required argument: searchRenderer"]);this._initialize()};b.prototype._bindToDom=function(a){var f=this;f.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",l["FileName FolderName"]):this.$fileName.setAttribute("placeholder",l.Search);this.$fileName.addEventListener("input",function(a){f._time=+new Date;f._timeoutId&&clearTimeout(f._timeoutId);f._timeoutId=setTimeout(f.checkSearch.bind(f),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===e.KEY.ENTER){var b=e.$("a",f.$results);b&&(e.stop(a),(h.isMac?a.metaKey:a.ctrlKey)?window.open(b.href):(window.location.href=b.href,f.hide()))}},!1);a.addEventListener("keydown",function(a){var b,g,h;if(a.keyCode===e.KEY.DOWN||a.keyCode===e.KEY.UP)b=e.$$array("a",f.$results),g=document.activeElement,h=b.indexOf(g),a.keyCode===e.KEY.DOWN?0<=h?(g.classList.remove("treeIterationCursor"),b=h<b.length-1?b[h+1]:b[0],b.focus(),
b.classList.add("treeIterationCursor")):0<b.length&&(b=b[0],b.focus(),b.classList.add("treeIterationCursor")):0<=h?(g.classList.remove("treeIterationCursor"),g=f.$fileName,b=0<h?b[h-1]:g,b.focus(),0<h&&b.classList.add("treeIterationCursor")):0<b.length&&(b[b.length-1].focus(),b[b.length-1].classList.add("treeIterationCursor")),e.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(f._forceUseCrawler||!f._fileService.getService(f._searcher.getSearchLocation()).search){var a=
f._searchOnRoot?f._searcher.getSearchRootLocation():f._searcher.getChildrenLocation(),a=new n.SearchCrawler(f._searcher.registry,f._fileService,"",{searchOnName:!0,location:a});f._searcher.setCrawler(a);a.buildSkeleton(function(){f.$crawlingProgress.style.display="inline";f.$progress.appendChild(document.createTextNode(l["Building file skeleton..."]))},function(){f.$crawlingProgress.style.display="none";f.$progress.removeChild(f.$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 f,d=a,b=null;if(this._nameSearch&&(f=/(\S+)\s*(.*)/,(a=f.exec(a))&&3===a.length))a[1]&&
(d=a[1]),a[2]&&(b=a[2]);return{keyword:d,folderKeyword:b}};b.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var f=this._detectFolderKeyword(a),d=this._searcher.createSearchParams(f.keyword,this._nameSearch,this._searchOnRoot),b=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=b;var g=document.createElement("div");g.appendChild(document.createTextNode(this._nameSearch?l["Searching..."]:h.formatMessage(l["Searching for occurrences of"],
a)));e.empty(this.$results);this.$results.appendChild(g);this._searcher.search(d,f.folderKeyword,function(){b===this.currentSearch&&b.apply(null,arguments)}.bind(this))}};b.prototype.decorateResult=function(a){function f(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&d.hide()}var d=this;a=e.$$array("a",a);for(var b=0;b<a.length;b++)a[b].addEventListener("click",f,!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(l,n){function m(k,e,h){if(k=n.node(k))this._parent=k;else throw Error("Parent node of dropdown menu not found");this.options=h=h||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=h.selectionClass;k=document.createElement("div");k.classList.add("dropdownMenu");k.classList.add("dropdownMenuOpen");k.id=this.navDropDownId;k.style.display="none";this._parent.appendChild(k);this._dropdownMenu=
k;if(e=n.node(e))this._triggerNode=e;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");h.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(g){g.keyCode===n.KEY.ESCAPE&&this.clearPanel()}.bind(this))}l.mixin(m.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){n.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=n.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",n.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(k){this._dropdownMenu.innerHTML=k},getContentNode:function(){return this._dropdownMenu},updateContent:function(k,e){e()},_positionDropdown:function(){this._dropdownMenu.style.right="";var k=n.bounds(this._dropdownMenu),e=n.bounds(document.body);k.left+k.width>e.left+e.width&&(k=n.bounds(this._boundingNode(this._triggerNode)),e=n.bounds(this._triggerNode),this._dropdownMenu.style.right=k.width-(e.left-k.left+e.width)+"px")},_boundingNode:function(k){var e=window.getComputedStyle(k,
null);return null===e||"absolute"===e.getPropertyValue("position")||!k.parentNode||k===document.body?k:this._boundingNode(k.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&&(n.setFramesEnabled(!0),n.empty(this._parent),this._parent=this.select=null)}});return m});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(l,n,m){function k(g,b,a){if(!g[b])throw b+l[" is not supported in this file system"];return g[b].apply(g,a)}function e(g,b,a,f){if(!g.readBlob)throw l["source file service does not support binary read"];if(!a.writeBlob)throw l["target file service does not support binary write"];if("/"!==b[b.length-1])return k(g,"readBlob",[b]).then(function(d){return k(a,"writeBlob",[f,d])});var d=f.substring(0,
f.length-1),p=decodeURIComponent(d.substring(d.lastIndexOf("/")+1)),d=d.substring(0,d.lastIndexOf("/")+1);return k(a,"createFolder",[d,p]).then(function(){},function(){}).then(function(){return k(g,"fetchChildren",[b]).then(function(d){for(var b=[],p=0;p<d.length;++p){var h=d[p].Location,k=h;d[p].Directory&&(k=h.substring(0,h.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=f+encodeURIComponent(k);d[p].Directory&&(k+="/");b[p]=e(g,h,a,k)}return n.all(b)})})}function h(g,b){function a(a){var d=
new n;d.reject(l["No Matching FileService for location:"]+a);return d}var f=g.getServiceReferences("orion.core.file"),d=f;if(b)for(var d=[],e=0;e<f.length;++e)b(f[e])&&d.push(f[e]);for(var h=[],k=[],t=[],y=[],v={fetchChildren:function(){var a=new n;a.resolve(y);return a},createWorkspace:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspace:function(a){var d=new n;window.setTimeout(function(){d.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:l["File Servers"],Location:"/",Children:y,ChildrenLocation:"/"})},100);return d},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},f=0;f<d.length;++f)y[f]={Directory:!0,Length:0,LocalTimeStamp:0,Location:d[f].getProperty("top"),ChildrenLocation:d[f].getProperty("top"),Name:d[f].getProperty("Name")},e=d[f].getProperty("pattern")||d[f].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==e[0]&&(e=
"^"+e),h[f]=RegExp(e),k[f]=g.getService(d[f]),t[f]=d[f].getProperty("Name"),d[f].getProperty("NameKey")&&d[f].getProperty("nls")&&m.getMessageBundle(d[f].getProperty("nls")).then(function(a,f){y[a].Name=f[d[a].getProperty("NameKey")];t[a]=f[d[a].getProperty("NameKey")]}.bind(this,f));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return k[0]?0:-1;for(var d=0;d<h.length;++d)if(h[d].test(a))return d;throw l["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?v:k[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?v.Name:t[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?v.Location:y[a].Location}}h.prototype={getService:function(g){return this._getService(g)},fileServiceName:function(g){return this._getServiceName(g)},fileServiceRootURL:function(g){return this._getServiceRootURL(g)},fetchChildren:function(g){return k(this._getService(g),"fetchChildren",
arguments)},createWorkspace:function(g){return k(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return k(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(g){return k(this._getService(g),"loadWorkspace",arguments)},createProject:function(g,b,a,f){return k(this._getService(g),"createProject",arguments)},createFolder:function(g,b){return k(this._getService(g),"createFolder",arguments)},createFile:function(g,b){return k(this._getService(g),"createFile",
arguments)},deleteFile:function(g){return k(this._getService(g),"deleteFile",arguments)},moveFile:function(g,b,a){var f=this._getService(g),d=this._getService(b);if(f===d)return k(f,"moveFile",arguments);var p="/"===g[g.length-1],h=b;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var l=g;p&&(l=l.substring(0,l.length-1));h+=l.substring(l.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return e(f,g,d,h).then(function(){return k(f,"deleteFile",[g])})},copyFile:function(g,b,a){var f=
this._getService(g),d=this._getService(b);if(f===d)return k(f,"copyFile",arguments);var p="/"===g[g.length-1],h=b;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var l=g;p&&(l=l.substring(0,l.length-1));h+=l.substring(l.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return e(f,g,d,h)},read:function(g,b){return k(this._getService(g),"read",arguments)},readBlob:function(g){return k(this._getService(g),"readBlob",arguments)},write:function(g,b,a){return k(this._getService(g),"write",
arguments)},remoteImport:function(g,b){return k(this._getService(g),"remoteImport",arguments)},remoteExport:function(g,b){return k(this._getService(g),"remoteExport",arguments)},search:function(g){return k(this._getService(g.resource),"search",arguments)}};h.prototype.constructor=h;return{FileClient:h}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(l,n){function m(h,g){this._parentNode=l.node(h);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=l.node(g);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(k)||e;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var k="sideMenuNavigation",e="open";m.prototype=
{constructor:m.prototype.constructor,setCategories:function(e){this._categoryInfos=e.getCategoryIDs().map(function(g){return e.getCategory(g)}).sort(function(g,b){var a=g.order||100,f=b.order||100;return a<f?-1:f<a?1:g.textContent.localeCompare(b.textContent)})},setPageLinks:function(e){this._categorizedPageLinks={};e.getAllLinks().forEach(function(g){var b=g.category;this._categorizedPageLinks[b]=this._categorizedPageLinks[b]||[];this._categorizedPageLinks[b].push({title:g.textContent,order:g.order||
100,href:g.href})},this)},setRelatedLinks:function(e,g){this._categorizedRelatedLinks={};e.forEach(function(b){var a=b.relatedLink,f=b.command;b=b.invocation;if(!g||-1===g.indexOf(a.id)){var d=a.category;this._categorizedRelatedLinks[d]=this._categorizedRelatedLinks[d]||[];this._categorizedRelatedLinks[d].push({title:f.name,order:a.order||100,href:f.hrefCallback.call(b.handler,b)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var e=new URL(window.location.href);this._currentCategory=e.hash="";Object.keys(this._categorizedPageLinks).some(function(b){if(this._categorizedPageLinks[b].some(function(a){var f=new URL(a.href);a.hash="";return e.href===f.href}))return this._currentCategory=b,!0},this);var g=document.createElement("ul");g.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 f=document.createElement("a");f.classList.add("submenu-trigger");if("string"===typeof b.imageDataURI&&0===b.imageDataURI.indexOf("data:image")){var d=document.createElement("img");d.width="16";d.height="16";d.src=b.imageDataURI;f.appendChild(d)}else f.classList.add(b.imageClass||"core-sprite-blank-menu-item");a.appendChild(f);g.appendChild(a);this._categorizedAnchors[b.id]=f},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(g);this._show=m.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(k,"closed");this._contentNode.style.left="0"},toggle:function(){var h=this._contentNode;h&&h.classList.add("content-fixedHeight-animation");this._state="open"===this._state?"closed":"open";this._state===e?localStorage.removeItem(k):localStorage.setItem(k,this._state);this.render()},
_updateCategoryAnchors:function(){var e=[];Object.keys(this._categorizedRelatedLinks).forEach(function(g){("git"===g||g.match(/-scm$/))&&e.push(g)});Object.keys(this._categorizedAnchors).forEach(function(g){var b=this._categorizedAnchors[g],a=[];g===this._currentCategory?(b.parentElement.style.display="",b.href="",b.onclick=function(){return!1},b.title=b.parentElement.categoryName):(this._categorizedPageLinks[g]&&a.push.apply(a,this._categorizedPageLinks[g]),this._categorizedRelatedLinks[g]&&a.push.apply(a,
this._categorizedRelatedLinks[g]),0===a.length||0!==e.length&&("git"===g||g.match(/-scm$/))&&-1===e.indexOf(g)?(b.href="",b.title=b.parentElement.categoryName,b.parentElement.style.display="none"):(b.parentElement.style.display="",a.sort(function(a,d){return a.order<d.order?-1:d.order<a.order?1:a.title.localeCompare(d.title)}),g=a.shift(),b.href=g.href,b.title=g.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var e=n.matchResourceParameters().resource,g=(new URL(e,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(g).then(function(f){if(e===n.matchResourceParameters().resource){var d="";f.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 m});
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(l,
n,m,k,e,h,g,b,a,f,d,p,q,u,t,y,v,x,s,w,z,C,r,A,D,B,E,K,L,F,G,H,I,P,J){function V(a,d){if(a.getLabel)return a.getLabel();var f=new r;f.resolve(d.properties.name);return f}function U(a){q.node("progressPane").setAttribute("aria-label",l["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function S(a,d){var f=a.getServiceReferences("orion.core.auth");ca=[];var b=O.createMenuGenerator.apply(this,arguments);if(b)for(var g=0;g<
f.length;g++){var e=f[g],r=a.getService(e);V(r,e).then(function(a){r.getKey().then(function(d){ca.push(d);r.getUser().then(function(f){b.addUserItem(d,r,a,f)},function(f,g){b.addUserItem(d,r,a,g)});window.addEventListener("storage",function(f){M[d]!==localStorage.getItem(d)&&(M[d]=localStorage.getItem(d),r.getUser().then(function(f){b.addUserItem(d,r,a,f)},function(f){b.addUserItem(d,r,a)}))},!1)})})}}function W(a){return a}function T(d,f,b,e,p){function h(){if(u)return u;var a=d.getService("orion.core.contentTypeRegistry");
a||(a=new v.ContentTypeRegistry(d),a=d.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return u=a})}function k(a){for(var d={},f=a.getPropertyKeys(),b,g=0;g<f.length;g++)b=f[g],d[b]=a.getProperty(b);return d}function A(a,d){var f=null;a.some(function(a){return d===a.getProperty("id")?!!(f=a):!1});return f}function D(a){var d=a.command;return!d.visibleWhen||d.visibleWhen(f)?(a.invocation=new g.CommandInvocation(f,f,null,d,e),(new r).resolve(a)):"function"===
typeof p?(t||(t=p()),r.when(t,function(b){if(b&&f===$&&(!d.visibleWhen||d.visibleWhen(b)))return a.invocation=new g.CommandInvocation(b,b,null,d,e),a})):(new r).resolve()}function q(a,d,f){return f?(new r).resolve({relatedLink:a,command:f}):d.then(function(d){return{relatedLink:a,command:new g.Command(d)}})}var l=arguments,u,t,m=d&&d.getServiceReferences("orion.page.link.related");if(m&&0!==m.length){var B=this;r.when(h(),function(){if(O.beforeGenerateRelatedLinks.apply(B,l)){var f=d.getServiceReferences("orion.navigate.command"),
g=[];m.forEach(function(b){var r=k(b);if(r.id){var p;if((r.nls&&r.nameKey||r.name)&&r.uriTemplate)p=a._createCommandOptions(r,b,d,u,!0),g.push(q(r,p,null));else if(p=A(f,r.id)){var h=k(p);b={};J.mixin(b,h,r);(r=e.findCommand(r.id))?g.push(q(b,null,r)):(p=a._createCommandOptions(h,p,d,u,!0),g.push(q(b,p,null)))}}});r.all(g,W).then(function(a){a.sort(function(a,d){return a.command.name.localeCompare(d.command.name)});return r.all(a.map(D),W).then(function(d){var f=[];d=d.filter(function(d,b){if(d)return!0;
f.push(a[b]);return!1});O.addRelatedLinkCommands.call(B,e,d,f,b);O.afterGenerateRelatedLinks.apply(B,l)})})}})}}function ba(a){var d=q.node("globalActions");d&&(a.destroy(d),a.renderCommands(d.id,d,{},{},"tool"))}function X(a){var d=window.getComputedStyle(a,null);return null===d||"absolute"===d.getPropertyValue("position")||!a.parentNode||a===document.body?a:X(a.parentNode)}function Q(a){var d={},f=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var b=a;b&&b.classList;){if(b.classList.contains("toolComposite")){f=
b;break}b=b.parentNode}a.classList.contains("commandMarker")&&(d.commandNode=a);f||(f=q.node("pageToolbar"));f&&(d.slideContainer=q.$(".slideParameters",f),d.parameterArea=q.$(".parameters",f),d.dismissArea=q.$(".parametersDismiss",f),d.notifications=q.$("#notificationArea",f),f.parentNode&&(d.toolbarTarget=q.$(".toolbarTarget",f.parentNode),d.toolbarTarget&&(a=q.bounds(d.toolbarTarget),b=q.bounds(X(d.toolbarTarget.parentNode)),d.toolbarTargetY=a.top-b.top,d.toolbar=f)));return d}function N(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var d=q.bounds(a),f=q.bounds(a.parentNode);a.style.left=(f.width-d.width)/2+"px";a.style.top="0"}}h=function(a){var d=document.createElement("a");d.href=a;return d.href}(n.toUrl("auth/NotifyAuthentication.html"));var M={},O={createMenuGenerator:H.createMenuGenerator||function(a,d){if(q.node("userMenu")){var f=q.node("userDropdown"),b=new t.Dropdown({dropdown:f}),f=new A.UserMenu({dropdownNode:f,dropdown:b,
serviceRegistry:a}),b=q.node("userTrigger");new y.Tooltip({node:b,text:l.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),g=b.className;b.className=g+" imageSprite core-sprite-silhouette";f.setKeyAssist(d);return f}},beforeGenerateRelatedLinks:H.beforeGenerateRelatedLinks||function(a,d,f,b,g){return!0},addRelatedLinkCommands:H.addRelatedLinkCommands||function(a,d,f,b){this.sideMenu&&this.sideMenu.setRelatedLinks(d,b)},afterGenerateRelatedLinks:H.afterGenerateRelatedLinks||
function(a,d,f,b,g){},afterSetPageTarget:H.afterSetPageTarget||function(a){},generateNavigationMenu:H.generateNavigationMenu||function(a,d,f,b,g,e,r){if(a=q.node("sideMenu"))d=q.node("centralNavigation"),new y.Tooltip({node:d,text:l.CentralNavTooltip,position:["right"]}),this.sideMenu=new P(a,q.node("pageContent")),d.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:H.afterGenerateNavigationMenu||
function(a,d,f,b,g,e,r){},afterGenerateBanner:H.afterGenerateBanner||function(a,d,f,b,g,e,r){}},ca=[],$,Y=[],R,aa=null,Z=null,da=new e;return{generateBanner:function(a,d,f,e,p,h,A,t){function y(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var d=q.$$array(".targetSelector"),f=0;f<d.length;f++)d[f].target=a}},{pid:"nav.config"})}(new z.ThemePreferences(e,new C.ThemeData)).apply();var w=q.node(a);
if(!w)throw l["could not find banner parent, id was "]+a;var v=document.createRange();v.selectNode(w);v=v.createContextualFragment(E);q.processTextNodes(v,l);w.firstChild?w.insertBefore(v,w.firstChild):w.appendChild(v);w=q.node("home");w.href=n.toUrl("edit/edit.html");w.setAttribute("aria-label",l["Orion Home"]);q.node("progressPane").src=g.NO_IMAGE;if(w=q.node("pageToolbar"))w.classList.add("toolbarLayout"),w.innerHTML=L+m.slideoutHTMLFragment("mainToolbar");(w=q.node("closeNotifications"))&&w.setAttribute("aria-label",
l["Close notification"]);if(17>=G.isFirefox&&(w=q.node("staticBanner")))w.style.width="100%",w.style.MozBoxSizing="border-box";if(w=q.node("footer"))w.innerHTML=K,q.processTextNodes(w,l);f.setParameterCollector(new b.CommandParameterCollector(Q,N));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=d.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);w=D.getCategoriesInfo(d);
v=D.getPageLinksInfo(d,"orion.page.link");r.all([w,v]).then(function(a){if(this.sideMenu){var d=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(d);this.sideMenu.render()}}.bind(this));if(w=q.$(".split")){var v=q.$(".sidePanelLayout"),x=q.$(".mainPanelLayout");v&&x&&(aa={side:v,main:x},aa.splitter=new u.Splitter({node:w,sidePanel:v,mainPanel:x,toggle:!0,closeByDefault:t}),w=new g.Command({name:l["Toggle side panel"],tooltip:l["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){aa.splitter.toggleSidePanel()}}),f.addCommand(w),f.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new k.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1)))}var F=!1,H=function(a,d){if(!F){var f=d.getService("orion.page.progress"),b=new B.OpenResourceDialog({searcher:a,progress:f,searchRenderer:a.defaultRenderer,onHide:function(){F=!1}});window.setTimeout(function(){F=!0;b.show()},0)}},w=new g.Command({name:l["Find File Named..."],tooltip:l["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){H(p,d)}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new k.KeyBinding("f",!0,!0));var P=!1,w=function(){if(P)return!1;var a=q.node("banner"),d=q.node("footer"),f=q.node("sideMenu"),b=q.$(".content-fixedHeight"),g="hidden"===a.style.visibility;g?(a.style.visibility="visible",d.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized"),f&&f.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",d.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"),f&&f.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!g});return!0};window.orionNoTrim?(w(),P=!0,this.sideMenu.hide()):(w=new g.Command({name:l["Toggle banner and footer"],tooltip:l["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:w}),f.addCommand(w),f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new k.KeyBinding("m",!0,!0)));
w=new g.Command({name:l["System Configuration Details"],tooltip:l["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return n.toUrl("help/about.html")}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new k.KeyBinding(112,!0,!0));w=new g.Command({name:l["Background Operations"],tooltip:l["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return n.toUrl("operations/list.html")}});f.addCommand(w);
f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new k.KeyBinding("o",!0,!0));Z=new s.KeyAssistPanel({commandRegistry:f});w=new g.Command({name:l["Show Keys"],tooltip:l["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Z.isVisible()?Z.hide():Z.show();return!0}});f.addCommand(w);f.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new k.KeyBinding(191,!1,!0));ba(f);S(d,w.callback);U(d);window.addEventListener("hashchange",
function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){y(d)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:Q,getMainSplitter:function(){return aa},getKeyAssist:function(){return Z},getGlobalEventTarget:function(){return da},layoutToolbarElements:N,setPageTarget:function(a){var d,f,b=a.breadcrumbRootName,g=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(f=(b?b+" ":"")+a.fileService.fileServiceName(a.target.Location),b=null),d=a.name||a.target.Name,$=a.target,T.call(this,g,a.target,Y,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(b=b||a.task||a.name),d=a.name,T.call(this,g,{NoTarget:""},Y,a.commandService,a.makeAlternate));(R=a.title)||(R=d?d+" - "+a.task:a.task);window.document.title=R;O.afterSetPageTarget.apply(this,arguments);if(d=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(d),a.staticBreadcrumb)new p.BreadCrumbs({container:d,
rootSegmentName:b});else{var e=g&&new I.FileClient(g),g=a.breadcrumbTarget||a.target,e=e&&g&&g.Location?e.fileServiceRootURL(g.Location):null;new p.BreadCrumbs({container:d,resource:g,rootSegmentName:b,workspaceRootSegmentName:f,workspaceRootURL:e,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){R&&("*"===R.charAt(0)&&!a&&(R=R.substring(1)),a&&"*"!==R.charAt(0)&&(R="*"+R),window.document.title=R);var d=q.node("dirty");d&&(d.textContent=a?"*":"")},
setPageCommandExclusions:function(a){Y=a},notifyAuthenticationSite:h}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(l){return{detectValidURL:function(n){for(var m=/\[([^\]]*)\]\(([^\)]+)\)/g,k=m.exec(n),e=[],h=0;k;){if(3===k.length&&0<k[2].length){var g=new URL(k[2]);":"!==g.protocol&&l.validateURLScheme(g.href)&&(k.index>h&&e.push({segmentStr:n.substring(h,k.index)}),e.push({segmentStr:0<k[1].length?k[1]:k[2],urlStr:k[2]}),h=k.index+k[0].length)}k=m.exec(n)}if(0===h)return null;h<n.length&&e.push({segmentStr:n.substring(h)});return e},processURLSegments:function(l,
m){m.forEach(function(k){if(k.urlStr){var e=document.createElement("a");e.href=k.urlStr;e.appendChild(document.createTextNode(k.segmentStr))}else e=document.createElement("span"),e.textContent=k.segmentStr;l.appendChild(e)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(l,n,m,k){function e(g,b,a,f,d){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=d;this.domId=a;this.progressDomId=f||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var h;e.prototype={_init:function(){var g=n.node("closeNotifications");if(g&&
!this._hookedClose){g.style.cursor="pointer";this._hookedClose=!0;var b=n.node(this.notificationContainerDomId);n.addAutoDismiss([b],function(){this._clickToDisMiss&&this.close()}.bind(this));g.addEventListener("click",function(){this.close()}.bind(this));b.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=n.$$("a",b))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var g=n.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&g?(g.innerHTML="",g.classList.remove("cancelButton"),g.classList.add("dismissButton"),g.classList.add("core-sprite-close"),g.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=m.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(g,b,a){this._init();this.currentMessage=g;var f=n.node(this.domId);
if("boolean"===typeof a){var d=f.getAttribute("aria-live");f.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){g===this.currentMessage&&(n.empty(f),f.appendChild(document.createTextNode(g)),window.setTimeout(function(){f.setAttribute("aria-live",d)},100))}.bind(this),100)}else n.empty(f),f.appendChild(document.createTextNode(g));"number"===typeof b&&window.setTimeout(function(){g===this.currentMessage&&(n.empty(f),f.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(g){this._clickToDisMiss=
!0;this.currentMessage=g;this._init();var b=g.responseText||g.message||g;if("string"===typeof b)try{b=JSON.parse(b)}catch(a){}g=b.Message||b;var f="red";if(b.Severity)switch(b.Severity){case "Warning":f="#FFCC00";break;case "Error":f="red";break;case "Info":case "Ok":f="green"}b=document.createElement("span");b.style.color=f;b.appendChild(document.createTextNode(g));g=n.node(this.domId);n.empty(g);g.appendChild(b)},setProgressMessage:function(g){this._clickToDisMiss=!1;this._init();this.currentMessage=
g;var b=document.createElement("span");b.classList.add("progressIcon");var a=n.node(this.progressDomId);n.empty(a);a.appendChild(b);a.appendChild(document.createTextNode(g));b=n.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(g&&0<g.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(g){this._cancelFunc=g},setProgressResult:function(g,b){this._clickToDisMiss=!1;this._cancelMsg=b;this.currentMessage=g;var a=g.responseText||g;if("string"===typeof a)try{a=JSON.parse(a)}catch(f){}this._init();var d=a.Message||a.toString(),e=l.UnknownError,h="core-sprite-information",u="progressNormal",t=document.createElement("span");t.classList.add("imageSprite");t.classList.add("progressIcon");var m=[];if(a.Severity)switch(a.Severity){case "Warning":e=l.UnknownWarning;
h="core-sprite-warning";u="progressWarning";m.push("progressInfo");m.push("progressError");m.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":h="core-sprite-error";u="progressError";m.push("progressWarning");m.push("progressInfo");m.push("progressNormal");this._clickToDisMiss=!0;break;default:u="progressNormal",m.push("progressWarning"),m.push("progressError"),m.push("progressNormal")}m.push("notificationHide");t.classList.add(h);var v=n.node(this.progressDomId),h=n.node(this.notificationContainerDomId);
n.empty(v);v.appendChild(t);d===Object.prototype.toString()&&(d=e);a.HTML?(a=document.createElement("span"),a.innerHTML=d,v.appendChild(a)):((e=k.detectValidURL(d))?(d=document.createDocumentFragment(),k.processURLSegments(d,e),Array.prototype.forEach.call(n.$$("a",d),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)),
d=document.createTextNode(d)),v.appendChild(d));if(u&&this.progressDomId!==this.domId){h.classList.add(u);for(u=0;u<m.length;u++)h.classList.remove(m[u])}h.classList.add("notificationShow");if(m=n.node("closeNotifications"))this._cancelMsg?(m.classList.add("cancelButton"),m.classList.remove("dismissButton"),m.classList.remove("core-sprite-close"),m.classList.remove("imageSprite"),m.innerHTML=this._cancelMsg):(m.innerHTML="",m.classList.remove("cancelButton"),m.classList.add("dismissButton"),m.classList.add("core-sprite-close"),
m.classList.add("imageSprite"))},showWhile:function(g,b){var a=this;if(b){a.setProgressMessage(b);var f=function(){b===a.currentMessage&&a.setProgressMessage("")};g.then(f,f)}return g},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(g,b){return new h(this,++this._lastProgressId,g,b)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var g="",b=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(b||(g+=", "),g+=this._progressMonitors[a].status,
b=!1);this.setProgressMessage(g)}else this.setProgressMessage("")},_beginProgressMonitor:function(g){this._progressMonitors[g.progressId]=g;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(g){this._progressMonitors[g.progressId]=g;this._renderOngoingMonitors()},_doneProgressMonitor:function(g){delete this._progressMonitors[g.progressId];this._progressMonitors.length--;g.status?this.setProgressResult(g.status):this._renderOngoingMonitors()}};e.prototype.constructor=
e;h=function(g,b,a,f){this.statusService=g;this.progressId=b;if(a){this.deferred=a;this.begin(f);var d=this;a.then(function(a,f){d.done.bind(d)()},function(a,f){d.done.bind(d)()})}};h.prototype.begin=function(g){this.status=g;this.statusService._beginProgressMonitor(this)};h.prototype.done=function(g){this.status=g;this.statusService._doneProgressMonitor(this)};h.prototype.worked=function(g){this.status=g;this.statusService._workedProgressMonitor(this)};h.prototype.constructor=h;return{StatusReportingService:e,
ProgressMonitor:h}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(l,n,m,k){function e(){}e.prototype={_initialize:function(e,g,b,a,f){this._tooltip=new k.Tooltip({node:e,hideDelay:f||0,afterShowing:this._afterShowingFunction(g).bind(this),afterHiding:b,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";e=document.createRange();e.selectNode(this.$parent);e=e.createContextualFragment(this.TEMPLATE);
this.messages&&m.processTextNodes(e,l);this.$parent.appendChild(e);var d=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&d.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(e){for(var g=0;g<e.childNodes.length;g++){var b=e.childNodes[g];b.id&&(this["$"+b.id]=b);this._bindElements(b)}},_afterShowingFunction:function(e){return function(){e&&e.bind(this)();if(!this.customFocus){var g=
m.firstTabbable(this.$parent);g&&g.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};e.prototype.constructor=e;return{PopupDialog:e}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(l,n,m,k){var e={};(function(){var h=!1;e.updateNavTools=function(g,b,a,f,d,e){var k=m.node(f);if(k)b.destroy(k);else throw l["could not find toolbar "]+f;b.renderCommands(f,k,e,a,"button");if(d&&(f=m.node(d)))b.destroy(f),b.renderCommands(d,f,null,a,"button");h||(h=!0,g.getService("orion.page.selection").addEventListener("selectionChanged",function(f){var g=m.node(d);
g&&(b.destroy(g),b.renderCommands(d,g,f.selections,a,"button"))}))};e.createOperationsCommands=function(g,b,a){function f(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var d=new k.Command({name:l["Remove Completed"],tooltip:l["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(d){a.removeCompletedOperations().then(function(a){b.loadOperations.bind(b)()})},visibleWhen:function(a){return!0}});g.addCommand(d);
d=new k.Command({name:l.Remove,tooltip:l["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(d){d=Array.isArray(d.items)?d.items:[d.items];for(var f=0;f<d.length;f++){var g=d[f];a.removeOperation.bind(a)(g.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!f(a);for(var d in a)if(f(a[d]))return!1;return!0}});g.addCommand(d);
d=new k.Command({name:l.Cancel,tooltip:l["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 d=0;d<a.length;d++){var f=a[d];f.deferred&&f.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return f(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var d in a)if(!f(a[d])||!a[d].operation||!a[d].operation.cancelable)return!1;return!0}});g.addCommand(d)}})();
return e});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(l,n,m,k,e){function h(g){this._options=g}h.prototype=new k.PopupDialog;h.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';h.prototype._init=
function(g){this._myOperations=[];this._operationsDeferreds=[];this._commandService=g.commandRegistry;e.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(g.triggerNode)};h.prototype._bindToDom=function(g){this.$allOperationsLink.href=n.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(g,b){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(g)for(var a in g)this._myOperations.push(g[a]),this._operationsDeferreds.push(b[a]);this._renderOperations()};h.prototype.parseProgressResult=function(g){if(!g)return{};g=g.responseText||g;try{g=JSON.parse(g)}catch(b){}var a={Message:g.Message||g,Severity:g.Severity};g.DetailedMessage&&g.DetailedMessage!==a.Message&&(a.DetailedMessage=g.DetailedMessage);return a};h.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};h.prototype._renderOperationsTable=function(g,b,a){m.empty(g);for(var f=0;f<b.length;f++){var d=b[f],e=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px";h.style.paddingRight="5px";h.textContent=d.Name;e.appendChild(h);var k=document.createElement("div");h.appendChild(k);h=document.createElement("span");h.style.paddingRight="5px";h.classList.add("imageSprite");switch(d.type){case "Warning":h.classList.add("core-sprite-warning");
h.setAttribute("aria-label",l["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",l["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",l["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");h.setAttribute("aria-label",l["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label",
"Operation ok.")}k.appendChild(h);h=document.createElement("span");h.classList.add("operationStatus");h.textContent=d.Name;k.appendChild(h);if(d.error){var t=d.error.Message||d.error;d.error.DetailedMessage&&""!==d.error.DetailedMessage&&(t+=": "+d.error.DetailedMessage);h.textContent=t;h.classList.remove("operationStatus");h.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",k,{operation:d,deferred:a[f]},this,"tool");g.appendChild(e)}this._setOperationsVisibility()};
h.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"};h.prototype.constructor=h;return{OperationsDialog:h}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(l,n,m,k,e){function h(b,a){if(!this._progressPane){this._progressPane=k.node(b);this._operationsDialog=new e.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var f=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===k.KEY.ENTER)&&f._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){f._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function g(b,a,f,d){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=f;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=d}h.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 f={},d;for(d in b)b[d].progressMonitor||(f[d]=b[d]);if(this._isEmpty(f))this._switchIconTo("progressPane_empty"),this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var g="";for(d in f){var e=f[d];if(e.type&&("loadstart"===e.type||"progress"===e.type)){g=
"running";break}}""===g&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==g;switch(g){case "running":this._progressPane.title=l["Operations running"];this._progressPane.alt=l["Operations running"];this._progressPane.setAttribute("aria-valuetext",l["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=l["Some operations finished with warning"];this._progressPane.alt=l["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=l["Some operations finished with error"];this._progressPane.alt=l["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(f,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};h.prototype.constructor=h;g.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new h(b,this._commandRegistry))},progress:function(b,a,f){var d=this,g=this._operationsIndex++;!f&&this._progressMonitorClass&&(f=new this._progressMonitorClass,f.begin(a));b.then(function(e){d._operations[g]&&
(e=d._operations[g],a&&(e.Name=a),d._lastOperation=e,e.type="loadend",f&&(e.progressMonitor=f),d.writeOperation.bind(d)(g,e,b),e.Location||d._removeOperationFromTheList.bind(d)(g))},function(e){if(d._operations[g]){var h=d._operations[g];a&&(h.Name=a);f&&(h.progressMonitor=f);d._lastOperation=h;h.type=e.canceled?"abort":"error";h.error=e;d.writeOperation.bind(d)(g,h,b);h.Location||d._removeOperationFromTheList.bind(d)(g)}},function(e){a&&(e.Name=a);f&&(e.progressMonitor=f);d.writeOperation.bind(d)(g,
e,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,f){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){f?d._serviceRegistry.getService("orion.page.message").setProgressMessage(""):d.setProgressResult.bind(d)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,f){this._operations[b]=a;this._operationDeferrds[b]=f;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(d){d.put(a.Location,{Name:a.Name,expires:a.expires})});
a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};g.prototype.constructor=g;return{ProgressService:g}});define("orion/dialogs",[],function(){function l(l){this._serviceRegistry=l;this._serviceRegistration=l.registerService("orion.page.dialog",this)}l.prototype={confirm:function(l,m){m(window.confirm(l))},openFiles:function(l){}};l.prototype.constructor=l;return{DialogService:l}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(l,n){function m(k,e){e||(e="orion.page.selection");this._serviceRegistry=k;l.attach(this);this._serviceRegistration=k.registerService(e,this);this._selections=null}m.prototype={getSelection:function(k){var e=this._getSingleSelection();"function"===typeof k&&k(e);return e},getSelections:function(k){var e=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof k&&k(e);return e},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(k){var e=this._selections;Array.isArray(k)?this._selections=0<k.length?k.slice():null:this._selections=k?[k]:null;e!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};m.prototype.constructor=m;return{Selection:m}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(l,n){function m(g,b,a){return g[b].apply(g,a)}function k(g){this._location=g}function e(){var g=new n;g.reject(l["No Matching OperationService for location:"]+this._location);return g}function h(g){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=g.getService("orion.core.preference");for(var b=g.getServiceReferences("orion.core.operation"),
a=0;a<b.length;a++){var f=g.getService(b[a]);this._services[a]=f;f=b[a].getProperty("pattern")||".*";"^"!==f[0]&&(f="^"+f);this._patterns[a]=RegExp(f)}this._getService=function(a){if(!a)return this._services[0];for(var f=0;f<this._patterns.length;++f)if(this._patterns[f].test(a))return this._services[f];this._operations.remove(a);return new k(a)}}k.prototype={getOperation:e,getOperations:e,removeCompletedOperations:e,removeOperation:e,cancelOperation:e};k.prototype.constructor=k;h.prototype={getOperations:function(){var g=
new n;if(this._operations)return g.resolve(this._operations),g;var b=this;this._preferenceService.getPreferences("/operations").then(function(a){b._operations=a;g.resolve(b._operations)});return g},getOperation:function(g){return m(this._getService(g),"getOperation",arguments)},removeCompletedOperations:function(){for(var g=[],b=this,a=0;a<this._services.length;a++){var f=this._patterns[a],d=new n;g[a]=d.promise;m(this._services[a],"removeCompletedOperations").then(function(a){return function(d){Array.isArray(d)&&
b.getOperations.bind(b)().then(function(b){for(var g=b.keys(),e=0;e<g.length;e++){var h=g[e];f.test(h)&&0>d.indexOf(h)&&b.remove(h)}a.resolve()})}}(d),function(a){return function(d){a.reject(d)}}(d))}return n.all(g)},removeOperation:function(g){var b=this;return m(this._getService(g),"removeOperation",arguments).then(function(a){b.getOperations.bind(b)().then(function(a){a.remove(g)})},function(a){return a},function(a){return a})}};h.prototype.constructor=h;return{OperationsClient:h}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var e=k.parent,h=this,e=n.node(e);if(!e)throw l["no parent"];if(!k.model)throw l["no tree model"];if(!k.renderer)throw l["no renderer"];this._parent=e;this._treeModel=k.model;this._onComplete=k.onComplete;this._renderer=k.renderer;this._showRoot=void 0===k.showRoot?!1:k.showRoot;this._indent=void 0===k.indent?16:k.indent;this._onCollapse=k.onCollapse;
this._labelColumnIndex=void 0===k.labelColumnIndex?0:k.labelColumnIndex;this._id=void 0===k.id?"treetable":k.id;this._tableStyle=k.tableStyle;this._tableElement=k.tableElement||"table";this._tableBodyElement=k.tableBodyElement||"tbody";this._tableRowElement=k.tableRowElement||"tr";this._treeModel.getRoot(function(g){h._root=g;h._showRoot?(g._depth=0,h._generate([g],0)):h._treeModel.getChildren(g,function(b){h.destroyed||h._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(k,
e){n.empty(this._parent);var h=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(h);var g=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(g);g.id=this._id;this._tableStyle&&g.classList.add(this._tableStyle);this._renderer.initTable(g,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===k.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(k,e);g.appendChild(this._bodyElement);h.appendChild(g);this._parent.appendChild(h);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(k,e,h){for(var g=0;g<k.length;g++){var b=document.createElement(this._tableRowElement);b.id=this._treeModel.getId(k[g]);b._depth=e;b._item=k[g];this._renderer.render(k[g],b);var a=this._indent*e;b.childNodes[Math.min(b.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(b,k[g]);h?(this._bodyElement.insertBefore(b,h.nextSibling),h&&(h=b)):this._bodyElement.appendChild(b)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(k,e,h){var g=this._treeModel.getId(k),b;if(g===this._id)this._removeChildRows(g),this._generateChildren(e,0),this._rowsChanged();else if(g===
this._treeModel.getId(this._root)&&k.removeAll)this._removeAllRows(),this._generateChildren(e,0),this._rowsChanged();else{var a=n.node(g);a?(a._item=k,a&&(h||a._expanded)?(this._removeChildRows(g),e?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(e,a._depth+1,a),this._rowsChanged()):(b=this,this._renderer.updateExpandVisuals(a,"progress"),e=this._treeModel.getChildren(a._item,function(f){b.destroyed||(b._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,b._generateChildren(f,a._depth+1,a),b._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(l["could not find table row "]+g)}},getItem:function(k){var e=n.node(k);return e&&e._item?e._item:k},toggle:function(k){var e=n.node(k);e&&(e._expanded?this.collapse(k):this.expand(k))},isExpanded:function(k){k="string"===typeof k?k:this._treeModel.getId(k);return(k=n.node(k))?k._expanded:!1},expand:function(k,e,h){k="string"===typeof k?k:this._treeModel.getId(k);var g=n.node(k);if(g){var b=
this;g._expanded?e&&e.apply(b,h):(this._renderer.updateExpandVisuals(g,"progress"),this._treeModel.getChildren(g._item,function(a){b.destroyed||(b._renderer.updateExpandVisuals(g,!0),g._expanded||(g._expanded=!0,b._generateChildren(a,g._depth+1,g),b._rowsChanged()),e&&e.apply(b,h))}))}},_removeChildRows:function(k){for(var e=k===this._id,h=!1,g=-1,b=[],a=n.$$array(".treeTableRow",this._parent),f=0;f<a.length;f++){var d=a[f];if(h)break;e?d._depth>g?b.push(d):h=!0:d.id===k&&(e=!0,g=d._depth)}for(k=
0;k<b.length;k++)e=b[k],e.parentNode.removeChild(e)},_removeAllRows:function(){for(var k=n.$$array(".treeTableRow",this._parent),e=0;e<k.length;e++)k[e].parentNode.removeChild(k[e])},collapse:function(k){k="string"===typeof k?k:this._treeModel.getId(k);var e=n.node(k);if(e){if(!e._expanded)return;e._expanded=!1;this._renderer.updateExpandVisuals(e,!1);this._removeChildRows(k);this._rowsChanged()}this._onCollapse&&this._onCollapse(e._item)},getIndent:function(){return this._indent}};m.prototype.constructor=
m;return{TableTree:m}});
define("orion/treeModelIterator",[],function(){var l={};l.TreeModelIterator=function(){function l(m,k){this.firstLevelChildren=m;this.reset();this._init(k)}l.prototype={_init:function(l){l&&(this.isExpanded=l.isExpanded,this.isExpandable=l.isExpandable,this.forceExpandFunc=l.forceExpandFunc,this.getChildrenFunc=l.getChildrenFunc)},topLevel:function(l){return l.parent?l.parent===this.root:!0},_getChildren:function(l){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(l):l?l.children:
null},_expanded:function(l){if(!l)return!0;var k=this._getChildren(l),k=k&&0<k.length;this.isExpanded&&k&&(k=this.isExpanded(l));return k},_expandable:function(l){return!l?!0:this.isExpandable?this.isExpandable(l):!1},_diveIn:function(l){return this._expanded(l)?(l=this._getChildren(l),this.setCursor(l[0]),this.cursor()):null},_drillToLast:function(l){return this._expanded(l)?(l=this._getChildren(l),this._drillToLast(l[l.length-1])):l},_forward:function(l){if(!this._cursor)return null;var k=this._diveIn(this._cursor);
if(!k){if(l&&this._expandable(this._cursor)&&this.forceExpandFunc){var e=this;return this.forceExpandFunc(this._cursor,"first",function(h){h&&e.setCursor(h)})}(k=this._findSibling(this._cursor,!0))&&this.setCursor(k)}return k},_backward:function(l){if(!this._cursor)return null;var k=this._findSibling(this._cursor,!1);k&&k!==this._cursor.parent&&(k=this._drillToLast(k));if(l&&k&&this._expandable(k)&&this.forceExpandFunc&&k!==this._cursor.parent){var e=this;return this.forceExpandFunc(k,"last",function(h){h&&
e.setCursor(h)})}k&&this.setCursor(k);return k},_findSibling:function(l,k){for(var e=this.topLevel(l),h=this._getChildren(l.parent),h=e?this.firstLevelChildren:h,g=0;g<h.length;g++)if(h[g]===l)return 0===g&&!k?e?null:l.parent:g===h.length-1&&k?e?null:this._findSibling(l.parent,k):k?h[g+1]:h[g-1];return null},_inParentChain:function(l,k){for(var e=l.parent;e;){if(e===k)return!0;e=e.parent}return!1},_getTopLevelParent:function(l){if(this.topLevel(l))return l;for(l=l.parent;l;){if(this.topLevel(l))return l;
l=l.parent}return null},_onCollapse:function(l){return this._expanded(l.parent)?l:this._onCollapse(l.parent)},_scan:function(l,k,e){this.setCursor(k);var h=[];for(h.push(k);;){if(this.iterate(l))h.push(this.cursor());else break;if(e===this.cursor())return h}return null},setCursor:function(l){this._prevCursor=this._cursor;this._cursor=l},setTree:function(l){this.firstLevelChildren=l;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(l,k){var e=this.cursor(),
h=this._scan(!0,l,k);h||(h=this._scan(!1,l,k));this.setCursor(e);return h},iterate:function(l,k){return l?this._forward(k):this._backward(k)},iterateOnTop:function(l,k){var e=this._findSibling(this._getTopLevelParent(this.cursor()),l);e?this.setCursor(e):k&&0<this.firstLevelChildren.length&&this.setCursor(l?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(l){return!this._cursor?null:this._inParentChain(this._cursor,l)?(this.setCursor(l),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 l}();return l});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(l,n,m){var k={},e=-1!==navigator.userAgent.indexOf("iPad"),h=-1!==window.navigator.platform.indexOf("Mac");k.ExplorerNavHandler=function(){function g(b,a,f){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 d=this;this._modelIterator=
new n.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:f.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return d.explorer.renderer.isExpandable(a)}:function(a){return d.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,f,b){return d.explorer.forceExpandFunc(a,f,b)}:void 0});this._init(f);(!f||!1!==f.setFocus)&&b.focus();f=function(a){if(m.isFormElement(a.target)||d.explorer.preventDefaultFunc&&d.explorer.preventDefaultFunc(a,
d._modelIterator.cursor()))return!0;if(a.keyCode===l.KEY.DOWN)return d.onDownArrow(a);if(a.keyCode===l.KEY.UP)return d.onUpArrow(a);if(a.keyCode===l.KEY.RIGHT)return d.onRightArrow(a);if(a.keyCode===l.KEY.LEFT)return d.onLeftArrow(a);if(a.keyCode===l.KEY.SPACE)return d.onSpace(a);if(a.keyCode===l.KEY.ENTER)return d.onEnter(a)};b.addEventListener("keydown",f,!1);this._listeners.push({type:"keydown",listener:f});f=function(a){if(d.explorer.onFocus)d.explorer.onFocus(!1);else d.toggleCursor(null,!1)};
b.addEventListener("blur",f,!1);this._listeners.push({type:"blur",listener:f});f=function(a){if(d.explorer.onFocus)d.explorer.onFocus(!0);else d.toggleCursor(null,!0)};b.addEventListener("focus",f,!1);this._listeners.push({type:"focus",listener:f});this._parentDiv=b}g.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 h?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):l.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:l.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 f=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){f._clearSelection(a);for(var g=0;g<d.length;g++)f._selections.push(d[g]);0<f._selections.length?f.cursorOn(f._selections[0],
!0,!1,b):f.cursorOn(null,!1,!1,b);f._shiftSelectionAnchor&&0<=f._inSelection(f._shiftSelectionAnchor)||(f._shiftSelectionAnchor=null)})},refreshModel:function(b,a,f,d){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():f&&(this.topIterationNodes=f);this._modelIterator.setTree(this.topIterationNodes);!d&&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,f){"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)),f&&(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 f=this._getGridChildren(b);if(f&&1<f.length||
0===a&&f){0!==a&&this.toggleCursor(b,!1);var d=this._currentColumn,g=!0,d=d+a;0>d?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():g=!1),d=g?f.length-1:this._currentColumn):d>=f.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():g=!1),d=g?0:this._currentColumn);this._currentColumn=d;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,f;b&&b!==a&&"grid"!==(f=b.getAttribute("role"))&&"tree"!==f&&"treegrid"!==f;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var f=this.getRowDiv(b),d=this.getCurrentGrid(b);d?(f&&(a?f.classList.add("treeIterationCursorRow"):f.classList.remove("treeIterationCursorRow")),d.domNode&&(f=this.getAriaContainerElement(d.domNode),
a?(d.domNode.classList.add("treeIterationCursor"),f&&f.setAttribute("aria-activedescendant",d.domNode.id)):d.domNode.classList.remove("treeIterationCursor"))):f&&(a?f.classList.add("treeIterationCursorRow_Dotted"):f.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,f,d){var g,e;if(b||a){if(e===this._modelIterator.cursor())return;g=this._modelIterator.cursor();e=b;this._modelIterator.setCursor(e)}else g=this._modelIterator.prevCursor(),
e=this._modelIterator.cursor();if(g!==e||a)if(this.toggleCursor(g,!1),!a||e){this.moveColumn(null,0);this.toggleCursor(e,!0);if((b=this.getRowDiv())&&!d){d=b.parentNode;for(a=document.documentElement;d&&d!==a;){var h=window.getComputedStyle(d,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;d=d.parentNode}d&&(a=!0,b.offsetTop<=d.scrollTop?(a=!1,void 0===f&&(f=!1)):b.offsetTop+b.offsetHeight>=d.scrollTop+d.clientHeight&&(a=!1,void 0===f&&(f=!0)),a||b.scrollIntoView(!f))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(g,
e)}},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:l.node(b)},iterate:function(b,a,f,d){var g=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(d){d=this.currentModel();for((g=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,f);g&&g.isNotSelectable;)(g=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,f);g||(this.cursorOn(d,!0,!1,!0),this._setCursorOnItem(b,f))}else(g=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,f)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(f){(f=this.getRowDiv(f))&&(a?f.classList.add(b):f.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var f=this._inSelection(this._modelIterator.prevCursor()),
d=this._inSelection(this._modelIterator.cursor());0<=f&&0<=d?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var f=this.getRowDiv(b);if(f){var d=l.node(this.explorer.renderer.getCheckBoxId(f.id)),g=a?!d.checked:!0;if(g!==d.checked)this.explorer.renderer.onCheck(f,d,g,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var f=this.getRowDiv(b);f&&(0>this._inSelection(b)?f.classList.add("checkedRow"):f.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var f=this._getGridChildren(b);if(f)for(var d=0;d<f.length;d++)if(a.target===f[d].domNode)return!0;return!1},onClick:function(b,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(b)))l.stop(a);else{var f=l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==f&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),e)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(f=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var d=0;d<f.length;d++)this.setSelection(f[d],!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(),f=this._getGridChildren(a);return f&&1<f.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 f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(f)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(f=this.explorer.renderer.getRowActionElement(this.model.getId(a)),f.href&&(this._ctrlKeyOn(b)?window.open(f.href):window.location.href=f.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 g}();k.ExplorerNavDict=function(){function g(b){this._dict={};this._model=b}g.prototype={addRow:function(b,a){var f=this._model.getId(b);this._dict[f]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var f=this._model.getId(b);return this._dict[f]?(!this._dict[f].gridChildren&&a&&(this._dict[f].gridChildren=[]),this._dict[f].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return g}();return k});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(l,n,m,k,e,h){var g={};g.Explorer=function(){function b(a,f,d,b){this.registry=a;this.renderer=d;this.selection=f;this.commandService=b;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,f){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,f,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceholder:function(a,f,d){var b=null;if(a=this.getRow(a)){var b=a.parentNode,g=document.createElement("tr");g.id=f+"placeHolderRow";g.classList.add("navRow");var e=document.createElement("td");e.id=f+"placeHolderCol";e.classList.add("navColumn");g.appendChild(e);
d?b.insertBefore(g,a.nextSibling):b.insertBefore(g,a);e.style.paddingLeft=a.firstChild.style.paddingLeft;b={wrapperNode:g,refNode:e,destroyFunction:function(){try{g&&g.parentNode&&g.parentNode.removeChild(g)}catch(a){}}}}return b},getRow:function(a){if(a=this.model.getId(a))return m.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),f=0;f<a.length;f++)this.myTree.collapse(a[f])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();
for(var f=0;f<a.length;f++)this._expandRecursively(a[f])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var f=this;this.myTree.expand(a,function(){f.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var b=a.length,g=0;g<b;g++)f._expandRecursively(a[g])})})}},createTree:function(a,f,d){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var b=a+"innerTree",
g=m.node(b);g&&m.empty(g);f&&(f.rootId=b);this.model=f;this._parentId=a;this._treeOptions=d;if(!d||d&&!d.noSelection)this.selectionPolicy=d?d.selectionPolicy:"",this._navDict=new e.ExplorerNavDict(this.model);this.myTree=new k.TableTree({id:b,model:f,parent:a,onComplete:d?d.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:d?!!d.showRoot:!1,indent:d?d.indent:void 0,onCollapse:d?d.onCollapse:void 0,navHandlerFactory:d?d.navHandlerFactory:void 0,
tableElement:d?d.tableElement:void 0,tableBodyElement:d?d.tableBodyElement:void 0,tableRowElement:d?d.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),f=[];if(a&&this.getNavDict())for(var d=a.getSelection(),b=0;b<d.length;b++){var g=a.getRowDiv(d[b]);g&&g.parentNode&&
(g=this.getNavDict().getValue(this.model.getId(d[b])),g.model&&f.push(g.model))}this.selection.setSelections(f)}},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 e.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var f=this;this.model.getRoot(function(d){d instanceof Array?f.getNavHandler().refreshModel(f.getNavDict(),f.model,d):d.children&&d.children instanceof Array&&f.getNavHandler().refreshModel(f.getNavDict(),f.model,d.children);a&&a.setFocus&&f.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();g.createExplorerCommands=function(b,a){function f(d){return"function"===
typeof d.getItemCount&&0<d.getItemCount()?a?a(d):!0:!1}var d=new h.Command({tooltip:l["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.expandAll()}}),g=new h.Command({tooltip:l["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.collapseAll()}});
b.addCommand(d);b.addCommand(g)};g.ExplorerModel=function(){function b(a,f,d){this.rootPath=a;this.fetchItems=f;this.idPrefix=d||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var f=this;this.fetchItems(this.rootPath).then(function(d){f.root=d;a(d)})},getChildren:function(a,f){a.Children?f(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(d){a.Children=d;f(d)}):f([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var f=this.idPrefix,d=0;d<a.length;d++)f=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?f+a.charCodeAt(d):f+a[d];return f}};return b}();g.ExplorerFlatModel=function(){function b(a,f,d){this.rootPath=a;this.fetchItems=f;this.root=d}b.prototype=new g.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var f=this;this.fetchItems(this.rootPath).then(function(d){f.root=d;a(d)})}};b.prototype.getChildren=function(a,f){a===this.root?f(this.root):f([])};
return b}();g.ExplorerRenderer=function(){function b(a,f){this.explorer=f;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,f){this.tableTree=f;this.tableNode=a;m.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,f,d,b,g){d=d||"tool";var e=document.createElement("td");e.id=f.id+"actionswrapper";b&&e.classList.add(b);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,e,a,this.explorer,d,null,g&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return e},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,f){if(this._useCheckboxSelection){var d=document.createElement("td"),b=document.createElement("span");b.id=this.getCheckBoxId(f.id);b.classList.add("core-sprite-check");b.classList.add("selectionCheckmarkSprite");b.rowId=f.id;this.getCheckedFunc&&(b.checked=this.getCheckedFunc(a),b.checked?(this._highlightSelection&&f.classList.add("checkedRow"),b.classList.add("core-sprite-check_on")):
(this._highlightSelection&&f.classList.remove("checkedRow"),b.classList.remove("core-sprite-check_on")));d.appendChild(b);var g=this;b.addEventListener("click",function(d){g.onCheck(f,d.target,d.target.checked?!1:!0,!0,!1,a)},!1);return d}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,f,d,b,g,e){(f.checked=d)?f.classList.add("core-sprite-check_on"):f.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(f.rowId,d,b,e);this.explorer.getNavHandler()&&
g&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),f=this._getUIStatePreferencePath();f&&window.sessionStorage&&(window.sessionStorage[f+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var f=this.explorer.getNavDict(),d=this.explorer.getNavHandler();if(d&&(f&&"cursorOnly"!==d.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var b=[],d=0;d<a.length;d++){var g=f.getValue(a[d]);if(g&&(g.rowDomNode&&g.model)&&(b.push(g.model),this._highlightSelection&&g.rowDomNode.classList.add("checkedRow"),g=m.node(this.getCheckBoxId(g.rowDomNode.id))))g.checked=!0,g.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(b),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var f=!1,d=window.sessionStorage[a+"expanded"];"string"===typeof d&&(d=0<d.length?JSON.parse(d):null);var b;if(d)for(b=0;b<d.length;b++)if(m.node(d[b])){this._expanded.push(d[b]);var g=this;this.tableTree.expand(d[b],function(){g._restoreSelections(a)});f=!0}return!f},_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,f){var d=m.node(this.expandCollapseImageId(a.id));d&&(d.classList.remove(this._expandImageClass),d.classList.remove(this._collapseImageClass),d.classList.remove(this._progressImageClass),d.classList.add("progress"===f?this._progressImageClass:f?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,f,d,b){var g=document.createElement("span");
g.id=this.expandCollapseImageId(a.id);f.appendChild(g);g.classList.add(this._twistieSpriteClass);g.classList.add(this._collapseImageClass);if(d){var e=document.createElement("span");f.appendChild(e);e.classList.add(b||"imageSprite");e.classList.add(d)}var h=this;g.onclick=function(d){if(!h.explorer.getNavHandler().isDisabled(a)){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(a.id);else for(var f in h._expanded)if(h._expanded[f]===
a.id){h._expanded.splice(f,1);break}(d=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(d)}};return g},render:function(a,f){f.classList.add("navRow");this.renderRow(a,f)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(m.$(".sectionTreeTable",this.tableNode.parentNode)||m.$(".treetable",this.tableNode.parentNode))&&m.$$array(".treeTableRow",this.tableNode).forEach(function(a,
f){var d=!(f%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",b="lightSectionTreeTableRow"===d?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(d);a.classList.remove(b)})},updateCommands:function(){if(this.commandService)for(var a=m.$$array(".treeTableRow"),f=0;f<a.length;f++){var d=a[f],b=m.node(d.id+"actionswrapper");this.commandService.destroy(b);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,b,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();g.SelectionRenderer=function(){function b(a,f){this._init(a);this.explorer=f}b.prototype=new g.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var f=document.createElement("thead"),d=document.createElement("tr");f.classList.add("navTableHeading");this._useCheckboxSelection&&d.appendChild(this.initCheckboxColumn(a));for(var b=0,g=this.getCellHeaderElement(b);g;)0<
g.innerHTML.length&&g.classList.add("navColumn"),d.appendChild(g),g=this.getCellHeaderElement(++b);f.appendChild(d);0<b&&a.appendChild(f)};b.prototype.renderRow=function(a,f){f.verticalAlign="baseline";f.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var d=this.explorer.getNavDict();if(d){"cursorOnly"!==this.explorer.selectionPolicy&&f.classList.add("selectableNavRow");d.addRow(a,f);var b=this;f.addEventListener("click",function(d){if(b.explorer.getNavHandler())b.explorer.getNavHandler().onClick(a,
d)},!1)}if(d=this.getCheckboxColumn(a,f))d.classList.add("checkColumn"),f.appendChild(d)}for(var d=0,g=this.getCellElement(d,a,f);g;)f.appendChild(g),0===d?this.getPrimColumnStyle?g.classList.add(this.getPrimColumnStyle(a)):g.classList.add("navColumn"):this.getSecondaryColumnStyle?g.classList.add(this.getSecondaryColumnStyle()):g.classList.add("secondaryColumn"),g=this.getCellElement(++d,a,f)};b.prototype.getCellHeaderElement=function(a){};b.prototype.getCellElement=function(a,f,d){};return b}();
g.SimpleFlatModel=function(){function b(a,f,d){this.items=a;this.getKey=d;this.idPrefix=f;this.root={children:a}}b.prototype=new g.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var f="",d=0;d<a.length;d++)f=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?f+a.charCodeAt(d):f+a[d];return this.idPrefix+f};b.prototype.getChildren=function(a,f){a===this.root?f(this.items):f([])};return b}();return g});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(l,n,m,k){function e(b,a,f){return 0<b?1===b?a+" ":b+" "+f+" ":""}function h(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,f=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*f,d=Math.floor(a/1E3/60/60/24),a=a-864E5*d,g=Math.floor(a/1E3/60/60),h=Math.floor((a-36E5*g)/1E3/60),a=e(b,"a year","years"),k=
e(f,"a month","months"),l=e(d,"a day","days"),m=e(g,"an hour","hours"),h=e(h,"a minute","minutes"),n="";a?n=0<b?a:a+k:k?n=0<f?k:k+l:l?n=0<d?l:l+m:m?n=0<g?m:m+h:h&&(n=h);return n?n+"ago":"Just now"}function g(b){this._parentDomNode=m.node(b.parent);this._commitInfo=b.commitInfo}l.mixin(g.prototype,{destroy:function(){},_simpleMessage:function(b){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var f=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");f&&0<f.length&&(a=f[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 f=(new URL("commit",window.location.href)).href,f=decodeURIComponent(f);a.href=(new n(f+"{/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 f=
this,d=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);d.query.set("contributorUserId",b);k("GET",d.href,{timeout:15E3}).then(function(d){d=JSON.parse(d.response);a.src=d.photoURI},function(){f._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 f=this._commitInfo.Author&&this._commitInfo.Author.Date?h(this._commitInfo.Author.Date):"",d=this._simpleMessage(-1),g=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",e=b;e||(e="Commit");e="Last "+e;if(a){var k=document.createElement("div"),l=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,l):this._useOtherPhotoURL(l);l.classList.add("commitInfoAvatar");k.appendChild(l)}else k=
document.createElement("div"),k.classList.add("commitInfoLabelContainer"),k.appendChild(document.createTextNode(e.toUpperCase()));this._parentDomNode.appendChild(k);k=document.createElement("div");k.classList.add("commitInfoMessageContainer");l=document.createElement("div");l.classList.add("commitInfoAutorContainer");var y=document.createDocumentFragment(),n=document.createElement("span");n.appendChild(document.createTextNode(g));n.classList.add("navColumnBold");a?(g=document.createElement("span"),
g.appendChild(document.createTextNode(e)),g.classList.add("navColumnBold"),y.textContent=f?"${0} by ${1} "+f+".":"${0} by ${1}.",f=[g,n]):(y.textContent=f?"by ${0} "+f+".":"by ${0}.",f=[n]);m.processDOMNodes(y,f);l.appendChild(y);k.appendChild(l);f=document.createElement("div");f.classList.add("commitInfoMessageTextContainer");f.appendChild(this._generateMessageNode(d));k.appendChild(f);this._parentDomNode.appendChild(k)}});return{CommitInfoRenderer:g,calculateTime:h}});
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(l,n,m,k,e,h,g,b,a){function f(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function d(a,d,b,p,k,l,m,C,r){d=h.clone(d);
var A;if(d.Directory)A=document.createElement("a"),A.className="navlinkonpage",p=!a?q:new g(a+"#{,resource,params*}"),A.href=p.expand({resource:d.ChildrenLocation}),d.Name&&A.appendChild(document.createTextNode(d.Name));else{k||(k=e.getOpenWithCommands(b));A=document.createElement("a");A.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){A[a]=l[a]});var D=null,B=null;if(D=C?C.holderDom:A)B=document.createElement("span"),B.className="core-sprite-file modelDecorationSprite thumbnail",
D.appendChild(B);d.Name&&A.appendChild(document.createTextNode(d.Name));var E=d.Location;m&&"object"===typeof m&&(d.params={},h.mixin(d.params,m));(a=e.getOpenWithCommand(b,d,k))&&(E=a.hrefCallback({items:d}));n.when(p.getFileContentType(d),function(a){if(D){var b=D,g=B;if(a){var e,h=a.imageClass,p=a.image;h?(e=document.createElement("span"),e.className+=h,e.classList.add("thumbnail")):p&&(e=document.createElement("img"),e.src=p,e.classList.add("thumbnail"));e&&b.replaceChild(e,g)}}A.href=E;r&&"function"===
typeof r.updateFileNode&&r.updateFileNode(d,A,f(a))})}A.addEventListener("click",function(){u=d}.bind(this),!1);return A}function p(a,d,f,b){this.explorer=d;this.commandService=f;this.contentTypeService=b;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var q=new g("#{,resource,params*}"),u;p.prototype=new m.SelectionRenderer;p.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};p.prototype.tableCallback=function(a){a.setAttribute("aria-label",
l.Navigator);a.setAttribute("role","presentation")};p.prototype.rowCallback=function(a,d){a.setAttribute("role","treeitem")};p.prototype.emptyCallback=function(d){var f=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var g=document.createElement("div");g.classList.add("noFile");g.textContent=l.NoFile;var e=document.createElement("span");e.appendChild(document.createTextNode(l.File));a.processDOMNodes(g,[e]);b.appendChild(g);f.appendChild(b);d.appendChild(f)};
p.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};p.prototype.getCommitRenderer=function(a,d){return new b.CommitInfoRenderer({parent:a,commitInfo:d})};p.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"}};p.prototype.setTarget=function(a){this.target=a};p.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};p.prototype.createFolderNode=function(a){var f;this.showFolderLinks?(f=d(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&f.insertBefore(a,f.firstChild)):(f=document.createElement("span"),f.textContent=a.Name);return f};p.prototype.updateFileNode=function(a,d,f){};p.prototype.showFolderLinks=!0;p.prototype.getCellElement=function(a,f,b){var g=f.LastCommit?2:1,h=f.LastCommit?3:2,p=f.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),g=document.createElement("span"),g.id=b.id+"MainCol",g.setAttribute("role","presentation"),a.appendChild(g),a.setAttribute("role","presentation"),g.className="mainNavColumn",f.Directory?(this.getExpandImage(b,g),h=this.createFolderNode(f),g.appendChild(h),this.explorer._makeDropTarget(f,h),this.explorer._makeDropTarget(f,b)):(this.openWithCommands||(this.openWithCommands=e.getOpenWithCommands(this.commandService)),h=d("",f,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),g.appendChild(h)),h&&(h.id=b.id+"NameLink",1===h.nodeType&&(k.addNavGrid(this.explorer.getNavDict(),f,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,f,this.explorer,"tool",null,!0),a;case g:if(this.oneColumn)return null;b=document.createElement("td");f.LocalTimeStamp&&(b.textContent=this.getDisplayTime(f.LocalTimeStamp));return b;case h:if(this.oneColumn)return null;
b=document.createElement("td");!f.Directory&&"number"===typeof f.Length&&(f=parseInt(f.Length,10)/1024,b.textContent=Math.ceil(f).toLocaleString()+" KB");b.style.textAlign="right";return b;case p:if(this.oneColumn||!f.LastCommit)return null;b=document.createElement("td");this.getCommitRenderer(b,f.LastCommit).renderSimple(60);return b}};p.prototype.constructor=p;return{NavigatorRenderer:p,isImage:f,getClickedItem:function(){return u},createLink:d}});
define("orion/searchClient","i18n!orion/search/nls/messages require orion/webui/littlelib orion/i18nUtil orion/searchUtils orion/crawler/searchCrawler orion/explorers/navigatorRenderer orion/extensionCommands orion/Deferred".split(" "),function(l,n,m,k,e,h,g,b,a){function f(a,d){this.serviceRegistry=a;this.commandRegistry=d;this.openWithCommands=null}function d(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new f(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}f.prototype.makeRenderFunction=function(d,f,h,t,y){var v=this.serviceRegistry,x=this.commandRegistry;this.openWithCommands=this.openWithCommands||b.createOpenWithCommands(v,d,x);var s=this;return function(b,v,C,r){a.when(s.openWithCommands,function(a){if(C)m.empty(f),a=document.createElement("div"),a.appendChild(document.createTextNode(l["Search failed."])),f.appendChild(a),"function"===typeof t&&t(f);else{var D=
function(){function a(d,f){var b=f.folderName?f.folderName:f.path,g=document.createElement("span");g.id=b.replace(/[^a-zA-Z0-9_\.:\-]/g,"");g.appendChild(document.createTextNode(" - "+b+" "));d.appendChild(g)}var d={};return function(f,b){var g=b.name;if(d.hasOwnProperty(g)){a(f,b);var e=d[g];"function"===typeof e&&(d[g]=null,e())}else d[g]=function(){a(f,b)}}}(),B=!1;m.empty(f);if(b&&0<b.length){var E=document.createElement("table");E.setAttribute("role","presentation");for(var K=0;K<b.length;K++){var s=
b[K],F;B||(B=!0,h&&(F=E.insertRow(0).insertCell(0),F.textContent=h));F=E.insertRow(-1).insertCell(0);F.colspan=2;y&&y(F);var G={Name:s.name,Directory:s.directory,Location:s.path||s.location},H=null;"number"===typeof s.LineNumber&&(H={},H.line=s.LineNumber);if(r&&r.keyword&&!r.nameSearch){var I=e.generateSearchHelper(r),H=H||{};H.find=I.inFileQuery.searchStr;H.regEx=I.inFileQuery.wildCard?!0:void 0}G=g.createLink(n.toUrl("edit/edit.html"),G,x,d,a,{"aria-describedby":(s.folderName?s.folderName:s.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},H);s.LineNumber&&G.appendChild(document.createTextNode(" (Line "+s.LineNumber+")"));F.appendChild(G);D(F,s)}f.appendChild(E);"function"===typeof t&&t(f)}!B&&v&&(a=k.formatMessage(l["No matches found for ${0}"],v),m.empty(f),f.appendChild(document.createTextNode(a)),"function"===typeof t&&t(f))}})}};d.prototype={search:function(a,d,f){var b=function(a){for(var f=[],b=0;b<a.response.docs.length;b++){var g=a.response.docs[b],h=g.Location,p=e.path2FolderName(g.Path?
g.Path:g.Location,g.Name),r=p?p:h;(d?0<=r.indexOf(d):1)&&f.push({name:g.Name,path:h,folderName:p,directory:g.Directory,lineNumber:g.LineNumber})}return f};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(d){f(b(d),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(d){var g=a.keyword,g=g.substring(g.indexOf("}")+1),g=g.substring(g.indexOf(":")+1);f(b(d),g,null,a)},function(a){f(null,
null,a,null)})}catch(g){"string"===typeof g&&-1<g.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(d){f(b(d),null,null,a)}):"string"===typeof g&&-1<g.indexOf("search")&&!a.nameSearch?(new h.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(d){f(b(d),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,d){console.error(a);m.empty(d);d.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,d){var f="",b=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);d&&a&&a.Parents&&0<a.Parents.length?b="last"===d.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(b=a);b?(this.setLocationbyURL(b.Location),f=b.Name,this._childrenLocation=b.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
f=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);b=m.node("search");f||(f="");if(b&&b.placeholder){b.value="";var g=k.formatMessage(l["Search ${0}"],f);b.placeholder=30<g.length?g.substring(0,27)+"...":k.formatMessage(l["Search ${0}"],f)}b&&b.title&&(b.title=l["Type a keyword or wild card to search in "]+f)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,d,f,b){f=f?this.getSearchRootLocation():this.getSearchLocation();return d?{resource:f,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:f,sort:b&&b.sort?b.sort:"Path asc",rows:b&&b.rows?b.rows:40,start:0,caseSensitive:b?b.caseSensitive:void 0,regEx:b?b.regEx:void 0,fileType:b?b.fileType:void 0,fileNamePatterns:b&&b.fileNamePatterns?b.fileNamePatterns:void 0,keyword:a,replace:b?b.replace:void 0}}};d.prototype.constructor=d;return{Searcher:d}});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/ThemeVersion"],function(l,n,m){function k(){}function e(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.constant="blue";a.tag="darkorange";
a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=b;a.rightRuler="#DDDDDD";a.leftRuler="#DDDDDD";this.styles.push(a);a=new k;a.name="Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="#CCCCCC";a.lineNumberEven="#CCCCCC";a.lineNumber="#CCCCCC";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=b;a.rightRuler="#EEEEEE";a.leftRuler="#EEEEEE";
a.constant="darkOrchid";this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="white";a.leftRuler="white";a.fontFamily=g;a.fontSize=b;a.constant="blue";this.styles.push(a);
a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="darkgrey";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=b;a.constant="blue";this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";
a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=b;a.constant="blue";this.styles.push(a);a=new k;a.name="Nimbus";a.annotationRuler="#232323";a.background="#333333";a.comment="darkseagreen";a.keyword=
"darkorange";a.text="#DDDDDD";a.string="cornflowerblue";a.overviewRuler="#232323";a.lineNumberOdd="#555555";a.lineNumberEven="#555555";a.lineNumber="#555555";a.currentLine="dimgrey";a.tag="darkorange";a.attribute="cadetBlue";a.rightRuler="#3a3a3a";a.leftRuler="#3a3a3a";a.fontFamily=g;a.fontSize=b;a.constant="#01B199";this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler=
"#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.rightRuler="#9e937b";a.leftRuler="#9e937b";a.fontFamily=g;a.fontSize=b;a.constant="blue";this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#f6b8b6";a.lineNumberEven="#f6b8b6";
a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.rightRuler="#fbdfde";a.leftRuler="#fbdfde";a.fontFamily=g;a.fontSize=b;a.constant="blue";this.styles.push(a)}function h(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", monospace',b="10pt";e.prototype.styles=[];e.prototype.getStyles=h;e.prototype.fontSettable=!0;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",
version:m}};e.prototype.parseToXML=function(a){try{var f=null;if(window.DOMParser){var f=(new DOMParser).parseFromString(a,"text/xml"),d=f.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?f:null}f=new ActiveXObject("Microsoft.XMLDOM");f.async=!1;f.loadXML(a);return f}catch(b){}};e.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};e.prototype.importTheme=function(a){console.log("import theme");console.log(a);var f=a.parameters.valueFor("name"),f=this.parseToXML(f),
d=new k;d.name=f.getElementsByTagName("colorTheme")[0].attributes[1].value;d.annotationRuler=f.getElementsByTagName("background")[0].attributes[0].value;d.background=f.getElementsByTagName("background")[0].attributes[0].value;d.comment=f.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=f.getElementsByTagName("keyword")[0].attributes[0].value;d.text=f.getElementsByTagName("foreground")[0].attributes[0].value;d.string=f.getElementsByTagName("string")[0].attributes[0].value;
d.overviewRuler=f.getElementsByTagName("background")[0].attributes[0].value;d.lineNumberOdd=f.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=f.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=f.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=f.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(d)};e.prototype.processSettings=function(a,f){var d=n.TextTheme.getTheme();d.setThemeClass("editorTheme",
d.buildStyleSheet("editorTheme",a))};e.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},f=a.left,d=a.top;a.shapes=[{type:"TEXT",name:l["Line Numbers"],label:"1",x:f+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:l.Background,x:f+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:l.Strings,label:"'text/javascript'",x:f+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:f+124,y:d+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Current Line"],x:f+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:f+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Overview Ruler"],x:f+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:l.Comments,label:"/* comment */",
x:f+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cscript",x:f+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:f+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'Result'",x:f+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"multiply(a,b){",x:f+120,y:d+
60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"function",x:f+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:f+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output \x3d ",x:f+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:";",x:f+205,y:d+80,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:f+95,y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"result \x3d a*b;",x:f+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"return",x:f+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output + result;",x:f+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:l.Foreground,label:"}",x:f+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/script\x3e",x:f+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cstyle",x:f+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:f+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:f+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'text/css'",x:f+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:f+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:".some-class",x:f+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],
label:"{",x:f+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Attribute"],label:"color:",x:f+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Value"],label:"#123456",x:f+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Text"],label:";",x:f+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:"}",x:f+
75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/style\x3e",x:f+55,y:d+280,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Annotation Ruler"],x:f,y:d,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var b=0;16>b;b++)a.shapes.push({type:"TEXT",name:l["Line Numbers"],label:b+1,x:f+20,y:d+20*b+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:e,
getStyles:h}});
define("orion/git/util",["orion/URL-shim"],function(l){function n(h){for(var g=0;g<e.length;g++)if(h.type===e[g])return!0;return!1}function m(e){for(var g=0;g<k.length;g++)if(e.type===k[g])return!0;return!1}var k=["Missing","Modified","Untracked","Conflicting"],e=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:n,isUnstaged:m,isChange:function(e){return n(e)||m(e)},hasStagedChanges:function(h){for(var g=0;g<e.length;g++)if(0<h[e[g]].length)return!0;return!1},hasUnstagedChanges:function(e){for(var g=
0;g<k.length;g++)if(0<e[k[g]].length)return!0;return!1},parseSshGitUrl:function(e){try{var g=new URL(e);return{host:g.hostname,port:g.port}}catch(b){try{var a=e.split(":")[0].split("@");return{host:1<a.length?a[1]:a[0],port:22}}catch(f){return{host:"",port:""}}}},trimCommitMessage:function(e){e=e.split(/\r\n|\n/);for(var g=0;0<e.length&&/^\s*$/.test(e[g]);)g++;return 100<e[g].length?e[g].substring(0,100)+"...":e[g]},getGerritFooter:function(e){e=e.split(/\r\n|\n/);for(var g={},b=0,a=e.length-1;0<=
a;--a)if(0===e[a].indexOf("Change-Id: ")){if(g.changeId=e[a].substring(11,e[a].length),1<++b){g={};break}}else 0===e[a].indexOf("Signed-off-by: ")&&(g.signedOffBy=e[a].substring(15,e[a].length));return g}}});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"header"\x3e\x3c/div\x3e';m.prototype._init=function(k){var e=this;this.title="Git Push";this.modal=!0;this.messages=l;this.location=k.location;this.moreCallback=k.moreCallback;this.func=k.func;this._afterHiding=k.closeCallback;this.buttons=[];this.moreCallback&&this.buttons.push({callback:function(){e.destroy();
e.moreCallback()},text:"More"});this.buttons.push({callback:function(){e.destroy();e.func()},text:"OK"});this._initialize()};m.prototype._bindToDom=function(k){k=this.$header;k.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));k.appendChild(document.createElement("br"));this.moreCallback&&k.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};m.prototype.constructor=m;return{ConfirmPushDialog:m}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(l){function n(l){this._prefix="/git/credentials";this._preferenceService=l.getService("orion.core.preference")}n.prototype={put:function(m,k){var e={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};void 0!==k&&(void 0!==k.gitSshUsername&&null!==k.gitSshUsername&&(e.gitSshUsername=k.gitSshUsername),void 0!==k.gitSshPassword&&null!==k.gitSshPassword&&(e.gitSshPassword=k.gitSshPassword),void 0!==k.gitPrivateKey&&
null!==k.gitPrivateKey&&(e.gitPrivateKey=k.gitPrivateKey),void 0!==k.gitPassphrase&&null!==k.gitPassphrase&&(e.gitPassphrase=k.gitPassphrase));var h=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(g){var b=g.get("settings");void 0===b?h.reject():b.enabled?(g.put(m,e),h.resolve()):h.reject()});return h},get:function(m){var k={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},e=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(h){var g=
h.get("settings");void 0===g?e.reject():g.enabled?(h=h.get(m),void 0!==h?e.resolve(h):e.resolve(k)):e.reject()});return e},isEnabled:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k=k.get("settings");void 0===k?m.resolve(!1):m.resolve(k.enabled)});return m},enable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k.put("settings",{enabled:!0});m.resolve()});return m},disable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,
2).then(function(k){k.put("settings",{enabled:!1});m.resolve()});return m},remove:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e.remove(m);k.resolve()});return k},getRepositories:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){var e=[];k=k.keys();for(var h=0;h<k.length;++h)"settings"!==k[h]&&e.push(k[h]);m.resolve(e)});return m}};return n.prototype.constructor=n});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog","orion/git/util"],function(l,n,m,k){function e(e){this._init(e)}e.prototype=new m.Dialog;e.prototype.TEMPLATE='\x3cdiv id\x3d"gitCredentialsLabel" style\x3d"padding: 8px"\x3e${Repository URL:}\x3cstrong id\x3d"url"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshUsernameRow" style\x3d"padding: 8px"\x3e\x3clabel id\x3d"gitSshUsernameLabel" for\x3d"gitSshUsername"\x3e${Username:}\x3c/label\x3e\x3cinput id\x3d"gitSshUsername" value\x3d""\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshPasswordRow" style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isSshPassword" type\x3d"radio" name\x3d"isSshPassword" checked value\x3d"password"/\x3e\x3clabel id\x3d"gitSshPasswordLabel" for\x3d"gitSshPassword" style\x3d"padding: 0 8px"\x3e${Password:}\x3c/label\x3e\x3cinput type\x3d"password" id\x3d"gitSshPassword" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cdiv id\x3d"gitPrivateKeyRow"\x3e\x3cinput id\x3d"isPrivateKey" type\x3d"radio" name\x3d"isSshPassword" value\x3d"privateKey" style\x3d"vertical-align: top"/\x3e\x3clabel id\x3d"gitPrivateKeyLabel" for\x3d"gitPrivateKey" style\x3d"padding: 0 8px; vertical-align: top"\x3e${Private key:}\x3c/label\x3e\x3ctextarea id\x3d"gitPrivateKey" value\x3d""\x3e\x3c/textarea\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPrivateKeyFileRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPrivateKeyFileLabel" for\x3d"gitPrivateKeyFile"\x3e${Private key file (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"gitPrivateKeyFile" multiple\x3d"false" type\x3d"file" size\x3d"53" label\x3d"Browse..."\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPassphraseRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPassphraseLabel" for\x3d"gitPassphrase"\x3e${Passphrase (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput type\x3d"password" id\x3d"gitPassphrase" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSaveCredentialsRow" style\x3d"padding: 8px"\x3e\x3cimg id\x3d"gitSaveCredentialsInfo" src\x3d"/images/info.gif""\x3e\x3cinput id\x3d"gitSaveCredentials" type\x3d"checkbox" name\x3d"gitSaveCredentials"\x3e\x3clabel id\x3d"gitSaveCredentialsLabel" for\x3d"gitSaveCredentials"\x3e${Don\'t prompt me again:}\x3c/label\x3e\x3c/div\x3e';
e.prototype._init=function(e){var g=this;this.title=e.title||l["Git Credentials"];this.modal=!0;this.messages=l;this.options=e;this._afterHiding=e.closeCallback;!this.options.username&&(!this.options.password&&!this.options.privatekey&&!this.options.passphrase)&&(this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0);e.serviceRegistry&&(this._sshService=e.serviceRegistry.getService("orion.net.ssh"),this._progressService=e.serviceRegistry.getService("orion.page.progress"));
this.buttons=[];this.buttons.push({callback:function(){g.destroy();g._execute()},text:"OK",isDefault:!0});this._initialize()};e.prototype._bindToDom=function(e){var g=this;this.options.username||(this.$gitSshUsernameRow.style.display="none");this.options.password||(this.$gitSshPasswordRow.style.display="none");this.options.privatekey||(this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none");this.options.passphrase||(this.$gitPassphraseRow.style.display="none");
this.options.errordata&&this.options.errordata.Url&&(this.$gitCredentialsLabel.style.display="block",this.$url.textContent=this.options.errordata.Url);this.options.errordata&&(this.options.errordata.User&&""!==this.options.errordata.User)&&(this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){g.$gitSshPassword.focus()},400));(new n(this.options.serviceRegistry)).isEnabled().then(function(b){b||(g.$gitSaveCredentials.style.display=
"none",g.$gitSaveCredentialsLabel.style.display="none",g.$gitSaveCredentialsInfo.style.display="none")});this.$gitSshPassword.addEventListener("focus",function(b){g.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(b){g.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(b){g.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(b){g.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",
function(b){g.privateKeyFile=b.target.files[0]})};e.prototype._execute=function(){var e=this,g=this.$gitPrivateKey.value,b=this.$url.textContent,a=function(a){if(e._sshService){var f=k.parseSshGitUrl(b);e._sshService.getKnownHostCredentials(f.host,f.port).then(function(f){if(e.options.func){var b="undefined"===typeof e.options.failedOperation?e.options.errordata.failedOperation:e.options.failedOperation;"undefined"!==b&&e._progressService.removeOperation(b);e.options.func({gitSshUsername:e.$gitSshUsername.value,
gitSshPassword:e.$isSshPassword.checked?e.$gitSshPassword.value:"",gitPrivateKey:e.$isPrivateKey.checked?a:"",gitPassphrase:e.$isPrivateKey.checked?e.$gitPassphrase.value:"",knownHosts:f})}})}else e.options.func&&(f="undefined"===typeof e.options.failedOperation?e.options.errordata.failedOperation:e.options.failedOperation,"undefined"!==f&&e._progressService.removeOperation(f),e.options.func({gitSshUsername:e.$gitSshUsername.value,gitSshPassword:e.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:e.$gitPassphrase.value,
knownHosts:e.$gitSshKnownHosts.value}))};if(this.privateKeyFile){var f=new FileReader;f.onload=function(d){return function(d){g=d.target.result;d=new n(e.options.serviceRegistry);e.$gitSaveCredentials.checked?d.put(b,{gitPrivateKey:g,gitPassphrase:e.$gitPassphrase.value}).then(function(){a(g)}):a(g)}}(this.privateKeyFile);f.readAsText(this.privateKeyFile)}else 0<g.length?(f=new n(e.options.serviceRegistry),e.$gitSaveCredentials.checked?f.put(b,{gitPrivateKey:g,gitPassphrase:e.$gitPassphrase.value}).then(function(){a(g)}):
a(g)):(f=new n(e.options.serviceRegistry),e.$gitSaveCredentials.checked?f.put(b,{gitSshUsername:e.$gitSshUsername.value,gitSshPassword:e.$gitSshPassword.value}).then(function(){a(g)}):a(g))};e.prototype.constructor=e;return{GitCredentialsDialog:e}});
define("orion/git/logic/gitCommon","orion/git/util orion/i18nUtil orion/git/gitPreferenceStorage orion/git/widgets/GitCredentialsDialog orion/Deferred i18n!git/nls/gitmessages".split(" "),function(l,n,m,k,e,h){function g(a){var d;try{d=JSON.parse(a.responseText)}catch(b){d={Message:h["Problem while performing the action"]}}d.HttpCode=a.status;return d}var b=function(a,d,b,g){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],d.KeyType,
d.Host,d.HostFingerprint))){var e=l.parseSshGitUrl(d.Url);d={host:d.Host,keyType:d.KeyType,hostKey:d.HostKey,port:e.port};a.getService("orion.net.ssh").addKnownHost(d).then(function(d){b.knownHosts=d;"undefined"!==typeof b.failedOperation&&a.getService("orion.page.progress").removeOperation(b.failedOperation);g(b)})}},a=function(a,d,b,g,e,h){d=d?d.Url:void 0;var l=function(){(new k.GitCredentialsDialog({title:e,serviceRegistry:a,func:g,errordata:b.errordata,failedOperation:b.failedOperation,closeCallback:h})).show()};
b.gitSshUsername&&""!==b.gitSshUsername||b.gitSshPassword&&""!==b.gitSshPassword||b.gitPrivateKey&&""!==b.gitPrivateKey?l():(new m(a)).get(d).then(function(d){""!==d.gitPrivateKey||""!==d.gitSshUsername||""!==d.gitSshPassword?("undefined"!==typeof b.failedOperation&&a.getService("orion.page.progress").removeOperation(b.failedOperation),g({knownHosts:b.knownHosts,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})):l()},l)};
return{handleGitServiceResponse:function(a,d,b,e){a&&void 0!==a.status&&(a=g(a));if(!a||!a.HttpCode)b&&b(a);else switch(a.HttpCode){case 401:var k=new m(d);k.isEnabled().then(function(d){d&&void 0!==a.JsonData.Url?k.remove(a.JsonData.Url).then(function(){e(a)}):e(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){e(a);break}default:var l=[];l.Severity=a.Severity||"Error";l.HTML=!1;l.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?h.REJECTED_NONFASTFORWARD:a.DetailedMessage?
a.DetailedMessage:a.Message;d.getService("orion.page.message").setProgressResult(l);b&&b(a)}},handleProgressServiceResponse:function(f,d,e,h,k,l){f&&void 0!==f.status&&(f=g(f));if(!f||void 0===f.HttpCode)h&&h(f);else switch(f.HttpCode){case 401:f.JsonData&&(d.errordata=f.JsonData);f.failedOperation&&(d.failedOperation=f.failedOperation);a(e,f.JsonData,d,k,l);break;case 400:if(f.JsonData&&f.JsonData.HostKey){f.failedOperation&&(d.failedOperation=f.failedOperation);b(e,f.JsonData,d,k);break}else if(f.JsonData&&
f.JsonData.Host){f.JsonData&&(d.errordata=f.JsonData);f.failedOperation&&(d.failedOperation=f.failedOperation);a(e,f.JsonData,d,k,l);break}default:d=[],d.Severity="Error",d.HTML=!1,d.Message=f.DetailedMessage?f.DetailedMessage:f.Message,e.getService("orion.page.message").setProgressResult(d),h&&h(f)}},gatherSshCredentials:function(a,d,b,g){var u=new e,t,y=d.items;y.LocalBranch&&y.RemoteBranch&&(y=y.LocalBranch);void 0!==y.RemoteLocation?t=y.RemoteLocation[0].GitUrl:void 0!==y.GitUrl?t=y.GitUrl:void 0!==
y.errorData?t=y.errorData.Url:void 0!==y.toRef&&(t=y.toRef.RemoteLocation[0].GitUrl);var y=a.getService("orion.net.ssh"),v=l.parseSshGitUrl(t),x=function(b){a.getService("orion.net.ssh").getKnownHostCredentials(v.host,v.port).then(function(a){d.sshObject=b;u.resolve({knownHosts:a,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})})},s=d.errorData;if(s&&s.HostKey){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],
s.KeyType,s.Host,s.HostFingerprint))){var w=l.parseSshGitUrl(s.Url);y.addKnownHost({host:s.Host,keyType:s.KeyType,hostKey:s.HostKey,port:w.port}).then(function(){d.sshObject&&(""!==d.sshObject.gitSshUsername||""!==d.sshObject.gitSshPassword||""!==d.sshObject.gitPrivateKey)?x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new m(a)).get(t).then(function(a){x(a)},function(){x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}else"function"===typeof g&&
g();return u}var z=function(){if(!d.parameters&&!d.optionsRequested)x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(d.parameters&&!d.optionsRequested){var e=d.parameters&&d.parameters.valueFor("sshuser")?d.parameters.valueFor("sshuser"):d.errorData.User,r=d.parameters?d.parameters.valueFor("sshpassword"):"",h=d.parameters&&d.parameters.valueFor("saveCredentials")?d.parameters.valueFor("saveCredentials"):!1,D=new m(a);h?D.put(t,{gitSshUsername:e,gitSshPassword:r}).then(function(){x({gitSshUsername:e,
gitSshPassword:r,gitPrivateKey:"",gitPassphrase:""})}):x({gitSshUsername:e,gitSshPassword:r,gitPrivateKey:"",gitPassphrase:""})}else(new k.GitCredentialsDialog({title:b,serviceRegistry:a,func:x,errordata:s,closeCallback:g})).show()};d.sshObject&&(""!==d.sshObject.gitSshUsername||""!==d.sshObject.gitSshPassword||""!==d.sshObject.gitPrivateKey)?z():(new m(a)).get(t).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?x(a):z()},z);return u},handleSshAuthenticationError:a,
handleKnownHostsError:b}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(l,n,m,k){function e(b,a){this.explorer=a;this._init(b)}function h(b){this._init(b)}var g=function(){function b(a,b,d,g){this.gitClient=a;this.rootPath=b;this.fetchItems=d;this.root=g?g:null}b.prototype=new m.ExplorerModel;b.prototype.getRoot=function(a){var b=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})};
b.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};b.prototype.getChildren=function(a,b){a.children=[];if(a.Children){for(var d=0;d<a.Children.length;d++)a.Children[d].parent=a,a.children[d]=a.Children[d];b(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],b(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(d){a.children=d.Children;for(var g=0;g<d.Children.length;g++)d.Children[g].parent=a;b(d.Children)}):"Remote"===a.Type&&this.gitClient.getGitBranch(a.Location).then(function(d){a.children=d.Children;for(var g=0;g<d.Children.length;g++)d.Children[g].parent=a;b(d.Children)})};return b}();e.prototype=new m.SelectionRenderer;e.prototype.constructor=
e;e.prototype.getLabelColumnIndex=function(){return 0};e.prototype.getCellElement=function(b,a,f){var d=document.createElement("td");f.appendChild(d);b=document.createElement("span");b.id=f.id+"navSpan";d.appendChild(b);b.className="mainNavColumn singleNavColumn";(a.children||a.Children||a.GroupNode||"Remote"===a.Type||a.BranchLocation&&a.RemoteLocation)&&this.getExpandImage(f,b);f=a.Name;"RemoteTrackingBranch"===a.Type&&!a.Id&&(f=a.Name+l[" [New branch]"]);b.appendChild(document.createTextNode(f))};
h.prototype=new n.Dialog;h.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"newBranch"\x3e${New Branch:}\x3c/label\x3e\x3cinput id\x3d"newBranch" value\x3d"" disabled\x3dtrue/\x3e\x3c/div\x3e\x3c/div\x3e';h.prototype._init=function(b){var a=this;this.title=b.title||l["Choose a Folder"];this.modal=
!0;this.messages=l;this.func=b.func;this.treeRoot=b.treeRoot;this.gitClient=b.gitClient;this.hideNewBranch=b.hideNewBranch;this.serviceRegistry=b.serviceRegistry;this._afterHiding=b.closeCallback;this.buttons=[];this.buttons.push({callback:function(){a.$remoteOk.classList.contains(this.DISABLED)||(a.destroy(),a._execute.bind(a)())},text:"OK",isDefault:!0,id:"remoteOk"});this._initialize()};h.prototype._bindToDom=function(b){var a=this;this.$newBranch.addEventListener("input",function(b){a._validate()});
this.$newBranch.placeholder=l["No remote selected"];this.hideNewBranch&&(this.$newBranchPane.style.display="none")};h.prototype._beforeShowing=function(){this._loadRemoteChildren()};h.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};h.prototype._loadRemoteChildren=function(){var b=new g(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot);this._createTree(b)};h.prototype._createTree=function(b){var a=this,f=this.serviceRegistry.getService("orion.remotePrompter.selection");
f||(f=new k.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var d=new e({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=new m.Explorer(this.serviceRegistry,f,d);d.explorer=this.explorer;this.explorer.createTree("treeContentPane",b);f.addEventListener("selectionChanged",function(d){d.selection&&"Remote"===d.selection.Type?(a.$newBranch.disabled=!1,a.$newBranch.placeholder=l["Enter a name..."]):(a.$newBranch.disabled=!0,a.$newBranch.placeholder=l["No remote selected"]);
a._validate(d.selection)})};h.prototype._validate=function(b){var a=function(a){a&&"RemoteTrackingBranch"===a.Type?this.$remoteOk.classList.remove(this.DISABLED):a&&"Remote"===a.Type&&""!==this.$newBranch.value?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};b?a.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(a.bind(this))};h.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(a){if(b.func)if("RemoteTrackingBranch"===
a.Type)b.func(a,a.parent);else{var f=a.CloneLocation.substring(a.CloneLocation.indexOf(a.CloneLocation.split("/")[3])),d={};d.parent=a;d.FullName="refs/remotes/"+a.Name+"/"+b.$newBranch.value;d.Name=a.Name+"/"+b.$newBranch.value;d.Type="RemoteTrackingBranch";d.Location="/gitapi/remote/"+a.Name+"/"+encodeURIComponent(encodeURIComponent(b.$newBranch.value))+"/"+f;b.func(null,a,d)}})};h.prototype.constructor=h;return{RemotePrompterDialog:h}});
define("orion/git/logic/gitPush","i18n!git/nls/gitmessages orion/commandRegistry orion/git/widgets/ConfirmPushDialog orion/git/gitPreferenceStorage orion/git/logic/gitCommon orion/Deferred orion/git/widgets/RemotePrompterDialog".split(" "),function(l,n,m,k,e,h,g){var b=e.handleGitServiceResponse,a=e.handleProgressServiceResponse,f=e.gatherSshCredentials;return function(d){var e=d.serviceRegistry,q=d.commandService,u=d.tags,t=d.force,y=d.gerrit,v=d.confirmDialogCloseCallback,x=d.remotePrompterDialogCloseCallback,
s=d.sshCredentialsDialogCloseCallback,w=d.sshSlideoutCloseCallback,z=function(d,b,f){var k=new h,q=new h,u=e.getService("orion.git.provider"),t=e.getService("orion.page.progress");1===b.RemoteLocation.length&&b.RemoteLocation[0].Children&&1===b.RemoteLocation[0].Children.length?q=t.progress(u.getGitRemote(d.RemoteLocation),"Getting git remote details "+b.Name):q.resolve({Children:b.RemoteLocation});q.then(function(h){var q=function(d){a(d,{},e);k.reject(d)};(new g.RemotePrompterDialog({title:l["Choose Branch"],
serviceRegistry:e,gitClient:u,closeCallback:function(){k.reject()},treeRoot:{Children:h.Children},hideNewBranch:!1,func:function(a,g,e){var h;h=null===a?e:a;if(void 0===f||f){var p="branch."+b.Name+".remote";t.progress(u.addCloneConfigurationProperty(d.ConfigLocation,p,h.parent.Name),"Adding git configuration property "+b.Name).then(function(){k.resolve(h)},function(a){409===a.status?u.getGitCloneConfig(d.ConfigLocation).then(function(a){if(a.Children)for(var d=0;d<a.Children.length;d++)if(a.Children[d].Key===
p){t.progress(u.editCloneConfigurationProperty(a.Children[d].Location,h.parent.Name),"Updating configuration property "+h.parent.Name).then(function(){k.resolve(h)},q);break}},q):q(a)})}else k.resolve(h)}})).show()});return k};return{perform:function(a){function d(a){var h=a.targetBranch,w=a.confirmedWarnings;if(t&&!w)if(confirm(l["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+l["Are you sure?"]))w=a.confirmedWarnings=!0;else{g.reject();
return}var s=a.items;s.LocalBranch&&s.RemoteBranch&&(h=s.RemoteBranch,s=s.LocalBranch);s.toRef&&(s=s.toRef);a.command||(a.command={},a.command.callback=d);var v=function(a,d){a.JsonData.HostKey?(d.parameters=null,d.errorData=a.JsonData,d.errorData.failedOperation=a.failedOperation,q.collectParameters(d,E)):d.optionsRequested?(d.errorData=a.JsonData,d.errorData.failedOperation=a.failedOperation,q.collectParameters(d,E)):(new k(e)).isEnabled().then(function(b){d.parameters=b?a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword",
"password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});d.errorData=a.JsonData;d.errorData.failedOperation=a.failedOperation;q.collectParameters(d,E)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,q.collectParameters(a,E);else{var C=e.getService("orion.git.provider"),P=e.getService("orion.page.progress");a.errorData&&
a.errorData.failedOperation&&P.removeOperation(a.errorData.failedOperation);var J=function(d,f,r,h,k){var D=e.getService("orion.page.message");d=P.progress(C.doPush(f,r,u,k,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),l["Pushing remote: "]+h);D.createProgressMonitor(d,l["Pushing remote: "]+h);d.then(function(d){b(d,e,function(){g.resolve()},function(d){v(d,a)})},function(d){b(d,e,function(){g.resolve()},function(d){v(d,a)})})};P.progress(C.getGitClone(s.CloneLocation),
"Getting git repository details "+s.Name).then(function(d){var b=d.Children[0];f(e,a,null,B).then(function(d){if(h)J(d,h.Location,"HEAD",h.Name,t);else{var f=function(){z(b,s).then(function(b){a.targetBranch=b;a.items.RemoteLocation=b.parent;J(d,b.Location,"HEAD",b.Name,t)},function(){"function"===typeof x&&x();g.reject()})};if(1===s.RemoteLocation.length&&s.RemoteLocation[0].Children&&1===s.RemoteLocation[0].Children.length){var r=s.RemoteLocation[0].Children[0],k=s.Name;if(y){var q=s.RemoteLocation[0].Children[0].Location.split("/"),
k="refs/for/master";q[4]=encodeURIComponent(encodeURIComponent(k));q=q.join("/");r.Location=q;r.Name=k}(new m.ConfirmPushDialog({title:l["Choose Branch"],serviceRegistry:e,gitClient:C,moreCallback:function(){f()},location:r.Name,func:function(){a.targetBranch=r;J(d,r.Location,"HEAD",k,t)},closeCallback:D})).show()}else f()}})})}}var g=new h,D=function(){"function"===typeof v&&v();g.reject()},B=function(){"function"===typeof s&&s();g.reject()},E=function(){"function"===typeof w&&w();g.reject()};d(a);
return g},chooseRemote:z}}});
define("orion/git/widgets/gitCommitInfo","require i18n!git/nls/gitmessages orion/URITemplate orion/i18nUtil orion/git/util orion/objects".split(" "),function(l,n,m,k,e,h){function g(a){this.parent=a.parent;this.commit=a.commit;this.showTags=a.showTags;this.commitLink=a.commitLink}var b=new m("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");h.mixin(g.prototype,{display:function(){var a=this.commit,f=this.parent,d=a.Message.split(/(\r?\n|$)/)[0],g;this.commitLink?(g=document.createElement("a"),
g.className="navlinkonpage",g.href=l.toUrl(b.expand({resource:a.Location}))):g=document.createElement("span");g.appendChild(document.createTextNode(e.trimCommitMessage(d)));f.appendChild(g);d=document.createElement("div");d.style.paddingTop="15px";f.appendChild(d);a.AuthorImage&&(f=new Image,f.src=a.AuthorImage,f.name=a.AuthorName,f.className="git-author-icon",d.appendChild(f));f=document.createElement("div");f.textContent=k.formatMessage(n[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,
(new Date(a.Time)).toLocaleString());d.appendChild(f);f=document.createElement("div");f.textContent=k.formatMessage(n["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);d.appendChild(f);f=document.createElement("div");f.style.paddingTop="15px";f.textContent=n["commit:"]+a.Name;d.appendChild(f);f=e.getGerritFooter(a.Message);f.changeId&&(g=document.createElement("div"),g.style.paddingTop="15px",g.textContent=n["Change-Id: "]+f.changeId,d.appendChild(g));f.signedOffBy&&(g=document.createElement("div"),
g.textContent=n["Signed-off-by: "]+f.signedOffBy,d.appendChild(g));if(a.Parents&&0<a.Parents.length){g=document.createElement("div");g.textContent=n["parent:"];if(f.signedOffBy||f.changeId)g.style.paddingTop="15px";f=document.createElement("a");f.className="navlinkonpage";f.href=l.toUrl(b.expand({resource:a.Parents[0].Location}));f.textContent=a.Parents[0].Name;g.appendChild(f);d.appendChild(g)}g=this.showTags&&a.Tags&&0<a.Tags.length;if(a.Branches&&0<a.Branches.length){f=document.createElement("section");
f.style.paddingTop="15px";f.textContent=n["branches: "];d.appendChild(f);var h=document.createElement("div");f.appendChild(h);for(f=0;f<a.Branches.length;++f){var u=document.createElement("span");u.style.paddingLeft="10px";u.textContent=a.Branches[f].FullName;h.appendChild(u)}}if(g){f=document.createElement("div");f.style.paddingTop="15px";d.appendChild(f);f=document.createElement("section");d.appendChild(f);d=document.createElement("span");d.textContent=n["tags: "];f.appendChild(d);d=document.createElement("div");
f.appendChild(d);for(f=0;f<a.Tags.length;++f)g=document.createElement("span"),g.style.paddingLeft="10px",g.textContent=a.Tags[f].Name,d.appendChild(g)}}});return{GitCommitInfo:g}});
define("orion/git/widgets/CommitTooltipDialog",["orion/git/widgets/gitCommitInfo","orion/webui/popupdialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.PopupDialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"parentPane" style\x3d"padding:10px; width:520px"\x3e\x3c/div\x3e';m.prototype._init=function(k){this.commit=k.commit;this._initialize(k.triggerNode,null,null,"mouseover",1E3)};m.prototype._bindToDom=function(k){this._displayCommit(this.commit)};m.prototype._displayCommit=function(k){(new l.GitCommitInfo({parent:this.$parentPane,
commit:k,showTags:!0,commitLink:!0})).display()};m.prototype.constructor=m;return{CommitTooltipDialog:m}});
define("orion/git/widgets/gitCommitList","require i18n!git/nls/gitmessages orion/commands orion/Deferred orion/explorers/explorer orion/URITemplate orion/git/util orion/commonHTMLFragments orion/git/logic/gitPush orion/i18nUtil orion/explorers/navigationUtils orion/git/widgets/CommitTooltipDialog orion/webui/littlelib orion/objects".split(" "),function(l,n,m,k,e,h,g,b,a,f,d,p,q,u){function t(a){this.root=a.root;this.section=a.section;this.location=a.location;this.handleError=a.handleError;this.repository=
a.repository;this.progressService=a.progressService;this.statusService=a.statusService;this.gitClient=a.gitClient;this.progressService=a.progressService;this.legacyLog=a.legacyLog;this.logDeferred=new k}function y(a){var d=new v({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:"LogNavigator",checkbox:!1},this);e.Explorer.call(this,a.serviceRegistry,a.selection,d,a.commandRegistry);this.checkbox=!1;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;
this.section=a.section;this.root=a.root;this.handleError=a.handleError;this.location=a.location;this.gitClient=a.gitClient;this.progressService=a.progressService;this.statusService=a.statusService;this.legacyLog=a.legacyLog;this.incomingActionScope="IncomingActions";this.outgoingActionScope="OutgoingActions";this.syncActionScope="SynchronizedActions";this.createCommands()}function v(){e.SelectionRenderer.apply(this,arguments)}var x=new h("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");
t.prototype=Object.create(e.Explorer.prototype);u.mixin(t.prototype,{destroy:function(){},getRoot:function(a){a(this.root)},_getRepository:function(){var a=this;return k.when(a.log||a._getLog(),function(d){return a.progressService.progress(a.gitClient.getGitClone(d.CloneLocation),"Getting repository details for "+d.Name).then(function(b){b=b.Children[0];d.Clone=b;d.ContentLocation=b.ContentLocation;return a.root.repository=b})},function(d){a.handleError(d)})},_getLog:function(){var a=this,d=a.location?
n["Getting git log"]:f.formatMessage(n['Getting commits for "${0}" branch'],a.currentBranch.Name);return a.progressService.progress(a.gitClient.doGitLog(a.location||a.currentBranch.CommitLocation+"?page\x3d1\x26pageSize\x3d20"),d).then(function(b){return a.location&&"RemoteTrackingBranch"===b.Type?a.progressService.progress(a.gitClient.doGitLog(b.CommitLocation),d).then(function(d){return a.log=d},function(d){a.handleError(d)}):a.log=b},function(d){a.handleError(d)})},_getOutgoing:function(){var a=
this,d=this.getLocalBranch(),b=this.getRemoteBranch().CommitLocation+(a.log?a.log.RepositoryPath:"");return a.progressService.progress(a.gitClient.getLog(b+"?page\x3d1\x26pageSize\x3d20",d.Name),n["Getting outgoing commits"]).then(function(d){return a.outgoingCommits=d.Children})},_getIncoming:function(){var a=this,d=this.getLocalBranch(),b=this.getRemoteBranch();return a.progressService.progress(a.gitClient.getLog(d.CommitLocation+(a.log?a.log.RepositoryPath:"")+"?page\x3d1\x26pageSize\x3d20",b.Name),
n["Getting git incoming changes..."]).then(function(d){return a.incomingCommits=d.Children})},getLocalBranch:function(){var a=this.log?this.log.toRef:this.currentBranch;return"RemoteTrackingBranch"===a.Type?(this.tracksRemoteBranch(),this.localBranch):a},getRemoteBranch:function(){if(this.remoteBranch)return this.remoteBranch;var a=this.log?this.log.toRef:this.currentBranch;return"RemoteTrackingBranch"===a.Type?a:a.RemoteLocation[0].Children[a.RemoteLocation[0].Children.length-1]},tracksRemoteBranch:function(){if(this.remoteBranch&&
this.isNewBranch(this.remoteBranch))return!1;var a=this.log&&this.log.toRef||this.currentBranch;if(a&&"RemoteTrackingBranch"===a.Type&&this.root.repository&&this.root.repository.Branches){var d=!1,b=this;this.root.repository.Branches.some(function(f){return f.RemoteLocation&&(1===f.RemoteLocation.length&&1===f.RemoteLocation[0].Children.length)&&f.RemoteLocation[0].Children[0].Name===a.Name?(b.localBranch=f,d=!0):!1});return d}return a&&a.RemoteLocation&&1===a.RemoteLocation.length&&1===a.RemoteLocation[0].Children.length},
isRebasing:function(){var a=this.root.repository;return a&&a.status&&"REBASING_INTERACTIVE"===a.status.RepositoryState},isNewBranch:function(a){return"RemoteTrackingBranch"===a.Type&&!a.Id},getChildren:function(a,d){var b=this,g=this.tracksRemoteBranch();if(a instanceof Array&&0<a.length)d(a);else if(a.children)d(a.children);else if("CommitRoot"===a.Type){var e=this.section,h=e.createProgressMonitor();h.begin(n["Getting git log"]);k.when(a.repository||b._getRepository(),function(g){var p=f.formatMessage(n.GettingCurrentBranch,
g.Name);h.worked(p);k.when(b.Branches||b.progressService.progress(b.gitClient.getGitBranch(g.BranchLocation+"?commits\x3d0"),p),function(p){var l;p=p.Children||p;p.some(function(a){return a.Current?(l=a,!0):!1});b.currentBranch=l;if(!b.currentBranch||!l.RemoteLocation[0])b.isRebasing()?(e.setTitle(n.RebaseProgress),d([])):(e.setTitle(n.NoBranch),d(b.processChildren(a,[]))),h.done();else{g.ActiveBranch=l.CommitLocation;b.Branches=p;p=b.getLocalBranch();var q=b.getRemoteBranch();p&&!b.legacyLog?e.setTitle(f.formatMessage(n['Commits for "${0}" branch against'],
p.Name)):e.setTitle(f.formatMessage(n['Commits for "${0}" branch'],q.Name));h.done();if(b.legacyLog)return k.when(b.log||b._getLog(),function(f){a.log=f;b.logDeferred.resolve(f);d(b.processChildren(a,f.Children))},function(a){b.handleError(a)});d(b.processChildren(a,[{Type:"Outgoing",localBranch:p,remoteBranch:q},{Type:"Incoming",localBranch:p,remoteBranch:q},{Type:"Synchronized"}]))}},function(a){h.done();b.handleError(a)})},function(a){h.done();b.handleError(a)})}else if("Incoming"===a.Type)if(g)k.when(b.incomingCommits||
b._getIncoming(),function(f){d(b.processChildren(a,f))},function(a){b.handleError(a)});else return k.when(b.log||b._getLog(),function(f){var g=[];"RemoteTrackingBranch"===f.toRef.Type&&(g=f.Children);d(b.processChildren(a,g))},function(a){b.handleError(a)});else if("Outgoing"===a.Type)if(g)k.when(b.outgoingCommits||b._getOutgoing(),function(f){d(b.processChildren(a,f))},function(a){b.handleError(a)});else return k.when(b.log||b._getLog(),function(f){var g=[];"Branch"===f.toRef.Type&&(g=f.Children);
d(b.processChildren(a,g))},function(a){b.handleError(a)});else if("Synchronized"===a.Type){if(g)return k.when(b.log||b._getLog(),function(f){a.log=f;b.logDeferred.resolve(f);k.when("RemoteTrackingBranch"===f.toRef.Type?b.incomingCommits||b._getIncoming():b.outgoingCommits||b._getOutgoing(),function(g){var e=[];f.Children.forEach(function(a){g.some(function(d){return d.Name===a.Name})||e.push(a)});d(b.processChildren(a,e))},function(a){b.handleError(a)})},function(a){b.handleError(a)});d(b.processChildren(a,
[]))}else d([])},getId:function(a){return a.Name||a.Type},processChildren:function(a,d){0===d.length&&(d=[{Type:"NoCommits"}]);d.forEach(function(d){d.parent=a});return a.children=d}});y.prototype=Object.create(e.Explorer.prototype);u.mixin(y.prototype,{changedItem:function(a){var d=new k,b=this,f=this.model;a||f.getRoot(function(d){a=d});"CommitRoot"===a.Type&&(f.incomingCommits=f.outgoingCommits=null);a.children=f.log=null;f.logDeferred=new k;var g=this.section.createProgressMonitor();g.begin(n["Getting git log"]);
f.getChildren(a,function(f){a.removeAll=!0;b.myTree.refresh.bind(b.myTree)(a,f,!1);b.expandSections(f);"Synchronized"===a.Type?b.updatePageCommands(a):b.updateCommands();g.done();d.resolve(f)});return d},display:function(){var a=this,d=new k,b=new t({root:this.root,registry:this.registry,progressService:this.progressService,statusService:this.statusService,gitClient:this.gitClient,section:this.section,location:this.location,handleError:this.handleError,legacyLog:this.legacyLog});this.createTree(this.parentId,
b,{onComplete:function(){a.status=b.status;var f=function(){a.model.getRoot(function(d){a.model.getChildren(d,function(d){a.expandSections(d)})});a.updateCommands();d.resolve(b.log)};a.fetch().then(f,f)}});return d},expandSections:function(a){!this.legacyLog&&(!this.model.isRebasing()&&2<a.length)&&(this.myTree.expand(this.model.getId(a[0])),this.myTree.expand(this.model.getId(a[1])),this.location&&this.myTree.expand(this.model.getId(a[2])))},createCommands:function(){var d=this,b=this.commandService,
f=new m.Command({name:n["Next Page \x3e"],tooltip:n["Show next page of git log"],id:"eclipse.orion.git.commit.nextPage",callback:function(a){var d=a.items;d.log&&(a.handler.model.location=d.log.NextLocation,a.handler.changedItem(d))},visibleWhen:function(a){return!!a.log.NextLocation}});b.addCommand(f);f=new m.Command({name:n["\x3c Previous Page"],tooltip:n["Show previous page of git log"],id:"eclipse.orion.git.commit.previousPage",callback:function(a){var d=a.items;d.log&&(a.handler.model.location=
d.log.PreviousLocation,a.handler.changedItem(d))},visibleWhen:function(a){return!!a.log.PreviousLocation}});b.addCommand(f);var g=new m.Command({name:n["Choose Branch"],tooltip:n["Choose the remote branch."],id:"eclipse.orion.git.commit.chooseBranch",callback:function(d){var b=d.handler,f=b.model;a({serviceRegistry:b.registry,commandService:b.commandService}).chooseRemote(f.root.repository,f.log?f.log.toRef:f.currentBranch).then(function(a){var b=d.handler.model;b.remoteBranch=a;b.getRoot(function(a){d.handler.changedItem(a)})})},
visibleWhen:function(a){var b=a.Name;d.model.isNewBranch(a)&&(b+=n[" [New branch]"]);g.name=b;return!0}});b.addCommand(g)},fetch:function(){var a=this.model;if(a.tracksRemoteBranch()&&!this.legacyLog&&!a.isRebasing()){var d=this.commandService,b=a.getRemoteBranch(),a=a.getLocalBranch();return d.runCommand("eclipse.orion.git.fetch",{LocalBranch:a,RemoteBranch:b,noAuth:!0},this)}return(new k).resolve()},updateCommands:function(){var a=this.model,d=a.currentBranch,b=this.root.repository,f=this.commandService,
g=this.section,e=g.actionsNode.id,g=g.titleLeftActionsNode.id;if(!d&&a.isRebasing())f.registerCommandContribution(e,"eclipse.orion.git.resetCommand",100),f.registerCommandContribution(e,"eclipse.orion.git.rebaseContinueCommand",200),f.registerCommandContribution(e,"eclipse.orion.git.rebaseSkipPatchCommand",300),f.registerCommandContribution(e,"eclipse.orion.git.rebaseAbortCommand",400),f.renderCommands(e,e,b.status,this,"button");else if(d&&!this.legacyLog){d=this.incomingActionScope;b=this.outgoingActionScope;
q.node(e)&&f.destroy(e);q.node(g)&&f.destroy(g);q.node(d)&&f.destroy(d);q.node(b)&&f.destroy(b);var h=a.tracksRemoteBranch(),k=a.getLocalBranch(),a=a.getRemoteBranch();h&&(f.registerCommandContribution(d,"eclipse.orion.git.fetch",100),f.registerCommandContribution(d,"eclipse.orion.git.merge",300),f.registerCommandContribution(d,"eclipse.orion.git.rebase",200),f.registerCommandContribution(d,"eclipse.orion.git.resetIndex",400),a.GitUrl=k.RemoteLocation[0].GitUrl,f.renderCommands(d,d,a,this,"button"),
f.registerCommandContribution(e,"eclipse.orion.git.sync",100),f.renderCommands(e,e,{LocalBranch:k,RemoteBranch:a},this,"button"));f.registerCommandContribution(g,"eclipse.orion.git.commit.chooseBranch",100);f.renderCommands(g,g,a,this,"button");f.addCommandGroup(b,"eclipse.gitPushGroup",1E3,"Push",null,null,null,"Push",null,"eclipse.orion.git.push");f.registerCommandContribution(b,"eclipse.orion.git.push",1100,"eclipse.gitPushGroup");f.registerCommandContribution(b,"eclipse.orion.git.pushBranch",
1200,"eclipse.gitPushGroup");f.registerCommandContribution(b,"eclipse.orion.git.pushToGerrit",1200,"eclipse.gitPushGroup");f.renderCommands(b,b,{LocalBranch:k,RemoteBranch:a},this,"button")}},updatePageCommands:function(a){var d=this;this.model.logDeferred.then(function(){var b=d.commandService;q.node(d.syncActionScope)&&b.destroy(d.syncActionScope);b.registerCommandContribution(d.syncActionScope,"eclipse.orion.git.commit.nextPage",200);b.registerCommandContribution(d.syncActionScope,"eclipse.orion.git.commit.previousPage",
100);b.renderCommands(d.syncActionScope,d.syncActionScope,a,d,"button")})}});v.prototype=Object.create(e.SelectionRenderer.prototype);u.mixin(v.prototype,{getCellElement:function(a,f,e){var h=this.explorer;switch(a){case 0:a=document.createElement("td");var r=document.createElement("div");a.appendChild(r);var k=document.createElement("div");k.style.overflow="hidden";r.appendChild(k);if("Commit"!==f.Type){if("NoCommits"!==f.Type){r.className="gitCommitSectionTableItem";r=document.createElement("div");
r.style.display="inline-block";r.style.styleFloat="left";r.style.cssFloat="left";var D=this.getExpandImage(e,r);"Synchronized"===f.Type&&D.addEventListener("click",function(){h.updatePageCommands(f)});k.appendChild(r);e.classList.add("gitCommitListSection")}else e.classList.add("gitCommitListNoCommit"),r.classList.add("sectionTableItem");e=document.createElement("div");e.className="stretch";k.appendChild(e);r=document.createElement("div");r.textContent=n[f.Type];"NoCommits"!==f.Type&&r.classList.add("gitCommitListSectionTitle");
e.appendChild(r);e=document.createElement("ul");e.className="layoutRight commandList";e.id=f.Type+"Actions";k.appendChild(e);k.classList.add("toolComposite");e=b.slideoutHTMLFragment(e.id);r=document.createElement("div");r.innerHTML=e;k.appendChild(r)}else{r.className="sectionTableItem";f.AuthorImage&&(e=document.createElement("div"),e.style["float"]="left",r=new Image,r.src=f.AuthorImage,r.name=f.AuthorName,r.className="git-author-icon",e.appendChild(r),k.appendChild(e));e=document.createElement("div");
e.className="stretch";k.appendChild(e);r=document.createElement("a");r.className="navlinkonpage";r.href=l.toUrl(x.expand({resource:f.Location}));r.textContent=g.trimCommitMessage(f.Message);e.appendChild(r);d.addNavGrid(this.explorer.getNavDict(),f,r);new p.CommitTooltipDialog({commit:f,triggerNode:r});r=document.createElement("div");e.appendChild(r);r=document.createElement("div");r.textContent=n[" (SHA "]+f.Name+n[") by "]+f.AuthorName+n[" on "]+(new Date(f.Time)).toLocaleString();e.appendChild(r);
var q=document.createElement("div");q.textContent=n["Tags:"];q.className="gitCommitListTagsTitle";f.Tags&&f.Tags.length?f.Tags.forEach(function(a){var d=document.createElement("span");d.textContent=a.Name;d.className="gitCommitListTag";q.appendChild(d);var b=document.createElement("span");b.className="core-sprite-close gitCommitListTagClose";b.addEventListener("click",function(){h.commandService.runCommand("eclipse.removeTag",a,h)});d.appendChild(b)}):(r=document.createElement("span"),r.textContent=
n.None,q.className="gitCommitListNoTag",q.appendChild(r));e.appendChild(q);e=document.createElement("ul");e.className="layoutRight commandList";e.id="itemLevelCommands";k.appendChild(e);h.commandService.renderCommands("itemLevelCommands",e,f,h,"tool")}return a}},emptyCallback:function(a){var d=document.createElement("tr"),b=document.createElement("td");b.colSpan=1;var f=document.createElement("div");f.classList.add("sectionTableItem");if(this.explorer.model.isRebasing())f.style.whiteSpace="pre",f.appendChild(document.createTextNode(n.RebaseProgressDetails));
else{var g=document.createElement("div");g.textContent=n["The branch is up to date."];f.appendChild(g);g=document.createElement("div");g.textContent=n["You have no outgoing or incoming commits."];f.appendChild(g)}b.appendChild(f);d.appendChild(b);a.appendChild(d)}});return{GitCommitListExplorer:y,GitCommitListRenderer:v}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(l,n,m,k){var e={};e.CompareCommandFactory=function(){function e(g){this.setOptions(g,!0)}e.prototype={setOptions:function(g,b){b&&(this.options={});this.options||(this.options={});g&&Object.keys(g).forEach(function(a){this.options[a]=g[a]}.bind(this))},getOptions:function(){return this.options},initCommands:function(g){var b=this.options.commandSpanId,a=this.options.commandService;
if(a&&b){var f=new n.Command({name:l["Copy current change from right to left"],tooltip:l["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===g.type&&!g.getImageMode()&&g.options.newFile&&!g.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),d=new n.Command({name:l["Copy current change from left to right"],tooltip:l["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===g.type&&!g.getImageMode()&&g.options.oldFile&&!g.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),e=new n.Command({tooltip:l["Switch to unified diff"],name:l.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"twoWay"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),
h=new n.Command({tooltip:l["Switch to side by side diff"],name:l["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"inline"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),k=new n.Command({name:l["Next diff block"],tooltip:l["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},
callback:function(a){a.items.nextDiff()}}),t=new n.Command({name:l["Previous diff block"],tooltip:l["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},callback:function(a){a.items.prevDiff()}}),y=new n.Command({name:l["Next diff change"],tooltip:l["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},
callback:function(a){a.items.nextChange()}}),v=new n.Command({name:l["Previous diff change"],tooltip:l["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},callback:function(a){a.items.prevChange(a)}});a.addCommand(f);a.addCommand(d);a.addCommand(h);a.addCommand(e);a.addCommand(k);a.addCommand(t);a.addCommand(y);a.addCommand(v);a.registerCommandContribution(b,"orion.compare.toggle2Inline",
108);a.registerCommandContribution(b,"orion.compare.toggle2TwoWay",109);a.registerCommandContribution(b,"orion.compare.copyToLeft",110,null,!1,new m.KeyBinding(37,!0,!1,!0));a.registerCommandContribution(b,"orion.compare.copyToRight",111,null,!1,new m.KeyBinding(39,!0,!1,!0));a.registerCommandContribution(b,"orion.compare.nextDiff",112,null,!1,new m.KeyBinding(40,!0));a.registerCommandContribution(b,"orion.compare.prevDiff",113,null,!1,new m.KeyBinding(38,!0));g.options.wordLevelNav?(a.registerCommandContribution(b,
"orion.compare.nextChange",114,null,!1,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(b,"orion.compare.prevChange",115,null,!1,new m.KeyBinding(38,!0,!0))):(a.registerCommandContribution(b,"orion.compare.nextChange",114,null,!0,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(b,"orion.compare.prevChange",115,null,!0,new m.KeyBinding(38,!0,!0)))}},renderCommands:function(g){var b=this.options.commandSpanId,a=this.options.commandService;a&&b&&(k.empty(k.node(b)),this.options.gridRenderer&&
this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),a.renderCommands(b,b,g,g,"tool",null,this.options.gridRenderer.navGridHolder)):(a.renderCommands(b,b,g,g,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
a.renderCommands(b,b,g,g,"tool",null,this.options.gridRenderer.navGridHolder)):a.renderCommands(b,b,g,g,"tool",null))}};return e}();return e});
define("orion/compare/compareUtils",["orion/URITemplate"],function(l){var n=n||{};n.compareUtils=n.compareUtils||{};n.compareUtils.lookUpMapper=function(l,k,e){for(var h=0,g=0;g<l.length;g++){var b=l[g][k];0===b&&(b=1);if(e>=h&&e<h+b)return{mapperIndex:g,startFrom:h};if(g===l.length-1)break;h+=l[g][k]}return{mapperIndex:l.length-1,startFrom:h}};n.compareUtils.lookUpLineIndex=function(l,k,e){if(0===e)return 0;for(var h=0,g=0;g<e;g++)h+=l[g][k];return h};n.compareUtils.updateMapper=function(l,k,e,h,
g){if(h!==g&&(0<h||0<g)){var b=n.compareUtils.lookUpMapper(l,k,e);if(!(0>b.mapperIndex)){if(0<h){var a=e-b.startFrom;for(e=b.mapperIndex;e<l.length;e++){a=l[e][k]-a;if(h<=a){l[e][k]-=h;break}l[e][k]-=a;h-=a;a=0}}0<g&&(l[b.mapperIndex][k]+=g)}}};n.compareUtils.overlapMapper=function(l,k,e,h,g){l=e+l[k]-1;l<e&&(l=e);g<h&&(g=h);return l<h||g<e?!1:!0};n.compareUtils.findFirstDiff=function(l,k,e,h){for(var g=0,b=null,a=0;a<l.length&&!(g>h)&&(!n.compareUtils.overlapMapper(l[a],k,g,e,h)||!(b={mapperIndex:a,
startFrom:g},0!==l[a][2]));a++)g+=l[a][k];return b};n.compareUtils.matchMapper=function(l,k,e,h){if(0===l.length)return e;var g=e+Math.round((h-e)/3),b=n.compareUtils.findFirstDiff(l,k,e,h),a=0===l[b.mapperIndex][k]?b.startFrom:b.startFrom+l[b.mapperIndex][k]-1,f=n.compareUtils.lookUpLineIndex(l,1-k,b.mapperIndex),d=b.startFrom-e;return 0===l[b.mapperIndex][2]?f-d:g>=b.startFrom&&g<=a?f-Math.round((h-e)/3):g<b.startFrom?f-d:(0===l[b.mapperIndex][1-k]?f:f+l[b.mapperIndex][1-k]-1)-(a-e)};n.compareUtils.getMapperLineCount=
function(l){for(var k=0,e=0;e<l.length;e++)k+=Math.max(l[e][0],l[e][1]);return k};n.compareUtils.getAnnotationIndex=function(l,k){for(var e=0;e<l.length;e++)if(l[e][0]===k)return e;return-1};n.compareUtils.getAnnotationMapperIndex=function(l,k){return l[k][1]};n.compareUtils.getAnnotationIndexByMapper=function(l,k){for(var e=0;e<l.length;e++)if(l[e][1]===k)return{current:e,prev:e-1,next:e+1};return{current:-1,prev:-1,next:-1}};n.compareUtils.isMapperConflict=function(l,k){return 0>k||!l[k][3]?!1:
1===l[k][3]};n.compareUtils.mergeDiffBlocks=function(l,k,e,h,g,b){for(var a=0;a<k.length;a++){var f=k[a][0],d=e[k[a][1]];if(0<d[0]){for(var p="",q=0;q<d[0];q++)p=p+h[d[2]-1+q].substring(g)+b;d=l.getLineCount();f>=d&&(f=l.getLineEnd(d-1),q=l.getLineEnd(d-1,!0),f===q?(l.setText(b,f,f),f=d):f=d-1);f=l.getLineStart(f);l.setText(p,f,f)}}};n.compareUtils.generateCompareHref=function(m,k){var e=require.toUrl("compare/compare.html");k.conflict||(k.conflict=void 0);k.readonly||(k.readonly=void 0);return(new l(e+
"#{,resource,params*}")).expand({resource:m,params:k})};n.compareUtils.generateCompareTreeHref=function(m,k){var e=require.toUrl("compare-tree/compare-tree.html");return(new l(e+"#{,resource,params*}")).expand({resource:m,params:k})};return n.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(l,n){function m(e,h,g){var b=new n;e[h].apply(e,g).then(function(a){b.resolve(a)},function(a){b.reject(a)});return b}function k(e,h){var g=e.getServiceReferences("orion.core.diff"),b,a=g;if(h){a=[];for(b=0;b<g.length;++b)h(g[b])&&a.push(g[b])}var f=[],d=[];for(b=0;b<a.length;++b)f[b]=RegExp(a[b].getProperty("pattern")||".*"),d[b]=e.getService(a[b]);this._getService=function(a){if(-1===a.indexOf("://")){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<f.length;++b)if(f[b].test(a))return d[b];throw l["No Matching DiffService for location:"]+a;}}k.prototype={getDiffContent:function(e){return m(this._getService(e),"getDiffContent",arguments)},getDiffFileURI:function(e){return m(this._getService(e),"getDiffFileURI",arguments)}};return{DiffProvider:k}});
define("orion/compare/diffParser",[],function(){var l=l||{};l.DiffParser=function(){function l(k,e){this._lineDelimiter=k?k:m?"\r\n":"\n";this._diffLineDelimiter=e?e:this._lineDelimiter;this._DEBUG=!1}var m=-1!==window.navigator.platform.indexOf("Win");l.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(k){this._diffLineDelimiter=this._lineDelimiter=k},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(k,e,h,g){this._init();if(""===e)return{outPutFile:k,mapper:[]};this._oFileContents=""===k?[]:k.split(this._lineDelimiter);this._diffContents=e.split(this._diffLineDelimiter);e=this._diffContents.length;this._hunkRanges=[];for(var b=0;b<e;b++){var a=this._parseHunkRange(b);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return{outPutFile:k,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(k=0;k<this._hunkRanges.length;k++)this._parseHunkBlock(k);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(h);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));g||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var k=0;k<this._deltaMap.length;k++)if(console.log(JSON.stringify(this._deltaMap[k])),
0<this._deltaMap[k][2]){console.log("    **Diff content on change/add: \n");for(var e=0;e<this._deltaMap[k][0];e++)console.log("    "+this._diffContents[this._deltaMap[k][2]+e-1])}},_logNewFile:function(){for(var k=0;k<this._nFileContents.length;k++)console.log(this._nFileContents[k])},_createBlock:function(k,e,h,g){g===h&&" "===k||(h=[h,g-h,"s"],"-"===k?h[2]="r":"+"===k?h[2]="a":"c"===k&&(h[2]="c"),e.push(h))},_createMinusBlock:function(k,e,h){var g=this._oBlocks.length;0===g||k!==this._oBlocks[g-
1][0]?(this._oBlocks.push([0===k?1:k,h]),this._nBlocks.push([e,0,-2])):this._oBlocks[g-1][1]+=h},_createPlusBlock:function(k,e,h,g){var b=this._nBlocks.length;0===b||e!==this._nBlocks[b-1][0]?(this._oBlocks.push([0===k?1:k,0]),this._nBlocks.push([e,h,g])):(this._nBlocks[b-1][1]+=h,this._nBlocks[b-1][2]=g)},_parseHunkBlock:function(k){for(var e=" ",h=this._hunkRanges[k][0]+1,g=k===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[k+1][0],b=0,a=0,f=this._hunkRanges[k][1],d=this._hunkRanges[k][3],
p=h,l=h;l<g;l++)if(0!==this._diffContents[l].length){var u=this._diffContents[l][0];if("\\"===u&&("\\ No newline at end of file"===this._diffContents[l].substring(0,this._diffContents[l].length-1)||"\\ No newline at end of file"===this._diffContents[l]))"-"===e?this._oNewLineAtEnd=!1:" "===e?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,l>h&&"\r"===this._diffContents[l-1][this._diffContents[l-1].length-1]&&(this._diffContents[l-1]=this._diffContents[l-1].substring(0,this._diffContents[l-
1].length-1));else{switch(u){case "-":case "+":case " ":break;default:continue}if(e!==u){"+"===u&&(p=l);switch(e){case " ":f=this._hunkRanges[k][1]+b;d=this._hunkRanges[k][3]+a;break;case "-":this._createMinusBlock(f,d,this._hunkRanges[k][1]+b-f);break;case "+":this._createPlusBlock(f,d,this._hunkRanges[k][3]+a-d,p)}e=u}switch(u){case "-":b++;break;case "+":a++;break;case " ":b++,a++}}}switch(e){case "-":this._createMinusBlock(f,d,this._hunkRanges[k][1]+b-f);break;case "+":this._createPlusBlock(f,
d,this._hunkRanges[k][3]+a-d,p)}},_detectConflictes:function(k,e){if(0>k)return!1;for(var h=k+e,g=k;g<h;g++){var b=this._diffContents[g];if(-1<b.indexOf("\x3c\x3c\x3c\x3c\x3c")||-1<b.indexOf("\x3e\x3e\x3e\x3e\x3e"))return!0}return!1},_buildMap:function(k){var e=this._oBlocks.length,h=this._oFileContents.length,g=0,b;b=1;for(var a=0;a<e;a++)b=this._oBlocks[a][0]-b,0<b&&(this._deltaMap.push([b,b,0]),g+=b),k&&this._detectConflictes(this._nBlocks[a][2],this._nBlocks[a][1])?this._deltaMap.push([this._nBlocks[a][1],
this._oBlocks[a][1],this._nBlocks[a][2]+1,1]):this._deltaMap.push([this._nBlocks[a][1],this._oBlocks[a][1],this._nBlocks[a][2]+1]),g+=this._oBlocks[a][1],b=this._oBlocks[a][0]+this._oBlocks[a][1];0<h-b&&(this._deltaMap.push([h-b+1,h-b+1,0]),g+=h-b+1);g<h&&(b=h-g,k=this._deltaMap[this._deltaMap.length-1],0===k[2]?(k[0]+=b,k[1]+=b):-1===k[2]?this._deltaMap.push([b,b,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([b,b,0]):(this._nNewLineAtEnd&&(k[0]+=b),this._oNewLineAtEnd&&(k[1]+=
b)))},_buildNewFile:function(){var k=1,e=!1,h=this._deltaMap.length,g,b;for(g=0;g<h;g++){e=!1;if(0===this._deltaMap[g][2]){for(b=0;b<this._deltaMap[g][0];b++)this._nFileContents.push(this._oFileContents[k+b-1]);e=!0}else if(0<this._deltaMap[g][2])for(b=0;b<this._deltaMap[g][0];b++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+b-1].substring(1));k+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!e&&this._nFileContents.push("")},_converHRangeBody:function(k,e){if(k){var h=parseInt(k,10);
e.push(0<=h?h:1)}else e.push(1)},_parseHunkRange:function(k){var e=this._diffContents[k],h=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,g=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(e),b=null;if(g&&5===g.length)b=[k],this._converHRangeBody(g[1],b),this._converHRangeBody(g[2],b),this._converHRangeBody(g[3],b),this._converHRangeBody(g[4],b);else if((g=h.exec(e))&&5===g.length)b=[k],this._converHRangeBody(g[3],b),this._converHRangeBody(g[4],
b),this._converHRangeBody(g[1],b),this._converHRangeBody(g[2],b);return b}};return l}();return l});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(l){var n=n||{};n.CompareRuler=function(){function l(k,e,h){this._location=k||"left";this._overview=e||"page";this._rulerStyle=h;this._editor=null;var g=this;this._listener={onModelChanged:function(b){g._onModelChanged(b)}}}l.prototype={setView:function(k){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=k;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(k){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(k){},isAnnotationTypeVisible:function(k){return!1},removeAnnotationType:function(k){},setAnnotationModel:function(k){},getAnnotations:function(k,e){for(var h=[],g=k;g<e;g++){var b=this.getStyle(g);b&&(h[g]={html:this.getHTML(g),style:b})}return h},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return l}();n.LineNumberCompareRuler=function(){function l(k,e,h,g,b,a){n.CompareRuler.call(this,h,"page",g);this._diffNavigator=k;this._oddStyle=b||{style:{backgroundColor:"white"}};this._evenStyle=a||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=e}l.prototype=new n.CompareRuler;l.prototype.getStyle=function(k){return void 0===k?this._rulerStyle:this._evenStyle};l.prototype.getHTML=function(k){var e=
this._editor.getModel(),h=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);return!h?"":-1===k?e.getLineCount():h.getLineNumber?(k=h.getLineNumber(k),-1===k?"":k+1):k+1};l.prototype._onModelChanged=function(k){var e=k.start,h=this._editor.getModel();k=h.getLineCount();var g=(k+"").length;this._numOfDigits!==g&&(this._numOfDigits=g,e=h.getLineAtOffset(e),this._editor.redrawLines(e,k,this))};return l}();n.CompareOverviewRuler=function(){function m(k,e,h,g){this._diffNavigator=h;this._onClick=
g;n.CompareRuler.call(this,k,"document",e)}m.prototype=new n.CompareRuler;m.prototype.getStyle=function(k){var e,h;if(void 0===k)e=this._rulerStyle||{},h=e.style||(e.style={}),h.lineHeight="1px",h.fontSize="1px",h.width="14px";else if(e=-1!==k?{styleClass:"annotationOverview breakpoint"}:{},h=e.style||(e.style={}),h.cursor="pointer",h.width="8px",h.left="2px",0<=k){var g;if(this._diffNavigator&&this._diffNavigator.getFeeder())g=this._diffNavigator.getFeeder().getDiffBlocks();else return null;k=l.getAnnotationIndex(g,
k);if(-1===k)return null;g=l.getAnnotationMapperIndex(g,k);var b;b=this._diffNavigator.getMapper();if(g=l.isMapperConflict(b,g))h.border="1px #FF0000 solid";k===this._diffNavigator.getCurrentBlockIndex()&&(h.backgroundColor=g?"red":"blue");k=this._diffNavigator.getFeeder().getDiffBlockH(k);g=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>k)return null;b=this._editor.getClientArea();k=Math.floor(b.height*k/g);2>k&&(k=2);h.height=k+"px"}else return null;return e};m.prototype.setDiffNavigator=
function(k){this._diffNavigator=k};m.prototype.getHTML=function(k){return"\x26nbsp;"};m.prototype.onClick=function(k,e){void 0!==k&&this._onClick(k,this)};m.prototype._onModelChanged=function(k){0<this._editor.getModel().getLineCount()&&this._editor.redrawLines(0,1,this)};return m}();n.CompareCurveRuler=function(){function m(k){this._canvasDiv=k;this._mapper=void 0}m.prototype={init:function(k,e,h,g){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=k;this._leftEditor=e;this._rightEditor=
h;this._leftTextView=e.getTextView();this._rightTextView=h.getTextView();this._diffNavigator=g;this.render()},matchPositionFrom:function(k){var e=k?this._leftTextView:this._rightTextView,h=k?this._rightTextView:this._leftTextView,g=e.getTopIndex(),e=e.getBottomIndex();k=l.matchMapper(this._mapper,k?0:1,g,e);h.setTopIndex(k)},copyTo:function(k){if(this._diffNavigator.iterator){var e=this._diffNavigator.iterator.cursor();if(e&&("word"===e.type?!e.copied&&!e.parent.copied:!e.copied)){var h=k?this._rightTextView.getText(e.oldA.start,
e.oldA.end):this._leftTextView.getText(e.newA.start,e.newA.end),g=k?e.newA:e.oldA;(k?this._leftTextView:this._rightTextView).setText(h,g.start,g.end);e.copied=!0}}},render:function(){if(this._mapper){var k=this._canvasDiv.getContext("2d");k.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);k.strokeStyle="#AAAAAA";k.lineWidth=1;k.beginPath();var e=this._leftTextView.getTopIndex(),h=this._leftTextView.getBottomIndex(),g=this._rightTextView.getTopIndex(),b=this._rightTextView.getBottomIndex();
this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var a=0,f=0,d=!1,p=0;p<this._mapper.length;p++){if(0!==this._mapper[p][2])if(l.overlapMapper(this._mapper[p],0,a,e,h)||l.overlapMapper(this._mapper[p],1,f,g,b))this._renderCurve(p,a,f,this._canvasDiv,k,e,h,g,b),d=!0;else if(d)break;a+=this._mapper[p][0];f+=this._mapper[p][1]}k.stroke()}},_renderCurve:function(k,e,h,g,b,a,f,d,p){a=this._mapper[k];e=this._leftTextView.getLinePixel(e+a[0]/2)+a[0]%
2*this._leftLineH/3-this._leftTextView.getTopPixel();h=this._rightTextView.getLinePixel(h+a[1]/2)+a[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel();g=g.parentNode.clientWidth;k===this._diffNavigator.getCurrentMapperIndex()?(b.stroke(),b.strokeStyle="#000",b.lineWidth=1,b.beginPath(),b.moveTo(0,e),b.bezierCurveTo(g/3,e,0.666*g,h,g,h),b.stroke(),b.strokeStyle="#AAAAAA",b.lineWidth=1,b.beginPath()):(b.moveTo(0,e),b.bezierCurveTo(g/3,e,0.666*g,h,g,h),b.stroke())},onChanged:function(k,e){var h=
e?this._rightIniting:this._leftIniting;if(k.removedLineCount!==k.addedLineCount){var g=e?this._rightTextView:this._leftTextView;h||l.updateMapper(this._mapper,e?1:0,g.getModel().getLineAtOffset(k.start),k.removedLineCount,k.addedLineCount);(0<k.removedLineCount||0<k.addedLineCount)&&this.render()}e?this._rightIniting=!1:this._leftIniting=!1;return h}};return m}();return n});
define("orion/editor/i18n",{load:function(l,n,m,k){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+l],function(e){m(e)}):n(["orion/editor/config"],function(e){m(e&&e.languages||{})})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",
setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",
findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",
collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",
viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace All",findWith:"Find With",replaceWith:"Replace With",caseInsensitive:"Aa",regex:"/.*/",wholeWord:"\\b",caseInsensitiveTooltip:"Toggle Case Insensitive",regexTooltip:"Toogle Regex",wholeWordTooltip:"Toggle Whole Word",closeTooltip:"Close",replacingAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",
nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(l,n){var m={root:n},k;for(k in l)l.hasOwnProperty(k)&&"undefined"===typeof m[k]&&(m[k]=l[k]);return m});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(l,n,m){function k(e,h){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(e);this.setLineDelimiter(h)}k.prototype={destroy:function(){},find:function(e){1<this._text.length&&(this._text=[this._text.join("")]);var h=e.string,g=e.regex,b=h,a="",f=e.caseInsensitive;if(b)if(g){if(h=n.parse(b))b=h.pattern,a=h.flags}else b=h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),f&&(b=b.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var d=null,k;if(b){var h=e.reverse,l=e.wrap,g=e.wholeWord,u=e.start||0;e=e.end;var t=null!==e&&void 0!==e;-1===a.indexOf("g")&&(a+="g");-1===a.indexOf("m")&&(a+="m");f&&-1===a.indexOf("i")&&(a+="i");g&&(b="\\b"+b+"\\b");var m=this._text[0],v,x,s=0;t&&(f=u<e?u:e,m=m.substring(f,u<e?e:u),s=f);var w=RegExp(b,a);h?k=function(){var a=null;for(w.lastIndex=0;;){x=w.lastIndex;v=w.exec(m);if(x===w.lastIndex)return null;if(v){if(!(v.index+s<u)){if(!l||a)break;u=m.length+s}a={start:v.index+
s,end:w.lastIndex+s}}else break}a&&(u=a.start);return a}:(t||(w.lastIndex=u),k=function(){for(;;){x=w.lastIndex;v=w.exec(m);if(x===w.lastIndex)break;if(v)return{start:v.index+s,end:w.lastIndex+s};if(!(0!==x&&l))break}return null});d=k()}return{next:function(){var a=d;a&&(d=k());return a},hasNext:function(){return null!==d}}},getCharCount:function(){for(var e=0,h=0;h<this._text.length;h++)e+=this._text[h].length;return e},getLine:function(e,h){var g=this.getLineCount();if(!(0<=e&&e<g))return null;
var b=this._lineOffsets[e];if(e+1<g){g=this.getText(b,this._lineOffsets[e+1]);if(h)return g;for(var b=g.length,a;10===(a=g.charCodeAt(b-1))||13===a;)b--;return g.substring(0,b)}return this.getText(b)},getLineAtOffset:function(e){var h=this.getCharCount();if(!(0<=e&&e<=h))return-1;var g=this.getLineCount();if(e===h)return g-1;var b,a,f=this._lastLineIndex;if(0<=f&&f<g&&(b=this._lineOffsets[f],a=f+1<g?this._lineOffsets[f+1]:h,b<=e&&e<a))return f;for(var d=g,k=-1;1<d-k;)if(f=Math.floor((d+k)/2),b=this._lineOffsets[f],
a=f+1<g?this._lineOffsets[f+1]:h,e<=b)d=f;else if(e<a){d=f;break}else k=f;return this._lastLineIndex=d},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,h){var g=this.getLineCount();if(!(0<=e&&e<g))return-1;if(e+1<g){g=this._lineOffsets[e+1];if(h)return g;for(var b=this.getText(Math.max(this._lineOffsets[e],g-2),g),a=b.length,f;10===(f=b.charCodeAt(a-1))||13===f;)a--;return g-(b.length-a)}return this.getCharCount()},
getLineStart:function(e){return!(0<=e&&e<this.getLineCount())?-1:this._lineOffsets[e]},getText:function(e,h){void 0===e&&(e=0);void 0===h&&(h=this.getCharCount());if(e===h)return"";for(var g=0,b=0,a;b<this._text.length;){a=this._text[b].length;if(e<=g+a)break;g+=a;b++}for(var f=g,d=b;b<this._text.length;){a=this._text[b].length;if(h<=g+a)break;g+=a;b++}if(d===b)return this._text[d].substring(e-f,h-g);f=this._text[d].substring(e-f);g=this._text[b].substring(0,h-g);return f+this._text.slice(d+1,b).join("")+
g},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e,h){"auto"===e&&(e=void 0,1<this.getLineCount()&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=e?e:m.platformDelimiter;if(h){var g=this.getLineCount();if(1<g){for(var b=Array(g),a=0;a<g;a++)b[a]=this.getLine(a);this.setText(b.join(this._lineDelimiter))}}},setText:function(e,h,g){void 0===e&&(e="");void 0===h&&(h=0);void 0===g&&(g=
this.getCharCount());if(!(h===g&&""===e)){for(var b=this.getLineAtOffset(h),a=this.getLineAtOffset(g),f=h,d=g-h,k=a-b,l=e.length,u=0,t=this.getLineCount(),m=0,n=0,x=0,s=[];;){-1!==m&&m<=x&&(m=e.indexOf("\r",x));-1!==n&&n<=x&&(n=e.indexOf("\n",x));if(-1===n&&-1===m)break;x=-1!==m&&-1!==n?m+1===n?n+1:(m<n?m:n)+1:-1!==m?m+1:n+1;s.push(h+x);u++}this.onChanging({type:"Changing",text:e,start:f,removedCharCount:d,addedCharCount:l,removedLineCount:k,addedLineCount:u});0===s.length&&(x=this.getLineStart(b),
a=a+1<t?this.getLineStart(a+1):this.getCharCount(),h!==x&&(e=this.getText(x,h)+e,h=x),g!==a&&(e+=this.getText(g,a),g=a));x=l-d;for(a=b+k+1;a<t;a++)this._lineOffsets[a]+=x;if(5E4>s.length)b=[b+1,k].concat(s),Array.prototype.splice.apply(this._lineOffsets,b);else{x=b+1;this._lineOffsets.splice(x,k);for(t=0;t<s.length;t+=5E4)b=[x,0].concat(s.slice(t,Math.min(s.length,t+5E4))),Array.prototype.splice.apply(this._lineOffsets,b),x+=5E4}for(x=t=0;x<this._text.length;){a=this._text[x].length;if(h<=t+a)break;
t+=a;x++}b=t;for(s=x;x<this._text.length;){a=this._text[x].length;if(g<=t+a)break;t+=a;x++}a=this._text[x];h=this._text[s].substring(0,h-b);g=a.substring(g-t);s=[s,x-s+1];h&&s.push(h);e&&s.push(e);g&&s.push(g);Array.prototype.splice.apply(this._text,s);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:f,removedCharCount:d,addedCharCount:l,removedLineCount:k,addedLineCount:u})}}};l.EventTarget.addMixin(k.prototype);return{TextModel:k}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(l,n){function m(e){e&&(this._view=e,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function k(e){m.call(this,e)}m.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(e){for(var h=[],g=this._keyBindings,b=0;b<g.length;b++)g[b].actionID===e&&h.push(g[b].keyBinding);return h},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(e){if("keydown"===
e.type)switch(e.keyCode){case 16:case 17:case 18:case 91:return}for(var h=this._keyBindingIndex,g=this._matchingKeyBindings||this._keyBindings,b=[],a=0;a<g.length;a++){var f=g[a],d=f.keyBinding.match(e,h);if(!0===d)return this._keyBindingIndex=0,this._matchingKeyBindings=null,f.actionID;"number"===typeof d&&b.push(f)}if(0===b.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=b,"noop"},setKeyBinding:function(e,h){for(var g=this._keyBindings,
b=0;b<g.length;b++){var a=g[b];if(a.keyBinding.equals(e)){h?a.actionID=h:a.predefined?a.actionID="noop":g.splice(b,1);return}}h&&g.push({keyBinding:e,actionID:h})},setView:function(e){this._view=e}};k.prototype=new m;k.prototype.createKeyBindings=function(){var e=l.KeyBinding,h=[];h.push({actionID:"lineUp",keyBinding:new e(38),predefined:!0});h.push({actionID:"lineDown",keyBinding:new e(40),predefined:!0});h.push({actionID:"charPrevious",keyBinding:new e(37),predefined:!0});h.push({actionID:"charNext",
keyBinding:new e(39),predefined:!0});n.isMac?(h.push({actionID:"scrollPageUp",keyBinding:new e(33),predefined:!0}),h.push({actionID:"scrollPageDown",keyBinding:new e(34),predefined:!0}),h.push({actionID:"pageUp",keyBinding:new e(33,null,null,!0),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new e(34,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new e(37,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new e(39,!0),predefined:!0}),h.push({actionID:"wordPrevious",
keyBinding:new e(37,null,null,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new e(39,null,null,!0),predefined:!0}),h.push({actionID:"scrollTextStart",keyBinding:new e(36),predefined:!0}),h.push({actionID:"scrollTextEnd",keyBinding:new e(35),predefined:!0}),h.push({actionID:"textStart",keyBinding:new e(38,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new e(40,!0),predefined:!0}),h.push({actionID:"scrollPageUp",keyBinding:new e(38,null,null,null,!0),predefined:!0}),h.push({actionID:"scrollPageDown",
keyBinding:new e(40,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new e(37,null,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new e(39,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new e(38,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new e(40,null,null,!0),predefined:!0})):(h.push({actionID:"pageUp",keyBinding:new e(33),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new e(34),predefined:!0}),
h.push({actionID:"lineStart",keyBinding:new e(36),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new e(35),predefined:!0}),h.push({actionID:"wordPrevious",keyBinding:new e(37,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new e(39,!0),predefined:!0}),h.push({actionID:"textStart",keyBinding:new e(36,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new e(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(h.push({actionID:"lineUp",keyBinding:new e(38,!0),predefined:!0}),h.push({actionID:"lineDown",
keyBinding:new e(40,!0),predefined:!0}));n.isWindows&&(h.push({actionID:"scrollLineUp",keyBinding:new e(38,!0),predefined:!0}),h.push({actionID:"scrollLineDown",keyBinding:new e(40,!0),predefined:!0}));h.push({actionID:"selectLineUp",keyBinding:new e(38,null,!0),predefined:!0});h.push({actionID:"selectLineDown",keyBinding:new e(40,null,!0),predefined:!0});h.push({actionID:"selectCharPrevious",keyBinding:new e(37,null,!0),predefined:!0});h.push({actionID:"selectCharNext",keyBinding:new e(39,null,!0),
predefined:!0});h.push({actionID:"selectPageUp",keyBinding:new e(33,null,!0),predefined:!0});h.push({actionID:"selectPageDown",keyBinding:new e(34,null,!0),predefined:!0});n.isMac?(h.push({actionID:"selectLineStart",keyBinding:new e(37,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new e(39,!0,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",keyBinding:new e(37,null,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new e(39,null,!0,!0),predefined:!0}),
h.push({actionID:"selectTextStart",keyBinding:new e(36,null,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new e(35,null,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new e(38,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new e(40,!0,!0),predefined:!0}),h.push({actionID:"selectLineStart",keyBinding:new e(37,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new e(39,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineStart",
keyBinding:new e(38,null,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new e(40,null,!0,!0),predefined:!0})):(n.isLinux&&(h.push({actionID:"selectWholeLineUp",keyBinding:new e(38,!0,!0),predefined:!0}),h.push({actionID:"selectWholeLineDown",keyBinding:new e(40,!0,!0),predefined:!0})),h.push({actionID:"selectLineStart",keyBinding:new e(36,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new e(35,null,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",
keyBinding:new e(37,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new e(39,!0,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new e(36,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new e(35,!0,!0),predefined:!0}));h.push({actionID:"undo",keyBinding:new l.KeyBinding("z",!0),predefined:!0});n.isMac?h.push({actionID:"redo",keyBinding:new l.KeyBinding("z",!0,!0),predefined:!0}):h.push({actionID:"redo",keyBinding:new l.KeyBinding("y",!0),predefined:!0});
h.push({actionID:"deletePrevious",keyBinding:new e(8),predefined:!0});h.push({actionID:"deletePrevious",keyBinding:new e(8,null,!0),predefined:!0});h.push({actionID:"deleteNext",keyBinding:new e(46),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new e(8,!0),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new e(8,!0,!0),predefined:!0});h.push({actionID:"deleteWordNext",keyBinding:new e(46,!0),predefined:!0});h.push({actionID:"tab",keyBinding:new e(9),predefined:!0});
h.push({actionID:"shiftTab",keyBinding:new e(9,null,!0),predefined:!0});h.push({actionID:"enter",keyBinding:new e(13),predefined:!0});h.push({actionID:"enter",keyBinding:new e(13,null,!0),predefined:!0});h.push({actionID:"selectAll",keyBinding:new e("a",!0),predefined:!0});h.push({actionID:"toggleTabMode",keyBinding:new e("m",!0),predefined:!0});n.isMac&&(h.push({actionID:"deleteNext",keyBinding:new e(46,null,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new e(8,null,null,!0),
predefined:!0}),h.push({actionID:"deleteWordNext",keyBinding:new e(46,null,null,!0),predefined:!0}));h.push({actionID:"toggleWrapMode",keyBinding:new l.KeyBinding("w",!0,!1,!0)});h.push({actionID:"toggleOverwriteMode",keyBinding:new l.KeyBinding(45)});if(!n.isFirefox){var g=n.isMac&&n.isChrome;h.push({actionID:"noop",keyBinding:new e("u",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new e("i",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new e("b",!g,!1,!1,g),predefined:!0})}n.isFirefox&&
(h.push({actionID:"copy",keyBinding:new e(45,!0),predefined:!0}),h.push({actionID:"paste",keyBinding:new e(45,null,!0),predefined:!0}),h.push({actionID:"cut",keyBinding:new e(46,null,!0),predefined:!0}));n.isMac&&(h.push({actionID:"lineStart",keyBinding:new e("a",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new e("e",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineUp",keyBinding:new e("p",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineDown",keyBinding:new e("n",!1,!1,
!1,!0),predefined:!0}),h.push({actionID:"charPrevious",keyBinding:new e("b",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"charNext",keyBinding:new e("f",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deletePrevious",keyBinding:new e("h",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteNext",keyBinding:new e("d",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineEnd",keyBinding:new e("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(h.push({actionID:"scrollPageDown",keyBinding:new e("v",!1,
!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineStart",keyBinding:new e("u",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new e("w",!1,!1,!1,!0),predefined:!0})):(h.push({actionID:"pageDown",keyBinding:new e("v",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"centerLine",keyBinding:new e("l",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"enterNoCursor",keyBinding:new e("o",!1,!1,!1,!0),predefined:!0})));return h};return{KeyMode:m,DefaultKeyMode:k}});
define("orion/editor/util",[],function(){return{contains:function(l,n){if(!n)return!1;if(!l.compareDocumentPosition){for(var m=n;m;){if(l===m)return!0;m=m.parentNode}return!1}return l===n||0!==(l.compareDocumentPosition(n)&16)},addEventListener:function(l,n,m,k){"function"===typeof l.addEventListener?l.addEventListener(n,m,!0===k):l.attachEvent("on"+n,m)},removeEventListener:function(l,n,m,k){"function"===typeof l.removeEventListener?l.removeEventListener(n,m,!0===k):l.detachEvent("on"+n,m)},Animation:function(){function l(l){this.options=
l}l.prototype.play=function(){var l="number"===typeof this.options.duration?this.options.duration:350,m=this.options.easing||this.defaultEasing,k=this.options.onAnimate||function(){},e=this.options.curve[0],h=this.options.curve[1],g=h-e,b=-1,a,f=this;this.interval=this.options.window.setInterval(function(){b=-1===b?(new Date).getTime():b;var d=((new Date).getTime()-b)/l;1>d?(d=m(d),a=e+d*g,k(a)):(k(h),f.stop())},"number"===typeof this.options.rate?this.options.rate:20)};l.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};l.prototype.defaultEasing=function(l){return Math.sin(l*(Math.PI/2))};return l}()}});
define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(l,n,m,k,e,h,g){function b(a,d,b){if(b){d.className="";b=d.attributes;for(var f=b.length;0<f--;)(!g.isIE||9<=g.isIE||9>g.isIE&&b[f].specified)&&d.removeAttribute(b[f].name)}if(a){a.styleClass&&(d.className=a.styleClass);if(b=a.style)for(var e in b)b.hasOwnProperty(e)&&(d.style[e]=b[e]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&
d.setAttribute(h,a[h])}}function a(a){return a instanceof Array?a.slice(0):a}function f(a,d){if(!a)return d;if(!d)return a;for(var b in d)d.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=d[b]));return a}function d(a,b){if(a===b)return!0;if(a&&!b||!a&&b||a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof Array&&b instanceof Array)||a.length!==b.length)return!1;for(var f=0;f<a.length;f++)if(!d(a[f],b[f]))return!1;return!0}if(!(a instanceof
Object)||!(b instanceof Object))return!1;for(f in a)if(a.hasOwnProperty(f)&&(!b.hasOwnProperty(f)||!d(a[f],b[f])))return!1;for(f in b)if(!a.hasOwnProperty(f))return!1;return!0}function p(a,d,b){for(var f=0,g=0,e=0,h=a.length;e<h;){-1!==f&&f<=e&&(f=a.indexOf("\r",e));-1!==g&&g<=e&&(g=a.indexOf("\n",e));var k=e,p;if(-1===g&&-1===f){d(a.substring(e));break}-1!==f&&-1!==g?f+1===g?(p=f,e=g+1):(p=f<g?f:g,e=(f<g?f:g)+1):-1!==f?(p=f,e=f+1):(p=g,e=g+1);d(a.substring(k,p));b()}}function q(a){var d,b,f,g,e=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;e.getComputedStyle?(a=e.getComputedStyle(a,null),d=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),f=a.getPropertyValue("padding-right"),g=a.getPropertyValue("padding-bottom")):a.currentStyle&&(d=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,f=a.currentStyle.paddingRight,g=a.currentStyle.paddingBottom);return{left:parseInt(d,10)||0,top:parseInt(b,10)||0,right:parseInt(f,10)||0,bottom:parseInt(g,10)||0}}function u(a){var d,
b,f,g,e=a._trim;if(!e){var e=q(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;h.getComputedStyle?(g=h.getComputedStyle(a,null),d=g.getPropertyValue("border-left-width"),b=g.getPropertyValue("border-top-width"),f=g.getPropertyValue("border-right-width"),g=g.getPropertyValue("border-bottom-width")):a.currentStyle&&(d=a.currentStyle.borderLeftWidth,b=a.currentStyle.borderTopWidth,f=a.currentStyle.borderRightWidth,g=a.currentStyle.borderBottomWidth);d=parseInt(d,10)||0;b=parseInt(b,10)||
0;f=parseInt(f,10)||0;g=parseInt(g,10)||0;e.left+=d;e.top+=b;e.right+=f;e.bottom+=g;a._trim=e}return e}function t(a,d,b,f){function g(d){if(d.animationName===h){var b=d.target;"function"===typeof b.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){b.__DOMReady()},0)}}function e(a,d){for(var b=["","-webkit-","-moz-","-ms-","-o-"],f="",g="body ."+a+" {\n",r=0;r<b.length;r++)f+="@"+b[r]+"keyframes "+d+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",g+=b[r]+"animation-duration: 0.001s;\n"+
b[r]+"animation-name: "+d+";\n";return f+(g+"}")}b="_"+b+"DOMReady";d.className=d.className?d.className+" "+b:b;d.__DOMReady=f;f=b+"Style";if(!a.getElementById(f)){var h=b+"Animation";w(a,"animationstart",g,!1);w(a,"MSAnimationStart",g,!1);w(a,"webkitAnimationStart",g,!1);d=a.createElement("style");d.id=f;f=a.getElementsByTagName("head")[0]||a.documentElement;d.appendChild(a.createTextNode(e(b,h)));f.insertBefore(d,f.firstChild)}}function y(a,d,b){this.start=a;this.end=d;this.caret=b}function v(a){this.left=
a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function x(a,d,b){this.view=a;this.lineIndex=d;this._lineDiv=b}function s(a){this._init(a||{})}var w=h.addEventListener,z=h.removeEventListener,C=h.Animation;y.prototype={clone:function(){return new y(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;this.start>this.end&&(a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret)},
setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start\x3d"+this.start+" end\x3d"+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};v.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};
x.prototype={create:function(a,d){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,d,this.lineIndex);b._line=this;return b}},_createLine:function(a,f,e){var h=this.view,k=h._model,p=k.getLine(e),l=k.getLineStart(e),q={type:"LineStyle",textView:h,lineIndex:e,lineText:p,lineStart:l};h.onLineStyle(q);var u=a.ownerDocument,k=f||g.createElement(u,"div");if(!f||!d(f.viewStyle,q.style))b(q.style,k,f),f&&(f._trim=null),k.viewStyle=q.style,k.setAttribute("role","presentation");k.lineIndex=e;if(f&&
k.viewLineText===p&&d(q.ranges,k.viewRanges))return k;k.viewRanges=q.ranges;k.viewLineText=p;e=[];this._createRanges(q.ranges,p,0,p.length,l,{tabOffset:0,ranges:e});q=" ";!h._fullSelection&&9>g.isIE&&(q="\ufeff");h={text:q,style:h._metrics.largestFontStyle,ignoreChars:1};0===e.length||!e[e.length-1].style||"div"!==e[e.length-1].style.tagName?e.push(h):e.splice(e.length-1,0,h);var t,m,n,y=q=0;if(g.isFirefox&&2E3<p.length){f&&(k.innerHTML="",f.lineWidth=void 0);f=u.createDocumentFragment();for(p=0;p<
e.length;p++)h=e[p],l=h.text,t=h.style,t=this._createSpan(k,l,t,h.ignoreChars),f.appendChild(t);k.appendChild(f)}else{var v,w;if(f){if(m=f.modelChangedEvent)0===m.removedLineCount&&0===m.addedLineCount?(w=m.start-l,v=m.addedCharCount-m.removedCharCount):w=-1,f.modelChangedEvent=void 0;m=f.firstChild}for(p=0;p<e.length;p++){h=e[p];l=h.text;q+=l.length;t=h.style;if(m)if(n=m.firstChild.data,u=m.viewStyle,n===l&&d(t,u)){y+=n.length;m._rectsCache=void 0;t=m=m.nextSibling;continue}else for(;m;){if(-1!==
w){u=q;u>=w&&(u-=v);n=(n=m.firstChild.data)?n.length:0;if(y+n>u)break;y+=n}u=m.nextSibling;k.removeChild(m);m=u}t=this._createSpan(k,l,t,h.ignoreChars);m?k.insertBefore(t,m):k.appendChild(t);f&&(f.lineWidth=void 0)}if(f)for(v=t?t.nextSibling:null;v;)u=v.nextSibling,f.removeChild(v),v=u}k.parentNode||a.appendChild(k);return k},_createRanges:function(a,b,f,g,e,h){if(!(f>g)){if(a)for(var k=0;k<a.length;k++){var p=a[k];if(!(p.end<e+f)){var l=Math.max(e+f,p.start)-e;if(l>g)break;var q=Math.min(e+g,p.end)-
e;if(l<=q){l=Math.max(f,l);q=Math.min(g,q);f<l&&this._createRange(b,f,l,null,h);if(!p.style||!p.style.unmergeable)for(;k+1<a.length&&a[k+1].start-e===q&&d(p.style,a[k+1].style);)p=a[k+1],q=Math.min(e+g,p.end)-e,k++;this._createRange(b,l,q,p.style,h);f=q}}}f<g&&this._createRange(b,f,g,null,h)}},_createRange:function(a,d,b,f,g){if(!(d>b)){var e=this.view._customTabSize;if(e&&8!==e)for(var h=a.indexOf("\t",d);-1!==h&&h<b;){d<h&&(d={text:a.substring(d,h),style:f},g.ranges.push(d),g.tabOffset+=d.text.length);
d=e-g.tabOffset%e;if(0<d){for(var k="\u00a0",p=1;p<d;p++)k+=" ";d={text:k,style:f,ignoreChars:d-1};g.ranges.push(d);g.tabOffset+=d.text.length}d=h+1;if(d===b)return;h=a.indexOf("\t",d)}d<=b&&(d={text:a.substring(d,b),style:f},g.ranges.push(d),g.tabOffset+=d.text.length)}},_createSpan:function(a,d,f,e){var h=this.view,k="span";f&&f.tagName&&(k=f.tagName.toLowerCase());var p="a"===k;p&&(this.hasLink=!0);p&&!h._linksVisible&&(k="span");p=a.ownerDocument;a=g.createElement(a.ownerDocument,k);a.appendChild(p.createTextNode(f&&
f.text?f.text:d));f&&f.html?(a.innerHTML=f.html,a.ignore=!0):f&&f.node&&(a.appendChild(f.node),a.ignore=!0);b(f,a);if("a"===k){var l=h._getWindow();w(a,"click",function(a){return h._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=f;e&&(a.ignoreChars=e);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,d){var b=this._ensureCreated(),f=this.view;if(void 0===a)return this._getLineBoundingClientRect(b,
!0);var e=f._model,h=b.ownerDocument,k=this.lineIndex,p=null;if(a<e.getLineEnd(k)){var l=e.getLineStart(k);this.forEach(function(d){var e=d.firstChild,k=this._nodeLength(d);if(l+k>a){var A=a-l;if(1===e.length)p=new v(d.getBoundingClientRect());else if(f._isRangeRects)k=h.createRange(),k.setStart(e,A),k.setEnd(e,A+1),p=new v(k.getBoundingClientRect());else if(g.isIE)k=h.body.createTextRange(),k.moveToElementText(d),k.collapse(),(e=0===A&&8===g.isIE)&&(A=1),k.moveEnd("character",A+1),k.moveStart("character",
A),p=new v(k.getBoundingClientRect()),e&&(p.left=d.getClientRects()[0].left);else{var q=e.data;d.removeChild(e);d.appendChild(h.createTextNode(q.substring(0,A)));var u=g.createElement(h,"span");u.appendChild(h.createTextNode(q.substring(A,A+1)));d.appendChild(u);d.appendChild(h.createTextNode(q.substring(A+1)));p=new v(u.getBoundingClientRect());d.innerHTML="";d.appendChild(e);this._createdDiv||(d=f._getSelection(),(l<=d.start&&d.start<l+k||l<=d.end&&d.end<l+k)&&f._updateDOMSelection())}g.isIE&&(A=
b.ownerDocument.defaultView||b.ownerDocument.parentWindow,d=A.screen.logicalXDPI/A.screen.deviceXDPI,A=A.screen.logicalYDPI/A.screen.deviceYDPI,p.left*=d,p.right*=d,p.top*=A,p.bottom*=A);return!1}l+=k;return!0})}e=this.getBoundingClientRect();p||(f._wrapMode?(k=this.getClientRects(),p=k[k.length-1],p.left=p.right,p.left+=e.left,p.top+=e.top,p.right+=e.left,p.bottom+=e.top):(p=new v(e),p.left=p.right));if(d||void 0===d)p.left-=e.left,p.top-=e.top,p.right-=e.left,p.bottom-=e.top;return p},forEach:function(a){for(var d=
this._ensureCreated().firstChild;d;){var b=d.nextSibling;if(!d.ignore&&!a.call(this,d))break;d=b}},_getClientRects:function(a,d){var b,f,g,e;if(!a._rectsCache){b=a.getClientRects();f=Array(b.length);for(e=0;e<b.length;e++)g=f[e]=new v(b[e]),g.left-=d.left,g.top-=d.top,g.right-=d.left,g.bottom-=d.top;a._rectsCache=f}b=a._rectsCache;f=[b.length];for(e=0;e<b.length;e++)f[e]=new v(b[e]);return f},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var d=[],b=this._ensureCreated().getBoundingClientRect();
this.forEach(function(a){a=this._getClientRects(a,b);for(var f=0;f<a.length;f++){var g=a[f],e,r;if(g.top!==g.bottom){var h=g.top+(g.bottom-g.top)/2;for(e=0;e<d.length&&!(r=d[e],r.top<=h&&h<r.bottom);e++);e===d.length?d.push(g):(g.left<r.left&&(r.left=g.left),g.top<r.top&&(r.top=g.top),g.right>r.right&&(r.right=g.right),g.bottom>r.bottom&&(r.bottom=g.bottom))}}return!0});return void 0!==a?d[a]:d},_getLineBoundingClientRect:function(a,d){var b=new v(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=
b.left;for(var f=a.lastChild;f&&f.ignoreChars===f.firstChild.length;)f=f.previousSibling;f&&(f=f.getBoundingClientRect(),b.right=f.right+u(a).right)}d&&(f=u(a),b.left+=f.left,b.right-=f.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;var d=this.getClientRects();a=this.getBoundingClientRect(a);a=a.top+(a.bottom-a.top)/2;for(var b=0;b<d.length;b++)if(d[b].top<=a&&a<d[b].bottom)return b;return d.length-
1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(this.lineIndex);var d=this.getClientRects();return this.getOffset(d[a].left+1,d[a].top+1)},_nodeLength:function(a){if(!a||a.ignore)return 0;var d=a.firstChild.length;a.ignoreChars&&(d-=a.ignoreChars);return d},getModelOffset:function(a,d){if(!a)return 0;var b=0;this.forEach(function(f){var g=f.firstChild;if(g===a)return f.ignoreChars&&(b-=f.ignoreChars),b+=d,!1;f.ignoreChars&&(b-=f.ignoreChars);b+=g.data.length;
return!0});return Math.max(0,b)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var d=0,b,f,g=this.view._model,e=g.getLineStart(this.lineIndex),h=a-e,k=g.getLineEnd(this.lineIndex)-e;this.forEach(function(a){var g=a.firstChild,e=this._nodeLength(a);if(e+d>h||d+e>=k)return b=g,f=h-d,a.ignoreChars&&(0<e&&f===e)&&(f+=a.ignoreChars),!1;d+=e;return!0});return{node:b,offset:f}},getText:function(a){var d="",b=0;this.forEach(function(f){var g;if(f.ignoreChars){g=f.lastChild;for(var e=
0,h=[],k=-1;g;){var p=g.data;if(p)for(var l=p.length-1;0<=l;l--){var q=p.substring(l,l+1);e<f.ignoreChars&&(" "===q||"\ufeff"===q)?e++:h.push("\u00a0"===q?"\t":q)}a===g&&(k=h.length);g=g.previousSibling}h=h.reverse().join("");-1!==k&&(b=d.length+h.length-k);d+=h}else for(g=f.firstChild;g;)a===g&&(b=d.length),d+=g.data,g=g.nextSibling;return!0});return{text:d,offset:b}},getOffset:function(a,d){function b(f,l,D){var m=f.firstChild,B=t._nodeLength(f),n=q.ownerDocument,y=n.defaultView||n.parentWindow,
v=g.isIE?y.screen.logicalXDPI/y.screen.deviceXDPI:1,w=g.isIE?y.screen.logicalYDPI/y.screen.deviceYDPI:1,x,s,z,y=D.left+u.left,C,J;if(g.isIE||e._isRangeRects){for(var n=e._isRangeRects?n.createRange():n.body.createTextRange(),G=B,U=-1;1<G-U;){var V=Math.floor((G+U)/2);D=U+1;x=V===B-1&&f.ignoreChars?m.length:V+1;C=0===D&&8===g.isIE;e._isRangeRects?(n.setStart(m,D),n.setEnd(m,x)):(C&&(D=1),n.moveToElementText(f),n.move("character",D),n.moveEnd("character",x-D));J=n.getClientRects();for(var T=!1,S=0;S<
J.length;S++)if(D=J[S],x=(C?y:D.left)*v-u.left,z=D.right*v-u.left,s=D.top*w-u.top,D=D.bottom*w-u.top,x<=a&&a<z&&(!e._wrapMode||s<=d&&d<D)){T=!0;break}T?G=V:U=V}l+=G;D=G;x=G===B-1&&f.ignoreChars?m.length:Math.min(G+1,m.length);e._isRangeRects?(n.setStart(m,D),n.setEnd(m,x)):(n.moveToElementText(f),n.move("character",D),n.moveEnd("character",x-D));J=n.getClientRects();B=!1;0<J.length&&(D=J[0],x=(C?y:D.left)*v-u.left,z=D.right*v-u.left,B=a>x+(z-x)/2);f=l-p;m=h.getLine(k);v=m.charCodeAt(f);55296<=v&&
56319>=v&&B?f<m.length&&(v=m.charCodeAt(f+1),56320<=v&&57343>=v&&(l+=1)):56320<=v&&(57343>=v&&!B)&&0<f&&(v=m.charCodeAt(f-1),55296<=v&&56319>=v&&(l-=1));B&&l++}else{v=[];for(C=0;C<B;C++)v.push("\x3cspan\x3e"),C===B-1?v.push(m.data.substring(C)):v.push(m.data.substring(C,C+1)),v.push("\x3c/span\x3e");f.innerHTML=v.join("");for(v=f.firstChild;v;){D=v.getBoundingClientRect();x=D.left-u.left;z=D.right-u.left;if(x<=a&&a<z){a>x+(z-x)/2&&l++;break}l++;v=v.nextSibling}t._createdDiv||(f.innerHTML="",f.appendChild(m),
f=e._getSelection(),(l<=f.start&&f.start<l+B||l<=f.end&&f.end<l+B)&&e._updateDOMSelection())}return l}function f(b){if(b.ignore)return null;b=t._getClientRects(b,u);for(var g=0;g<b.length;g++){var h=b[g];if(h.left<=a&&a<h.right&&(!e._wrapMode||h.top<=d&&d<h.bottom))return h}return null}var e=this.view,h=e._model,k=this.lineIndex,p=h.getLineStart(k),l=h.getLineEnd(k);if(p===l)return p;var q=this._ensureCreated(),u=this.getBoundingClientRect(),t=this,m,n;if(e._wrapMode){m=this.getClientRects();d<m[0].top&&
(d=m[0].top);for(var y=0;y<m.length&&!(n=m[y],n.top<=d&&d<n.bottom);y++);a<n.left&&(a=n.left);a>n.right&&(a=n.right-1)}else 0>a&&(a=0),a>u.right-u.left&&(a=u.right-u.left);var v,w;if(this._lastHitChild&&this._lastHitChild.parentNode){if(v=this._lastHitOffset,w=this._lastHitChild,n=f(w),!n){m=v;for(var y=v+this._nodeLength(w),x=w.previousSibling,s=w.nextSibling;x||s;){if(x){m-=this._nodeLength(x);if(n=f(x)){w=x;v=m;break}x=x.previousSibling}if(s){if(n=f(s)){w=s;v=y;break}y+=this._nodeLength(s);s=s.nextSibling}}}}else v=
p,this.forEach(function(a){w=a;if(n=f(w))return!1;v+=this._nodeLength(w);return!0});w&&n&&(this._lastHitChild=w,this._lastHitOffset=v,v=b(w,v,n));return Math.min(l,Math.max(p,v))},getNextOffset:function(a,d){if("line"===d.unit){var b=this.view._model,f=b.getLineAtOffset(a);if(0<d.count)return d.count--,b.getLineEnd(f);d.count++;return b.getLineStart(f)}return"wordend"===d.unit||"wordWS"===d.unit||"wordendWS"===d.unit?this._getNextOffset_W3C(a,d):g.isIE?this._getNextOffset_IE(a,d):this._getNextOffset_W3C(a,
d)},_getNextOffset_W3C:function(a,d){function b(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function f(a){return 32===a||9===a}var g=this.view._model,e=g.getLineAtOffset(a),h=g.getLine(e),k=g.getLineStart(e),g=g.getLineEnd(e),e=h.length,p=a-k,l,q=0>d.count?-1:1;if("word"===d.unit||"wordend"===d.unit||"wordWS"===d.unit||"wordendWS"===d.unit)for(var u,t,m;0!==d.count;){if(0<d.count){if(p===e)return g;l=h.charCodeAt(p);u=b(l);t=!u&&!f(l);for(p++;p<e;){l=h.charCodeAt(p);
if("wordWS"!==d.unit&&"wordendWS"!==d.unit){m=b(l);if("wordend"===d.unit){if(!m&&u)break}else if(m&&!u)break;l=!m&&!f(l)}else l=!f(l);if("wordend"===d.unit||"wordendWS"===d.unit){if(!l&&t)break}else if(l&&!t)break;t=l;u=m;p++}}else{if(0===p)return k;p--;l=h.charCodeAt(p);u=b(l);for(t=!u&&!f(l);0<p;){l=h.charCodeAt(p-1);if("wordWS"!==d.unit&&"wordendWS"!==d.unit){m=b(l);if("wordend"===d.unit){if(m&&!u)break}else if(!m&&u)break;l=!m&&!f(l)}else l=!f(l);if("wordend"===d.unit||"wordendWS"===d.unit){if(l&&
!t)break}else if(!l&&t)break;t=l;u=m;p--}}d.count-=q}else for(;0!==d.count&&0<=p+q&&p+q<=e;)p+=q,l=h.charCodeAt(p),56320<=l&&57343>=l&&0<p&&(l=h.charCodeAt(p-1),55296<=l&&56319>=l&&(p+=q)),d.count-=q;return k+p},_getNextOffset_IE:function(a,d){var b=this._ensureCreated(),f=this.view._model,g=this.lineIndex,e=0,h;h=f.getLineStart(g);var k=f.getLine(g),p=f.getLineStart(g),l=b.ownerDocument,q=0>d.count?-1:1;if(a===f.getLineEnd(g)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;
if(!b)return h;e=l.body.createTextRange();e.moveToElementText(b);h=e.text.length;e.moveEnd(d.unit,q);e=a+e.text.length-h}else if(a===h&&0>d.count)e=h;else for(b=b.firstChild;b;){f=this._nodeLength(b);if(h+f>a){e=l.body.createTextRange();if(a===h&&0>d.count){for(h=b.previousSibling;h&&(!h.firstChild||!h.firstChild.length);)h=h.previousSibling;e.moveToElementText(h?h:b.previousSibling)}else e.moveToElementText(b),e.collapse(),e.moveEnd("character",a-h);h=e.text.length;e.moveEnd(d.unit,q);e=a+e.text.length-
h;break}h=f+h;b=b.nextSibling}h=e-p;c=k.charCodeAt(h);56320<=c&&57343>=c&&0<h&&(c=k.charCodeAt(h-1),55296<=c&&56319>=c&&(h+=q));d.count-=q;return h+p},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var d=this;this.forEach(function(b){var f=b.viewStyle;f&&(f.tagName&&"a"===f.tagName.toLowerCase())&&a.replaceChild(d._createSpan(a,b.firstChild.data,f),b);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};s.prototype={addKeyMode:function(a,
d){var b=this._keyModes;void 0!==d?b.splice(d,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,d){a.setView(this);var b=this._rulers;if(void 0!==d){var f,g;for(g=f=0;f<b.length&&g<d;f++)a.getLocation()===b[f].getLocation()&&g++;b.splice(g,0,a);d=g}else b.push(a);this._createRuler(a,d);this._update()},computeSize:function(){var a=0,d=0,b=this._model,f=this._clientDiv;if(!f)return{width:a,height:d};var e=f.style.width;g.isWebkit&&(f.style.width="0x7fffffffpx");for(var b=b.getLineCount(),
h=0;h<b;h++){var k=this._getLine(h),p=k.getBoundingClientRect(),a=Math.max(a,p.right-p.left),d=d+(p.bottom-p.top);k.destroy()}g.isWebkit&&(f.style.width=e);f=this._getViewPadding();a+=f.right+f.left+this._metrics.scrollWidth;d+=f.bottom+f.top+this._metrics.scrollWidth;return{width:a,height:d}},convert:function(a,d,b){if(this._clientDiv){var f=this._getScroll(),g=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();"document"===d&&(void 0!==a.x&&(a.x+=-f.x+e.left+g.left),void 0!==a.y&&(a.y+=
-f.y+e.top+g.top));"document"===b&&(void 0!==a.x&&(a.x+=f.x-e.left-g.left),void 0!==a.y&&(a.y+=f.y-e.top-g.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var d=[],b=this._actions,f;for(f in b)b.hasOwnProperty(f)&&(a||!b[f].defaultHandler)&&d.push(f);return d},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var d=[],b=this._keyModes,f=0;f<b.length;f++)d=d.concat(b[f].getKeyBindings(a));return d},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},
getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var d=this._model;a=Math.min(Math.max(0,a),d.getCharCount());var d=d.getLineAtOffset(a),b=this._getLine(d);a=b.getBoundingClientRect(a);b.destroy();b=a.left;d=this._getLinePixel(d)+a.top;return{x:b,y:d}},getNextOffset:function(a,d){var b=new y(a,a,!1);this._doMove(d,b);return b.getCaret()},
getOptions:function(){var d;if(0===arguments.length)d=this._defaultOptions();else if(1===arguments.length){if(d=arguments[0],"string"===typeof d)return a(this["_"+d])}else{d={};for(var b in arguments)arguments.hasOwnProperty(b)&&(d[arguments[b]]=void 0)}for(var f in d)d.hasOwnProperty(f)&&(d[f]=a(this["_"+f]));return d},getModel:function(){return this._model},getOffsetAtLocation:function(a,d){if(!this._clientDiv)return 0;var b=this._getLineIndex(d),f=this._getLine(b),b=f.getOffset(a,d-this._getLinePixel(b));
f.destroy();return b},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,d){return this._model.getText(a,d)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,
d,b){if(this._clientDiv){if(a=this._actions[a]){if(!d&&a.handler&&a.handler(b))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(b)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},
onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},
onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},
redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,d){if(!(0<this._redrawCount))for(var b=this.getRulers(),f=0;f<b.length;f++)this.redrawLines(a,d,b[f])},redrawLines:function(a,d,b){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===d&&(d=this._model.getLineCount()),a!==d)){var f=this._clientDiv;if(f){if(b)for(f=this._getRulerParent(b).firstChild;f&&f._ruler!==b;)f=f.nextSibling;b?f.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,d);if(!b||"page"===b.getOverview())for(f=f.firstChild;f;){var g=f.lineIndex;a<=g&&g<d&&(f.lineChanged=!0);f=f.nextSibling}!b&&(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<d)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,d){if(!(0<this._redrawCount)){var b=this._model;void 0===a&&(a=0);void 0===d&&(d=b.getCharCount());var f=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,
d-1))+1;this.redrawLines(f,b)}},removeKeyMode:function(a){for(var d=this._keyModes,b=0;b<d.length;b++)if(d[b]===a){d.splice(b,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var d=this._rulers,b=0;b<d.length;b++)if(d[b]===a){d.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,d,b){if(a){var f=this._actions,g=f[a];g||(g=f[a]={});g.handler=d;void 0!==b&&(g.actionDescription=
b)}},setKeyBinding:function(a,d){this._keyModes[0].setKeyBinding(a,d)},setCaretOffset:function(a,d,b){var f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));a=new y(a,a,!1);this._setSelection(a,void 0===d||d,!0,b)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",
this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var d=this._model.getLineCount(),b=this._model.getCharCount(),f=a.getLineCount(),g=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:g,removedLineCount:d,addedLineCount:f};this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:g,removedLineCount:d,addedLineCount:f};this.onModelChanged(e);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(b){var f=this._defaultOptions(),g;for(g in b)if(b.hasOwnProperty(g)){var e=b[g];if(!d(this["_"+g],e)){var h=f[g]?f[g].update:null;h?h.call(this,e):this["_"+g]=a(e)}}},setSelection:function(a,d,b,f){var g=a>d;if(g){var e=a;a=d;d=e}e=this._model.getCharCount();a=Math.max(0,Math.min(a,e));d=Math.max(0,Math.min(d,e));a=new y(a,d,g);this._setSelection(a,
void 0===b||b,!0,f)},setText:function(a,d,b){var f=void 0===d&&void 0===b;void 0===d&&(d=0);void 0===b&&(b=this._model.getCharCount());f&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:d,end:b,_code:!0},!f);f&&(this._columnX=-1,this._setSelection(new y(0,0,!1),!0),13>g.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(a,d){return this._showCaret(a?!1:!0,d,a)},update:function(a,d){this._clientDiv&&((a||this._metrics.invalid)&&this._updateStyle(),void 0===d||d?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){13>g.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var d=this._overlayDiv||this._clientDiv;9>g.isIE&&(d=
this._viewDiv);for(var b=a.target?a.target:a.srcElement;b;){if(d===b||b.className&&-1!==b.className.indexOf("textViewFind"))return;b=b.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var f=this;this._getWindow().setTimeout(function(){f._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&(13>g.isFirefox&&1===a.which)&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),
this._ignoreBlur=!1)},_handleBlur:function(a){this._cancelCheckSelection();if(!this._ignoreBlur){this._commitIME();this._hasFocus=!1;if(9>g.isIE&&!this._getSelection().isEmpty()){a=this._rootDiv;var d=g.createElement(a.ownerDocument,"div");a.appendChild(d);a.removeChild(d)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),d=
this._selDiv1.ownerDocument,a.getSelection){d=a.getSelection();for(a=d.anchorNode;a;){if(a===this._clientDiv){0<d.rangeCount&&d.removeAllRanges();break}a=a.parentNode}}else if(d.selection){this._ignoreSelect=!1;for(a=d.selection.createRange().parentElement();a;){if(a===this._clientDiv){d.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleCompositionStart:function(a){this._ignoreEvent(a)||(this._startIME(),this._mutationObserver&&
(this._mutationObserver.disconnect(),this._mutationObserver=null))},_handleCompositionEnd:function(a){this._ignoreEvent(a)||this._commitIME(a.data)},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){g.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var d=!1;this.isListening("ContextMenu")?(d=this._createMouseEvent("ContextMenu",a),d.screenX=a.screenX,d.screenY=a.screenY,this.onContextMenu(d),d=d.defaultPrevented):g.isMac&&(g.isFirefox&&0===a.button)&&(d=!0);if(d)return a.preventDefault&&
a.preventDefault(),!1;this._contextMenuOpen=!0;g.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))}},_handleCopy:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||
(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(13>g.isFirefox){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.contentEditable=!0;d._clientDiv.draggable=!1;d._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&
a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));13>g.isFirefox&&(this._fixCaret(),"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var d=
!0;this._dropTarget=!0;this.isListening("DragEnter")&&(d=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(g.isWebkit||d)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var d=!0;this.isListening("DragOver")&&(d=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(g.isWebkit||d)return d&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=
!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(a){this._hasFocus=!0;g.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display=
"block");this._selDiv1&&(a=this._highlightRGB,this._selDiv1.style.background=a,this._selDiv2.style.background=a,this._selDiv3.style.background=a);if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var d=this._createKeyEvent("KeyDown",a);this.onKeyDown(d);if(d.defaultPrevented){g.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}d=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:d=
!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;d=!0;g.isSafari&&g.isMac&&a.ctrlKey&&(d=!1,a.keyCode=129);d&&this._startIME()}else d||this._commitIME();if((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&
(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(g.isMac&&g.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var d=g.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&d)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(d=this._createKeyEvent("KeyPress",a),this.onKeyPress(d),
d.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;d=!1;if(g.isMac){if(a.ctrlKey||a.metaKey)d=!0}else if(g.isFirefox){if(a.ctrlKey||a.altKey)d=!0}else a.ctrlKey^a.altKey&&(d=!0);if(!d&&(d=g.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<d))return this._doContent(String.fromCharCode(d)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(g.isMac?
a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var d=this._createKeyEvent("KeyUp",a);this.onKeyUp(d);if(d.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},_handleLinkClick:function(a){if(!(g.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var d=this._getWindow(),b=!0,f=d;if(g.isIE||g.isFirefox&&!this._overlayDiv)f=
this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var e=this;d.setTimeout(function(){e.focus();e._ignoreFocus=!1},0)}1===this._clickCount?(b=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!g.isOpera||12.16<=g.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(f):(this._isW3CEvents&&this._setGrab(f),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return b},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==
(a.target||a.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var d=a.which;d||(4===a.button&&(d=2),2===a.button&&(d=3),1===a.button&&(d=1));var b=2!==d&&a.timeStamp?a.timeStamp:(new Date).getTime(),f=b-this._lastMouseTime,e=Math.abs(this._lastMouseX-a.clientX),h=Math.abs(this._lastMouseY-a.clientY),k=this._lastMouseButton===d;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=b;this._lastMouseButton=d;1===d&&(this._isMouseDown=!0,k&&f<=this._clickTime&&
e<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(b=this._createMouseEvent("MouseDown",a),this.onMouseDown(b),b.defaultPrevented)){a.preventDefault();return}if(1===d&&this._handleMouse(a)&&(9<=g.isIE||g.isOpera||g.isChrome||g.isSafari||g.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();g.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var d=this._isClientDiv(a);if(this.isListening("MouseMove")&&d)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var b=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(b&&!this._isMouseDown&&(g.isMac?a.metaKey:a.ctrlKey));this._checkOverlayScroll();if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===a.button&&0!==(this._clickCount&1)&&d)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){d=a.clientX;a=a.clientY;var f=this._getViewPadding(),
e=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),k=this._getClientHeight(),b=e.left+f.left,p=e.top+f.top,h=e.left+f.left+h,f=e.top+f.top+k;a<p?this._doAutoScroll("up",d,a-p):a>f?this._doAutoScroll("down",d,a-f):d<b&&!this._wrapMode?this._doAutoScroll("left",d-b,a):d>h&&!this._wrapMode?this._doAutoScroll("right",d-h,a):(this._endAutoScroll(),this._setSelectionTo(d,a,!0))}}}},_isClientDiv:function(a){var d=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(d===
a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,d){return{type:a,event:d,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,d){var b=this.convert({x:d.clientX,y:d.clientY},"page","document");return{type:a,event:d,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var d=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||d&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible){if(d&&this._isMouseDown){if(-1!==this._dragOffset){var b=this._getSelection();b.extend(this._dragOffset);b.collapse();this._setSelection(b,!0,!0);this._dragOffset=-1}this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null)}d&&g.isFirefox&&(this._updateDOMSelection(),a.preventDefault())}},_handleMouseWheel:function(a){var d=this._getLineHeight(),b=0,f=0;g.isIE||g.isOpera?f=-a.wheelDelta/40*d:g.isFirefox?"wheel"===a.type?a.deltaMode?(b=Math.max(-256,
Math.min(256,a.deltaX))*d,f=Math.max(-256,Math.min(256,a.deltaY))*d):(b=a.deltaX,f=a.deltaY):(d=g.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*d,a.axis===a.HORIZONTAL_AXIS?b=d:f=d):g.isMac?(f=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,b=0!==a.wheelDeltaX%120?1:40>f?40/(40-f):40,f=0!==a.wheelDeltaY%120?1:40>f?40/(40-f):40,b=Math.ceil(-a.wheelDeltaX/b),-1<b&&0>b&&(b=-1),0<b&&1>b&&(b=1),f=Math.ceil(-a.wheelDeltaY/f),-1<f&&0>f&&(f=-1),0<f&&1>f&&(f=1)):(b=-a.wheelDeltaX,
f=8*(-a.wheelDeltaY/120)*d);if(g.isSafari||g.isChrome&&g.isMac){for(d=a.target;d&&void 0===d.lineIndex;)d=d.parentNode;this._mouseWheelLine=d}d=this._getScroll();this._scrollView(b,f);b=this._getScroll();if(d.x!==b.x||d.y!==b.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(g.isIE){var d=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){d._updateDOMSelection();
d._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(a){a=this._rootDiv.clientWidth;var b=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==b)this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=a,this._rootHeight=b,a=9>g.isIE,b=this._calculateMetrics(),d(b,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=b,a=!0),a?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var d=
a.target?a.target:a.srcElement,b=d.lineIndex;d&&!d._ruler;)void 0===b&&void 0!==d.lineIndex&&(b=d.lineIndex),d=d.parentNode;var f=d?d._ruler:null;if(void 0===b&&f&&"document"===f.getOverview()){var b=this._getClientHeight(),g=this._model.getLineCount(),e=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*g/(b+e.top+e.bottom-2*this._metrics.scrollWidth));0<=b&&b<g||(b=void 0)}if(f)switch(a.type){case "click":if(f.onClick)f.onClick(b,
a);break;case "dblclick":if(f.onDblClick)f.onDblClick(b,a);break;case "mousemove":if(f.onMouseMove)f.onMouseMove(b,a);break;case "mouseover":if(f.onMouseOver)f.onMouseOver(b,a);break;case "mouseout":if(f.onMouseOut){for(g=a.relatedTarget;g&&g!==this._rootDiv;){if(g===d)return;g=g.parentNode}f.onMouseOut(b,a)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var a=this._getScroll(!1),d=this._hScroll,b=this._vScroll;if(d!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),
this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:d,y:b},newValue:a})},_handleSelectStart:function(a){var d=this._contextMenuOpen;this._contextMenuOpen=!1;if(d)this._checkSelectionChange=!0;else if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,d){if(a){var b;b="DIV"===a.tagName?a:a.parentNode.parentNode;return!b._line?0:b._line.getModelOffset(a,d)}},_updateSelectionFromDOM:function(){if(!g.isIOS&&!g.isAndroid&&!this._checkSelectionChange)return!1;
var a=this._getWindow().getSelection(),d=this._getModelOffset(a.anchorNode,a.anchorOffset),b=this._getModelOffset(a.focusNode,a.focusOffset),f=this._getSelection();if(void 0===d||void 0===b||f.start===d&&f.end===b)return!1;if(this._checkSelectionChange){var f=this._getLineNext(),e=this._getLinePrevious();if(a.anchorNode===f.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===e.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===f.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===
e.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)d=0,b=this.getModel().getCharCount()}this._setSelection(new y(d,b),!1,!1);this._checkSelectionChange=!1;return!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){this._selPollTimer&&(this._getWindow().clearTimeout(this._selPollTimer),this._selPollTimer=null)},_pollSelectionChange:function(a){var d=
this,b=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=b.setTimeout(function(){d._selPollTimer=null;d._clientDiv&&!d._updateSelectionFromDOM()&&a&&d._pollSelectionChange(a)},100)},_handleSelectionChange:function(a){-1===this._imeOffset&&(g.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var d=this._getWindow().getSelection();if(d.anchorNode!==this._anchorNode||d.focusNode!==this._focusNode||
d.anchorOffset!==this._anchorOffset||d.focusOffset!==this._focusOffset){for(var b=d.anchorNode;b&&void 0===b.lineIndex;)b=b.parentNode;if(b){var f=this._model,e=b.lineIndex,h=f.getLine(e),k=h,p=0,f=f.getLineStart(e);0<d.rangeCount&&(d.getRangeAt(0).deleteContents(),e=b.ownerDocument.createTextNode(a.data),d.getRangeAt(0).insertNode(e),p=this._getDOMText(b,e),k=p.text,p=p.offset,e.parentNode.removeChild(e));b.lineRemoved=!0;for(b=0;h.charCodeAt(b)===k.charCodeAt(b)&&b<p;)b++;d=h.length-1;for(e=k.length-
h.length;h.charCodeAt(d)===k.charCodeAt(d+e)&&d+e>=p+a.data.length;)d--;d++;h=k.substring(b,d+e);this._ignoreQueueUpdate=g.isSafari;this._modifyContent({text:h,start:b+f,end:d+f,_ignoreDOMSelection:!0,_ignoreDOMSelection1:g.isChrome},!0);this._ignoreQueueUpdate=!1}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var d=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",d.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null);var b=a.touches;if(1===b.length){var b=b[0],f=b.clientX,e=b.clientY;this._touchStartX=f;this._touchStartY=e;if(g.isAndroid&&(e<b.pageY-d.pageYOffset||f<b.pageX-d.pageXOffset))f=b.pageX-d.pageXOffset,e=b.pageY-d.pageYOffset;d=this.convert({x:f,y:e},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(d.x,d.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var d=a.touches;if(1===d.length){d=d[0];this._touchCurrentX=d.clientX;
this._touchCurrentY=d.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var b=this,f=this._getWindow();this._touchScrollTimer=f.setInterval(function(){var a=0,d=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,d=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=d/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else{if(0.1>Math.abs(b._touchSpeedX)&&
0.1>Math.abs(b._touchSpeedY)){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";f.clearInterval(b._touchScrollTimer);b._touchScrollTimer=null;return}a=10*b._touchSpeedX;d=10*b._touchSpeedY;b._touchSpeedX*=0.95;b._touchSpeedY*=0.95}b._scrollView(a,d)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var d,b,f=this._keyModes;for(b=f.length-1;0<=b;b--)if(d=f[b],"function"===typeof d.match&&
(d=d.match(a),void 0!==d))return this.invokeAction(d);return!1},_doMove:function(a,d){var b=this._model,f=d.getCaret(),g=b.getLineAtOffset(f);a.count||(a.count=1);for(;0!==a.count;){var e=b.getLineStart(g);if(0>a.count&&f===e)if(0<g)"character"===a.unit&&a.count++,g--,d.extend(b.getLineEnd(g));else break;else if(0<a.count&&f===b.getLineEnd(g))if(g+1<b.getLineCount())"character"===a.unit&&a.count--,g++,d.extend(b.getLineStart(g));else break;else{var h=!1;a.expandTab&&("character"===a.unit&&0===(f-
e)%this._tabSize)&&(e=b.getText(e,f),h=!/[^ ]/.test(e));h?(d.extend(f-this._tabSize),a.count+=0>a.count?1:-1):(e=this._getLine(g),d.extend(e.getNextOffset(f,a)),e.destroy())}f=d.getCaret()}return d},_doBackspace:function(a){var d=this._getSelection();d.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,d));this._modifyContent({text:"",start:d.start,end:d.end},!0);return!0},_doCase:function(a){var d=this._getSelection();this._doMove(a,d);var b=this.getText(d.start,
d.end);this._setSelection(d,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(d=0;d<b.length;d++){var f=b[d],g=f.toLowerCase(),f=g!==f?g:f.toUpperCase();a+=f}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var d=this._getSelection();if(this._overwriteMode&&d.isEmpty()){var b=this._model,f=b.getLineAtOffset(d.end);d.end<b.getLineEnd(f)&&(b=this._getLine(f),
d.extend(b.getNextOffset(d.getCaret(),{unit:"character",count:1})),b.destroy())}return this._modifyContent({text:a,start:d.start,end:d.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var d=this._getSelection();return!d.isEmpty()?(d=this._getBaseText(d.start,d.end),this._setClipboardText(d,a)):!0},_doCursorNext:function(a){var d=this._getSelection();!d.isEmpty()&&!a.select?d.start=d.end:this._doMove(a,d);a.select||d.collapse();this._setSelection(d,!0);return!0},_doCursorPrevious:function(a){var d=
this._getSelection();!d.isEmpty()&&!a.select?d.end=d.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,d));a.select||d.collapse();this._setSelection(d,!0);return!0},_doCut:function(a){var d=this._getSelection();return!d.isEmpty()?(d=this._getBaseText(d.start,d.end),this._doContent(""),this._setClipboardText(d,a)):!0},_doDelete:function(a){var d=this._getSelection();d.isEmpty()&&this._doMove(a,d);this._modifyContent({text:"",start:d.start,end:d.end},!0);return!0},_doEnd:function(a){var d=this._getSelection(),
b=this._model,f;if(a.ctrl)d.extend(b.getCharCount()),f=function(){};else{var g=d.getCaret(),e=b.getLineAtOffset(g);if(this._wrapMode){var h=this._getLine(e),g=h.getLineIndex(g),g=g===h.getLineCount()-1?b.getLineEnd(e):h.getLineStart(g+1)-1;h.destroy()}else a.count&&0<a.count&&(e=Math.min(e+a.count-1,b.getLineCount()-1)),g=b.getLineEnd(e);d.extend(g)}a.select||d.collapse();this._setSelection(d,!0,!0,f);return!0},_doEnter:function(a){var d=this._model,b=this._getSelection();this._doContent(d.getLineDelimiter());
a&&a.noCursor&&(b.end=b.start,this._setSelection(b,!0));return!0},_doHome:function(a){var d=this._getSelection(),b=this._model,f;if(a.ctrl)d.extend(0),f=function(){};else{var g=d.getCaret(),e=b.getLineAtOffset(g);this._wrapMode?(b=this._getLine(e),g=b.getLineIndex(g),g=b.getLineStart(g),b.destroy()):g=b.getLineStart(e);d.extend(g)}a.select||d.collapse();this._setSelection(d,!0,!0,f);return!0},_doLineDown:function(a){var d=this._model,b=this._getSelection(),f=b.getCaret(),e=d.getLineAtOffset(f),h=
this._getLine(e),k=this._columnX,p=1,l=!1;if(-1===k||a.wholeLine||a.select&&g.isIE)k=a.wholeLine?d.getLineEnd(e+1):f,k=h.getBoundingClientRect(k).left;(f=h.getLineIndex(f))<h.getLineCount()-1?p=h.getClientRects(f+1).top+1:(f=d.getLineCount()-1,l=e===f,a.count&&0<a.count?e=Math.min(e+a.count,f):e++);f=!1;if(l){if(a.select||g.isMac||g.isLinux)b.extend(d.getCharCount()),f=!0}else h.lineIndex!==e&&(h.destroy(),h=this._getLine(e)),b.extend(h.getOffset(k,p)),f=!0;f&&(a.select||b.collapse(),this._setSelection(b,
!0,!0));this._columnX=k;h.destroy();return!0},_doLineUp:function(a){var d=this._model,b=this._getSelection(),f=b.getCaret(),e=d.getLineAtOffset(f),h=this._getLine(e),k=this._columnX,p=!1,l;if(-1===k||a.wholeLine||a.select&&g.isIE)k=a.wholeLine?d.getLineStart(e-1):f,k=h.getBoundingClientRect(k).left;0<(f=h.getLineIndex(f))?l=h.getClientRects(f-1).top+1:(p=0===e,p||(a.count&&0<a.count?e=Math.max(e-a.count,0):e--,l=this._getLineHeight(e)-1));f=!1;if(p){if(a.select||g.isMac||g.isLinux)b.extend(0),f=!0}else h.lineIndex!==
e&&(h.destroy(),h=this._getLine(e)),b.extend(h.getOffset(k,l)),f=!0;f&&(a.select||b.collapse(),this._setSelection(b,!0,!0));this._columnX=k;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var d=this,b=this._model,f=this._getSelection(),e=f.getCaret(),h=b.getLineAtOffset(e),k=b.getLineCount(),p=this._getScroll(),b=this._getClientHeight(),l,q;if(this._lineHeight){l=this._columnX;p=this._getBoundsAtOffset(e);if(-1===l||a.select&&g.isIE)l=p.left;e=this._getLineIndex(p.top+b);
q=this._getLine(e);h=this._getLinePixel(e);e=q.getOffset(l,p.top+b-h);b=q.getBoundingClientRect(e);q.destroy();f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){d._columnX=l},b.top+h-p.top);return!0}if(h<k-1){var u=this._getLineHeight(),t=Math.min(k-h-1,Math.floor(b/u)),t=Math.max(1,t);l=this._columnX;if(-1===l||a.select&&g.isIE)q=this._getLine(h),l=q.getBoundingClientRect(e).left,q.destroy();q=this._getLine(h+t);f.extend(q.getOffset(l,0));q.destroy();a.select||f.collapse();
a=k*u;e=p.y+t*u;e+b>a&&(e=a-b);this._setSelection(f,!0,!0,function(){d._columnX=l},e-p.y)}return!0},_doPageUp:function(a){var d=this,b=this._model,f=this._getSelection(),e=f.getCaret(),h=b.getLineAtOffset(e),k=this._getScroll(),p=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;k=this._getBoundsAtOffset(e);if(-1===l||a.select&&g.isIE)l=k.left;e=this._getLineIndex(k.bottom-p);b=this._getLine(e);h=this._getLinePixel(e);e=b.getOffset(l,k.bottom-p-h);p=b.getBoundingClientRect(e);b.destroy();
f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){d._columnX=l},p.top+h-k.top);return!0}if(0<h){var q=this._getLineHeight(),p=Math.max(1,Math.min(h,Math.floor(p/q)));l=this._columnX;if(-1===l||a.select&&g.isIE)b=this._getLine(h),l=b.getBoundingClientRect(e).left,b.destroy();b=this._getLine(h-p);f.extend(b.getOffset(l,this._getLineHeight(h-p)-1));b.destroy();a.select||f.collapse();a=Math.max(0,k.y-p*q);this._setSelection(f,!0,!0,function(){d._columnX=l},a-k.y)}return!0},_doPaste:function(a){var d=
this;return null!==this._getClipboardText(a,function(a){a&&(g.isLinux&&2===d._lastMouseButton&&(new Date).getTime()-d._lastMouseTime<=d._clickTime&&d._setSelectionTo(d._lastMouseX,d._lastMouseY),d._doContent(a))})},_doScroll:function(a){var d=a.type,b=this._model,f=b.getLineCount();a=this._getClientHeight();var g=this._getLineHeight(),f=f*g,e=this._getScroll().y,h;switch(d){case "textStart":h=0;break;case "textEnd":h=f-a;break;case "pageDown":h=e+a;break;case "pageUp":h=e-a;break;case "lineDown":h=
e+g;break;case "lineUp":h=e-g;break;case "centerLine":d=this._getSelection(),h=b.getLineAtOffset(d.start),b=(b.getLineAtOffset(d.end)-h+1)*g,h=h*g-a/2+b/2}void 0!==h&&(h=Math.min(Math.max(0,h),f-a),this._scrollViewAnimated(0,h-e,function(){}));return!0},_doSelectAll:function(a){a=this._model;var d=this._getSelection();d.setCaret(0);d.extend(a.getCharCount());this._setSelection(d,!1);return!0},_doTab:function(a){if(this._tabMode&&!this._readonly){a="\t";if(this._expandTab){var d=this._model;a=this._getSelection().getCaret();
var b=d.getLineAtOffset(a),d=d.getLineStart(b);a=Array(this._tabSize-(a-d)%this._tabSize+1).join(" ")}this._doContent(a);return!0}},_doShiftTab:function(a){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(a){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(a){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(a){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,d=this._getSelection(),b=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),f=d.getCaret(),e=a.getLineCount(),h=a.getLineAtOffset(f),k;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)f=this._autoScrollY/this._getLineHeight(),f=0>f?Math.floor(f):Math.ceil(f),k=Math.max(0,Math.min(e-1,h+f));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)k=this._getLineIndex(b.y),h=this._getLine(h),b.x+=h.getBoundingClientRect(f,!1).left,h.destroy();
0===k&&(g.isMac||g.isLinux)?d.extend(0):k===e-1&&(g.isMac||g.isLinux)?d.extend(a.getCharCount()):(h=this._getLine(k),d.extend(h.getOffset(b.x,b.y-this._getLinePixel(k))),h.destroy());this._setSelection(d,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var d=this._model.getLineCount(),b=0;if(a){a=
0;for(var f=(new Date).getTime(),g=0;b<d&&!(this._lineHeight[b]||(a++,g||(g=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,100<(new Date).getTime()-f););this.redrawRulers(0,d);this._queueUpdate()}a=this._getWindow();if(b!==d){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){a=this._getLine(a);
var d=a.getBoundingClientRect();a.destroy();return Math.max(1,d.bottom-d.top)},_calculateMetrics:function(){var a=this._clientDiv,d=a.ownerDocument,f=g.createElement(d,"div");f.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);b(e.style,f);f.style.position="fixed";f.style.left="-1000px";var h=g.createElement(d,"span");h.appendChild(d.createTextNode(" "));f.appendChild(h);var k=g.createElement(d,"span");k.style.fontStyle=
"italic";k.appendChild(d.createTextNode(" "));f.appendChild(k);var p=g.createElement(d,"span");p.style.fontWeight="bold";p.appendChild(d.createTextNode(" "));f.appendChild(p);e=g.createElement(d,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(d.createTextNode(" "));f.appendChild(e);a.appendChild(f);var l=f.getBoundingClientRect(),h=h.getBoundingClientRect(),k=k.getBoundingClientRect(),p=p.getBoundingClientRect(),e=e.getBoundingClientRect(),h=h.bottom-h.top,k=k.bottom-k.top,
p=p.bottom-p.top,t=e.bottom-e.top,m=0,e=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);k>h&&(m=1);p>k&&(m=2);t>p&&(m=3);var n;0!==m&&(n={style:{}},0!==(m&1)&&(n.style.fontStyle="italic"),0!==(m&2)&&(n.style.fontWeight="bold"));h=u(f);a.removeChild(f);t=q(this._viewDiv);f=g.createElement(d,"div");f.style.position="fixed";f.style.left="-1000px";f.style.paddingLeft=t.left+"px";f.style.paddingTop=t.top+"px";f.style.paddingRight=t.right+"px";f.style.paddingBottom=t.bottom+"px";f.style.width="100px";f.style.height=
"100px";t=g.createElement(d,"div");t.style.width="100%";t.style.height="100%";f.appendChild(t);a.appendChild(f);m=f.getBoundingClientRect();k=t.getBoundingClientRect();p=0;this._singleMode||(f.style.overflow="hidden",t.style.height="200px",p=f.clientWidth,f.style.overflow="scroll",p-=f.clientWidth);a.removeChild(f);t={left:k.left-m.left,top:k.top-m.top,right:m.right-k.right,bottom:m.bottom-k.bottom};k=m=0;if(!e&&(this._wrapOffset||this._marginOffset))f=g.createElement(d,"div"),f.style.position="fixed",
f.style.left="-1000px",f.innerHTML=Array(this._wrapOffset+1+(g.isWebkit?0:1)).join(" "),a.appendChild(f),m=f.getBoundingClientRect(),m=Math.ceil(m.right-m.left),f.innerHTML=Array(this._marginOffset+1).join(" "),k=f.getBoundingClientRect(),k=Math.ceil(k.right-k.left),a.removeChild(f);return{lineHeight:l,largestFontStyle:n,lineTrim:h,viewPadding:t,scrollWidth:p,wrapWidth:m,marginWidth:k,invalid:e}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var d=
this._getSelection();if(d.isEmpty())return!1;"next"===a?d.start=d.end:d.end=d.start;this._setSelection(d,!0);return!0},_commitIME:function(a){if(-1!==this._imeOffset){var d=this._model,b=d.getLineAtOffset(this._imeOffset),f=d.getLineStart(b),e=this._getLineNode(b);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var h=this._getDOMText(e).text,d=d.getLine(b),f=this._imeOffset-f,d=f+h.length-d.length;f!==d&&(a=h.substring(f,d))}a&&(!this._doContent(a)&&!g.isWebkit)&&(e.lineRemoved=!0,this._queueUpdate());
this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new m.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(d){return a._doLineUp(f(d,{select:!1}))},actionDescription:{name:l.lineUp}},lineDown:{defaultHandler:function(d){return a._doLineDown(f(d,{select:!1}))},actionDescription:{name:l.lineDown}},lineStart:{defaultHandler:function(d){return a._doHome(f(d,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineStart}},
lineEnd:{defaultHandler:function(d){return a._doEnd(f(d,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineEnd}},charPrevious:{defaultHandler:function(d){return a._doCursorPrevious(f(d,{select:!1,unit:"character"}))},actionDescription:{name:l.charPrevious}},charNext:{defaultHandler:function(d){return a._doCursorNext(f(d,{select:!1,unit:"character"}))},actionDescription:{name:l.charNext}},pageUp:{defaultHandler:function(d){return a._doPageUp(f(d,{select:!1}))},actionDescription:{name:l.pageUp}},
pageDown:{defaultHandler:function(d){return a._doPageDown(f(d,{select:!1}))},actionDescription:{name:l.pageDown}},scrollPageUp:{defaultHandler:function(d){return a._doScroll(f(d,{type:"pageUp"}))},actionDescription:{name:l.scrollPageUp}},scrollPageDown:{defaultHandler:function(d){return a._doScroll(f(d,{type:"pageDown"}))},actionDescription:{name:l.scrollPageDown}},scrollLineUp:{defaultHandler:function(d){return a._doScroll(f(d,{type:"lineUp"}))},actionDescription:{name:l.scrollLineUp}},scrollLineDown:{defaultHandler:function(d){return a._doScroll(f(d,
{type:"lineDown"}))},actionDescription:{name:l.scrollLineDown}},wordPrevious:{defaultHandler:function(d){return a._doCursorPrevious(f(d,{select:!1,unit:"word"}))},actionDescription:{name:l.wordPrevious}},wordNext:{defaultHandler:function(d){return a._doCursorNext(f(d,{select:!1,unit:"word"}))},actionDescription:{name:l.wordNext}},textStart:{defaultHandler:function(d){return a._doHome(f(d,{select:!1,ctrl:!0}))},actionDescription:{name:l.textStart}},textEnd:{defaultHandler:function(d){return a._doEnd(f(d,
{select:!1,ctrl:!0}))},actionDescription:{name:l.textEnd}},scrollTextStart:{defaultHandler:function(d){return a._doScroll(f(d,{type:"textStart"}))},actionDescription:{name:l.scrollTextStart}},scrollTextEnd:{defaultHandler:function(d){return a._doScroll(f(d,{type:"textEnd"}))},actionDescription:{name:l.scrollTextEnd}},centerLine:{defaultHandler:function(d){return a._doScroll(f(d,{type:"centerLine"}))},actionDescription:{name:l.centerLine}},selectLineUp:{defaultHandler:function(d){return a._doLineUp(f(d,
{select:!0}))},actionDescription:{name:l.selectLineUp}},selectLineDown:{defaultHandler:function(d){return a._doLineDown(f(d,{select:!0}))},actionDescription:{name:l.selectLineDown}},selectWholeLineUp:{defaultHandler:function(d){return a._doLineUp(f(d,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(d){return a._doLineDown(f(d,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineDown}},selectLineStart:{defaultHandler:function(d){return a._doHome(f(d,
{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineStart}},selectLineEnd:{defaultHandler:function(d){return a._doEnd(f(d,{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineEnd}},selectCharPrevious:{defaultHandler:function(d){return a._doCursorPrevious(f(d,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharPrevious}},selectCharNext:{defaultHandler:function(d){return a._doCursorNext(f(d,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharNext}},selectPageUp:{defaultHandler:function(d){return a._doPageUp(f(d,
{select:!0}))},actionDescription:{name:l.selectPageUp}},selectPageDown:{defaultHandler:function(d){return a._doPageDown(f(d,{select:!0}))},actionDescription:{name:l.selectPageDown}},selectWordPrevious:{defaultHandler:function(d){return a._doCursorPrevious(f(d,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordPrevious}},selectWordNext:{defaultHandler:function(d){return a._doCursorNext(f(d,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordNext}},selectTextStart:{defaultHandler:function(d){return a._doHome(f(d,
{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextStart}},selectTextEnd:{defaultHandler:function(d){return a._doEnd(f(d,{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextEnd}},deletePrevious:{defaultHandler:function(d){return a._doBackspace(f(d,{unit:"character"}))},actionDescription:{name:l.deletePrevious}},deleteNext:{defaultHandler:function(d){return a._doDelete(f(d,{unit:"character"}))},actionDescription:{name:l.deleteNext}},deleteWordPrevious:{defaultHandler:function(d){return a._doBackspace(f(d,
{unit:"word"}))},actionDescription:{name:l.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(d){return a._doDelete(f(d,{unit:"word"}))},actionDescription:{name:l.deleteWordNext}},deleteLineStart:{defaultHandler:function(d){return a._doBackspace(f(d,{unit:"line"}))},actionDescription:{name:l.deleteLineStart}},deleteLineEnd:{defaultHandler:function(d){return a._doDelete(f(d,{unit:"line"}))},actionDescription:{name:l.deleteLineEnd}},tab:{defaultHandler:function(d){return a._doTab()},actionDescription:{name:l.tab}},
shiftTab:{defaultHandler:function(d){return a._doShiftTab()},actionDescription:{name:l.shiftTab}},enter:{defaultHandler:function(d){return a._doEnter()},actionDescription:{name:l.enter}},enterNoCursor:{defaultHandler:function(d){return a._doEnter(f(d,{noCursor:!0}))},actionDescription:{name:l.enterNoCursor}},selectAll:{defaultHandler:function(d){return a._doSelectAll()},actionDescription:{name:l.selectAll}},copy:{defaultHandler:function(d){return a._doCopy()},actionDescription:{name:l.copy}},cut:{defaultHandler:function(d){return a._doCut()},
actionDescription:{name:l.cut}},paste:{defaultHandler:function(d){return a._doPaste()},actionDescription:{name:l.paste}},uppercase:{defaultHandler:function(d){return a._doCase(f(d,{type:"upper"}))},actionDescription:{name:l.uppercase}},lowercase:{defaultHandler:function(d){return a._doCase(f(d,{type:"lower"}))},actionDescription:{name:l.lowercase}},capitalize:{defaultHandler:function(d){return a._doCase(f(d,{unit:"word",type:"capitalize"}))},actionDescription:{name:l.capitalize}},reversecase:{defaultHandler:function(d){return a._doCase(f(d,
{type:"reverse"}))},actionDescription:{name:l.reversecase}},toggleOverwriteMode:{defaultHandler:function(d){return a._doOverwriteMode()},actionDescription:{name:l.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(d){return a._doTabMode()},actionDescription:{name:l.toggleTabMode}},toggleWrapMode:{defaultHandler:function(d){return a._doWrapMode()},actionDescription:{name:l.toggleWrapMode}}}},_createRulerParent:function(a,d){var b=g.createElement(a,"div");b.className=d;b.tabIndex=-1;b.style.overflow=
"hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");this._rootDiv.appendChild(b);return b},_createRuler:function(a,d){if(this._clientDiv){var b=this._getRulerParent(a);if(b){if(b!==this._marginDiv||this._marginOffset)b.style.display="block";var f=g.createElement(b.ownerDocument,"div");f._ruler=a;f.rulerChanged=!0;f.style.position=
"relative";f.style.cssFloat="left";f.style.styleFloat="left";f.style.outline="none";if(void 0===d||0>d||d>=b.children.length)b.appendChild(f);else{for(var e=b.firstChild;e&&0<d--;)e=e.nextSibling;b.insertBefore(f,e)}}}},_createView:function(){function a(){h._rootDiv&&(h.update(!0),h._metrics.invalid&&h._getWindow().setTimeout(function(){a()},100))}if(!this._clientDiv){for(var d=this._parent;d.hasChildNodes();)d.removeChild(d.lastChild);var b=d.ownerDocument,f=g.createElement(b,"div");this._rootDiv=
f;f.tabIndex=-1;f.style.position="relative";f.style.overflow="hidden";f.style.width="100%";f.style.height="100%";f.style.overflow="hidden";f.style.WebkitTextSizeAdjust="100%";f.setAttribute("role","application");d.appendChild(f);this._leftDiv=this._createRulerParent(b,"textviewLeftRuler");d=g.createElement(b,"div");d.className="textviewScroll";this._viewDiv=d;d.tabIndex=-1;d.style.position="absolute";d.style.top="0px";d.style.bottom="0px";d.style.borderWidth="0px";d.style.margin="0px";d.style.outline=
"none";d.style.background="transparent";f.appendChild(d);var e=this._createRulerParent(b,"textviewRightRuler");this._rightDiv=e;e.style.right="0px";this._scrollDiv=e=g.createElement(b,"div");e.style.margin="0px";e.style.borderWidth="0px";e.style.padding="0px";d.appendChild(e);(this._marginDiv=this._createRulerParent(b,"textviewMarginRuler")).style.zIndex="4";!g.isIE&&!g.isIOS&&(this._clipDiv=d=g.createElement(b,"div"),d.style.position="absolute",d.style.overflow="hidden",d.style.margin="0px",d.style.borderWidth=
"0px",d.style.padding="0px",d.style.background="transparent",f.appendChild(d),this._clipScrollDiv=e=g.createElement(b,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",d.appendChild(e));this._setFullSelection(this._fullSelection,!0);d=g.createElement(b,"div");d.className="textviewContent";this._clientDiv=d;d.tabIndex=0;d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";
d.style.zIndex="1";d.style.WebkitUserSelect="text";d.setAttribute("spellcheck","false");if(g.isIOS||g.isAndroid)d.style.WebkitTapHighlightColor="transparent";(this._clipDiv||f).appendChild(d);if(g.isIOS||g.isAndroid)this._vScrollDiv=e=g.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline=
"none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",f.appendChild(e),this._hScrollDiv=e=g.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",f.appendChild(e);g.isFirefox&&!d.setCapture&&(this._overlayDiv=
e=g.createElement(b,"div"),e.style.position=d.style.position,e.style.borderWidth=d.style.borderWidth,e.style.margin=d.style.margin,e.style.padding=d.style.padding,e.style.cursor="text",e.style.zIndex="2",(this._clipDiv||f).appendChild(e));d.contentEditable="true";d.setAttribute("role","textbox");d.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,
!0);this._hookEvents();d=this._rulers;for(e=0;e<d.length;e++)this._createRuler(d[e]);this._update();var h=this;t(b,f,"textview",a)}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,
update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:e.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var d=this._getRulerParent(a);if(d)for(var b=
d.firstChild;b;){if(b._ruler===a){b._ruler=void 0;d.removeChild(b);if(0===d.children.length&&(d!==this._marginDiv||!this._marginOffset))d.style.display="none";break}b=b.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);
this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,d,b){this._autoScrollDir=a;this._autoScrollX=d;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);
this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var d=this._hasFocus;this._ignoreFocus=!0;d&&a.blur();a.contentEditable=!1;a.contentEditable=!0;d&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,d){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),d=b.mapOffset(d),b=b.getBaseModel());return b.getText(a,d)},_getBottomIndex:function(a){var d=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=d.getBoundingClientRect();
var b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(d=this._getLinePrevious(d)||d)}return d.lineIndex},_getBoundsAtOffset:function(a){var d=this._getLine(this._model.getLineAtOffset(a));a=d.getBoundingClientRect(a);var b=this._getLinePixel(d.lineIndex);a.top+=b;a.bottom+=b;d.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,d){var b=this._model.getLineDelimiter(),f,e,h=this._getWindow(),k=h.clipboardData;!k&&a&&(k=a.clipboardData);if(k)return f=[],e=k.getData(g.isIE?"Text":"text/plain"),p(e,function(a){f.push(a)},function(){f.push(b)}),e=f.join(""),d&&d(e),e;if(g.isFirefox){this._ignoreFocus=!0;var l=this._clipboardDiv,k=this._rootDiv.ownerDocument;l||(this._clipboardDiv=l=g.createElement(k,"div"),l.style.position="fixed",l.style.whiteSpace="pre",
l.style.left="-1000px",this._rootDiv.appendChild(l));l.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";l.firstChild.focus();var q=this,u=function(){var a=q._getTextFromElement(l);l.innerHTML="";f=[];p(a,function(a){f.push(a)},function(){f.push(b)});return f.join("")},t=!1;this._ignorePaste=!0;if(!g.isLinux||2!==this._lastMouseButton)try{t=k.execCommand("paste",!1,null)}catch(m){t=1<l.childNodes.length||l.firstChild&&0<l.firstChild.childNodes.length}this._ignorePaste=!1;if(!t){if(a)return h.setTimeout(function(){q.focus();
(e=u())&&d&&d(e);q._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(e=u())&&d&&d(e);return e}return""},_getDOMText:function(a,d){return a._line.getText(d)},_getTextFromElement:function(a){var d=a.ownerDocument,b=d.defaultView;if(!b.getSelection)return a.innerText||a.textContent;d=d.createRange();d.selectNode(a);a=b.getSelection();var b=[],f;for(f=0;f<a.rangeCount;f++)b.push(a.getRangeAt(f));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(d);
d=a.toString();a.removeAllRanges();for(f=0;f<b.length;f++)a.addRange(b[f]);this._ignoreSelect=!1;return d},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var d=this._getLineNode(a);return d&&!d.lineChanged&&!d.lineRemoved?d._line:new x(this,a)},_getLineHeight:function(a,d){if(void 0!==a&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(d||void 0===d)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var d=
this._clientDiv.firstChild;d;){if(a===d.lineIndex)return d;d=d.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&(-1===a.lineIndex||!a._line);)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&(-1===a.lineIndex||!a._line);)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var d=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;
if(a>d)for(;d<a;d++)b+=this._getLineHeight(d);else for(d-=1;d>=a;d--)b-=this._getLineHeight(d);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var d,b=0,f=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),g=-this._topIndexY+this._getScroll().y;if(a!==g)if(a<g)for(;a<g&&0<b;)a+=this._getLineHeight(--b);else for(d=this._getLineHeight(b);a-d>=g&&b<f-1;)a-=d,d=this._getLineHeight(++b)}else d=this._getLineHeight(),b=Math.floor(a/d);return Math.max(0,Math.min(f-
1,b))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var d=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=d.getBoundingClientRect();var b=this._getViewPadding(),
f=this._viewDiv.getBoundingClientRect();a.top<f.top+b.top&&(d=this._getLineNext(d)||d)}return d.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(d){a._onModelChanging(d)},onChanged:function(d){a._onModelChanged(d)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(d){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);var d=this._handlers=[],b=this._clientDiv,f=this._viewDiv,e=this._rootDiv,h=this._overlayDiv||b,k=b.ownerDocument,p=this._getWindow(),l=g.isIE?k:p;d.push({target:p,type:"resize",handler:function(d){return a._handleResize(d?d:p.event)}});d.push({target:b,type:"blur",handler:function(d){return a._handleBlur(d?d:p.event)}});d.push({target:b,type:"focus",handler:function(d){return a._handleFocus(d?d:p.event)}});d.push({target:f,type:"focus",handler:function(a){b.focus()}});
d.push({target:f,type:"scroll",handler:function(d){return a._handleScroll(d?d:p.event)}});d.push({target:b,type:"textInput",handler:function(d){return a._handleTextInput(d?d:p.event)}});d.push({target:b,type:"keydown",handler:function(d){return a._handleKeyDown(d?d:p.event)}});d.push({target:b,type:"keypress",handler:function(d){return a._handleKeyPress(d?d:p.event)}});d.push({target:b,type:"keyup",handler:function(d){return a._handleKeyUp(d?d:p.event)}});g.isIE&&d.push({target:k,type:"keyup",handler:function(d){return a._handleDocKeyUp(d?
d:p.event)}});d.push({target:b,type:"contextmenu",handler:function(d){return a._handleContextMenu(d?d:p.event)}});d.push({target:b,type:"copy",handler:function(d){return a._handleCopy(d?d:p.event)}});d.push({target:b,type:"cut",handler:function(d){return a._handleCut(d?d:p.event)}});d.push({target:b,type:"paste",handler:function(d){return a._handlePaste(d?d:p.event)}});d.push({target:k,type:"selectionchange",handler:function(d){return a._handleSelectionChange(d?d:p.event)}});if(g.isIOS||g.isAndroid)d.push({target:b,
type:"touchstart",handler:function(d){return a._handleTouchStart(d?d:p.event)}}),d.push({target:b,type:"touchmove",handler:function(d){return a._handleTouchMove(d?d:p.event)}}),d.push({target:b,type:"touchend",handler:function(d){return a._handleTouchEnd(d?d:p.event)}});else{d.push({target:b,type:"selectstart",handler:function(d){return a._handleSelectStart(d?d:p.event)}});d.push({target:b,type:"mousedown",handler:function(d){return a._handleMouseDown(d?d:p.event)}});d.push({target:b,type:"mouseover",
handler:function(d){return a._handleMouseOver(d?d:p.event)}});d.push({target:b,type:"mouseout",handler:function(d){return a._handleMouseOut(d?d:p.event)}});d.push({target:l,type:"mouseup",handler:function(d){return a._handleMouseUp(d?d:p.event)}});d.push({target:l,type:"mousemove",handler:function(d){return a._handleMouseMove(d?d:p.event)}});d.push({target:e,type:"mousedown",handler:function(d){return a._handleRootMouseDown(d?d:p.event)}});d.push({target:e,type:"mouseup",handler:function(d){return a._handleRootMouseUp(d?
d:p.event)}});d.push({target:h,type:"dragstart",handler:function(d){return a._handleDragStart(d?d:p.event)}});d.push({target:h,type:"drag",handler:function(d){return a._handleDrag(d?d:p.event)}});d.push({target:h,type:"dragend",handler:function(d){return a._handleDragEnd(d?d:p.event)}});d.push({target:h,type:"dragenter",handler:function(d){return a._handleDragEnter(d?d:p.event)}});d.push({target:h,type:"dragover",handler:function(d){return a._handleDragOver(d?d:p.event)}});d.push({target:h,type:"dragleave",
handler:function(d){return a._handleDragLeave(d?d:p.event)}});d.push({target:h,type:"drop",handler:function(d){return a._handleDrop(d?d:p.event)}});d.push({target:this._clientDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(d){return a._handleMouseWheel(d?d:p.event)}});this._clipDiv&&d.push({target:this._clipDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(d){return a._handleMouseWheel(d?d:p.event)}});if(g.isFirefox&&
(!g.isWindows||15<=g.isFirefox))(f=p.MutationObserver||p.MozMutationObserver)?(this._mutationObserver=new f(function(d){a._handleDataModified(d)}),this._mutationObserver.observe(b,{subtree:!0,characterData:!0})):d.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(d){return a._handleDataModified(d?d:p.event)}});if(g.isFirefox&&(!g.isWindows||15<=g.isFirefox)||g.isIE)d.push({target:this._clientDiv,type:"compositionstart",handler:function(d){return a._handleCompositionStart(d?
d:p.event)}}),d.push({target:this._clientDiv,type:"compositionend",handler:function(d){return a._handleCompositionEnd(d?d:p.event)}});this._overlayDiv&&(d.push({target:this._overlayDiv,type:"mousedown",handler:function(d){return a._handleMouseDown(d?d:p.event)}}),d.push({target:this._overlayDiv,type:"mouseover",handler:function(d){return a._handleMouseOver(d?d:p.event)}}),d.push({target:this._overlayDiv,type:"mouseout",handler:function(d){return a._handleMouseOut(d?d:p.event)}}),d.push({target:this._overlayDiv,
type:"contextmenu",handler:function(d){return a._handleContextMenu(d?d:p.event)}}));this._isW3CEvents||d.push({target:this._clientDiv,type:"dblclick",handler:function(d){return a._handleDblclick(d?d:p.event)}})}this._hookRulerEvents(this._leftDiv,d);this._hookRulerEvents(this._rightDiv,d);this._hookRulerEvents(this._marginDiv,d);for(f=0;f<d.length;f++)e=d[f],w(e.target,e.type,e.handler,e.capture)},_hookRulerEvents:function(a,d){if(a){var b=this,f=this._getWindow();g.isIE&&d.push({target:a,type:"selectstart",
handler:function(){return!1}});d.push({target:a,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:f.event)}});d.push({target:a,type:"click",handler:function(a){b._handleRulerEvent(a?a:f.event)}});d.push({target:a,type:"dblclick",handler:function(a){b._handleRulerEvent(a?a:f.event)}});d.push({target:a,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:f.event)}});d.push({target:a,type:"mouseover",handler:function(a){b._handleRulerEvent(a?
a:f.event)}});d.push({target:a,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:f.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var d=a.parent;"string"===typeof d&&(d=(a.document||document).getElementById(d));if(!d)throw"no parent";a.parent=d;a.model=a.model||new n.TextModel;var b=this._defaultOptions(),
f;for(f in b)b.hasOwnProperty(f)&&(this["_"+f]=void 0!==a[f]?a[f]:b[f].value);this._keyModes=[];this._rulers=[];this._selection=new y(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!g.isIE||9<=g.isIE)&&"function"===typeof d.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=d.addEventListener;this._autoScrollTimerID=this._autoScrollY=
this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_checkOverlayScroll:function(){if(g.isMac&&g.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var a=this._viewDiv,d=
this._isOverOverlayScroll();a.style.pointerEvents=d.vertical||d.horizontal?"":"none"}},_isOverOverlayScroll:function(){if(!(200>(new Date).getTime()-this._lastScrollTime))return{};var a=this._viewDiv.getBoundingClientRect(),d=this._lastMouseMoveX,b=this._lastMouseMoveY;return{vertical:a.top<=b&&b<a.bottom&&a.right-15<=d&&d<a.right,horizontal:a.bottom-15<=b&&b<a.bottom&&a.left<=d&&d<a.right}},_modifyContent:function(a,d){if(this._readonly&&!a._code)return!1;a.type="Verify";this.onVerify(a);if(null===
a.text||void 0===a.text)return!1;var b=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),b.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}if(d){b=this._getSelection();b.setCaret(a.start+a.text.length);try{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!0),this._setSelection(b,!0)}finally{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!1)}}this.onModify({type:"Modify"});return!0},_onModelChanged:function(a){a.type="ModelChanged";
this.onModelChanged(a);a.type="Changed";var d=a.start,b=a.addedCharCount,f=a.removedCharCount,g=a.addedLineCount,e=a.removedLineCount,h=this._getSelection();h.end>d&&(h.end>d&&h.start<d+f?h.setCaret(d+b):(h.start+=b-f,h.end+=b-f),this._setSelection(h,!1,!1));d=this._model.getLineAtOffset(d);for(b=this._getLineNext();b;)f=b.lineIndex,d<=f&&f<=d+e&&(d===f&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null)),f>d+
e&&(b.lineIndex=f+g-e,b._line.lineIndex=b.lineIndex),b=this._getLineNext(b);this._lineHeight&&(a=[d,e].concat(Array(g)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(d<=this._maxLineIndex&&this._maxLineIndex<=d+e)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=
this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,d){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==d)for(var b=a;b<d;b++)this._lineHeight[b]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=
-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new y(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>g.isFirefox&&this._fixCaret()}},_scrollViewAnimated:function(a,d,b){var f=this._getWindow();if(b&&this._scrollAnimation){var g=this;this._animation=new C({window:f,
duration:this._scrollAnimation,curve:[d,0],onAnimate:function(a){a=d-Math.floor(a);g._scrollView(0,a);d-=a},onEnd:function(){g._animation=null;g._scrollView(a,d);b&&f.setTimeout(b,0)}});this._animation.play()}else this._scrollView(a,d),b&&f.setTimeout(b,0)},_scrollView:function(a,d){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);d&&(b.scrollTop+=d)},_setClipboardText:function(a,d){var b,f=this._getWindow(),e=f.clipboardData;!e&&d&&(e=d.clipboardData);if(e&&(b=[],p(a,function(a){b.push(a)},
function(){b.push(g.platformDelimiter)}),e.setData(g.isIE?"Text":"text/plain",b.join(""))||21<g.isFirefox))return!0;var h=this._parent.ownerDocument,k=g.createElement(h,"pre");k.style.position="fixed";k.style.left="-1000px";p(a,function(a){k.appendChild(h.createTextNode(a))},function(){k.appendChild(g.createElement(h,"br"))});k.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(k);e=h.createRange();e.setStart(k.firstChild,0);e.setEndBefore(k.lastChild);var l=f.getSelection();0<l.rangeCount&&
l.removeAllRanges();l.addRange(e);var q=this,e=function(){k&&k.parentNode===q._clientDiv&&q._clientDiv.removeChild(k);q._updateDOMSelection()},l=!1;this._ignoreCopy=!0;try{l=h.execCommand("copy",!1,null)}catch(u){}this._ignoreCopy=!1;if(!l&&d)return f.setTimeout(e,0),!1;e();return!0},_setDOMSelection:function(a,d,b,f,e){this._setDOMFullSelection(a,d,b,f);a=a._line.getNodeOffset(d);b=b._line.getNodeOffset(f);f=this._getWindow();d=this._parent.ownerDocument;if(f.getSelection){var h=f.getSelection();
f=d.createRange();f.setStart(a.node,a.offset);f.setEnd(b.node,b.offset);if(this._hasFocus&&(h.anchorNode!==a.node||h.anchorOffset!==a.offset||h.focusNode!==b.node||h.focusOffset!==b.offset||h.anchorNode!==b.node||h.anchorOffset!==b.offset||h.focusNode!==a.node||h.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=b.node,this._focusOffset=b.offset,this._ignoreSelect=!1,0<h.rangeCount&&h.removeAllRanges(),h.addRange(f),this._ignoreSelect=!0;this._cursorDiv&&
(f=d.createRange(),e?(f.setStart(a.node,a.offset),f.setEnd(a.node,a.offset)):(f.setStart(b.node,b.offset),f.setEnd(b.node,b.offset)),e=f.getClientRects()[0],a=this._cursorDiv.parentNode,b=a.getBoundingClientRect(),e&&b&&(this._cursorDiv.style.top=e.top-b.top+a.scrollTop+"px",this._cursorDiv.style.left=e.left-b.left+a.scrollLeft+"px"))}else d.selection&&this._hasFocus&&(e=d.body,f=g.createElement(d,"div"),e.appendChild(f),e.removeChild(f),f=e.createTextRange(),f.moveToElementText(a.node.parentNode),
f.moveStart("character",a.offset),e=e.createTextRange(),e.moveToElementText(b.node.parentNode),e.moveStart("character",b.offset),f.setEndPoint("EndToStart",e),this._ignoreSelect=!1,f.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,d,b,f){if(this._selDiv1){var g=this._selDiv1;g.style.width="0px";g.style.height="0px";g=this._selDiv2;g.style.width="0px";g.style.height="0px";g=this._selDiv3;g.style.width="0px";g.style.height="0px";if(!(a===b&&d===f)){var e=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),
k=this._viewDiv.getBoundingClientRect(),g=k.left+e.left,p=h.right,e=k.top+e.top,l=h.bottom,k=h=0;this._clipDiv?(k=this._clipDiv.getBoundingClientRect(),h=k.left-this._clipDiv.scrollLeft):(k=this._rootDiv.getBoundingClientRect(),h=k.left);k=k.top;this._ignoreDOMSelection=!0;var q=(new x(this,a.lineIndex,a)).getBoundingClientRect(d,!1),u=q.left;d=(new x(this,b.lineIndex,b)).getBoundingClientRect(f,!1);var t=d.left;this._ignoreDOMSelection=!1;var m=this._selDiv1,u=Math.min(p,Math.max(g,u)),n=Math.min(l,
Math.max(e,q.top)),y=p;f=Math.min(l,Math.max(e,q.bottom));m.style.left=u-h+"px";m.style.top=n-k+"px";m.style.width=Math.max(0,y-u)+"px";m.style.height=Math.max(0,f-n)+"px";a.lineIndex===b.lineIndex?(y=Math.min(t,p),m.style.width=Math.max(0,y-u)+"px"):(q=Math.min(l,Math.max(e,d.top)),t=Math.min(p,Math.max(g,t)),e=Math.min(l,Math.max(e,d.bottom)),l=this._selDiv3,l.style.left=g-h+"px",l.style.top=q-k+"px",l.style.width=Math.max(0,t-g)+"px",l.style.height=Math.max(0,e-q)+"px",1<Math.abs(a.lineIndex-b.lineIndex)&&
(a=this._selDiv2,a.style.left=g-h+"px",a.style.top=f-k+"px",a.style.width=Math.max(0,p-g)+"px",a.style.height=Math.max(0,q-f)+"px"))}}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;g.isIE&&a&&(this._hadFocus=this._hasFocus);var d=this._clientDiv;d.contentEditable=!a;this._hadFocus&&
!a&&d.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;)a._line.updateLinks(),a=this._getLineNext(a);this._updateDOMSelection()}},_setSelection:function(a,d,b,f,g){if(a){this._columnX=-1;void 0===b&&(b=!0);var e=this._selection;this._selection=a;!1!==d&&this._showCaret(!1,f,d,g);b&&this._updateDOMSelection();if(!e.equals(a))this.onSelection({type:"Selection",oldValue:{start:e.start,end:e.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,
d,b,f){var g=this._model,e=this._getSelection();d=this.convert({x:a,y:d},"page","document");a=this._getLineIndex(d.y);if(1===this._clickCount){g=this._getLine(a);a=g.getOffset(d.x,d.y-this._getLinePixel(a));g.destroy();if(f&&!b&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);b||e.collapse()}else 0===(this._clickCount&1)?(g=this._getLine(a),a=g.getOffset(d.x,d.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,f=
g.getNextOffset(a,{unit:"wordend",count:1})):(b=g.getNextOffset(a,{unit:"word",count:-1}),f=this._doubleClickSelection.end):(b=g.getNextOffset(a,{unit:"word",count:-1}),f=g.getNextOffset(b,{unit:"wordend",count:1})),g.destroy()):this._doubleClickSelection?(f=g.getLineAtOffset(this._doubleClickSelection.start),a>=f?(b=g.getLineStart(f),f=g.getLineEnd(a)):(b=g.getLineStart(a),f=g.getLineEnd(f))):(b=g.getLineStart(a),f=g.getLineEnd(a)),e.setCaret(b),e.extend(f);this._setSelection(e,!0,!0);return!0},
_setFullSelection:function(a,d){this._fullSelection=a;g.isWebkit&&(this._fullSelection=!0);var b=this._clipDiv||this._rootDiv;if(b)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!g.isIOS){var f=b.ownerDocument;this._highlightRGB=g.isWebkit?"transparent":"Highlight";var e=g.createElement(f,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width=
"0px";e.style.height="0px";e.style.zIndex="0";b.appendChild(e);var h=g.createElement(f,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding="0px";h.style.outline="none";h.style.background=this._highlightRGB;h.style.width="0px";h.style.height="0px";h.style.zIndex="0";b.appendChild(h);this._selDiv3=f=g.createElement(f,"div");f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";
f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";b.appendChild(f);if(g.isFirefox&&g.isMac){b=this._getWindow().getComputedStyle(f,null).getPropertyValue("background-color");switch(b){case "rgb(119, 141, 168)":b="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":b="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":b="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":b="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":b="rgb(255, 209, 129)";break;
case "rgb(102, 197, 71)":b="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":b="rgb(232, 184, 255)";break;default:b="rgb(180, 213, 255)"}this._highlightRGB=b;e.style.background=b;h.style.background=b;f.style.background=b}d||this._updateDOMSelection()}}else this._selDiv1&&(b.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(b.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(b.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=
a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=this._viewDiv,d=g.createElement(a.ownerDocument,"div");d.className="textviewBlockCursor";this._cursorDiv=d;d.tabIndex=-1;d.style.zIndex="2";d.style.color="transparent";d.style.position="absolute";d.style.pointerEvents="none";d.innerHTML="\x26nbsp;";a.appendChild(d);
this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,d){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";d||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(a,d){this._wrapOffset=a;d||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":
"false")},_setSingleMode:function(a,d){this._singleMode=a;this._updateOverflow();this._updateStyle(d)},_setTabSize:function(a,d){this._tabSize=a;this._customTabSize=void 0;var b=this._clientDiv;g.isOpera?b&&(b.style.OTabSize=this._tabSize+""):537.1<=g.isWebkit?b&&(b.style.tabSize=this._tabSize+""):4<=g.isFirefox?b&&(b.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);d||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",
this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,d){this._themeClass=a;var b="textview",f=this._theme.getThemeClass();f&&(b+=" "+f);this._themeClass&&f!==this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(d)},_setWrapMode:function(a,d){this._wrapMode=a&&this._wrappable;var b=this._clientDiv;this._wrapMode?(b.style.whiteSpace=
"pre-wrap",b.style.wordWrap="break-word"):(b.style.whiteSpace="pre",b.style.wordWrap="normal");this._updateOverflow();d||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,d,b,f){if(this._clientDiv&&!(0<this._redrawCount)&&!this._ignoreDOMSelection){var g=this._model,e=this._getSelection(),h=this._getScroll(),k=e.getCaret(),p=e.start,l=e.end,q=g.getLineAtOffset(p),u=g.getLineAtOffset(l),t=Math.max(Math.max(p,g.getLineStart(u)),l-1),g=this._getClientWidth(),m=this._getClientHeight(),
n=g/4,y=this._getBoundsAtOffset(k===p?p:t),v=y.left,w=y.right,x=y.top,s=y.bottom,z=0,C="object"===typeof b;if((a||C)&&!e.isEmpty())y=this._getBoundsAtOffset(k===l?p:t),z=(y.bottom>s?y.bottom:s)-(y.top<x?y.top:x),a&&(y.top===x?k===p?w=v+Math.min(y.right-v,g):v=w-Math.min(w-y.left,g):k===p?s=x+Math.min(y.bottom-x,m):x=s-Math.min(s-y.top,m));a=0;v<h.x&&(a=Math.min(v-h.x,-n));w>h.x+g&&(a=Math.max(w-h.x-g,n));e=0;x<h.y?e=x-h.y:s>h.y+m&&(e=s-h.y-m);f&&(0<f?0<e&&(e=Math.max(e,f)):0>e&&(e=Math.min(e,f)));
f=C&&"always"===b.scrollPolicy;if(0!==a||0!==e||f)return C?(f=0<e,0===e&&(e=x-h.y),h=b.viewAnchor,x=b.selectionAnchor,b=Math.min(Math.max(0,b.viewAnchorOffset||0)),e="top"===h?e+Math.floor(f?(1-b)*m:-b*m):"bottom"===h?e+Math.floor(f?b*m:-(1-b)*m):"center"===h?e+Math.floor(f?m/2+b*m:m/2-(1-b)*m):e+Math.floor(f?b*m:-b*m),q!==u&&("top"===x&&k!==p?e+=Math.floor(-z):"bottom"===x&&k!==l?e+=Math.floor(z):"center"===x&&(e+=Math.floor(z/2)))):0!==e&&"number"===typeof b&&(0>b&&(b=0),1<b&&(b=1),e+=Math.floor(0<
e?b*m:-b*m)),this._scrollViewAnimated(a,e,d),m!==this._getClientHeight()||g!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;d&&d();return!1}},_startIME:function(){if(-1===this._imeOffset){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);
this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var d=this._handlers[a];z(d.target,d.type,d.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),d=this._model,b=d.getLineAtOffset(a.start),f=d.getLineAtOffset(a.end),
e=this._getLineNext();if(e){var g=this._getLinePrevious(),h;b<e.lineIndex?(b=e,h=d.getLineStart(e.lineIndex)):b>g.lineIndex?(b=g,h=d.getLineStart(g.lineIndex)):(b=this._getLineNode(b),h=a.start);f<e.lineIndex?(f=e,d=d.getLineStart(e.lineIndex)):f>g.lineIndex?(f=g,d=d.getLineStart(g.lineIndex)):(f=this._getLineNode(f),d=a.end);this._setDOMSelection(b,h,f,d,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=
null,a=!1);var d=this._clientDiv,b=this._viewDiv;if(d){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var f=this._model,e=this._getScroll(!1),h=this._getViewPadding(),k=f.getLineCount(),p=this._getLineHeight(),l=!1,q=!1,u=!1,t=this._metrics.scrollWidth;this._wrapMode&&(d.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var m,n,y,v,w=0,s=0,z;if(this._lineHeight){for(;s<k;){z=this._getLineHeight(s);if(w+z>e.y)break;w+=z;s++}m=s;
n=Math.max(0,m-1);y=f=e.y-w;0<m&&(f+=this._getLineHeight(m-1))}else v=Math.max(0,e.y)/p,m=Math.floor(v),n=Math.max(0,m-1),f=Math.round((v-n)*p),y=Math.round((v-m)*p);this._topIndexY=y;v=this._rootDiv;var C=v.clientWidth,Q=v.clientHeight;if(a){p=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),p=m.right-m.left);m=this._getClientWidth();v=this._getClientHeight();q=m;this._wrapMode?this._metrics.wrapWidth&&(q=this._metrics.wrapWidth):q=Math.max(this._maxLineWidth,q);for(;s<k;)z=this._getLineHeight(s,
!1),w+=z,s++;k=w}else{v=this._getClientHeight();y=Math.min(m+Math.floor((v+y)/p),k-1);var e=Math.min(y+1,k-1),N;for(z=d.firstChild;z;){N=z.lineIndex;var M=z.nextSibling;if(!(n<=N&&N<=e)||z.lineRemoved||-1===z.lineIndex)this._mouseWheelLine===z?(z.style.display="none",z.lineIndex=-1):d.removeChild(z);z=M}z=this._getLineNext();var M=b.ownerDocument,O=M.createDocumentFragment();for(N=n;N<=e;N++)!z||z.lineIndex>N?(new x(this,N)).create(O,null):(O.firstChild&&(d.insertBefore(O,z),O=M.createDocumentFragment()),
z&&z.lineChanged&&(z=(new x(this,N)).create(O,z),z.lineChanged=!1),z=this._getLineNext(z));O.firstChild&&d.insertBefore(O,z);g.isWebkit&&!this._wrapMode&&(d.style.width="0x7fffffffpx");z=this._getLineNext();N=v+f;for(O=!1;z;)n=z.lineWidth,void 0===n&&(M=z._line.getBoundingClientRect(),n=z.lineWidth=Math.ceil(M.right-M.left),M=M.bottom-M.top,this._lineHeight?this._lineHeight[z.lineIndex]=M:0!==p&&(0!==M&&Math.ceil(p)!==Math.ceil(M))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[z.lineIndex]=
M)),this._lineHeight&&!O&&(N-=this._lineHeight[z.lineIndex],0>N&&(y=z.lineIndex,O=!0)),this._wrapMode||(n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=z.lineIndex),this._checkMaxLineIndex===z.lineIndex&&(this._checkMaxLineIndex=-1)),z.lineIndex===m&&(this._topChild=z),z.lineIndex===y&&(this._bottomChild=z),z=this._getLineNext(z);-1!==this._checkMaxLineIndex&&(N=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=N&&N<k&&(p=new x(this,N),M=p.getBoundingClientRect(),n=M.right-M.left,
n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=N),p.destroy()));for(;s<k;)z=this._getLineHeight(s,s<=y),w+=z,s++;k=w;this._updateRuler(this._leftDiv,m,e,Q);this._updateRuler(this._rightDiv,m,e,Q);this._updateRuler(this._marginDiv,m,e,Q);p=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),p=m.right-m.left);e=0;this._rightDiv&&(e=this._rightDiv.getBoundingClientRect(),e=e.right-e.left);b.style.left=p+"px";b.style.right=e+"px";e=this._scrollDiv;e.style.height=k+"px";m=this._getClientWidth();
!this._singleMode&&!this._wrapMode&&(w=l=v,(s="scroll"===b.style.overflowX)?l+=t:w-=t,z=y=m,(n="scroll"===b.style.overflowY)?y+=t:z-=t,v=l,m=y,k>v&&(u=!0,m=z),this._maxLineWidth>m&&(q=!0,v=w,k>v&&(u=!0,m=z)),s!==q&&(b.style.overflowX=q?"scroll":"hidden"),n!==u&&(b.style.overflowY=u?"scroll":"hidden"),l=s!==q||n!==u);u=m;this._wrapMode?this._metrics.wrapWidth&&(u=this._metrics.wrapWidth):u=Math.max(this._maxLineWidth,u);q=u;if((!g.isIE||9<=g.isIE)&&this._maxLineWidth>m)u+=h.right+h.left;e.style.width=
u+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=u+"px");e=this._getScroll(!1)}this._vScrollDiv&&(u=v-8,w=Math.max(15,Math.ceil(Math.min(1,u/(k+h.top+h.bottom))*u)),this._vScrollDiv.style.left=p+m-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,e.y*u/k))+"px",this._vScrollDiv.style.height=w+"px");!this._wrapMode&&this._hScrollDiv&&(u=m-8,w=Math.max(15,Math.ceil(Math.min(1,u/(this._maxLineWidth+h.left+h.right))*u)),this._hScrollDiv.style.left=p+Math.floor(Math.max(0,Math.floor(e.x*
u/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=v-9+"px",this._hScrollDiv.style.width=w+"px");s=e.x;w=this._clipDiv;u=this._overlayDiv;if(y=this._marginDiv)y.style.left=-s+p+this._metrics.marginWidth+h.left+"px",y.style.bottom=("scroll"===b.style.overflowX?t:0)+"px";w?(w.scrollLeft=s,w.scrollTop=0,b=p+h.left,t=h.top,a=m,p=v,s=0,y=-f,0===e.x&&(b-=h.left,a+=h.left,s=h.left),e.x+m===q&&(a+=h.right),0===e.y&&(t-=h.top,p+=h.top,y+=h.top),e.y+v===k&&(p+=h.bottom),w.style.left=b+"px",w.style.top=
t+"px",w.style.right=C-a-b+"px",w.style.bottom=Q-p-t+"px",d.style.left=s+"px",d.style.top=y+"px",d.style.width=q+"px",d.style.height=v+f+"px",u&&(u.style.left=d.style.left,u.style.top=d.style.top,u.style.width=d.style.width,u.style.height=d.style.height)):(b=s,t=f,C=s+m,Q=f+v,0===b&&(b-=h.left),0===t&&(t-=h.top),C===q&&(C+=h.right),e.y+v===k&&(Q+=h.bottom),d.style.clip="rect("+t+"px,"+C+"px,"+Q+"px,"+b+"px)",d.style.left=-s+p+h.left+"px",d.style.width=(this._wrapMode||g.isWebkit?q:m+s)+"px",a||(d.style.top=
-f+h.top+"px",d.style.height=v+f+"px"),u&&(u.style.clip=d.style.clip,u.style.left=d.style.left,u.style.width=d.style.width,a||(u.style.top=d.style.top,u.style.height=d.style.height)));this._updateDOMSelection();l&&(d=this._ensureCaretVisible,this._ensureCaretVisible=!1,d&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,d,f,e){if(a){var h=
this._parent.ownerDocument,k=this._getLineHeight(),p=this._getViewPadding();for(a=a.firstChild;a;){var l=a._ruler,q=k,u=l.getOverview();"page"===u&&(q+=this._topIndexY);a.style.top=-q+"px";a.style.height=e+q+"px";a.rulerChanged&&b(l.getRulerStyle(),a);var m,t=a.firstChild;t?(m=t,t=t.nextSibling):(m=g.createElement(h,"div"),m.style.visibility="hidden",a.appendChild(m));var n;if(a.rulerChanged&&m){q=-1;if(n=l.getWidestAnnotation())b(n.style,m),n.html&&(m.innerHTML=n.html);m.lineIndex=q;m.style.height=
k+p.top+"px"}var y;if("page"===u){for(l=l.getAnnotations(d,f+1);t;)q=t.lineIndex,n=t.nextSibling,(!(d<=q&&q<=f)||t.lineChanged)&&a.removeChild(t),t=n;t=a.firstChild.nextSibling;y=h.createDocumentFragment();for(q=d;q<=f;q++)if(!t||t.lineIndex>q){m=g.createElement(h,"div");if(n=l[q])b(n.style,m),n.html&&(m.innerHTML=n.html),m.annotation=n;m.lineIndex=q;m.style.height=this._getLineHeight(q)+"px";y.appendChild(m)}else y.firstChild&&(a.insertBefore(y,t),y=h.createDocumentFragment()),t&&(t=t.nextSibling);
y.firstChild&&a.insertBefore(y,t)}else{n=this._getClientHeight();q=this._model.getLineCount();t=n+p.top+p.bottom-2*this._metrics.scrollWidth;u=k*q<t?k:t/q;if(a.rulerChanged){for(n=a.childNodes.length;1<n;)a.removeChild(a.lastChild),n--;l=l.getAnnotations(0,q);y=h.createDocumentFragment();for(var v in l)q=v>>>0,0>q||(m=g.createElement(h,"div"),n=l[v],b(n.style,m),m.style.position="absolute",m.style.top=this._metrics.scrollWidth+k+Math.floor(q*u)+"px",n.html&&(m.innerHTML=n.html),m.annotation=n,m.lineIndex=
q,y.appendChild(m));a.appendChild(y)}else if(a._oldTrackHeight!==t)for(m=a.firstChild?a.firstChild.nextSibling:null;m;)m.style.top=this._metrics.scrollWidth+k+Math.floor(m.lineIndex*u)+"px",m=m.nextSibling;a._oldTrackHeight=t}a.rulerChanged=!1;a=a.nextSibling}}},_updateStyleSheet:function(){var a="";g.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");g.isFirefox&&(g.isMac&&this._highlightRGB&&"Highlight"!==this._highlightRGB)&&(a+="\n.textview ::-moz-selection {background: "+
this._highlightRGB+";}");if(a){var d=this._clientDiv.ownerDocument,b=d.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(d.createTextNode(a));else{b=g.createElement(d,"style");b.id="_textviewStyle";var f=d.getElementsByTagName("head")[0]||d.documentElement;b.appendChild(d.createTextNode(a));f.insertBefore(b,f.firstChild)}}},_updateStyle:function(a){!a&&g.isIE&&(this._rootDiv.style.lineHeight="normal");var d=this._metrics=this._calculateMetrics();this._variableLineHeight&&
(this._variableLineHeight=!1,this._resetLineHeight());this._rootDiv.style.lineHeight=g.isIE?d.lineHeight-(d.lineTrim.top+d.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();if(g.isMac&&g.isWebkit){var b=this._viewDiv;!d.invalid&&0===d.scrollWidth?(b.style.pointerEvents="none",b.style.zIndex="2"):(b.style.pointerEvents="",b.style.zIndex="")}a||(this.redraw(),this._resetLineWidth())}};k.EventTarget.addMixin(s.prototype);return{TextView:s}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(l,n){function m(k){this._model=k;this._projections=[];var e=this;this._listener={onChanged:function(h){e._onChanged(h)},onChanging:function(h){e._onChanging(h)}};k.addEventListener("postChanged",this._listener.onChanged);k.addEventListener("preChanging",this._listener.onChanging)}m.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(k){if(k){var e=this._model,h=this._projections;k._lineIndex=e.getLineAtOffset(k.start);k._lineCount=e.getLineAtOffset(k.end)-k._lineIndex;var g=k.text;g||(g="");k._model="string"===typeof g?new l.TextModel(g,e.getLineDelimiter()):g;var e=this.mapOffset(k.start,!0),g=k.end-k.start,b=k._lineCount,a=k._model.getCharCount(),f=k._model.getLineCount()-1,d={type:"Changing",text:k._model.getText(),
start:e,removedCharCount:g,addedCharCount:a,removedLineCount:b,addedLineCount:f};this.onChanging(d);d=this._binarySearch(h,k.start);h.splice(d,0,k);this.onChanged({type:"Changed",start:e,removedCharCount:g,addedCharCount:a,removedLineCount:b,addedLineCount:f})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(k,e){var h=this._projections,g=0,b,a;if(e){for(b=0;b<h.length;b++){a=h[b];if(a.start>k)break;if(a.end>k)return-1;g+=
a._model.getCharCount()-(a.end-a.start)}return k+g}for(b=0;b<h.length;b++){a=h[b];if(a.start>k-g)break;var f=a._model.getCharCount();if(a.start+f>k-g)return-1;g+=f-(a.end-a.start)}return k-g},removeProjection:function(k){this._removeProjection(k)},_removeProjection:function(k,e){var h,g=0;for(h=0;h<this._projections.length;h++){var b=this._projections[h];if(b===k){k=b;break}g+=b._model.getCharCount()-(b.end-b.start)}if(h<this._projections.length){var b=this._model,g=k.start+g,a=k.end-k.start,f=k._lineCount,
d=k._model.getCharCount(),p=k._model.getLineCount()-1;e||(b={type:"Changing",text:b.getText(k.start,k.end),start:g,removedCharCount:d,addedCharCount:a,removedLineCount:p,addedLineCount:f},this.onChanging(b));this._projections.splice(h,1);if(!e)this.onChanged({type:"Changed",start:g,removedCharCount:d,addedCharCount:a,removedLineCount:p,addedLineCount:f})}},_binarySearch:function(k,e){for(var h=k.length,g=-1,b;1<h-g;)b=Math.floor((h+g)/2),e<=k[b].start?h=b:g=b;return h},getCharCount:function(){for(var k=
this._model.getCharCount(),e=this._projections,h=0;h<e.length;h++)var g=e[h],k=k+(g._model.getCharCount()-(g.end-g.start));return k},getLine:function(k,e){if(0>k)return null;var h=this._model,g=this._projections,b=0,a=[],f=0,d,p,l;for(d=0;d<g.length;d++){l=g[d];if(l._lineIndex>=k-b)break;p=l._model.getLineCount()-1;if(l._lineIndex+p>=k-b){f=k-(l._lineIndex+b);if(f<p)return l._model.getLine(f,e);a.push(l._model.getLine(p))}f=l.end;b+=p-l._lineCount}for(f=Math.max(f,h.getLineStart(k-b));d<g.length;d++){l=
g[d];if(l._lineIndex>k-b)break;a.push(h.getText(f,l.start));p=l._model.getLineCount()-1;if(l._lineIndex+p>k-b)return a.push(l._model.getLine(0,e)),a.join("");a.push(l._model.getText());f=l.end;b+=p-l._lineCount}g=h.getLineEnd(k-b,e);f<g&&a.push(h.getText(f,g));return a.join("")},getLineAtOffset:function(k){for(var e=this._model,h=this._projections,g=0,b=0,a=0;a<h.length;a++){var f=h[a];if(f.start>k-g)break;var d=f._model.getCharCount();if(f.start+d>k-g){h=k-(f.start+g);b+=f._model.getLineAtOffset(h);
g+=h;break}b+=f._model.getLineCount()-1-f._lineCount;g+=d-(f.end-f.start)}return e.getLineAtOffset(k-g)+b},getLineCount:function(){for(var k=this._projections,e=this._model.getLineCount(),h=0;h<k.length;h++)var g=k[h],e=e+(g._model.getLineCount()-1-g._lineCount);return e},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(k,e){if(0>k)return-1;for(var h=this._model,g=this._projections,b=0,a=0,f=0;f<g.length;f++){var d=g[f];if(d._lineIndex>k-b)break;var p=d._model.getLineCount()-
1;if(d._lineIndex+p>k-b)return d._model.getLineEnd(k-(d._lineIndex+b),e)+d.start+a;a+=d._model.getCharCount()-(d.end-d.start);b+=p-d._lineCount}return h.getLineEnd(k-b,e)+a},getLineStart:function(k){if(0>k)return-1;for(var e=this._model,h=this._projections,g=0,b=0,a=0;a<h.length;a++){var f=h[a];if(f._lineIndex>=k-g)break;var d=f._model.getLineCount()-1;if(f._lineIndex+d>=k-g)return f._model.getLineStart(k-(f._lineIndex+g))+f.start+b;b+=f._model.getCharCount()-(f.end-f.start);g+=d-f._lineCount}return e.getLineStart(k-
g)+b},getText:function(k,e){void 0===k&&(k=0);var h=this._model,g=this._projections,b=0,a=[],f,d,p;for(f=0;f<g.length;f++){d=g[f];if(d.start>k-b)break;p=d._model.getCharCount();if(d.start+p>k-b){if(void 0!==e&&d.start+p>e-b)return d._model.getText(k-(d.start+b),e-(d.start+b));a.push(d._model.getText(k-(d.start+b)));k=d.end+b+p-(d.end-d.start)}b+=p-(d.end-d.start)}var l=k-b;if(void 0!==e){for(;f<g.length;f++){d=g[f];if(d.start>e-b)break;a.push(h.getText(l,d.start));p=d._model.getCharCount();if(d.start+
p>e-b)return a.push(d._model.getText(0,e-(d.start+b))),a.join("");a.push(d._model.getText());l=d.end;b+=p-(d.end-d.start)}a.push(h.getText(l,e-b))}else{for(;f<g.length;f++)d=g[f],a.push(h.getText(l,d.start)),a.push(d._model.getText()),l=d.end;a.push(h.getText(l))}return a.join("")},_onChanged:function(k){k=this._change;var e=k.baseStart,h=k.baseEnd,g,b,a=this._projections;for(g=0;g<a.length&&!(b=a[g],b.end>e);g++);var f=g;for(g=0;g<a.length&&!(b=a[g],b.start>=h);g++);var d=g,p=this._model,e=k.baseText.length-
(h-e);for(g=d;g<a.length;g++)b=a[g],b.start+=e,b.end+=e,b._lineIndex=p.getLineAtOffset(b.start);b=a.splice(f,d-f);for(g=0;g<b.length;g++)b[g].annotation&&b[g].annotation._expand();this.onChanged({type:"Changed",start:k.start,removedCharCount:k.removedCharCount,addedCharCount:k.addedCharCount,removedLineCount:k.removedLineCount,addedLineCount:k.addedLineCount});this._change=void 0},_onChanging:function(k){var e=!!this._change,h=this._change||{},g=k.start,b=g+k.removedCharCount;h.baseStart=g;h.baseEnd=
b;h.baseText=k.text;h.addedLineCount=k.addedLineCount;if(!e){this._change=h;h.text=k.text;var a=this._projections,f,d,p;k=function(b){for(f=d=0;d<a.length;d++){p=a[d];if(p.start>b)break;if(p.end>b)return-1;f+=p._model.getCharCount()-(p.end-p.start)}return b+f};h.start=k(g);-1===h.start&&(h.text=this._model.getText(p.start,g)+h.text,h.addedLineCount+=this._model.getLineAtOffset(g)-this._model.getLineAtOffset(p.start),h.start=p.start+f);h.end=k(b);-1===h.end&&(h.text+=this._model.getText(b,p.end),h.addedLineCount+=
this._model.getLineAtOffset(p.end)-this._model.getLineAtOffset(b),h.end=p.start+f)}h.addedCharCount=h.text.length;h.removedCharCount=h.end-h.start;h.removedLineCount=this.getLineAtOffset(h.end)-this.getLineAtOffset(h.start);this.onChanging({type:"Changing",text:h.text,start:h.start,removedCharCount:h.removedCharCount,addedCharCount:h.addedCharCount,removedLineCount:h.removedLineCount,addedLineCount:h.addedLineCount})},onChanging:function(k){return this.dispatchEvent(k)},onChanged:function(k){return this.dispatchEvent(k)},
setLineDelimiter:function(k){this._model.setLineDelimiter(k)},setText:function(k,e,h){function g(e){for(a=f=0;f<b.length;f++){d=b[f];if(d.start>e-a)break;var g=d._model.getCharCount();if(d.start+g>e-a)return-1;a+=g-(d.end-d.start)}return e-a}this._change={text:k||"",start:e||0,end:void 0===h?this.getCharCount():h};var b=this._projections,a,f,d,p,l;k=g(this._change.start);-1===k&&(p={projection:d,start:this._change.start-(d.start+a)},k=d.end);e=g(this._change.end);-1===e&&(l={projection:d,end:this._change.end-
(d.start+a)},e=d.start);p&&l&&p.projection===l.projection?d._model.setText(this._change.text,p.start,l.end):(this._model.setText(this._change.text,k,e),p&&(d=p.projection,d._model.setText("",p.start)),l&&(d=l.projection,d._model.setText("",0,l.end),d.start=d.end,d._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(m.prototype);return{ProjectionTextModel:m}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(l,n,m,k,e,h){function g(b){this._view=b;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(b.getOptions("parent").ownerDocument)}g.getTooltip=function(b){b._tooltip||(b._tooltip=new g(b));return b._tooltip};g.prototype={_create:function(b){if(!this._tooltipDiv){var a=
this._tooltipDiv=h.createElement(b,"div");a.tabIndex=0;a.className="textviewTooltip";a.setAttribute("aria-live","assertive");a.setAttribute("aria-atomic","true");var f=this._tooltipContents=h.createElement(b,"div");a.appendChild(f);b.body.appendChild(a);var d=this;e.addEventListener(a,"mouseover",function(a){d._hideDelay&&(a=d._getWindow(),d._delayedHideTimeout&&(a.clearTimeout(d._delayedHideTimeout),d._delayedHideTimeout=null),d._hideTimeout&&(a.clearTimeout(d._hideTimeout),d._hideTimeout=null),
d._nextTarget=null)},!1);e.addEventListener(a,"mouseout",function(b){b=b.relatedTarget||b.toElement;!(b===a||d._hasFocus())&&(!b||!e.contains(a,b))&&d._hide()},!1);e.addEventListener(a,"keydown",function(a){27===a.keyCode&&d._hide()},!1);e.addEventListener(b,"mousedown",this._mouseDownHandler=function(b){d.isVisible()&&(e.contains(a,b.target||b.srcElement)||d._hide())},!0);this._view.addEventListener("Destroy",function(){d.destroy()});this._hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;
return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var b=this._tooltipDiv.parentNode;b&&b.removeChild(this._tooltipDiv);e.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var b=this._tooltipDiv;return!b?!1:e.contains(b,b.ownerDocument.activeElement)},hide:function(b){void 0===b&&(b=this._hideDelay);var a=this._getWindow();this._delayedHideTimeout&&(a.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null);var f=this;b?f._delayedHideTimeout=a.setTimeout(function(){f._delayedHideTimeout=null;f._hide();f.setTarget(f._nextTarget,0)},b):(f._hide(),f.setTarget(f._nextTarget,0))},_hide:function(){var b=this._tooltipDiv;b&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),b.style.visibility="hidden",b=this._getWindow(),this._showTimeout&&(b.clearTimeout(this._showTimeout),
this._showTimeout=null),this._delayedHideTimeout&&(b.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(b.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(b.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(b,a,f){if(this.isVisible())this._hasFocus()||(this._nextTarget=b,this.hide(f));else if(this._target=b){var d=
this;b=d._getWindow();d._showTimeout&&(b.clearTimeout(d._showTimeout),d._showTimeout=null);0===a?d.show(!0):d._showTimeout=b.setTimeout(function(){d._showTimeout=null;d.show(!0)},a?a:d._showDelay)}},show:function(b){if(this._target){var a=this._target.getTooltipInfo();if(a){var f=this._tooltipDiv,d=this._tooltipContents;f.style.left=f.style.right=f.style.width=f.style.height=d.style.width=d.style.height="auto";var e=a.contents;e instanceof Array&&(e=this._getAnnotationContents(e));if("string"===typeof e)d.innerHTML=
e;else if(this._isNode(e))d.appendChild(e);else if(e instanceof k.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=d;var l=h.themeClass;l?((l=l.replace("tooltipTheme",""))&&(l=" "+l),l="tooltipTheme"+l):l="tooltipTheme";h.themeClass=l;h=this._contentsView=new n.TextView(h);h.addEventListener("LineStyle",function(a){g.onLineStyle(a)});h.setModel(e);e=h.computeSize();d.style.width=e.width+"px";d.style.height=e.height+"px";h.resize()}else return;d=f.ownerDocument.documentElement;
"right"===a.anchor?(e=d.clientWidth-a.x,f.style.right=e+"px"):(e=parseInt(this._getNodeStyle(f,"padding-left","0"),10),e+=parseInt(this._getNodeStyle(f,"border-left-width","0"),10),e=a.x-e,f.style.left=e+"px");f.style.maxWidth=d.clientWidth-e-10+"px";e=parseInt(this._getNodeStyle(f,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(f,"border-top-width","0"),10);e=a.y-e;f.style.top=e+"px";f.style.maxHeight=d.clientHeight-e-10+"px";f.style.opacity="1";f.style.visibility="visible";if(b){var m=this,
v=this._getWindow();m._hideTimeout=v.setTimeout(function(){m._hideTimeout=null;var a=parseFloat(m._getNodeStyle(f,"opacity","1"));m._fadeTimeout=v.setInterval(function(){"visible"===f.style.visibility&&0<a?(a-=0.1,f.style.opacity=a):m._hide()},m._fadeDelay/10)},m._autoHideDelay)}}}},_getAnnotationContents:function(b){function a(a,d){var b=x.getLineStart(x.getLineAtOffset(a)),f=x.getLineEnd(x.getLineAtOffset(d),!0);return x.getText(b,f)}function f(d){var b=d.title,f=h.createElement(m,"div");f.className=
"tooltipRow";d.html&&(f.innerHTML=d.html,f.lastChild&&e.addEventListener(f.lastChild,"click",function(a){a=d.start;var b=d.end;v.getBaseModel&&(a=v.mapOffset(a,!0),b=v.mapOffset(b,!0));n.setSelection(a,b,1/3,function(){u._hide()})},!1),f.appendChild(m.createTextNode("\u00a0")));b||(b=a(d.start,d.end));"function"===typeof b&&(b=d.title());if("string"===typeof b){var g=h.createElement(m,"span");g.appendChild(m.createTextNode(b));b=g}f.appendChild(b);return f}for(var d,g=[],q=0;q<b.length;q++)d=b[q],
""!==d.title&&!d.groupAnnotation&&g.push(d);b=g;if(0===b.length)return null;var u=this,m=this._tooltipDiv.ownerDocument,n=this._view,v=n.getModel(),x=v.getBaseModel?v.getBaseModel():v;if(1===b.length){d=b[0];if(void 0!==d.title)return d=f(d),d.firstChild&&((b=d.firstChild.className)&&(b+=" "),d.firstChild.className=b+"single"),d;b=new k.ProjectionTextModel(x);g=x.getLineStart(x.getLineAtOffset(d.start));q=x.getCharCount();d.end!==q&&b.addProjection({start:d.end,end:q});0<g&&b.addProjection({start:0,
end:g});return b}g=h.createElement(m,"div");d=h.createElement(m,"em");d.appendChild(m.createTextNode(l.multipleAnnotations));g.appendChild(d);for(q=0;q<b.length;q++)d=b[q],(d=f(d))&&g.appendChild(d);return g},_getNodeStyle:function(b,a,f){var d;if(b&&(d=b.style[a],!d))if(b.currentStyle){for(d=0;-1!==(d=a.indexOf("-",d));)a=a.substring(0,d)+a.substring(d+1,d+2).toUpperCase()+a.substring(d+2);d=b.currentStyle[a]}else d=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(a):null;
return d||f},_isNode:function(b){return"object"===typeof Node?b instanceof Node:b&&"object"===typeof b&&"number"===typeof b.nodeType&&"string"===typeof b.nodeName}};return{Tooltip:g}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(l,n){function m(){}function k(a,b,f){this.start=a;this.end=b;this._projectionModel=f;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(a,b){var f=a.lastIndexOf("."),f=a.substring(f+1),e={title:l[f],style:{styleClass:"annotation "+f},html:"\x3cdiv class\x3d'annotationHTML "+f+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+f}};b?e.lineStyle=
{styleClass:"annotationLine "+f}:e.rangeStyle={styleClass:"annotationRange "+f};m.registerType(a,e)}function h(){}function g(a,b,f,e,g){var h;void 0===e&&(e=-1);void 0===g&&(g=a.length);for(;1<g-e;)if(h=Math.floor((g+e)/2),b<=a[h].start)g=h;else if(f&&b<a[h].end){g=h;break}else e=h;return g}function b(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function a(a,b){this._view=a;this._annotationModel=b;var f=this;this._listener={onDestroy:function(a){f._onDestroy(a)},
onLineStyle:function(a){f._onLineStyle(a)},onChanged:function(a){f._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}k.prototype={_expandedHTML:"\x3cdiv class\x3d'annotationHTML expanded'\x3e\x3c/div\x3e",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"\x3cdiv class\x3d'annotationHTML collapsed'\x3e\x3c/div\x3e",_collapsedStyle:{styleClass:"annotation collapsed"},
_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_collapseImpl:function(a){if(this._collapse()){a&&this._forEachOverlaping(function(a){a.expanded||
(a._expandImpl(!1),a._recollapse=!0)});a=this._projectionModel;var b=a.getBaseModel();this._projection={annotation:this,start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},_expandImpl:function(a){this._expand()&&(this._projectionModel._removeProjection(this._projection,!this._annotationModel),a&&this._forEachOverlaping(function(a){a._recollapse&&(a._collapseImpl(!1),a._recollapse=!1)}))},_forEachOverlaping:function(a){if(this._annotationModel)for(var b=
this._annotationModel.getAnnotations(this.start,this.end);b.hasNext();){var f=b.next();f!==this&&f.type===m.ANNOTATION_FOLDING&&a.call(this,f)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};m.ANNOTATION_ERROR="orion.annotation.error";m.ANNOTATION_WARNING="orion.annotation.warning";m.ANNOTATION_TASK="orion.annotation.task";m.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";m.ANNOTATION_BOOKMARK="orion.annotation.bookmark";
m.ANNOTATION_FOLDING="orion.annotation.folding";m.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";m.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";m.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";m.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";m.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";m.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";m.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";m.ANNOTATION_SELECTED_LINKED_GROUP=
"orion.annotation.selectedLinkedGroup";m.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";m.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";m.ANNOTATION_BLAME="orion.annotation.blame";m.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var f={};m.registerType=function(a,b){var e=b;"function"!==typeof e&&(e=function(a,d,b){this.start=a;this.end=d;void 0!==b&&(this.title=b)},e.prototype=b);e.prototype.type=a;f[a]=e;return a};m.createAnnotation=function(a,b,f,e){return new (this.getType(a))(b,
f,e)};m.getType=function(a){return f[a]};e(m.ANNOTATION_ERROR);e(m.ANNOTATION_WARNING);e(m.ANNOTATION_TASK);e(m.ANNOTATION_BREAKPOINT);e(m.ANNOTATION_BOOKMARK);e(m.ANNOTATION_CURRENT_BRACKET);e(m.ANNOTATION_MATCHING_BRACKET);e(m.ANNOTATION_CURRENT_SEARCH);e(m.ANNOTATION_MATCHING_SEARCH);e(m.ANNOTATION_READ_OCCURRENCE);e(m.ANNOTATION_WRITE_OCCURRENCE);e(m.ANNOTATION_SELECTED_LINKED_GROUP);e(m.ANNOTATION_CURRENT_LINKED_GROUP);e(m.ANNOTATION_LINKED_GROUP);e(m.ANNOTATION_CURRENT_LINE,!0);e(m.ANNOTATION_BLAME,
!0);e(m.ANNOTATION_CURRENT_BLAME,!0);m.registerType(m.ANNOTATION_FOLDING,k);h.addMixin=function(a){var b=h.prototype,f;for(f in b)b.hasOwnProperty(f)&&(a[f]=b[f])};h.prototype={addAnnotationType:function(a,b){this._annotationTypes||(this._annotationTypes=[]);var f=b-1;void 0==b||!(0<=f&&f<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(f,0,a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===
a)return b+1;return 0},getAnnotationsByType:function(a,b,f){a=a.getAnnotations(b,f);for(f=[];a.hasNext();)b=a.next(),0!==this.getAnnotationTypePriority(b.type)&&f.push(b);var e=this;f.sort(function(a,d){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(d.type)});return f},isAnnotationTypeVisible:function(a){return 0!==this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===
a){this._annotationTypes.splice(b,1);break}}};b.prototype={addAnnotation:function(a){if(a){var b=this._annotations,f=g(b,a.start);b.splice(f,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var f=this._annotations,e,g=0,h;h=void 0===a&&void 0===b?function(){return g<f.length?f[g++]:null}:function(){for(;g<f.length;){var e=f[g++];if(a===e.start||(a>e.start?a<e.end:e.start<b))return e;
if(e.start>=b)break}return null};e=h();return{next:function(){var a=e;a&&(e=h());return a},hasNext:function(){return null!==e}}},modifyAnnotation:function(a){if(a&&!(0>this._getAnnotationIndex(a)))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,f,e;if(a){f=[];for(e=b.length-1;0<=e;e--){var g=b[e];g.type===a&&(b.splice(e,1),f.splice(0,0,g),g._annotationModel=null)}}else f=b;this.onChanged({type:"Changed",
removed:f,added:[],changed:[]})},removeAnnotation:function(a){if(a){var b=this._getAnnotationIndex(a);0>b||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,b){var f=this._annotations,e,h,k,l=[];if(a)for(e=a.length-1;0<=e;e--)k=a[e],h=this._getAnnotationIndex(k),0>h||(k._annotationModel=null,f.splice(h,1),l.splice(0,0,k));b||(b=[]);for(e=0;e<b.length;e++)k=b[e],h=g(f,k.start),k._annotationModel=
this,f.splice(h,0,k);this.onChanged({type:"Changed",removed:l,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_getAnnotationIndex:function(a){for(var b=this._annotations,f=g(b,a.start);f<b.length&&b[f].start===a.start;){if(b[f]===a)return f;f++}return-1},_onChanged:function(a){var b=a.start,f=a.addedCharCount,e=a.removedCharCount,g=this._annotations,
h=b+e;if(0<g.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};f-=e;for(e=0;e<g.length;e++){var k=g[e];k.start>=h?(k._oldStart=k.start,k._oldEnd=k.end,k.start+=f,k.end+=f,a.changed.push(k)):k.end<=b||(k.start<b&&h<k.end?(k._oldStart=k.start,k._oldEnd=k.end,k.end+=f,a.changed.push(k)):(g.splice(e,1),a.removed.push(k),k._annotationModel=null,k.expand&&k.expand(),e--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};n.EventTarget.addMixin(b.prototype);
a.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+(" "+b.styleClass):b.styleClass;var f;b.tagName&&!a.tagName&&(a.tagName=b.tagName);if(b.style)for(f in a.style||
(a.style={}),b.style)a.style[f]||(a.style[f]=b.style[f]);if(b.attributes)for(f in a.attributes||(a.attributes={}),b.attributes)a.attributes[f]||(a.attributes[f]=b.attributes[f])}return a},_mergeStyleRanges:function(a,b){a||(a=[]);for(var f,e=g(a,b.start,!0);e<a.length&&b;e++){var h=a[e];if(b.end<=h.start)break;if(!(b.start>=h.end)){f=this._mergeStyle({},h.style);f=this._mergeStyle(f,b.style);var k=[];k.push(e,1);b.start<h.start&&k.push({start:b.start,end:h.start,style:b.style});b.start>h.start&&k.push({start:h.start,
end:b.start,style:h.style});k.push({start:Math.max(h.start,b.start),end:Math.min(h.end,b.end),style:f});b.end<h.end&&k.push({start:b.end,end:h.end,style:h.style});b=b.end>h.end?{start:h.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,k)}}b&&(f=this._mergeStyle({},b.style),a.splice(e,0,{start:b.start,end:b.end,style:f}));return a},_onAnnotationModelChanged:function(a){function b(a,d){h.getBaseModel&&(a=h.mapOffset(a,!0),d=h.mapOffset(d,!0));-1!==a&&-1!==d&&e.redrawRange(a,d)}function f(a,
d){for(var e=0;e<a.length;e++)if(g.isAnnotationTypeVisible(a[e].type)){var h=a[e];b(h.start,h.end);d&&(void 0!==h._oldStart&&h._oldEnd)&&b(h._oldStart,h._oldEnd)}}var e=this._view;if(e){var g=this,h=e.getModel();f(a.added);f(a.removed);f(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,f=a.textView.getModel(),e=b.getTextModel(),g=a.lineStart,h=a.lineStart+a.lineText.length;e!==f&&(g=f.mapOffset(g),h=f.mapOffset(h));for(b=b.getAnnotations(g,
h);b.hasNext();)if(g=b.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var h=g.start,k=g.end;e!==f&&(h=f.mapOffset(h,!0),k=f.mapOffset(k,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:k,style:g.rangeStyle})}g.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,g.lineStyle))}}};h.addMixin(a.prototype);return{FoldingAnnotation:k,AnnotationType:m,AnnotationTypeList:h,AnnotationModel:b,AnnotationStyler:a}});
define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(l,n,m,k,e,h){function g(a){a=a||{};this._domNode=a.domNode;this._model=a.model;this._undoStack=a.undoStack;this._statusReporter=a.statusReporter;this._title=null;var d=this;this._listener={onChanged:function(a){d.onChanged(a)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function b(a){a=a||{};g.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var a=k.AnnotationType;g.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(a,d){return this.getModel().getText(a,d)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(a){this.checkDirty()},reportStatus:function(a,d,b){this._statusReporter&&this._statusReporter(a,d,b)},resize:function(){},setDirty:function(a){this._dirty!==a&&(this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"}))},
_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,d,b,e){this._title=a;e||(d?this.reportStatus(d,"error"):null!==b&&(void 0!==b&&"string"===typeof b)&&this._setModelText(b),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:d,contents:b,contentsSaved:e})},setText:function(a,d,b){this.getModel().setText(a,d,b)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(g.prototype);b.prototype=new g;
e.mixin(b.prototype,{destroy:function(){g.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,d){if(this._annotationRulerVisible!==a||d)if(this._annotationRulerVisible=a,this._annotationRuler){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,d){if(this._foldingRulerVisible!==a||d)if(this._foldingRulerVisible=
a,this._foldingRuler){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler):b.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,d){if(this._lineNumberRulerVisible!==a||d)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var b=this._textView;a?b.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,d){if(this._overviewRulerVisible!==a||d)if(this._overviewRulerVisible=
a,this._overviewRuler){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,d){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,d));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,d=a.getSelection(),
a=a.getModel();a.getBaseModel&&(d.start=a.mapOffset(d.start),d.end=a.mapOffset(d.end));return d},_expandOffset:function(b){var d=this._textView.getModel(),e=this._annotationModel;if(e&&d.getBaseModel)for(b=e.getAnnotations(b,b+1);b.hasNext();)d=b.next(),d.type===a.ANNOTATION_FOLDING&&d.expand&&d.expand()},setCaretOffset:function(a,d,b){var e=this._textView,g=e.getModel();g.getBaseModel&&(this._expandOffset(a),a=g.mapOffset(a,!0));e.setCaretOffset(a,d,b)},setText:function(a,d,b){var e=this._textView,
g=e.getModel();g.getBaseModel&&(void 0!==d&&(this._expandOffset(d),d=g.mapOffset(d,!0)),void 0!==b&&(this._expandOffset(b),b=g.mapOffset(b,!0)));e.setText(a,d,b)},setSelection:function(a,d,b,e){var g=this._textView,h=g.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(d),a=h.mapOffset(a,!0),d=h.mapOffset(d,!0));g.setSelection(a,d,b,e)},moveSelection:function(a,d,b,e){var g=this._textView;this.setSelection(a,d||a,1/3,function(){(void 0===e||e)&&g.focus();b&&b()})},_getTooltipInfo:function(a,
d){var b=this._textView,e=this.getAnnotationModel();if(!e)return null;var g=this._annotationStyler;if(!g)return null;var h=b.getOffsetAtLocation(a,d);if(-1===h)return null;h=this.mapOffset(h);g=g.getAnnotationsByType(e,h,h+1);e=[];for(h=0;h<g.length;h++)g[h].rangeStyle&&e.push(g[h]);if(0===e.length)return null;b=b.convert({x:a,y:d},"document","page");return{contents:e,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(b,d){var e=this._annotationModel;if(e){var g=this._textView;if(!g.getOptions("singleMode")){var h=
g.getModel(),k=d?h.getLineAtOffset(d.start):-1,l=h.getLineAtOffset(b.start),g=b.start===b.end,m=!d||d.start===d.end,n=h.getLineStart(l),s=h.getLineEnd(l);h.getBaseModel&&(n=h.mapOffset(n),s=h.mapOffset(s));h=this._currentLineAnnotation;if(!(k===l&&m&&g&&h&&h.start===n&&h.end===s)){var k=h?[h]:null,w;g&&(h=a.createAnnotation(a.ANNOTATION_CURRENT_LINE,n,s),w=[h]);this._currentLineAnnotation=h;e.replaceAnnotations(k,w)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var b=this,d=this._textView,e=this;this._listener={onModelChanged:function(a){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var b=
m.Tooltip.getTooltip(d);b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY)&&(e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,b.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var b=m.Tooltip.getTooltip(d);b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY)&&(e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,
b.setTarget(null))},onScroll:function(a){(a=m.Tooltip.getTooltip(d))&&a.setTarget(null,0,0)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,a.oldValue)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("MouseOver",this._listener.onMouseOver);d.addEventListener("MouseOut",this._listener.onMouseOut);d.addEventListener("MouseMove",this._listener.onMouseMove);d.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var h;if(h="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(b,this._undoStack,this._contentAssist))this._textActions=h.textActions,this._linkedMode=h.linkedMode,this._sourceCodeActions=h.sourceCodeActions}h=function(d,e){if(void 0!==d&&-1!==d){for(var g=this.getView().getModel(),h=this.getAnnotationModel(),k=b.mapOffset(g.getLineStart(d)),
g=b.mapOffset(g.getLineEnd(d)),l=h.getAnnotations(k,g),p=null;l.hasNext();){var q=l.next();if(q.type===a.ANNOTATION_BOOKMARK){p=q;break}}p?h.removeAnnotation(p):(p=a.createAnnotation(a.ANNOTATION_BOOKMARK,k,g),p.title=void 0,h.addAnnotation(p))}};if(this._annotationFactory){var k=d.getModel();k.getBaseModel&&(k=k.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(k))if(k=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))k.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),
k.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_LINE),k.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_SELECTED_LINKED_GROUP),k.addAnnotationType(a.ANNOTATION_CURRENT_LINKED_GROUP),k.addAnnotationType(a.ANNOTATION_LINKED_GROUP),
k.addAnnotationType("orion.annotation.highlightError");var k=this._annotationFactory.createAnnotationRulers(this._annotationModel),l=this._annotationRuler=k.annotationRuler;l&&(l.onDblClick=h,l.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),l.addAnnotationType(a.ANNOTATION_ERROR),l.addAnnotationType(a.ANNOTATION_WARNING),l.addAnnotationType(a.ANNOTATION_TASK),l.addAnnotationType(a.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(l=this._overviewRuler=k.overviewRuler)l.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),l.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),l.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),l.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),l.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),l.addAnnotationType(a.ANNOTATION_ERROR),l.addAnnotationType(a.ANNOTATION_WARNING),l.addAnnotationType(a.ANNOTATION_TASK),l.addAnnotationType(a.ANNOTATION_BOOKMARK),l.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),
l.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),l.addAnnotationType(a.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=h,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
void 0===this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(a.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:d});g.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;a&&(a.destroy(),
this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),
g.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var a=this.getModel(),d=this.getCaretOffset(),b=a.getLineAtOffset(d),a=a.getLineStart(b),d=d-a,a=this.getKeyModes(),e=0;e<a.length;e++){var g=a[e];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(h.formatMessage(l.lineColumn,b+1,d+1))},showAnnotations:function(b,d,e,g){var h=this._annotationModel;if(h){for(var k=[],l=[],m=h.getTextModel(),n=h.getAnnotations(),s;n.hasNext();)s=n.next(),-1!==d.indexOf(s.type)&&
s.creatorID===this&&k.push(s);if(b)for(d=0;d<b.length;d++)if(s=b[d]){if(e)s=e(s);else{var w;"number"===typeof s.line?(w=m.getLineStart(s.line-1),n=w+s.start-1,w=w+s.end-1):(n=s.start,w=s.end);var z=g(s);if(!z)continue;s=a.createAnnotation(z,n,w,s.description)}s.creatorID=this;l.push(s)}h.replaceAnnotations(k,l)}},showProblems:function(b){this.showAnnotations(b,[a.ANNOTATION_ERROR,a.ANNOTATION_WARNING,a.ANNOTATION_TASK],null,function(d){switch(d.severity){case "error":return a.ANNOTATION_ERROR;case "warning":return a.ANNOTATION_WARNING;
case "task":return a.ANNOTATION_TASK}return null})},showOccurrences:function(b){this.showAnnotations(b,[a.ANNOTATION_READ_OCCURRENCE,a.ANNOTATION_WRITE_OCCURRENCE],null,function(d){return d.readAccess?a.ANNOTATION_READ_OCCURRENCE:a.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(b){var d=this._blameRGB,g=this.getTextView().getOptions("parent").ownerDocument;if(!d){var q=h.createElement(g,"div");q.className="annotation blame";g.body.appendChild(q);var m=(g.defaultView||g.parentWindow).getComputedStyle(q).getPropertyValue("background-color");
q.parentNode.removeChild(q);var q=m.indexOf("("),t=m.indexOf(")"),m=m.substring(q+1,t);this._blameRGB=d=m.split(",").slice(0,3)}var n=function(){var a=k.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=e.mixin({},a.style);a.style.style=e.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},v=function(){var a=h.createElement(g,"div");a.className="tooltipTitle";var d=
this.blame.Message.indexOf("\n");-1===d&&(d=this.blame.Message.length);var b=h.createElement(g,"a");b.href=this.blame.CommitLink;b.appendChild(g.createTextNode(this.blame.Message.substring(0,d)));a.appendChild(b);a.appendChild(h.createElement(g,"br"));a.appendChild(g.createTextNode(h.formatMessage(l.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},x=this.getModel();this.showAnnotations(b,[a.ANNOTATION_BLAME,a.ANNOTATION_CURRENT_BLAME],function(b){var f=x.getLineStart(b.Start-1),
g=x.getLineEnd(b.End-1,!0),f=k.AnnotationType.createAnnotation(a.ANNOTATION_BLAME,f,g,v),g=d.slice(0);g.push(b.Shade);f.style=e.mixin({},f.style);f.style.style=e.mixin({},f.style.style);f.style.style.backgroundColor="rgba("+g.join()+")";f.groupId=b.Name;f.groupType=a.ANNOTATION_CURRENT_BLAME;f.createGroupAnnotation=n;f.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+b.AuthorImage+'"/\x3e';f.blame=b;return f})},showSelection:function(a,d,b,e,g){"number"===typeof a?("number"!==typeof d&&(d=
a),this.moveSelection(a,d)):"number"===typeof b&&(a=this.getModel().getLineStart(b-1),"number"===typeof e&&(a+=e),"number"!==typeof g&&(g=0),this.moveSelection(a,a+g))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,d,b,e,h){g.prototype.setInput.call(this,a,d,b,e);this._textView&&(!e&&!h)&&this._textView.focus()},onGotoLine:function(a,d,b,e){if(this._textView){var g=
this.getModel();a=Math.max(0,Math.min(a,g.getLineCount()-1));var h=g.getLineStart(a),k=0;void 0===b&&(b=0);"string"===typeof d?(a=g.getLine(a).indexOf(d),-1!==a&&(k=a,b=k+d.length)):(k=d,d=g.getLineEnd(a)-h,k=Math.min(k,d),b=Math.min(b,d));this.moveSelection(h+k,h+b,e)}}});return{BaseEditor:g,Editor:b}});
define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(l,n,m,k,e,h,g){function b(a){var b=a.getTextView();m.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var f=this;this._listener={onVerify:function(a){var d=f.editor,b=d.getModel(),g=d.mapOffset(a.start),d=d.mapOffset(a.end),b=b.getText(g,d);if((b=f._prefix.match(RegExp("^"+e.escape(b),"i")))&&0<b.length)f._prefix+=a.text,f._success=!0,f._status(),f.find(f._forward,!0),a.text=null},onSelection:function(){f._ignoreSelection||f.setActive(!1)}}}function a(a,b,f){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var e=this;this._listeners={onEditorFocus:function(a){e._removeCurrentAnnotation(a)}};this.setOptions(f)}}var f={};b.prototype=new m.KeyMode;h.mixin(b.prototype,{createKeyBindings:function(){var a=n.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var f=this._prefix;if(0===f.length)return!1;var e=this.editor,g=e.getModel(),g=a?this._success?b?this._start:e.getCaretOffset()+
1:0:this._success?b?this._start:e.getCaretOffset():g.getCharCount()-1;(f=e.getModel().find({string:f,start:g,reverse:!a,caseInsensitive:f.toLowerCase()===f}).next())?(b||(this._start=g),this._ignoreSelection=this._success=!0,e.moveSelection(a?f.start:f.end,a?f.end:f.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?l.incrementalFindStr:l.incrementalFindStrNotFound:this._success?l.incrementalFindReverseStr:l.incrementalFindReverseStrNotFound;a=g.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
f.IncrementalFind=b;a.prototype={find:function(a,b,f){this.setOptions({reverse:!a});var e=this.getFindString(),g;b&&(e=b.findString||e,g=b.count);a=this.getOptions();this.setOptions(b);b=f?this._startOffset:this.getStartOffset();if((g=this._doFind(e,b,g))&&!f)this._startOffset=g.start;this.setOptions(a);this._hideAfterFind&&this.hide();return g},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=e.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",f=!1,e=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var h=a.substring(g,g+1);if(f){switch(h){case "R":b+=e;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+h}f=!1}else"\\"===h?f=!0:b+=h}f&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,f=this._processReplaceString(this.getReplaceString()),e=b.getSelection().start;if(b=b.getModel().find({string:a,start:e,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,f),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,f=b.getTextView();b.reportStatus(l.replacingAll);var e=this._processReplaceString(this.getReplaceString()),h=this;window.setTimeout(function(){for(var k=0,m=0;;){var n=h._doFind(a,k,null,!0);if(!n)break;m++;1===m&&(f.setRedraw(!1),h.startUndo());h._doReplace(n.start,n.end,a,e);k=h.getStartOffset()}0<
m&&(h.endUndo(),f.setRedraw(!0));0<k?b.reportStatus(g.formatMessage(l.replacedMatches,m)):b.reportStatus(l.nothingReplaced,"error");h._replacingAll=!1},100)}},setOptions:function(a){if(a){if((!0===a.showAll||!1===a.showAll)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===a.caseInsensitive||!1===a.caseInsensitive)this._caseInsensitive=
a.caseInsensitive;if(!0===a.wrap||!1===a.wrap)this._wrap=a.wrap;if(!0===a.wholeWord||!1===a.wholeWord)this._wholeWord=a.wholeWord;if(!0===a.incremental||!1===a.incremental)this._incremental=a.incremental;if(!0===a.regex||!1===a.regex)this._regex=a.regex;if(!0===a.findAfterReplace||!1===a.findAfterReplace)this._findAfterReplace=a.findAfterReplace;if(!0===a.hideAfterFind||!1===a.hideAfterFind)this._hideAfterFind=a.hideAfterFind;if(!0===a.reverse||!1===a.reverse)this._reverse=a.reverse;a.hasOwnProperty("findCallback")&&
(this._findCallback=a.findCallback);a.hasOwnProperty("start")&&(this._start=a.start);a.hasOwnProperty("end")&&(this._end=a.end)}},show:function(a){this._visible=!0;a&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(a));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,b,f){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:f?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,f,e){f=f||1;var g=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,m;if(this._regex)try{m=this._find(a,b,e)}catch(n){g.reportStatus(n.message,
"error");return}else m=this._find(a,b,e);for(a=0;a<f&&m.hasNext();a++)h=m.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(l.notFound,"error");if(this.isVisible()){f=k.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(m=g.getAnnotationModel())m.removeAnnotations(f),h&&m.addAnnotation(k.AnnotationType.createAnnotation(f,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var s=this;this._timer=window.setTimeout(function(){s._markAllOccurrences();
s._timer=null},500)}}this._findCallback?this._findCallback(h):h&&g.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,f,e){var g=this._editor;this._regex&&(e=g.getText(a,b).replace(RegExp(f,this._caseInsensitive?"i":""),e));g.setText(e,a,b);g.setSelection(a,a+e.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=k.AnnotationType.ANNOTATION_MATCHING_SEARCH,f=a.getAnnotations(),e=[],g;f.hasNext();){var h=f.next();h.type===b&&e.push(h)}if(this.isVisible()){f=
this.getFindString();f=this._editor.getModel().find({string:f,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(g=[];f.hasNext();)h=f.next(),g.push(k.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(e,g)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(a){(a=
this._editor.getAnnotationModel())&&a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};f.Find=a;return f});
define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(l,n,m,k,e){function h(e,b,a){n.Find.call(this,e,b,a)}h.prototype=new n.Find;m.mixin(h.prototype,{getFindString:function(){var e=this._findInput;return!e?n.Find.prototype.getFindString.call(this):e.value},getReplaceString:function(){var e=this._replaceInput;return!e?n.Find.prototype.getReplaceString(this):e.value},hide:function(){var e=this.isVisible();n.Find.prototype.hide.call(this);
e&&(this._rootDiv.className="textViewFind")},show:function(e){n.Find.prototype.show.call(this,e);var b=e.findString;e=e.replaceString;var a=this._findInput;a||(this._create(),a=this._findInput);b&&(a.value=b);e&&(this._replaceInput.value=e);var f=this;window.setTimeout(function(){f._rootDiv.className="textViewFind show";a.select();a.focus()},0)},_create:function(){var g=this,b=this._editor.getTextView(),a=b.getOptions("parent").ownerDocument,f=e.createElement(a,"div");f.className="textViewFind";k.addEventListener(f,
"keydown",function(a){g._handleKeyDown(a)});this._rootDiv=f;this._createContents(a,f);b._rootDiv.insertBefore(f,b._rootDiv.firstChild)},_createContents:function(g,b){var a=this,f=e.createElement(g,"input");f.className="textViewFindInput";this._findInput=f;f.type="text";f.placeholder=l.findWith;k.addEventListener(f,"input",function(d){return a._handleInput(d)});b.appendChild(f);f=e.createElement(g,"span");a._createButton(g,f,l.next,function(){a.find(!0)});a._createButton(g,f,l.previous,function(){a.find(!1)});
b.appendChild(f);a._editor.getTextView().getOptions("readonly")||(f=e.createElement(g,"input"),f.className="textViewReplaceInput",this._replaceInput=f,f.type="text",f.placeholder=l.replaceWith,b.appendChild(f),f=e.createElement(g,"span"),a._createButton(g,f,l.replace,function(){a.replace()}),a._createButton(g,f,l.replaceAll,function(){a.replaceAll()}),b.appendChild(f));f=e.createElement(g,"span");a._createButton(g,f,l.regex,function(d){a._toggle("regex",d.target)},this._regex,l.regexTooltip);a._createButton(g,
f,l.caseInsensitive,function(d){a._toggle("caseInsensitive",d.target)},this._caseInsensitive,l.caseInsensitiveTooltip);a._createButton(g,f,l.wholeWord,function(d){a._toggle("wholeWord",d.target)},this._wholeWord,l.wholeWordTooltip);b.appendChild(f);f=a._createButton(g,b,"",function(){a.hide()});f.className="textViewFindCloseButton";f.title=l.closeTooltip},_createButton:function(e,b,a,f,d,h){var l=e.createElement("button");this._checked(d,l);h&&(l.title=h);k.addEventListener(l,"click",function(a){f.call(this,
a)},!1);a&&l.appendChild(e.createTextNode(a));b.appendChild(l);return l},_toggle:function(e,b){var a={};a[e]=!this["_"+e];this.setOptions(a);this._checked(a[e],b)},_checked:function(e,b){b.className="textViewFindButton";e&&(b.className+=" checked")},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(g){var b,a=(e.isMac?g.metaKey:g.ctrlKey)&&!g.altKey&&!g.shiftKey;a&&70===g.keyCode&&(b=!0);if((e.isMac?g.metaKey:g.ctrlKey)&&!g.altKey&&75===g.keyCode||
13===g.keyCode)13===g.keyCode?this.find(this._reverse?g.shiftKey:!g.shiftKey):this.find(!g.shiftKey),b=!0;a&&82===g.keyCode&&(this.replace(),b=!0);27===g.keyCode&&(this.hide(),b=!0);return b?(g.stopPropagation&&g.stopPropagation(),g.preventDefault&&g.preventDefault(),g.cancelBubble=!0,!1):!0}});return{FindUI:h}});
define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/editor/findUI orion/util".split(" "),function(l,n,m,k,e,h,g){function b(a,d,b){this.editor=a;this.undoStack=d;this._incrementalFind=new e.IncrementalFind(a);this._find=b?b:new h.FindUI(a,d);this._lastEditLocation=null;this.init()}function a(a,d,b,f){this.editor=a;this.undoStack=d;this.contentAssist=b;this.linkedMode=f;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var f=m.AnnotationType,d={};b.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var d=1;a&&a.count&&(d=a.count);for(;0<d;)this.undoStack.undo(),--d;return!0}return!1}.bind(this),
{name:l.undo});a.setAction("redo",function(a){if(this.undoStack){var d=1;a&&a.count&&(d=a.count);for(;0<d;)this.undoStack.redo(),--d;return!0}return!1}.bind(this),{name:l.redo});a.setKeyBinding(new n.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();this._find.show({findString:this.editor.getText(a.start,a.end)});return!0}return!1}.bind(this),{name:l.find});a.setKeyBinding(new n.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
(this._find.find(!0,a),!0):!1}.bind(this),{name:l.findNext});a.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:l.findPrevious});a.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:l.incrementalFind});a.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:l.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:l.unindentLines});a.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:l.moveLinesUp});a.setKeyBinding(new n.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:l.moveLinesDown});a.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:l.copyLinesUp});a.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:l.copyLinesDown});a.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:l.deleteLines});a.setKeyBinding(new n.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:l.gotoLine});a.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:l.nextAnnotation});a.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:l.prevAnnotation});a.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:l.expand});a.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:l.collapse});a.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:l.expandAll});a.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:l.collapseAll});a.setKeyBinding(new n.KeyBinding("q",!g.isMac,!1,!1,g.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:l.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var d=a.getModel(),b=a.getSelection(),f=d.getLineAtOffset(b.start),b=d.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=d.getLineStart(f),f=d.getLineEnd(b,!0),g=d.getLineCount(),h="",e=d.getText(e,f);b===g-1&&(e=(h=d.getLineDelimiter())+e);a.setText(e,f,f);a.setSelection(f+h.length,f+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var d=a.getModel(),b=a.getSelection(),f=d.getLineAtOffset(b.start),b=d.getLineAtOffset(b.end>b.start?b.end-
1:b.end),f=d.getLineStart(f),e=d.getLineEnd(b,!0),g=d.getLineCount(),h="",e=d.getText(f,e);b===g-1&&(e+=h=d.getLineDelimiter());a.setText(e,f,f);a.setSelection(f,f+e.length-h.length);return!0},deleteLines:function(a){var d=this.editor;if(d.getTextView().getOptions("readonly"))return!1;var b=1;a&&a.count&&(b=a.count);var f=d.getSelection(),e=d.getModel(),g=e.getLineAtOffset(f.start);a=e.getLineStart(g);b=f.start!==f.end||1===b?e.getLineAtOffset(f.end>f.start?f.end-1:f.end):Math.min(g+b-1,e.getLineCount()-
1);b=e.getLineEnd(b,!0);d.setText("",a,b);return!0},expandAnnotation:function(a){var d=this.editor,b=d.getAnnotationModel();if(!b)return!0;var f=d.getModel(),e=d.getCaretOffset(),g=f.getLineAtOffset(e),e=f.getLineStart(g),g=f.getLineEnd(g,!0);f.getBaseModel&&(e=f.mapOffset(e),g=f.mapOffset(g),f.getBaseModel());for(var h,b=b.getAnnotations(e,g);!h&&b.hasNext();)f=b.next(),f.type===m.AnnotationType.ANNOTATION_FOLDING&&(h=f);h&&a!==h.expanded&&(a?h.expand():(d.setCaretOffset(h.start),h.collapse()));
return!0},expandAnnotations:function(a){var d=this.editor,b=d.getTextView(),d=d.getAnnotationModel();if(!d)return!0;var f=d.getAnnotations();for(b.setRedraw(!1);f.hasNext();)d=f.next(),d.type===m.AnnotationType.ANNOTATION_FOLDING&&a!==d.expanded&&(a?d.expand():d.collapse());b.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,d=a.getTextView();if(d.getOptions("readonly"))return!1;if(d.getOptions("tabMode")){var b=a.getModel(),f=a.getSelection(),e=b.getLineAtOffset(f.start),g=b.getLineAtOffset(f.end>
f.start?f.end-1:f.end);if(e!==g){var h=[];h.push("");for(var k=e;k<=g;k++)h.push(b.getLine(k,!0));k=b.getLineStart(e);b=b.getLineEnd(g,!0);d=d.getOptions("tabSize","expandTab");d=d.expandTab?Array(d.tabSize+1).join(" "):"\t";a.setText(h.join(d),k,b);a.setSelection(k===f.start?f.start:f.start+d.length,f.end+(g-e+1)*d.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,
d=a.getModel().getLineAtOffset(a.getCaretOffset());if(d=prompt(l.gotoLinePrompty,d+1))d=parseInt(d,10),a.onGotoLine(d-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var d=a.getModel(),b=a.getSelection(),f=d.getLineAtOffset(b.start),e=d.getLineAtOffset(b.end>b.start?b.end-1:b.end),g=d.getLineCount();if(e===g-1)return!0;var f=d.getLineStart(f),b=d.getLineEnd(e,!0),h=d.getLineEnd(e+1,!0)-(b-f),k=0;e!==g-2?d=d.getText(f,b):(e=d.getLineEnd(e),
d=d.getText(e,b)+d.getText(f,e),k+=b-e);this.startUndo();a.setText("",f,b);a.setText(d,h,h);a.setSelection(h+k,h+k+d.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var d=a.getModel(),b=a.getSelection(),f=d.getLineAtOffset(b.start);if(0===f)return!0;var e=d.getLineAtOffset(b.end>b.start?b.end-1:b.end),g=d.getLineCount(),b=d.getLineStart(f-1),h=d.getLineStart(f),k=d.getLineEnd(e,!0),l=d.getText(h,k),m=0;e===g-1&&(e=d.getLineEnd(f-
1),f=d.getLineEnd(f-1,!0),l+=d.getText(e,f),h=e,m=f-e);this.startUndo();a.setText("",h,k);a.setText(l,b,b);a.setSelection(b,b+l.length-m);this.endUndo();return!0},nextAnnotation:function(a){function d(a){return!!a.lineStyle||a.type===f.ANNOTATION_MATCHING_BRACKET||a.type===f.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var g=b.getOverviewRuler()||b.getAnnotationStyler();if(!g)return!0;for(var h=b.getModel(),l=b.getCaretOffset(),
m=e.getAnnotations(a?l:0,a?h.getCharCount():l),n=null;m.hasNext();){var z=m.next();if(a){if(z.start<=l)continue}else if(z.start>=l)continue;if(!d(z)&&(n=z,a))break}if(n){for(var C=[n],m=e.getAnnotations(n.start,n.start);m.hasNext();)z=m.next(),z!==n&&!d(z)&&C.push(z);var r=b.getTextView(),A=h.getLineAtOffset(n.start),D=k.Tooltip.getTooltip(r);if(!D)return b.moveSelection(n.start),!0;b.moveSelection(n.start,n.start,function(){D.setTarget({getTooltipInfo:function(){var a=r.convert({x:r.getLocationAtOffset(n.start).x,
y:r.getLocationAtOffset(h.getLineStart(A)).y},"document","page");return{contents:C,x:a.x,y:a.y+Math.floor(1.33*r.getLineHeight(A))}}},0)})}return!0},unindentLines:function(){var a=this.editor,d=a.getTextView();if(d.getOptions("readonly"))return!1;if(d.getOptions("tabMode")){for(var b=a.getModel(),f=a.getSelection(),e=b.getLineAtOffset(f.start),g=b.getLineAtOffset(f.end>f.start?f.end-1:f.end),h=d.getOptions("tabSize"),k=Array(h+1).join(" "),l=[],m=d=0,n=e;n<=g;n++){var r=b.getLine(n,!0);if(b.getLineStart(n)!==
b.getLineEnd(n))if(0===r.indexOf("\t"))r=r.substring(1),d++;else if(0===r.indexOf(k))r=r.substring(h),d+=h;else return!0;n===e&&(m=d);l.push(r)}e=b.getLineStart(e);h=b.getLineEnd(g,!0);b=b.getLineStart(g);a.setText(l.join(""),e,h);g=e===f.start?f.start:f.start-m;f=Math.max(g,f.end-d+(f.end===b+1&&f.start!==f.end?1:0));a.setSelection(g,f);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.TextActions=
b;a.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:l.trimTrailingWhitespaces});a.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:l.toggleLineComment});a.setKeyBinding(new n.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:l.addBlockComment});a.setKeyBinding(new n.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:l.removeBlockComment});a.setKeyBinding(new n.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,d=a.getTextView();if(d.getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var f=a.getModel(),e=f.getLineAtOffset(b.start),
g=f.getLine(e,!1),h=f.getLineStart(e),k=0,l=b.start-h,m;k<l&&(32===(m=g.charCodeAt(k))||9===m);)k++;var h=g.substring(0,k),d=d.getOptions("tabSize","expandTab"),n=d.expandTab?Array(d.tabSize+1).join(" "):"\t",d=f.getLineDelimiter(),r=/^[\s]*\/\*[\*]*[\s]*$/,A=/^[\s]*\*/,D=/\*\/[\s]*$/,B=g.substring(0,l),E=g.substring(l),K;if(this.smartIndentation&&123===g.charCodeAt(K=B.trimRight().length-1))return f=l-K-1,E=E.length-E.trimLeft().length,g=125===g.charCodeAt(l+E)?d+h+n+d+h:d+h+n,a.setText(g,b.start-
f,b.end+E),a.setCaretOffset(b.start+d.length+h.length+n.length-f),!0;if(this.autoCompleteComments&&!D.test(B)&&(r.test(B)||A.test(B))){if(k=r.exec(B)){g=d+h+" * ";g=D.test(E)?g+E.substring(0,E.length-2).trim():g+E.trim();if(f.getLineCount()===e+1||!A.test(f.getLine(e+1)))g+=d+h+" */";a.setText(g,b.start,b.end+E.length);a.setCaretOffset(b.start+d.length+h.length+3);return!0}if(k=A.exec(B))for(e-=1;0<=e;e--){k=f.getLine(e,!1);if(r.test(k))return D.test(E)||47===g.charCodeAt(l)?(g=d+h+"*"+E,h=b.start+
d.length+h.length+1):(g=d+h+"* "+E,h=b.start+d.length+h.length+2),a.setText(g,b.start,b.end+E.length),a.setCaretOffset(h),!0;if(!A.test(k))break}}else{if(D.test(B)&&32===h.charCodeAt(h.length-1))return g=d+h.substring(0,h.length-1),a.setText(g,b.start,b.end),a.setCaretOffset(b.start+g.length),!0;if(0<k){for(k=l;k<g.length&&(32===(m=g.charCodeAt(k++))||9===m);)b.end++;a.setText(f.getLineDelimiter()+h,b.start,b.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var d=a.getModel(),b=a.getSelection(),f=this._findEnclosingComment(d,b.start,b.end);if(void 0!==f.commentStart&&void 0!==f.commentEnd)return!0;d=d.getText(b.start,b.end);if(0===d.length)return!0;var f=d.length,d=d.replace(/\/\*|\*\//g,""),e=d.length;a.setText("/*"+d+"*/",b.start,b.end);a.setSelection(b.start+2,b.end+2+(e-f));return!0},autoPairBrackets:function(a,d){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var f=b.getSelection(),e=b.getModel(),g=b.getCaretOffset()===e.getCharCount()?"":e.getText(f.start,f.start+1).trim(),h=/^$|[)}\]>]/;return f.start===f.end&&h.test(g)?(b.setText(a+d,f.start,f.start),b.setCaretOffset(f.start+1),!0):f.start!==f.end?(e=e.getText(f.start,f.end),b.setText(a+e+d,f.start,f.end),b.setSelection(f.start+1,f.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var d=this.editor;
if(d.getTextView().getOptions("readonly"))return!1;var b=d.getSelection(),f=d.getModel(),e=d.getCaretOffset(),g=0===e?"":f.getText(b.start-1,b.start).trim(),h=e===f.getCharCount()?"":f.getText(b.start,b.start+1).trim(),e=/^"$|^'$/,k=/\w/,l=/^$|[)}\]>]/;if(b.start!==b.end){f=f.getText(b.start,b.end);if(e.test(f))return!1;d.setText(a+f+a,b.start,b.end);d.setSelection(b.start+1,b.end+1)}else{if(h!==a){if(g===a||e.test(h)||k.test(g)||!l.test(h))return!1;d.setText(a+a,b.start,b.start)}d.setCaretOffset(b.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var d=[],b=0;b<a.positions.length;++b)d[b]={positions:[{offset:a.positions[b].offset,length:a.positions[b].length}]};this.linkedMode.enterLinkedMode({groups:d,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var d=a.getSelection();if(d.start!==d.end)return!1;var b=a.getModel(),f=a.getCaretOffset(),e=0===f?"":b.getText(d.start-1,d.start),b=f===b.getCharCount()?"":b.getText(d.start,d.start+1);("("===e&&")"===b||"["===e&&"]"===b||"{"===e&&"}"===b||"\x3c"===e&&"\x3e"===b||'"'===e&&'"'===b||"'"===e&&"'"===b)&&a.setText("",d.start,d.start+1);return!1},_findEnclosingComment:function(a,d,b){var f=a.getLineAtOffset(d),
e=a.getLineAtOffset(b),g,h,k,l,m,n;for(g=f;0<=g&&!(h=a.getLine(g),k=g===f?d-a.getLineStart(f):h.length,l=h.lastIndexOf("/*",k),h=h.lastIndexOf("*/",k),h>l);g--)if(-1!==l){m=a.getLineStart(g)+l;break}for(g=e;g<a.getLineCount()&&!(h=a.getLine(g),k=g===e?b-a.getLineStart(e):0,l=h.indexOf("/*",k),h=h.indexOf("*/",k),-1!==l&&l<h);g++)if(-1!==h){n=a.getLineStart(g)+h;break}return{commentStart:m,commentEnd:n}},lineStart:function(){for(var a=this.editor,d=a.getModel(),b=a.getCaretOffset(),f=d.getLineAtOffset(b),
e=d.getLineStart(f),d=d.getLine(f),f=0;f<d.length;f++){var g=d.charCodeAt(f);if(!(32===g||9===g))break}f+=e;return b!==f?(a.setSelection(f,f),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var d=a.getModel(),b=a.getSelection(),f=d.getText(b.start,b.end),e,g,h;for(h=0;h<f.length;h++)if("/*"===f.substring(h,h+2)){e=b.start+h;break}for(;h<f.length;h++)if("*/"===f.substring(h,h+2)){g=b.start+h;break}if(void 0!==e&&void 0!==g)a.setText(d.getText(e+
2,g),e,g+2),a.setSelection(e,g);else{f=this._findEnclosingComment(d,b.start,b.end);if(void 0===f.commentStart||void 0===f.commentEnd)return!0;d=d.getText(f.commentStart+2,f.commentEnd);a.setText(d,f.commentStart,f.commentEnd+2);a.setSelection(b.start-2,b.end-2)}return!0},toggleLineComment:function(){var a=this.editor,d=a.getTextView();if(d.getOptions("readonly"))return!1;for(var b=this.lineComment||"//",f=a.getModel(),e=a.getSelection(),g=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?
e.end-1:e.end),k=!0,l=[],m,n=g;n<=h;n++){var r=f.getLine(n,!0);m=r.indexOf(b);l.push(m);if(!k||-1===m)k=!1;else if(0!==m){for(k=0;k<m;k++){var A=r.charCodeAt(k);if(!(32===A||9===A))break}k=k===m}}n=b.length;r=f.getLineStart(g);d.setRedraw(!1);this.startUndo();if(k){for(k=l.length-1;0<=k;k--)m=l[k]+f.getLineStart(g+k),a.setText("",m,m+n);f=f.getLineStart(h);b=r===e.start?e.start:e.start-n;e=e.end-n*(h-g+1)+(e.end===f+1?n:0)}else{for(k=l.length-1;0<=k;k--)m=f.getLineStart(g+k),a.setText(b,m,m);b=r===
e.start?e.start:e.start+n;e=e.end+n*(h-g+1)}this.endUndo();d.setRedraw(!0);a.setSelection(b,e);return!0},trimTrailingWhitespaces:function(){var a=this.editor,d=a.getModel(),b=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var f=/(\s+$)/,e=d.getLineCount(),g=0;g<e;g++){var h=d.getLine(g),k=f.exec(h);if(k){var l=d.getLineStart(g),h=k[0].length,k=l+k.index;d.setText("",k,k+h);b.start>k&&(b.start=Math.max(k,b.start-h));b.start!==b.end&&b.end>k&&(b.end=Math.max(k,
b.end-h))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(b.start,b.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var d=this.editor;if(d.getTextView().getOptions("readonly"))return!1;var b=d.getSelection(),f=d.getModel();return(d.getCaretOffset()===f.getCharCount()?"":f.getText(b.start,b.start+1))===a?(d.setCaretOffset(b.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};d.SourceCodeActions=
a;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});return d});
define("orion/editor/undoStack",[],function(){function l(k,e,h,g,b){this.model=k;this.offset=e;this.text=h;this.previousText=g;this.type=b}function n(k){this.owner=k;this.changes=[]}function m(k,e){this.size=void 0!==e?e:100;this.reset();var h=this;this._listener={onChanging:function(b){h._onChanging(b)},onDestroy:function(b){h._onDestroy(b)}};if(k.getModel){var g=k.getModel();g.getBaseModel&&(g=g.getBaseModel());this.model=g;this.setView(k)}else this.shared=!0,this.model=k;this.model.addEventListener("Changing",
this._listener.onChanging)}l.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(k,e){this._doUndoRedo(this.offset,this.previousText,this.text,k,e);return!0},redo:function(k,e){this._doUndoRedo(this.offset,this.text,this.previousText,k,e);return!0},merge:function(k,e,h,g,b){if(g===this.type){if(1===g&&k===
this.offset+this.text.length)return this.text+=e,!0;if(-1===g&&b===this.offset)return this.offset=k,this.previousText=h+this.previousText,!0;if(-1===g&&k===this.offset)return this.previousText+=h,!0}return!1},_doUndoRedo:function(k,e,h,g,b){this.model.setText(e,k,k+h.length);b&&g&&(h=g.getModel(),h!==this.model&&(k=h.mapOffset(k,!0)),g.setSelection(k,k+e.length))}};n.prototype={getRedoChanges:function(){for(var k=[],e=0;e<this.changes.length;e++)k=k.concat(this.changes[e].getRedoChanges());return k},
getUndoChanges:function(){for(var k=[],e=this.changes.length-1;0<=e;e--)k=k.concat(this.changes[e].getUndoChanges());return k},add:function(k){this.changes.push(k)},end:function(k){k&&(this.endSelection=k.getSelection(),this.endCaret=k.getCaretOffset());(k=this.owner)&&k.end&&k.end()},undo:function(k,e){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=this.changes.length-1;0<=h;h--)this.changes[h].undo(k,!1);1<this.changes.length&&k&&k.setRedraw(!0);if(e&&k){var h=this.startSelection.start,g=this.startSelection.end;
k.setSelection(this.startCaret?h:g,this.startCaret?g:h)}(h=this.owner)&&h.undo&&h.undo();return 0<this.changes.length},redo:function(k,e){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=0;h<this.changes.length;h++)this.changes[h].redo(k,!1);(1<this.changes.length,k)&&k.setRedraw(!0);if(e&&k){var h=this.endSelection.start,g=this.endSelection.end;k.setSelection(this.endCaret?h:g,this.endCaret?g:h)}(h=this.owner)&&h.redo&&h.redo();return 0<this.changes.length},merge:function(k,e,h,g,b){var a=this.changes.length;
return 0<a?this.changes[a-1].merge(k,e,h,g,b):!1},start:function(k){k&&(this.startSelection=k.getSelection(),this.startCaret=k.getCaretOffset());(k=this.owner)&&k.start&&k.start()}};m.prototype={destroy:function(){this._onDestroy()},add:function(k){this.compoundChange?this.compoundChange.add(k):(this.stack.splice(this.index,this.stack.length-this.index,k),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-
1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var k=[],e=this.index;e<this.stack.length;e++)k=k.concat(this.stack[e].getRedoChanges());
return k},getUndoChanges:function(){this._commitUndo();for(var k=[],e=this.index;0<=e;e--)k=k.concat(this.stack[e].getUndoChanges());return k},undo:function(){this._commitUndo();var k;k=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;k=this.stack[--this.index]}while(!(k=k.undo(this.view,!0)));this._ignoreUndo=!1;return k},redo:function(){this._commitUndo();var k;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;k=this.stack[this.index++]}while(!k.redo(this.view,!0));this._ignoreUndo=
!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(k){this.view!==k&&(this.view&&k.removeEventListener("Destroy",this._listener.onDestroy),(this.view=k)&&k.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(k){this._commitUndo();k=new n(k);this.add(k);this.compoundChange=k;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(k){(!k||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(k){if(!this._ignoreUndo){var e=k.text,h=k.start,g=k.addedCharCount,b=k.removedCharCount;k=h+b;var a=0;0===g&&1===b?a=-1:1===g&&0===b&&(a=1);g=this.stack.length;b=this.model.getText(h,k);(!(0<g&&this.index===g)||!this.stack[g-1].merge(h,e,b,a,k))&&this.add(new l(this.model,
h,e,b,a))}}};return{UndoStack:m}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(l,n,m,k){function e(a,d,b,e){this._location=d||"left";this._overview=b||"page";this._rulerStyle=e;this._view=null;var g=this;this._listener={onTextModelChanged:function(a){g._onTextModelChanged(a)},onAnnotationModelChanged:function(a){g._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function h(a,d,b,g,h){e.call(this,a,d,"page",b);this._oddStyle=g||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function g(a,d,b){e.call(this,a,d,"page",b)}function b(a,d,b){e.call(this,a,d,"document",b)}function a(a,d,b){g.call(this,a,d,b)}e.prototype={getAnnotations:function(a,d){var b=this._annotationModel;if(!b)return[];var e=this._view.getModel(),g=e.getLineStart(a),h=e.getLineEnd(d-1),k=e;e.getBaseModel&&(k=e.getBaseModel(),g=e.mapOffset(g),h=e.mapOffset(h));for(var l=[],b=this.getAnnotationsByType(b,g,h),g=0;g<
b.length;g++)for(var h=b[g],m=k.getLineAtOffset(h.start),n=k.getLineAtOffset(Math.max(h.start,h.end-1)),w=m;w<=n;w++){var z=w;if(e!==k){z=k.getLineStart(w);z=e.mapOffset(z,!0);if(-1===z)continue;z=e.getLineAtOffset(z)}if(a<=z&&z<d){var C=this._mergeAnnotation(l[z],h,w-m,n-m+1);C&&(l[z]=C)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var r in l)l[r]._multiple&&(l[r].html+=this._multiAnnotationOverlay.html);return l},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a,d){if(void 0!==a){var b=this._view,e=b.getModel(),g=e,h=e.getLineStart(a),k=h,l=h,n=this._annotationModel;if(n){b=b.getSelection();l=e.getLineEnd(a,!0);h<=b.start&&b.start<l&&(h=b.start);e.getBaseModel&&(h=e.mapOffset(h),
l=e.mapOffset(l),g=e.getBaseModel());for(var s,l=n.getAnnotations(h,l),n=null;!s&&l.hasNext();)b=l.next(),this.isAnnotationTypeVisible(b.type)&&(n=b,b.start<=h||(s=b));n&&void 0!==n.groupId&&(this._currentClickGroup=this._currentClickGroup===n.groupId?null:n.groupId,this._setCurrentGroup(a));s&&g.getLineAtOffset(s.start)===g.getLineAtOffset(h)?(h=s.start,l=s.end):l=h=k;e.getBaseModel&&(h=e.mapOffset(h,!0),l=e.mapOffset(l,!0))}(e=m.Tooltip.getTooltip(this._view))&&e.setTarget(null);this._view.setSelection(l,
h,1/3,function(){})}},onDblClick:function(a,d){},onMouseMove:function(a,d){var b=m.Tooltip.getTooltip(this._view);if(b&&!(b.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var e=this;b.setTarget({y:d.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,d){this.onMouseMove(a,d);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(a,d){this._currentClickGroup||this._setCurrentGroup(-1);var b=m.Tooltip.getTooltip(this._view);
b&&b.setTarget(null)},_getTooltipInfo:function(a,d){if(void 0!==a){var b=this._view,e=b.getModel(),g=this._annotationModel,h=[];if(g){var h=e.getLineStart(a),k=e.getLineEnd(a);e.getBaseModel&&(h=e.mapOffset(h),k=e.mapOffset(k));h=this.getAnnotationsByType(g,h,k)}g=this._getTooltipContents(a,h);if(!g)return null;g={contents:g,anchor:this.getLocation()};h=b.getClientArea();"document"===this.getOverview()?h.y=b.convert({y:d},"view","document").y:h.y=b.getLocationAtOffset(e.getLineStart(a)).y;b.convert(h,
"document","page");g.x=h.x;g.y=h.y;"right"===g.anchor&&(g.x+=h.width);return g}},_getTooltipContents:function(a,d){return d},_onAnnotationModelChanged:function(a){function d(a){for(var d=0;d<a.length;d++)if(g.isAnnotationTypeVisible(a[d].type)){var f=a[d].start,h=a[d].end;e.getBaseModel&&(f=e.mapOffset(f,!0),h=e.mapOffset(h,!0));-1!==f&&-1!==h&&b.redrawLines(e.getLineAtOffset(f),e.getLineAtOffset(Math.max(f,h-1))+1,g)}}var b=this._view;if(b){var e=b.getModel(),g=this,h=e.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,e.getBaseModel&&(a=e.mapOffset(a,!0)),a=e.getLineAtOffset(a),b.redrawLines(a,h,g)):(d(a.added),d(a.removed),d(a.changed))}},_mergeAnnotation:function(a,d,b,e){a||(a={});0===b&&(a.html&&d.html?(d.html!==a.html&&(!a._multiple&&this._multiAnnotation)&&(a.html=this._multiAnnotation.html),a._multiple=!0):a.html=d.html);a.style=this._mergeStyle(a.style,d.style);return a},_mergeStyle:function(a,d){if(d){a||(a={});a.styleClass=a.styleClass&&d.styleClass&&a.styleClass!==d.styleClass?
a.styleClass+(" "+d.styleClass):d.styleClass;var b;if(d.style)for(b in a.style||(a.style={}),d.style)void 0===a.style[b]&&(a.style[b]=d.style[b]);if(d.attributes)for(b in a.attributes||(a.attributes={}),d.attributes)void 0===a.attributes[b]&&(a.attributes[b]=d.attributes[b])}return a},_setCurrentGroup:function(a){var d=this._annotationModel,b=null,e=d.getTextModel(),g,h=this._currentGroupAnnotation;if(-1!==a){var k=e.getLineStart(a),l=e.getLineEnd(a);e.getBaseModel&&(k=e.mapOffset(k),l=e.mapOffset(l));
for(g=d.getAnnotations(k,l);g.hasNext();)if(e=g.next(),this.isAnnotationTypeVisible(e.type)&&e.start<=k&&e.end>=l&&void 0!==e.groupId){b=e;break}if(h&&b&&h.groupId===b.groupId)return}this._currentGroupAnnotation=null;h&&d.removeAnnotations(h.groupType);if(b&&-1!==a){this._currentGroupAnnotation=b;g=d.getAnnotations();for(a=[];g.hasNext();)e=g.next(),delete e.groupAnnotation,e.groupId===b.groupId&&(e=e.createGroupAnnotation(),a.push(e));d.replaceAnnotations(null,a)}}};n.AnnotationTypeList.addMixin(e.prototype);
h.prototype=new e;h.prototype.getAnnotations=function(a,d){for(var b=e.prototype.getAnnotations.call(this,a,d),g=this._view.getModel(),h=a;h<d;h++){var k=h&1?this._oddStyle:this._evenStyle,l=h;g.getBaseModel&&(l=g.getLineStart(l),l=g.getBaseModel().getLineAtOffset(g.mapOffset(l)));b[h]||(b[h]={});b[h].html=this._firstLine+l+"";b[h].style||(b[h].style=k)}return b};h.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};h.prototype.setFirstLine=
function(a){this._firstLine=void 0!==a?a:1};h.prototype._onTextModelChanged=function(a){var d=a.start;a=this._view.getModel();var b=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),b=(this._firstLine+b-1+"").length;this._numOfDigits!==b&&(this._numOfDigits=b,d=a.getLineAtOffset(d),this._view.redrawLines(d,a.getLineCount(),this))};g.prototype=new e;b.prototype=new e;b.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
b.prototype._getTooltipContents=function(a,d){if(0===d.length){var b=this._view.getModel(),g=a;b.getBaseModel&&(g=b.getLineStart(g),g=b.getBaseModel().getLineAtOffset(b.mapOffset(g)));return k.formatMessage(l.line,g+1)}return e.prototype._getTooltipContents.call(this,a,d)};b.prototype._mergeAnnotation=function(a,d,b,e){if(0===b)return a||(a={html:"\x26nbsp;",style:{style:{height:3*e+"px"}}},a.style=this._mergeStyle(a.style,d.overviewStyle)),a};a.prototype=new g;a.prototype.onClick=function(a,d){if(void 0!==
a){var b=this._annotationModel;if(b){var e=this._view.getModel(),g=e.getLineStart(a),h=e.getLineEnd(a,!0);e.getBaseModel&&(g=e.mapOffset(g),h=e.mapOffset(h),e=e.getBaseModel());for(var k,b=b.getAnnotations(g,h);!k&&b.hasNext();)h=b.next(),this.isAnnotationTypeVisible(h.type)&&e.getLineAtOffset(h.start)===e.getLineAtOffset(g)&&(k=h);k&&((e=m.Tooltip.getTooltip(this._view))&&e.setTarget(null),k.expanded?k.collapse():k.expand())}}};a.prototype._getTooltipContents=function(a,d){if(0<d.length){var b=this._view.getModel(),
e=b.getLineStart(a);b.getBaseModel&&(e=b.mapOffset(e),b=b.getBaseModel());for(var e=b.getLineAtOffset(e),h=0;h<d.length;h++){var k=d[h];if(this.isAnnotationTypeVisible(k.type)&&b.getLineAtOffset(k.start)===e){if(d[h].expanded)break;return g.prototype._getTooltipContents.call(this,a,[k])}}}return null};a.prototype._onAnnotationModelChanged=function(a){function d(a){for(k=0;k<a.length;k++)if(h.isAnnotationTypeVisible(a[k].type)){var d=a[k].start;e.getBaseModel&&(d=e.mapOffset(d,!0));-1!==d&&(m=Math.min(m,
e.getLineAtOffset(d)))}}if(a.textModelChangedEvent)g.prototype._onAnnotationModelChanged.call(this,a);else{var b=this._view;if(b){var e=b.getModel(),h=this,k,l=e.getLineCount(),m=l;d(a.added);d(a.removed);d(a.changed);a=b.getRulers();for(k=0;k<a.length;k++)b.redrawLines(m,l,a[k])}}};return{Ruler:e,AnnotationRuler:g,LineNumberRuler:h,OverviewRuler:b,FoldingRuler:a}});
define("orion/editor/textDND",["orion/util"],function(l){function n(l,k){this._view=l;this._undoStack=k;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var e=this;this._listener={onDragStart:function(h){e._onDragStart(h)},onDragEnd:function(h){e._onDragEnd(h)},onDragEnter:function(h){e._onDragEnter(h)},onDragOver:function(h){e._onDragOver(h)},onDrop:function(h){e._onDrop(h)},onDestroy:function(h){e._onDestroy(h)}};l.addEventListener("DragStart",this._listener.onDragStart);l.addEventListener("DragEnd",
this._listener.onDragEnd);l.addEventListener("DragEnter",this._listener.onDragEnter);l.addEventListener("DragOver",this._listener.onDragOver);l.addEventListener("Drop",this._listener.onDrop);l.addEventListener("Destroy",this._listener.onDestroy)}n.prototype={destroy:function(){var l=this._view;l&&(l.removeEventListener("DragStart",this._listener.onDragStart),l.removeEventListener("DragEnd",this._listener.onDragEnd),l.removeEventListener("DragEnter",this._listener.onDragEnter),l.removeEventListener("DragOver",
this._listener.onDragOver),l.removeEventListener("Drop",this._listener.onDrop),l.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(l){this.destroy()},_onDragStart:function(l){var k=this._view,e=k.getSelection(),k=k.getModel();k.getBaseModel&&(e.start=k.mapOffset(e.start),e.end=k.mapOffset(e.end),k=k.getBaseModel());if(k=k.getText(e.start,e.end))this._dragSelection=e,l.event.dataTransfer.effectAllowed="copyMove",l.event.dataTransfer.setData("Text",k)},_onDragEnd:function(m){if(this._dragSelection){var k=
this._view,e=m.event.dataTransfer.dropEffect;if(!l.isFirefox&&("none"!==e||this._dropText))e=m.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(m="move"===e)&&k.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var e=this._dropText,h=this._dropOffset;m&&(h>=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));k.setText(e,h,h);k.setSelection(h,
h+e.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(l){this._onDragOver(l)},_onDragOver:function(m){var k=m.event.dataTransfer.types,e=!this._view.getOptions("readonly");e&&k&&(e=k.contains?k.contains("text/plain")||k.contains("Text"):-1!==k.indexOf("text/plain")||-1!==k.indexOf("Text"));e?l.isFirefox||(this._dropEffect=m.event.dataTransfer.dropEffect=(l.isMac?m.event.altKey:m.event.ctrlKey)?"copy":
"move"):m.event.dataTransfer.dropEffect="none"},_onDrop:function(m){var k=this._view,e=m.event.dataTransfer.getData("Text");e&&(l.isFirefox||(m.event.dataTransfer.dropEffect=this._dropEffect),m=k.getOffsetAtLocation(m.x,m.y),this._dragSelection?(this._dropOffset=m,this._dropText=e):(k.setText(e,m,m),k.setSelection(m,m+e.length)))}};return{TextDND:n}});
define("orion/editor/templates",[],function(){function l(l,k,e,h){this.prefix=l;this.description=k;this.template=e;this.name=h;this._parse()}function n(l,k){this._keywords=l||[];this._templates=[];this.addTemplates(k||[])}l.prototype={getProposal:function(l,k,e){l=k-l.length;k={};var h,g=void 0!==e.delimiter?e.delimiter:"\n";e.indentation&&(g+=e.indentation);var b=void 0!==e.tab?e.tab:"\t",a=0,f=this.variables,d=this.segments;e=[];for(var p=0;p<d.length;p++){var n=d[p],u=f[n];if(void 0!==u)switch(n){case "${tab}":n=
b;break;case "${delimiter}":n=g;break;case "${cursor}":n="";h=a;break;default:var t=k[n];t||(t=k[n]={data:u.data,positions:[]});n=u.substitution;t.data&&t.data.values&&(n=t.data.values[0]);t.positions.push({offset:l+a,length:n.length})}e.push(n);a+=n.length}var g=[],y;for(y in k)k.hasOwnProperty(y)&&g.push(k[y]);e=e.join("");void 0===h&&(h=e.length);return{proposal:e,name:this.name,description:this.description,groups:g,escapePosition:l+h,style:"noemphasis"}},match:function(l){return 0===this.prefix.indexOf(l)},
_parse:function(){var l=this.template,k=[],e={},h,g=0,l=l.replace(/\n/g,"${delimiter}"),l=l.replace(/\t/g,"${tab}");l.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(b,a,f){var d=b.substring(2,b.length-1);a=b;var p=d,n=null,u=p.indexOf(":");-1!==u&&(p=p.substring(0,u),a="${"+p+"}",n=JSON.parse(d.substring(u+1).replace("\\}","}").trim()));(d=e[a])||(d=e[a]={});d.substitution=p;n&&(d.data=n);(h=l.substring(g,f))&&k.push(h);k.push(a);g=f+b.length;return p});(h=l.substring(g,l.length))&&k.push(h);this.segments=
k;this.variables=e}};n.prototype={addTemplates:function(m){for(var k=this.getTemplates(),e=0;e<m.length;e++)k.push(new l(m[e].prefix,m[e].description,m[e].template,m[e].name))},initialize:function(){},computeProposals:function(l,k,e){var h=this.getPrefix(l,k,e),g=[];this.isValid(h,l,k,e)&&(g=g.concat(this.getTemplateProposals(h,k,e)),g=g.concat(this.getKeywordProposals(h)));return g},getKeywords:function(){return this._keywords},getKeywordProposals:function(l){var k=[],e=this.getKeywords();if(e){for(var h=
0;h<e.length;h++)0===e[h].indexOf(l)&&k.push({proposal:e[h].substring(l.length),description:e[h],style:"noemphasis_keyword"});0<k.length&&k.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return k},getPrefix:function(l,k,e){return e.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(l,k,e){for(var h=[],g=this.getTemplates(),b=0;b<g.length;b++){var a=g[b];a.match(l)&&(a=a.getProposal(l,k,e),this.removePrefix(l,a),
h.push(a))}0<h.length&&(h.sort(function(a,d){return a.name<d.name?-1:a.name>d.name?1:0}),h.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return h},removePrefix:function(l,k){if(!(k.overwrite=k.proposal.substring(0,l.length)!==l))k.proposal=k.proposal.substring(l.length)},isValid:function(l,k,e,h){return!0}};return{Template:l,TemplateContentAssist:n}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(l,n,m,k,e,h){function g(a,b,d){var e=a.getTextView();m.KeyMode.call(this,e);this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(a){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var d=this.editor.mapOffset(a.start),b=this.linkedModeModel,f,e;b;)if(f=this._getPositionChanged(b,d,d+a.removedCharCount),e=f.position,void 0===e||e.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;a=a.addedCharCount-a.removedCharCount;f=f.positions;for(var g,h=0;h<f.length;++h){g=f[h];e=g.position;var k=e.offset<=d&&d<=e.offset+e.length;k&&!g.ansestor?(e.offset+=b,
e.length+=a,b+=a):(e.offset+=b,g.ansestor&&k&&(e.length+=a));g.escape&&(g.model.escapePosition=e.offset)}this._updateAnnotations(f)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var d=this.editor,b=d.mapOffset(a.start),f=this.editor.mapOffset(a.end),e=this.linkedModeModel,g,h;e;)if(g=this._getPositionChanged(e,b,f),h=g.position,void 0===h||h.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var k=this._compoundChange;k?k.owner.model===e&&k.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=h.group;var k=0,l=a.text.length-(f-b);g=g.positions;for(var p,b=b-h.position.offset,m=f-h.position.offset,n=0;n<g.length;++n)p=g[n],f=p.position,p.oldOffset=f.offset,p.model===e&&p.group===h.group?(f.offset+=k,f.length+=l,k+=l):(f.offset+=k,p.ansestor&&(f.length+=h.count*l)),p.escape&&(p.model.escapePosition=f.offset);this.ignoreVerify=!0;for(n=g.length-1;0<=n;n--)p=g[n],p.model===e&&p.group===h.group&&d.setText(a.text,p.oldOffset+
b,p.oldOffset+m);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(g)}}}.bind(this)}}var b={};g.prototype=new m.KeyMode;h.mixin(g.prototype,{createKeyBindings:function(){var a=n.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=
this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(l.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a);this.linkedModeModel=
a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var d=this.editor,e=d.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(l.linkedModeExited,null,!0);a&&d.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=a;a=b.groups[a];var d=a.positions[0],g=this.editor;g.setSelection(d.offset,d.offset+d.length);if(b=this.contentAssist)b.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new e.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),d.offset<=a&&a<=d.offset+d.length)?g.getText(d.offset,a):""},b.offset=d.offset,b.deactivate(),b.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,b.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,b,d){for(var e=b.groups,g=0;g<e.length;g++)for(var h=e[g].positions,k=0;k<h.length;k++){var l=h[k];d&&(l={offset:l.offset+d,length:l.length});l={index:k,group:g,count:h.length,model:b,
position:l};a.push(l);b.nextModel&&b.nextModel.parentGroup===g&&(l.ansestor=!0,this._getModelPositions(a,b.nextModel,(d||0)+h[k].offset-h[0].offset))}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)void 0!==a.escapePosition&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},
_getPositionChanged:function(a,b,d){var e;a=this._getSortedPositions(a);for(var g=a.length-1;0<=g;g--){var h=a[g].position;if(h.offset<=b&&d<=h.offset+h.length){e=a[g];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var d=[],e=[],g=b.getAnnotations(),h;g.hasNext();)switch(h=g.next(),h.type){case k.AnnotationType.ANNOTATION_LINKED_GROUP:case k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.push(h)}if(g=
this.linkedModeModel){a=a||this._getSortedPositions(g);for(var l=0;l<a.length;l++)if(h=a[l],h.model===g){var m=k.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===g.selectedGroupIndex&&(m=0===h.index?k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=k.AnnotationType.createAnnotation(m,h.offset,h.offset+h.length,"");e.push(h)}}b.replaceAnnotations(d,e)}}});b.LinkedMode=g;return b});
define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(l,n,m,k,e,h){function g(){}function b(){}function a(){}function f(){}function d(){}function p(){}var q={};g.prototype={createKeyBindings:function(a,d,b,f){f=new l.TextActions(a,d,f);var e=new h.LinkedMode(a,d,b);a=new l.SourceCodeActions(a,d,b,e);return{textActions:f,linkedMode:e,sourceCodeActions:a}}};q.KeyBindingsFactory=
g;b.prototype={createUndoStack:function(a){a=a.getTextView();return new n.UndoStack(a,200)}};q.UndoFactory=b;a.prototype={createLineNumberRuler:function(a){return new m.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};q.LineNumberRulerFactory=a;f.prototype={createFoldingRuler:function(a){return new m.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};q.FoldingRulerFactory=f;d.prototype={createAnnotationModel:function(a){return new k.AnnotationModel(a)},
createAnnotationStyler:function(a,d){return new k.AnnotationStyler(a,d)},createAnnotationRulers:function(a){var d=new m.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new m.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:d,overviewRuler:a}}};q.AnnotationFactory=d;p.prototype={createTextDND:function(a,d){return new e.TextDND(a.getTextView(),d)}};q.TextDNDFactory=p;return q});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(l,n,m,k){return k.mixin({},l,n,m)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'\x3cdiv id\x3d"topWidget_id" style\x3d"height:100%;width:100%;position:relative"\x3e\n\t\x3cdiv class\x3d"leftPanelLayout "\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"left_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"left_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent" id\x3d"left_editor_id"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"left_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\t\x3cdiv class\x3d"split compareSplitLayout"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"rightPanelLayout"\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"right_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"right_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent"  id\x3d"right_editor_wrapper_id"\x3e\n\t\t\t\x3cdiv class\x3d"canvasContainer"\x3e\n\t\t\t\t\x3ccanvas id\x3d"diff_canvas_id" class\x3d"compareCanvas" width\x3d"46" height\x3d"3000"\x3e\x3c/canvas\x3e\n\t\t\t\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"compareEditorParentWithCanvas" id\x3d"right_editor_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"right_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(l,n,m){var k=k||{};k.TwoWayCompareUIFactory=function(){function e(e){this._parentDivID=e.parentDivID;this._commandSpanId=e.commandSpanId;this._showTitle=e.showTitle;this._leftTitle=e.leftTitle;this._rightTitle=e.rightTitle;this._showLineStatus=e.showLineStatus}e.prototype={_init:function(){var e=this._parentDivID+"_";this._topWidgetDiv=l.node("topWidget_id");
this._topWidgetDiv.id=e+"topWidget_id";this._leftEditorParentDiv=l.node("left_editor_id");this._leftEditorParentDiv.id=e+"left_editor_id";this._rightEditorParentDiv=l.node("right_editor_id");this._rightEditorParentDiv.id=e+"right_editor_id";this._rightEditorWrapperDiv=l.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=e+"right_editor_wrapper_id";this._leftActionDiv=l.node("left_action_id");this._leftActionDiv.id=e+"left_action_id";this._rightActionDiv=l.node("right_action_id");this._rightActionDiv.id=
e+"right_action_id";this._leftTitleDiv=l.node("left_title_id");this._leftTitleDiv.id=e+"left_title_id";this._rightTitleDiv=l.node("right_title_id");this._rightTitleDiv.id=e+"right_title_id";this._leftStatusDiv=l.node("left_status_id");this._leftStatusDiv.id=e+"left_status_id";this._rightStatusDiv=l.node("right_status_id");this._rightStatusDiv.id=e+"right_status_id";this._diffCanvasDiv=l.node("diff_canvas_id");this._diffCanvasDiv.id=e+"diff_canvas_id";this._splitterId=e+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var e=l.$(".split",this._topWidgetDiv);e.id=this._splitterId;var g=l.$(".leftPanelLayout",this._topWidgetDiv),b=l.$(".rightPanelLayout",this._topWidgetDiv);e&&(g&&b)&&(this._splitter=new n.Splitter({node:e,sidePanel:g,mainPanel:b}))},buildUI:function(){l.node(this._parentDivID).innerHTML=m;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(e){return l.$(".leftPanelLayout",
this._topWidgetDiv)===e},getEditorParentDiv:function(e){return e?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(e){return e?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(e){return e?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(e){return e?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return e}();return k});
var JsDiff=function(){function l(b){for(var a=[],f=0;f<b.length;f++)b[f]&&a.push(b[f]);return a}function n(b){b=b.replace(/&/g,"\x26amp;");b=b.replace(/</g,"\x26lt;");b=b.replace(/>/g,"\x26gt;");return b=b.replace(/"/g,"\x26quot;")}var m=function(b){this.ignoreWhitespace=b};m.prototype={diff:function(b,a){if(a==b)return[{value:a}];if(!a)return[{value:b,removed:!0}];if(!b)return[{value:a,added:!0}];a=this.tokenize(a);b=this.tokenize(b);var f=a.length,d=b.length,e=f+d,g=[{newPos:-1,components:[]}],
h=this.extractCommon(g[0],a,b,0);if(g[0].newPos+1>=f&&h+1>=d)return g[0].components;for(var k=1;k<=e;k++)for(var l=-1*k;l<=k;l+=2){var m;m=g[l-1];var n=g[l+1],h=(n?n.newPos:0)-l;m&&(g[l-1]=void 0);var s=m&&m.newPos+1<f,w=n&&0<=h&&h<d;if(!s&&!w)g[l]=void 0;else{!s||w&&m.newPos<n.newPos?(m={newPos:n.newPos,components:n.components.slice(0)},this.pushComponent(m.components,b[h],void 0,!0)):(m={newPos:m.newPos,components:m.components.slice(0)},m.newPos++,this.pushComponent(m.components,a[m.newPos],!0,
void 0));h=this.extractCommon(m,a,b,l);if(m.newPos+1>=f&&h+1>=d)return m.components;g[l]=m}}},pushComponent:function(b,a,f,d){var e=b[b.length-1];e&&e.added===f&&e.removed===d?b[b.length-1]={value:this.join(e.value,a),added:f,removed:d}:b.push({value:a,added:f,removed:d})},extractCommon:function(b,a,f,d){var e=a.length,g=f.length,h=b.newPos;for(d=h-d;h+1<e&&d+1<g&&this.equals(a[h+1],f[d+1]);)h++,d++,this.pushComponent(b.components,a[h],void 0,void 0);b.newPos=h;return d},equals:function(b,a){var f=
/\S/;return this.ignoreWhitespace&&!f.test(b)&&!f.test(a)?!0:b==a},join:function(b,a){return b+a},tokenize:function(b){return b}};var k=new m,e=new m(!1);e.tokenize=function(b){return l(b.split(/(\s+|\b)/))};var h=new m(!0);h.tokenize=function(b){return l(b.split(/([{}:;,]|\s+)/))};var g=new m;g.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,a){return k.diff(b,a)},diffWords:function(b,a){return e.diff(b,a)},diffLines:function(b,a){return g.diff(b,a)},diffCss:function(b,a){return h.diff(b,
a)},createPatch:function(b,a,f,d,e){var h=[];h.push("Index: "+b);h.push("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");h.push("--- "+b+"\t"+d);h.push("+++ "+b+"\t"+e);b=g.diff(a,f);b.push({value:"",lines:[]});f=a=0;d=[];for(var k=e=1,l=0;l<b.length;l++){var m=b[l],n=m.lines||
m.value.replace(/\n$/,"").split("\n");m.lines=n;if(m.added||m.removed){if(!a){var x=b[l-1];a=e;f=k;x&&(d.push.apply(d,x.lines.slice(-4).map(function(a){return" "+a})),a-=4,f-=4)}d.push.apply(d,n.map(function(a){return(m.added?"+":"-")+a}));m.added?k+=n.length:e+=n.length}else a&&(8>=n.length&&l<b.length-1?d.push.apply(d,n.map(function(a){return" "+a})):(x=Math.min(n.length,4),h.push("@@ -"+a+","+(e-a+x)+" +"+f+","+(k-f+x)+" @@"),h.push.apply(h,d),h.push.apply(h,n.slice(0,x).map(function(a){return" "+
a})),f=a=0,d=[])),e+=n.length,k+=n.length}1<b.length&&!/\n$/.test(b[b.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(b){for(var a=[],f=0;f<b.length;f++){var d=b[f];d.added?a.push("\x3cins\x3e"):d.removed&&a.push("\x3cdel\x3e");a.push(n(d.value));d.added?a.push("\x3c/ins\x3e"):d.removed&&a.push("\x3c/del\x3e")}return a.join("")}}}();"undefined"!==typeof module&&(module.exports=JsDiff);
"function"===typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(l){var n=n||{};n.JSDiffAdapter=function(){function m(){}m.prototype={_specialLine:function(k,e,h){return e.value===k&&h!==k},adapt:function(k,e,h){h||(h="\n");var g=k.split(h),b=e.split(h),a=""===g[g.length-1],b=""===b[b.length-1],f=l.diffLines(k,e);k=[];e=[];for(var d=0,p=0,m=-1,n=0,t=!0,y=h,v=0;v<f.length;v++){var x=f[v],s=x.lines||x.value.split(h),w=s.length,z=0;1<s.length&&""===s[s.length-1]&&w--;1<w&&!t&&""===s[0]&&(w--,z++);x.lines=
s;if(!x.added&&!x.removed){if(!this._specialLine(h,x,y)){if(d||p)k.push([d,p,m]),p=d=0,m=-1,n+=p;k.push([w,w,0]);n+=w}}else if(x.added){-1===m&&(m=e.length+1);d+=w;for(t=z;t<w+z;t++)e.push(x.lines[t])}else p+=w;t=!1;1<s.length&&""===s[s.length-1]&&(t=!0);y=x.value?x.value[x.value.length-1]:h}if(d||p)k.push([d,p,m]),n+=p;n<g.length&&1<g.length&&(h=k[k.length-1],0===h[2]?(h[0]+=1,h[1]+=1):-1===h[2]?k.push([1,1,0]):a===b?k.push([1,1,0]):(b&&(h[0]+=1),a&&(h[1]+=1)));return{mapper:k,changContents:{array:e,
index:0}}},adaptCharDiff:function(k,e,h){k=h?l.diffWords(k,e):l.diffChars(k,e);e=[];for(var g=h=0,b=0,a=0,f=0;f<k.length;f++){var d=k[f];if(!d.added&&!d.removed){if(0<b||0<a)e.push([g,g+b,h,h+a]),g+=b,h+=a,a=b=0;g+=d.value.length;h+=d.value.length}else d.added?b+=d.value.length:a+=d.value.length}(0<b||0<a)&&e.push([g,g+b,h,h+a]);return e}};return m}();return n});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(l,n,m,k){var e={},h,g,b,a,f,d,p,q,u,t,y,v,x,s,w,z;e.DiffTreeNavigator=function(){function e(a,d,b,f,g,h){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,d,b,f,g,h)}h="orion.annotation.diff.addedBlock";g="orion.annotation.diff.currentAddedBlock";b="orion.annotation.diff.deletedBlock";a="orion.annotation.diff.currentDeletedBlock";
f="orion.annotation.diff.blockTop";d="orion.annotation.diff.currentBlockTop";p="orion.annotation.diff.blockConflict";q="orion.annotation.diff.currentBlockConflict";u="orion.annotation.diff.addedWord";t="orion.annotation.diff.currentAddedWord";y="orion.annotation.diff.deletedWord";v="orion.annotation.diff.currentDeletedWord";x="orion.annotation.diff.emptyDeletedWordLeft";s="orion.annotation.diff.emptyDeletedWordRight";w="orion.annotation.diff.emptyAddedWordLeft";z="orion.annotation.diff.emptyAddedWordRight";
m.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});m.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});m.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});m.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});m.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
m.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});m.AnnotationType.registerType(p,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});m.AnnotationType.registerType(q,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});m.AnnotationType.registerType(u,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});m.AnnotationType.registerType(t,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});m.AnnotationType.registerType(y,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});m.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});m.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});m.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
m.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});m.AnnotationType.registerType(z,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});e.prototype={initAll:function(a,d,b,f,e,g,h){this._charOrWordDiff=a?a:"word";d&&(this._initialized=!0);this.editorWrapper=[{editor:d,diffFeeder:f},{editor:b,diffFeeder:e}];this._curveRuler=h;(this._overviewRuler=g)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var d=
0;d<this.editorWrapper.length;d++)this.editorWrapper[d].diffFeeder.init(this.editorWrapper[d].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)this.editorWrapper[a].annoTypes[d].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[d].current),this.editorWrapper[a].annoTypes[d].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[d].normal)}this._root.children=[];d=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!d||0===d.length)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var b=new k.JSDiffAdapter;for(a=0;a<d.length;a++){var f=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(f);var e=this.generatePairWordAnnotations(f,a,b);e&&(f.children=e)}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new l.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,d,b,f,e){if(this.editorWrapper[d].annoTypes)for(var g=0;g<this.editorWrapper[d].annoTypes.length;g++)this.editorWrapper[d].annoTypes[g].type===b&&this.replaceDiffAnnotations(this.editorWrapper[d].editor,e?e:this.editorWrapper[d].annoTypes[g].list,f?this.editorWrapper[d].annoTypes[g].normal:this.editorWrapper[d].annoTypes[g].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,d){this.iterator&&(this.iterator.iterateOnTop(a,d),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var d=this.iterator.iterate(a);if(d){var b=this.iterator.cursor();"block"===b.type&&(b.children&&0<b.children.length)&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return d},
gotoBlock:function(a,d){if(this.iterator){if(0>a||a>=this._root.children.length||0===this._root.children.length)a=0;void 0!==d&&0<=d&&this._root.children[a].children&&d<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[d]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,d,b){if(b===this.editorWrapper[a].editor.getTextView()){for(var f=0;f<this._root.children.length;f++){b=
this._root.children[f];var e=0===a?b.oldA:b.newA;if(d>=e.start&&d<=e.end){f=b;if(b.children&&0<b.children.length)for(e=0;e<b.children.length;e++){var g=b.children[e],h=0===a?g.oldA:g.newA;if(d>=h.start&&d<=h.end){f=g;break}}return f}}return null}},gotoChange:function(a,d){for(var b=0;b<this.editorWrapper.length;b++){var f=this._hitDiffAnnotation(b,a,d);if(f)return this.iterator.setCursor(f),this.updateCurrentAnnotation(!1,d),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;
var a=this.iterator.cursor();return!a?-1:"block"===a.type?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return"block"===a.type?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var d=this.getFeeder().getDiffBlocks();if(!d||0===d.length)return-1;a>d.length-1&&(a=0);return d[a][1]},replaceDiffAnnotations:function(a,d,b,f){if(d&&b&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(),g=[];f&&e.hasNext();){var h=e.next();h.type===b&&g.push(h)}a.replaceAnnotations(g,d)}},updateCurrentAnnotation:function(a,d){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var b=this.iterator.cursor();if(b){var f,e,g={start:b.oldA.start,end:b.oldA.end},h={start:b.newA.start,end:b.newA.end};"word"===b.type?(f=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(g,
this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(h,this.editorWrapper[1].editor.getTextView().getModel())):(f=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(b.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(b.index));f&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (m.AnnotationType.getType(f.current))(g.start,g.end)],f,!0);e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (m.AnnotationType.getType(e.current))(h.start,
h.end)],e,!0);a?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1):d&&(this.autoSelecting=!0,d!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),d!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(a,
d){var b=this.generateBlockDiffAnnotations(0,d),f=this.generateBlockDiffAnnotations(1,d);return{parent:a,index:d,type:"block",oldA:b,newA:f}},generatePairWordAnnotations:function(a,d,b){var f=this.editorWrapper[0].diffFeeder.getTextOnBlock(d),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(d);d=null;var g=0,h=0;if(f&&e&&f.text&&e.text&&5E3>=f.text.length&&5E3>=e.text.length)d=b.adaptCharDiff(f.text,e.text,"word"===this._charOrWordDiff),h=e.start,g=f.start;else return null;b=[];f=[];this.generateWordDiffAnnotations(0,
b,g,d,2,3);this.generateWordDiffAnnotations(1,f,h,d,0,1);d=[];for(g=0;g<b.length;g++)d.push({parent:a,index:g,type:"word",oldA:b[g],newA:f[g]});return d},getAnnoModelList:function(a,d,b){for(var f=0;f<this.editorWrapper[a].annoTypes.length;f++)if(this.editorWrapper[a].annoTypes[f].type===d&&this.editorWrapper[a].annoTypes[f].normal===b)return this.editorWrapper[a].annoTypes[f].list;return null},generateBlockDiffAnnotations:function(a,d){var b=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(d),
f=this.getAnnoModelList(a,"block",b.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(d),b=m.AnnotationType.createAnnotation(b.normal,e.start,e.end);f&&f.push(b);return b},generateWordDiffAnnotations:function(a,d,b,f,e,g){if(f){var h=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1});a=this.getAnnoModelList(a,"word",h.normal);for(var k=0;k<f.length;k++){var l=m.AnnotationType.createAnnotation(h.normal,f[k][e]+b,f[k][g]+b);a.push(l);d.push(l)}}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,d){var b=a.getLineHeight(),f=a.getClientArea(),b=Math.floor(f.height/b/3);a.setTopIndex(0<d-b?d-b:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var d=this.getFeeder().getDiffBlocks();0!==d.length&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
d[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=n.lookUpLineIndex(this.getMapper(),0,d[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&(a=0>a?0:n.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a),this.gotoBlock(a))},gotoDiff:function(a,d){this.gotoChange(a,d)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return e}();e.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:t,normal:u,list:[]}):a.push({type:"word",
current:v,normal:y,list:[]});a.push({type:"word",current:x});a.push({type:"word",current:s});a.push({type:"word",current:w});a.push({type:"word",current:z})},getCurrentWordAnnoType:function(a,d){return a.start===a.end&&d?this._isAddedSide()?{current:this._repositionEmptyWord(a,d),normal:u}:{current:this._repositionEmptyWord(a,d),normal:y}:this._isAddedSide()?{current:t,normal:u}:{current:v,normal:y}},_repositionEmptyWord:function(a,d){var b=d.getLineAtOffset(a.start),f=d.getLineStart(b),e=d.getLineEnd(b);
if(f!==e){if(a.start===e)return a.start--,this._isAddedSide()?z:s;a.end++}else if(0<b&&(b--,f=d.getLineStart(b),e=d.getLineEnd(b),f!==e))return a.start=e-1,a.end=e,this._isAddedSide()?z:s;return this._isAddedSide()?w:x},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return-1===a?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var d=this._diffBlocks[a][0],b=d+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1;a=this._textModel.getLineStart(d);if(b<d)return{start:a,end:a};d=this._textModel.getLineEnd(b,!0);return{start:a,end:d}},getTextOnBlock:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return 0===this._mapper.length}};return a}();e.TwoWayDiffBlockFeeder=function(){function k(a,d,b,f){this._mapperColumnIndex=b;this._reverseAnnotation=f;this.init(a,d)}k.prototype=new e.DiffBlockFeeder;k.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex};k.prototype.init=function(a,d){this._textModel=a;this._diffBlocks=void 0;if(d){this._mapper=d;this._diffBlocks=[];for(var b=0,f=0;f<this._mapper.length;f++)0!==
this._mapper[f][2]&&this._diffBlocks.push([b,f]),b+=this._mapper[f][this._mapperColumnIndex]}};k.prototype.getBlockAnnoTypes=function(e){this._isAddedSide()?e.push({type:"block",normal:h,current:g,list:[]}):e.push({type:"block",normal:b,current:a,list:[]});e.push({type:"block",normal:f,current:d,list:[]});e.push({type:"block",normal:p,current:q,list:[]})};k.prototype.getCurrentBlockAnnoType=function(e){if(!this._diffBlocks||0===this._diffBlocks.length||this._diffBlocks.length<=e)return null;e=this._diffBlocks[e][1];
return 0===this._mapper[e][this._mapperColumnIndex]?{normal:f,current:d}:n.isMapperConflict(this.getMapper(),e)?{normal:p,current:q}:this._isAddedSide()?{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:b,current:a,list:[]}};return k}();e.inlineDiffBlockFeeder=function(){function d(a,b){this._mapperColumnIndex=b;this.init(a)}d.prototype=new e.DiffBlockFeeder;d.prototype.setModel=function(a){this._textModel=a};d.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=
[];this._gapBlocks=[];for(var d=a=0,b=0;b<this._mapper.length;b++){if(0!==this._mapper[b][2]){if(this._isAddedSide()){var f=a+this._mapper[b][1];this._diffBlocks.push([f,b]);this._gapBlocks.push([f,f+this._mapper[b][0],d])}else this._diffBlocks.push([a,b]),this._gapBlocks.push([a,a+this._mapper[b][1],d]);a+=this._mapper[b][0]+this._mapper[b][1]}else this._gapBlocks.push([a,a+this._mapper[b][this._mapperColumnIndex],d]),a+=this._mapper[b][this._mapperColumnIndex];d+=this._mapper[b][this._mapperColumnIndex]}}};
d.prototype.getBlockAnnoTypes=function(d){this._isAddedSide()?d.push({type:"block",normal:h,current:g,list:[]}):d.push({type:"block",normal:b,current:a,list:[]});d.push({type:"block",normal:p,current:q,list:[]})};d.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||0===this._diffBlocks.length)return null;d=this._diffBlocks[d][1];return 0===this._mapper[d][this._mapperColumnIndex]?{current:t,normal:u}:n.isMapperConflict(this.getMapper(),d)?{normal:p,current:q}:this._isAddedSide()?
{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:b,current:a,list:[]}};d.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};d.prototype.getLineNumber=function(a){for(var d=0;d<this._gapBlocks.length;d++)if(this._gapBlocks[d][0]!==this._gapBlocks[d][1]&&a>=this._gapBlocks[d][0]&&a<this._gapBlocks[d][1])return a-this._gapBlocks[d][0]+this._gapBlocks[d][2];return-1};return d}();
return e});
define("orion/compare/compareView","i18n!orion/compare/nls/messages orion/Deferred orion/webui/littlelib orion/compare/diffParser orion/compare/compareRulers orion/editor/editor orion/editor/editorFeatures orion/keyBinding orion/editor/textView orion/compare/compareUIFactory orion/compare/compareUtils orion/compare/jsdiffAdapter orion/compare/diffTreeNavigator".split(" "),function(l,n,m,k,e,h,g,b,a,f,d,p,q,u,t,y){var v={};v.CompareView=function(){function a(){this._diffParser=new k.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(a,d){return"\n"},_generateMapper:function(a,d,b,f,e){var g=this._getLineDelim(a,b);this._diffParser.setLineDelim(g);if(this.options.mapper&&this.options.toggler)return{delim:g,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if("string"===typeof d&&"string"===typeof a)return a=(new p.JSDiffAdapter).adapt(a,d,g),this.options.toggler&&
(this.options.mapper=a.mapper,this.options.newFile.Content=d,this.options.diffArray=a.changContents),{delim:g,mapper:a.mapper,output:d,diffArray:a.changContents};d=this._diffParser.parse(a,b,f,e);a=this._diffParser.getDiffArray();this.options.toggler&&(this.options.mapper=d.mapper,this.options.newFile.Content=d.outPutFile,this.options.diffArray=a);return{delim:g,mapper:d.mapper,output:d.outPutFile,diffArray:a}},_loadImageFile:function(a,d,b){var f=document.createElement("img");f.src=a;var e=new n;
f.onload=function(){d.appendChild(f);if(b){var a=document.createElement("hr");d.appendChild(a)}e.resolve(f.height)};f.onerror=function(){e.resolve(0)};return e},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&0<this.options.highlighters.length&&!(1>a.length||2<a.length))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],2===a.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(d){a.push(d.highlighter.highlight(d.target.fileName,d.target.contentType,d.target.editor))}.bind(this));n.all(a,function(a){return{_error:a}}).then(function(a){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,d){d&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(d){this.options[d]=a[d]}.bind(this));if(a.newFileOnRight){var b=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=b}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},
prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(a){},initImageMode:function(){}};return a}();v.TwoWayCompareView=function(){function d(a){this.setOptions(a,!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
this._uiFactory||(this._uiFactory=new f.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI());this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new e.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}d.prototype=new v.CompareView;d.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new e.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,d){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return l["There are unsaved changes."]}.bind(this)};
d.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(a){a.destroy()}),this._editors=null);this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};d.prototype.getImageMode=function(){return this._imageMode};d.prototype.getEditors=function(){return this._editors};d.prototype.gotoDiff=
function(a,d,b){b=b?this._editors[1].getTextView():this._editors[0].getTextView();a=b.getModel().getLineStart(a)+d;this._diffNavigator.gotoDiff(a,b)};d.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};d.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};d.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};d.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};d.prototype._createEditor=function(d,b,f,e,k){var p=
"undefined"===typeof e.readonly?!0:e.readonly,m=function(){var d=new a.TextView({parent:b,readonly:p,tabSize:4});this._viewLoadedCounter++;2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var f=this.getSplitter();f&&f.addResizeListener(function(a){if(a){var b=!1;(b=this._uiFactory.isLeftPane(a)?k:!k)&&d.resize()}}.bind(this));return d}.bind(this),n=e.keyBindingFactory;n||(n=new g.KeyBindingsFactory);var q=null;if(f)var u="",q=function(a,d){f&&
(u=d?l["ERROR: "]+a:a,f.textContent=""+u)};m=new h.Editor({textViewFactory:m,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,keyBindingFactory:n,statusReporter:q,domNode:b});m.installTextView();m.setInput(null,null,e.Content?e.Content:d);m.setOverviewRulerVisible(!1);var t=m.getTextView();t.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=
t.getCaretOffset(),this._diffNavigator.gotoDiff(a,t))}.bind(this));t.getModel().addEventListener("Changed",function(a){this._curveRuler.onChanged(a,!k)||(this.options.mapper=null)}.bind(this));k?t.addEventListener("Scroll",function(a){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):t.addEventListener("Scroll",function(a){this._curveRuler&&this._curveRuler.render()}.bind(this));return m};d.prototype.destroy=function(){this._editors&&
(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};d.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new e.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),d=new e.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);
this._editors[0].getTextView().addRuler(d);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};d.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var d=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return d._loadImageFile(d.options.oldFile.URL,d._uiFactory.getEditorParentDiv()).then(function(d){return(new n).resolve(a>d?a:
d)})})}var b=this.options.oldFile.Content,f=this.options.newFile.Content,e=this.options.diffContent;"string"===typeof f?e=this._generateMapper(b,f,e,this.options.hasConflicts):(e=this._generateMapper(b,f,e,this.options.hasConflicts),f=e.output);var g=new q.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),e.mapper,1,this.options.newFileOnRight),h=new q.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),e.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editors[0],this._editors[1],g,h,this._overviewRuler,this._curveRuler);this._curveRuler.init(e.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,f),this._editors[0].setInput(this.options.oldFile.Name,null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+
5;return a>b?a:b};d.prototype.refreshTitle=function(a,d){if(1===a){var b=this._uiFactory.getTitleDiv(!0);b&&(m.empty(b),b.appendChild(document.createTextNode(d||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(b=this._uiFactory.getTitleDiv(!1))m.empty(b),b.appendChild(document.createTextNode(d||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return d}();v.InlineCompareView=function(){function b(a){this.setOptions(a,
!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}b.prototype=new v.CompareView;b.prototype.addRulers=function(){this._textView&&!this._hasRuler&&(this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0)};b.prototype.removeRulers=function(){this._textView&&this._hasRuler&&
(this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1)};b.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};b.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};b.prototype.initEditors=function(d){var b=m.node(this._editorDiv),f=function(){return new a.TextView({parent:b,
readonly:!0,tabSize:4})}.bind(this);this._editor=new h.Editor({textViewFactory:f,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,domNode:b});this._editor.installTextView();this._editor.setInput(null,null,d);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new e.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._rulerNew=new e.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new e.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,d){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&
this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=this._textView.getCaretOffset(),this._diffNavigator.gotoDiff(a,this._textView))}.bind(this))};b.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null);m.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};b.prototype.getImageMode=function(){return this._imageMode};b.prototype._initDiffPosition=function(a){var d=a.getModel();if(d&&d.getAnnotations&&(d=d.getAnnotations(),0<d.length)){var d=
d[0][0],b=a.getLineHeight(),f=a.getClientArea(),b=Math.floor(f.height/b/3);a.setTopIndex(0<d-b?d-b:0)}};b.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var a=this;return this._loadImageFile(this.options.newFile.URL,m.node(this._editorDiv),!0).then(function(d){return a._loadImageFile(a.options.oldFile.URL,m.node(a._editorDiv)).then(function(a){return(new n).resolve(d+a+20)})})}var b=this.options.oldFile.Content,f=this.options.newFile.Content,
e=this._generateMapper(b,f,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);"string"!==typeof f&&(f=e.output);this._textView.getModel().setText(b);b=new q.inlineDiffBlockFeeder(e.mapper,1);f=new q.inlineDiffBlockFeeder(e.mapper,0);d.mergeDiffBlocks(this._textView.getModel(),f.getDiffBlocks(),e.mapper,e.diffArray.array,e.diffArray.index,this._diffParser._lineDelimiter);b.setModel(this._textView.getModel());f.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editor,this._editor,b,f,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();e=this._textView.getTopIndex();this._textView.redrawLines(e,e+1,this._overviewRuler);this._textView.redrawLines(e,e+1,this._rulerOrigin);this._textView.redrawLines(e,e+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};b.prototype.setConflicting=function(a){this._conflcit=a};return b}();v.toggleableCompareView=function(){function a(d,b){b&&(b.toggler=this);this._widget="inline"===d?new v.InlineCompareView(b):new v.TwoWayCompareView(b)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;
if(!this._imageMode){var d=this._widget.getCurrentDiffPos();a.blockNumber=d.block;a.changeNumber=d.change}this._widget.destroy();m.empty(m.node(a.parentDivId));this._widget="inline"===this._widget.type?new v.TwoWayCompareView(a):new v.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return v});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},
doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\\x3c\\S*\\\x3e",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},
number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",
patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="break case class catch continue const debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" ");l=l.grammars;l.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",
end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},
{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="abstract boolean break byte case catch char class continue default do double else extends false final finally float for if implements import instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try void volatile while".split(" ");l=l.grammars;l.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+
n.join("|")+")\\b",name:"keyword.control.java"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");l=
l.grammars;l.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},
{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+n.join("|")+")\\b",name:"keyword.control.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});
return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(l,n,m,k){function e(a,d){this.keywords=a;this.whitespacesVisible=d;this.setText("")}function h(){e.call(this,null,!0)}function g(a){e.call(this,null,a)}function b(){e.call(this,null,!1)}function a(a,k,l){this.commentStart="/*";this.commentEnd="*/";var m=[];switch(k){case "java":m=d;break;
case "js":m=f;break;case "css":m=p}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new e(m,this.whitespacesVisible);this._firstScanner=new b;this._commentScanner=new g(this.whitespacesVisible);this._whitespaceScanner=new h;"css"===k&&(this._scanner.isCSS=!0,this._firstScanner.isCSS=!0);this.view=a;this.annotationModel=l;this._bracketAnnotations=void 0;var n=this;this._listener=
{onChanged:function(a){n._onModelChanged(a)},onDestroy:function(a){n._onDestroy(a)},onLineStyle:function(a){n._onLineStyle(a)},onMouseDown:function(a){n._onMouseDown(a)},onSelection:function(a){n._onSelection(a)}};k=a.getModel();k.getBaseModel&&(k=k.getBaseModel());k.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var f=n.keywords,d=m.keywords,p=k.keywords,q={styleClass:"comment"},u={styleClass:"comment"},t={styleClass:"comment block documentation"},y={styleClass:"keyword other documentation markup"},v={styleClass:"keyword other documentation task"},x={styleClass:"keyword other documentation tag"},s={styleClass:"string"},w={styleClass:"constant numeric"},z={styleClass:"keyword"},C={styleClass:"punctuation separator space",
unmergeable:!0},r={styleClass:"punctuation separator tab",unmergeable:!0},A={styleClass:"meta annotation currentLine"};e.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);
return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var d=this.isCSS,b=this.offset-1;if(!d&&48<=a&&57>=a){var f=d=!1,e=!1,g=a;do if(a=this._read(),46===a&&!d)d=!0;else if(101===a&&!f)d=f=!0,a=this._read(),45!==a&&this._unread(a);else if(120===a&&48===g&&2===this.offset-b)d=f=e=!0;else if(!(48<=a&&57>=a||e&&(65<=a&&70>=a||97<=a&&102>=a)))break;while(1);this._unread(a);return 3}if(97<=a&&122>=a||65<=a&&90>=a||95===a||45===a&&d){do a=this._read();while(97<=a&&
122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a||45===a&&d);this._unread(a);a=this.keywords;if(0<a.length){b=this.text.substring(b,this.offset);for(d=0;d<a.length;d++)if(this.keywords[d]===b)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){-1!==a&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),d;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&47===a)for(;;)if(a=
this._read(),-1===a||10===a||13===a)return this._unread(a),6;if(42===a){a=this._read();d=7;for(42===a&&(d=8);;){for(;42===a;)if(a=this._read(),47===a)return d;if(-1===a)return this._unread(a),d;a=this._read()}}this._unread(a);return 1;case 39:for(d=4;;)switch(a=this._read(),a){case 39:return d;case 13:case 10:case -1:return this._unread(a),d;case 92:switch(a=this._read(),a){case 10:d=5;break;case 13:d=5,a=this._read(),10!==a&&this._unread(a)}}break;case 34:for(d=4;;)switch(a=this._read(),a){case 34:return d;
case 13:case 10:case -1:return this._unread(a),d;case 92:switch(a=this._read(),a){case 10:d=5;break;case 13:d=5,a=this._read(),10!==a&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};h.prototype=new e(null);h.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(32===a||9===a||-1===a));this._unread(a);
return 1}}};g.prototype=new e(null);g.prototype.setType=function(a){this._type=a};g.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);return 9;case 60:if(8===this._type){do a=this._read();while(!(62===a||-1===a));if(62===a)return 12}return 1;case 64:if(8===this._type){do a=this._read();while(97<=a&&122>=a||65<=a&&90>=
a||95===a||48<=a&&57>=a);this._unread(a);return 13}return 1;case 84:if(79===(a=this._read()))if(68===(a=this._read()))if(79===(a=this._read()))if(a=this._read(),!(97<=a&&122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(32===a||9===a||-1===a||60===a||64===a||84===a));this._unread(a);return 1}}};b.prototype=new e(null);b.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};a.prototype={destroy:function(){var a=this.view;if(a){var d=a.getModel();d.getBaseModel&&(d=d.getBaseModel());d.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
d){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,d&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,d,b,f,e){var g;void 0===f&&(f=-1);void 0===e&&(e=a.length);for(;1<e-f;)if(g=Math.floor((e+f)/2),d<=a[g].start)e=g;else if(b&&d<a[g].end){e=g;break}else f=g;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var d=this.annotationModel;if(d){d.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING);for(var b=[],f=a.getBaseModel(),e=this.comments,g=0;g<e.length;g++){var h=e[g];(h=this._createFoldingAnnotation(a,f,h.start,h.end))&&b.push(h)}d.replaceAnnotations(null,b)}}}},_createFoldingAnnotation:function(a,d,b,f){var e=d.getLineAtOffset(b);d=d.getLineAtOffset(f);return e===d?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(b,f,a)},_computeTasks:function(a,d,b){if(this.detectTasks){var f=
this.annotationModel;if(f){var e=this.view.getModel(),g=e;e.getBaseModel&&(g=e.getBaseModel());for(var h=f.getAnnotations(d,b),e=[],k=l.AnnotationType.ANNOTATION_TASK;h.hasNext();){var p=h.next();p.type===k&&e.push(p)}h=[];p=this._commentScanner;p.setText(g.getText(d,b));for(var m;m=p.nextToken();){var n=p.getStartOffset()+d;14===m&&(m=g.getLineEnd(g.getLineAtOffset(n)),6!==a&&(m=Math.min(m,b-this.commentEnd.length)),h.push(l.AnnotationType.createAnnotation(k,n,m,g.getText(n,m))))}f.replaceAnnotations(e,
h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var d=this.view,b=d.getModel(),d=d.getSelection();if(d.start===d.end&&b.getLineAtOffset(d.start)===a)return A}return null},_getStyles:function(a,d,b){a.getBaseModel&&(b=a.mapOffset(b));for(var f=b+d.length,e=[],g=b,h=this.comments,k=this._binarySearch(h,b,!0);k<h.length&&!(h[k].start>=f);k++){var l=h[k].start,p=h[k].end;g<l&&this._parse(d.substring(g-b,l-b),g,e);var m=h[k].type,n;switch(m){case 8:n=t;break;case 7:n=u;break;case 5:n=s}g=Math.max(g,
l);l=Math.min(f,p);(8===m||7===m)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(d.substring(g-b,l-b),g,e,n,m):5===m&&this.whitespacesVisible?this._parseString(d.substring(g-b,l-b),g,e,s):e.push({start:g,end:l,style:n});g=p}g<f&&this._parse(d.substring(g-b,f-b),g,e);if(a.getBaseModel)for(d=0;d<e.length;d++)b=e[d].end-e[d].start,e[d].start=a.mapOffset(e[d].start,!0),e[d].end=e[d].start+b;return e},_parse:function(a,d,b){var f=this._scanner;for(f.setText(a);a=f.nextToken();){var e=
f.getStartOffset()+d,g=null;switch(a){case 2:g=z;break;case 3:g=w;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(f.getData(),e,b,s);continue}else g=s;break;case 8:this._parseComment(f.getData(),e,b,t,a);continue;case 6:this._parseComment(f.getData(),e,b,q,a);continue;case 7:this._parseComment(f.getData(),e,b,u,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=C)}b.push({start:e,end:f.getOffset()+d,
style:g})}},_parseComment:function(a,d,b,f,e){var g=this._commentScanner;g.setText(a);for(g.setType(e);a=g.nextToken();){e=g.getStartOffset()+d;var h=f;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=C);break;case 12:h=y;break;case 13:h=x;break;case 14:h=v;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(g.getData(),e,b,h))}h&&b.push({start:e,end:g.getOffset()+d,style:h})}},_parseString:function(a,d,b,f){var e=
this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var g=e.getStartOffset()+d,h=f;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=C)}h&&b.push({start:g,end:e.getOffset()+d,style:h})}},_detectHyperlinks:function(a,d,b,f){var e=null,g;if(0<(g=a.indexOf("://"))){for(var e=a,h=g;0<h;){g=e.charCodeAt(h-1);if(!(97<=g&&122>=g||65<=g&&90>=g||45===g||48<=g&&57>=g))break;h--}if(0<h&&(g="\"\"''(){}[]\x3c\x3e".indexOf(e.substring(h-
1,h)),-1!==g&&0===(g&1)&&-1!==(g=e.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(g+1,g+2))))){var k=g;g=this._clone(f);g.tagName="a";g.attributes={href:e.substring(h,k)};b.push({start:d,end:d+h,style:f});b.push({start:d+h,end:d+k,style:g});b.push({start:d+k,end:d+a.length,style:f});return null}}else 0===a.toLowerCase().indexOf("bug#")&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id\x3d"+parseInt(a.substring(4),10));return e?(g=this._clone(f),g.tagName="a",g.attributes={href:e},g):f},_clone:function(a){if(!a)return a;
var d={},b;for(b in a)a.hasOwnProperty(b)&&(d[b]=a[b]);return d},_findComments:function(a,d){d=d||0;var b=this._firstScanner,f;b.setText(a);for(var e=[];f=b.nextToken();)(7===f||8===f||5===f)&&e.push({start:b.getStartOffset()+d,end:b.getOffset()+d,type:f}),(6===f||7===f||8===f)&&this._computeTasks(f,b.getStartOffset()+d,b.getOffset()+d);return e},_findMatchingBracket:function(a,d){var b="{}()[]\x3c\x3e",f=a.getText(d,d+1),e=b.indexOf(f,0);if(-1===e)return-1;var g;g=e&1?b.substring(e-1,e):b.substring(e+
1,e+2);for(var h=a.getLineAtOffset(d),b=a.getLine(h),k=a.getLineStart(h),l=a.getLineEnd(h),b=this._findBrackets(f,g,b,k,k,l),l=0;l<b.length;l++)if(k=0<=b[l]?1:-1,b[l]*k-1===d){var p=1;if(e&1){for(l--;0<=l;l--)if(k=0<=b[l]?1:-1,p+=k,0===p)return b[l]*k-1;for(h-=1;0<=h;){b=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);b=this._findBrackets(f,g,b,k,k,l);for(e=b.length-1;0<=e;e--)if(k=0<=b[e]?1:-1,p+=k,0===p)return b[e]*k-1;h--}}else{for(l++;l<b.length;l++)if(k=0<=b[l]?1:-1,p+=k,0===p)return b[l]*
k-1;h+=1;for(e=a.getLineCount();h<e;){b=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);b=this._findBrackets(f,g,b,k,k,l);for(l=0;l<b.length;l++)if(k=0<=b[l]?1:-1,p+=k,0===p)return b[l]*k-1;h++}}break}return-1},_findBrackets:function(a,d,b,f,e,g){var h=[];a=a.charCodeAt(0);d=d.charCodeAt(0);for(var k=e,l=this._scanner,p,m=this.comments,n=this._binarySearch(m,e,!0);n<m.length&&!(m[n].start>=g);n++){p=m[n].start;var q=m[n].end;if(k<p)for(l.setText(b.substring(k-e,p-e));p=l.nextToken();)p===a?h.push(l.getStartOffset()+
k-e+f+1):p===d&&h.push(-(l.getStartOffset()+k-e+f+1));k=q}if(k<g)for(l.setText(b.substring(k-e,g-e));p=l.nextToken();)p===a?h.push(l.getStartOffset()+k-e+f+1):p===d&&h.push(-(l.getStartOffset()+k-e+f+1));return h},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){a.textView===this.view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var d=a.oldValue,b=a.newValue,f=this.view;a=f.getModel();var e;
if(this.highlightCaretLine){var g=a.getLineAtOffset(d.start);e=a.getLineAtOffset(b.start);var h=b.start===b.end,d=d.start===d.end;g===e&&d&&h||(d&&f.redrawLines(g,g+1),(g!==e||!d)&&h&&f.redrawLines(e,e+1))}if(this.annotationModel){var d=this._bracketAnnotations,k,p;if(b.start===b.end&&0<(p=f.getCaretOffset()))p-=1,a.getBaseModel&&(p=a.mapOffset(p),a=a.getBaseModel()),a=this._findMatchingBracket(a,p),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),
l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,p,p+1)]);this._bracketAnnotations=k;this.annotationModel.replaceAnnotations(d,k)}},_onMouseDown:function(a){if(2===a.clickCount){var d=this.view,b=d.getModel(),f=d.getOffsetAtLocation(a.x,a.y);if(0<f){var e=f-1,g=b;b.getBaseModel&&(e=b.mapOffset(e),g=b.getBaseModel());e=this._findMatchingBracket(g,e);-1!==e&&(a.preventDefault(),a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),f>a&&(f--,a++),d.setSelection(a,f))}}},_onModelChanged:function(a){var d=
a.start,b=a.removedCharCount,f=a.addedCharCount-b,e=this.view;a=e.getModel();var g=a.getBaseModel?a.getBaseModel():a,b=d+b,h=g.getCharCount(),k=this.comments.length,p=g.getLineStart(g.getLineAtOffset(d)),m=this._binarySearch(this.comments,p,!0),n=this._binarySearch(this.comments,b,!1,m-1,k);m<k&&this.comments[m].start<=p&&p<this.comments[m].end?(p=this.comments[m].start,p>d&&(p+=f)):p=m===k&&0<k&&h-f===this.comments[k-1].end?this.comments[k-1].start:p;var q;n<k?(q=this.comments[n].end,q>d&&(q+=f),
n+=1):(n=k,q=h);for(var h=g.getText(p,q),u,h=this._findComments(h,p),k=m;k<this.comments.length;k++)u=this.comments[k],u.start>d&&(u.start+=f),u.start>d&&(u.end+=f);var t=n-m!==h.length;if(!t)for(k=0;k<h.length;k++){u=this.comments[m+k];var w=h[k];if(u.start!==w.start||u.end!==w.end||u.type!==w.type){t=!0;break}}k=[m,n-m].concat(h);Array.prototype.splice.apply(this.comments,k);t&&(k=p,u=q,a!==g&&(k=a.mapOffset(k,!0),u=a.mapOffset(u,!0)),e.redrawRange(k,u));if(this.foldingEnabled&&g!==a&&this.annotationModel){e=
this.annotationModel;m=e.getAnnotations(p,q);p=[];for(q=[];m.hasNext();)if(u=m.next(),u.type===l.AnnotationType.ANNOTATION_FOLDING){q.push(u);for(k=0;k<h.length&&!(u.start===h[k].start&&u.end===h[k].end);k++);k===h.length?(p.push(u),u.expand()):(k=u.start,n=u.end,k>d&&(k-=f),n>d&&(n-=f),k<=d&&(d<n&&k<=b&&b<n)&&(k=g.getLineAtOffset(u.start),n=g.getLineAtOffset(u.end),k!==n?u.expanded||u.expand():e.removeAnnotation(u)))}d=[];for(k=0;k<h.length;k++){u=h[k];for(f=0;f<q.length&&!(q[f].start===u.start&&
q[f].end===u.end);f++);f===q.length&&(u=this._createFoldingAnnotation(a,g,u.start,u.end))&&d.push(u)}e.replaceAnnotations(p,d)}}};return{TextStyler:a}});
define("orion/editor/textStyler",["orion/editor/annotations","orion/editor/eventTarget"],function(l,n){function m(a,b){this._patternManager=new k(a,b)}function k(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function e(a,b,d,e,g,h,k){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.name=b;this.typeId=d;this.styler=
e;this.parent=h;k&&k(this);this._subBlocks=e.computeBlocks(g,g.getText(this.start,this.end),this,this.start,null,null,null)}function h(a){this._styler=a}function g(a,b,d){this._highlightCaretLine=this._whitespacesVisible=this._spacesVisible=this._tabsVisible=!1;this._detectTasks=this._foldingEnabled=!0;this._view=a;this._annotationModel=b;this._stylerAdapter=d;this._stylerAdapter.setStyler(this);this._accessor=new h(this);this._bracketAnnotations;var e=this;this._listener={onChanged:function(a){e._onModelChanged(a)},
onDestroy:function(a){e._onDestroy(a)},onLineStyle:function(a){e._onLineStyle(a)},onMouseDown:function(a){e._onMouseDown(a)},onSelection:function(a){e._onSelection(a)}};d=a.getModel();d.getBaseModel&&(d=d.getBaseModel());d.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);
var g=d.getCharCount();this._rootBlock=this._stylerAdapter.createBlock({start:0,contentStart:0,end:g,contentEnd:g},this,d,null);b&&(g=[],b.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),a.getModel(),g),this._detectTasks&&(b.removeAnnotations(l.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,d,g)),b.replaceAnnotations([],g));a.redrawLines()}var b=function(a,b,d,e,g){var h;void 0===e&&(e=-1);void 0===g&&(g=a.length);for(;1<
g-e;)if(h=Math.floor((g+e)/2),b<=a[h].start)g=h;else if(d&&b<a[h].end){g=h;break}else e=h;return g};m.prototype={blockSpansBeyondEnd:function(a){return a.pattern.regexEnd===this._eolRegex},computeBlocks:function(a,b,d,e,g,h,k){if(!b)return[];var l=[],m=[];g=g||0;h=h||Infinity;k=k||Infinity;d.blockPatterns.forEach(function(a){var d=this._findMatch(a.regexBegin||a.regex,b,g);d&&m.push({result:d,pattern:a})}.bind(this));if(!m.length)return l;m.sort(function(a,d){return a.result.index<d.result.index?
-1:a.result.index>d.result.index?1:a.pattern.pattern.index<d.pattern.pattern.index?-1:1});for(var n=0;0<m.length;){var s=m[0];m.splice(0,1);if(h<s.result.index)break;if(!(s.result.index<n)){var n=e+s.result.index,w=s.result.index,z=null,C=s.pattern.regexEnd;if(C){var w=w+s.result[0].length,r=s.pattern,A=this._substituteCaptureValues(C,s.result);A!==C&&(r={pattern:r.pattern,regexBegin:r.regexBegin,regexEnd:A},C=A);for(A=w;!z;){A=this._findMatch(C,b,A);A||(this._eolRegex.lastIndex=0,A=this._eolRegex.exec(b),
r={pattern:r.pattern,regexBegin:r.regexBegin,regexEnd:this._eolRegex});var D=this.createBlock({start:n,end:e+A.index+A[0].length,contentStart:e+w,contentEnd:e+A.index},d.styler,a,d,r),B=D.getBlocks();if(!B.length||B[B.length-1].end<=A.index+e)z=D;A=A.index+A[0].length}}else z=this.createBlock({start:n,end:n+s.result[0].length,contentStart:n,contentEnd:n+s.result[0].length},d.styler,a,d,s.pattern);l.push(z);if(l.length===k||h<=z.end)break;n=z.end-e}this._updateMatch(s,b,m,n,h)}return l},computeStyle:function(a,
f,d){if(!a.pattern)return null;var e={start:a.start,end:a.end,style:a.pattern.pattern.name};if(a.contentStart<=d&&d<a.contentEnd)return a.pattern.pattern.contentName?{start:a.contentStart,end:a.contentEnd,style:a.pattern.pattern.contentName}:e;var g,h;if(d<a.contentStart){h=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures;if(!h)return e;g=a.pattern.regexBegin;f=f.getText(a.start,a.contentStart);a=a.start}else{h=a.pattern.pattern.endCaptures||a.pattern.pattern.captures;if(!h)return e;g=
a.pattern.regexEnd;f=f.getText(a.contentEnd,a.end);a=a.contentEnd}g.lastIndex=0;if(g=g.exec(f))if(f=[],this._getCaptureStyles(g,h,a,f),(h=f[b(f,d,!0)])&&h.start<=d&&d<h.end)return h;return e},createBlock:function(a,b,d,g,h){return new e(a,h?h.pattern.name:null,h?h.pattern.id:null,b,d,g,function(a){a.pattern=h;a.linePatterns=[];a.blockPatterns=[];a.enclosurePatterns={};this._initPatterns(this._patternManager,a)}.bind(this))},getBlockContentStyleName:function(a){return a.pattern.pattern.contentName||
a.pattern.pattern.name},getBlockEndStyle:function(a,b,d,e){var g;if(a.pattern.regexEnd&&(g=this._findMatch(a.pattern.regexEnd,b,0)))(b=a.pattern.pattern.endCaptures||a.pattern.pattern.captures)?this._getCaptureStyles(g,b,d-g[0].length,e):a.pattern.pattern.name&&e.push({start:d-g[0].length,end:d,style:a.pattern.pattern.name});return g?g[0]:null},getBlockStartStyle:function(a,b,d,e){var g;if(a.pattern.regexBegin&&(g=this._findMatch(a.pattern.regexBegin,b,0)))(b=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures)?
this._getCaptureStyles(g,b,d,e):e.push({start:d,end:d+g[0].length,style:a.pattern.pattern.name});return g?g[0]:null},getBracketMatch:function(a,b){for(var d,e=Object.keys(a.enclosurePatterns),g=0;g<e.length;g++){var h=a.enclosurePatterns[e[g]],k=this._findMatch(h.regex,b,0);if(k&&0===k.index){d=h;break}}if(!d)return null;g=!1;-1!==d.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)?(g=!0,e=d.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN,this._PUNCTUATION_SECTION_END)):e=d.pattern.name.replace(this._PUNCTUATION_SECTION_END,
this._PUNCTUATION_SECTION_BEGIN);return!a.enclosurePatterns[e]?null:{beginName:d.pattern.name,endName:e,atStart:g}},parse:function(a,b,d,e,g){if(a&&(d=d.linePatterns)){var h=[];d.forEach(function(d){var b=d.regex||d.regexBegin;b.oldLastIndex=b.lastIndex;(b=this._findMatch(b,a,0))&&h.push({result:b,pattern:d})}.bind(this));h.sort(function(a,d){return a.result.index<d.result.index?-1:a.result.index>d.result.index?1:a.pattern.pattern.index<d.pattern.pattern.index?-1:1});for(var k=0;0<h.length;){var l=
h[0];h.splice(0,1);if(!(l.result.index<k)){var m=l.result.index,n,s=[];if(l.pattern.regex){k=l.result;n=m+k[0].length;n={start:b+m,end:b+n,style:l.pattern.pattern.name};if(!g){l.pattern.pattern.captures&&this._getCaptureStyles(k,l.pattern.pattern.captures,b+m,s);s.sort(function(a,d){return a.start<d.start?-1:a.start>d.start?1:0});for(m=0;m<s.length-1;m++)if(s[m+1].start<s[m].end){var w={start:s[m+1].end,end:s[m].end,style:s[m].style};s[m].end=s[m+1].start;s.splice(m+2,0,w)}}this._mergeStyles(n,s,
e)}else k=l.pattern.regexEnd,k=this._substituteCaptureValues(k,l.result),k=this._findMatch(k,a,l.result.index+l.result[0].length),k||(this._eolRegex.lastIndex=0,k=this._eolRegex.exec(a)),n=k.index+k[0].length,e.push({start:b+m,end:b+n,style:l.pattern.pattern.name});k=k.index+k[0].length}this._updateMatch(l,a,h,k)}d.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},setStyler:function(){},verifyBlock:function(a,b,d,e){var g=null,h=[];d.parent.blockPatterns.forEach(function(a){var d=
this._findMatch(a.regexBegin||a.regex,b,0);d&&h.push({result:d,pattern:a})}.bind(this));h.sort(function(a,d){return!a.result.index&&d.result.index?-1:a.result.index&&!d.result.index?1:!a.result.index&&!d.result.index?a.pattern.pattern.index<d.pattern.pattern.index?-1:1:0});if(!h.length||0!==h[0].result.index||h[0].pattern.pattern.id!==d.pattern.pattern.id)g=!1;else{var k=h[0],l=k.pattern.regexEnd;if(l){for(var l=this._substituteCaptureValues(l,k.result),k=k.result[0].length,m=this._findMatch(l,b,
k);null===g&&m&&d.start+m.index!==d.contentEnd+e;){var n=this.computeBlocks(a,b,d,d.start,k,m.index+1,null);!n.length||n[n.length-1].end<=d.start+m.index?g=!1:n.length?(k=n[n.length-1].end-d.start,m=this._findMatch(l,b,k)):m=null}m||(this._eolRegex.lastIndex=0,m=this._eolRegex.exec(b),g=d.start+m.index===d.end+e)}else g=d.start+k.result[0].length===d.end+e}return null!==g?g:!0},_findMatch:function(a,b,d,e){var g=d,h=a.lastIndex;this._linebreakRegex.lastIndex=d;d=this._linebreakRegex.exec(b);var k,
l;a.lastIndex=0;if(d){for(l=d.index;0<=--l&&!(k=b.charAt(l),k===this._NEWLINE||k===this._CR););k=b.substring(l+1,d.index+d[1].length);a.lastIndex=l=d.index-l-1}for(;d&&d.index<b.length;){var m;if(e){var n=a.lastIndex;a.test(k)&&(a.lastIndex=n,m=a.exec(k))}else m=a.exec(k);if(m)return m.index+=g,m.index-=l,a.lastIndex=h,m;l=0;g+=d[0].length;if(d=this._linebreakRegex.exec(b))k=d[1],a.lastIndex=0}a.lastIndex=h;return null},_getCaptureStyles:function(a,b,d,e){if(b[0])e.push({start:d,end:d+a[0].length,
style:b[0].name});else for(var g=0,h=1;h<a.length;h++)if(a[h]){var k=b[h];if(k){var l=d+g;e.push({start:l,end:l+a[h].length,style:k.name})}g+=a[h].length}},_initPatterns:function(a,b){if(b.pattern&&b.pattern.pattern.linePatterns)b.linePatterns=b.pattern.pattern.linePatterns,b.blockPatterns=b.pattern.pattern.blockPatterns,b.enclosurePatterns=b.pattern.pattern.enclosurePatterns;else{var d=a.getPatterns(b.pattern?b.pattern.pattern:null),e=function(a){a="string"===typeof a?a:a.match;var d=this._ignoreCaseRegex.exec(a),
b=this._FLAGS;d&&(a=a.substring(d[0].length),b+="i");return RegExp(a,b)}.bind(this),g=-1,h=0;d.forEach(function(a){var d;if(a.match&&!a.begin&&!a.end){if(d={regex:e(a.match),pattern:a},b.linePatterns.push(d),a.name&&0===a.name.indexOf("punctuation.section")&&(-1!==a.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)||-1!==a.name.indexOf(this._PUNCTUATION_SECTION_END)))b.enclosurePatterns[a.name]=d}else!a.match&&(a.begin&&a.end)&&(g=h,d={regexBegin:e(a.begin),regexEnd:e(a.end),pattern:a},b.linePatterns.push(d));
h++}.bind(this));b.blockPatterns=b.linePatterns.slice(0,g+1);b.pattern&&(b.pattern.pattern.enclosurePatterns=b.enclosurePatterns,b.pattern.pattern.linePatterns=b.linePatterns,b.pattern.pattern.blockPatterns=b.blockPatterns)}},_mergeStyles:function(a,b,d){var e=a.start;b.forEach(function(b){e<=b.start&&d.push({start:e,end:b.start,style:a.style});d.push(b);e=b.end});e<a.end&&d.push({start:e,end:a.end,style:a.style})},_substituteCaptureValues:function(a,b){var d=a.toString();this._captureReferenceRegex.lastIndex=
0;if(!this._captureReferenceRegex.test(d))return a;this._captureReferenceRegex.lastIndex=0;for(var e=this._captureReferenceRegex.exec(d);e;)d=d.replace(e[0],b[e[1]]||""),this._captureReferenceRegex.lastIndex=0,e=this._captureReferenceRegex.exec(d);return RegExp(d.substring(1,d.length-1-this._FLAGS.length),this._FLAGS)},_updateMatch:function(a,b,d,e,g){var h=a.pattern.regex?a.pattern.regex:a.pattern.regexBegin;g=g||Infinity;if((b=this._findMatch(h,b,e,!0))&&b.index<g){a.result=b;for(g=0;g<d.length;g++)if(b.index<
d[g].result.index||b.index===d[g].result.index&&a.pattern.pattern.index<d[g].pattern.pattern.index){d.splice(g,0,a);return}d.push(a)}},_captureReferenceRegex:/\\(\d)/g,_eolRegex:/$/,_ignoreCaseRegex:/^\(\?i\)\s*/,_linebreakRegex:/(.*)(?:[\r\n]|$)/g,_CR:"\r",_FLAGS:"g",_NEWLINE:"\n",_PUNCTUATION_SECTION_BEGIN:".begin",_PUNCTUATION_SECTION_END:".end"};k.prototype={getPatterns:function(a){a?(a="string"===typeof a?a:a.qualifiedId,a+="#"):a=this._rootId+"#"+this._NO_ID;var b=[0],d={},e=RegExp("^"+a+"[^#]+$");
this._patterns.forEach(function(a){e.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,d):(a.index=b[0]++,d[a.id]=a))}.bind(this));var g=[];Object.keys(d).forEach(function(a){g.push(d[a])});return g},_addPattern:function(a,b,d){a.parentId=d;a.id=b;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_addPatterns:function(a,b){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,b)}.bind(this))},
_addRepositoryPatterns:function(a,b){Object.keys(a).forEach(function(d){this._addPattern(a[d],d,b)}.bind(this))},_processInclude:function(a,b,d){var e,g=a.include.indexOf("#");e=0===g?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===g?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){e.test(a.qualifiedId)&&(a.include?this._processInclude(a,b,d):d[a.id]||(a.index=b[0]++,d[a.id]=a))}.bind(this))},_NO_ID:"NoID"};
e.prototype={adjustBounds:function(a,b){a<this.start&&(this.start+=b);a<this.contentStart&&(this.contentStart+=b);a<=this.end&&(this.end+=b);a<=this.contentEnd&&(this.contentEnd+=b);this._subBlocks.forEach(function(d){a<=d.end&&d.adjustBounds(a,b)})},getBlocks:function(){return this._subBlocks},getBlockAtIndex:function(a){return b(this.getBlocks(),a,!0)},isRenderingWhitespace:function(){return this.styler._isRenderingWhitespace()}};h.prototype={getStyles:function(a){return this._styler.getStyles(a)}};
g.prototype={computeBlocks:function(a,b,d,e,g,h,k){return this._stylerAdapter.computeBlocks(a,b,d,e,g,h,k)},destroy:function(){if(this._view){var a=this._view.getModel();a.getBaseModel&&(a=a.getBaseModel());a.removeEventListener("Changed",this._listener.onChanged);this._view.removeEventListener("MouseDown",this._listener.onMouseDown);this._view.removeEventListener("Selection",this._listener.onSelection);this._view.removeEventListener("Destroy",this._listener.onDestroy);this._view.removeEventListener("LineStyle",
this._listener.onLineStyle);this._view=null}},getBlockAtIndex:function(a){return this._findBlock(this._rootBlock,a)},getRootBlock:function(){return this._rootBlock},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var e=[],d=this._view.getModel();d.getBaseModel&&(d=d.getBaseModel());var g=this._findBlock(this._rootBlock,a),h=d.getLineAtOffset(a),k=d.getLine(h),l=[];this._stylerAdapter.parse(k,d.getLineStart(h),g,l);for((h=l[b(l,a,!0)])&&(h.start<=a&&a<h.end)&&e.push(h);g;)(h=
this._stylerAdapter.computeStyle(g,d,a))&&e.splice(0,0,h),g=g.parent;return e},setDetectHyperlinks:function(){},setDetectTasks:function(a){this._detectTasks=a},setFoldingEnabled:function(a){this._foldingEnabled=a},setHighlightCaretLine:function(a){this._highlightCaretLine=a},setSpacesVisible:function(a){this._spacesVisible!==a&&(this._spacesVisible=a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setTabsVisible:function(a){this._tabsVisible!==a&&(this._tabsVisible=
a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setWhitespacesVisible:function(a,b){this._whitespacesVisible!==a&&(this._whitespacesVisible=a,b&&this._view.redraw())},_computeFolding:function(a,b,d){if(b.getBaseModel){var e=b.getBaseModel();a.forEach(function(a){var g=this._createFoldingAnnotation(b,e,a.start,a.end);g&&d.push(g);this._computeFolding(a.getBlocks(),b,d)}.bind(this))}},_computeTasks:function(a,b,d,e,g){e=e||a.start;g=g||a.end;if(a.start<=
g&&e<=a.end&&this._annotationModel){var h=l.AnnotationType.ANNOTATION_TASK;if(a.name&&0===a.name.indexOf("comment")){var k=[];this._stylerAdapter.parse(b.getText(a.contentStart,a.end),a.contentStart,a,k,!0);for(var m=0;m<k.length;m++)"meta.annotation.task.todo"===k[m].style&&(e<=k[m].start&&k[m].end<=g)&&d.push(l.AnnotationType.createAnnotation(h,k[m].start,k[m].end,b.getText(k[m].start,k[m].end)))}a.getBlocks().forEach(function(a){this._computeTasks(a,b,d,e,g)}.bind(this))}},_createFoldingAnnotation:function(a,
b,d,e){var g=b.getLineAtOffset(d),h=b.getLineAtOffset(e);return g===h||g+1===h&&b.getLineStart(h)===b.getLineEnd(h)?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(d,e,a)},_findBlock:function(a,e){var d=a.getBlocks();if(!d.length)return a;var g=b(d,e,!0);return g<d.length&&d[g].start<=e&&e<d[g].end?this._findBlock(d[g],e):a},_findBrackets:function(a,e,d,g,h){for(var k=[],l=[],m=g,n=e.getBlocks(),x=b(n,g,!0);x<n.length&&!(n[x].start>=h);x++){var s=n[x].start,w=n[x].end;m<s&&
(this._stylerAdapter.parse(d.substring(m-g,s-g),m,e,l),l.forEach(function(d){0===d.style.indexOf(a.beginName)?k.push(d.start+1):0===d.style.indexOf(a.endName)&&k.push(-(d.start+1))}),l=[]);m=w}m<h&&(this._stylerAdapter.parse(d.substring(m-g,h-g),m,e,l),l.forEach(function(d){d.style&&(0===d.style.indexOf(a.beginName)?k.push(d.start+1):0===d.style.indexOf(a.endName)&&k.push(-(d.start+1)))}));return k},_findMatchingBracket:function(a,b,d){var e=a.getLineAtOffset(d),g=a.getLineEnd(e),h=a.getText(d,g),
h=this._stylerAdapter.getBracketMatch(b,h);if(!h)return-1;for(var k=a.getLine(e),l=a.getLineStart(e),g=this._findBrackets(h,b,k,l,g),m=0;m<g.length;m++)if(k=0<=g[m]?1:-1,g[m]*k-1===d){d=1;if(h.atStart){for(m++;m<g.length;m++)if(k=0<=g[m]?1:-1,d+=k,0===d)return g[m]*k-1;e+=1;for(m=a.getLineCount();e<m;){k=a.getLine(e);l=a.getLineStart(e);g=a.getLineEnd(e);g=this._findBrackets(h,b,k,l,g);for(l=0;l<g.length;l++)if(k=0<=g[l]?1:-1,d+=k,0===d)return g[l]*k-1;e++}}else{for(m--;0<=m;m--)if(k=0<=g[m]?1:-1,
d+=k,0===d)return g[m]*k-1;for(e-=1;0<=e;){k=a.getLine(e);l=a.getLineStart(e);g=a.getLineEnd(e);g=this._findBrackets(h,b,k,l,g);for(m=g.length-1;0<=m;m--)if(k=0<=g[m]?1:-1,d+=k,0===d)return g[m]*k-1;e--}}break}return-1},_getLineStyle:function(a){if(this._highlightCaretLine){var b=this._view.getModel(),d=this._view.getSelection();if(d.start===d.end&&b.getLineAtOffset(d.start)===a)return this._caretLineStyle}return null},_getStyles:function(a,e,d,g){e.getBaseModel&&(g=e.mapOffset(g));for(var h=g+d.length,
k=[],l=g,m=a.getBlocks(),n=b(m,g,!0);n<m.length&&!(m[n].start>=h);n++){var x=m[n].start,s=m[n].end;l<x&&this._stylerAdapter.parse(d.substring(l-g,x-g),l,a,k);var w=Math.max(l,x);w===x&&(x=this._stylerAdapter.getBlockStartStyle(m[n],d.substring(w-g),w,k))&&(w+=x.length);var x=Math.min(h,s),z=[];x===s&&(l=d.substring(x-l-(m[n].end-m[n].contentEnd)),(l=this._stylerAdapter.getBlockEndStyle(m[n],l,x,z))&&(x-=l.length));var l=this._getStyles(m[n],e,d.substring(w-g,x-g),w),C=this._stylerAdapter.getBlockContentStyleName(m[n]);
if(C){var r=w;l.forEach(function(a){a.start-r&&k.push({start:r,end:a.start,style:C});a.mergeable&&(a.style+=","+C);k.push(a);r=a.end});x-r&&k.push({start:r,end:x,style:C})}else k=k.concat(l);k=k.concat(z);l=s}l<h&&this._stylerAdapter.parse(d.substring(l-g,h-g),l,a,k);if(e.getBaseModel)for(a=0;a<k.length;a++)d=k[a].end-k[a].start,k[a].start=e.mapOffset(k[a].start,!0),k[a].end=k[a].start+d;return k},_isRenderingWhitespace:function(){return this._whitespacesVisible&&(this._tabsVisible||this._spacesVisible)},
_onDestroy:function(){this.destroy()},_onLineStyle:function(a){a.textView===this._view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(this._rootBlock,a.textView.getModel(),a.lineText,a.lineStart);a.ranges.forEach(function(a){a.style&&(a.style={styleClass:a.style.replace(/\./g," ")})});this._isRenderingWhitespace()&&(this._spacesVisible&&this._spliceStyles(this._spacePattern,a.ranges,a.lineText,a.lineStart),this._tabsVisible&&this._spliceStyles(this._tabPattern,a.ranges,a.lineText,
a.lineStart))},_onModelChanged:function(a){var e=a.start,d=a.removedCharCount;a=a.addedCharCount-d;var g=this._view.getModel(),h=g.getBaseModel?g.getBaseModel():g,d=e+d,k=h.getCharCount(),m=h.getLineStart(h.getLineAtOffset(e)),n=this._findBlock(this._rootBlock,e),v,x,s,w,z,C,r;do{s=n.parent;if(!v&&s&&(z=h.getText(n.start,Math.min(k,n.end+a+1)),!this._stylerAdapter.verifyBlock(h,z,n,a))){n=s;continue}x=n.getBlocks();var A=x.length,D=b(x,m,!0),B=b(x,d,!1,D-1,A);v=!1;if(D&&x.length&&x[D-1].end===e){z=
h.getText(x[D-1].start,Math.min(k,e+1));var E=this.computeBlocks(h,z,n,x[D-1].start,null,null,null);E.length&&E[0].end!==x[D-1].end&&(D--,v=!0)}D<A&&x[D].start<=m&&(m<x[D].end||v)?(r=x[D].start,r>e&&(r+=a)):D===A&&0<A&&n.end-a===x[A-1].end?(r=x[--D].start,r>e&&(r+=a)):r=Math.max(m,n.contentStart);C=B<A?x[B].end:n.contentEnd;e<=C&&(C+=a);C=Math.min(C,k-1);z=h.getText(r,C+1);E=this.computeBlocks(h,z,n,r,null,null,null);if(B<A){if(E.length&&E[E.length-1].end===C&&E[E.length-1].typeId===x[B].typeId)break;
if(E.length&&this._stylerAdapter.blockSpansBeyondEnd(E[E.length-1])){B++;for(var K=E[E.length-1].getBlocks(),K=(K.length?K[K.length-1]:E[E.length-1]).typeId;B<A;){if(x[B].typeId===K){var L=x[B].end+a,L=Math.min(L,k-1);z=h.getText(r,L+1);z=this.computeBlocks(h,z,n,r,null,null,null);if(z.length&&z[z.length-1].end===L){C=L;E=z;break}}B++}if(B<A)break}}else if(!E.length||E[E.length-1].end<=n.contentEnd+a)break;if(!s){C=k;B=A;z=h.getText(r,C);E=this.computeBlocks(h,z,n,r,null,null,null);break}n=s;w=!0}while(1);
this._rootBlock.adjustBounds(e,a);B=Math.min(B+1,A);w||(w=B-D!==E.length);if(!w)for(A=0;A<E.length;A++)if(v=x[D+A],k=E[A],v.start!==k.start||v.end!==k.end||v.typeId!==k.typeId){w=!0;break}!x.length&&!E.length?this.dispatchEvent({type:"BlocksChanged",old:[n],"new":[n]}):this.dispatchEvent({type:"BlocksChanged",old:x.slice(D,B),"new":E});D=[D,B-D].concat(E);Array.prototype.splice.apply(x,D);w&&(x=r,w=C,g!==h&&(x=g.mapOffset(x,!0),w=g.mapOffset(w,!0)),this._view.redrawRange(x,w));if(this._annotationModel){x=
[];var F=[],G=[];w=this._annotationModel.getAnnotations(r,C);D=this._foldingEnabled&&h!==g;for(B=n.parent||n;w.hasNext();)E=w.next(),D&&E.type===l.AnnotationType.ANNOTATION_FOLDING?(G.push(E),v=this._findBlock(B,E.start),!v||!(E.start===v.start&&E.end===v.end)?(x.push(E),E.expand()):(v=E.start,A=E.end,v>e&&(v-=a),A>e&&(A-=a),v<=e&&(e<A&&v<=d&&d<A)&&(v=h.getLineAtOffset(E.start),A=h.getLineAtOffset(E.end),v!==A?E.expanded||E.expand():x.push(E)))):E.type===l.AnnotationType.ANNOTATION_TASK&&n.start<=
E.start&&E.end<=n.end&&x.push(E);D&&B.getBlocks().forEach(function(a){this._updateFolding(a,h,g,G,F,r,C)}.bind(this));this._detectTasks&&this._computeTasks(n,h,F,r,C);this._annotationModel.replaceAnnotations(x,F)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this._view.getModel(),d=this._view.getOffsetAtLocation(a.x,a.y);if(0<d){var e=d-1,g=b;b.getBaseModel&&(e=b.mapOffset(e),g=b.getBaseModel());var h=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(g,h,e);-1!==e&&(a.preventDefault(),
a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),this._view.setSelection(a,d))}}},_onSelection:function(a){var b=a.oldValue,d=a.newValue;a=this._view.getModel();var e;if(this._highlightCaretLine){var g=a.getLineAtOffset(b.start);e=a.getLineAtOffset(d.start);var h=d.start===d.end,b=b.start===b.end;g===e&&b&&h||(b&&this._view.redrawLines(g,g+1),(g!==e||!b)&&h&&this._view.redrawLines(e,e+1))}if(this._annotationModel){var b=this._bracketAnnotations,k,m;if(d.start===d.end&&0<(m=this._view.getCaretOffset()))m-=
1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),d=this._findBlock(this._rootBlock,m),a=this._findMatchingBracket(a,d,m),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,m,m+1)]);this._bracketAnnotations=k;this._annotationModel.replaceAnnotations(b,k)}},_spliceStyles:function(a,b,d,e){for(var g=a.regex,h=g.lastIndex=0,k=g.exec(d);k;){for(k=e+k.index;h<b.length&&!(k<
b[h].end);)h++;var l={start:k,end:k+1,style:a.style};if(h<b.length&&b[h].start<=k){var m={start:k+1,end:b[h].end,style:b[h].style};b[h].end=k;b.splice(h+1,0,m);b.splice(h+1,0,l);h+=2}else b.splice(h,0,l),h++;k=g.exec(d)}},_updateFolding:function(a,e,d,g,h,k,l){k=k||a.start;l=l||a.end;if(!a.doNotFold&&a.start<=l&&k<=a.end){var m=b(g,a.start,!0);m<g.length&&g[m].start===a.start&&g[m].end===a.end||(m=this._createFoldingAnnotation(d,e,a.start,a.end))&&h.push(m);a.getBlocks().forEach(function(a){this._updateFolding(a,
e,d,g,h,k,l)}.bind(this))}},_caretLineStyle:{styleClass:"meta annotation currentLine"},_spacePattern:{regex:/[ ]/g,style:{styleClass:"punctuation separator space",unmergeable:!0}},_tabPattern:{regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}}};n.EventTarget.addMixin(g.prototype);return{TextStyler:g,Block:e,createPatternBasedAdapter:function(a,b){return new m(a,b)}}});
define("orion/editor/textMateStyler",["orion/regex"],function(l){function n(e){var h;if(e instanceof Array){h=Array(e.length);for(var g=0;g<e.length;g++)h[g]=n(e[g])}else for(g in h={},e)if(Object.prototype.hasOwnProperty.call(e,g)){var b=e[g];h[g]="object"===typeof b&&null!==b?n(b):b}return h}function m(e,h,g){this.initialize(e);this.grammar=n(h);this.externalGrammars=g?n(g):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var k={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(e){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(e){return"\x3d"===e[1]?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(e){return"atomic group"}}],toRegExp:function(e){function h(a,d){throw Error('Unsupported regex feature "'+a+'": "'+d[0]+'" at index: '+d.index+" in "+d.input);}var g="",b;e=k.processGlobalFlag("x",e,function(a){for(var d="",b=!1,e=a.length,g=0;g<e;){var h=a.charAt(g);if(!b&&"#"===h)for(;g<e&&"\r"!==h&&"\n"!==h;)h=a.charAt(++g);
else if(!b&&/\s/.test(h))for(;g<e&&/\s/.test(h);)h=a.charAt(++g);else"\\"===h?(d+=h,/\s/.test(a.charAt(g+1))||(d+=a.charAt(g+1),g+=1)):("["===h?b=!0:"]"===h&&(b=!1),d+=h),g+=1}return d});e=k.processGlobalFlag("i",e,function(a){g+="i";return a});for(b=0;b<this.unsupported.length;b++){var a;(a=this.unsupported[b].regex.exec(e))&&h(this.unsupported[b].func(a),a)}return RegExp(e,g)},processGlobalFlag:function(e,h,g){var b="(?"+e+")";e="(?"+e+":";if(h.substring(0,b.length)===b)return g(h.substring(b.length));
if(h.substring(0,e.length)===e){for(var b=0,a=h.length,f=-1,d=0;d<a&&-1===f;d++)switch(h.charAt(d)){case "\\":d++;break;case "(":b++;break;case ")":b--,0===b&&(f=d)}b=f;if(b<h.length-1)throw Error("Only a "+e+") group that encloses the entire regex is supported in: "+h);return g(h.substring(e.length,b))}return h},hasBackReference:function(e){return/\\\d+/.test(e.source)},getSubstitutedRegex:function(e,h,g){g="undefined"===typeof g?!0:!1;e=e.source.split(/(\\\d+)/g);for(var b=[],a=0;a<e.length;a++){var f=
e[a],d=/\\(\d+)/.exec(f);d?(f=h[d[1]]||"",b.push(g?l.escape(f):f)):b.push(f)}return RegExp(b.join(""))},groupify:function(e,h){for(var g=e.source,b=g.length,a=[],f=0,d=[],k=1,l=1,m=[],n={},y={},v=0;v<b;v++){var x=a[a.length-1],s=g.charAt(v);switch(s){case "(":4===x&&(a.pop(),m.push(")"),d[d.length-1].end=v);var w=v+2<b?g.charAt(v+1)+""+g.charAt(v+2):null;if("?:"===w||"?\x3d"===w||"?!"===w){var z;"?:"===w?z=1:(z=3,f++);a.push(z);d.push({start:v,end:-1,type:z});m.push(s);m.push(w);v+=w.length}else a.push(2),
d.push({start:v,end:-1,type:2,oldNum:k,num:l}),m.push(s),0===f&&(y[l]=null),n[k]=l,k++,l++;break;case ")":x=a.pop();3===x&&f--;d[d.length-1].end=v;m.push(s);break;case "*":case "+":case "?":case "}":var C=s,r=g.charAt(v-1),w=v-1;if("}"===s){for(z=v-1;"{"!==g.charAt(z)&&0<=z;z--);r=g.charAt(z-1);w=z-1;C=g.substring(z,v+1)}z=d[d.length-1];if(")"===r&&(2===z.type||4===z.type)){m.splice(z.start,0,"(");m.push(C);m.push(")");s={start:z.start,end:m.length-1,type:4,num:z.num};for(r=0;r<d.length;r++)if(x=
d[r],(2===x.type||4===x.type)&&x.start>=z.start&&x.end<=w)x.start+=1,x.end+=1,x.num+=1,2===x.type&&(n[x.oldNum]=x.num);d.push(s);l++;break}default:"|"!==s&&(2!==x&&4!==x)&&0===f&&(a.push(4),d.push({start:v,end:-1,type:4,num:l}),m.push("("),y[l]=null,l++),m.push(s),"\\"===s&&(s=g.charAt(v+1),m.push(s),v+=1)}}for(;a.length;)a.pop(),m.push(")");g=RegExp(m.join(""));b={};h=h||n;for(var A in h)h.hasOwnProperty(A)&&(b[A]="\\"+h[A]);g=this.getSubstitutedRegex(g,b,!1);return[g,n,y]},complexCaptures:function(e){if(!e)return!1;
for(var h in e)if(e.hasOwnProperty(h)&&"0"!==h)return!0;return!1}};m.prototype={initialize:function(e){this.textView=e;this.textView.stylerOptions=this;var h=this;this._listener={onModelChanged:function(e){h.onModelChanged(e)},onDestroy:function(e){h.onDestroy(e)},onLineStyle:function(e){h.onLineStyle(e)},onStorage:function(e){h.onStorage(e)}};e.addEventListener("ModelChanged",this._listener.onModelChanged);e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",this._listener.onLineStyle);
e.redrawLines()},onDestroy:function(e){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null);this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(e){for(e=[e];0!==e.length;){var h=e.pop();if(!h._resolvedRule||!h._typedRule)if(h._resolvedRule=
this._resolve(h),h._typedRule=this._createTypedRule(h),this.addStyles(h.name),this.addStyles(h.contentName),this.addStylesForCaptures(h.captures),this.addStylesForCaptures(h.beginCaptures),this.addStylesForCaptures(h.endCaptures),h._resolvedRule!==h&&e.push(h._resolvedRule),h.patterns)for(var g=0;g<h.patterns.length;g++)e.push(h.patterns[g])}},addStyles:function(e){if(e&&!this._styles[e]){this._styles[e]=[];for(var h=e.split("."),g=0;g<h.length;g++)this._styles[e].push(h.slice(0,g+1).join("-"))}},
addStylesForCaptures:function(e){for(var h in e)e.hasOwnProperty(h)&&this.addStyles(e[h].name)},ContainerRule:function(){function e(e){this.rule=e;this.subrules=e.patterns}e.prototype.valueOf=function(){return"aa"};return e}(),BeginEndRule:function(){function e(e){this.rule=e;this.beginRegex=k.toRegExp(e.begin);this.endRegex=k.toRegExp(e.end);this.subrules=e.patterns||[];this.endRegexHasBackRef=k.hasBackReference(this.endRegex);var g=k.complexCaptures(e.captures);e=k.complexCaptures(e.beginCaptures)||
k.complexCaptures(e.endCaptures);if(this.isComplex=g||e)g=k.groupify(this.beginRegex),this.beginRegex=g[0],this.beginOld2New=g[1],this.beginConsuming=g[2],g=k.groupify(this.endRegex,this.beginOld2New),this.endRegex=g[0],this.endOld2New=g[1],this.endConsuming=g[2]}e.prototype.valueOf=function(){return this.beginRegex};return e}(),MatchRule:function(){function e(e){this.rule=e;this.matchRegex=k.toRegExp(e.match);if(this.isComplex=k.complexCaptures(e.captures))e=k.groupify(this.matchRegex),this.matchRegex=
e[0],this.matchOld2New=e[1],this.matchConsuming=e[2]}e.prototype.valueOf=function(){return this.matchRegex};return e}(),_createTypedRule:function(e){return e.match?new this.MatchRule(e):e.begin?new this.BeginEndRule(e):new this.ContainerRule(e)},_resolve:function(e){var h=e;if(e.include){if(e.begin||e.end||e.match)throw Error('Unexpected regex pattern in "include" rule '+e.include);e=e.include;if("#"===e.charAt(0)){if(h=this.grammar.repository&&this.grammar.repository[e.substring(1)],!h)throw Error("Couldn't find included rule "+
e+" in grammar repository");}else if("$self"===e)h=this.grammar;else{if("$base"===e)throw Error('Include "$base" is not supported');h=this._allGrammars[e];if(!h)for(var g=0;g<this.externalGrammars.length;g++){var b=this.externalGrammars[g];if(b.scopeName===e){this.preprocess(b);h=this._allGrammars[e]=b;break}}}}return h},ContainerNode:function(){function e(e,g){this.parent=e;this.rule=g;this.children=[];this.end=this.start=null}e.prototype.addChild=function(e){this.children.push(e)};e.prototype.valueOf=
function(){var e=this.rule;return"ContainerNode { "+(e.include||"")+" "+(e.name||"")+(e.comment||"")+"}"};return e}(),BeginEndNode:function(){function e(e,g,b){this.parent=e;this.rule=g;this.children=[];this.setStart(b);this.endMatch=this.end=null;this.endRegexSubstituted=g.endRegexHasBackRef?k.getSubstitutedRegex(g.endRegex,b):null}e.prototype.addChild=function(e){this.children.push(e)};e.prototype.getIndexInParent=function(e){return this.parent?this.parent.children.indexOf(this):-1};e.prototype.setStart=
function(e){this.start=e.index;this.beginMatch=e};e.prototype.setEnd=function(e){e&&"object"===typeof e?(this.endMatch=e,this.end=e.index+e[0].length):(this.endMatch=null,this.end=e)};e.prototype.shiftStart=function(e){this.start+=e;this.beginMatch.index+=e};e.prototype.shiftEnd=function(e){this.end+=e;this.endMatch&&(this.endMatch.index+=e)};e.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range\x3d"+this.start+".."+this.end+"}"};return e}(),push:function(e,h){if(h)for(var g=h.length;0<
g;)e.push(h[--g])},exec:function(e,h,g){if(h=e.exec(h))h.index+=g;e.lastIndex=0;return h},afterMatch:function(e){return e.index+e[0].length},getEndMatch:function(e,h,g){if(e instanceof this.BeginEndNode){var b=e.rule;e=e.endRegexSubstituted||b.endRegex;return!e?null:this.exec(e,h,g)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(e){var h=e.addedCharCount,
g=e.removedCharCount;e=e.start;if(this._tree){var b=this.textView.getModel(),a=b.getCharCount(),b=b.getLineEnd(b.getLineAtOffset(e)-1),f=this.getFirstDamaged(b,b),b=-1===b?0:b,h=f?this.parse(f,!0,b,e,h,g):a;this.textView.redrawRange(b,h)}else this.initialParse()},getFirstDamaged:function(e,h){if(0>e)return this._tree;for(var g=[this._tree],b=null;g.length;){var a=g.pop();if(!a.parent||this.isDamaged(a,e,h)){a instanceof this.BeginEndNode&&(b=a);for(var f=0;f<a.children.length;f++)g.push(a.children[f])}}return b||
this._tree},isDamaged:function(e,h,g){return e.start<=g&&e.end>h},parse:function(e,h,g,b,a,f){var d=this.textView.getModel(),k=d.getLineStart(d.getLineCount()-1),l=d.getCharCount(),m=this.getInitialExpected(e,g),n=-1;h&&(e.repaired=!0,e.endNeedsUpdate=!0,n=(n=e.children[e.children.length-1])?d.getLineEnd(d.getLineAtOffset(n.end+(a-f))):-1,b=d.getLineEnd(d.getLineAtOffset(b+f)),n=Math.max(n,b));n=-1===n?l:n;b=m;for(var y=e,v=!1,x=g,s=-1;y&&(!h||x<n);){var w=this.getNextMatch(d,y,x);w||(x=x>=k?l:d.getLineStart(d.getLineAtOffset(x)+
1));var z=w&&w.match,C=w&&w.rule,r=w&&w.isEnd;if(w&&w.isSub)x=this.afterMatch(z),C instanceof this.BeginEndRule&&(v=!0,h&&C===b.rule&&y===b.parent?(y=b,y.setStart(z),y.repaired=!0,y.endNeedsUpdate=!0,b=this.getNextExpected(b,"begin")):(h&&(this.prune(y,b),h=!1),z=new this.BeginEndNode(y,C,z),y.addChild(z),y=z));else if(r||x===l)y instanceof this.BeginEndNode&&(z?(v=!0,s=Math.max(s,y.end),y.setEnd(z),x=this.afterMatch(z),h&&y===b&&y.parent===b.parent?(y.repaired=!0,delete y.endNeedsUpdate,b=this.getNextExpected(b,
"end")):h&&(this.prune(y,b),h=!1)):(y.setEnd(l),delete y.endNeedsUpdate)),y=y.parent;h&&(x>=n&&!v)&&(this.prune(e,m),h=!1)}this.removeUnrepairedChildren(e,h,g);this.cleanup(h,e,g,n,l,a,f);return h?Math.max(s,x):x},removeUnrepairedChildren:function(e,h,g){if(h){h=e.children;for(var b=-1,a=0;a<h.length;a++){var f=h[a];if(!f.repaired&&this.isDamaged(f,g,Number.MAX_VALUE)){b=a;break}}-1!==b&&(e.children.length=b)}},cleanup:function(e,h,g,b,a,f,d){if(e){e=f-d;a=this.getIntersecting(b-e+1,a);h=this.getIntersecting(g,
b);for(g=0;g<a.length;g++)b=a[g],!b.repaired&&b instanceof this.BeginEndNode&&(b.shiftEnd(e),b.shiftStart(e));for(g=0;g<h.length;g++)b=h[g],b.repaired&&b.endNeedsUpdate&&b.shiftEnd(e),delete b.endNeedsUpdate,delete b.repaired}else{h=this.getIntersecting(g,b);for(g=0;g<h.length;g++)delete h[g].repaired}},getNextMatch:function(e,h,g,b){var a=e.getLineAtOffset(g),a=e.getLineEnd(a),f=e.getText(g,a),d=[],k=[];e=[];a=[];for(this.push(d,h.rule.subrules);d.length;){var l=d.length?d.pop():null,l=l&&l._resolvedRule._typedRule;
if(l instanceof this.ContainerRule&&-1===k.indexOf(l))k.push(l),this.push(d,l.subrules);else if(!l||!b||l.matchRegex){var m=l&&this.exec(l.matchRegex||l.beginRegex,f,g);m&&(e.push(m),a.push(l))}}d=Number.MAX_VALUE;k=-1;for(l=0;l<e.length;l++)m=e[l],m.index<d&&(d=m.index,k=l);if(!b&&(g=this.getEndMatch(h,f,g)))if(b=h.rule.applyEndPatternLast,-1===k||g.index<d||!b&&g.index===d)return{isEnd:!0,rule:h.rule,match:g};return-1===k?null:{isSub:!0,rule:a[k],match:e[k]}},getInitialExpected:function(e,h){var g,
b;if(e===this._tree)for(g=0;g<e.children.length;g++){if(b=e.children[g],b.start>=h)return b}else if(e instanceof this.BeginEndNode&&e.endMatch){var a=e.endMatch.index;for(g=0;g<e.children.length&&!(b=e.children[g],b.start>=h);g++);if(b&&b.start<a)return b}return e},getNextExpected:function(e,h){if("begin"===h){var g=e.children[0];return g?g:e}if("end"===h&&(g=e.parent)){var b=g.children[g.children.indexOf(e)+1];return b?b:g}return null},prune:function(e,h){h.parent===e?e.children.length=h.getIndexInParent():
e instanceof this.BeginEndNode&&(e.endMatch=null,e.end=null);e.parent&&(e.parent.children.length=e.getIndexInParent()+1)},onLineStyle:function(e){this._tree||this.initialParse();var h=e.lineStart,g=this.textView.getModel(),b=g.getLineEnd(e.lineIndex),a=g.getLineEnd(g.getLineAtOffset(h)-1),a=this.getFirstDamaged(a,a),h=this.getLineScope(g,a,h,b);e.ranges=this.toStyleRanges(h);e.ranges.sort(function(a,d){return a.start-d.start})},getLineScope:function(e,h,g,b){for(var a=g,f=this.getInitialExpected(h,
g),d=[],k=[];h&&a<b;){var l=this.getNextMatch(e,h,a);if(!l)break;var m=l&&l.match,n=l&&l.rule,y=l&&l.isSub,l=l&&l.isEnd;m.index!==a&&k.push({start:a,end:m.index,node:h});y?(a=this.afterMatch(m),n instanceof this.BeginEndRule?(this.addBeginScope(d,m,n),h=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(d,m,n)):l&&(a=this.afterMatch(m),this.addEndScope(d,m,n),f=this.getNextExpected(f,"end"),h=h.parent)}a<b&&k.push({start:a,end:b,node:h});e=this.getInheritedLineScope(k,g,b);return d.concat(e)},
getInheritedLineScope:function(e,h,g){h=[];for(g=0;g<e.length;g++)for(var b=e[g],a=b.node;a;){var f=a.rule.rule,d=f.name;if(f=f.contentName||d){this.addScopeRange(h,b.start,b.end,f);break}a=a.parent}return h},addBeginScope:function(e,h,g){var b=g.rule;this.addCapturesScope(e,h,b.beginCaptures||b.captures,g.isComplex,g.beginOld2New,g.beginConsuming)},addEndScope:function(e,h,g){var b=g.rule;this.addCapturesScope(e,h,b.endCaptures||b.captures,g.isComplex,g.endOld2New,g.endConsuming)},addMatchScope:function(e,
h,g){var b=g.rule,a=b.name;(b=b.captures)?this.addCapturesScope(e,h,b,g.isComplex,g.matchOld2New,g.matchConsuming):this.addScope(e,h,a)},addScope:function(e,h,g){g&&e.push({start:h.index,end:this.afterMatch(h),scope:g})},addScopeRange:function(e,h,g,b){b&&e.push({start:h,end:g,scope:b})},addCapturesScope:function(e,h,g,b,a,f){if(g)if(b){b={1:0};for(var d=0,k=1;void 0!==h[k];k++)void 0!==f[k]&&(d+=h[k].length),void 0!==h[k+1]&&(b[k+1]=d);f=h.index;for(d=1;g[d];d++){var k=g[d].name,l=a[d],m=f+b[l];
"undefined"!==typeof h[l]&&this.addScopeRange(e,m,m+h[l].length,k)}}else this.addScope(e,h,g[0]&&g[0].name)},getIntersecting:function(e,h){for(var g=[],b=this._tree?[this._tree]:[];b.length;){var a=b.pop(),f=!1;a instanceof this.ContainerNode?f=!0:this.isDamaged(a,e,h)&&(f=!0,g.push(a));if(f)for(var f=a.children.length,d=0;d<f;d++)b.push(a.children[d])}return g.reverse()},toStyleRanges:function(e){for(var h=[],g=0;g<e.length;g++){var b=e[g],a=this._styles[b.scope];if(!a)throw Error("styles not found for "+
b.scope);a=a.join(" ");h.push({start:b.start,end:b.end,style:{styleClass:a}})}return h}};return{RegexUtil:k,TextMateStyler:m}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(l,n){function m(g){return-1!==g.getProperty("objectClass").indexOf(e)&&"highlighter"===g.getProperty("type")}function k(e,b,a){this.initialize(e,b,a);this.lineStyles=[]}var e="orion.edit.highlighter",h=e+" service must be an event emitter";n.AnnotationType.registerType("orion.annotation.highlightError",{title:l.syntaxError,html:"\x3cdiv class\x3d'annotationHTML error'\x3e\x3c/div\x3e",rangeStyle:{styleClass:"annotationRange error"}});
k.prototype={initialize:function(g,b,a){this.textView=g;this.serviceRegistry=b;this.annotationModel=a;this.services=[];var f=this;this.listener={onModelChanging:function(a){f.onModelChanging(a)},onModelChanged:function(a){f.onModelChanged(a)},onDestroy:function(a){f.onDestroy(a)},onLineStyle:function(a){f.onLineStyle(a)},onStyleReady:function(a){f.onStyleReady(a)},onServiceAdded:function(a){f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){f.onServiceRemoved(a.serviceReference,
f.serviceRegistry.getService(a.serviceReference))}};g.addEventListener("ModelChanging",this.listener.onModelChanging);g.addEventListener("ModelChanged",this.listener.onModelChanged);g.addEventListener("Destroy",this.listener.onDestroy);g.addEventListener("LineStyle",this.listener.onLineStyle);b.addEventListener("registered",this.listener.onServiceAdded);b.addEventListener("unregistering",this.listener.onServiceRemoved);g=b.getServiceReferences(e);for(a=0;a<g.length;a++){var d=g[a];m(d)&&this.addServiceListener(b.getService(d))}},
onDestroy:function(e){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null);if(this.services){for(var e=0;e<this.services.length;e++)this.removeServiceListener(this.services[e]);this.services=
null}this.serviceRegistry&&(this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null);this.lineStyles=this.listener=null},onModelChanging:function(e){this.startLine=this.textView.getModel().getLineAtOffset(e.start)},onModelChanged:function(e){var b=this.startLine;(e.addedLineCount||e.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[b,e.removedLineCount].concat(this._getEmptyStyle(e.addedLineCount)))},
onStyleReady:function(e){var b=e.lineStyles||e.style;e=Number.MAX_VALUE;var a=-1,f=this.textView.getModel(),d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(this.lineStyles[d]=b[d],e=Math.min(e,d),a=Math.max(a,d));e=Math.max(e,0);a=Math.min(a,f.getLineCount());if(b=this.annotationModel){for(var h=b.getAnnotations(f.getLineStart(e),f.getLineEnd(a)),k=[];h.hasNext();){var l=h.next();"orion.annotation.highlightError"===l.type&&k.push(l)}h=[];for(l=e;l<=a;l++){d=l;var m=this.lineStyles[d],m=m&&
m.errors;d=f.getLineStart(d);if(m)for(var y=0;y<m.length;y++){var v=m[y];h.push(n.AnnotationType.createAnnotation("orion.annotation.highlightError",v.start+d,v.end+d))}}b.replaceAnnotations(k,h)}this.textView.redrawLines(e,a+1)},onLineStyle:function(e){var b=this.lineStyles[e.lineIndex];if(b)if(b.ranges){for(var b=b.ranges,a=e.lineStart,f=b.length,d=[],h=0;h<f;h++){var k=b[h];d.push({start:k.start+a,end:k.end+a,style:k.style})}e.ranges=d}else b.style&&(e.style=b.style)},_getEmptyStyle:function(e){for(var b=
[],a=0;a<e;a++)b.push(null);return b},setContentType:function(e){this.contentType=e;if(this.services)for(e=0;e<this.services.length;e++){var b=this.services[e];if(b.setContentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(e,b){m(e)&&this.addServiceListener(b)},onServiceRemoved:function(e,
b){-1!==this.services.indexOf(b)&&this.removeServiceListener(b)},addServiceListener:function(e){if("function"===typeof e.addEventListener){if(e.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(e),e.setContentType&&this.contentType){var b=this.serviceRegistry.getService("orion.page.progress");b?b.progress(e.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):e.setContentType(this.contentType)}}else"undefined"!==
typeof console&&console.log(Error(h))},removeServiceListener:function(e){"function"===typeof e.removeEventListener?(e.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),e=this.services.indexOf(e),-1!==e&&this.services.splice(e,1)):"undefined"!==typeof console&&console.log(Error(h))}};return k});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(l,n,m,k,e){function h(a,f,d,g,h,u,t){function y(a,b){var g=a.getProperty("contentType")||a.getProperty("contentTypes"),h=a.getProperty("fileTypes");return g?e.when(f.isSomeExtensionOf(d,g)).then(function(d){return d?a:null}):b&&h&&-1!==h.indexOf(b)?(g=new e,g.resolve(a),g):null}function v(a){var d=null;switch(a&&a.id){case "application/javascript":case "application/json":d=
new l.TextStyler(g,"js",h);break;case "text/x-java-source":d=new l.TextStyler(g,"java",h);break;case "text/css":d=new l.TextStyler(g,"css",h)}return d}if(!b){var x=v(d);if(x)return u=new e,u.resolve(x),u}b&&!this.orionGrammars&&(this.orionGrammars={});x=u&&u.split(".").pop().toLowerCase();u=a.getServiceReferences("orion.edit.highlighter");for(var s=[],w=[],z=0;z<u.length;z++){var C=u[z],r=C.getProperty("type");"grammar"===r||!b&&"undefined"===typeof r?s.push(C.getProperty("grammar")):"highlighter"!==
r&&(r=C.getProperty("id"))&&!this.orionGrammars[r]&&(this.orionGrammars[r]={id:r,contentTypes:C.getProperty("contentTypes"),patterns:C.getProperty("patterns"),repository:C.getProperty("repository")});(C=y(C,x))&&w.push(C)}return e.all(w,function(a){return{_error:a}}).then(function(e){for(var f,l=e.length-1;0<=l;l--){var u=e[l];if(u&&!u._error&&(t||"highlighter"!==u.getProperty("type"))){f=u;break}}var w;if(f)if(e=f.getProperty("type"),"highlighter"===e)w=new k(g,a,h),w.setContentType(d);else if("grammar"===
e||!b&&"undefined"===typeof e)f=f.getProperty("grammar"),w=new m.TextMateStyler(g,f,s);else if(b){w=[];for(var r in this.orionGrammars)w.push(this.orionGrammars[r]);f=new n.createPatternBasedAdapter(w,f.getProperty("id"));w=new n.TextStyler(g,h,f)}return w})}function g(a,b){this.serviceRegistry=a;this.contentTypeService=b;this.styler=null}var b=1;g.prototype={setup:function(a,b,d,e,g){g="undefined"===typeof g?!0:g;this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var k=this;
return h(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,b,d,e,g).then(function(a){return k.styler=a})},getStyler:function(){return this.styler}};return{createStyler:h,SyntaxHighlighter:g}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(l){function n(m,k,e){l.attach(this);this._binderFunc=k;this.setInputField(m);(m=e?e.group:null)||(m=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=m+"__completion__";this._proposeFromStart=e?e.proposeFromStart:!1;this._extendedProvider=e?e.extendedProvider:null;this._serviceRegistry=e?e.serviceRegistry:null;this._onDelete=e?e.onDelete:null;this._deleteToolTips=
e?e.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];e=function(e){this._binderFunc&&this._binderFunc(function(g){this._bind(g);e.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",e);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:e});e=function(e){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",e);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:e});e=function(e){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",e);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:e})}n.prototype._removeListeners=function(l){l&&l.forEach(function(k){k.evtTarget.removeEventListener(k.type,k.handler,!1)})};n.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};n.prototype.hasValueOf=function(l){return this._dataList.some(function(k){return k.value===l})};n.prototype.setInputField=function(l){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=l;"string"===typeof this._inputField&&(this._inputField=document.getElementById(this._inputField));l=function(k){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):document.activeElement!==this._inputField&&this._dismiss()}.bind(this);this._inputField.addEventListener("blur",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:l});l=function(k){this.onKeyDown(k)}.bind(this);this._inputField.addEventListener("keydown",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:l});l=function(k){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",l);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:l});l=function(k){this._dismissed&&this._binderFunc&&(this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(e){this._bind(e)}.bind(this)))}.bind(this);this._inputField.addEventListener("focus",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:l})};n.prototype.onKeyDown=function(l){if(this._dismissed)return!0;var k=l.charCode||l.keyCode;if(13===k){if(this._proposalList&&0<this._proposalList.length&&0<=this._proposalIndex&&
this._proposalIndex<this._proposalList.length)return l.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,l.ctrlKey),l.stopPropagation(),!1}else{if((40===k||38===k)&&this._proposalList&&0<this._proposalList.length)return l.preventDefault(),this._walk(40===k),l.stopPropagation(),!1;if(27===k)return l.preventDefault(),this._dismiss(),!1;if(46===k&&-1<this._proposalIndex&&this._onDelete)return l.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),l.stopPropagation(),!1}return!0};n.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};n.prototype._bind=function(l){this._dataList=l};n.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};n.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
n.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());this._completionUIContainer||(this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer));this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());this._completionUL||(this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL");this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};n.prototype._createProposalLink=function(l,k,e,h){var g=
document.createElement("a");g.href=require.toUrl(k);g.appendChild(this._createBoldText(l,e,h));return g};n.prototype._createBoldText=function(l,k,e,h){if(0>k)return document.createTextNode(l);h=h?h:document.createElement("span");var g;0!==k&&(g=document.createTextNode(l.substring(0,k)),h.appendChild(g));var b=document.createElement("b");h.appendChild(b);g=document.createTextNode(l.substring(k,k+e));b.appendChild(g);k+e<l.length&&(g=document.createTextNode(l.substring(k+e)),h.appendChild(g));return h};
n.prototype._proposeOnCategory=function(l,k){if(0!==k.length){var e;if(l){e=document.createElement("li");e.className="inputCompletionLICategory";var h=document.createTextNode(l);e.appendChild(h);this._completionUL.appendChild(e)}k.forEach(function(g){e=document.createElement("li");e.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);e.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);e.className="inputCompletionLINormal";e.completionItem=g.item;
var b;if("string"===typeof g.item.value){var a=document.createElement("table");a.style.width="100%";a.style.tableLayout="fixed";a.style.borderSpacing="0";var f=document.createElement("tr");f.style.width=this._inputField.offsetWidth+"px";a.appendChild(f);var d=document.createElement("td");d.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(g.item.value,g.boldIndex,g.boldLength);d.appendChild(h);d.style.overflow="hidden";f.appendChild(d);this._onDelete&&(b=document.createElement("button"),
b.classList.add("inputCompletionDismissButton"),b.classList.add("layoutRight"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),b.style.display="none",b.style.margin="0 0 0",b.title=this._deleteToolTips,b.onclick=function(a){a.stopPropagation();this._onDelete(g.item.value,this);this._resetIndexAfterDeletion()}.bind(this),d=document.createElement("td"),d.classList.add("inputCompletionLIRightTD"),d.appendChild(b),f.appendChild(d));e.appendChild(a)}else g.item.value.name&&"link"===
g.item.value.type&&e.appendChild(this._createProposalLink(g.item.value.name,g.item.value.value,g.boldIndex,g.boldLength));this._completionUL.appendChild(e);this._proposalList.push({item:g.item,domNode:e,deleteBtn:b})}.bind(this))}};n.prototype._domNode2Index=function(l){if(this._proposalList)for(var k=0;k<this._proposalList.length;k++)if(this._proposalList[k].domNode===l)return k;return-1};n.prototype._highlight=function(l,k){var e=l,h,g=!1;isNaN(e)||(g=!0,this._proposalList&&0<=l&&l<this._proposalList.length?
(e=this._proposalList[l].domNode,h=this._proposalList[l].deleteBtn):e=null);e&&(e.className=k?"inputCompletionLISelected":"inputCompletionLINormal",h&&(h.style.display=k?"":"none"),k&&g&&(e.offsetTop<this._completionUIContainer.scrollTop?e.scrollIntoView(!0):e.offsetTop+e.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&e.scrollIntoView(!1)))};n.prototype._selectProposal=function(l,k){var e=l;isNaN(e)&&(e=this._domNode2Index(l));if(e!==this._proposalIndex||
k)this._highlight(this._proposalIndex,!1),this._proposalIndex=e,this._highlight(this._proposalIndex,!0)};n.prototype._dismiss=function(l,k){this._mouseDown||(this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,"string"===typeof l?(this._inputField.value=l,this._dismissing=!0,this._inputField.focus()):l&&(l.name&&"link"===l.type)&&(k?window.open(l.value):window.location.href=l.value),this._completionUIContainer.style.display="none")};n.prototype._show=function(){if(this._proposalList&&
0<this._proposalList.length){for(var l=0,k=0,e=this._inputField;e;)l+=e.offsetLeft,k+=e.offsetTop,e=e.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=k+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=l+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display=
"none"};n.prototype._walk=function(l){l=this._proposalIndex+(l?1:-1);-1>l?l=this._proposalList.length-1:l>=this._proposalList.length&&(l=-1);this._selectProposal(l)};n.prototype._proposeOnList=function(l,k,e){var h="",g=[],b=k?k.length:0;l.forEach(function(a){if("category"===a.type)this._proposeOnCategory(h,g),h=a.label,g=[];else{var f=!0,d=-1;if(k&&e){var l;"string"===typeof a.value?l=a.value.toLowerCase():a.value.name&&(l=a.value.name.toLowerCase());d=l.indexOf(k);0>d?f=!1:this._proposeFromStart&&
(f=0===d)}f&&g.push({item:a,boldIndex:d,boldLength:b})}}.bind(this));this._proposeOnCategory(h,g)};n.prototype._proposeOn=function(l){this._completionUL.textContent="";var k=l?l.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,k,!0);this._extendedProvider&&k?this._extendedProvider(l,function(e){e&&e.forEach(function(e){this._proposeOnList(e.proposals,e.filterForMe?k:l,e.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};n.prototype.constructor=n;return{InputCompletion:n}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages orion/editor/find orion/commands orion/objects orion/searchUtils orion/inputCompletion/inputCompletion orion/webui/littlelib".split(" "),function(l,n,m,k,e,h,g){function b(a,b,d,e,g){n.Find.call(this,a,e,g);this._serviceRegistry=b;this._commandService=d}b.prototype=new n.Find;k.mixin(b.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?n.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?n.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();n.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){n.Find.prototype.show.call(this,a);var b=a.findString;this._addRecentfind(b);a=a.replaceString;var d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));
b&&(d.value=b);a&&(document.getElementById("localSearchReplaceWith").value=a);window.setTimeout(function(){d.select();d.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw\x3d\x3d",this._replaceInfo.title=l["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."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw\x3d\x3d",
this._replaceInfo.title=l["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."]);this._replaceInfo.style.display=""},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(b){var d=document.createElement("input");d.type="text";d.name=l["Find:"];d.className="parameterInput";d.id="localSearchFindWith";
d.placeholder=l["Find With"];d.oninput=function(d){return a._handleInput(d)};d.onkeydown=function(d){return a._handleKeyDown(d)};b.appendChild(d);a._initCompletion(d);a._createButton(l.Next,b,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(l.Previous,b,function(){a._addRecentfind(a.getFindString());a.find(!1)});var e=a._editor.getTextView().getOptions("readonly");if(!e){var g=document.createElement("input");g.type="text";g.name=l["ReplaceWith:"];g.className="parameterInput";
g.id="localSearchReplaceWith";g.placeholder=l["Replace With"];g.onkeydown=function(d){return a._handleKeyDown(d)};b.appendChild(g);a._replaceInfo=a._createInfoImage(null,b,null);a._showReplaceInfo();a._createButton(l.Replace,b,function(){a.replace()});a._createButton(l["Replace All"],b,function(){a.replaceAll()})}g=document.createElement("div");b.appendChild(g);g.classList.add("findOptionsDiv");var h=m.createDropdownMenu(g,l.Options,null,"dismissButton",null,!0);h.menuButton.classList.add("parameterInlineButton");
m.createCheckedMenuItem(h.menu,l["Show all"],a._showAll,function(d){a.setOptions({showAll:d.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Case sensitive"],!a._caseInsensitive,function(d){a.setOptions({caseInsensitive:!d.target.checked});h.dropdown.close(!0);a.find(!0)});m.createCheckedMenuItem(h.menu,l["Wrap search"],a._wrap,function(d){a.setOptions({wrap:d.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Incremental search"],a._incremental,function(d){a.setOptions({incremental:d.target.checked});
h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Whole Word"],a._wholeWord,function(d){a.setOptions({wholeWord:d.target.checked});h.dropdown.close(!0);a.find(!0)});a._regExBox=m.createCheckedMenuItem(h.menu,l["Regular expression"],a._regex,function(d){a.setOptions({regex:d.target.checked});h.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});e||m.createCheckedMenuItem(h.menu,l["Find after replace"],a._findAfterReplace,function(d){a.setOptions({findAfterReplace:d.target.checked});h.dropdown.close(!0)});
return d},function(){a.hide()})},_storeRecentFind:function(a,b,d){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentFind",a);b&&window.setTimeout(function(){b.dispatchEvent({type:"inputDataListChanged",deleting:d})}.bind(this),20)})},_addRecentfind:function(a){"string"===typeof a&&a&&(!this._completion||!this._completion.hasValueOf(a))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var d;
b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){for(d in b)if(b[d].name===a)return;30<=b.length&&b.splice(29,b.length-30+1)}else b=[];b.splice(0,0,{name:a});this._storeRecentFind(b,this._completion)}.bind(this))},_removeRecentSearch:function(a,b){"string"===typeof a&&a&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var e;d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d)for(e in d)if(d[e].name===a){d.splice(e,
1);this._storeRecentFind(d,b,!0);break}}.bind(this))},_initCompletion:function(a){if(this._completion)this._completion.setInputField(a);else{var b=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b){var e=[];b.forEach(function(a){e.push({type:"proposal",label:a.name,value:a.name})});a(e)}})}.bind(this);this._completion=new h.InputCompletion(a,b,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,b){this._removeRecentSearch(a,b)}.bind(this),deleteToolTips:l["Click or use delete key to delete the search term"]})}},_createButton:function(a,b,d){var e=document.createElement("button");e.addEventListener("click",d.bind(this),!1);var h=this;e.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&h.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";b.appendChild(e)},_createInfoImage:function(a,b,
d){a=document.createElement("img");a.classList.add("replaceInfo");a.addEventListener("click",function(a){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));b.appendChild(a);return a},_handleInput:function(a){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var b=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;return b&&70===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=
!0,!1):(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&75===a.keyCode||13===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this._addRecentfind(this.getFindString()),13===a.keyCode?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1):b&&82===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1):27===a.keyCode?(this.hide(),!1):!0}});return{TextSearcher:b}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(m){var k=l.getService(m);Object.keys(k).forEach(function(e){"function"===typeof k[e]&&(n[e]=k[e].bind(k))})});return n},getOptions:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(l){l.getPropertyKeys().forEach(function(k){"service.id"!==k&&("service.names"!==k&&"objectClass"!==
k)&&(n[k]=l.getProperty(k))})});return n}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(l,n,m,k){function e(e,g){for(var b=g.getFileMetadata(),a=e.getServiceReferences("orion.edit.blamer"),f=0;f<a.length;f++){var d=a[f],k={};k.validationProperties=d.getProperty("validationProperties");k.forceSingleItem=!0;k=l._makeValidator(k,e);if(k.validationFunction.bind(k)(b))return e.getService(d)}return null}return{isVisible:function(h,g){return!!e(h,g)&&!!h.getService("orion.core.blame")},
getBlame:function(h,g){var b=e(h,g);if(b){var a=function(a){for(var b=n.getOrionHome(),e=0;e<a.length;e++){var f=a[e],g=new m(f.CommitLink),k={};k.OrionHome=b;f.CommitLink=g.expand(k)}h.getService("orion.core.blame")._setAnnotations(a)};if(b.computeBlame){var f={metadata:g.getFileMetadata()};b.computeBlame(k.getEditorContext(h),f).then(a)}else b.doBlame(g.getInput()).then(a)}}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages orion/i18nUtil orion/webui/littlelib orion/webui/dialogs/OpenResourceDialog orion/widgets/input/DropDownMenu orion/Deferred orion/URITemplate orion/commands orion/keyBinding orion/commandRegistry orion/extensionCommands orion/contentTypes orion/searchUtils orion/PageUtil orion/PageLinks orion/editor/annotations orion/blamer orion/regex orion/util orion/edit/editorContext".split(" "),function(l,n,m,k,e,h,g,b,a,f,d,p,q,u,t,y,v,x,s,w){function z(a){var d=
new g(a.uriTemplate),b=a.params||{};b.OrionHome=b.OrionHome||t.getOrionHome();var d=d.expand(b),e=document.createElement("div"),f=document.createElement("iframe");f.id=a.id;f.name=a.id;f.type="text/html";f.sandbox="allow-scripts allow-same-origin";f.frameborder=void 0!==a.border?a.border:1;f.src=d;f.className="delegatedUI";a.width&&(e.style.width=a.width,f.style.width=a.width);a.height&&(e.style.height=a.height,f.style.height=a.height);f.style.visibility="hidden";null!==a.parent&&(a.parent||window.document.body).appendChild(e);
e.appendChild(f);f.style.left=a.left||(window.innerWidth-parseInt(f.clientWidth,10))/2+"px";f.style.top=a.top||(window.innerHeight-parseInt(f.clientHeight,10))/2+"px";f.style.visibility="";window.addEventListener("message",function G(d){if(d.source===f.contentWindow&&"string"===typeof d.data&&(d=JSON.parse(d.data),"orion.page.delegatedUI"===d.pageService&&d.source===a.id)){if(d.cancelled)a.cancelled&&a.cancelled();else if(d.result)a.done&&a.done(d.result);else if(d.Status||d.status)a.status&&a.status(d.Status||
d.status);window.removeEventListener("message",G,!1);e.parentNode&&e.parentNode.removeChild(e)}},!1);return e}function C(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var r={},A=null;r.createDelegatedUI=z;C.prototype={generateSimpleEditorCommands:function(a,d){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,d));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(d){var f=this,g=new b.Command({imageClass:"core-sprite-wrench",tooltip:l.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return d.installed},callback:function(a){var b=g.settingsDropDown;if(!b||
b.isDestroyed())b=g.settingsDropDown=new e(a.domNode.parentNode,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){b.focus()},onHide:function(){d.focus()}}),b.updateContent=f.localSettings.show.bind(f.localSettings),a=b.getContentNode(),a.tabIndex=a.style.marginTop=0;b.click()}});this.commandService.addCommand(g);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new a.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(d){var e=
new b.Command({name:l.Undo,id:"orion.undo",visibleWhen:function(){return d.installed},callback:function(a){d.getUndoStack().undo()}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new a.KeyBinding("z",!0));e=new b.Command({name:l.Redo,id:"orion.redo",visibleWhen:function(){return d.installed},callback:function(a){d.getUndoStack().redo()}});
this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,s.isMac?new a.KeyBinding("z",!0,!0):new a.KeyBinding("y",!0))},_generateSearchFilesCommand:function(d){var e=this;if(e._searcher){var f=!1,g=new b.Command({name:l.searchFiles,tooltip:l.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return d.installed},callback:function(a){if(!f){a=
d.getSelection();a=d.getText(a.start,a.end);var b=e.serviceRegistry.getService("orion.page.progress"),g=new k.OpenResourceDialog({searcher:e._searcher,progress:b,searchRenderer:e._searcher.defaultRenderer,nameSearch:!1,title:l.searchFiles,message:l.searchTerm,initialText:a,onHide:function(){f=!1;d.focus()}});window.setTimeout(function(){f=!0;g.show(m.node(e.toolbarId))},0)}}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",
1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("h",!0))}},_generateSaveCommand:function(d,e){var f=this,g=e?e:"orion.save",h=new b.Command({name:l.Save,tooltip:l.saveFile,id:g,visibleWhen:function(){return!d.installed||f.inputManager.getReadOnly()?!1:!0},callback:function(a){f.inputManager.save();return!0}});this.commandService.addCommand(h);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,g,1,this.saveToolbarId?
"orion.menuBarFileGroup/orion.saveGroup":null,!1,new a.KeyBinding("s",!0));d.getTextView&&d.getTextView()&&(d.getTextView().setKeyBinding(new a.KeyBinding("s",!0),"save"),d.getTextView().setAction("save",h.callback,h))},_generateGotoLineCommnand:function(d){var e=this,g=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=d.getModel().getLineAtOffset(d.getCaretOffset())+1;return[new f.CommandParameter("line","number","Line:",a.toString())]}),
g=new b.Command({name:l.gotoLine,tooltip:l.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return d.installed},parameters:g,callback:function(a){var b=d.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=b.getLineAtOffset(d.getCaretOffset()),(a=prompt(l.gotoLinePrompt,a+1))&&(a=parseInt(a,10)));if(a)d.onGotoLine(a-1,0)}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("l",!s.isMac,!1,!1,s.isMac),new f.URLBinding("gotoLine","line"));d.getTextView&&d.getTextView()&&d.getTextView().setAction("gotoLine",function(a){if(a)return d.onGotoLine(a.line-1,0,void 0,a.callback),!0;e.commandService.runCommand("orion.gotoLine");return!0},g)},_generateFindCommnand:function(d){var e=this,g=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var a=d.getSelection(),b="";a.end>a.start&&(b=d.getModel().getText(a.start,a.end),e._localSearcher&&e._localSearcher.getOptions().regex&&(b=x.escape(b)));return[new f.CommandParameter("find","text","Find:",b)]}),g=new b.Command({name:l.Find,tooltip:l.Find,id:"orion.editor.find",visibleWhen:function(){return d.installed},parameters:g,callback:function(a){if(e._localSearcher){var b="",f=null,g=d.getSelection();g.end>g.start&&a.parameters.valueFor("useEditorSelection")?(b=d.getModel().getText(g.start,
g.end),e._localSearcher.getOptions().regex&&(b=x.escape(b))):a.parameters&&a.parameters.valueFor("find")&&(b=a.parameters.valueFor("find"),f=u.matchResourceParameters(),q.convertFindURLBinding(f));f?(e._localSearcher.setOptions({regex:f.regEx,caseInsensitive:!f.caseSensitive}),a={},f.atLine&&(a.start=d.getModel().getLineStart(f.atLine-1)),e._localSearcher.show({findString:b,replaceString:f.replaceWith}),e._localSearcher.find(!0,a)):e._localSearcher.show({findString:b});return!0}return!1}});this.commandService.addCommand(g);
this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("f",!0),new f.URLBinding("find","find"));d.getTextView&&d.getTextView()&&d.getTextView().setAction("find",function(a){if(a)return e._localSearcher.show(a),!0;e.commandService.runCommand("orion.editor.find",null,null,new f.ParametersDescription([new f.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},g)},_generateBlame:function(d){var e=this,g=new b.Command({name:l.Blame,tooltip:l.BlameTooltip,id:"orion.edit.blame",parameters:new f.ParametersDescription([new f.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!d.installed?!1:v.isVisible(e.serviceRegistry,e.inputManager)},callback:function(a){for(var b=!1,f=d.getAnnotationModel().getAnnotations();f.hasNext();)if(f.next().type===y.AnnotationType.ANNOTATION_BLAME){b=!0;
break}b=!b;a.parameters&&a.parameters.valueFor("blame")&&(b="true"===a.parameters.valueFor("blame"));b?v.getBlame(e.serviceRegistry,e.inputManager):d.showBlame([])}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new a.KeyBinding("b",!0,!0),new f.URLBinding("blame","blame"))},_generateEditCommands:function(e){function f(d){if(!d)return null;var b=new a.KeyBinding;a.KeyBinding.apply(b,d);return b}function g(a,
d){!d&&(a&&"undefined"!==typeof a.HTML)&&delete a.HTML;var b=k.serviceRegistry.getService("orion.page.message");b?b.setProgressResult(a):window.console.log(a)}var k=this,u=this.toolbarId,q=this.serviceRegistry,t=q.getServiceReferences("orion.edit.command"),r=this.inputManager,v=q.getService("orion.page.progress"),y=function(a,d,f){var h=f.visibleWhen;f.visibleWhen=function(a){return!e.installed||k.inputManager.getReadOnly()?!1:!h||h(a)};f.callback=function(b){e=this;var f=e.getSelection?e.getSelection():
{start:0,end:0};b=e.getModel();var h=function(a){"object"===typeof a&&a?(a.text&&e.setText(a.text),a.selection&&(e.setSelection&&e.setSelection(a.selection.start,a.selection.end,!0),e.focus())):"string"===typeof a&&(e.setText(a,f.start,f.end,!0),e.setSelection&&e.setSelection(f.start,f.start+a.length),e.focus())},k;d.execute?(b={contentType:r.getContentType(),input:r.getInput()},k=w.getEditorContext(q),k.openDelegatedUI=z,k.setStatus=g,b=d.execute(k,b),k=null):(b=d.run(b.getText(f.start,f.end),b.getText(),
f,r.getInput()),k=function(d){if(d&&d.uriTemplate){var b={};b.uriTemplate=d.uriTemplate;b.params=r.getFileMetadata();b.id=a.id;b.width=d.width;b.height=d.height;b.done=h;b.status=g;z(b)}else d&&(d.Status||d.status)?g(d.Status||d.status):h(d)});v.showWhile(b,n.formatMessage(l.running,a.name)).then(k);return!0};f.callback=f.callback.bind(e);return new b.Command(f)};h.when(function(a){if(A)return A;var d=a.getService("orion.core.contentTypeRegistry");d||(d=new p.ContentTypeRegistry(a),d=a.getService("orion.core.contentTypeRegistry"));
return d.getContentTypes().then(function(a){return A=a})}(this.serviceRegistry),function(){var a=[],b=100;t.forEach(function(g){var h=g.getProperty("editor");if(!h||!(e.id&&h!==e.id)){for(var l=k.serviceRegistry.getService(g),m={},h=g.getPropertyKeys(),n=0;n<h.length;n++)m[h[n]]=g.getProperty(h[n]);m.forceSingleItem=!0;g=d._createCommandOptions(m,g,k.serviceRegistry,A,!1,function(a){return r.getFileMetadata()});a.push(g);g.then(function(a){a=y(m,l,a);k.commandService.addCommand(a);k.commandService.registerCommandContribution(k.toolbarId,
a.id,b,"orion.menuBarToolsGroup",m.bindingOnly,f(m.key))});b++}});h.all(a,function(a){return{_error:a}}).then(function(a){if(a=r.getFileMetadata()){var d=m.node(u);d&&(k.commandService.destroy(d),k.commandService.renderCommands(d.id,d,a,e,"button"));if(d=m.node("pageNavigationActions"))k.commandService.destroy(d),k.commandService.renderCommands(d.id,d,e,e,"button")}})})}};r.EditorCommandFactory=C;return r});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(l,n,m,k,e,h,g){function b(a){this._document=a.document||document;this._timeout=a.timeout;a=["keypress","keydown","keyup"];for(var b=function(a){this._resetTimer()}.bind(this),f=0;f<a.length;f++)this._document.addEventListener(a[f],b,!0);e.attach(this)}function a(a,b){if(a){if(!b.Severity){var e=b,f={Severity:"Error",
Message:l.noResponse};if("Cancel"===e.name)b={Severity:"Warning",Message:e.name,Cancel:!0};else{if(0===e.status)f.Cancel=!0;else if(e.responseText){e=e.responseText;try{var g=JSON.parse(e);f.Severity=g.Severity||f.Severity;f.Message=g.Message||f.Message}catch(h){f.Message=e}}else try{f.Message=JSON.stringify(e)}catch(k){}b=f}}a.setProgressResult(b)}else window.console.log(b)}function f(a){e.attach(this);this.serviceRegistry=a.serviceRegistry;this.statusService=a.statusService;this.fileClient=a.fileClient;
this.progressService=a.progressService;this.contentTypeRegistry=a.contentTypeRegistry;this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}b.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;this._timer&&(a.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(a){return this.dispatchEvent(a)},
setTimeout:function(a){this._timeout=a;this._resetTimer()}};h.mixin(f.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):(new k).resolve(a)},_read:function(a){var b=this.cachedMetadata||n.getClickedItem();if(b&&b.Location===a&&b.Parents&&b.Attributes&&b.ETag)return(new k).resolve(b);var e=this.fileClient,f=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return e.read.apply(e,
[a].concat(f))})},load:function(){var d=this.getInput();if(d){var b=this.fileClient,e=this._parsedLocation.resource,f=this.progressService,g=function(a,d,b){return!f?a:f.progress(a,m.formatMessage(d,b))},h=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&g(b.read(e,!0),l.ReadingMetadata,d).then(function(a){this._fileMetadata&&(this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)&&(this._fileMetadata=a,(!h.isDirty()||window.confirm(l.loadOutOfSync))&&
g(b.read(e),l.Reading,d).then(function(a){h.setInput(d,null,a);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var n=e;if(0===n.indexOf("/gitapi/commit/")){var x=n.indexOf("/file"),s=n.indexOf("?",x);-1===s&&(s=n.length);n=n.substring(x,s);this._readonly=!0}var w=window.setTimeout(function(){w=null;this.reportStatus(m.formatMessage(l.Fetching,d))}.bind(this),800),z=function(){this.reportStatus("");w&&window.clearTimeout(w)}.bind(this),C=function(d){z();var b=null;this.serviceRegistry?b=this.serviceRegistry.getService("orion.page.message"):
this.statusService&&(b=this.statusService);a(b,d);this._setNoInput()}.bind(this);this._acceptPatch=null;g(this._read(n,!0),l.ReadingMetadata,n).then(function(a){a?a.Directory?k.when(a.Children||g(b.fetchChildren(a.ChildrenLocation),l.Reading,d),function(b){z();a.Children=b;this._setInputContents(this._parsedLocation,d,b,a)}.bind(this),C):this._isText(a)?g(b.read(e,!1,!0),l.Reading,d).then(function(b){z();"string"!==typeof b&&(this._acceptPatch=b.acceptPatch,b=b.result);this._setInputContents(this._parsedLocation,
d,b,a)}.bind(this),C):g(b._getService(e).readBlob(e),l.Reading,d).then(function(b){z();this._setInputContents(this._parsedLocation,d,b,a)}.bind(this),C):C({responseText:m.formatMessage(l.ReadingMetadataError,n)})}.bind(this),C)}}},processParameters:function(a){var b=this.getEditor();b&&b.processParameters&&b.processParameters(a)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(a){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(a){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,e=a.removedCharCount,f=a.start,g=a.start+e,h=
0;0===a.addedCharCount?h=-1:0===e&&(h=1);if(0<b&&h===this.previousChangeType){b=this._unsavedChanges[b-1];if(0===e&&f===b.end+b.text.length){b.text+=a.text;return}if(0===a.addedCharCount&&g===b.start){b.start=f;return}}this.previousChangeType=h;this._unsavedChanges.push({start:f,end:g,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function b(a){h===A.getInput()&&(A.getFileMetadata().ETag=a.ETag,f.setInput(h,
null,k,!0));A.reportStatus("");g&&r&&r.setProgressResult({Message:l.Saved,Severity:"Normal"});A.afterSave&&A.afterSave();A._saving=!1}function e(b){A.reportStatus("");a(r,b);A._saving=!1;A._errorSaving=!0}if(!this._saving){var f=this.getEditor();if(f&&f.isDirty()&&!this.getReadOnly()){var g=this._errorSaving;this._saving=!0;var h=this.getInput();this.reportStatus(l["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});f.markClean();var k=f.getText(),n=k;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var x=this._unsavedChanges,s=0,w=0;w<x.length;w++)s+=x[w].text.length;k.length>s&&(n={diff:x})}this._unsavedChanges=[];this._errorSaving=!1;var x={ETag:this.getFileMetadata().ETag},z=this._parsedLocation.resource,n=this.fileClient.write(z,n,x),C=this.progressService,r=null;this.serviceRegistry&&(r=this.serviceRegistry.getService("orion.page.message"));C&&(n=C.progress(n,m.formatMessage(l.savingFile,h)));var A=this;n.then(b,function(a){412===a.status?window.confirm(l.saveOutOfSync)?
(a=A.fileClient.write(z,k),C&&(a=C.progress(a,m.formatMessage(l.savingFile,h))),a.then(b,e)):A._saving=!1:e(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new b({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=g.hash()),"string"===typeof a)){var b=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var e=g.matchResourceParameters(a),f=this._parsedLocation||{};if(b&&b.isDirty()){var h=this._location;if(f.resource!==e.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(l.confirmUnsavedChanges)){window.location.hash=h;return}}b=b&&f.editor!==e.editor;this._location=a;this._parsedLocation=e;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=e.resource)?
a===this._input?b?(this.reportStatus(""),this._setInputContents(e,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(e):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var b=a.lastIndexOf("/");-1!==b&&(a=a.substring(b+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
_unknownContentTypeAsText:function(){return!0},_isText:function(a){a=this.contentTypeRegistry.getFileContentType(a);if(!a)return this._unknownContentTypeAsText();var b=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,b)},_setNoInput:function(a){a?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),
this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,b,e,f,g){var h,k=!1;f?(this._fileMetadata=f,this.setTitle(f.Location||String(f)),this.setContentType(this.contentTypeRegistry.getFileContentType(f)),h=f.Name,k=f.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),h=this.getTitle());var l=this.getEditor();this._focusListener&&(l&&(l.getTextView&&l.getTextView())&&l.getTextView().removeEventListener("Focus",
this._focusListener),this._focusListener=null);this._changingListener&&(l&&(l.getModel&&l.getModel())&&l.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);f={type:"InputChanged",input:a,name:h,title:b,contentType:this.getContentType(),metadata:f,location:window.location,contents:e};this.dispatchEvent(f);this.editor=l=f.editor;k||(l&&(l.getModel&&l.getModel())&&l.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),g||
l.setInput(b,null,e),l&&(l.getTextView&&l.getTextView())&&l.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),this._unsavedChanges=[],this.processParameters(a))}});return{handleError:a,InputManager:f}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages require orion/Deferred orion/webui/littlelib orion/compare/compareUtils orion/compare/diffProvider orion/compare/compareView orion/highlight orion/fileClient orion/globalCommands orion/commands orion/keyBinding orion/searchAndReplace/textSearcher orion/editorCommands orion/objects orion/inputManager orion/editor/editorFeatures orion/URL-shim".split(" "),function(l,n,m,k,e,h,g,b,a,f,d,p,q,u,t,y,v){function x(a){this._syntaxHighlither=
new b.SyntaxHighlighter(a)}n={};n.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new h.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var d=this;return m.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&2===e.length&&e[0]&&e[1]){var f=e[0];e=e[1];return(new m).resolve({oldFile:{URL:a,Name:d._resolveFileName(a),Type:f},newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diffContent:d._diffContent})}f=
a?d._resolveFileName(a):"";e=b?d._resolveFileName(b):"";return(new m).resolve({oldFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:e,Type:null},diffContent:d._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a,d){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,d){this._hasConflicts=d;if(b)return this._resolveTwoFiles(b,a);if(this._diffProvider){var e=this;return e._diffProvider.getDiffContent(a).then(function(b,d){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;return e._resolveComplexFileURL(a)},function(){})}console.log("A diff provider is needed for compound diff URL")}};return a}();x.prototype={highlight:function(a,b,d){return this._syntaxHighlither.setup(b,d.getTextView(),null,a,!1)}};n.ResourceComparer=
function(){function b(d,e,f,h){this._registry=d;this._commandService=e;this._fileClient=new a.FileClient(d);this._fileClient=new a.FileClient(d);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(f,!0);this._compareView=f.toggleable?new g.toggleableCompareView("inline"===f.type?"inline":"twoWay",h):"inline"===f.type?new g.inlineCompareView(h):new g.TwoWayCompareView(h);this._compareView.getWidget().setOptions({extCmdHolder:this});
h.highlighters||this._compareView.getWidget().setOptions({highlighters:[new x(d),new x(d)]});h.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(f.readonlyRight)}});h.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(f.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(l["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(d){a.manager.setDirty(b.isDirty())})}}.bind(this))}b.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?"undefined"===typeof a?!1:a:"undefined"===typeof a?!0:a},_getFileOptions:function(a){return 1===a?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new y.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];!this.options.toggleable&&(this._compareView.getWidget()._uiFactory&&"twoWay"===this._compareView.getWidget().type)&&(this._checkReadonly(this.options.readonlyRight)||(this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId())),this._checkReadonly(this.options.readonly,!0)||(this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))));var a=this;this._inputManagers.forEach(function(b){b.manager&&(this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(d,e,f,g){e=new q.TextSearcher(d,a._registry,a._commandService,f);f=(new v.KeyBindingsFactory).createKeyBindings(d,f,g,e);(new u.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:e})).generateSimpleEditorCommands(d,1===b.manager._editorIndex?"orion.compare.save.left":"orion.compare.save.right");return f})}.bind(this))},_initInputManager:function(a,b,d){var e=this;t.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:d,getInput:function(){return this.filePath},setDirty:function(a){var b=e._compareView.getWidget().getEditors(),d=a;b&&2===b.length&&(d=b[0].isDirty()||b[1].isDirty());f.setDirtyIndicator(d);
e._compareView.getWidget().refreshTitle&&e._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return e._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a,b){this._parsedLocation={resource:a};e._progress.progress(e._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=k.node(this._actionBarId);if(b){e._commandService.destroy(b);var d=this._editorIndex;
e._commandService.renderCommands(b.id,b,e._compareView.getWidget().getEditors()[d],e._compareView.getWidget().getEditors()[d],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){"*"===a.charAt(0)?f.setDirtyIndicator(!0):f.setDirtyIndicator(!1)},afterSave:function(){var a=e._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();e._getFileOptions(this._editorIndex).Content=
a;e._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=e.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;
prompt(l["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return e.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,b=new d.Command({tooltip:l["Generate link of the current diff"],
name:l["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),e=new d.Command({tooltip:l["Open the compare page"],name:l.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(e);this._commandService.registerCommandContribution(a,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new p.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return m.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,d){404===b.status&&(a.Content="");return a}.bind(this))},start:function(){if(this.options.resource){if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);b=a._isImage(b.newFile.Type);var d=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)d.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)d.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new m).resolve(a+5)})):
a._getFilesContents(d.diffContent?[d.oldFile]:[d.oldFile,d.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var d=a._getFileOptions(b.manager._editorIndex),e=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=d.URL;b.manager.setInput(d.URL,e)}});return(new m).resolve(b)}.bind(a))})}console.log("A diff provider is needed for Complex diff URL")}}};return b}();return n});
define("orion/git/uiUtil",["orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib","orion/git/util"],function(l,n,m,k){k=Object.create(k);k.createCompareWidget=function(e,h,g,b,a,f,d,k,q){var u=new n.DefaultDiffProvider(e);f=new l.CompareCommandFactory({commandService:h,commandSpanId:f,gridRenderer:k});(new n.ResourceComparer(e,h,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:b,diffProvider:u,resource:g,compareTo:q,editableInComparePage:d},{parentDivId:a,commandProvider:f})).start().then(function(b){var d=
420;b<d&&(d=b);m.node(a).style.height=d+"px"})};return k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(l){function n(l){this._prefix="/git/config";this._preferenceService=l.getService("orion.core.preference")}n.prototype={getConfig:function(){var m=new l;this._preferenceService.getPreferences(this._prefix).then(function(k){k=k.get("userInfo");m.resolve(k)});return m},setConfig:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix).then(function(e){e.put("userInfo",m);k.resolve()});return k}};return n.prototype.constructor=
n});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/git/gitConfigPreference"],function(l,n,m){function k(e){this._init(e)}k.prototype=new n.Dialog;k.prototype.TEMPLATE='\x3cdiv style\x3d"display: none; padding-top: 10px; padding-bottom: 10px;" id\x3d"commitInfoBar"\x3e\x3cstrong id\x3d"commitInfo"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cdiv style\x3d"vertical-align:top"\x3e\x3clabel style\x3d"display:block; float:left" id\x3d"commitMessageLabel" for\x3d"commitMessage"\x3e${Message:}\x3c/label\x3e\x3ctextarea id\x3d"commitMessage" rows\x3d"5" style\x3d"width: 30em"\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"amendLabel" for\x3d"amend"\x3e${Amend:}\x3c/label\x3e\x3cinput id\x3d"amend" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"changeIdLabel" for\x3d"changeId"\x3e${ChangeId:}\x3c/label\x3e\x3cinput id\x3d"changeId" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerNameLabel" for\x3d"committerName"\x3e${Committer Name:}\x3c/label\x3e\x3cinput id\x3d"committerName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerEmailLabel" for\x3d"committerEmail"\x3e${Committer Email:}\x3c/label\x3e\x3cinput id\x3d"committerEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorNameLabel" for\x3d"authorName"\x3e${Author Name:}\x3c/label\x3e\x3cinput id\x3d"authorName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorEmailLabel" for\x3d"authorEmail"\x3e${Author Email:}\x3c/label\x3e\x3cinput id\x3d"authorEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"persistLabel" for\x3d"persist"\x3e${Remember my committer name and email:}\x3c/label\x3e\x3cinput id\x3d"persist" type\x3d"checkbox"\x3e\x3c/div\x3e';k.prototype._init=
function(e){var h=this;this.title=l["Commit Changes"];this.modal=!0;this.messages=l;this.options=e;this.buttons=[];this.buttons.push({callback:function(){h._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};k.prototype._bindToDom=function(e){var h=this;this.options.body.Message&&(this.$commitMessage.value=this.options.body.Message);this.$commitMessage.addEventListener("keyup",function(e){h._validate()});this.options.body.Amend&&(this.$amend.checked=!0);this.options.body.ChangeId&&
(this.$changeId.checked=!0);this.options.body.CommitterName&&(this.$committerName.value=this.options.body.CommitterName);this.$committerName.addEventListener("keyup",function(e){h._validate()});this.options.body.CommitterEmail&&(this.$committerEmail.value=this.options.body.CommitterEmail);this.$committerEmail.addEventListener("keyup",function(e){h._validate()});this.options.body.AuthorName&&(this.$authorName.value=this.options.body.AuthorName);this.$authorName.addEventListener("keyup",function(e){h._validate()});
this.options.body.AuthorEmail&&(this.$authorEmail.value=this.options.body.AuthorEmail);this.$authorEmail.addEventListener("keyup",function(e){h._validate()});this._validate()};k.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),
this.$commitInfo.textContent=l["The author mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=
l["The committer name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The commit message is required."])};k.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var e={};e.Message=this.$commitMessage.value;e.Amend=this.$amend.checked?!0:!1;e.ChangeId=this.$changeId.checked?!0:!1;e.CommitterName=this.$committerName.value;e.CommitterEmail=
this.$committerEmail.value;e.AuthorName=this.$authorName.value;e.AuthorEmail=this.$authorEmail.value;e.persist=this.$persist.checked?!0:!1;this.options.func(e)}this.hide()}};k.prototype.constructor=k;return{CommitDialog:k}});
define("orion/git/logic/gitCommit","i18n!git/nls/gitmessages orion/commandRegistry orion/Deferred orion/git/widgets/CommitDialog orion/git/logic/gitCommon orion/i18nUtil orion/webui/littlelib".split(" "),function(l,n,m,k,e,h,g){var b=e.handleProgressServiceResponse;return function(a){var e=a.serviceRegistry,d=new n.CommandEventListener("change",function(a,b){var d=b.status,g=b.messageTextArea;if(a.target.checked){var h=e.getService("orion.page.message"),d=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(d.CommitLocation+
"?page\x3d1\x26pageSize\x3d1"),l["Fetching previous commit message"]);h.createProgressMonitor(d,l["Fetching previous commit message"],d.then(function(a){g.value=a.Children[0].Message}),function(a){g.value=""})}else g.value=""}),p=function(a,b,d){var g=e.getService("orion.git.provider"),h=new m;g.addCloneConfigurationProperty(d,a,b).then(function(){h.resolve()},function(e){409===e.status?g.getGitCloneConfig(d).then(function(d){if(d.Children)for(var e=0;e<d.Children.length;e++)if(d.Children[e].Key===
a){g.editCloneConfigurationProperty(d.Children[e].Location,b).then(function(){h.resolve()},function(a){h.reject(a)});break}},function(a){h.reject(a)}):h.reject(e)});return h},q=function(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);401===a.status?(b.HTML=!0,b.Message="\x3cspan\x3e",b.Message+=h.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],d.label,'\x3ca target\x3d"_blank" href\x3d"'+d.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):
b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:l["Problem while performing the action"]}catch(g){b.Message=l["Problem while performing the action"]}e.getService("orion.page.message").setProgressResult(b)};return{perform:function(a){var d=new m,g=a.items.status||a.handler.status,h=g.Clone.ConfigLocation,n=function(a){a.persist&&p("user.name",a.CommitterName,h).then(function(){p("user.email",a.CommitterEmail,h).then(function(){},function(a){b(a,{},e);d.reject(a)})},function(a){b(a,
{},e);d.reject(a)});var k=e.getService("orion.page.message"),m=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").commitAll(g.Clone.HeadLocation,null,JSON.stringify(a)),l["Committing changes"]);k.createProgressMonitor(m,l["Committing changes"]);m.then(function(a){d.resolve()},function(a){q(a);d.reject(a)})},s=function(a,b){for(var d=0;d<b.length;d++)"user.name"===b[d].Key?(a.CommitterName=b[d].Value,a.AuthorName=b[d].Value):"user.email"===b[d].Key&&(a.CommitterEmail=b[d].Value,
a.AuthorEmail=b[d].Value);a.Message&&a.CommitterName&&a.CommitterEmail?n(a):(new k.CommitDialog({body:a,func:n})).show()},w={};w.Message=a.userData.name;w.Amend=a.userData.amend;w.ChangeId=a.userData.changeId;var z=g.Clone.Config;if(w.Amend&&!w.Message){a=e.getService("orion.page.message");var C=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(g.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),l["Committing changes"]);a.createProgressMonitor(C,l["Committing changes"]);
C.then(function(a){w.Message=a.Children[0].Message;s(w,z)},function(a){s(w,z)})}else s(w,z);return d},createParameters:function(a){return new n.ParametersDescription([new n.CommandParameter("name","text",l["Commit message:"],"",4),new n.CommandParameter("amend","boolean",a?l.SmartAmend:l["Amend:"],!1,null,d),new n.CommandParameter("changeId","boolean",a?l.SmartChangeId:l["ChangeId:"],!1)],{hasOptionalParameters:!0,getParameterElement:a?function(a,b){return g.$("#"+a.name+"parameterCollector",b.parentNode.parentNode)}:
null,getSubmitName:a?function(a){a=a.items;Array.isArray(a)||(a=[a]);return h.formatMessage(l.SmartCountCommit,a.length)}:null})},displayErrorOnStatus:q,amendEventListener:d,setGitCloneConfig:p}}});
define("orion/git/widgets/gitChangeList","i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/explorers/explorer orion/git/uiUtil orion/git/util orion/webui/tooltip orion/selection orion/webui/littlelib orion/commands orion/git/logic/gitCommit orion/objects".split(" "),function(l,n,m,k,e,h,g,b,a,f,d,p){function q(a){this.changes=a.changes;this.registry=a.registry;this.prefix=a.prefix;this.location=a.location;this.repository=a.repository;this.handleError=a.handleError;this.changes=a.changes;
this.gitClient=a.gitClient;this.progressService=a.progressService;this.section=a.section}function u(a){this.checkbox="all"===a.prefix;var b=new t({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:a.prefix+"Navigator",checkbox:this.checkbox},this);k.Explorer.call(this,a.serviceRegistry,a.selection,b,a.commandRegistry);this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.prefix=a.prefix;this.changes=a.changes;this.section=a.section;this.location=
a.location;this.repository=a.repository;this.editableInComparePage=a.editableInComparePage;this.handleError=a.handleError;this.gitClient=a.gitClient;this.progressService=a.progressService;this.explorerSelectionScope="explorerSelection";this.createSelection();this.createCommands();"all"!==this.prefix&&this.updateCommands()}function t(a,b){k.SelectionRenderer.apply(this,arguments);this.registry=a.registry}var y=["Missing","Modified","Untracked","Conflicting"],v=["Added","Changed","Removed"],x=y.concat(v),
s={Missing:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Unstaged removal"]},Removed:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Staged removal"]},Modified:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Unstaged change"]},Changed:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Staged change"]},Untracked:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Unstaged addition"]},Added:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Staged addition"]},
Conflicting:{imageClass:"gitImageSprite git-sprite-conflict-file",tooltip:l.Conflicting},ADD:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l.Addition},MODIFY:{imageClass:"gitImageSprite git-sprite-file",tooltip:l.Deletion},DELETE:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l.Diffs}};q.prototype=Object.create(k.Explorer.prototype);p.mixin(q.prototype,{destroy:function(){},getRoot:function(a){a(this.changes||this.root||(this.root={Type:"Root"}))},getGroups:function(a){switch(a){case "all":return x;
case "staged":return v;case "unstaged":return y}},getChildren:function(a,b){if(a instanceof Array&&0<a.length)b(a);else if("Root"===a.Type){var d=this;if(a.children)b(a.children);else{var f=this.location,g=this.progressService,h=this.gitClient,k=this.section.createProgressMonitor();k.begin("Getting changes");g.progress(h.getGitStatus(f),l["Loading..."]).then(function(e){if("Status"===e.Type){var f=d.status=d.items=e;m.when(d.repository||g.progress(h.getGitClone(f.CloneLocation),"Getting repository information"),
function(e){var h=e.Children?e.Children[0]:e;d.repository=h;h.status=f;g.progress(d.registry.getService("orion.git.provider").getGitCloneConfig(h.ConfigLocation),"Getting repository configuration ",h.Name).then(function(e){e=e.Children;f.Clone=h;f.Clone.Config=[];for(var g=0;g<e.length;g++)("user.name"===e[g].Key||"user.email"===e[g].Key)&&f.Clone.Config.push(e[g]);e=a.children=d._sortBlock(d.getGroups(d.prefix));"all"===d.prefix&&(0<e.length&&e.unshift({Type:"ExplorerSelection",selectable:!0}),e.unshift({Type:"CommitMsg",
selectable:!1}));e.forEach(function(b){b.parent=a});k.done();b(e)},function(a){k.done();d.handleError(a)})},function(a){k.done();d.handleError(a)})}},function(a){k.done();d.handleError(a)})}}else e.isChange(a)||"Diff"===a.Type?(a.children||(a.children=[],a.children.push({DiffLocation:a.DiffLocation,Type:"Compare",parent:a,selectable:"all"!==this.prefix})),b(a.children)):b([])},getId:function(a){var b=this.prefix;return a instanceof Array&&0<a.length||"Root"===a.Type?b+"Root":e.isChange(a)?b+a.type+
a.name:"ExplorerSelection"===a.Type||"CommitMsg"===a.Type?b+a.Type:b+a.type+a.DiffLocation},getModelType:function(a,b){return b},_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var d=0;d<b.length;d++)if(!b[d].Conflicting){for(var e=b[d].Location,f=[],g=2;g<a.length;g++){var h=this.getGroupData(a[g]);h&&(h=this._findSameFile(e,h))&&f.push(h)}if(f.length===Math.max(0,a.length-2)){b[d].Conflicting=a[0];for(e=0;e<f.length;e++)f[e].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var d=
0;d<b.length;d++)if(!b[d].Conflicting&&a===b[d].Location)return b[d]},_sortBlock:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.getGroupData(e);if(f)for(var g=0;g<f.length;g++){var h=this.getModelType(f[g],e);h&&b.push({name:f[g].Name,type:h,location:f[g].Location,path:f[g].Path,commitURI:f[g].Git.CommitLocation,indexURI:f[g].Git.IndexLocation,DiffLocation:f[g].Git.DiffLocation,CloneLocation:this.items.CloneLocation,conflicting:"Conflicting"===h})}}b.sort(function(a,b){var d=a.name&&
a.name.toLowerCase(),e=b.name&&b.name.toLowerCase();return d<e?-1:d>e?1:0});return b},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=0;b<v.length;b++)if(a===v[b])return!0;return!1},getClass:function(a){return s[a.type].imageClass},getTooltip:function(a){return s[a.type].tooltip}});u.prototype=Object.create(k.Explorer.prototype);p.mixin(u.prototype,{changedItem:function(a){var b=new m;if("all"===this.prefix){var d=a[0].parent,e=this.messageTextArea.value,f=this.amendCheck.checked,
g=this.changeIDCheck.checked,h=this;d.children=d.Children=null;this.model.getChildren(d,function(a){d.removeAll=!0;h.myTree.refresh.bind(h.myTree)(d,a,!1);var k=a.filter(function(a){return h.model.isStaged(a.type)});h.selection.setSelections(k);h.messageTextArea.value=e;h.amendCheck.checked=f;h.changeIDCheck.checked=g;b.resolve(a)})}else b.resolve();return b},destroy:function(){this._selectionListener&&(this.selection.removeEventListener("selectionChanged",this._selectionListener),this._selectionListener=
null)},display:function(){var a=this,b=new m,d=new q({registry:this.registry,progress:this.progressService,prefix:this.prefix,location:this.location,repository:this.repository,handleError:this.handleError,changes:this.changes,gitClient:this.gitClient,progressService:this.progressService,section:this.section});this.createTree(this.parentId,d,{onComplete:function(){var d=a.model;"all"===a.prefix&&(a.updateCommands(),a.selection.setSelections(d._sortBlock(d.getGroups("staged"))));a.status=d.status;b.resolve()}});
return b},isRowSelectable:function(a){return"all"===this.prefix?!1:e.isChange(a)},getItemCount:function(){var a=0,b=this.model;b&&b.getRoot(function(d){b.getChildren(d,function(b){a=Math.max(0,b.length-2)})});return a},updateCommands:function(){k.createExplorerCommands(this.commandService);var b=this.section.actionsNode.id,d=this.section.selectionNode.id,e=this.explorerSelectionScope;this.commandService.registerCommandContribution(e,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(e,
"orion.explorer.collapseAll",300);if("staged"===this.prefix)this.commandService.addCommandGroup(b,"eclipse.gitCommitGroup",1E3,"Commit",null,null,null,"Commit",null,"eclipse.orion.git.commitCommand"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitCommand",100,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitAndPushCommand",200,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(d,"eclipse.orion.git.unstageCommand",
100),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);else if("unstaged"===this.prefix)this.commandService.registerCommandContribution(d,"eclipse.orion.git.showPatchCommand",100),this.commandService.registerCommandContribution(d,"eclipse.orion.git.stageCommand",200),this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutCommand",300),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",
100);else if("all"===this.prefix){this.commandService.registerCommandContribution(d,"eclipse.orion.git.showStagedPatchCommand",100);this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutStagedCommand",200);this.commandService.registerCommandContribution(d,"eclipse.orion.git.precommitCommand",300);var f=a.node(e);f&&(this.commandService.destroy(f),this.commandService.renderCommands(e,e,this,this,"button"));this.commandService.renderCommands(d,d,[],this,"button",{Clone:this.model.repository})}this.commandService.renderCommands(b,
b,this,this,"button")},createCommands:function(){if("all"===this.prefix){var a=this,b=new f.Command({tooltip:l["Select all"],imageClass:"core-sprite-check",id:"orion.explorer.selectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){d=0<b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)}).length});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)});a.commandService.runCommand("eclipse.orion.git.stageCommand",
b,a,null,a.status)})}}),d=new f.Command({tooltip:l["Deselect all"],imageClass:"core-sprite-check_on",id:"orion.explorer.deselectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){1<b.children.length&&(d=b.children.filter(function(b){return a.model.isStaged(b.type)}).length===Math.max(0,b.children.length-2))});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return a.model.isStaged(b.type)});a.commandService.runCommand("eclipse.orion.git.unstageCommand",
b,a,null,a.status)})}}),e=new f.Command({tooltip:l.Commit,id:"eclipse.orion.git.precommitCommand",extraClass:"primaryButton",callback:function(b){var d=a.messageTextArea.value.trim();a.commandService.runCommand("eclipse.orion.git.commitCommand",b.items,b.handler,null,{name:d,amend:a.amendCheck.checked,changeId:a.changeIDCheck.checked})},visibleWhen:function(a){Array.isArray(a)||(a=[a]);e.name=n.formatMessage(l.SmartCountCommit,a.length);return!0}});this.commandService.addCommand(e);this.commandService.addCommand(b);
this.commandService.addCommand(d)}},createSelection:function(){if(!this.selection){this.selection=new b.Selection(this.registry,"orion.selection."+this.prefix+"Section");this.commandService.registerSelectionService(this.section.selectionNode.id,this.selection);var a=this.section,d=this.commandService,e=this;this.selection.addEventListener("selectionChanged",this._selectionListener=function(b){var f=a.selectionNode;f&&(d.destroy(f),d.renderCommands(a.selectionNode.id,f,b.selections,e,"button",{Clone:e.model.repository}));
"all"===e.prefix&&((b=a.titleActionsNode)&&d.destroy(b),d.renderCommands(b.id,b,e,e,"button"))})}},refreshSelection:function(){}});t.prototype=Object.create(k.SelectionRenderer.prototype);p.mixin(t.prototype,{getCellElement:function(a,b,f){var h,k,m,n=this.explorer;switch(a){case 0:h=document.createElement("td");a=document.createElement("div");a.className="sectionTableItem";h.appendChild(a);if("CommitMsg"===b.Type){f.classList.add("gitCommitListSection");k=document.createElement("div");k.id="gitCommitMessage";
k.className="gitCommitMessage toolComposite";h.colSpan=2;f.classList.remove("selectableNavRow");f=document.createElement("div");f.className="gitCommitMessageTopRow";var p=n.messageTextArea=document.createElement("textarea");p.rows=2;p.type="textarea";p.id="nameparameterCollector";p.placeholder=l.SmartCommit;p.classList.add("parameterInput");f.appendChild(p);p=document.createElement("div");p.className="gitCommitMessageBottomRow";var u=document.createElement("span");u.className="layoutRight parameters";
p.appendChild(u);var q=n.amendCheck=document.createElement("input");q.type="checkbox";q.id="amendparameterCollector";var t=d({serviceRegistry:n.registry,commandService:n.commandService}).amendEventListener;q.addEventListener(t.event,function(a){return t.handler(a,n)},t.capture);u.appendChild(q);var v=document.createElement("label");v.classList.add("parameterInput");v.setAttribute("for",q.id);v.textContent=l.SmartAmend;u.appendChild(v);q=n.changeIDCheck=document.createElement("input");q.type="checkbox";
q.id="changeIDparameterCollector";u.appendChild(q);v=document.createElement("label");v.classList.add("parameterInput");v.setAttribute("for",q.id);v.textContent=l.SmartChangeId;u.appendChild(v);k.appendChild(f);k.appendChild(p);a.appendChild(k)}else e.isChange(b)||"Diff"===b.Type?(this.getExpandImage(f,a),f=n.getNavDict()?n.getNavDict().getGridNavHolder(b,!0):null,m=document.createElement("span"),m.id=n.prefix+b.name+b.type+"DiffActionWrapper",m.className="sectionExplorerActions",a.appendChild(m),
n.commandService.destroy(m),n.commandService.renderCommands("DefaultActionWrapper",m,b,n,"tool",null,f),k=document.createElement("span"),k.className=n.model.getClass(b),k.commandTooltip=new g.Tooltip({node:k,text:n.model.getTooltip(b),position:["above","below","right","left"]}),a.appendChild(k),k=document.createElement("span"),k.textContent=b.name,a.appendChild(k)):"ExplorerSelection"===b.Type?(h.colSpan=2,k=document.createElement("span"),k.textContent=l.SelectAll,a.appendChild(k),k=document.createElement("div"),
k.className="layoutRight commandList",k.id=n.explorerSelectionScope,a.appendChild(k),n.commandService.renderCommands(k.id,k,n,n,"button")):(h.colSpan=2,f=document.createElement("div"),f.className="sectionExplorerActions",a.appendChild(f),m=document.createElement("span"),p=n.prefix+b.parent.name+b.parent.type,m.id=p+"DiffActionWrapperChange",f.appendChild(m),k=document.createElement("span"),k.id=p+"CompareWidgetActionWrapper",f.appendChild(k),p=document.createElement("div"),p.id="diffArea_"+b.DiffLocation,
p.style.height="420px",p.style.border="1px solid lightgray",p.style.overflow="hidden",a.appendChild(p),f=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null,e.createCompareWidget(n.registry,n.commandService,b.DiffLocation,"Conflicting"===b.parent.type,p,k.id,n.editableInComparePage,{navGridHolder:f,additionalCmdRender:function(a){n.commandService.destroy(m.id);n.commandService.renderCommands("itemLevelCommands",m.id,b.parent,n,"tool",!1,a)},before:!0}));return h}},onCheckedFunc:function(a,
b,d,e){"ExplorerSelection"===e.Type?b?this.explorer.commandService.runCommand("orion.explorer.selectAllCommandChangeList",this.explorer,this.explorer):this.explorer.commandService.runCommand("orion.explorer.deselectAllCommandChangeList",this.explorer,this.explorer):b?this.explorer.commandService.runCommand("eclipse.orion.git.stageCommand",[e],this.explorer):this.explorer.commandService.runCommand("eclipse.orion.git.unstageCommand",[e],this.explorer)},getCheckedFunc:function(a){return"ExplorerSelection"===
a.Type?!this.explorer.commandService.findCommand("orion.explorer.selectAllCommandChangeList").visibleWhen(this.explorer):this.explorer.model.isStaged(a.type)}});return{GitChangeListExplorer:u,GitChangeListRenderer:t,GitChangeListModel:q}});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(l,n,m,k,e,h){function g(a,b){var d=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");
var e=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var g=0;g<e.length;g++)this.domNode.classList.add(e[g]);this.domNode.id=b.id;b.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),
this.domNode.tabIndex=0,this.domNode.addEventListener("click",function(a){(a.target===d.titleNode||a.target===d.twistie||a.target===d.domNode)&&d._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===l.KEY.ENTER&&(a.target===d.domNode||a.target===d.titleNode||a.target===d.twistie)&&d._changeExpandedState()},!1));if(b.iconClass){var h=document.createElement("span");h.classList.add("sectionIcon");this.domNode.appendChild(h);e=Array.isArray(b.iconClass)?b.iconClass:
[b.iconClass];e.forEach(function(a){h.classList.add(a)})}b.headerClass&&(e=Array.isArray(b.headerClass)?b.headerClass:[b.headerClass],e.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleActionsNode=document.createElement("div");this.titleActionsNode.id=b.id+"TitleActionsArea";this.titleActionsNode.classList.add("layoutLeft");this.titleActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleActionsNode);this.titleNode=document.createElement("div");this.titleNode.id=
b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;"function"===typeof b.getItemCount&&(e=document.createElement("div"),e.classList.add("layoutLeft"),e.classList.add("sectionItemCount"),this.domNode.appendChild(e),e.textContent=b.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=b.id+"Progress";
this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.display="none";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);this.titleLeftActionsNode=document.createElement("div");this.titleLeftActionsNode.id=b.id+"LeftTitleActionsArea";this.titleLeftActionsNode.classList.add("layoutLeft");this.titleLeftActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleLeftActionsNode);
e=document.createElement("div");e.id=b.id+"FilterSearchBox";this.domNode.appendChild(e);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");
this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);b.slideout&&(e=k.slideoutHTMLFragment(b.id),g=document.createRange(),g.selectNode(this.domNode),e=g.createContextualFragment(e),
this.domNode.appendChild(e));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);"function"===typeof b.onExpandCollapse&&(this._onExpandCollapse=b.onExpandCollapse);this._preferenceService=b.preferenceService;this._collapse();if(this._preferenceService){var m=
this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(m.id);void 0===a?b.hidden||m._expand():a&&m._expand();m._updateExpandedState(!1)})}else b.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function b(a){this._section=a;this._id=++a._lastMonitor}g.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(a){return this.domNode},getTitleElement:function(a){return this.titleNode},
getActionElement:function(a){return this._toolActionsNode},setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,b,d){this._contentParent.innerHTML="";a.parent||(a.parent=b);this._contentParent.appendChild(a.parent);a.section=this;e.mixin(a,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!l.node(a)){var b=
document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a,b){this.section.actionsNode.style.visibility=a?"":"hidden";void 0===b&&(b=a?null:"cursorOnly");this.renderer.selectionPolicy=b;var d=this.getNavHandler();d&&d.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){l.node(a)&&
this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;!this.selection&&!d&&(this.serviceRegistry||this.registry?(this.selection=
new h.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var b=this.registerCommands();!b||!b.then?a.updateCommands():b.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,e.mixin(a.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,
a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new b(this)},_setMonitorMessage:function(a,b){this._progressNode.style.display="block";this._loading[a]=b;var d="",e;for(e in this._loading)""!==d&&(d+="\n"),d+=this._loading[e];this._progressNode.title=d;this._updateExpandedState(!1)},_monitorDone:function(a){delete this._loading[a];a="";for(var b in this._loading)""!==a&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;""===a&&(this._progressNode.style.display=
"none");this._updateExpandedState(!1)},_changeExpandedState:function(){this.hidden?this._expand():this._collapse();this._updateExpandedState(!0)},_updateExpandedState:function(a){var b=!this.hidden,d=this.working,e=this.twistie,g=this.id;e&&(e.classList.remove(this._expandImageClass),e.classList.remove(this._collapseImageClass),e.classList.remove(this._progressImageClass),e.classList.add(d?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(g,
b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)},_expand:function(){this._contentParent.classList.remove("sectionClosed");this.domNode.classList.remove("sectionClosed");this.hidden=!1},_collapse:function(){this.hidden=!0;this._contentParent.classList.add("sectionClosed");this.domNode.classList.add("sectionClosed")}};g.prototype.constructor=g;b.prototype={begin:function(a){this._section.working=!0;this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this._section.working=!1;this.status=a;this._section._monitorDone(this.id)}};b.prototype.constructor=b;return{Section:g}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewReqUrl"\x3e${Paste link in email or IM}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewReqUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewerName"\x3e${Send the link to the reviewer}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewerName" style\x3d"width: 30em"  value\x3d""/\x3e\x3c/div\x3e\x3c/div\x3e';m.prototype._init=
function(k){var e=this;this.title=k.title||l["Contribution Review Request"];this.modal=!0;this.messages=l;this.url=k.url;this.func=k.func;this.buttons=[];this.buttons.push({callback:function(){e.destroy();e.func(e.$reviewerName.value)},text:l.Submit});this._initialize()};m.prototype._bindToDom=function(k){this.$reviewReqUrl.value=this.url};m.prototype.constructor=m;return{ReviewRequestDialog:m}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(l,n){var m;m=l.toUrl?(new URL(l.toUrl("workspace"),window.location.href)).href:(new URL("/",window.location.href)).href;return{makeRelative:function(k){if(!k)return k;var e=window.location.protocol+"//"+window.location.host;return 0===k.indexOf(e)?k.substring(e.length):k},isAtRoot:function(k){return!k?!1:"/workspace"===k?!0:0===(new URL(k,window.location.href)).href.indexOf(m)}}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(l,n,m,k,e,h,g,b,a){function f(a,b,d,e,f,g){this.registry=a;this.root=b;this.fileClient=d;this.idPrefix=e||"";this.excludeFiles=!!f;this.excludeFolders=!!g}function d(a){g.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=a.modelEventDispatcher?a.modelEventDispatcher:new g;this.modelEventDispatcher=b;var d=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){b.addEventListener(a,
d._modelListeners[a]=d.modelHandler[a].bind(d))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)d.onLinkClick({type:"linkClick",item:a._item})}};(a=m.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&e.setTarget(a)}},
{pid:"nav.config"})}f.prototype=new h.ExplorerModel;b.mixin(f.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var d=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var e=[],f;for(f in b)if(!(b[f].Directory?this.excludeFolders:this.excludeFiles))e.push(b[f]),b[f].parent=a,b[f].Parents||(b[f].Parents=d);b=e}else for(e in b)b[e].parent=a,b[e].Parents||(b[e].Parents=d);a.children=b;a.children.sort(this.sortChildren);return b},sortChildren:function(a,
b){var d=a.Directory;if(d!==b.Directory)return d?-1:1;var d=a.Name&&a.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return d<e?-1:d>e?1:0},getChildren:function(a,b){var d=this;if(a.children)b(a.children);else if(void 0!==a.Directory&&!1===a.Directory)b([]);else if(a.Children)b(d.processParent(a,a.Children));else if(a.Location){var e=null;this.registry&&(e=this.registry.getService("orion.page.progress"));(e?e.progress(this.fileClient.fetchChildren(a.ChildrenLocation),l["Fetching children of "]+
a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(e){d.destroyed||b(d.processParent(a,e))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=0<this.root.Children.length);return a}});f.prototype.constructor=f;var p,q;d.prototype=Object.create(h.Explorer.prototype);b.mixin(d.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=
m.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);h.Explorer.prototype.destroy.call(this)},onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||b.treeRoot;d[a.Location]=a});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],!0)}))},onModelMove:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){var e=
b.treeRoot;if((e.Location||e.ContentLocation)===a.oldValue.Location){var f=b.treeRoot;a=a.newValue;a=a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return n.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});b.loadResourceList(a)})}e=(e=a.oldValue.parent)||b.treeRoot;d[e.Location]=e;e=(e=a.parent)||b.treeRoot;d[e.Location]=e;a.oldValue.Directory&&(a.newValue&&b.isExpanded(a.oldValue))&&(d[a.newValue.Location]=a.newValue)});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],
!0)}))},onModelDelete:function(a){a=a.items||[a];var b=this,d=b.treeRoot,e;if(a.some(function(a){if(a.oldValue.Location===(d.Location||d.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))e=a.parent;return!0}return!1}))return this.loadResourceList(e);var f={};a.forEach(function(a){a=a.parent;f[a.Location]=a});return n.all(Object.keys(f).map(function(a){return b.changedItem(f[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},
create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},makeNewChildItemPlaceholder:function(a,b,d){var e=new n;this.model.getChildren(a,function(f){var g=null,h=!1;if(f){f.push(b);f.sort(this.model.sortChildren);var g=
f.indexOf(b),k=g+1;f.length>k?g=f[k]:(h=g-1,g=0<=h?f[h]:a,h=!0)}else g=a;f=this.makeNewItemPlaceholder(g,d,h);e.resolve(f)}.bind(this));return e},_makeDropTarget:function(b,d,f){if(this.dragAndDrop){var g=this,h=this.dragAndDrop,s=function(a){p=a.target};f&&(this._oldDragStart&&d.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=s);d.addEventListener("dragstart",s,!1);s=function(a){p=null};f&&(this._oldDragEnd&&d.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
s);d.addEventListener("dragend",s,!1);s=function(a){d.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};f&&(this._oldDragLeave&&d.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=s);d.addEventListener("dragleave",s,!1);s=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
"copy";d.classList.add("dragOver");m.stop(b)};f&&(this._oldDragEnter&&d.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=s);d.addEventListener("dragenter",s,!1);s=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";m.stop(b)};f&&!this._oldDragOver&&(d.addEventListener("dragover",
s,!1),this._oldDragOver=s);var w=null,z=null;g.registry&&(w=g.registry.getService("orion.page.progress"),z=g.registry.getService("orion.page.message"));var C=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a)},r=function(a,d,f,g,h,m){var p=!1,q=e.isAtRoot(d.Location);m?(p=!0,m.entryCount++):a.isDirectory&&(p=!0,m={entryCount:1,deferred:new n},f._makeUploadNode(d,a.name,!0).then(function(a){var b=
function(){a.destroyFunction();q?f.loadResourceList(f.treeRoot.Path,!0):f.changedItem(d)};m.deferred.then(b,b)}));var t=function(){m&&(m.entryCount--,0===m.entryCount&&m.deferred.resolve())},v=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a);t()};!d.Location&&d.fileMetadata&&(d=d.fileMetadata);if(a.isFile)q?v(l["You cannot copy files directly into the workspace.  Create a folder first."]):
a.file(function(a){if(m){var e=a.name.indexOf(".zip")===a.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],a.name));g(d,a,f,e,!1,{error:function(b){b=l["Uploading the following file failed: "]+a.name;z?z.setProgressResult({Severity:"Error",Message:b}):window.console.log(b)},loadend:t},!0)}else f._uploadFile(b,a,!0)}.bind(this));else if(a.isDirectory){var s=a.createReader(),x=function(a){s.readEntries(function(b){for(var d=0;d<b.length;d++)r(b[d],a,f,g,h,m);t()})};q?(w?w.progress(h.createProject(d.ChildrenLocation,
a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createProject(d.ChildrenLocation,a.name)).then(function(a){(w?w.progress(h.read(a.ContentLocation,!0),l["Loading "]+a.name):h.read(a.ContentLocation,!0)).then(function(a){x(a)},v)},v):(w?w.progress(h.createFolder(d.Location,a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createFolder(d.Location,a.name)).then(function(a){var d=f.modelEventDispatcher;p||d.dispatchEvent({type:"create",parent:b,newValue:a});x(a)},v)}},s=function(a){var f;d.classList.remove("dragOver");
if(p){f=g.fileClient;for(var n=p,s;n;){if(n._item){s=n._item;break}n=n.parentNode}if(!s)return;var y="copy"===q;f=(y?f.copyFile:f.moveFile).apply(f,[s.Location,b.Location,s.Name]);w&&(n=k.formatMessage(l[y?"Copying ${0}":"Moving ${0}"],s.Location),f=w.showWhile(f,n));f.then(function(a){g.modelEventDispatcher.dispatchEvent({type:y?"copy":"move",oldValue:s,newValue:a,parent:b})},C)}else if(a.dataTransfer.items&&0<a.dataTransfer.items.length)for(f=0;f<a.dataTransfer.items.length;f++)n=null,"function"===
typeof a.dataTransfer.items[f].getAsEntry?n=a.dataTransfer.items[f].getAsEntry():"function"===typeof a.dataTransfer.items[f].webkitGetAsEntry&&(n=a.dataTransfer.items[f].webkitGetAsEntry()),n&&r(n,b,g,h,g.fileClient);else if(a.dataTransfer.files&&0<a.dataTransfer.files.length)for(f=0;f<a.dataTransfer.files.length;f++)n=a.dataTransfer.files[f],!n.size&&!n.type?C(k.formatMessage(l["Did not drop ${0}.  Folder drop is not supported in this browser."],n.name)):e.isAtRoot(b.Location)?C(l["You cannot copy files directly into the workspace.  Create a folder first."]):
g._uploadFile(b,n,!0);m.stop(a)};f&&(this._oldDrop&&d.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=s);d.addEventListener("drop",s,!1)}},_uploadFile:function(a,b,d){var e=a;!e.Location&&e.fileMetadata&&(e=e.fileMetadata);a=function(){this._makeUploadNode(e,b.name,!1).then(function(a){var d=a.refNode,f=a.progressBar,g=a.cancelButton,h=a.destroyFunction,m=this.registry.getService("orion.page.message");a={progress:function(a){var b="";if(a.lengthComputable){b=Math.floor(100*(a.loaded/a.total))+
"%";f.style.width=b;var e=Math.round(a.loaded/1024);a=Math.round(a.total/1024);f.title=l["Upload progress: "]+b+",  "+e+"/"+a+" KB";d.title=f.title}},loadend:function(a){h();this.changedItem(e)}.bind(this),error:function(a){a=l["Uploading the following file failed: "]+b.name;m?m.setProgressResult({Severity:"Error",Message:a}):window.console.log(a)}};var n=b.name.indexOf(".zip")===b.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],b.name)),p=this.dragAndDrop(e,b,this,n,!1,a,!0);g.addEventListener("click",
function(){p.abort()})}.bind(this))}.bind(this);d?this.expandItem(e,!1).then(a):a()},_makeUploadNode:function(a,b,d){var e=this.getRow(a).id;return this.makeNewChildItemPlaceholder(a,{Name:b,Directory:d},e).then(function(a){var e=null,f,g;if(a){e={};f=a.refNode;g=a.wrapperNode;f.classList.add("uploadNode");e.refNode=f;e.wrapperNode=g;g=document.createElement("span");g.classList.add("uploadNodeText");g.appendChild(document.createTextNode(b));f.appendChild(g);g=document.createElement("span");g.classList.add("progressBarWrapper");
var h=document.createElement("span");h.classList.add("progressBar");g.appendChild(h);f.appendChild(g);e.progressBar=h;d?(h.classList.add("continuous"),f.title=l["Uploading "]+b,h.title=f.title):(g=document.createElement("button"),g.classList.add("imageSprite"),g.classList.add("core-sprite-delete"),g.classList.add("uploadCancelButton"),g.title=l["Cancel upload"],f.appendChild(g),e.cancelButton=g);e.destroyFunction=a.destroyFunction}return e}.bind(this))},createModel:function(){return new f(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var d=this,e=new n;a.children=a.Children=null;this.model.getChildren(a,function(f){d.getNavHandler();d.myTree.refresh.bind(d.myTree)(a,f,b);e.resolve(f)});return e},showItem:function(a,b){var d=new n;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return d.reject();
var e=this.getRow(a);if(e)d.resolve(e._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var d=this.getRow(a);return!d?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new n).reject()}.bind(this)):d._item||a}.bind(this))):void 0===b||b?this.reroot(a):d.reject();return d},expandItem:function(a,b){var d=new n;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?d.resolve(a):
this.myTree.expand(this.model.getId(a),function(){d.resolve(a)})}.bind(this),d.reject);return d},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(a){return(new n).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return m.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(a){},
loadResourceList:function(a,b,d){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=e.makeRelative(a);if(!b&&a===this._lastPath)return(new n).resolve(this.treeRoot);this._lastPath=a;var f=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),l["Loading "]+a).then(function(b){f.treeRoot.Path=a;"function"===typeof d&&d();f.dispatchEvent({type:"rootChanged",root:f.treeRoot});return(new n).resolve(f.treeRoot)},function(a){f.treeRoot.Path=null;f.dispatchEvent({type:"rootChanged",
root:f.treeRoot});return(new n).reject(a)}):(new n).resolve(f.treeRoot)},load:function(a,b,d){var e=m.node(this.parentId),f=m.node("progress");f||(f=document.createElement("div"),f.id="progress",m.empty(e),e.appendChild(f));m.empty(f);var g=setTimeout(function(){m.empty(f);f.appendChild(document.createTextNode(b))},500),h=this;return n.when(a,function(a){clearTimeout(g);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();h.dragAndDrop&&(h._hookedDrag?h._makeDropTarget(h.treeRoot,
e,!0):(a=(a=e&&("draggable"in e||"ondragstart"in e&&"ondrop"in e))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,e,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser."))));var f=new n;h.createTree(h.parentId,h.model,{onComplete:function(a){f.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:"undefined"===typeof h.setFocus?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return f.then(function(){if("function"===typeof d)try{d()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===typeof h.onchange)h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(g);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new n).reject(a)})},onchange:function(a){}});d.prototype.constructor=d;return{FileExplorer:d,FileModel:f}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages orion/webui/littlelib orion/webui/dialog orion/fileUtils orion/selection orion/explorers/navigationUtils orion/explorers/explorer orion/explorers/explorer-table".split(" "),function(l,n,m,k,e,h,g,b){function a(a,b){this.explorer=b;this._init(a)}function f(a){this._init(a)}a.prototype=new g.SelectionRenderer;a.prototype.constructor=a;a.prototype.getLabelColumnIndex=function(){return 0};a.prototype.getCellElement=
function(a,b,e){a=document.createElement("td");e.appendChild(a);var f=document.createElement("span");f.id=e.id+"navSpan";a.appendChild(f);f.className="mainNavColumn singleNavColumn";this.getExpandImage(e,f);f.appendChild(document.createTextNode(b.Name))};f.prototype=new m.Dialog;f.prototype.TEMPLATE='\x3cdiv id\x3d"message" style\x3d"width: 25em; padding-bottom: 5px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"directoryTree" class\x3d"explorerTreeClass" style\x3d"width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"\x3e\x3c/div\x3e';
f.prototype._init=function(a){this.title=a.title||l["Choose a Folder"];this.modal=!0;this.buttons=[{text:l.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};f.prototype._bindToDom=function(a){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
f.prototype.loadFolderList=function(d){d=k.makeRelative(d);this.selection=new e.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new b.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(b){return new a({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},b)}});this.explorer.loadResourceList(d,!0,null)};f.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};f.prototype.constructor=f;return{DirectoryPrompterDialog:f}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(l,n,m,k,e){function h(b){this._init(b)}var g=new k("edit/edit.html#{,resource,params*}");h.prototype=new m.Dialog;h.prototype.TEMPLATE='\x3cspan id\x3d"basicPane"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3clabel for\x3d"gitUrl"\x3e${Repository URL:}\x3c/label\x3e\x3cinput id\x3d"gitUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px; text-align: right;"\x3e\x3ca id\x3d"advancedLink" href\x3d"javascript:"\x3e${Choose target location}\x3c/a\x3e\x3ca id\x3d"advancedLinkHide" href\x3d"javascript:" style\x3d"display: none"\x3e${Default target location}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e\x3cspan id\x3d"advancedPane" style\x3d"display: none;"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isNewProject" type\x3d"radio" name\x3d"isNewProject" checked value\x3d"new"/\x3e\x3clabel for\x3d"gitName" style\x3d"padding: 0 8px"\x3e${New folder:}\x3c/label\x3e\x3cinput id\x3d"gitName" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isExistingProject" type\x3d"radio" name\x3d"isNewProject" value\x3d"existing"/\x3e\x3clabel for\x3d"gitPath" style\x3d"padding: 0 8px"\x3e${Existing directory:}\x3c/label\x3e\x3cinput id\x3d"gitPath" type\x3d"hidden" value\x3d""\x3e\x3cspan id\x3d"shownGitPath" style\x3d"padding-right: 24px"\x3e\x3c/span\x3e\x3ca id\x3d"changeGitPath" href\x3d"javascript:"\x3e${Change...}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e';h.prototype._init=
function(b){var a=this;this.title=b.title?b.title:l["Clone Git Repository"];this.modal=!0;this.messages=l;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){a.destroy();a._execute()},text:"OK"});this._initialize()};h.prototype._bindToDom=function(b){var a=this;this.url&&(this.$gitUrl.value=this.url);
this.advancedOnly&&(this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){a.$gitName.focus()},400));this.$changeGitPath.addEventListener("click",function(b){a._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(b){a._checkNewExisting()});this.$isNewProject.addEventListener("click",function(b){a._checkNewExisting()});this.$gitName.addEventListener("focus",function(b){a._showNewProject()});this.$advancedLink.addEventListener("click",
function(b){a._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(b){a._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};h.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};h.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";
this.$advancedLink.style.display="none";this.$advancedLinkHide.style.display=""};h.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};h.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};h.prototype._showNewProject=function(){this.$isNewProject.checked=!0};h.prototype._openDirectoryPickerDialog=function(){function b(a){var b=
document.createElement("a");b.href=e.toUrl(g.expand({resource:a.ChildrenLocation}));b.textContent=a.Name;return b}var a=this;this.$isExistingProject.checked=!0;var f=new n.DirectoryPrompterDialog({title:l["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(d){if(d&&d.Location){for(a.$gitPath.value=d.Location;a.$shownGitPath.hasChildNodes();)a.$shownGitPath.removeChild(a.$shownGitPath.lastChild);for(a.$shownGitPath.appendChild(b(d));d.parent&&"/"!==d.parent.Location;)a.$shownGitPath.insertBefore(document.createTextNode("/"),
a.$shownGitPath.firstChild),a.$shownGitPath.insertBefore(b(d.parent),a.$shownGitPath.firstChild),d=d.parent}}});this._addChildDialog(f);f.show()};h.prototype.constructor=h;return{CloneGitRepositoryDialog:h}});
define("orion/git/widgets/OpenCommitDialog","require i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/webui/dialog orion/URITemplate orion/webui/littlelib".split(" "),function(l,n,m,k,e,h,g){function b(a){this._init(a)}var a=new h("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");b.prototype=new e.Dialog;b.prototype.TEMPLATE='\x3cdiv\x3e\x3clabel for\x3d"resourceName"\x3e${Type the commit name (sha1):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d"text" id\x3d"resourceName"\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:400px; height:auto; overflow-y:auto;"\x3e\x3c/div\x3e';
b.prototype._init=function(a){this.title=a.title||n["Find Commit"];this.modal=!0;this.messages=n;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};b.prototype._bindToDom=function(a){var b=this;this.$resourceName.addEventListener("input",
function(a){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.ENTER){var e=g.$("a",b.$results);e&&(g.stop(a),window.open(e.href),b.hide())}},!1);this.$resourceName.value=this.commitName};b.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};b.prototype._findCommitLocation=function(a,b,e){var g=this;e||(e=new k);0<a.length?this.serviceRegistry.getService("orion.page.progress").progress(g.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b+a[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1"),"Getting commit details "+b).then(function(a){e.resolve(a.Children[0])},function(h){g._findCommitLocation(a.slice(1),b,e)}):e.reject();return e};b.prototype._doSearch=function(){var a=this,b=this.$resourceName&&this.$resourceName.value;
if(b){var e=document.createElement("div");e.appendChild(document.createTextNode(n["Searching..."]));g.empty(this.$results);this.$results.appendChild(e);this.serviceRegistry.getService("orion.page.message").setProgressMessage(n["Looking for the commit"]);this._findCommitLocation(this.repositories,b).then(function(b){g.empty(a.$results);a._displayCommit(b,a.$results);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){b=document.createElement("div");b.appendChild(document.createTextNode("No commits found"));
g.empty(a.$results);a.$results.appendChild(b);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};b.prototype._displayCommit=function(b,d){var e=this,h=document.createElement("div");h.style.padding="10px";h.style.maxWidth="480px";g.empty(d);d.appendChild(h);var k=b.Message.split(/(\r?\n|$)/)[0],t=document.createElement("a");t.className="navlinkonpage";t.href=l.toUrl(a.expand({resource:b.Location}));t.textContent=k;h.appendChild(t);t.addEventListener("mouseup",function(a){0===
a.button&&(!a.ctrlKey&&!a.metaKey)&&e.hide()},!1);t.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&e.hide()},!1);k=document.createElement("div");k.style.paddingTop="15px";h.appendChild(k);b.AuthorImage&&(h=new Image,h.src=b.AuthorImage,h.name=b.AuthorName,h.className="git-author-icon",k.appendChild(h));h=document.createElement("div");h.textContent=m.formatMessage(n[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());k.appendChild(h);h=
document.createElement("div");h.textContent=m.formatMessage(n["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);k.appendChild(h);h=document.createElement("div");h.style.paddingTop="15px";h.textContent=n["commit:"]+b.Name;k.appendChild(h);b.Parents&&0<b.Parents.length&&(d=document.createElement("div"),d.textContent=n["parent:"],h=document.createElement("a"),h.className="navlinkonpage",h.href=l.toUrl(a.expand({resource:b.Parents[0].Location})),h.textContent=b.Parents[0].Name,d.appendChild(h),
h.addEventListener("mouseup",function(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&e.hide()},!1),h.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&e.hide()},!1),k.appendChild(d))};b.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};b.prototype.constructor=b;return{OpenCommitDialog:b}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"urlRadio" id\x3d"urlRadio" checked/\x3e'+l["URL:"]+'\x3cinput type\x3d"text" name\x3d"url" id\x3d"url"/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"fileRadio" id\x3d"fileRadio"/\x3e'+
l["File:"]+'\x3cinput type\x3d"file" name\x3d"selectedFile" id\x3d"selectedFile" class\x3d"uploadChooser" /\x3e\x3c/div\x3e';m.prototype._init=function(k){var e=this;this.title=l["Apply Patch"];this.modal=!0;this.messages=l;this.options=k;this.buttons=[];this.buttons.push({callback:function(){e._applyPatch()},text:l.OK});this._initialize()};m.prototype._bindToDom=function(k){this.$selectedFile.onchange=function(e){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=
function(e){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};m.prototype._applyPatch=function(k){k=new FormData;k.append("uploadedfile",this.$selectedFile.files[0]);k.append("url",this.$url.value);k.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(k)};m.prototype.handleReadyState=
function(k){4===this.req.readyState&&(200===this.req.status?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};m.prototype.constructor=m;return{ApplyPatchDialog:m}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages require orion/Deferred orion/i18nUtil orion/webui/littlelib orion/commands orion/commandRegistry orion/git/util orion/compare/compareUtils orion/git/gitPreferenceStorage orion/git/gitConfigPreference orion/git/widgets/ConfirmPushDialog orion/git/widgets/RemotePrompterDialog orion/git/widgets/ReviewRequestDialog orion/git/widgets/CloneGitRepositoryDialog orion/git/widgets/GitCredentialsDialog orion/git/widgets/OpenCommitDialog orion/git/widgets/CommitDialog orion/git/widgets/ApplyPatchDialog orion/URL-shim orion/PageLinks orion/URITemplate orion/git/logic/gitPush orion/git/logic/gitCommit orion/objects".split(" "),function(l,
n,m,k,e,h,g,b,a,f,d,p,q,u,t,y,v,x,s,w,z,C,r,A,D){var B={};(function(){function p(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:l["Problem while performing the action"]}}b.HttpCode=a.status;return b}var q=!1,x=new C("git/git-repository.html#{,resource,params*}"),w=new C("git/git-log.html#{,resource,params*}?page\x3d1"),G=new C("git/git-log.html#{,resource,params*}"),H=new C("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1"),I=new C("edit/edit.html#{,resource,params*}");
B.updateNavTools=function(a,b,d,f,g,h,k){var l=e.node(f);if(l)b.destroy(l);else throw"could not find toolbar "+f;b.renderCommands(f,l,h,d,"button");if(k&&(f=e.node(k)))b.destroy(f),b.renderCommands(k,f,h,d,"button");if(g&&(h=e.node(g)))b.destroy(g),b.renderCommands(g,h,null,d,"button");q||(q=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var f=e.node(g);f&&(b.destroy(f),b.renderCommands(g,f,a.selections,d,"button"))}))};B.handleKnownHostsError=function(a,d,
e,f){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],d.KeyType,d.Host,d.HostFingerprint))){var g=b.parseSshGitUrl(d.Url);d={host:d.Host,keyType:d.KeyType,hostKey:d.HostKey,port:g.port};a.getService("orion.net.ssh").addKnownHost(d).then(function(b){e.knownHosts=b;"undefined"!==typeof e.failedOperation&&a.getService("orion.page.progress").removeOperation(e.failedOperation);f(e)})}};B.handleSshAuthenticationError=function(a,b,
d,e,g){b=b?b.Url:void 0;var h=function(){(new y.GitCredentialsDialog({title:g,serviceRegistry:a,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&""!==d.gitSshUsername||d.gitSshPassword&&""!==d.gitSshPassword||d.gitPrivateKey&&""!==d.gitPrivateKey?h():(new f(a)).get(b).then(function(b){""!==b.gitPrivateKey||""!==b.gitSshUsername||""!==b.gitSshPassword?("undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation),
e({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):h()},h)};B.getDefaultSshOptions=function(a,d,e){var f=new m;a=a.getService("orion.net.ssh");var g=e&&!e.optionsRequested?e.valueFor("sshuser"):"",h=e&&!e.optionsRequested?e.valueFor("sshpassword"):"",k;void 0!==d.GitUrl?k=d.GitUrl:void 0!==d.errorData?k=d.errorData.Url:void 0!==d.toRef?k=d.toRef.RemoteLocation[0].GitUrl:void 0!==d.RemoteLocation&&
(k=d.RemoteLocation[0].GitUrl);if(!k)return f.resolve({knownHosts:"",gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""}),f;d=b.parseSshGitUrl(k);a.getKnownHostCredentials(d.host,d.port).then(function(a){f.resolve({knownHosts:a,gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})});return f};B.handleProgressServiceResponse=function(a,b,d,e,f,g){a&&void 0!==a.status&&(a=p(a));if(!a||void 0===a.HttpCode)e&&e(a);else switch(a.HttpCode){case 401:a.JsonData&&(b.errordata=
a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);B.handleSshAuthenticationError(d,a.JsonData,b,f,g);break;case 400:if(a.JsonData&&a.JsonData.HostKey){a.failedOperation&&(b.failedOperation=a.failedOperation);B.handleKnownHostsError(d,a.JsonData,b,f);break}else if(a.JsonData&&a.JsonData.Host){a.JsonData&&(b.errordata=a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);B.handleSshAuthenticationError(d,a.JsonData,b,f,g);break}default:b=[],b.Severity="Error",b.HTML=
!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,d.getService("orion.page.message").setProgressResult(b),e&&e(a)}};B.gatherSshCredentials=function(a,d,e,g){var h=new m,n;void 0!==d.items.RemoteLocation?n=d.items.RemoteLocation[0].GitUrl:void 0!==d.items.GitUrl?n=d.items.GitUrl:void 0!==d.items.errorData?n=d.items.errorData.Url:void 0!==d.items.toRef&&(n=d.items.toRef.RemoteLocation[0].GitUrl);g=a.getService("orion.net.ssh");var p=b.parseSshGitUrl(n),q=function(b){a.getService("orion.net.ssh").getKnownHostCredentials(p.host,
p.port).then(function(a){d.sshObject=b;h.resolve({knownHosts:a,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})})},t=d.errorData;if(t&&t.HostKey){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],t.KeyType,t.Host,t.HostFingerprint))){var r=b.parseSshGitUrl(t.Url);g.addKnownHost({host:t.Host,keyType:t.KeyType,hostKey:t.HostKey,port:r.port}).then(function(){d.sshObject&&
(""!==d.sshObject.gitSshUsername||""!==d.sshObject.gitSshPassword||""!==d.sshObject.gitPrivateKey)?q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new f(a)).get(n).then(function(a){q(a)},function(){q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}return h}var u=function(){if(!d.parameters&&!d.optionsRequested)q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(d.parameters&&!d.optionsRequested){var b=d.parameters&&
d.parameters.valueFor("sshuser")?d.parameters.valueFor("sshuser"):d.errorData.User,g=d.parameters?d.parameters.valueFor("sshpassword"):"",h=d.parameters&&d.parameters.valueFor("saveCredentials")?d.parameters.valueFor("saveCredentials"):!1,k=new f(a);h?k.put(n,{gitSshUsername:b,gitSshPassword:g}).then(function(){q({gitSshUsername:b,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}):q({gitSshUsername:b,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}else(new y.GitCredentialsDialog({title:e,
serviceRegistry:a,func:q,errordata:t})).show()};d.sshObject&&(""!==d.sshObject.gitSshUsername||""!==d.sshObject.gitSshPassword||""!==d.sshObject.gitPrivateKey)?u():(new f(a)).get(n).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?q(a):u()},u);return h};B.handleGitServiceResponse=function(a,b,d,e){a&&void 0!==a.status&&(a=p(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:var g=new f(b);g.isEnabled().then(function(b){b&&void 0!==a.JsonData.Url?g.remove(a.JsonData.Url).then(function(){e(a)}):
e(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){e(a);break}default:var h=[];h.Severity="Error";h.HTML=!1;h.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?l.REJECTED_NONFASTFORWARD:a.DetailedMessage?a.DetailedMessage:a.Message;b.getService("orion.page.message").setProgressResult(h);d&&d(a)}};B.createFileCommands=function(b,d,e,p){function q(a){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(a.responseText);401===a.status?(d.HTML=!0,d.Message="\x3cspan\x3e",
d.Message+=k.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],e.label,'\x3ca target\x3d"_blank" href\x3d"'+e.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(d)}var t=function(a){a&&a.handler.changedItem?a.handler.changedItem():e.changedItem()},
s=new g.ParametersDescription([new g.CommandParameter("name","text",l["Local Branch Name:"])]),s=new h.Command({name:l.Checkout,tooltip:l["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:s,callback:function(a){var d=a.items,f=function(a,d,f){b.getService("orion.page.progress").showWhile(b.getService("orion.git.provider").checkoutTag(a,d,f),k.formatMessage(l["Checking out tag ${0}"],
f)).then(function(){e.changedItem()},q)},g=d.Repository?d.Repository.Location:d.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&f(g,d.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Tag"===a.Type||"Commit"===a.Type}});d.addCommand(s);s=new h.Command({name:l.Checkout,tooltip:l["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],
imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutBranch",callback:function(a){var d=a.items,f=b.getService("orion.git.provider"),g=b.getService("orion.page.message"),h=b.getService("orion.page.progress");g.setProgressMessage(d.Name?k.formatMessage(l["Checking out branch ${0}..."],d.Name):l["Checking out branch..."]);"Branch"===d.Type?h.progress(f.checkoutBranch(d.CloneLocation,d.Name),"Checking out branch "+d.Name).then(function(){g.setProgressResult(l["Branch checked out."]);
e.changedItem(d.parent)},function(a){q(a)}):h.progress(f.addBranch(d.Repository?d.Repository.BranchLocation:d.parent.parent.repository.BranchLocation,null,d.Name),"Adding branch "+d.Name).then(function(a){h.progress(f.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+d.Name).then(function(){g.setProgressResult(l["Branch checked out."]);e.changedItem(d.Repository?d.Repository.BranchLocation:d.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return"Branch"===
a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(s);s=new g.ParametersDescription([new g.CommandParameter("name","text","Name:")]);s=new h.Command({name:l["New Branch"],tooltip:l["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:s,callback:function(a){var d=a.items,f=b.getService("orion.page.progress"),g=function(a,g){f.progress(b.getService("orion.git.provider").addBranch(a,g),"Adding branch "+g).then(function(){e.changedItem(d)},q)},h;h="Clone"===d.Type?d.BranchLocation:
d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&g(h,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.GroupNode&&"Branches"===a.Name||"Clone"===a.Type&&"artifacts"===e.parentId}});d.addCommand(s);s=new h.Command({name:l.Delete,tooltip:l["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var d=a.items;a=b.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete branch ${0}?"],
d.Name))&&a.progress(b.getService("orion.git.provider").removeBranch(d.Location),"Removing branch "+d.Name).then(function(){e.changedItem?e.changedItem(d.parent):e.displayBranches&&e.displayBranches(d.ParentLocation,null)},q)},visibleWhen:function(a){return"Branch"===a.Type&&!a.Current}});d.addCommand(s);s=new h.Command({name:l.Delete,tooltip:l["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var d=a.items,
f=b.getService("orion.page.progress");confirm(k.formatMessage(l["You're going to delete remote branch ${0} and push the change."],d.Name)+"\n\n"+l["Are you sure?"])&&B.getDefaultSshOptions(b,d).then(function(a){var g=arguments.callee,h=b.getService("orion.git.provider"),k=b.getService("orion.page.message"),h=f.progress(h.doPush(d.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Removing remote branch: "]+d.Name);k.createProgressMonitor(h,l["Removing remote branch: "]+
d.Name);h.then(function(f){B.handleProgressServiceResponse(f,a,b,function(a){"Ok"==a.Result.Severity&&e.changedItem(d.parent)},g,l["Delete Remote Branch"])},function(e,f){B.handleProgressServiceResponse(e,a,b,function(){},g,l["Removing remote branch: "]+d.Name)})})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(s);s=new g.ParametersDescription([new g.CommandParameter("name","text","Name:"),new g.CommandParameter("url","url","Url:")]);s=new h.Command({name:l["New Remote"],
tooltip:l["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:s,callback:function(a){var d=a.items,f=b.getService("orion.page.progress"),g=function(a,g,h){f.progress(b.getService("orion.git.provider").addRemote(a,g,h),"Adding remote "+a).then(function(){e.changedItem(d)},q)},h;h="Clone"===d.Type?d.RemoteLocation:d.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&g(h,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&
"Remotes"===a.Name||"Clone"===a.Type&&"artifacts"===e.parentId}});d.addCommand(s);s=new h.Command({name:l.Delete,tooltip:l["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete remote ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").removeRemote(d.Location),"Removing remote "+d.Name).then(function(){e.changedItem(d.parent)},
q)},visibleWhen:function(a){return"Remote"===a.Type}});d.addCommand(s);s=new h.Command({name:l.Pull,tooltip:l["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var d=a.items,f=d.Location,g=d.Name;B.getDefaultSshOptions(b,d).then(function(a){var h=arguments.callee,k=b.getService("orion.git.provider"),m=b.getService("orion.page.message"),k=b.getService("orion.page.progress").progress(k.doPull(f,!1,a.gitSshUsername,
a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Pulling: "]+g);m.createProgressMonitor(k,l["Pulling: "]+g);var n;k.then(function(f){B.handleProgressServiceResponse(f,a,b,function(a){"Clone"===d.Type&&e.changedItem(d)},h,"Pull Git Repository")},function(f,g){n&&(f.failedOperation=n);B.handleProgressServiceResponse(f,a,b,function(){e.changedItem(d)},h,l["Pull Git Repository"])},function(a){n=a.Location})})},visibleWhen:function(a){return"Clone"===a.Type}});d.addCommand(s);s=new h.Command({name:l["Git Log"],
tooltip:l["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return n.toUrl(w.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return"Branch"===a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(s);s=new h.Command({name:l["Git Log"],tooltip:l["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(w.expand({resource:a.items.CommitLocation}))},
visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});d.addCommand(s);s=new h.Command({name:l.ShowInEditor,tooltip:l.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return n.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});d.addCommand(s);s=new h.Command({name:l["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(d){d=d.items;return b.getService("orion.page.progress").progress(b.getService("orion.git.provider").getDiff(d[1].DiffLocation,
d[0].Name),"Generating Diff for "+d[0].Name+" and "+d[1].Name).then(function(b){return a.generateCompareHref(b.Location,{readonly:!0})})},visibleWhen:function(a){return e.isDirectory?!1:Array.isArray(a)&&2===a.length&&"Commit"===a[0].Type&&"Commit"===a[1].Type?!0:!1}});d.addCommand(s);s=new h.Command({name:l["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(b){return a.generateCompareHref(b.items.DiffLocation,
{})},visibleWhen:function(a){return"Commit"===a.Type&&null!==a.ContentLocation&&!e.isDirectory}});d.addCommand(s);s=new h.Command({name:l.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return"Commit"===a.Type&&null!=a.ContentLocation&&!e.isDirectory}});d.addCommand(s);var v=function(a,e,h){var k=new m;if(h&&!h(h))return k.reject(),k;h=a.items;
var n=!1;h.LocalBranch&&h.RemoteBranch&&(n=h.noAuth,h=h.RemoteBranch);var p=h.Location,t=h.Name,s=function(a,e){a.JsonData.HostKey?(e.parameters=null,e.errorData=a.JsonData,e.errorData.failedOperation=a.failedOperation,d.collectParameters(e)):e.optionsRequested?(e.errorData=a.JsonData,e.errorData.failedOperation=a.failedOperation,d.collectParameters(e)):(new f(b)).isEnabled().then(function(b){e.parameters=b?a.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",
l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0}):
new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});e.errorData=a.JsonData;e.errorData.failedOperation=a.failedOperation;d.collectParameters(e)})},u=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,d.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&b.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),
B.gatherSshCredentials(b,a,null).then(function(d){var f=b.getService("orion.git.provider"),g=b.getService("orion.page.message");d=b.getService("orion.page.progress").progress(f.doFetch(p,e,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),l["Fetching remote: "]+t);g.createProgressMonitor(d,l["Fetching remote: "]+t);d.then(function(d){B.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){s(b,a)})},function(d){var e=d.status||d.HttpCode;n&&(400===e||401===
e)?k.reject():B.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){s(b,a)})})},k.reject))};if(a.items.GitUrl)u();else{var r=b.getService("orion.git.provider"),v=b.getService("orion.page.progress");v.progress(r.getGitRemote(p),"Getting remote details "+t).then(function(b){v.progress(r.getGitClone(b.CloneLocation),"Getting git repository information "+b.Name).then(function(b){a.items.GitUrl=b.Children[0].GitUrl;u()},q)},q)}return k},s=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);
return"RemoteTrackingBranch"===a.Type||"Remote"===a.Type||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1},y=new h.Command({name:l.Fetch,tooltip:l["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){return v(a,!1).then(function(){t(a)})},visibleWhen:s});d.addCommand(y);s=new h.Command({name:l["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:l["Fetch from the remote branch into your remote tracking branch overriding its current content"],
id:"eclipse.orion.git.fetchForce",callback:function(a){v(a,!0,l["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+l["Are you sure?"]).then(function(){t(a)})},visibleWhen:s});d.addCommand(s);s=new h.Command({name:l.Merge,tooltip:l["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");
var f=b.getService("orion.page.progress"),g=b.getService("orion.page.message");f.progress(a.doMerge(d.HeadLocation,d.Name,!1),"Merging "+d.Name).then(function(a){var b={};if("FAST_FORWARD"===a.Result||"ALREADY_UP_TO_DATE"===a.Result)b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){b.Severity="Warning";b.HTML=!0;b.Message="\x3cspan\x3e"+a.Result;if(a.FailingPaths){var f="",h=!0,m;for(m in a.FailingPaths)h||(f+=", "),h=!1,f+=m;h||(b.Severity="Error",b.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],
f))}b.Message+="\x3c/span\x3e"}else a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");g.setProgressResult(b);e.changedItem(d)},function(a,f){var g={Severity:"Error",HTML:!0};g.Message="\x3cspan\x3e"+JSON.stringify(f.xhr.responseText).DetailedMessage+"\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(g);
e.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1}});d.addCommand(s);s=new h.Command({name:l["Merge Squash"],tooltip:l["Squash the content of the branch to the index"],imageClass:"git-sprite-merge-squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");var f=b.getService("orion.page.progress"),
g=b.getService("orion.page.message");f.progress(a.doMerge(d.HeadLocation,d.Name,!0),"Merging "+d.Name).then(function(a){var b=[];"FAST_FORWARD_SQUASHED"===a.Result||"ALREADY_UP_TO_DATE"===a.Result?(b.Severity="Ok",b.HTML=!1,b.Message=a.Result):a.Result?(b.Severity="Warning",b.HTML=!0,b.Message="\x3cspan\x3e"+a.Result+"\x3c/span\x3e"):a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:
a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");g.setProgressResult(b);e.changedItem(d)},function(a,f){var g=[];g.Severity="Error";g.HTML=!0;g.Message="\x3cspan\x3e"+JSON.stringify(f.xhr.responseText).DetailedMessage+".\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(g);e.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===
a.toRef.Type?!0:!1}});d.addCommand(s);var A=function(a){var d=new m;a=a.items;a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);var e=b.getService("orion.page.message"),f=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(a.HeadLocation,a.Name,"BEGIN"),a.Name?l["Rebase on top of "]+a.Name:l.Rebase);e.createProgressMonitor(f,a.Name?l["Rebase on top of "]+a.Name:l.Rebase);f.then(function(a){var e={};switch(a.Result){case "OK":case "FAST_FORWARD":case "UP_TO_DATE":e.Severity=
"Ok";break;case "FAILED_WRONG_REPOSITORY_STATE":case "FAILED_UNMERGED_PATHS":case "FAILED_PENDING_CHANGES":case "UNCOMMITTED_CHANGES":e.Severity="Error";break;default:e.Severity="Warning"}if("Ok"===e.Severity)e.HTML=!1,e.Message=a.Result,d.resolve(a);else{e.HTML=!0;var f=l["Rebase"+a.Result];e.Message="\x3cspan\x3e"+a.Result+(f?f:"")+"\x3c/span\x3e";d.reject(a)}b.getService("orion.page.message").setProgressResult(e)},function(a){q(a);d.reject()});return d},s=new h.Command({name:l.Rebase,tooltip:l["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){A(a).then(function(){t(a)},function(){t()})},visibleWhen:function(a){this.tooltip=l["Rebase your commits by removing them from the active branch, "]+l["starting the active branch again based on the latest state of '"]+a.Name+"' "+l["and applying each commit again to the updated active branch."];return"RemoteTrackingBranch"===
a.Type||"Branch"===a.Type&&!a.Current}});d.addCommand(s);p={serviceRegistry:b,commandService:d,explorer:e,toolbarId:p};var C=r(D.mixin(p,{tags:!0,force:!1})).perform,M=r(D.mixin(p,{tags:!1,force:!1})).perform,O=r(D.mixin(p,{tags:!0,force:!0})).perform,E=r(D.mixin(p,{tags:!1,force:!0})).perform,$=r(D.mixin(p,{tags:!1,force:!1,gerrit:!0})).perform;p=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation:
"Branch"===a.Type&&a.Current&&a.RemoteLocation};s=new h.Command({name:l.Sync,tooltip:l.SyncTooltip,extraClass:"primaryButton",id:"eclipse.orion.git.sync",callback:function(a){return v(a).then(function(){return A(a).then(function(b){return C(a).then(function(){t(a)})},function(){t()})})},visibleWhen:p});d.addCommand(s);s=new h.Command({name:l["Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",
callback:function(a){C(a).then(function(){t(a)})},visibleWhen:p});d.addCommand(s);s=new h.Command({name:l["Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushBranch",callback:function(a){M(a).then(function(){t(a)})},visibleWhen:p});d.addCommand(s);s=new h.Command({name:l["Push for Review"],tooltip:l["Push commits to Gerrit Code Review"],imageClass:"git-sprite-push",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushToGerrit",callback:function(a){$(a).then(function(){t(a)})},visibleWhen:function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation&&a.toRef.RemoteLocation[0].IsGerrit:"Branch"===a.Type&&a.Current&&a.RemoteLocation&&a.RemoteLocation[0].IsGerrit}});d.addCommand(s);s=new h.Command({name:l["Force Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch overriding its current content"],
imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(a){O(a).then(function(){t(a)})},visibleWhen:p});d.addCommand(s);p=new h.Command({name:l["Force Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForceBranch",callback:function(a){E(a).then(function(){t(a)})},visibleWhen:p});
d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",
hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.NextLocation:!1}});d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return n.toUrl(x.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"Tag"===
a.Type?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return n.toUrl(x.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"Tag"===a.Type?void 0!==a.NextLocation:!1}});d.addCommand(p);var Y=function(a,d,f,g,h){var m=a.items;if(confirm(k.formatMessage(h,f))){a=b.getService("orion.git.provider");var n=b.getService("orion.page.message");
d=b.getService("orion.page.progress").progress(a.resetIndex(d,f,g),"Resetting git index for "+f);n.createProgressMonitor(d,l["Resetting index..."]);d.then(function(a){e.changedItem(m);n.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=a.message;n.setProgressResult(b)})}};p=new h.Command({name:l.Reset,tooltip:l["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){Y(a,a.items.IndexLocation,a.items.Name,"HARD",l.GitResetIndexConfirm)},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Undo,tooltip:l.UndoTooltip,id:"eclipse.orion.git.undoCommit",callback:function(a){Y(a,a.items.parent.remoteBranch.IndexLocation,"HEAD^","SOFT",l.UndoConfirm)},visibleWhen:function(a){return"Commit"===a.Type&&a.parent&&"Outgoing"===a.parent.Type&&
a.parent.children&&a.parent.children[0].Name===a.Name}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("name","text",l["Name:"])]);p=new h.Command({name:l.Tag,tooltip:l["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var d=a.items,f=function(a,f){b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doAddTag(a,f),"Adding tag "+f).then(function(){e.changedItem(d)},
q)},g=d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&f(g,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete tag ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRemoveTag(d.Location),
"Removing tag "+d.Name).then(function(){e.changedItem(d.parent)},q)},visibleWhen:function(a){return"Tag"===a.Type}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("reviewer","text",l["Reviewer name"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Ask for review"],tooltip:l["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var d=b.getService("orion.page.progress"),e=function(a){var b=document.createElement("a");
b.href=a;"ssh:"===b.protocol&&(b=a.indexOf("@"),-1!==b&&(a="ssh://"+a.substr(b+1)));return a},f=function(f){var g=a.items,h=g.Location.replace(g.Name,"HEAD"),k=g.AuthorName,l=g.Name,m=g.Message;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting repository details "+g.Name).then(function(a){window.location.href.split("#");var n=z.getOrionHome();a=e(a.Children[0].GitUrl);n=n+"/git/reviewRequest.html#"+a+"_"+g.Name;d.progress(b.getService("orion.git.provider").sendCommitReviewRequest(l,
h,f,n,k,m),"Sending review request for "+l).then(function(a){var d={Severity:"Ok",HTML:!1};d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)f(a.parameters.valueFor("reviewer"));else{var g=a.items;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting git details "+g.Name).then(function(a){window.location.href.split("#");var b=z.getOrionHome();a=e(a.Children[0].GitUrl);
(new u.ReviewRequestDialog({title:l["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+g.Name,func:f})).show()},q)}},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l["Cherry-Pick"],tooltip:l["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry-pick",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),
f=a.Location.replace(a.Name,"HEAD");d.progress(e.doCherryPick(f,a.Name),"Cherry picking "+a.Name).then(function(a){var d={};if("OK"===a.Result)d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="\x3cspan\x3e"+l["Nothing changed."]+"\x3c/span\x3e");else if("CONFLICTING"===a.Result)d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Some conflicts occurred"]+"\x3c/span\x3e";else if("FAILED"===a.Result){d.Severity="Error";d.HTML=!0;d.Message="\x3cspan\x3e"+
a.Result;if(a.FailingPaths){var e="",f=!0,g;for(g in a.FailingPaths)f||(e+=", "),f=!1,e+=g;f||(d.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],e))}d.Message+="\x3c/span\x3e"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Revert,tooltip:l["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),f=a.Location.replace(a.Name,"HEAD");d.progress(e.doRevert(f,a.Name),"Reverting "+a.Name).then(function(a){var d=[];"OK"===a.Result?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):"FAILURE"===a.Result?(d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Could not revert into active branch"]+"\x3c/span\x3e"):(d.Severity=
"Warning",d.HTML=!1,d.Message=a.Result);b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p)};B.createGitClonesCommands=function(a,b,e,p,q,u){function r(b){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(b.responseText);d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(d)}
function w(a){Array.isArray(a)&&(a=1<a.length?{}:a[0]);return a}p=new g.ParametersDescription([new g.CommandParameter("key","text",l["Key:"]),new g.CommandParameter("value","text",l["Value:"])]);p=new h.Command({name:l["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,f=a.getService("orion.git.provider"),g=a.getService("orion.page.progress");b.parameters.valueFor("key")&&
b.parameters.valueFor("value")&&g.progress(f.addCloneConfigurationProperty(d.ConfigLocation,b.parameters.valueFor("key"),b.parameters.valueFor("value")),"Setting configuration propetry: "+b.parameters.valueFor("key")).then(function(a){e.changedItem(d)},r)}});b.addCommand(p);p=new g.ParametersDescription([],null,function(a){a=a.items;var b;a&&(b=a.Value);return[new g.CommandParameter("value","text",l["Value:"],b)]});p=new h.Command({name:l.Edit,tooltip:l["Edit the configuration entry"],imageClass:"core-sprite-edit",
id:"eclipse.orion.git.editConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,f=a.getService("orion.git.provider"),g=a.getService("orion.page.progress");b.parameters.valueFor("value")&&g.progress(f.editCloneConfigurationProperty(d.Location,b.parameters.valueFor("value")),"Editing configuration property "+d.Key).then(function(a){e.changedItem(d)},r)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});b.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the configuration entry"],
imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(b){var d=b.items;b=a.getService("orion.git.provider");var f=a.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Key))&&f.progress(b.deleteCloneConfigurationProperty(d.Location),"Deleting configuration property "+d.Key).then(function(a){e.changedItem(d)},r)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});b.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("url",
"url",l["Repository URL:"])],{hasOptionalParameters:!0});q=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(b){var f=b.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(b,k,m){f.GitUrl=b;B.getDefaultSshOptions(a,f).then(function(p){var q=arguments.callee,t=new d(a);a.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");
t.getConfig().then(function(d){h.progress(g.cloneGitRepository(m,b,k,e.defaultPath,p.gitSshUsername,p.gitSshPassword,p.knownHosts,p.gitPrivateKey,p.gitPassphrase,d,!0),"Cloning repository "+m).then(function(b,d){B.handleProgressServiceResponse(b,p,a,function(a){g.getGitClone(a.Location).then(function(a){var b="",d;for(d in f.projectDescription)b+=d+"\x3d"+f.projectDescription[d]+"\n";u.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=n.toUrl(I.expand({resource:a.Children[0].ContentLocation}));
window.location=b})})},q,l["Clone Git Repository"])},function(b,d){B.handleProgressServiceResponse(b,p,a,function(){},q,l["Clone Git Repository"])})})})};f.url&&f.projectDescription.name&&(a.getService("orion.page.message").setProgressMessage("Looking for project "+f.projectDescription.name),u.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var d=a.Children[b];if(d.Name===f.projectDescription.name){d.Git?g.getGitClone(d.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===
f.url?window.location=n.toUrl(I.expand({resource:a.Children[0].ContentLocation})):console.info("Folder project is used")}):console.info("Folder project is used");return}}k(f.url,null,f.projectDescription.name)}))},visibleWhen:function(a){return!0}});b.addCommand(q);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:p,callback:function(b){var f=b.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),
k=function(b,k,m){f.GitUrl=b;B.getDefaultSshOptions(a,f).then(function(f){var n=arguments.callee;(new d(a)).getConfig().then(function(d){d=h.progress(g.cloneGitRepository(m,b,k,e.defaultPath,f.gitSshUsername,f.gitSshPassword,f.knownHosts,f.gitPrivateKey,f.gitPassphrase,d),"Cloning repository "+m);a.getService("orion.page.message").createProgressMonitor(d,l["Cloning repository: "]+b);d.then(function(b,d){B.handleProgressServiceResponse(b,f,a,function(a){e.changedItem&&e.changedItem()},n,l["Clone Git Repository"])},
function(b,d){B.handleProgressServiceResponse(b,f,a,function(){},n,l["Clone Git Repository"])})})})};b.parameters.valueFor("url")&&!b.parameters.optionsRequested?k(b.parameters.valueFor("url")):(new t.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:u,url:b.parameters.valueFor("url"),alwaysShowAdvanced:b.parameters.optionsRequested,func:k})).show()},visibleWhen:function(a){return!0}});b.addCommand(p);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],
id:"eclipse.cloneGitRepositoryReviewReq",callback:function(b){var f=b.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress");(new t.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:u,url:b.userData,alwaysShowAdvanced:!1,func:function(b,k,m){f.GitUrl=b;B.getDefaultSshOptions(a,f).then(function(f){var n=arguments.callee;(new d(a)).getConfig().then(function(d){d=h.progress(g.cloneGitRepository(m,b,k,e.defaultPath,f.gitSshUsername,f.gitSshPassword,f.knownHosts,f.gitPrivateKey,
f.gitPassphrase,d),"Cloning git repository "+m);a.getService("orion.page.message").createProgressMonitor(d,l["Cloning repository: "]+b);d.then(function(b,d){B.handleProgressServiceResponse(b,f,a,function(a){e.changedItem&&e.changedItem()},n,l["Clone Git Repository"])},function(b,d){B.handleProgressServiceResponse(b,f,a,function(){},n,l["Clone Git Repository"])})})})}})).show()},visibleWhen:function(a){return!0}});b.addCommand(p);p=new h.Command({name:l["Add Remote"],tooltip:l["Add a new remote to the repository"],
id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(d){d.parameters&&d.parameters.valueFor("remoteName")&&(d.remoteName=d.parameters.valueFor("remoteName"));var h=function(d,e){d.JsonData.HostKey?(e.parameters=null,e.errorData=d.JsonData,b.collectParameters(e)):e.optionsRequested?(e.errorData=d.JsonData,b.collectParameters(e)):(new f(a)).isEnabled().then(function(a){e.parameters=a?d.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword",
"password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):d.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});e.errorData=d.JsonData;b.collectParameters(e)})};if(d.parameters&&d.parameters.optionsRequested)d.parameters=null,d.optionsRequested=!0,b.collectParameters(d);else{var k=function(b,f,g){var k=a.getService("orion.page.progress");k.progress(a.getService("orion.git.provider").addRemote(b,f,d.userData),
"Adding git remote "+f).then(function(){B.gatherSshCredentials(a,d).then(function(b){a.getService("orion.git.provider").getGitRemote(g.RemoteLocation).then(function(m){for(var n,p=0;p<m.Children.length;p++)m.Children[p].Name===f&&(n=m.Children[p]);var q=a.getService("orion.git.provider");m=a.getService("orion.page.message");p=k.progress(q.doFetch(n.Location,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),"Fetching remote "+f);m.createProgressMonitor(p,l["Fetching remote: "]+
n.Location);p.then(function(b,l){B.handleGitServiceResponse(b,a,function(){k.progress(q.getGitRemote(n.Location),"Getting remote details "+f).then(function(a){e.changedItem(g)},r)},function(a){h(a,d)})},function(b,f){B.handleGitServiceResponse(b,a,function(){e.changedItem(g)},function(a){h(a,d)})})})})},r)};d.remoteName?k(d.items.RemoteLocation,d.remoteName,d.items):(d.parameters=new g.ParametersDescription([new g.CommandParameter("remoteName","text",l["Remote Name:"])],{hasOptionalParameters:!1}),
b.collectParameters(d))}},visibleWhen:function(a){return!0}});b.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("folderName","text",l["New folder:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Init Repository"],tooltip:l["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:p,callback:function(b){var f=b.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(b,k,m){f.GitUrl=b;B.getDefaultSshOptions(a,
f).then(function(f){var n=arguments.callee;(new d(a)).getConfig().then(function(d){d=h.progress(g.cloneGitRepository(m,b,k,e.defaultPath,null,null,null,null,null,d),l["Initializing repository: "]+m);a.getService("orion.page.message").createProgressMonitor(d,l["Initializing repository: "]+m);d.then(function(b,d){B.handleProgressServiceResponse(b,f,a,function(a){e.changedItem&&e.changedItem()},n,l["Init Git Repository"])},function(b,d){B.handleProgressServiceResponse(b,f,a,function(){},n,l["Init Git Repository"])})})})};
b.parameters.valueFor("folderName")&&!b.parameters.optionsRequested?k(null,null,b.parameters.valueFor("folderName")):(new t.CloneGitRepositoryDialog({serviceRegistry:a,title:l["Init Git Repository"],fileClient:u,advancedOnly:!0,func:k})).show()},visibleWhen:function(a){return!0}});b.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return"Clone"===a.Type},callback:function(b){var d=b.items;
b=a.getService("orion.git.provider");var f=a.getService("orion.page.progress");if(Array.isArray(d)){if(confirm(k.formatMessage(l["Are you sure you want do delete ${0} repositories?"],d.length)))for(var g=0,h=0;h<d.length;h++)f.progress(b.removeGitRepository(d[h].Location),"Removing repository "+d.Name).then(function(a){g++;g>=d.length&&e.changedItem&&e.changedItem()},r)}else confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Name))&&f.progress(b.removeGitRepository(d.Location),"Removing repository "+
d.Name).then(function(a){e.changedItem&&(window.location=n.toUrl(x.expand({})),e.changedItem())},r)}});b.addCommand(p);p=new h.Command({name:l["Apply Patch"],tooltip:l["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",callback:function(b){b=w(b.items);var d=new m;(new s.ApplyPatchDialog({title:l["Apply Patch"],diffLocation:b.DiffLocation||b.repository.DiffLocation,deferred:d})).show();var e=a.getService("orion.page.message");
d.then(function(a){var b;try{var d=JSON.parse(a);if(d.JsonData&&d.JsonData.modifiedFieles){b="Patch applied, files modified: ";a=!0;for(var f=0;f<d.JsonData.modifiedFieles.length;f++)a||(b+=", "),b+=d.JsonData.modifiedFieles[f],a=!1;d=[];d.Severity="Info";d.HTML=!1;d.Message=b;e.setProgressResult(d);return}}catch(g){}e.setMessage("Patch applied")},function(a){var b=JSON.parse(a);a="Apply patch failed.";b.DetailedMessage?a=a+" "+b.DetailedMessage:b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";
b.HTML=!1;b.Message=a;e.setProgressResult(b)})},visibleWhen:function(a){return"Clone"===a.Type||a.repository}});b.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("commitName","text",l["Commit name:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Open Commit"],tooltip:l["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",parameters:p,callback:function(b){var d=a.getService("orion.page.progress"),
e=function(f,g,h){null==h&&(h=new m);0<f.length?d.progress(a.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b.parameters.valueFor("commitName")+f[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1",null,null,l["Looking for the commit"]),"Looking for commit "+b.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(a){e(f.slice(1),g,h)}):h.reject();return h},f=function(d){b.parameters.optionsRequested?(new v.OpenCommitDialog({repositories:d,serviceRegistry:a,
commitName:b.parameters.valueFor("commitName")})).show():(a.getService("orion.page.message").setProgressMessage(l["Looking for the commit"]),e(d,b.parameters.valueFor("commitName")).then(function(b){b&&(b=n.toUrl(H.expand({resource:b})),window.open(b));a.getService("orion.page.message").setProgressMessage("")},function(){var b=[];b.Severity="warning";b.HTML=!1;b.Message=l["No commits found"];a.getService("orion.page.message").setProgressResult(b)}))};if("Clone"===b.items.Type){var g=[b.items];f(g)}else b.items.CloneLocation?
d.progress(a.getService("orion.git.provider").getGitClone(b.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(g=b.items,f(g))},visibleWhen:function(a){return"Clone"===a.Type||a.CloneLocation||1<a.length&&"Clone"===a[0].Type}});b.addCommand(p)};B.createGitStatusCommands=function(a,d,e,f){function g(a){Array.isArray(a)||(a=[a]);return a}function m(b,d){var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,
"",d),"Rebasing git repository");f.createProgressMonitor(g,d);g.then(function(b){if("OK"===b.Result||"ABORTED"===b.Result||"FAST_FORWARD"===b.Result||"UP_TO_DATE"===b.Result){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d);e.changedItem({})}"STOPPED"===b.Result?(d=[],d.Severity="Warning",d.HTML=!1,d.Message=b.Result+l[". Repository still contains conflicts."],a.getService("orion.page.message").setProgressResult(d),e.changedItem({})):"FAILED_UNMERGED_PATHS"===
b.Result&&(d=[],d.Severity="Error",d.HTML=!1,d.Message=b.Result+l[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d))},q)}var n=A({serviceRegistry:a,commandService:d}),p=n.perform,q=n.displayErrorOnStatus,n=new h.Command({name:l.Stage,tooltip:l["Stage the change"],imageClass:f?"core-sprite-check":"git-sprite-stage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var d=g(b.items),
h=a.getService("orion.page.message"),k=a.getService("orion.page.progress");if(1===d.length)k=k.progress(a.getService("orion.git.provider").stage(d[0].indexURI),l["Staging changes"]),h.createProgressMonitor(k,l["Staging changes"]),k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q);else{for(var m=[],n=0;n<d.length;n++)m[n]=d[n].name;k=k.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,m),l["Staging changes"]);h.createProgressMonitor(k,"Staging changes");
k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)}},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var d=0;d<a.length;d++)if(!b.isChange(a[d])||b.isStaged(a[d]))return!1;return!0}});d.addCommand(n);var t=function(b){var d=g(b.items),e=a.getService("orion.page.message"),f=a.getService("orion.page.progress");if(1===d.length)b=f.progress(a.getService("orion.git.provider").unstage(d[0].indexURI,d[0].name),"Unstaging changes");else{for(var h=[],k=0;k<d.length;k++)h[k]=d[k].name;
b=f.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,h),"Unstaging changes")}e.createProgressMonitor(b,l["Staging changes"]);return b.then(function(){return d})},n=new h.Command({name:l.Unstage,tooltip:l["Unstage the change"],imageClass:f?"core-sprite-check_on":"git-sprite-unstage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){t(a).then(function(b){f?a.handler.changedItem(b):e.changedItem(b)},q)},visibleWhen:function(a){a=
g(a);if(0===a.length)return!1;for(var d=0;d<a.length;d++)if(!b.isChange(a[d])||!b.isStaged(a[d]))return!1;return!0}});d.addCommand(n);n=new h.Command({name:f?l.SmartCommit:l.Commit,tooltip:f?"":l.Commit,id:"eclipse.orion.git.commitCommand",callback:function(a){p(a).then(function(){e.changedItem()})},visibleWhen:function(a){return!0}});d.addCommand(n);n=new h.Command({name:l.Reset,tooltip:l["Reset the branch, discarding all staged and unstaged changes"],imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",
callback:function(b){var d=b.items;a.getService("orion.page.dialog").confirm(l["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(b){if(b){b=a.getService("orion.page.message");var f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(d.IndexLocation,"HARD"),l["Resetting local changes"]);b.createProgressMonitor(f,l["Resetting local changes"]);f.then(function(a){e.changedItem(d)},
q)}})},visibleWhen:function(a){return"Status"!==a.Type?!1:b.hasStagedChanges(a)||b.hasUnstagedChanges(a)}});d.addCommand(n);n=new h.Command({name:l.Checkout,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var d=g(b.items);a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],
function(f){if(f){f=a.getService("orion.page.message");for(var g=a.getService("orion.page.progress"),h=[],k=0;k<d.length;k++)h[k]=d[k].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,h),l["Resetting local changes"]);f.createProgressMonitor(g,l["Resetting local changes"]);g.then(function(a){e.changedItem(d)},q)}})},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var d=0;d<a.length;d++)if(!b.isChange(a[d])||b.isStaged(a[d]))return!1;return!0}});
d.addCommand(n);var r=new h.Command({name:l.Discard,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutStagedCommand",callback:function(b){a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(d){d&&t(b).then(function(d){for(var g=a.getService("orion.page.message"),
h=a.getService("orion.page.progress"),k=[],m=0;m<d.length;m++)k[m]=d[m].name;h=h.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,k),l["Resetting local changes"]);g.createProgressMonitor(h,l["Resetting local changes"]);return h.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)})})},visibleWhen:function(a){a=g(a);r.name=k.formatMessage(l.Discard,a.length);return!0}});d.addCommand(r);n=new h.Command({name:l["Show Patch"],tooltip:l["Show workspace changes as a patch"],
id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){var b=g(a.items);a=a.userData.Clone.DiffLocation+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var d=0;d<a.length;d++)if(b.isStaged(a[d]))return!1;return!0}});d.addCommand(n);n=new h.Command({name:l["Show Patch"],tooltip:l["Show checked changes as a patch"],id:"eclipse.orion.git.showStagedPatchCommand",hrefCallback:function(a){var b=g(a.items);
a=a.userData.Clone.DiffLocation.replace("/Default/","/Cached/")+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){return 0!==g(a).length}});d.addCommand(n);n=new h.Command({name:l.Continue,tooltip:l["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});d.addCommand(n);
n=new h.Command({name:l["Skip Patch"],tooltip:l["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});d.addCommand(n);n=new h.Command({name:l.Abort,tooltip:l["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState&&
-1!==a.RepositoryState.indexOf("REBASING")}});d.addCommand(n)};B.createSharedCommands=function(a,b,d,e,f,g){var k=function(){d.changedItem()};f={serviceRegistry:a,commandService:b};e=r({serviceRegistry:a,commandService:b,explorer:d,toolbarId:e,tags:!0,confirmDialogCloseCallback:k,remotePrompterDialogCloseCallback:k,sshCredentialsDialogCloseCallback:k,sshSlideoutCloseCallback:k});f=A(f);g=f.createParameters(!1);var m=f.perform,n=f.displayErrorOnStatus,p=e.perform;e=new h.Command({name:l["Commit and Push"],
tooltip:l["Commit and Push"],id:"eclipse.orion.git.commitAndPushCommand",parameters:g,callback:function(b){m(b).then(function(){a.getService("orion.git.provider").getGitBranch(b.items.status.Clone.BranchLocation).then(function(a){a=a.Children;for(var d,e=0;e<a.length;e++)if(a[e].Current){d=a[e];break}b.command=void 0;b.targetBranch=void 0;b.parameters=void 0;b.items=d;p(b).then(function(){k()})},function(a){n(a)})},function(a){n(a);k()})},visibleWhen:function(a){return!0}});b.addCommand(e)}})();return B});
define("orion/git/gitStatusExplorer","require i18n!git/nls/gitmessages orion/git/widgets/gitCommitList orion/git/widgets/gitChangeList orion/section orion/URITemplate orion/PageUtil orion/webui/littlelib orion/globalCommands orion/git/gitCommands".split(" "),function(l,n,m,k,e,h,g,b,a,f){var d={},p=new h("git/git-repository.html#{,resource,params*}");d.GitStatusExplorer=function(){function d(a){this.parentId=a.parentId;this.registry=a.registry;this.commandService=a.commandService;this.fileClient=
a.fileClient;this.gitClient=a.gitClient;this.progressService=a.progressService;this.preferencesService=a.preferencesService;this.statusService=a.statusService;this.linkService=a.linkService;this.selection=a.selection;this.parentId=a.parentId;this.toolbarId=a.toolbarId;this.selectionToolsId=a.selectionToolsId;this.actionScopeId=a.actionScopeId;this.checkbox=!1}d.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:
d.Message}catch(e){b.Message=a.DetailedMessage||a.Message||a.message}this.statusService.setProgressResult(b);404===a.status&&(this.initTitleBar(),this.displayCommit())};d.prototype.changedItem=function(a,b){this.redisplay()};d.prototype.redisplay=function(){var a=g.matchResourceParameters();this.display(a.resource)};d.prototype.display=function(a){var d=this,e=b.node("table");b.empty(e);this.displayUnstaged(a).then(function(){var b=d.unstagedNavigator.model.repository,e=d.unstagedNavigator.model.status;
return d.displayStaged(a).then(function(){return d.displayCommits(b).then(function(){d.initTitleBar(e,b);f.updateNavTools(d.registry,d.commandService,d,"pageActions","selectionTools",e)})})})};d.prototype.initTitleBar=function(b,d){var e={};e.Name=n.Status+(b.RepositoryState&&-1!==b.RepositoryState.indexOf("REBASING")?n[" (Rebase in Progress)"]:"");e.Parents=[];e.Parents[0]={};e.Parents[0].Name=d.Name;e.Parents[0].Location=d.Location;e.Parents[0].ChildrenLocation=d.Location;e.Parents[1]={};e.Parents[1].Name=
n.Repo;a.setPageTarget({task:n.Status,target:d,breadcrumbTarget:e,makeBreadcrumbLink:function(a,b){a.href=l.toUrl(p.expand({resource:b||""}))},serviceRegistry:this.registry,commandService:this.commandService})};d.prototype.displayUnstaged=function(a){var d=this,f=b.node("table"),f=new e.Section(f,{id:"unstagedSection",title:n.Unstaged,content:'\x3cdiv id\x3d"unstagedNode"\x3e\x3c/div\x3e',canHide:!0,onExpandCollapse:function(a,b){d.unstagedNavigator&&(d.commandService.destroy(b.selectionNode),a&&
d.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,d.unstagedNavigator,"button",{Clone:d.unstagedNavigator.model.repository}))}});this.unstagedNavigator&&this.unstagedNavigator.destroy();this.unstagedNavigator=new k.GitChangeListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,gitClient:this.gitClient,progressService:this.progressService,selection:this.unstagedSelection,parentId:"unstagedNode",prefix:"unstaged",location:a,section:f,editableInComparePage:!0,
handleError:this.handleError});return this.unstagedNavigator.display()};d.prototype.displayStaged=function(a){var d=this,f=b.node("table"),f=new e.Section(f,{id:"stagedSection",title:n.Staged,content:'\x3cdiv id\x3d"stagedNode"\x3e\x3c/div\x3e',slideout:!0,canHide:!0,onExpandCollapse:function(a,b){d.stagedNavigator&&(d.commandService.destroy(b.selectionNode),a&&d.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,d.stagedNavigator,"button",{Clone:d.stagedNavigator.model.repository}))}});
this.stagedNavigator&&this.stagedNavigator.destroy();this.stagedNavigator=new k.GitChangeListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,gitClient:this.gitClient,progressService:this.progressService,selection:this.stagedSelection,parentId:"stagedNode",prefix:"staged",location:a,section:f,editableInComparePage:!0,handleError:this.handleError});return this.stagedNavigator.display()};d.prototype.displayCommits=function(a){var d=b.node("table"),d=new e.Section(d,{id:"commitSection",
title:n.Commits,content:'\x3cdiv id\x3d"commitNode" class\x3d"mainPadding"\x3e\x3c/div\x3e',slideout:!0,canHide:!0,preferenceService:this.preferenceService});return(new m.GitCommitListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,fileClient:this.fileClient,gitClient:this.gitClient,progressService:this.progressService,statusService:this.statusService,selection:this.selection,actionScopeId:this.actionScopeId,parentId:"commitNode",section:d,handleError:this.handleError,
root:{Type:"CommitRoot",repository:a}})).display()};return d}();return d});
define("orion/operation",["orion/xhr","orion/Deferred"],function(l,n){function m(e,h,g,b){l("GET",e,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=a.response?JSON.parse(a.response):null;h.progress(a);!a.type||"loadstart"===a.type||"progress"===a.type?setTimeout(function(){m(e,h,g,b)},2E3):("error"===a.type||"abort"===a.type?h.reject(b?b(a):a.Result):h.resolve(g?g(a):a.Result.JsonData),a.Location||l("DELETE",e,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var b=a;if(void 0!==
a.responseText){b=a.responseText;try{b=JSON.parse(a.responseText)}catch(d){}}void 0!==b.Message?(b.HttpCode=void 0===b.HttpCode?a.status:b.HttpCode,b.Severity=void 0===b.Severity?"Error":b.Severity,h.reject(b)):h.reject({Severity:"Error",Message:b,HttpCode:a.status})})}function k(e,h){h.then(null,function(g){g instanceof Error&&"Cancel"===g.name&&l("PUT",e,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(e,h,g){var b=new n;k(e,b);m(e,b,h,g);return b}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(l,n,m,k){var e=e||{};e.GitService=function(){function e(g){g&&(this._serviceRegistry=g,this._serviceRegistration=g.registerService("orion.git.provider",this))}e.prototype={checkGitService:function(){},cloneGitRepository:function(e,b,a,f,d,h,k,u,t,y,v){var x=this,s={};e&&(s.Name=e);a&&(s.Path=a);b&&(s.GitUrl=b);s.Location=f;d&&(s.GitSshUsername=d);h&&(s.GitSshPassword=h);k&&(s.GitSshKnownHost=k);u&&(s.GitSshPrivateKey=
u);t&&(s.GitSshPassphrase=t);y&&(y.GitMail&&(s.GitMail=y.GitMail),y.GitName&&(s.GitName=y.GitName));v&&(s.initProject=v);e=l.toUrl("gitapi/clone/._");e=e.substring(0,e.length-2);var w=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(s)}).then(function(a){x._getGitServiceResponse(w,a)},function(a){x._handleGitServiceResponseError(w,a)});return w},removeGitRepository:function(e){var b=this,a=new m;n("DELETE",
e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},getGitStatus:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},
stage:function(e){var b=this,a=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},stageMultipleFiles:function(e,b){var a=this,f=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(b){a._getGitServiceResponse(f,
b)},function(b){a._handleGitServiceResponseError(f,b)});return f},unstageAll:function(e,b){var a=this,f=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},unstage:function(e,b){var a=this,f=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},checkoutPath:function(e,b){var a=this,f=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b,RemoveUntracked:"true"})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},
commitAll:function(e,b,a){var f=this,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:a}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,a)});return d},getGitClone:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},
function(e){b._handleGitServiceResponseError(a,e)});return a},getGitCloneConfig:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},getGitBranch:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,
e)},function(e){b._handleGitServiceResponseError(a,e)});return a},getGitRemote:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},checkoutBranch:function(e,b){var a=this,f=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Branch:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},resetIndex:function(e,b,a){var f=this,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:b,Reset:a?a:"HARD"})}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,a)});return d},addBranch:function(e,b,a){var f=
this,d={};b&&(d.Name=b);a&&(d.Branch=a);var h=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(d)}).then(function(a){f._getGitServiceResponse(h,a)},function(a){f._handleGitServiceResponseError(h,a)});return h},removeBranch:function(e){var b=this,a=new m;n("DELETE",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,
e)},function(e){b._handleGitServiceResponseError(a,e)});return a},addRemote:function(e,b,a){var f=this,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:b,RemoteURI:a})}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,a)});return d},removeRemote:function(e){var b=this,a=new m;n("DELETE",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},doGitLog:function(e){var b=this,a=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},getDiff:function(e,b){var a=this,f=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},doFetch:function(e,b,a,f,d,h,k){var l=this,t=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:b,GitSshUsername:a,GitSshPassword:f,GitSshKnownHost:d,GitSshPrivateKey:h,GitSshPassphrase:k})}).then(function(a){l._getGitServiceResponse(t,
a)},function(a){l._handleGitServiceResponseError(t,a)});return t},doPull:function(e,b,a,f,d,h,k){var l=this,t=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:b,GitSshUsername:a,GitSshPassword:f,GitSshKnownHost:d,GitSshPrivateKey:h,GitSshPassphrase:k})}).then(function(a){l._getGitServiceResponse(t,a)},function(a){l._handleGitServiceResponseError(t,a)});return t},doMerge:function(e,
b,a){var f=this,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:b,Squash:a})}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,a)});return d},doCherryPick:function(e,b){var a=this,f=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":b})}).then(function(b){a._getGitServiceResponse(f,
b)},function(b){a._handleGitServiceResponseError(f,b)});return f},doRevert:function(e,b){var a=this,f=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},doRebase:function(e,b,a){var f=this,d={};d.Rebase=b;a&&(d.Operation=a);var h=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify(d)}).then(function(a){f._getGitServiceResponse(h,a)},function(a){f._handleGitServiceResponseError(h,a)});return h},doPush:function(e,b,a,f,d,h,k,l,t){var y=this,v=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:b,PushTags:a,Force:f,GitSshUsername:d,GitSshPassword:h,GitSshKnownHost:k,GitSshPrivateKey:l,GitSshPassphrase:t})}).then(function(a){y._getGitServiceResponse(v,
a)},function(a){y._handleGitServiceResponseError(v,a)});return v},getLog:function(e,b){var a=this,f=new m,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){d.resolve(a.xhr.getResponseHeader("Location"))},function(b){a._handleGitServiceResponseError(f,b)});d.then(function(b){n("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,
handleAs:"json"}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)})});return f},getDefaultRemoteBranch:function(e){var b=this,a=new m,f=new m;n("GET",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(f,a)},function(d){b._handleGitServiceResponseError(a,d)});f.then(function(d){n("GET",d.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(d){b._getGitServiceResponse(a,d)},function(d){b._handleGitServiceResponseError(a,d)})});return a},doAddTag:function(e,b){var a=this,f=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},doRemoveTag:function(e){var b=this,a=new m;n("DELETE",
e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},checkoutTag:function(e,b,a){var f=this,d=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:b,Branch:a})}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,
a)});return d},addCloneConfigurationProperty:function(e,b,a){var f=this,d=new m;n("POST",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:b,Value:a})}).then(function(a){f._getGitServiceResponse(d,a)},function(a){f._handleGitServiceResponseError(d,a)});return d},editCloneConfigurationProperty:function(e,b){var a=this,f=new m;n("PUT",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:b})}).then(function(b){a._getGitServiceResponse(f,b)},function(b){a._handleGitServiceResponseError(f,b)});return f},deleteCloneConfigurationProperty:function(e){var b=this,a=new m;n("DELETE",e,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){b._getGitServiceResponse(a,e)},function(e){b._handleGitServiceResponseError(a,e)});return a},sendCommitReviewRequest:function(e,
b,a,f,d,h){var k=this,l=new m;n("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:e,ReviewReqUrl:f,ReviewReqNotifyLogin:a,ReviewReqAuthorName:d,ReviewMessage:h})}).then(function(a){k._getGitServiceResponse(l,a)},function(a){k._handleGitServiceResponseError(l,a)});return l},_getGitServiceResponse:function(e,b){var a=b.response?JSON.parse(b.response):null;if(b.xhr&&202===b.xhr.status){var f=k.handle(a.Location);
f.then(e.resolve,function(b){b.failedOperation=a.Location;e.reject(b)},e.progress);e.then(null,function(a){f.reject(a)})}else e.resolve(a)},_handleGitServiceResponseError:function(e,b){e.reject(b)}};return e}();return e});
define("orion/ssh/sshTools",["orion/Deferred","orion/xhr"],function(l,n){var m=m||{};m.SshService=function(){function k(e){if(e&&(this._serviceRegistry=e,this._authService=e.getService("orion.core.auth"),this._serviceRegistration=e.registerService("orion.net.ssh",this),!this._authService)){var h;this._authService={getUser:function(){if(h){var e=new l;e.resolve(h);return e}return n("POST","../../login",{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){return h=b.response?JSON.parse(b.response):
null},function(b){h=null;return b instanceof Error&&"Cancel"===b.name?"_cancel":b.response?JSON.parse(b.response):null})}}}}k.prototype={KNOWN_HOSTS:"knownHosts",addKnownHost:function(e){e=e||{};var h=new l,g=this,b=e.host,a=e.keyType,f=e.hostKey,d=e.port||22;if(!b||!a||!f||!d)return h.reject(),h;this._authService.getUser().then(function(e){for(var k=localStorage.getItem(e.login+"/"+g.KNOWN_HOSTS),k=k?JSON.parse(k):[],l=0;l<k.length;++l){var m=k[l];if(m.host===b&&m.port===d){h.resolve(m.host+" "+
m.keyType+" "+m.hostKey);return}}m={host:b,port:d,keyType:a,hostKey:f};k.push(m);localStorage.setItem(e.login+"/"+g.KNOWN_HOSTS,JSON.stringify(k));h.resolve(m.host+" "+m.keyType+" "+m.hostKey)},function(a){h.reject(a)});return h},clearKnownHosts:function(){var e=new l,h=this;this._authService.getUser().then(function(g){var b=localStorage.getItem(g.login+"/"+h.KNOWN_HOSTS),b=b?JSON.parse(b):[];localStorage.removeItem(g.login+"/"+h.KNOWN_HOSTS);e.resolve(b)},function(g){e.reject(g)});return e},getKnownHostCredentials:function(e,
h){var g=new l,b=this;h=h||22;if(!e||!h)return g.reject(),g;this._authService.getUser().then(function(a){a=(a=localStorage.getItem(a.login+"/"+b.KNOWN_HOSTS))?JSON.parse(a):[];for(var f=0;f<a.length;++f){var d=a[f];if(d.host===e&&d.port===h){g.resolve(d.host+" "+d.keyType+" "+d.hostKey);return}}g.resolve("")},function(a){g.reject(a)});return g}};return k}();return m});
define("orion/links",[],function(){function l(l){this._init(l)}l.prototype={_init:function(l){this._registry=l.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(l,m,k,e,h){var g=l.search(k);0<g&&(m.appendChild(document.createTextNode(l.substring(0,g))),l=l.substring(g));k=l.replace(k,"");var g=l.substring(0,l.length-k.length),b=g.split(" ",e);if(b.length===e){l=document.createElement("a");for(var a=0;a<e;a++)h=h.replace("%"+
(a+1),b[a]);l.setAttribute("href",h);l.textContent=g;m.appendChild(l);l=k}return l},addLinks:function(l,m){var k=m||document.createElement("div"),e=this._registry.getServiceReferences("orion.core.linkScanner");if(0<e.length)for(var h=e[0],e=RegExp(h.getProperty("pattern"),"i"),g=h.getProperty("words"),h=h.getProperty("anchor"),b=l.search(e);0<=b;)l=this._replaceLink(l,k,e,g,h),b=l.search(e);0<l.length&&k.appendChild(document.createTextNode(l));return k}};l.prototype.constructor=l;return{TextLinkService:l}});
var eclipse;
define("git/git-status","i18n!git/nls/gitmessages require orion/browserCompatibility orion/bootstrap orion/status orion/progress orion/commandRegistry orion/commands orion/dialogs orion/selection orion/fileClient orion/operationsClient orion/searchClient orion/globalCommands orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/git/gitStatusExplorer orion/git/gitCommands orion/git/gitClient orion/ssh/sshTools orion/links orion/contentTypes orion/PageUtil".split(" "),function(l,
n,m,k,e,h,g,b,a,f,d,p,q,u,t,y,v,x,s,w,z,C,r){k.startup().then(function(k){var m=k.serviceRegistry;k=k.preferences;new a.DialogService(m);var B=new f.Selection(m);new w.SshService(m);var B=new g.CommandRegistry({selection:B}),E=new p.OperationsClient(m),K=new e.StatusReportingService(m,E,"statusPane","notifications","notificationArea"),E=new h.ProgressService(m,E,B);(new t.ThemePreferences(k,new y.ThemeData)).apply();var L=new z.TextLinkService({serviceRegistry:m}),F=new s.GitService(m),G=new d.FileClient(m);
new C.ContentTypeRegistry(m);var H=new q.Searcher({serviceRegistry:m,commandService:B,fileService:G}),I=new v.GitStatusExplorer({registry:m,commandService:B,fileClient:G,gitClient:F,progressService:E,preferencesService:k,statusService:K,linkService:L,selection:null,parentId:"artifacts",toolbarId:"pageActions",selectionToolsId:null,actionScopeId:"itemLevelCommands"});u.setPageCommandExclusions(["eclipse.git.status2","eclipse.git.status"]);u.generateBanner("orion-git-status",m,B,k,H,I);x.createFileCommands(m,
B,I,"pageActions","selectionTools");x.createGitClonesCommands(m,B,I,"pageActions","selectionTools",G);x.createSharedCommands(m,B,I,"pageActions","selectionTools",G);x.createGitStatusCommands(m,B,I);B.addCommandGroup("pageActions","eclipse.gitGroup",100);B.registerCommandContribution("pageActions","eclipse.orion.git.resetCommand",100,"eclipse.gitGroup");B.registerCommandContribution("pageActions","eclipse.orion.git.rebaseContinueCommand",200,"eclipse.gitGroup");B.registerCommandContribution("pageActions",
"eclipse.orion.git.rebaseSkipPatchCommand",300,"eclipse.gitGroup");B.registerCommandContribution("pageActions","eclipse.orion.git.rebaseAbortCommand",400,"eclipse.gitGroup");m=new b.Command({name:l["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",hrefCallback:function(a){return n.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;return a.ViewAllLabel&&a.ViewAllTooltip&&a.ViewAllLink}});B.addCommand(m);m=r.matchResourceParameters();
I.display(m.resource);window.addEventListener("hashchange",function(){var a=r.matchResourceParameters();I.display(a.resource)},!1)})});
//@ sourceMappingURL=git-status.js.map