Automated merge with http://hg.netbeans.org/main/contrib
authorTomas Zezula <tzezula@netbeans.org>
Wed, 29 Jan 2014 18:23:26 +0100
changeset 1813295f0a9cae8e0
parent 18130 93c0074459db
parent 18131 8e32d397f1e1
child 18133 0cf988b7188e
Automated merge with http://hg.netbeans.org/main/contrib
dew4nb/release/web4dew/css/app.css
dew4nb/release/web4dew/css/bootstrap-combined.min.css
dew4nb/release/web4dew/css/java-hint.css
dew4nb/release/web4dew/img/error.png
dew4nb/release/web4dew/img/glyphicons-halflings-white.png
dew4nb/release/web4dew/img/glyphicons-halflings.png
dew4nb/release/web4dew/img/html5.png
dew4nb/release/web4dew/img/java-hint-icons.png
dew4nb/release/web4dew/img/java.png
dew4nb/release/web4dew/index.html
dew4nb/release/web4dew/js/angular/angular.min.js
dew4nb/release/web4dew/js/app.js
dew4nb/release/web4dew/js/codemirror/addon/hint/show-hint.css
dew4nb/release/web4dew/js/codemirror/addon/hint/show-hint.js
dew4nb/release/web4dew/js/codemirror/codemirror.css
dew4nb/release/web4dew/js/codemirror/codemirror.js
dew4nb/release/web4dew/js/codemirror/mode/clike.js
dew4nb/release/web4dew/js/codemirror/mode/xml.js
dew4nb/release/web4dew/js/codemirror/theme/elegant.css
     1.1 --- a/dew4nb/nbproject/project.properties	Wed Jan 29 17:28:57 2014 +0100
     1.2 +++ b/dew4nb/nbproject/project.properties	Wed Jan 29 18:23:26 2014 +0100
     1.3 @@ -1,6 +1,5 @@
     1.4  javac.source=1.7
     1.5  javac.compilerargs=-Xlint -Xlint:-serial
     1.6 -run.args.ide=-J-Dweb4dew=${basedir}/release/web4dew/
     1.7  requires.nb.javac=true
     1.8  spec.version.base.fatal.warning=false
     1.9  cp.extra=${tools.jar}
     2.1 --- a/dew4nb/release/web4dew/css/app.css	Wed Jan 29 17:28:57 2014 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,99 +0,0 @@
     2.4 -/*
     2.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     2.6 - *
     2.7 - * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
     2.8 - *
     2.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    2.10 - * Other names may be trademarks of their respective owners.
    2.11 - *
    2.12 - * The contents of this file are subject to the terms of either the GNU
    2.13 - * General Public License Version 2 only ("GPL") or the Common
    2.14 - * Development and Distribution License("CDDL") (collectively, the
    2.15 - * "License"). You may not use this file except in compliance with the
    2.16 - * License. You can obtain a copy of the License at
    2.17 - * http://www.netbeans.org/cddl-gplv2.html
    2.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    2.19 - * specific language governing permissions and limitations under the
    2.20 - * License.  When distributing the software, include this License Header
    2.21 - * Notice in each file and include the License file at
    2.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    2.23 - * particular file as subject to the "Classpath" exception as provided
    2.24 - * by Oracle in the GPL Version 2 section of the License file that
    2.25 - * accompanied this code. If applicable, add the following below the
    2.26 - * License Header, with the fields enclosed by brackets [] replaced by
    2.27 - * your own identifying information:
    2.28 - * "Portions Copyrighted [year] [name of copyright owner]"
    2.29 - *
    2.30 - * If you wish your version of this file to be governed by only the CDDL
    2.31 - * or only the GPL Version 2, indicate your decision by adding
    2.32 - * "[Contributor] elects to include this software in this distribution
    2.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    2.34 - * single choice of license, a recipient has the option to distribute
    2.35 - * your version of this file under either the CDDL, the GPL Version 2 or
    2.36 - * to extend the choice of license to its licensees as provided above.
    2.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    2.38 - * Version 2 license, then the option applies only if the new code is
    2.39 - * made subject to such option by the copyright holder.
    2.40 - *
    2.41 - * Contributor(s):
    2.42 - *
    2.43 - * Portions Copyrighted 2013 Sun Microsystems, Inc.
    2.44 - */
    2.45 -/* app css stylesheet */
    2.46 -.code-editor, .mono-font, .CodeMirror {
    2.47 -    font-family: "Inconsolata","Monaco","Consolas","Andale Mono","Bitstream Vera Sans Mono","Courier New",Courier,monospace;
    2.48 -    font-size: 13px;
    2.49 -    line-height: 15px;
    2.50 -}
    2.51 -
    2.52 -.CodeMirror {                    
    2.53 -    border: 1px solid #d9edf7;      
    2.54 -    height: 300px;
    2.55 -}
    2.56 -      
    2.57 -.CodeMirror-scroll {
    2.58 -    overflow-y: auto;
    2.59 -    overflow-x: auto;
    2.60 -}
    2.61 -
    2.62 -.error-hover:hover {
    2.63 -    text-decoration: underline;
    2.64 -    cursor: pointer;
    2.65 -} 
    2.66 -
    2.67 -.ic-html5 {
    2.68 -  display: inline-block;  
    2.69 -  height: 20px;
    2.70 -  width: 20px;
    2.71 -  vertical-align: text-bottom;
    2.72 -  background-repeat: no-repeat;  
    2.73 -  background-image: url("../img/html5.png");  
    2.74 -}
    2.75 -
    2.76 -.ic-java {
    2.77 -  display: inline-block;  
    2.78 -  height: 20px;
    2.79 -  width: 20px;
    2.80 -  vertical-align: text-bottom;
    2.81 -  background-repeat: no-repeat;  
    2.82 -  background-image: url("../img/java.png"); 
    2.83 - 
    2.84 -}
    2.85 -
    2.86 -.issues {    
    2.87 -    width: 16px;
    2.88 -}
    2.89 -
    2.90 -.issue { 
    2.91 -    height: 16px;
    2.92 -    width: 16px;
    2.93 -    vertical-align: middle;
    2.94 -    background-repeat: no-repeat;  
    2.95 -    background-image: url("../img/error.png"); 
    2.96 -    /* color: #822; */
    2.97 -}
    2.98 -
    2.99 -.btn:disabled {
   2.100 -    background-color: gray;
   2.101 -}
   2.102 -
     3.1 --- a/dew4nb/release/web4dew/css/bootstrap-combined.min.css	Wed Jan 29 17:28:57 2014 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,18 +0,0 @@
     3.4 -/*!
     3.5 - * Bootstrap v2.2.2
     3.6 - *
     3.7 - * Copyright 2012 Twitter, Inc
     3.8 - * Licensed under the Apache License v2.0
     3.9 - * http://www.apache.org/licenses/LICENSE-2.0
    3.10 - *
    3.11 - * Designed and built with all the love in the world @twitter by @mdo and @fat.
    3.12 - */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}
    3.13 -/*!
    3.14 - * Bootstrap Responsive v2.2.2
    3.15 - *
    3.16 - * Copyright 2012 Twitter, Inc
    3.17 - * Licensed under the Apache License v2.0
    3.18 - * http://www.apache.org/licenses/LICENSE-2.0
    3.19 - *
    3.20 - * Designed and built with all the love in the world @twitter by @mdo and @fat.
    3.21 - */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
     4.1 --- a/dew4nb/release/web4dew/css/java-hint.css	Wed Jan 29 17:28:57 2014 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,140 +0,0 @@
     4.4 -.Java-hint {
     4.5 -  background-image: url("../img/java-hint-icons.png");
     4.6 -  background-repeat: no-repeat;
     4.7 -  padding-left: 20px;
     4.8 -  max-width: none;
     4.9 -}  
    4.10 -.Java-hint-left {
    4.11 -  float: left;
    4.12 -  display: inline-block;
    4.13 -}
    4.14 -.Java-hint-right {
    4.15 -  padding-left: 1em;
    4.16 -  float: right;
    4.17 -  display: inline-block;
    4.18 -}
    4.19 -.Dpr .Java-hint-name {
    4.20 -  text-decoration:line-through;
    4.21 -}
    4.22 -.NoI .Java-hint-name {
    4.23 -  font-weight: bolder;
    4.24 -}
    4.25 -.KW {
    4.26 -  color: rgb(0,0,153);
    4.27 -  background-position: left -376px;
    4.28 -}
    4.29 -.PKG {
    4.30 -  color: rgb(0,86,0);
    4.31 -  background-position: left -586px;
    4.32 -}
    4.33 -.CL {
    4.34 -  color: rgb(86,0,0);
    4.35 -  background-position: left -61px;
    4.36 -}
    4.37 -.IF {
    4.38 -  color: rgb(64,64,64);
    4.39 -  background-position: left -355px;
    4.40 -}
    4.41 -.EN {
    4.42 -  color: rgb(86,0,0);
    4.43 -  background-position: left -166px;
    4.44 -}
    4.45 -.AT {
    4.46 -  color: rgb(86,0,0);
    4.47 -  background-position: left 2px;
    4.48 -}
    4.49 -.TP {
    4.50 -  color: black;
    4.51 -}
    4.52 -.VAR {
    4.53 -  color: rgb(0,0,124);
    4.54 -  background-position: left -397px;
    4.55 -}
    4.56 -.MT {
    4.57 -  color: black;
    4.58 -  background-position: left -418px;
    4.59 -}
    4.60 -.MTP {
    4.61 -  color: black;
    4.62 -  background-position: left -439px;
    4.63 -}
    4.64 -.MTV {
    4.65 -  color: black;
    4.66 -  background-position: left -460px;
    4.67 -}
    4.68 -.MTR {
    4.69 -  color: black;
    4.70 -  background-position: left -481px;
    4.71 -}
    4.72 -.MTS {
    4.73 -  color: black;
    4.74 -  background-position: left -502px;
    4.75 -}
    4.76 -.MTSP {
    4.77 -  color: black;
    4.78 -  background-position: left -523px;
    4.79 -}
    4.80 -.MTSV {
    4.81 -  color: black;
    4.82 -  background-position: left -544px;
    4.83 -}
    4.84 -.MTSR {
    4.85 -  color: black;
    4.86 -  background-position: left -565px;
    4.87 -}
    4.88 -.FD {
    4.89 -  color: rgb(0,134,24);
    4.90 -  background-position: left -187px;
    4.91 -}
    4.92 -.FDP {
    4.93 -  color: rgb(0,134,24);
    4.94 -  background-position: left -208px;
    4.95 -}
    4.96 -.FDV {
    4.97 -  color: rgb(0,134,24);
    4.98 -  background-position: left -229px;
    4.99 -}
   4.100 -.FDR {
   4.101 -  color: rgb(0,134,24);
   4.102 -  background-position: left -250px;
   4.103 -}
   4.104 -.FDS {
   4.105 -  color: rgb(0,134,24);
   4.106 -  background-position: left -271px;
   4.107 -}
   4.108 -.FDSP {
   4.109 -  color: rgb(0,134,24);
   4.110 -  background-position: left -292px;
   4.111 -}
   4.112 -.FDSV {
   4.113 -  color: rgb(0,134,24);
   4.114 -  background-position: left -313px;
   4.115 -}
   4.116 -.FDSR {
   4.117 -  color: rgb(0,134,24);
   4.118 -  background-position: left -334px;
   4.119 -}
   4.120 -.CT {
   4.121 -  color: rgb(178,139,0);
   4.122 -  background-position: left -82px;
   4.123 -}
   4.124 -.CTP {
   4.125 -  color: rgb(178,139,0);
   4.126 -  background-position: left -103px;
   4.127 -}
   4.128 -.CTV {
   4.129 -  color: rgb(178,139,0);
   4.130 -  background-position: left -124px;
   4.131 -}
   4.132 -.CTR {
   4.133 -  color: rgb(178,139,0);
   4.134 -  background-position: left -145px;
   4.135 -}
   4.136 -.A {
   4.137 -  color: rgb(64,64,64);
   4.138 -  background-position: left -19px;
   4.139 -}
   4.140 -.AV {
   4.141 -  color: rgb(64,64,64);
   4.142 -  background-position: left -40px;
   4.143 -}
     5.1 Binary file dew4nb/release/web4dew/img/error.png has changed
     6.1 Binary file dew4nb/release/web4dew/img/glyphicons-halflings-white.png has changed
     7.1 Binary file dew4nb/release/web4dew/img/glyphicons-halflings.png has changed
     8.1 Binary file dew4nb/release/web4dew/img/html5.png has changed
     9.1 Binary file dew4nb/release/web4dew/img/java-hint-icons.png has changed
    10.1 Binary file dew4nb/release/web4dew/img/java.png has changed
    11.1 --- a/dew4nb/release/web4dew/index.html	Wed Jan 29 17:28:57 2014 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,153 +0,0 @@
    11.4 -<!--
    11.5 -
    11.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    11.7 -
    11.8 - Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    11.9 -
   11.10 - Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   11.11 - Other names may be trademarks of their respective owners.
   11.12 -
   11.13 - The contents of this file are subject to the terms of either the GNU
   11.14 - General Public License Version 2 only ("GPL") or the Common
   11.15 - Development and Distribution License("CDDL") (collectively, the
   11.16 - "License"). You may not use this file except in compliance with the
   11.17 - License. You can obtain a copy of the License at
   11.18 - http://www.netbeans.org/cddl-gplv2.html
   11.19 - or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   11.20 - specific language governing permissions and limitations under the
   11.21 - License.  When distributing the software, include this License Header
   11.22 - Notice in each file and include the License file at
   11.23 - nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   11.24 - particular file as subject to the "Classpath" exception as provided
   11.25 - by Oracle in the GPL Version 2 section of the License file that
   11.26 - accompanied this code. If applicable, add the following below the
   11.27 - License Header, with the fields enclosed by brackets [] replaced by
   11.28 - your own identifying information:
   11.29 - "Portions Copyrighted [year] [name of copyright owner]"
   11.30 -
   11.31 - If you wish your version of this file to be governed by only the CDDL
   11.32 - or only the GPL Version 2, indicate your decision by adding
   11.33 - "[Contributor] elects to include this software in this distribution
   11.34 - under the [CDDL or GPL Version 2] license." If you do not indicate a
   11.35 - single choice of license, a recipient has the option to distribute
   11.36 - your version of this file under either the CDDL, the GPL Version 2 or
   11.37 - to extend the choice of license to its licensees as provided above.
   11.38 - However, if you add GPL Version 2 code and therefore, elected the GPL
   11.39 - Version 2 license, then the option applies only if the new code is
   11.40 - made subject to such option by the copyright holder.
   11.41 -
   11.42 - Contributor(s):
   11.43 -
   11.44 - Portions Copyrighted 2013 Sun Microsystems, Inc.
   11.45 -
   11.46 --->
   11.47 -<!DOCTYPE html>
   11.48 -<html lang="en" ng-app="bck2brwsr" ng-controller="DevCtrl">
   11.49 -    <head>
   11.50 -        <title>DEW</title>
   11.51 -        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   11.52 -        <meta name="viewport" content="width=device-width, initial-scale=1.0">
   11.53 -        <link rel="stylesheet" href="css/bootstrap-combined.min.css"/>  
   11.54 -        <link rel="stylesheet" href="js/codemirror/codemirror.css">
   11.55 -        <link rel="stylesheet" href="js/codemirror/theme/elegant.css"/>
   11.56 -        <link rel="stylesheet" href="js/codemirror/addon/hint/show-hint.css">
   11.57 -        <link rel="stylesheet" href="css/java-hint.css"/>
   11.58 -        <link rel="stylesheet" href="css/app.css"/>
   11.59 -    </head>
   11.60 -    <body>
   11.61 -                
   11.62 -        <div class="navbar navbar-fixed-top" style="width: 100%"> 
   11.63 -        <div class="navbar-inner" style="padding-left: 12px; padding-right: 12px;">
   11.64 -            <a class="brand" style="font-size: 100%" href="http://hg.netbeans.org/main/contrib/dew4nb/" target="_blank">
   11.65 -                DEW 4 NetBeans
   11.66 -            </a>
   11.67 -            <span class="text-info"><b ng-bind="description">Loading a file ...</b>
   11.68 -            </span>
   11.69 -            <form class="navbar-form pull-right">
   11.70 -                <!-- select class="span2"></select -->
   11.71 -                <button ng-click="save()" ng-disabled="noModification()" class="btn btn-warning">Save</button>
   11.72 -                <button ng-click="run()" ng-disabled="someErrors()" class="btn btn-warning">Run</button>
   11.73 -            </form>
   11.74 -            <div class="nav">
   11.75 -                <input ng-model="gototype.value" type="search" placeholder="Name of a class"/><button ng-click="goto()" ng-disabled="noType()" class="btn btn-warning">Goto!</button>
   11.76 -            </div>
   11.77 -            <!-- form class="form form-horizontal pull-right">
   11.78 -                <button class="btn btn-warning btn-small pull-right top" ng-click="post()">Rebuild</button>
   11.79 -            </form -->
   11.80 -            <!-- ul class="nav pull-right">
   11.81 -                
   11.82 -            </ul-->     
   11.83 -        </div>  
   11.84 -        </div>
   11.85 -
   11.86 -        <div class="container-fluid">        
   11.87 -        
   11.88 -        <div style="height: 4em;">&nbsp;</div>    
   11.89 -            
   11.90 -        <div class="row-fluid">
   11.91 -            <!--
   11.92 -            <div class="span6" style="margin-bottom: 10px;"> 
   11.93 -                <table class="table table-condensed" style="margin-bottom: 2px">
   11.94 -                <tr><td><i class="ic-html5"></i> HTML5</td></tr>               
   11.95 -                </table>
   11.96 -                <div>
   11.97 -                    <textarea ui-codemirror='{ lineNumbers : true, mode : "xml", theme : "elegant", matchBrackets : true, lineWrapping : true }' ng-model="html"></textarea>
   11.98 -                    <div class="alert alert-error" ng-show="doc.modelError">
   11.99 -                        <small>{{doc.modelError.toString()}}</small>
  11.100 -                    </div>
  11.101 -                </div>    
  11.102 -            </div>
  11.103 -            -->
  11.104 -            
  11.105 -            <div class="span12">
  11.106 -                <table class="table table-condensed" style="margin-bottom: 2px">
  11.107 -                <tr><td><i class="ic-java"></i> Java</td></tr>               
  11.108 -                </table>                
  11.109 -                <div>
  11.110 -                    <textarea id="editorJava" ui-codemirror='{ lineNumbers : true, mode : "text/x-java", theme : "elegant", matchBrackets : true, lineWrapping : true, gutters: ["CodeMirror-linenumbers", "issues"], extraKeys: {"Ctrl-Space": "autocomplete"} }' ng-model="java"></textarea>
  11.111 -                    <span ng-repeat="c in completions.list">
  11.112 -                        <button class="btn-info" ng-click="applyCompletion(c, completions)">
  11.113 -                            <span ng-class="c.className">{{c.displayName || c.text}}</span>
  11.114 -                        </button>
  11.115 -                    </span>
  11.116 -                    <span ng-hide="littleCompletions()">
  11.117 -                        <a class="help-inline" ng-click="completions.more()">Ctrl-Space for more</a>...
  11.118 -                    </span>
  11.119 -                    <div class="alert alert-error" ng-show="doc.modelError">
  11.120 -                        <small>{{doc.modelError.toString()}}</small>
  11.121 -                    </div>
  11.122 -                </div>
  11.123 -            </div>
  11.124 -        
  11.125 -        </div>    
  11.126 -            
  11.127 -        <table class="table table-condensed">
  11.128 -            <tr ng-click="gotoError(e.line, e.col)" ng-repeat="e in errors" ng-class="errorClass(e.kind)">
  11.129 -                <td style="text-align: right">{{e.line}}</td> 
  11.130 -                <td>:</td> 
  11.131 -                <td style="text-align: left">{{e.col}}</td> 
  11.132 -                <td width="100%" class="text-error error-hover">{{e.msg}} <i class="icon-play"/></td>
  11.133 -            </tr>            
  11.134 -        </table>    
  11.135 -
  11.136 -        <div class="show" ng-bind="status"></div>
  11.137 -        
  11.138 -        <div>&nbsp;</div>    
  11.139 -            
  11.140 -        <ul class="nav nav-tabs">
  11.141 -            <li ng-class="'active'"><a href="#">Result</a></li>
  11.142 -        </ul>    
  11.143 -        
  11.144 -        <div id="result"></div>
  11.145 -        
  11.146 -        </div>
  11.147 -        
  11.148 -        <script src="js/angular/angular.min.js"></script>
  11.149 -        <script src="js/codemirror/codemirror.js"></script>
  11.150 -        <script src="js/codemirror/addon/hint/show-hint.js"></script>
  11.151 -        <script src="js/codemirror/mode/xml.js"></script>
  11.152 -        <script src="js/codemirror/mode/clike.js"></script>
  11.153 -        <script src="js/app.js"></script>
  11.154 -        <script id="brwsrvm"></script>
  11.155 -    </body>
  11.156 -</html>
    12.1 --- a/dew4nb/release/web4dew/js/angular/angular.min.js	Wed Jan 29 17:28:57 2014 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,159 +0,0 @@
    12.4 -/*
    12.5 - AngularJS v1.0.3
    12.6 - (c) 2010-2012 Google, Inc. http://angularjs.org
    12.7 - License: MIT
    12.8 -*/
    12.9 -(function(U,ca,p){'use strict';function m(b,a,c){var d;if(b)if(N(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(L(b)&&wa(b.length))for(d=0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function lb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function ec(b,a,c){for(var d=lb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}
   12.10 -function mb(b){return function(a,c){b(c,a)}}function xa(){for(var b=Z.length,a;b;){b--;a=Z[b].charCodeAt(0);if(a==57)return Z[b]="A",Z.join("");if(a==90)Z[b]="0";else return Z[b]=String.fromCharCode(a+1),Z.join("")}Z.unshift("0");return Z.join("")}function x(b){m(arguments,function(a){a!==b&&m(a,function(a,d){b[d]=a})});return b}function G(b){return parseInt(b,10)}function ya(b,a){return x(new (x(function(){},{prototype:b})),a)}function D(){}function ma(b){return b}function I(b){return function(){return b}}
   12.11 -function t(b){return typeof b=="undefined"}function v(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function F(b){return typeof b=="string"}function wa(b){return typeof b=="number"}function na(b){return Sa.apply(b)=="[object Date]"}function J(b){return Sa.apply(b)=="[object Array]"}function N(b){return typeof b=="function"}function oa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function R(b){return F(b)?b.replace(/^\s*/,"").replace(/\s*$/,""):b}function fc(b){return b&&
   12.12 -(b.nodeName||b.bind&&b.find)}function Ta(b,a,c){var d=[];m(b,function(b,g,i){d.push(a.call(c,b,g,i))});return d}function gc(b,a){var c=0,d;if(J(b)||F(b))return b.length;else if(L(b))for(d in b)(!a||b.hasOwnProperty(d))&&c++;return c}function za(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Ua(b,a){var c=za(b,a);c>=0&&b.splice(c,1);return a}function V(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw B("Can't copy Window or Scope");if(a){if(b===
   12.13 -a)throw B("Can't copy equivalent objects or arrays");if(J(b)){for(;a.length;)a.pop();for(var c=0;c<b.length;c++)a.push(V(b[c]))}else for(c in m(a,function(b,c){delete a[c]}),b)a[c]=V(b[c])}else(a=b)&&(J(b)?a=V(b,[]):na(b)?a=new Date(b.getTime()):L(b)&&(a=V(b,{})));return a}function hc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&c.substr(0,2)!=="$$"&&(a[c]=b[c]);return a}function ha(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&
   12.14 -c=="object")if(J(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ha(b[d],a[d]))return!1;return!0}}else if(na(b))return na(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||oa(b)||oa(a))return!1;c={};for(d in b){if(d.charAt(0)!=="$"&&!N(b[d])&&!ha(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&d.charAt(0)!=="$"&&!N(a[d]))return!1;return!0}return!1}function Va(b,a){var c=arguments.length>2?ia.call(arguments,2):[];return N(a)&&!(a instanceof RegExp)?c.length?
   12.15 -function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&ca===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?"  ":null)}function nb(b){return F(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=E(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;
   12.16 -return b}function pa(b){b=u(b).clone();try{b.html("")}catch(a){}return u("<div>").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+E(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function ob(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,
   12.17 -"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(ca.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+
   12.18 -a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes,function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function pb(b,a){b=u(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=qb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,
   12.19 -function(b,d){return(d?a:"")+b.toLowerCase()})}function qa(b,a,c){if(!b)throw new B("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function ra(b,a,c){c&&J(b)&&(b=b[b.length-1]);qa(N(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,
   12.20 -d,e){return function(){b[e||"push"]([c,d,arguments]);return j}}if(!e)throw B("No module: "+d);var b=[],c=[],k=a("$injector","invoke"),j={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:k,run:function(a){c.push(a);
   12.21 -return this}};g&&k(g);return j})}})}function rb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc,"Moz$1")}function ab(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,k,j,l;b.length;){i=b.shift();f=0;for(h=i.length;f<h;f++){k=u(i[f]);c?k.triggerHandler("$destroy"):c=!c;j=0;for(e=(l=k.children()).length,k=e;j<k;j++)b.push(ja(l[j]))}}return d.apply(this,arguments)}var d=ja.fn[b],d=d.$original||d;c.$original=d;ja.fn[b]=c}function Q(b){if(b instanceof Q)return b;if(!(this instanceof
   12.22 -Q)){if(F(b)&&b.charAt(0)!="<")throw B("selectors not implemented");return new Q(b)}if(F(b)){var a=ca.createElement("div");a.innerHTML="<div>&#160;</div>"+b;a.removeChild(a.firstChild);bb(this,a.childNodes);this.remove()}else bb(this,b)}function cb(b){return b.cloneNode(!0)}function sa(b){sb(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)sa(b[a])}function tb(b,a,c){var d=$(b,"events");$(b,"handle")&&(t(a)?m(d,function(a,c){db(b,c,a);delete d[c]}):t(c)?(db(b,a,d[a]),delete d[a]):Ua(d[a],c))}function sb(b){var a=
   12.23 -b[Aa],c=Ba[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),tb(b)),delete Ba[a],b[Aa]=p)}function $(b,a,c){var d=b[Aa],d=Ba[d||-1];if(v(c))d||(b[Aa]=d=++oc,d=Ba[d]={}),d[a]=c;else return d&&d[a]}function ub(b,a,c){var d=$(b,"data"),e=v(c),g=!e&&v(a),i=g&&!L(a);!d&&!i&&$(b,"data",d={});if(e)d[a]=c;else if(g)if(i)return d&&d[a];else x(d,a);else return d}function Ca(b,a){return(" "+b.className+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" ")>-1}function vb(b,a){a&&m(a.split(" "),function(a){b.className=
   12.24 -R((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+R(a)+" "," "))})}function wb(b,a){a&&m(a.split(" "),function(a){if(!Ca(b,a))b.className=R(b.className+" "+R(a))})}function bb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function xb(b,a){return Da(b,"$"+(a||"ngController")+"Controller")}function Da(b,a,c){b=u(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=b.data(a))return c;b=b.parent()}}function yb(b,a){var c=Ea[a.toLowerCase()];
   12.25 -return c&&zb[b.nodeName]&&c}function pc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||ca;if(t(c.defaultPrevented)){var g=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;g.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented};m(a[e||c.type],function(a){a.call(b,c)});aa<=8?(c.preventDefault=null,
   12.26 -c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function ga(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$$hashKey)=="function")c=b.$$hashKey();else{if(c===p)c=b.$$hashKey=xa()}else c=b;return a+":"+c}function Fa(b){m(b,this.put,this)}function eb(){}function Ab(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=[],c=b.toString().replace(qc,""),c=c.match(rc),m(c[1].split(sc),function(b){b.replace(tc,
   12.27 -function(b,c,d){a.push(d)})}),b.$inject=a}else J(b)?(c=b.length-1,ra(b[c],"fn"),a=b.slice(0,c)):ra(b,"fn",!0);return a}function qb(b){function a(a){return function(b,c){if(L(b))m(b,mb(a));else return a(b,c)}}function c(a,b){N(b)&&(b=l.instantiate(b));if(!b.$get)throw B("Provider "+a+" must define $get factory method.");return j[a+f]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];m(a,function(a){if(!k.get(a))if(k.put(a,!0),F(a)){var c=ta(a);b=b.concat(e(c.requires)).concat(c._runBlocks);
   12.28 -try{for(var d=c._invokeQueue,c=0,f=d.length;c<f;c++){var h=d[c],g=h[0]=="$injector"?l:l.get(h[0]);g[h[1]].apply(g,h[2])}}catch(n){throw n.message&&(n.message+=" from "+a),n;}}else if(N(a))try{b.push(l.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i;}else if(J(a))try{b.push(l.invoke(a))}catch(j){throw j.message&&(j.message+=" from "+String(a[a.length-1])),j;}else ra(a,"module")});return b}function g(a,b){function c(d){if(typeof d!=="string")throw B("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===
   12.29 -i)throw B("Circular dependency: "+h.join(" <- "));return a[d]}else try{return h.unshift(d),a[d]=i,a[d]=b(d)}finally{h.shift()}}function d(a,b,e){var f=[],k=Ab(a),g,n,i;n=0;for(g=k.length;n<g;n++)i=k[n],f.push(e&&e.hasOwnProperty(i)?e[i]:c(i,h));a.$inject||(a=a[g]);switch(b?-1:f.length){case 0:return a();case 1:return a(f[0]);case 2:return a(f[0],f[1]);case 3:return a(f[0],f[1],f[2]);case 4:return a(f[0],f[1],f[2],f[3]);case 5:return a(f[0],f[1],f[2],f[3],f[4]);case 6:return a(f[0],f[1],f[2],f[3],
   12.30 -f[4],f[5]);case 7:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);case 8:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7]);case 9:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8]);case 10:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9]);default:return a.apply(b,f)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(J(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Ab}}var i={},f="Provider",h=[],k=new Fa,j={$provide:{provider:a(c),
   12.31 -factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,I(b))}),constant:a(function(a,b){j[a]=b;o[a]=b}),decorator:function(a,b){var c=l.get(a+f),d=c.$get;c.$get=function(){var a=r.invoke(d,c);return r.invoke(b,null,{$delegate:a})}}}},l=g(j,function(){throw B("Unknown provider: "+h.join(" <- "));}),o={},r=o.$injector=g(o,function(a){a=l.get(a+f);return r.invoke(a.$get,a)});m(e(b),function(a){r.invoke(a||D)});return r}function uc(){var b=
   12.32 -!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;m(a,function(a){!b&&E(a.nodeName)==="a"&&(b=a)});return b}function g(){var b=c.hash(),d;b?(d=i.getElementById(b))?d.scrollIntoView():(d=e(i.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var i=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(g)});return g}]}function vc(b,a,c,d){function e(a){try{a.apply(null,
   12.33 -ia.call(arguments,1))}finally{if(n--,n===0)for(;w.length;)try{w.pop()()}catch(b){c.error(b)}}}function g(a,b){(function ea(){m(q,function(a){a()});s=b(ea,a)})()}function i(){O!=f.url()&&(O=f.url(),m(A,function(a){a(f.url())}))}var f=this,h=a[0],k=b.location,j=b.history,l=b.setTimeout,o=b.clearTimeout,r={};f.isMock=!1;var n=0,w=[];f.$$completeOutstandingRequest=e;f.$$incOutstandingRequestCount=function(){n++};f.notifyWhenNoOutstandingRequests=function(a){m(q,function(a){a()});n===0?a():w.push(a)};
   12.34 -var q=[],s;f.addPollFn=function(a){t(s)&&g(100,l);q.push(a);return a};var O=k.href,C=a.find("base");f.url=function(a,b){if(a){if(O!=a)return O=a,d.history?b?j.replaceState(null,"",a):(j.pushState(null,"",a),C.attr("href",C.attr("href"))):b?k.replace(a):k.href=a,f}else return k.href.replace(/%27/g,"'")};var A=[],K=!1;f.onUrlChange=function(a){K||(d.history&&u(b).bind("popstate",i),d.hashchange?u(b).bind("hashchange",i):f.addPollFn(i),K=!0);A.push(a);return a};f.baseHref=function(){var a=C.attr("href");
   12.35 -return a?a.replace(/^https?\:\/\/[^\/]*/,""):a};var W={},y="",M=f.baseHref();f.cookies=function(a,b){var d,e,f,k;if(a)if(b===p)h.cookie=escape(a)+"=;path="+M+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(F(b))d=(h.cookie=escape(a)+"="+escape(b)+";path="+M).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"),W.length>20&&c.warn("Cookie '"+a+"' possibly not set or overflowed because too many cookies were already set ("+W.length+
   12.36 -" > 20 )")}else{if(h.cookie!==y){y=h.cookie;d=y.split("; ");W={};for(f=0;f<d.length;f++)e=d[f],k=e.indexOf("="),k>0&&(W[unescape(e.substring(0,k))]=unescape(e.substring(k+1)))}return W}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c];e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(D),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,
   12.37 -d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw B("cacheId "+b+" taken");var i=0,f=x({},d,{id:b}),h={},k=d&&d.capacity||Number.MAX_VALUE,j={},l=null,o=null;return a[b]={put:function(a,b){var c=j[a]||(j[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>k&&this.remove(o.key))},get:function(a){var b=j[a];if(b)return e(b),h[a]},remove:function(a){var b=j[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete j[a];
   12.38 -delete h[a];i--}},removeAll:function(){h={};i=0;j={};l=o=null},destroy:function(){j=f=h=null;delete a[b]},info:function(){return x({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Bb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";
   12.39 -this.directive=function f(d,e){F(d)?(qa(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(N(f))f={compile:I(f)};else if(!f.compile&&f.link)f.compile=I(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(k){c(k)}});return e}])),a[d].push(e)):m(d,mb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler",
   12.40 -"$http","$templateCache","$parse","$controller","$rootScope",function(b,h,k,j,l,o,r,n){function w(a,b,c){a instanceof u||(a=u(a));m(a,function(b,c){b.nodeType==3&&(a[c]=u(b).wrap("<span></span>").parent()[0])});var d=s(a,b,a,c);return function(b,c){qa(b,"scope");var e=c?ua.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function s(a,b,c,d){function e(a,c,d,k){for(var g,h,j,n,o,l=0,r=0,q=f.length;l<q;r++)j=c[r],g=f[l++],
   12.41 -h=f[l++],g?(g.scope?(n=a.$new(L(g.scope)),u(j).data("$scope",n)):n=a,(o=g.transclude)||!k&&b?g(h,n,j,d,function(b){return function(c){var d=a.$new();return b(d,c).bind("$destroy",Va(d,d.$destroy))}}(o||b)):g(h,n,j,p,k)):h&&h(a,j.childNodes,p,k)}for(var f=[],k,g,h,j=0;j<a.length;j++)g=new ea,k=O(a[j],[],g,d),g=(k=k.length?C(k,a[j],g,b,c):null)&&k.terminal||!a[j].childNodes.length?null:s(a[j].childNodes,k?k.transclude:b),f.push(k),f.push(g),h=h||k||g;return h?e:null}function O(a,b,c,f){var k=c.$attr,
   12.42 -g;switch(a.nodeType){case 1:A(b,fa(Cb(a).toLowerCase()),"E",f);var h,j,n;g=a.attributes;for(var o=0,l=g&&g.length;o<l;o++)if(h=g[o],h.specified)j=h.name,n=fa(j.toLowerCase()),k[n]=j,c[n]=h=R(aa&&j=="href"?decodeURIComponent(a.getAttribute(j,2)):h.value),yb(a,n)&&(c[n]=!0),X(a,b,h,n),A(b,n,"A",f);a=a.className;if(F(a)&&a!=="")for(;g=e.exec(a);)n=fa(g[2]),A(b,n,"C",f)&&(c[n]=R(g[3])),a=a.substr(g.index+g[0].length);break;case 3:H(b,a.nodeValue);break;case 8:try{if(g=d.exec(a.nodeValue))n=fa(g[1]),A(b,
   12.43 -n,"M",f)&&(c[n]=R(g[2]))}catch(r){}}b.sort(y);return b}function C(a,b,c,d,e){function f(a,b){if(a)a.require=z.require,l.push(a);if(b)b.require=z.require,ba.push(b)}function h(a,b){var c,d="data",e=!1;if(F(a)){for(;(c=a.charAt(0))=="^"||c=="?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw B("No controller: "+a);}else J(a)&&(c=[],m(a,function(a){c.push(h(a,b))}));return c}function j(a,d,e,f,g){var n,q,w,K,s;n=b===e?c:hc(c,new ea(u(e),c.$attr));q=n.$$element;
   12.44 -if(C){var zc=/^\s*([@=&])\s*(\w*)\s*$/,O=d.$parent||d;m(C.scope,function(a,b){var c=a.match(zc)||[],e=c[2]||b,f,g,k;switch(c[1]){case "@":n.$observe(e,function(a){d[b]=a});n.$$observers[e].$$scope=O;break;case "=":g=o(n[e]);k=g.assign||function(){f=d[b]=g(O);throw B(Db+n[e]+" (directive: "+C.name+")");};f=d[b]=g(O);d.$watch(function(){var a=g(O);a!==d[b]&&(a!==f?f=d[b]=a:k(O,a=f=d[b]));return a});break;case "&":g=o(n[e]);d[b]=function(a){return g(O,a)};break;default:throw B("Invalid isolate scope definition for directive "+
   12.45 -C.name+": "+a);}})}t&&m(t,function(a){var b={$scope:d,$element:q,$attrs:n,$transclude:g};s=a.controller;s=="@"&&(s=n[a.name]);q.data("$"+a.name+"Controller",r(s,b))});f=0;for(w=l.length;f<w;f++)try{K=l[f],K(d,q,n,K.require&&h(K.require,q))}catch(y){k(y,pa(q))}a&&a(d,e.childNodes,p,g);f=0;for(w=ba.length;f<w;f++)try{K=ba[f],K(d,q,n,K.require&&h(K.require,q))}catch(Ha){k(Ha,pa(q))}}for(var n=-Number.MAX_VALUE,l=[],ba=[],s=null,C=null,A=null,y=c.$$element=u(b),z,H,X,D,v=d,t,x,Y,E=0,G=a.length;E<G;E++){z=
   12.46 -a[E];X=p;if(n>z.priority)break;if(Y=z.scope)M("isolated scope",C,z,y),L(Y)&&(q(y,"ng-isolate-scope"),C=z),q(y,"ng-scope"),s=s||z;H=z.name;if(Y=z.controller)t=t||{},M("'"+H+"' controller",t[H],z,y),t[H]=z;if(Y=z.transclude)M("transclusion",D,z,y),D=z,n=z.priority,Y=="element"?(X=u(b),y=c.$$element=u("<\!-- "+H+": "+c[H]+" --\>"),b=y[0],Ga(e,u(X[0]),b),v=w(X,d,n)):(X=u(cb(b)).contents(),y.html(""),v=w(X,d));if(Y=z.template)if(M("template",A,z,y),A=z,Y=Ha(Y),z.replace){X=u("<div>"+R(Y)+"</div>").contents();
   12.47 -b=X[0];if(X.length!=1||b.nodeType!==1)throw new B(g+Y);Ga(e,y,b);H={$attr:{}};a=a.concat(O(b,a.splice(E+1,a.length-(E+1)),H));K(c,H);G=a.length}else y.html(Y);if(z.templateUrl)M("template",A,z,y),A=z,j=W(a.splice(E,a.length-E),j,y,c,e,z.replace,v),G=a.length;else if(z.compile)try{x=z.compile(y,c,v),N(x)?f(null,x):x&&f(x.pre,x.post)}catch(I){k(I,pa(y))}if(z.terminal)j.terminal=!0,n=Math.max(n,z.priority)}j.scope=s&&s.scope;j.transclude=D&&v;return j}function A(d,e,g,h){var j=!1;if(a.hasOwnProperty(e))for(var n,
   12.48 -e=b.get(e+c),o=0,l=e.length;o<l;o++)try{if(n=e[o],(h===p||h>n.priority)&&n.restrict.indexOf(g)!=-1)d.push(n),j=!0}catch(r){k(r)}return j}function K(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function W(a,b,c,d,e,
   12.49 -f,k){var h=[],n,o,r=c[0],q=a.shift(),w=x({},q,{controller:null,templateUrl:null,transclude:null,scope:null});c.html("");j.get(q.templateUrl,{cache:l}).success(function(j){var l,q,j=Ha(j);if(f){q=u("<div>"+R(j)+"</div>").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new B(g+j);j={$attr:{}};Ga(e,c,l);O(l,a,j);K(d,j)}else l=r,c.html(j);a.unshift(w);n=C(a,c,d,k);for(o=s(c.contents(),k);h.length;){var ba=h.pop(),j=h.pop();q=h.pop();var y=h.pop(),m=l;q!==r&&(m=cb(l),Ga(j,u(q),m));n(function(){b(o,
   12.50 -y,m,e,ba)},y,m,e,ba)}h=null}).error(function(a,b,c,d){throw B("Failed to load template: "+d.url);});return function(a,c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function y(a,b){return b.priority-a.priority}function M(a,b,c,d){if(b)throw B("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function H(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:I(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",
   12.51 -e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function X(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Ga(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f<g;f++)if(a[f]==d){a[f]=c;break}}e&&e.replaceChild(c,d);c[u.expando]=d[u.expando];b[0]=c}var ea=
   12.52 -function(a,b){this.$$element=a;this.$attr=b||{}};ea.prototype={$normalize:fa,$set:function(a,b,c,d){var e=yb(this.$$element[0],a),f=this.$$observers;e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=$a(a,"-"));c!==!1&&(b===null||b===p?this.$$element.removeAttr(d):this.$$element.attr(d,b));f&&m(f[a],function(a){try{a(b)}catch(c){k(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);n.$evalAsync(function(){e.$$inter||
   12.53 -b(c[a])});return b}};var D=h.startSymbol(),ba=h.endSymbol(),Ha=D=="{{"||ba=="}}"?ma:function(a){return a.replace(/\{\{/g,D).replace(/}}/g,ba)};return w}]}function fa(b){return rb(b.replace(Ac,""))}function Bc(){var b={};this.register=function(a,c){L(a)?x(b,a):b[a]=c};this.$get=["$injector","$window",function(a,c){return function(d,e){if(F(d)){var g=d,d=b.hasOwnProperty(g)?b[g]:fb(e.$scope,g,!0)||fb(c,g,!0);ra(d,g,!0)}return a.instantiate(d,e)}}]}function Cc(){this.$get=["$window",function(b){return u(b.document)}]}
   12.54 -function Dc(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Ec(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse",function(c){function d(d,f){for(var h,k,j=0,l=[],o=d.length,r=!1,n=[];j<o;)(h=d.indexOf(b,j))!=-1&&(k=d.indexOf(a,h+e))!=-1?(j!=h&&l.push(d.substring(j,h)),l.push(j=c(r=d.substring(h+e,k))),j.exp=r,j=k+g,r=!0):(j!=o&&l.push(d.substring(j)),j=o);if(!(o=
   12.55 -l.length))l.push(""),o=1;if(!f||r)return n.length=o,j=function(a){for(var b=0,c=o,d;b<c;b++){if(typeof(d=l[b])=="function")d=d(a),d==null||d==p?d="":typeof d!="string"&&(d=da(d));n[b]=d}return n.join("")},j.exp=d,j.parts=l,j}var e=b.length,g=a.length;d.startSymbol=function(){return b};d.endSymbol=function(){return a};return d}]}function Eb(b){for(var b=b.split("/"),a=b.length;a--;)b[a]=Za(b[a]);return b.join("/")}function va(b,a){var c=Fb.exec(b),c={protocol:c[1],host:c[3],port:G(c[5])||Gb[c[1]]||
   12.56 -null,path:c[6]||"/",search:c[8],hash:c[10]};if(a)a.$$protocol=c.protocol,a.$$host=c.host,a.$$port=c.port;return c}function ka(b,a,c){return b+"://"+a+(c==Gb[b]?"":":"+c)}function Fc(b,a,c){var d=va(b);return decodeURIComponent(d.path)!=a||t(d.hash)||d.hash.indexOf(c)!==0?b:ka(d.protocol,d.host,d.port)+a.substr(0,a.lastIndexOf("/"))+d.hash.substr(c.length)}function Gc(b,a,c){var d=va(b);if(decodeURIComponent(d.path)==a)return b;else{var e=d.search&&"?"+d.search||"",g=d.hash&&"#"+d.hash||"",i=a.substr(0,
   12.57 -a.lastIndexOf("/")),f=d.path.substr(i.length);if(d.path.indexOf(i)!==0)throw B('Invalid url "'+b+'", missing path prefix "'+i+'" !');return ka(d.protocol,d.host,d.port)+a+"#"+c+f+e+g}}function gb(b,a,c){a=a||"";this.$$parse=function(b){var c=va(b,this);if(c.path.indexOf(a)!==0)throw B('Invalid url "'+b+'", missing path prefix "'+a+'" !');this.$$path=decodeURIComponent(c.path.substr(a.length));this.$$search=Xa(c.search);this.$$hash=c.hash&&decodeURIComponent(c.hash)||"";this.$$compose()};this.$$compose=
   12.58 -function(){var b=ob(this.$$search),c=this.$$hash?"#"+Za(this.$$hash):"";this.$$url=Eb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ka(this.$$protocol,this.$$host,this.$$port)+a+this.$$url};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Ia(b,a,c){var d;this.$$parse=function(b){var c=va(b,this);if(c.hash&&c.hash.indexOf(a)!==0)throw B('Invalid url "'+b+'", missing hash prefix "'+a+'" !');d=c.path+(c.search?"?"+c.search:"");c=Hc.exec((c.hash||"").substr(a.length));
   12.59 -this.$$path=c[1]?(c[1].charAt(0)=="/"?"":"/")+decodeURIComponent(c[1]):"";this.$$search=Xa(c[3]);this.$$hash=c[5]&&decodeURIComponent(c[5])||"";this.$$compose()};this.$$compose=function(){var b=ob(this.$$search),c=this.$$hash?"#"+Za(this.$$hash):"";this.$$url=Eb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ka(this.$$protocol,this.$$host,this.$$port)+d+(this.$$url?"#"+a+this.$$url:"")};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Hb(b,a,c,d){Ia.apply(this,arguments);
   12.60 -this.$$rewriteAppUrl=function(b){if(b.indexOf(c)==0)return c+d+"#"+a+b.substr(c.length)}}function Ja(b){return function(){return this[b]}}function Ib(b,a){return function(c){if(t(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Ic(){var b="",a=!1;this.hashPrefix=function(a){return v(a)?(b=a,this):b};this.html5Mode=function(b){return v(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function i(a){c.$broadcast("$locationChangeSuccess",
   12.61 -f.absUrl(),a)}var f,h,k,j=d.url(),l=va(j);a?(h=d.baseHref()||"/",k=h.substr(0,h.lastIndexOf("/")),l=ka(l.protocol,l.host,l.port)+k+"/",f=e.history?new gb(Fc(j,h,b),k,l):new Hb(Gc(j,h,b),b,l,h.substr(k.length+1))):(l=ka(l.protocol,l.host,l.port)+(l.path||"")+(l.search?"?"+l.search:"")+"#"+b+"/",f=new Ia(j,b,l));g.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=u(a.target);E(b[0].nodeName)!=="a";)if(b[0]===g[0]||!(b=b.parent())[0])return;var d=b.prop("href"),e=f.$$rewriteAppUrl(d);
   12.62 -d&&!b.attr("target")&&e&&(f.$$parse(e),c.$apply(),a.preventDefault(),U.angular["ff-684208-preventDefault"]=!0)}});f.absUrl()!=j&&d.url(f.absUrl(),!0);d.onUrlChange(function(a){f.absUrl()!=a&&(c.$evalAsync(function(){var b=f.absUrl();f.$$parse(a);i(b)}),c.$$phase||c.$digest())});var o=0;c.$watch(function(){var a=d.url(),b=f.$$replace;if(!o||a!=f.absUrl())o++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",f.absUrl(),a).defaultPrevented?f.$$parse(a):(d.url(f.absUrl(),b),i(a))});f.$$replace=
   12.63 -!1;return o});return f}]}function Jc(){this.$get=["$window",function(b){function a(a){a instanceof B&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===-1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function c(c){var e=b.console||{},g=e[c]||e.log||D;return g.apply?function(){var b=[];m(arguments,function(c){b.push(a(c))});return g.apply(e,b)}:function(a,b){g(a,b)}}return{log:c("log"),warn:c("warn"),info:c("info"),error:c("error")}}]}function Kc(b,
   12.64 -a){function c(a){return a.indexOf(q)!=-1}function d(){return n+1<b.length?b.charAt(n+1):!1}function e(a){return"0"<=a&&a<="9"}function g(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}function i(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}function f(a){return a=="-"||a=="+"||e(a)}function h(a,c,d){d=d||n;throw B("Lexer Error: "+a+" at column"+(v(c)?"s "+c+"-"+n+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function k(){for(var a="",c=n;n<b.length;){var k=
   12.65 -E(b.charAt(n));if(k=="."||e(k))a+=k;else{var g=d();if(k=="e"&&f(g))a+=k;else if(f(k)&&g&&e(g)&&a.charAt(a.length-1)=="e")a+=k;else if(f(k)&&(!g||!e(g))&&a.charAt(a.length-1)=="e")h("Invalid exponent");else break}n++}a*=1;o.push({index:c,text:a,json:!0,fn:function(){return a}})}function j(){for(var c="",d=n,f,k,h;n<b.length;){var j=b.charAt(n);if(j=="."||i(j)||e(j))j=="."&&(f=n),c+=j;else break;n++}if(f)for(k=n;k<b.length;){j=b.charAt(k);if(j=="("){h=c.substr(f-d+1);c=c.substr(0,f-d);n=k;break}if(g(j))k++;
   12.66 -else break}d={index:d,text:c};if(Ka.hasOwnProperty(c))d.fn=d.json=Ka[c];else{var l=Jb(c,a);d.fn=x(function(a,b){return l(a,b)},{assign:function(a,b){return Kb(a,c,b)}})}o.push(d);h&&(o.push({index:f,text:".",json:!1}),o.push({index:f+1,text:h,json:!1}))}function l(a){var c=n;n++;for(var d="",e=a,f=!1;n<b.length;){var k=b.charAt(n);e+=k;if(f)k=="u"?(k=b.substring(n+1,n+5),k.match(/[\da-f]{4}/i)||h("Invalid unicode escape [\\u"+k+"]"),n+=4,d+=String.fromCharCode(parseInt(k,16))):(f=Lc[k],d+=f?f:k),
   12.67 -f=!1;else if(k=="\\")f=!0;else if(k==a){n++;o.push({index:c,text:e,string:d,json:!0,fn:function(){return d}});return}else d+=k;n++}h("Unterminated quote",c)}for(var o=[],r,n=0,w=[],q,s=":";n<b.length;){q=b.charAt(n);if(c("\"'"))l(q);else if(e(q)||c(".")&&e(d()))k();else if(i(q)){if(j(),"{,".indexOf(s)!=-1&&w[0]=="{"&&(r=o[o.length-1]))r.json=r.text.indexOf(".")==-1}else if(c("(){}[].,;:"))o.push({index:n,text:q,json:":[,".indexOf(s)!=-1&&c("{[")||c("}]:,")}),c("{[")&&w.unshift(q),c("}]")&&w.shift(),
   12.68 -n++;else if(g(q)){n++;continue}else{var m=q+d(),C=Ka[q],A=Ka[m];A?(o.push({index:n,text:m,fn:A}),n+=2):C?(o.push({index:n,text:q,fn:C,json:"[,:".indexOf(s)!=-1&&c("+-")}),n+=1):h("Unexpected next character ",n,n+1)}s=q}return o}function Mc(b,a,c,d){function e(a,c){throw B("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function g(){if(M.length===0)throw B("Unexpected end of expression: "+b);return M[0]}function i(a,
   12.69 -b,c,d){if(M.length>0){var e=M[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c,d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),M.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function k(a,b){return function(c,d){return a(c,d,b)}}function j(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(M.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,
   12.70 -e=0;e<a.length;e++){var f=a[e];f&&(d=f(b,c))}return d}}function o(){for(var a=f(),b=c(a.text),d=[];;)if(a=f(":"))d.push(H());else{var e=function(a,c,e){for(var e=[e],f=0;f<d.length;f++)e.push(d[f](a,c));return b.apply(a,e)};return function(){return e}}}function r(){for(var a=n(),b;;)if(b=f("||"))a=j(a,b.fn,n());else return a}function n(){var a=w(),b;if(b=f("&&"))a=j(a,b.fn,n());return a}function w(){var a=q(),b;if(b=f("==","!="))a=j(a,b.fn,w());return a}function q(){var a;a=s();for(var b;b=f("+",
   12.71 -"-");)a=j(a,b.fn,s());if(b=f("<",">","<=",">="))a=j(a,b.fn,q());return a}function s(){for(var a=m(),b;b=f("*","/","%");)a=j(a,b.fn,m());return a}function m(){var a;return f("+")?C():(a=f("-"))?j(W,a.fn,m()):(a=f("!"))?k(a.fn,m()):C()}function C(){var a;if(f("("))a=v(),h(")");else if(f("["))a=A();else if(f("{"))a=K();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=u(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");
   12.72 -return a}function A(){var a=[];if(g().text!="]"){do a.push(H());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d}}function K(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=H();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e<a.length;e++){var f=a[e],k=f.value(b,c);d[f.key]=k}return d}}var W=I(0),y,M=Kc(b,d),H=function(){var a=r(),c,d;return(d=f("="))?(a.assign||e("implies assignment but ["+
   12.73 -b.substring(0,d.index)+"] can not be assigned to",d),c=r(),function(b,d){return a.assign(b,c(b,d),d)}):a},u=function(a,b){var c=[];if(g().text!=")"){do c.push(H());while(f(","))}h(")");return function(d,e){for(var f=[],k=b?b(d,e):d,h=0;h<c.length;h++)f.push(c[h](d,e));h=a(d,e)||D;return h.apply?h.apply(k,f):h(f[0],f[1],f[2],f[3],f[4])}},t=function(a){var b=f().text,c=Jb(b,d);return x(function(b,d){return c(a(b,d),d)},{assign:function(c,d,e){return Kb(a(c,e),b,d)}})},ea=function(a){var b=H();h("]");
   12.74 -return x(function(c,d){var e=a(c,d),f=b(c,d),k;if(!e)return p;if((e=e[f])&&e.then){k=e;if(!("$$v"in e))k.$$v=p,k.then(function(a){k.$$v=a});e=e.$$v}return e},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})},v=function(){for(var a=H(),b;;)if(b=f("|"))a=j(a,b.fn,o());else return a};a?(H=r,u=t=ea=v=function(){e("is not valid json",{text:b,index:0})},y=C()):y=l();M.length!==0&&e("is an unexpected token",M[0]);return y}function Kb(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),g=
   12.75 -b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function fb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i<g;i++)d=a[i],b&&(b=(e=b)[d]);return!c&&N(b)?Va(e,b):b}function Lb(b,a,c,d,e){return function(g,i){var f=i&&i.hasOwnProperty(b)?i:g,h;if(f===null||f===p)return f;if((f=f[b])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!a||f===null||f===p)return f;if((f=f[a])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!c||f===
   12.76 -null||f===p)return f;if((f=f[c])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!d||f===null||f===p)return f;if((f=f[d])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!e||f===null||f===p)return f;if((f=f[e])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}return f}}function Jb(b,a){if(hb.hasOwnProperty(b))return hb[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Lb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,
   12.77 -k;do k=Lb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=p,a=k;while(e<d);return k};else{var g="var l, fn, p;\n";m(c,function(a,b){g+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'});g+="return s;";e=Function("s","k",g);e.toString=function(){return g}}return hb[b]=e}function Nc(){var b={};this.$get=["$filter","$sniffer",
   12.78 -function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?b[d]:b[d]=Mc(d,!1,a,c.csp);case "function":return d;default:return D}}}]}function Oc(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return Pc(function(a){b.$evalAsync(a)},a)}]}function Pc(b,a){function c(a){return a}function d(a){return i(a)}var e=function(){var f=[],h,k;return k={resolve:function(a){if(f){var c=f;f=p;h=g(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],h.then(a[0],
   12.79 -a[1])})}},reject:function(a){k.resolve(i(a))},promise:{then:function(b,k){var g=e(),i=function(d){try{g.resolve((b||c)(d))}catch(e){a(e),g.reject(e)}},n=function(b){try{g.resolve((k||d)(b))}catch(c){a(c),g.reject(c)}};f?f.push([i,n]):h.then(i,n);return g.promise}}}},g=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},i=function(a){return{then:function(c,k){var g=e();b(function(){g.resolve((k||d)(a))});return g.promise}}};return{defer:e,reject:i,
   12.80 -when:function(f,h,k){var j=e(),l,o=function(b){try{return(h||c)(b)}catch(d){return a(d),i(d)}},r=function(b){try{return(k||d)(b)}catch(c){return a(c),i(c)}};b(function(){g(f).then(function(a){l||(l=!0,j.resolve(g(a).then(o,r)))},function(a){l||(l=!0,j.resolve(r(a)))})});return j.promise},all:function(a){var b=e(),c=a.length,d=[];c?m(a,function(a,e){g(a).then(function(a){e in d||(d[e]=a,--c||b.resolve(d))},function(a){e in d||b.reject(a)})}):b.resolve(d);return b.promise}}}function Qc(){var b={};this.when=
   12.81 -function(a,c){b[a]=x({reloadOnSearch:!0},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,g,i,f){function h(){var b=k(),h=r.current;if(b&&h&&b.$route===h.$route&&ha(b.pathParams,h.pathParams)&&!b.reloadOnSearch&&!o)h.params=b.params,V(h.params,d),a.$broadcast("$routeUpdate",h);else if(b||
   12.82 -h)o=!1,a.$broadcast("$routeChangeStart",b,h),(r.current=b)&&b.redirectTo&&(F(b.redirectTo)?c.path(j(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=[],c=[],d;m(b.resolve||{},function(b,d){a.push(d);c.push(F(b)?g.get(b):g.invoke(b))});if(!v(d=b.template))if(v(d=b.templateUrl))d=i.get(d,{cache:f}).then(function(a){return a.data});v(d)&&(a.push("$template"),c.push(d));return e.all(c).then(function(b){var c=
   12.83 -{};m(b,function(b,d){c[a[d]]=b});return c})}}).then(function(c){if(b==r.current){if(b)b.locals=c,V(b.params,d);a.$broadcast("$routeChangeSuccess",b,h)}},function(c){b==r.current&&a.$broadcast("$routeChangeError",b,h,c)})}function k(){var a,d;m(b,function(b,e){if(!d&&(a=l(c.path(),e)))d=ya(b,{params:x({},c.search(),a),pathParams:a}),d.$route=b});return d||b[null]&&ya(b[null],{params:{},pathParams:{}})}function j(a,b){var c=[];m((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),
   12.84 -f=e[1];c.push(b[f]);c.push(e[2]||"");delete b[f]}});return c.join("")}var l=function(a,b){var c="^"+b.replace(/([\.\\\(\)\^\$])/g,"\\$1")+"$",d=[],e={};m(b.split(/\W/),function(a){if(a){var b=RegExp(":"+a+"([\\W])");c.match(b)&&(c=c.replace(b,"([^\\/]*)$1"),d.push(a))}});var f=a.match(RegExp(c));f&&m(d,function(a,b){e[a]=f[b+1]});return f?e:null},o=!1,r={routes:b,reload:function(){o=!0;a.$evalAsync(h)}};a.$on("$locationChangeSuccess",h);return r}]}function Rc(){this.$get=I({})}function Sc(){var b=
   12.85 -10;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=xa();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$asyncQueue=[];this.$$listeners={}}function g(a){if(h.$$phase)throw B(h.$$phase+" already in progress");h.$$phase=a}function i(a,b){var c=d(a);ra(c,b);return c}function f(){}e.prototype={$new:function(a){if(N(a))throw B("API-CHANGE: Use $controller to instantiate controllers.");
   12.86 -a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=xa());a["this"]=a;a.$$listeners={};a.$parent=this;a.$$asyncQueue=[];a.$$watchers=a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,c){var d=i(a,"watch"),e=this.$$watchers,g={fn:b,last:f,get:d,exp:a,eq:!!c};if(!N(b)){var h=i(b||D,"listener");g.fn=function(a,b,
   12.87 -c){h(c)}}if(!e)e=this.$$watchers=[];e.unshift(g);return function(){Ua(e,g)}},$digest:function(){var a,d,e,i,r,n,m,q=b,s,p=[],C,A;g("$digest");do{m=!1;s=this;do{for(r=s.$$asyncQueue;r.length;)try{s.$eval(r.shift())}catch(K){c(K)}if(i=s.$$watchers)for(n=i.length;n--;)try{if(a=i[n],(d=a.get(s))!==(e=a.last)&&!(a.eq?ha(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))m=!0,a.last=a.eq?V(d):d,a.fn(d,e===f?d:e,s),q<5&&(C=4-q,p[C]||(p[C]=[]),A=N(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):
   12.88 -a.exp,A+="; newVal: "+da(d)+"; oldVal: "+da(e),p[C].push(A))}catch(W){c(W)}if(!(i=s.$$childHead||s!==this&&s.$$nextSibling))for(;s!==this&&!(i=s.$$nextSibling);)s=s.$parent}while(s=i);if(m&&!q--)throw h.$$phase=null,B(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+da(p));}while(m||r.length);h.$$phase=null},$destroy:function(){if(h!=this){var a=this.$parent;this.$broadcast("$destroy");if(a.$$childHead==this)a.$$childHead=this.$$nextSibling;if(a.$$childTail==
   12.89 -this)a.$$childTail=this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling=this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling=this.$$prevSibling;this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return g("$apply"),this.$eval(a)}catch(b){c(b)}finally{h.$$phase=null;try{h.$digest()}catch(d){throw c(d),d;}}},
   12.90 -$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);return function(){c[za(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,g=!1,h={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},i=[h].concat(ia.call(arguments,1)),m,p;do{e=f.$$listeners[a]||d;h.currentScope=f;m=0;for(p=e.length;m<p;m++)if(e[m])try{if(e[m].apply(null,i),g)return h}catch(C){c(C)}else e.splice(m,1),m--,p--;f=f.$parent}while(f);
   12.91 -return h},$broadcast:function(a,b){var d=this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(ia.call(arguments,1)),h,i;do{d=e;f.currentScope=d;e=d.$$listeners[a]||[];h=0;for(i=e.length;h<i;h++)if(e[h])try{e[h].apply(null,g)}catch(m){c(m)}else e.splice(h,1),h--,i--;if(!(e=d.$$childHead||d!==this&&d.$$nextSibling))for(;d!==this&&!(e=d.$$nextSibling);)d=d.$parent}while(d=e);return f}};var h=new e;return h}]}function Tc(){this.$get=
   12.92 -["$window",function(b){var a={},c=G((/android (\d+)/.exec(E(b.navigator.userAgent))||[])[1]);return{history:!(!b.history||!b.history.pushState||c<4),hashchange:"onhashchange"in b&&(!b.document.documentMode||b.document.documentMode>7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Uc(){this.$get=I(U)}function Mb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=E(R(b.substr(0,
   12.93 -e)));d=R(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Nb(b){var a=L(b)?b:p;return function(c){a||(a=Mb(b));return c?a[E(c)]||null:a}}function Ob(b,a,c){if(N(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Vc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){F(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=nb(d,!0)));return d}],transformRequest:[function(a){return L(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],
   12.94 -headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,k,j){function l(a){function c(a){var b=x({},a,{data:Ob(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:k.reject(b)}a.method=la(a.method);var e=a.transformRequest||
   12.95 -d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=x({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[E(a.method)],a.headers),e=Ob(a.data,Nb(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,
   12.96 -[a,b,Mb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?j.resolve:j.reject)({data:a,status:c,headers:Nb(d),config:b})}function i(){var a=za(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var j=k.defer(),o=j.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=L(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else J(p)?f(p[1],p[0],V(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,
   12.97 -w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];ec(b,function(a,b){a==null||a==p||(L(a)&&(a=da(a)),c.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(F(a)?j.get(a):j.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(x(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=
   12.98 -function(b,c,d){return l(x(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Wc(){this.$get=["$browser","$window","$document",function(b,a,c){return Xc(b,Yc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Xc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=
   12.99 -d;e.body.appendChild(c)}return function(e,h,k,j,l,o,r){function n(a,c,d,e){c=(h.match(Fb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(D)}b.$$incOutstandingRequestCount();h=h||b.url();if(E(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(j,200,d[p].data):n(j,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});
  12.100 -var s;q.onreadystatechange=function(){q.readyState==4&&n(j,s||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(k||"");o>0&&c(function(){s=-1;q.abort()},o)}}}function Zc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},
  12.101 -DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",
  12.102 -shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function $c(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var k=c.defer(),j=k.promise,l=v(h)&&!h,f=a.defer(function(){try{k.resolve(e())}catch(a){k.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[j.$$timeoutId]};j.$$timeoutId=f;g[f]=k;j.then(h,h);return j}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):
  12.103 -!1};return e}]}function Pb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Qb);a("date",Rb);a("filter",ad);a("json",bd);a("limitTo",cd);a("lowercase",dd);a("number",Sb);a("orderBy",Tb);a("uppercase",ed)}function ad(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b<c.length;b++)if(!c[b](a))return!1;return!0};var d=function(a,b){if(b.charAt(0)===
  12.104 -"!")return!d(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return(""+a).toLowerCase().indexOf(b)>-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&&d(a[c],b))return!0;return!1;case "array":for(c=0;c<a.length;c++)if(d(a[c],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var e in a)e=="$"?function(){var b=(""+a[e]).toLowerCase();b&&c.push(function(a){return d(a,b)})}():function(){var b=e,f=
  12.105 -(""+a[e]).toLowerCase();f&&c.push(function(a){return d(fb(a,b),f)})}();break;case "function":c.push(a);break;default:return b}for(var g=[],i=0;i<b.length;i++){var f=b[i];c.check(f)&&g.push(f)}return g}}function Qb(b){var a=b.NUMBER_FORMATS;return function(b,d){if(t(d))d=a.CURRENCY_SYM;return Ub(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Sb(b){var a=b.NUMBER_FORMATS;return function(b,d){return Ub(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Ub(b,a,c,d,e){if(isNaN(b)||
  12.106 -!isFinite(b))return"";var g=b<0,b=Math.abs(b),i=b+"",f="",h=[],k=!1;if(i.indexOf("e")!==-1){var j=i.match(/([\d\.]+)e(-?)(\d+)/);j&&j[2]=="-"&&j[3]>e+1?i="0":(f=i,k=!0)}if(!k){i=(i.split(Vb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Vb),i=b[0],b=b[1]||"",k=0,j=a.lgSize,l=a.gSize;if(i.length>=j+l)for(var k=i.length-j,o=0;o<k;o++)(k-o)%l===0&&o!==0&&(f+=c),f+=i.charAt(o);for(o=k;o<i.length;o++)(i.length-o)%j===0&&o!==0&&
  12.107 -(f+=c),f+=i.charAt(o);for(;b.length<e;)b+="0";e&&(f+=d+b.substr(0,e))}h.push(g?a.negPre:a.posPre);h.push(f);h.push(g?a.negSuf:a.posSuf);return h.join("")}function ib(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function P(b,a,c,d){return function(e){e=e["get"+b]();if(c>0||e>-c)e+=c;e===0&&c==-12&&(e=12);return ib(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Rb(b){function a(a){var b;
  12.108 -if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=G(b[9]+b[10]),i=G(b[9]+b[11]));a.setUTCFullYear(G(b[1]),G(b[2])-1,G(b[3]));a.setUTCHours(G(b[4]||0)-g,G(b[5]||0)-i,G(b[6]||0),G(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;F(c)&&(c=fd.test(c)?G(c):a(c));wa(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=gd.exec(e))?(i=i.concat(ia.call(h,
  12.109 -1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=hd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function bd(){return function(b){return da(b,!0)}}function cd(){return function(b,a){if(!(b instanceof Array))return b;var a=G(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Tb(b){return function(a,c,d){function e(a,b){return Wa(b)?
  12.110 -function(b,c){return a(c,b)}:a}if(!(a instanceof Array))return a;if(!c)return a;for(var c=J(c)?c:[c],c=Ta(c,function(a){var c=!1,d=a||ma;if(F(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,g=typeof e;f==g?(f=="string"&&(c=c.toLowerCase()),f=="string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<g?-1:1;return c},c)}),g=[],i=0;i<a.length;i++)g.push(a[i]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=
  12.111 -c[d](a,b);if(e!==0)return e}return 0},d))}}function S(b){N(b)&&(b={link:b});b.restrict=b.restrict||"AC";return I(b)}function Wb(b,a){function c(a,c){c=c?"-"+$a(c,"-"):"";b.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}var d=this,e=b.parent().controller("form")||Oa,g=0,i=d.$error={};d.$name=a.name;d.$dirty=!1;d.$pristine=!0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(Pa);c(!0);d.$addControl=function(a){a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&
  12.112 -d[a.$name]===a&&delete d[a.$name];m(i,function(b,c){d.$setValidity(c,!0,a)})};d.$setValidity=function(a,b,k){var j=i[a];if(b){if(j&&(Ua(j,k),!j.length)){g--;if(!g)c(b),d.$valid=!0,d.$invalid=!1;i[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{g||c(b);if(j){if(za(j,k)!=-1)return}else i[a]=j=[],g++,c(!1,a),e.$setValidity(a,!1,d);j.push(k);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(Pa).addClass(Xb);d.$dirty=!0;d.$pristine=!1;e.$setDirty()}}function T(b){return t(b)||b===""||b===null||
  12.113 -b!==b}function Qa(b,a,c,d,e,g){var i=function(){var c=R(a.val());d.$viewValue!==c&&b.$apply(function(){d.$setViewValue(c)})};if(e.hasEvent("input"))a.bind("input",i);else{var f;a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||f||(f=g.defer(function(){i();f=null}))});a.bind("change",i)}d.$render=function(){a.val(T(d.$viewValue)?"":d.$viewValue)};var h=c.ngPattern,k=function(a,b){return T(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),p)};h&&(h.match(/^\/(.*)\/$/)?
  12.114 -(h=RegExp(h.substr(1,h.length-2)),e=function(a){return k(h,a)}):e=function(a){var c=b.$eval(h);if(!c||!c.test)throw new B("Expected "+h+" to be a RegExp but was "+c);return k(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var j=G(c.ngMinlength),e=function(a){return!T(a)&&a.length<j?(d.$setValidity("minlength",!1),p):(d.$setValidity("minlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var l=G(c.ngMaxlength),c=function(a){return!T(a)&&a.length>l?(d.$setValidity("maxlength",
  12.115 -!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function jb(b,a){b="ngClass"+b;return S(function(c,d,e){function g(b,d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){L(a)&&!J(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(J(a)?a.join(" "):a)}function f(a){L(a)&&!J(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(J(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",
  12.116 -function(d,g){var j=d%2;j!==g%2&&(j==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var E=function(b){return F(b)?b.toLowerCase():b},la=function(b){return F(b)?b.toUpperCase():b},B=U.Error,aa=G((/msie (\d+)/.exec(E(navigator.userAgent))||[])[1]),u,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Yb=U.angular||(U.angular={}),ta,Cb,Z=["0","0","0"];D.$inject=[];ma.$inject=[];Cb=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?
  12.117 -b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,id={full:"1.0.3",major:1,minor:0,dot:3,codeName:"bouncy-thunder"},Ba=Q.cache={},Aa=Q.expando="ng-"+(new Date).getTime(),oc=1,Zb=U.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},db=U.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ua=Q.prototype={ready:function(b){function a(){c||(c=!0,b())}
  12.118 -var c=!1;this.bind("DOMContentLoaded",a);Q(U).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?u(this[b]):u(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Ea={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Ea[E(b)]=b});var zb={};m("input,select,option,textarea,button,form".split(","),function(b){zb[la(b)]=!0});m({data:ub,inheritedData:Da,scope:function(b){return Da(b,
  12.119 -"$scope")},controller:xb,injector:function(b){return Da(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ca,css:function(b,a,c){a=rb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=E(a);if(Ea[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||D).specified?d:p;else if(v(c))b.setAttribute(a,
  12.120 -c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]},text:x(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)sa(d[c]);b.innerHTML=a}},function(b,
  12.121 -a){Q.prototype[a]=function(a,d){var e,g;if((b.length==2&&b!==Ca&&b!==xb?a:d)===p)if(L(a)){for(e=0;e<this.length;e++)if(b===ub)b(this[e],a);else for(g in a)b(this[e],g,a[g]);return this}else{if(this.length)return b(this[0],a,d)}else{for(e=0;e<this.length;e++)b(this[e],a,d);return this}return b.$dv}});m({removeData:sb,dealoc:sa,bind:function a(c,d,e){var g=$(c,"events"),i=$(c,"handle");g||$(c,"events",g={});i||$(c,"handle",i=pc(c,g));m(d.split(" "),function(d){var h=g[d];if(!h){if(d=="mouseenter"||
  12.122 -d=="mouseleave"){var k=0;g.mouseenter=[];g.mouseleave=[];a(c,"mouseover",function(a){k++;k==1&&i(a,"mouseenter")});a(c,"mouseout",function(a){k--;k==0&&i(a,"mouseleave")})}else Zb(c,d,i),g[d]=[];h=g[d]}h.push(e)})},unbind:tb,replaceWith:function(a,c){var d,e=a.parentNode;sa(a);m(new Q(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeName!="#text"&&c.push(a)});return c},contents:function(a){return a.childNodes},
  12.123 -append:function(a,c){m(new Q(c),function(c){a.nodeType===1&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;m(new Q(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=u(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){sa(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;m(new Q(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:wb,removeClass:vb,toggleClass:function(a,
  12.124 -c,d){t(d)&&(d=!Ca(a,c));(d?wb:vb)(a,c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){return a.nextSibling},find:function(a,c){return a.getElementsByTagName(c)},clone:cb,triggerHandler:function(a,c){var d=($(a,"events")||{})[c];m(d,function(c){c.call(a,null)})}},function(a,c){Q.prototype[c]=function(c,e){for(var g,i=0;i<this.length;i++)g==p?(g=a(this[i],c,e),g!==p&&(g=u(g))):bb(g,a(this[i],c,e));return g==p?this:g}});Fa.prototype={put:function(a,c){this[ga(a)]=
  12.125 -c},get:function(a){return this[ga(a)]},remove:function(a){var c=this[a=ga(a)];delete this[a];return c}};eb.prototype={push:function(a,c){var d=this[a=ga(a)];d?d.push(c):this[a]=[c]},shift:function(a){var c=this[a=ga(a)];if(c)return c.length==1?(delete this[a],c[0]):c.shift()},peek:function(a){if(a=this[ga(a)])return a[0]}};var rc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,sc=/,/,tc=/^\s*(_?)(\S+?)\1\s*$/,qc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Db="Non-assignable model expression: ";Bb.$inject=["$provide"];
  12.126 -var Ac=/^(x[\:\-_]|data[\:\-_])/i,Fb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,$b=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,Hc=$b,Gb={http:80,https:443,ftp:21};gb.prototype={$$replace:!1,absUrl:Ja("$$absUrl"),url:function(a,c){if(t(a))return this.$$url;var d=$b.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Ja("$$protocol"),host:Ja("$$host"),port:Ja("$$port"),path:Ib("$$path",function(a){return a.charAt(0)==
  12.127 -"/"?a:"/"+a}),search:function(a,c){if(t(a))return this.$$search;v(c)?c===null?delete this.$$search[a]:this.$$search[a]=c:this.$$search=F(a)?Xa(a):a;this.$$compose();return this},hash:Ib("$$hash",ma),replace:function(){this.$$replace=!0;return this}};Ia.prototype=ya(gb.prototype);Hb.prototype=ya(Ia.prototype);var Ka={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:D,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return v(d)?v(e)?d+e:d:v(e)?e:p},"-":function(a,
  12.128 -c,d,e){d=d(a,c);e=e(a,c);return(v(d)?d:0)-(v(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":D,"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,
  12.129 -c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Lc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},hb={},Yc=U.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new B("This browser does not support XMLHttpRequest.");
  12.130 -};Pb.$inject=["$provide"];Qb.$inject=["$locale"];Sb.$inject=["$locale"];var Vb=".",hd={yyyy:P("FullYear",4),yy:P("FullYear",2,0,!0),y:P("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:P("Month",2,1),M:P("Month",1,1),dd:P("Date",2),d:P("Date",1),HH:P("Hours",2),H:P("Hours",1),hh:P("Hours",2,-12),h:P("Hours",1,-12),mm:P("Minutes",2),m:P("Minutes",1),ss:P("Seconds",2),s:P("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();
  12.131 -return ib(a/60,2)+ib(Math.abs(a%60),2)}},gd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,fd=/^\d+$/;Rb.$inject=["$locale"];var dd=I(E),ed=I(la);Tb.$inject=["$parse"];var jd=I({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){if(!c.attr("href"))return a.preventDefault(),!1})}}}),kb={};m(Ea,function(a,c){var d=fa("ng-"+c);kb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],
  12.132 -function(a){i.$set(c,!!a)})}}}}});m(["src","href"],function(a){var c=fa("ng-"+a);kb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:D,$removeControl:D,$setValidity:D,$setDirty:D};Wb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Wb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?
  12.133 -a.preventDefault():a.returnValue=!1};Zb(d[0],"submit",h);d.bind("$destroy",function(){c(function(){db(d[0],"submit",h)},0,!1)})}var k=d.parent().controller("form"),j=i.name||i.ngForm;j&&(a[j]=f);k&&d.bind("$destroy",function(){k.$removeControl(f);j&&(a[j]=p);x(f,Oa)})}}}};return a?x(V(d),{restrict:"EAC"}):d}]},kd=Ra(),ld=Ra(!0),md=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,nd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,od=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,
  12.134 -ac={text:Qa,number:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=T(a);return c||od.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return T(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!T(a)&&a<f?(e.$setValidity("min",!1),p):(e.$setValidity("min",!0),a)};e.$parsers.push(a);e.$formatters.push(a)}if(d.max){var h=parseFloat(d.max),d=function(a){return!T(a)&&a>h?(e.$setValidity("max",
  12.135 -!1),p):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return T(a)||wa(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return T(a)||md.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return T(a)||nd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",
  12.136 -!1),p)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",xa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;F(g)||(g=!0);F(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===
  12.137 -g});e.$parsers.push(function(a){return a?g:i})},hidden:D,button:D,submit:D,reset:D},bc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(ac[E(g.type)]||ac.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Xb="ng-dirty",pd=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN;
  12.138 -this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw B(Db+d.ngModel+" ("+pa(e)+")");this.$render=D;var k=e.inheritedData("$formController")||Oa,j=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&j--,!j)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,j++;l[a]=!c;i(c,a);k.$setValidity(a,
  12.139 -c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Xb),k.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],qd=function(){return{require:["ngModel",
  12.140 -"^?form"],controller:pd,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},rd=I({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),cc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(T(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);
  12.141 -d.$observe("required",function(){g(e.$viewValue)})}}}},sd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(R(a))});return c});e.$formatters.push(function(a){return J(a)?a.join(", "):p})}}},td=/^(true|false|\d+)$/,ud=function(){return{priority:100,compile:function(a,c){return td.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,
  12.142 -c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},vd=S(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),wd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],xd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,
  12.143 -function(a){c.html(a||"")})}}],yd=jb("",!0),zd=jb("Odd",0),Ad=jb("Even",1),Bd=S({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Cd=[function(){return{scope:!0,controller:"@"}}],Dd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],dc={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);dc[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(E(a),function(a){e.$apply(function(){f(e,
  12.144 -{$event:a})})})}}]});var Ed=S(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Fd=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",k=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var p=++o;f?a.get(f,{cache:c}).success(function(a){p===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m),
  12.145 -v(k)&&(!k||g.$eval(k))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){p===o&&n()}):n()})}}}}],Gd=S({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Hd=S({terminal:!0,priority:1E3}),Id=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),k=i.offset||0,j=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(j,function(a,e){l[e]=c(a.replace(d,o+f+"-"+k+r))});e.$watch(function(){var c=
  12.146 -parseFloat(e.$eval(f));return isNaN(c)?"":(j[c]||(c=a.pluralCat(c-k)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Jd=S({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,k,j;if(!i)throw B("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw B("'item' in 'item in collection' should be identifier or (key, value) but got '"+
  12.147 -f+"'.");k=i[3]||i[1];j=i[2];var l=new eb;a.$watch(function(a){var e,f,i=a.$eval(h),m=gc(i,!0),p,u=new eb,C,A,v,t,y=c;if(J(i))v=i||[];else{v=[];for(C in i)i.hasOwnProperty(C)&&C.charAt(0)!="$"&&v.push(C);v.sort()}e=0;for(f=v.length;e<f;e++){C=i===v?e:v[e];A=i[C];if(t=l.shift(A)){p=t.scope;u.push(A,t);if(e!==t.index)t.index=e,y.after(t.element);y=t.element}else p=a.$new();p[k]=A;j&&(p[j]=C);p.$index=e;p.$first=e===0;p.$last=e===m-1;p.$middle=!(p.$first||p.$last);t||d(p,function(a){y.after(a);t={scope:p,
  12.148 -element:y=a,index:e};u.push(A,t)})}for(C in l)if(l.hasOwnProperty(C))for(v=l[C];v.length;)A=v.pop(),A.element.remove(),A.scope.$destroy();l=u})}}}),Kd=S(function(a,c,d){a.$watch(d.ngShow,function(a){c.css("display",Wa(a)?"":"none")})}),Ld=S(function(a,c,d){a.$watch(d.ngHide,function(a){c.css("display",Wa(a)?"none":"")})}),Md=S(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Nd=I({restrict:"EA",compile:function(a,c){var d=c.ngSwitch||c.on,
  12.149 -e={};a.data("ng-switch",e);return function(a,i){var f,h,k;a.$watch(d,function(d){h&&(k.$destroy(),h.remove(),h=k=null);if(f=e["!"+d]||e["?"])a.$eval(c.change),k=a.$new(),f(k,function(a){h=a;i.append(a)})})}}}),Od=S({transclude:"element",priority:500,compile:function(a,c,d){a=a.inheritedData("ng-switch");qa(a);a["!"+c.ngSwitchWhen]=d}}),Pd=S({transclude:"element",priority:500,compile:function(a,c,d){a=a.inheritedData("ng-switch");qa(a);a["?"]=d}}),Qd=S({controller:["$transclude","$element",function(a,
  12.150 -c){a(function(a){c.append(a)})}]}),Rd=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(a,c,d,e,g,i){return{restrict:"ECA",terminal:!0,link:function(a,c,k){function j(){var j=d.current&&d.current.locals,k=j&&j.$template;if(k){c.html(k);l&&(l.$destroy(),l=null);var k=g(c.contents()),p=d.current;l=p.scope=a.$new();if(p.controller)j.$scope=l,j=i(p.controller,j),c.contents().data("$ngControllerController",j);k(l);l.$emit("$viewContentLoaded");l.$eval(m);e()}else c.html(""),
  12.151 -l&&(l.$destroy(),l=null)}var l,m=k.onload||"";a.$on("$routeChangeSuccess",j);j()}}}],Sd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],Td=I({terminal:!0}),Ud=["$compile","$parse",function(a,c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,e={$setViewValue:D};return{restrict:"E",require:["select",
  12.152 -"?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var h=this,k={},j=e,l;h.databound=d.ngModel;h.init=function(a,c,d){j=a;l=d};h.addOption=function(c){k[c]=!0;j.$viewValue==c&&(a.val(c),l.parent()&&l.remove())};h.removeOption=function(a){this.hasOption(a)&&(delete k[a],j.$viewValue==a&&this.renderUnknownOption(a))};h.renderUnknownOption=function(c){c="? "+ga(c)+" ?";l.val(c);a.prepend(l);a.val(c);l.prop("selected",!0)};h.hasOption=function(a){return k.hasOwnProperty(a)};c.$on("$destroy",
  12.153 -function(){h.renderUnknownOption=D})}],link:function(e,i,f,h){function k(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(A.parent()&&A.remove(),c.val(a),a===""&&s.prop("selected",!0)):t(a)&&s?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){A.parent()&&A.remove();d.$setViewValue(c.val())})})}function j(a,c,d){var e;d.$render=function(){var a=new Fa(d.$viewValue);m(c.children(),function(c){c.selected=v(a.get(c.value))})};a.$watch(function(){ha(e,d.$viewValue)||
  12.154 -(e=V(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];m(c.children(),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function l(e,f,g){function h(){var a={"":[]},c=[""],d,i,s,t,u;s=g.$modelValue;t=r(e)||[];var y=l?lb(t):t,A,w,x;w={};u=!1;var z,B;if(n)u=new Fa(s);else if(s===null||q)a[""].push({selected:s===null,id:"",label:""}),u=!0;for(x=0;A=y.length,x<A;x++){w[k]=t[l?w[l]=y[x]:x];d=m(e,w)||"";if(!(i=a[d]))i=a[d]=[],c.push(d);n?d=u.remove(o(e,
  12.155 -w))!=p:(d=s===o(e,w),u=u||d);z=j(e,w);z=z===p?"":z;i.push({id:l?y[x]:x,label:z,selected:d})}!n&&!u&&a[""].unshift({id:"?",label:"",selected:!0});w=0;for(y=c.length;w<y;w++){d=c[w];i=a[d];if(v.length<=w)s={element:C.clone().attr("label",d),label:i.label},t=[s],v.push(t),f.append(s.element);else if(t=v[w],s=t[0],s.label!=d)s.element.attr("label",s.label=d);z=null;x=0;for(A=i.length;x<A;x++)if(d=i[x],u=t[x+1]){z=u.element;if(u.label!==d.label)z.text(u.label=d.label);if(u.id!==d.id)z.val(u.id=d.id);if(u.element.selected!==
  12.156 -d.selected)z.prop("selected",u.selected=d.selected)}else d.id===""&&q?B=q:(B=D.clone()).val(d.id).attr("selected",d.selected).text(d.label),t.push({element:B,label:d.label,id:d.id,selected:d.selected}),z?z.after(B):s.element.append(B),z=B;for(x++;t.length>x;)t.pop().element.remove()}for(;v.length>w;)v.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw B("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'.");var j=c(i[2]||i[1]),k=i[4]||
  12.157 -i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),v=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,s;if(n){i=[];m=0;for(s=v.length;m<s;m++){a=v[m];j=1;for(q=a.length;j<q;j++)if((h=a[j].element)[0].selected)h=h.val(),l&&(d[l]=h),d[k]=c[h],i.push(o(e,d))}}else h=f.val(),h=="?"?i=p:h==""?i=null:(d[k]=c[h],l&&(d[l]=h),i=o(e,d));g.$setViewValue(i)})});g.$render=h;e.$watch(h)}if(h[1]){for(var o=
  12.158 -h[0],r=h[1],n=f.multiple,w=f.ngOptions,q=!1,s,D=u(ca.createElement("option")),C=u(ca.createElement("optgroup")),A=D.clone(),h=0,x=i.children(),E=x.length;h<E;h++)if(x[h].value==""){s=q=x.eq(h);break}o.init(r,q,A);if(n&&(f.required||f.ngRequired)){var y=function(a){r.$setValidity("required",!f.required||a&&a.length);return a};r.$parsers.push(y);r.$formatters.unshift(y);f.$observe("required",function(){y(r.$viewValue)})}w?l(e,i,r):n?j(e,i,r):k(e,i,r,o)}}}}],Vd=["$interpolate",function(a){var c={addOption:D,
  12.159 -removeOption:D};return{restrict:"E",priority:100,compile:function(d,e){if(t(e.value)){var g=a(d.text(),!0);g||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),j=k.data("$selectController")||k.parent().data("$selectController");j&&j.databound?d.prop("selected",!1):j=c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&j.removeOption(c);j.addOption(a)}):j.addOption(e.value);d.bind("$destroy",function(){j.removeOption(e.value)})}}}}],Wd=I({restrict:"E",terminal:!0});(ja=U.jQuery)?(u=
  12.160 -ja,x(ja.fn,{scope:ua.scope,controller:ua.controller,injector:ua.injector,inheritedData:ua.inheritedData}),ab("remove",!0),ab("empty"),ab("html")):u=Q;Yb.element=u;(function(a){x(a,{bootstrap:pb,copy:V,extend:x,equals:ha,element:u,forEach:m,injector:qb,noop:D,bind:Va,toJson:da,fromJson:nb,identity:ma,isUndefined:t,isDefined:v,isString:F,isFunction:N,isObject:L,isNumber:wa,isElement:fc,isArray:J,version:id,isDate:na,lowercase:E,uppercase:la,callbacks:{counter:0}});ta=lc(U);try{ta("ngLocale")}catch(c){ta("ngLocale",
  12.161 -[]).provider("$locale",Zc)}ta("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Bb).directive({a:jd,input:bc,textarea:bc,form:kd,script:Sd,select:Ud,style:Wd,option:Vd,ngBind:vd,ngBindHtmlUnsafe:xd,ngBindTemplate:wd,ngClass:yd,ngClassEven:Ad,ngClassOdd:zd,ngCsp:Dd,ngCloak:Bd,ngController:Cd,ngForm:ld,ngHide:Ld,ngInclude:Fd,ngInit:Gd,ngNonBindable:Hd,ngPluralize:Id,ngRepeat:Jd,ngShow:Kd,ngSubmit:Ed,ngStyle:Md,ngSwitch:Nd,ngSwitchWhen:Od,ngSwitchDefault:Pd,ngOptions:Td,ngView:Rd,ngTransclude:Qd,
  12.162 -ngModel:qd,ngList:sd,ngChange:rd,required:cc,ngRequired:cc,ngValue:ud}).directive(kb).directive(dc);a.provider({$anchorScroll:uc,$browser:wc,$cacheFactory:xc,$controller:Bc,$document:Cc,$exceptionHandler:Dc,$filter:Pb,$interpolate:Ec,$http:Vc,$httpBackend:Wc,$location:Ic,$log:Jc,$parse:Nc,$route:Qc,$routeParams:Rc,$rootScope:Sc,$q:Oc,$sniffer:Tc,$templateCache:yc,$timeout:$c,$window:Uc})}])})(Yb);u(ca).ready(function(){jc(ca,pb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
    13.1 --- a/dew4nb/release/web4dew/js/app.js	Wed Jan 29 17:28:57 2014 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,500 +0,0 @@
    13.4 -/*
    13.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    13.6 - *
    13.7 - * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    13.8 - *
    13.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   13.10 - * Other names may be trademarks of their respective owners.
   13.11 - *
   13.12 - * The contents of this file are subject to the terms of either the GNU
   13.13 - * General Public License Version 2 only ("GPL") or the Common
   13.14 - * Development and Distribution License("CDDL") (collectively, the
   13.15 - * "License"). You may not use this file except in compliance with the
   13.16 - * License. You can obtain a copy of the License at
   13.17 - * http://www.netbeans.org/cddl-gplv2.html
   13.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   13.19 - * specific language governing permissions and limitations under the
   13.20 - * License.  When distributing the software, include this License Header
   13.21 - * Notice in each file and include the License file at
   13.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   13.23 - * particular file as subject to the "Classpath" exception as provided
   13.24 - * by Oracle in the GPL Version 2 section of the License file that
   13.25 - * accompanied this code. If applicable, add the following below the
   13.26 - * License Header, with the fields enclosed by brackets [] replaced by
   13.27 - * your own identifying information:
   13.28 - * "Portions Copyrighted [year] [name of copyright owner]"
   13.29 - *
   13.30 - * If you wish your version of this file to be governed by only the CDDL
   13.31 - * or only the GPL Version 2, indicate your decision by adding
   13.32 - * "[Contributor] elects to include this software in this distribution
   13.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   13.34 - * single choice of license, a recipient has the option to distribute
   13.35 - * your version of this file under either the CDDL, the GPL Version 2 or
   13.36 - * to extend the choice of license to its licensees as provided above.
   13.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   13.38 - * Version 2 license, then the option applies only if the new code is
   13.39 - * made subject to such option by the copyright holder.
   13.40 - *
   13.41 - * Contributor(s):
   13.42 - *
   13.43 - * Portions Copyrighted 2013 Sun Microsystems, Inc.
   13.44 - */
   13.45 -// 'use strict';
   13.46 -
   13.47 -// Declare app level module which depends on filters, and services
   13.48 -angular.module('bck2brwsr', []).
   13.49 -  directive('uiCodemirror', ['$timeout', function($timeout) {
   13.50 -        'use strict';
   13.51 -
   13.52 -        var events = ["cursorActivity", "viewportChange", "gutterClick", "focus", "blur", "scroll", "update"];
   13.53 -        return {
   13.54 -            restrict: 'A',
   13.55 -            require: 'ngModel',
   13.56 -            link: function(scope, elm, attrs, ngModel) {
   13.57 -                var options, opts, onChange, deferCodeMirror, codeMirror, timeoutId, val;
   13.58 -
   13.59 -                if (elm[0].type !== 'textarea') {
   13.60 -                    throw new Error('uiCodemirror3 can only be applied to a textarea element');
   13.61 -                }
   13.62 -
   13.63 -                options = /* uiConfig.codemirror  || */ {};
   13.64 -                opts = angular.extend({}, options, scope.$eval(attrs.uiCodemirror));
   13.65 -
   13.66 -                onChange = function(instance, changeObj) {                    
   13.67 -                    val = instance.getValue();
   13.68 -                    $timeout.cancel(timeoutId);
   13.69 -                    timeoutId = $timeout(function() {
   13.70 -                        ngModel.$setViewValue(val);                        
   13.71 -                      }, 500);                    
   13.72 -                };
   13.73 -                
   13.74 -                deferCodeMirror = function() {
   13.75 -                    codeMirror = CodeMirror.fromTextArea(elm[0], opts);
   13.76 -                    elm[0].codeMirror = codeMirror;
   13.77 -                    // codeMirror.on("change", onChange(opts.onChange));
   13.78 -                    codeMirror.on("change", onChange);
   13.79 -
   13.80 -                    for (var i = 0, n = events.length, aEvent; i < n; ++i) {
   13.81 -                        aEvent = opts["on" + events[i].charAt(0).toUpperCase() + events[i].slice(1)];
   13.82 -                        if (aEvent === void 0)
   13.83 -                            continue;
   13.84 -                        if (typeof aEvent !== "function")
   13.85 -                            continue;
   13.86 -                                                
   13.87 -                        var bound = _.bind( aEvent, scope );
   13.88 -                        
   13.89 -                        codeMirror.on(events[i], bound);
   13.90 -                    }
   13.91 -
   13.92 -                    // CodeMirror expects a string, so make sure it gets one.
   13.93 -                    // This does not change the model.
   13.94 -                    ngModel.$formatters.push(function(value) {
   13.95 -                        if (angular.isUndefined(value) || value === null) {
   13.96 -                            return '';
   13.97 -                        }
   13.98 -                        else if (angular.isObject(value) || angular.isArray(value)) {
   13.99 -                            throw new Error('ui-codemirror cannot use an object or an array as a model');
  13.100 -                        }
  13.101 -                        return value;
  13.102 -                    });
  13.103 -
  13.104 -                    // Override the ngModelController $render method, which is what gets called when the model is updated.
  13.105 -                    // This takes care of the synchronizing the codeMirror element with the underlying model, in the case that it is changed by something else.
  13.106 -                    ngModel.$render = function() {
  13.107 -                        codeMirror.setValue(ngModel.$viewValue);
  13.108 -                    };
  13.109 -
  13.110 -                };
  13.111 -
  13.112 -                $timeout(deferCodeMirror);
  13.113 -
  13.114 -            }
  13.115 -        };
  13.116 -}]);
  13.117 -
  13.118 -function DevCtrl( $scope, $timeout, $http ) {
  13.119 -    var templateHtml = 
  13.120 -"<h1>Please select a sample...</h1>\n";
  13.121 -    var templateJava = 
  13.122 -"package waiting4javac;\n" +
  13.123 -"class ToInitialize {\n" +
  13.124 -"  /*int*/ myFirstError;\n" +
  13.125 -"}\n";
  13.126 -
  13.127 -    function parseJson(s) {
  13.128 -      if (typeof s === 'string') {
  13.129 -        return JSON.parse(s);
  13.130 -      } else {
  13.131 -        return s;
  13.132 -      }
  13.133 -    }
  13.134 -
  13.135 -    $scope.makeMarker = function( editor, line ) {
  13.136 -        var marker = document.createElement("div");
  13.137 -        marker.innerHTML = " ";
  13.138 -        marker.className = "issue";
  13.139 -        
  13.140 -        var info = editor.lineInfo(line);
  13.141 -        editor.setGutterMarker(line, "issues", info.markers ? null : marker);
  13.142 -        
  13.143 -        return marker;
  13.144 -    };
  13.145 -    
  13.146 -    
  13.147 -    // Returns a function, that, as long as it continues to be invoked, will not
  13.148 -    // be triggered. The function will be called after it stops being called for
  13.149 -    // N milliseconds. If `immediate` is passed, trigger the function on the
  13.150 -    // leading edge, instead of the trailing.
  13.151 -    $scope.debounce = function(func, wait, immediate) {
  13.152 -      var timeout, result;
  13.153 -      return function() {
  13.154 -        var context = this;
  13.155 -        var later = function() {
  13.156 -          timeout = null;
  13.157 -          if (!immediate) result = func.apply(context);
  13.158 -        };
  13.159 -        var callNow = immediate && !timeout;
  13.160 -        clearTimeout(timeout);
  13.161 -        timeout = setTimeout(later, wait);
  13.162 -        if (callNow) result = func.apply(context);
  13.163 -        return result;
  13.164 -      };
  13.165 -    };
  13.166 -    
  13.167 -    $scope.fail = function( data ) {
  13.168 -        $scope.errors = eval( data );
  13.169 -        var editor = document.getElementById("editorJava").codeMirror;   
  13.170 -        editor.clearGutter( "issues" );
  13.171 -        
  13.172 -        for( var i = 0; i < $scope.errors.length; i ++ ) {
  13.173 -            $scope.makeMarker( editor, $scope.errors[i].line - 1 );
  13.174 -        }
  13.175 -        
  13.176 -    };
  13.177 -    
  13.178 -    $scope.compile = function() {
  13.179 -        $scope.post('compile');        
  13.180 -    }
  13.181 -    
  13.182 -    $scope.run = function() {
  13.183 -        var classes = $scope.classes;
  13.184 -        if (classes === null) {
  13.185 -            $scope.post('compile');
  13.186 -        } else {
  13.187 -            $scope.runWithClasses();
  13.188 -        }
  13.189 -    };
  13.190 -    
  13.191 -    $scope.loadResourceFromClasses = function(resource) {
  13.192 -        resource = resource.toString(); // from java.lang.String to JS string
  13.193 -        if ($scope.classes) {
  13.194 -            for (var i = 0; i < $scope.classes.length; i++) {
  13.195 -                var c = $scope.classes[i];
  13.196 -                if (c.className === resource) {
  13.197 -                    return c.byteCode;
  13.198 -                }
  13.199 -            }
  13.200 -        }
  13.201 -        return null;
  13.202 -    };
  13.203 -    
  13.204 -    $scope.runWithClasses = function() {
  13.205 -        if (!$scope.vm) {
  13.206 -            // initialize the VM
  13.207 -            var script = window.document.getElementById("brwsrvm");
  13.208 -            script.src = "bck2brwsr.js";
  13.209 -            if (!window.bck2brwsr) {
  13.210 -                $scope.result('<h3>Initializing the Virtual Machine</h3> Please wait...');
  13.211 -                $timeout($scope.run, 100);
  13.212 -                return;
  13.213 -            }
  13.214 -            $scope.vm = window.bck2brwsr('${project.build.finalName}.jar', $scope.loadResourceFromClasses);
  13.215 -        }
  13.216 -        var vm = $scope.vm;
  13.217 -        
  13.218 -        $scope.result("");
  13.219 -        $timeout(function() {
  13.220 -            $scope.result($scope.html);
  13.221 -        }, 100).then(function() {
  13.222 -            var first = null;
  13.223 -            for (var i = 0; i < $scope.classes.length; i++) {
  13.224 -                var cn = $scope.classes[i].className;
  13.225 -                cn = cn.substring(0, cn.length - 6).replace__Ljava_lang_String_2CC('/','.');
  13.226 -                try {
  13.227 -                    vm.vm._reload(cn, $scope.classes[i].byteCode);
  13.228 -                } catch (err) {
  13.229 -                    $scope.status = 'Error loading ' + cn + ': ' + err.toString();
  13.230 -                    break;
  13.231 -                }
  13.232 -                if (first === null) {
  13.233 -                    first = cn;
  13.234 -                }
  13.235 -            }   
  13.236 -            try {
  13.237 -                if (first !== null) {
  13.238 -                    vm.loadClass(first);
  13.239 -                    $scope.status = 'Class ' + first + ' loaded OK.';
  13.240 -                }
  13.241 -            } catch (err) {
  13.242 -                $scope.status = 'Error loading ' + first + ': ' + err.toString();
  13.243 -            }
  13.244 -        }, 100);
  13.245 -    };
  13.246 -    
  13.247 -    $scope.errorClass = function( kind ) {
  13.248 -        switch( kind ) {
  13.249 -            case "ERROR" :
  13.250 -                return "error";
  13.251 -            default :         
  13.252 -                return "warning";   
  13.253 -        }
  13.254 -    };
  13.255 -    
  13.256 -    $scope.gotoError = function( line, col ) {
  13.257 -        var editor = document.getElementById("editorJava").codeMirror;   
  13.258 -        editor.setCursor({ line: line - 1, ch : col - 1 });
  13.259 -        editor.focus();
  13.260 -    };
  13.261 -    
  13.262 -    $scope.someErrors = function() {
  13.263 -        return $scope.errors !== null;
  13.264 -    };
  13.265 -    
  13.266 -    $scope.noModification = function() {
  13.267 -        if (!$scope.origJava) return true;
  13.268 -        if (!$scope.origHtml) return true;
  13.269 -        if ($scope.origJava === $scope.java && $scope.origHtml === $scope.html) {
  13.270 -            return true;
  13.271 -        }
  13.272 -        return false;
  13.273 -    };
  13.274 -
  13.275 -    $scope.save = function() {
  13.276 -        alert('Save not implemented yet');
  13.277 -    };
  13.278 -    
  13.279 -    $scope.result = function(html) {
  13.280 -        var e = window.document.getElementById("result");
  13.281 -        e.innerHTML = html;
  13.282 -    };
  13.283 -
  13.284 -    $scope.goto = function() {
  13.285 -        var type = $scope.gototype.value;
  13.286 -        $scope.gototype.value="";
  13.287 -        $scope.javac.running = true;
  13.288 -        $scope.javac.postMessage({
  13.289 -            type : "types",
  13.290 -            java : type
  13.291 -        });
  13.292 -    };
  13.293 -
  13.294 -    $scope.noType = function() {        
  13.295 -        return !$scope.gototype.value || $scope.javac.running;
  13.296 -    };
  13.297 -
  13.298 -    
  13.299 -    $scope.url = "http://hg.netbeans.org/main/contrib/dew4nb/";
  13.300 -    $scope.description = "Development Environment for Web";
  13.301 -    $scope.gototype = {value : "", current : null};
  13.302 -    
  13.303 -    if (!$scope.html) {
  13.304 -        $scope.html= templateHtml;  
  13.305 -        $scope.java = templateJava;  
  13.306 -    }
  13.307 -    $scope.classes = null;
  13.308 -    $scope.status = 'Initializing compiler connection...';
  13.309 -    $scope.completions = null;
  13.310 -    $scope.littleCompletions = function() {
  13.311 -        return $scope.completions === null || $scope.completions.list === null || $scope.completions.list.length < 10;
  13.312 -    };
  13.313 -            
  13.314 -    (function() {
  13.315 -        var url = "ws://" + window.location.host + "/javac";
  13.316 -        var ws = new WebSocket(url);
  13.317 -        var javac = $scope.javac = {
  13.318 -            "postMessage" : function(msg) { 
  13.319 -                console.log('Ignoring ' + JSON.stringify(msg)); 
  13.320 -            }
  13.321 -        };
  13.322 -        ws.onopen = function(ev) { 
  13.323 -            console.log(url + ' opened'); 
  13.324 -            javac.postMessage = function(msg) { 
  13.325 -                ws.send(JSON.stringify(msg)); 
  13.326 -            };
  13.327 -            javac.onmessage({ "data" : { "status" : "Connected!" } }); 
  13.328 -        };
  13.329 -        ws.onmessage = function(ev) {
  13.330 -            var mev = {
  13.331 -                "data" : JSON.parse(ev.data)
  13.332 -            }
  13.333 -            javac.onmessage(mev); 
  13.334 -        };
  13.335 -        ws.onerror = function(ev) { 
  13.336 -            alert('Error: ' + ev); 
  13.337 -        };
  13.338 -        ws.onclose = function(ev) { 
  13.339 -            console.log(url + ' closed: ' + ev); 
  13.340 -        };
  13.341 -    })(this);
  13.342 -
  13.343 -    var JAVA_WORD = /[\w$]+/;
  13.344 -    $scope.javaHint = function (editor, fn, options) {
  13.345 -        var word = options && options.word || JAVA_WORD;
  13.346 -        var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
  13.347 -        var start = cur.ch, end = start;
  13.348 -        while (start && word.test(curLine.charAt(start - 1)))
  13.349 -            --start;
  13.350 -        var pref = start !== end && curLine.slice(start, end);
  13.351 -        while (end < curLine.length && word.test(curLine.charAt(end)))
  13.352 -            ++end;
  13.353 -
  13.354 -        $scope.pendingJavaHintInfo = {callback: fn, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end), prefix: pref};
  13.355 -        $scope.post('autocomplete');
  13.356 -    };
  13.357 -    $scope.applyCompletion = function(cmpltn, info) {
  13.358 -        var editor = document.getElementById("editorJava").codeMirror;
  13.359 -        editor.replaceRange(cmpltn.text, info.from, info.to);
  13.360 -        editor.focus();
  13.361 -    };
  13.362 -    $scope.computeCompletion = function() {
  13.363 -      $scope.post("autocomplete");
  13.364 -    };
  13.365 -    CodeMirror.registerHelper("hint", "clike", $scope.javaHint);
  13.366 -
  13.367 -    $scope.javac.onmessage = function(ev) {
  13.368 -        var editor = document.getElementById("editorJava").codeMirror;
  13.369 -        var obj = ev.data;
  13.370 -        $scope.status = obj.status;
  13.371 -        if (obj.status === "success") {
  13.372 -            if (obj.type === 'getfile') {
  13.373 -                editor.setValue(obj.content);
  13.374 -                $scope.javac.context = $scope.gototype.current;
  13.375 -                $scope.gototype.current = null;
  13.376 -            }
  13.377 -            if (obj.type === 'types') {
  13.378 -                if (obj.types && obj.types.length > 0) {
  13.379 -                    var ctx  = obj.types[0].context;
  13.380 -                    $scope.gototype.current = ctx;
  13.381 -                    $scope.javac.postMessage({
  13.382 -                        type : "getfile",
  13.383 -                        context : ctx
  13.384 -                    });
  13.385 -                    return;
  13.386 -                }
  13.387 -            } else if (obj.type === 'autocomplete') {
  13.388 -                if (obj.completions) {
  13.389 -                    var list = obj.completions;
  13.390 -                    list.map(function(item) {
  13.391 -                        item.className = "Java-hint " + item.className;
  13.392 -                        return item;
  13.393 -                    });
  13.394 -                    var from = editor.getCursor();
  13.395 -                    var to = editor.getCursor();
  13.396 -                    if ($scope.pendingJavaHintInfo) {
  13.397 -                        if ($scope.pendingJavaHintInfo.prefix) {
  13.398 -                            var pref = $scope.pendingJavaHintInfo.prefix;
  13.399 -                            var filtered = [];
  13.400 -                            for(var i = 0; i < list.length; ++i) {
  13.401 -                                if (list[i].text.slice(0, pref.length) === pref)
  13.402 -                                    filtered[filtered.length] = list[i];
  13.403 -                            }
  13.404 -                            list = filtered;
  13.405 -                        }
  13.406 -                        var render = function(elt, data, cur) {
  13.407 -                            var le = elt.appendChild(document.createElement("span"));
  13.408 -                            le.className = "Java-hint-left";
  13.409 -                            var name = le.appendChild(document.createElement("span"));
  13.410 -                            name.className = "Java-hint-name";
  13.411 -                            name.appendChild(document.createTextNode(cur.displayName || cur.text));
  13.412 -                            if (cur.extraText) {
  13.413 -                                le.appendChild(document.createTextNode(cur.extraText));
  13.414 -                            }
  13.415 -                            if (cur.rightText) {
  13.416 -                                var re = elt.appendChild(document.createElement("span"));
  13.417 -                                re.className="Java-hint-right";
  13.418 -                                re.appendChild(document.createTextNode(cur.rightText));
  13.419 -                            }
  13.420 -                        };
  13.421 -                        list.map(function (item) {
  13.422 -                            item.render = render;
  13.423 -                            return item;
  13.424 -                        });
  13.425 -                        from = $scope.pendingJavaHintInfo.from;
  13.426 -                        to = $scope.pendingJavaHintInfo.to;
  13.427 -                        $scope.pendingJavaHintInfo.callback({list: list, from: from, to: to, more: null});
  13.428 -                    }
  13.429 -                    var showHint = list.length <= 10 ? null : function() {
  13.430 -                        CodeMirror.showHint(editor, null, {async: true});
  13.431 -                    };
  13.432 -                    $scope.completions = {list: list.slice(0, 10), from: from, to: to, more: showHint };
  13.433 -                }
  13.434 -                $scope.pendingJavaHintInfo = null;
  13.435 -            } else if (obj.type === "compile") {
  13.436 -                $scope.errors = null;
  13.437 -                editor.clearGutter("issues");
  13.438 -                if (obj.classes !== null && obj.classes.length > 0) {
  13.439 -                    $scope.classes = obj.classes;
  13.440 -                    $scope.runWithClasses();
  13.441 -                } else {
  13.442 -                    $scope.classes = null;
  13.443 -                    $scope.fail(obj.diagnostics);
  13.444 -                }
  13.445 -            } else if (obj.type === "checkForErrors") {
  13.446 -                if (obj.diagnostics.length === 0) {
  13.447 -                    $scope.errors = null;
  13.448 -                    var editor = document.getElementById("editorJava").codeMirror;
  13.449 -                    editor.clearGutter("issues");
  13.450 -                } else {
  13.451 -                    $scope.classes = null;
  13.452 -                    $scope.fail(obj.diagnostics);
  13.453 -                }
  13.454 -            }
  13.455 -        }
  13.456 -        $scope.javac.running = false;
  13.457 -        if ($scope.javac.pending) {
  13.458 -            $scope.javac.pending = false;
  13.459 -            $scope.post();
  13.460 -        }
  13.461 -        $scope.$apply("");
  13.462 -    };
  13.463 -    $scope.post = function(t) {
  13.464 -        t = t || 'checkForErrors';
  13.465 -        if ($scope.javac.running) {
  13.466 -            $scope.javac.pending = true;
  13.467 -        } else {
  13.468 -            var editor = document.getElementById("editorJava").codeMirror;
  13.469 -            if ($scope.computeCompletion) {
  13.470 -                editor.on("cursorActivity", $scope.computeCompletion);
  13.471 -                $scope.computeCompletion = null;
  13.472 -            }
  13.473 -            var off = editor.indexFromPos(t === 'autocomplete' && $scope.pendingJavaHintInfo ? 
  13.474 -                $scope.pendingJavaHintInfo.from : editor.getCursor()
  13.475 -            );
  13.476 -            $scope.javac.postMessage({
  13.477 -                type : t,
  13.478 -                context : $scope.javac.context,
  13.479 -                html : $scope.html,
  13.480 -                java :$scope.java,
  13.481 -                offset : off});
  13.482 -            $scope.javac.running = true;
  13.483 -            if ($scope.status.indexOf('Init') < 0) {
  13.484 -                $scope.status = 'Compiling...';
  13.485 -                $scope.$apply("");
  13.486 -            }
  13.487 -        }
  13.488 -        if (t !== 'autocomplete') {
  13.489 -            $scope.classes = null;
  13.490 -            $scope.errors = [];
  13.491 -            localStorage.java = $scope.java;
  13.492 -            localStorage.html = $scope.html;
  13.493 -        }
  13.494 -    };
  13.495 -
  13.496 -    CodeMirror.commands.autocomplete = function(cm) {
  13.497 -        CodeMirror.showHint(cm, null, {async: true});
  13.498 -    };
  13.499 -
  13.500 -    $scope.$watch( "html", $scope.debounce( $scope.post, 500 ) );
  13.501 -    $scope.$watch( "java", $scope.debounce( $scope.post, 500 ) );
  13.502 -
  13.503 -}
    14.1 --- a/dew4nb/release/web4dew/js/codemirror/addon/hint/show-hint.css	Wed Jan 29 17:28:57 2014 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,38 +0,0 @@
    14.4 -.CodeMirror-hints {
    14.5 -  position: absolute;
    14.6 -  z-index: 10;
    14.7 -  overflow: hidden;
    14.8 -  list-style: none;
    14.9 -
   14.10 -  margin: 0;
   14.11 -  padding: 2px;
   14.12 -
   14.13 -  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
   14.14 -  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
   14.15 -  box-shadow: 2px 3px 5px rgba(0,0,0,.2);
   14.16 -  border-radius: 3px;
   14.17 -  border: 1px solid silver;
   14.18 -
   14.19 -  background: white;
   14.20 -  font-size: 90%;
   14.21 -  font-family: monospace;
   14.22 -
   14.23 -  max-height: 20em;
   14.24 -  overflow-y: auto;
   14.25 -}
   14.26 -
   14.27 -.CodeMirror-hint {
   14.28 -  margin: 0;
   14.29 -  padding: 0 4px;
   14.30 -  border-radius: 2px;
   14.31 -  max-width: 19em;
   14.32 -  overflow: hidden;
   14.33 -  white-space: pre;
   14.34 -  color: black;
   14.35 -  cursor: pointer;
   14.36 -}
   14.37 -
   14.38 -.CodeMirror-hint-active {
   14.39 -  background: #08f;
   14.40 -  color: white;
   14.41 -}
    15.1 --- a/dew4nb/release/web4dew/js/codemirror/addon/hint/show-hint.js	Wed Jan 29 17:28:57 2014 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,275 +0,0 @@
    15.4 -(function() {
    15.5 -  "use strict";
    15.6 -
    15.7 -  CodeMirror.showHint = function(cm, getHints, options) {
    15.8 -    // We want a single cursor position.
    15.9 -    if (cm.somethingSelected()) return;
   15.10 -    if (getHints == null) getHints = cm.getHelper(cm.getCursor(), "hint");
   15.11 -    if (getHints == null) return;
   15.12 -
   15.13 -    if (cm.state.completionActive) cm.state.completionActive.close();
   15.14 -
   15.15 -    var completion = cm.state.completionActive = new Completion(cm, getHints, options || {});
   15.16 -    CodeMirror.signal(cm, "startCompletion", cm);
   15.17 -    if (completion.options.async)
   15.18 -      getHints(cm, function(hints) { completion.showHints(hints); }, completion.options);
   15.19 -    else
   15.20 -      return completion.showHints(getHints(cm, completion.options));
   15.21 -  };
   15.22 -
   15.23 -  function Completion(cm, getHints, options) {
   15.24 -    this.cm = cm;
   15.25 -    this.getHints = getHints;
   15.26 -    this.options = options;
   15.27 -    this.widget = this.onClose = null;
   15.28 -  }
   15.29 -
   15.30 -  Completion.prototype = {
   15.31 -    close: function() {
   15.32 -      if (!this.active()) return;
   15.33 -      this.cm.state.completionActive = null;
   15.34 -
   15.35 -      if (this.widget) this.widget.close();
   15.36 -      if (this.onClose) this.onClose();
   15.37 -      CodeMirror.signal(this.cm, "endCompletion", this.cm);
   15.38 -    },
   15.39 -
   15.40 -    active: function() {
   15.41 -      return this.cm.state.completionActive == this;
   15.42 -    },
   15.43 -
   15.44 -    pick: function(data, i) {
   15.45 -      var completion = data.list[i];
   15.46 -      if (completion.hint) completion.hint(this.cm, data, completion);
   15.47 -      else this.cm.replaceRange(getText(completion), data.from, data.to);
   15.48 -      this.close();
   15.49 -    },
   15.50 -
   15.51 -    showHints: function(data) {
   15.52 -      if (!data || !data.list.length || !this.active()) return this.close();
   15.53 -
   15.54 -      if (this.options.completeSingle != false && data.list.length == 1)
   15.55 -        this.pick(data, 0);
   15.56 -      else
   15.57 -        this.showWidget(data);
   15.58 -    },
   15.59 -
   15.60 -    showWidget: function(data) {
   15.61 -      this.widget = new Widget(this, data);
   15.62 -      CodeMirror.signal(data, "shown");
   15.63 -
   15.64 -      var debounce = null, completion = this, finished;
   15.65 -      var closeOn = this.options.closeCharacters || /[\s()\[\]{};:>,]/;
   15.66 -      var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length;
   15.67 -
   15.68 -      function done() {
   15.69 -        if (finished) return;
   15.70 -        finished = true;
   15.71 -        completion.close();
   15.72 -        completion.cm.off("cursorActivity", activity);
   15.73 -        if (data) CodeMirror.signal(data, "close");
   15.74 -      }
   15.75 -
   15.76 -      function update() {
   15.77 -        if (finished) return;
   15.78 -        CodeMirror.signal(data, "update");
   15.79 -        if (completion.options.async)
   15.80 -          completion.getHints(completion.cm, finishUpdate, completion.options);
   15.81 -        else
   15.82 -          finishUpdate(completion.getHints(completion.cm, completion.options));
   15.83 -      }
   15.84 -      function finishUpdate(data_) {
   15.85 -        data = data_;
   15.86 -        if (finished) return;
   15.87 -        if (!data || !data.list.length) return done();
   15.88 -        completion.widget = new Widget(completion, data);
   15.89 -      }
   15.90 -
   15.91 -      function activity() {
   15.92 -        clearTimeout(debounce);
   15.93 -        var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line);
   15.94 -        if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch ||
   15.95 -            pos.ch < startPos.ch || completion.cm.somethingSelected() ||
   15.96 -            (pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) {
   15.97 -          completion.close();
   15.98 -        } else {
   15.99 -          debounce = setTimeout(update, 170);
  15.100 -          if (completion.widget) completion.widget.close();
  15.101 -        }
  15.102 -      }
  15.103 -      this.cm.on("cursorActivity", activity);
  15.104 -      this.onClose = done;
  15.105 -    }
  15.106 -  };
  15.107 -
  15.108 -  function getText(completion) {
  15.109 -    if (typeof completion == "string") return completion;
  15.110 -    else return completion.text;
  15.111 -  }
  15.112 -
  15.113 -  function buildKeyMap(options, handle) {
  15.114 -    var baseMap = {
  15.115 -      Up: function() {handle.moveFocus(-1);},
  15.116 -      Down: function() {handle.moveFocus(1);},
  15.117 -      PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
  15.118 -      PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
  15.119 -      Home: function() {handle.setFocus(0);},
  15.120 -      End: function() {handle.setFocus(handle.length - 1);},
  15.121 -      Enter: handle.pick,
  15.122 -      Tab: handle.pick,
  15.123 -      Esc: handle.close
  15.124 -    };
  15.125 -    var ourMap = options.customKeys ? {} : baseMap;
  15.126 -    function addBinding(key, val) {
  15.127 -      var bound;
  15.128 -      if (typeof val != "string")
  15.129 -        bound = function(cm) { return val(cm, handle); };
  15.130 -      // This mechanism is deprecated
  15.131 -      else if (baseMap.hasOwnProperty(val))
  15.132 -        bound = baseMap[val];
  15.133 -      else
  15.134 -        bound = val;
  15.135 -      ourMap[key] = bound;
  15.136 -    }
  15.137 -    if (options.customKeys)
  15.138 -      for (var key in options.customKeys) if (options.customKeys.hasOwnProperty(key))
  15.139 -        addBinding(key, options.customKeys[key]);
  15.140 -    if (options.extraKeys)
  15.141 -      for (var key in options.extraKeys) if (options.extraKeys.hasOwnProperty(key))
  15.142 -        addBinding(key, options.extraKeys[key]);
  15.143 -    return ourMap;
  15.144 -  }
  15.145 -
  15.146 -  function Widget(completion, data) {
  15.147 -    this.completion = completion;
  15.148 -    this.data = data;
  15.149 -    var widget = this, cm = completion.cm, options = completion.options;
  15.150 -
  15.151 -    var hints = this.hints = document.createElement("ul");
  15.152 -    hints.className = "CodeMirror-hints";
  15.153 -    this.selectedHint = 0;
  15.154 -
  15.155 -    var completions = data.list;
  15.156 -    for (var i = 0; i < completions.length; ++i) {
  15.157 -      var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
  15.158 -      var className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active");
  15.159 -      if (cur.className != null) className = cur.className + " " + className;
  15.160 -      elt.className = className;
  15.161 -      if (cur.render) cur.render(elt, data, cur);
  15.162 -//      else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
  15.163 -      else angular.element(elt).append(cur.displayText);
  15.164 -      elt.hintId = i;
  15.165 -    }
  15.166 -
  15.167 -    var pos = cm.cursorCoords(options.alignWithWord !== false ? data.from : null);
  15.168 -    var left = pos.left, top = pos.bottom, below = true;
  15.169 -    hints.style.left = left + "px";
  15.170 -    hints.style.top = top + "px";
  15.171 -    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
  15.172 -    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
  15.173 -    var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
  15.174 -    (options.container || document.body).appendChild(hints);
  15.175 -    var box = hints.getBoundingClientRect();
  15.176 -    var overlapX = box.right - winW, overlapY = box.bottom - winH;
  15.177 -    if (overlapX > 0) {
  15.178 -      if (box.right - box.left > winW) {
  15.179 -        hints.style.width = (winW - 5) + "px";
  15.180 -        overlapX -= (box.right - box.left) - winW;
  15.181 -      }
  15.182 -      hints.style.left = (left = pos.left - overlapX) + "px";
  15.183 -    }
  15.184 -    if (overlapY > 0) {
  15.185 -      var height = box.bottom - box.top;
  15.186 -      if (box.top - (pos.bottom - pos.top) - height > 0) {
  15.187 -        overlapY = height + (pos.bottom - pos.top);
  15.188 -        below = false;
  15.189 -      } else if (height > winH) {
  15.190 -        hints.style.height = (winH - 5) + "px";
  15.191 -        overlapY -= height - winH;
  15.192 -      }
  15.193 -      hints.style.top = (top = pos.bottom - overlapY) + "px";
  15.194 -    }
  15.195 -
  15.196 -    cm.addKeyMap(this.keyMap = buildKeyMap(options, {
  15.197 -      moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
  15.198 -      setFocus: function(n) { widget.changeActive(n); },
  15.199 -      menuSize: function() { return widget.screenAmount(); },
  15.200 -      length: completions.length,
  15.201 -      close: function() { completion.close(); },
  15.202 -      pick: function() { widget.pick(); }
  15.203 -    }));
  15.204 -
  15.205 -    if (options.closeOnUnfocus !== false) {
  15.206 -      var closingOnBlur;
  15.207 -      cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
  15.208 -      cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
  15.209 -    }
  15.210 -
  15.211 -    var startScroll = cm.getScrollInfo();
  15.212 -    cm.on("scroll", this.onScroll = function() {
  15.213 -      var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
  15.214 -      var newTop = top + startScroll.top - curScroll.top;
  15.215 -      var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
  15.216 -      if (!below) point += hints.offsetHeight;
  15.217 -      if (point <= editor.top || point >= editor.bottom) return completion.close();
  15.218 -      hints.style.top = newTop + "px";
  15.219 -      hints.style.left = (left + startScroll.left - curScroll.left) + "px";
  15.220 -    });
  15.221 -
  15.222 -    CodeMirror.on(hints, "dblclick", function(e) {
  15.223 -      var t = e.target || e.srcElement;
  15.224 -      if (t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
  15.225 -    });
  15.226 -    CodeMirror.on(hints, "click", function(e) {
  15.227 -      var t = e.target || e.srcElement;
  15.228 -      if (t.hintId != null) widget.changeActive(t.hintId);
  15.229 -    });
  15.230 -    CodeMirror.on(hints, "mousedown", function() {
  15.231 -      setTimeout(function(){cm.focus();}, 20);
  15.232 -    });
  15.233 -
  15.234 -    CodeMirror.signal(data, "select", completions[0], hints.firstChild);
  15.235 -    return true;
  15.236 -  }
  15.237 -
  15.238 -  Widget.prototype = {
  15.239 -    close: function() {
  15.240 -      if (this.completion.widget != this) return;
  15.241 -      this.completion.widget = null;
  15.242 -      this.hints.parentNode.removeChild(this.hints);
  15.243 -      this.completion.cm.removeKeyMap(this.keyMap);
  15.244 -
  15.245 -      var cm = this.completion.cm;
  15.246 -      if (this.completion.options.closeOnUnfocus !== false) {
  15.247 -        cm.off("blur", this.onBlur);
  15.248 -        cm.off("focus", this.onFocus);
  15.249 -      }
  15.250 -      cm.off("scroll", this.onScroll);
  15.251 -    },
  15.252 -
  15.253 -    pick: function() {
  15.254 -      this.completion.pick(this.data, this.selectedHint);
  15.255 -    },
  15.256 -
  15.257 -    changeActive: function(i, avoidWrap) {
  15.258 -      if (i >= this.data.list.length)
  15.259 -        i = avoidWrap ? this.data.list.length - 1 : 0;
  15.260 -      else if (i < 0)
  15.261 -        i = avoidWrap ? 0  : this.data.list.length - 1;
  15.262 -      if (this.selectedHint == i) return;
  15.263 -      var node = this.hints.childNodes[this.selectedHint];
  15.264 -      node.className = node.className.replace(" CodeMirror-hint-active", "");
  15.265 -      node = this.hints.childNodes[this.selectedHint = i];
  15.266 -      node.className += " CodeMirror-hint-active";
  15.267 -      if (node.offsetTop < this.hints.scrollTop)
  15.268 -        this.hints.scrollTop = node.offsetTop - 3;
  15.269 -      else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
  15.270 -        this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
  15.271 -      CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
  15.272 -    },
  15.273 -
  15.274 -    screenAmount: function() {
  15.275 -      return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
  15.276 -    }
  15.277 -  };
  15.278 -})();
    16.1 --- a/dew4nb/release/web4dew/js/codemirror/codemirror.css	Wed Jan 29 17:28:57 2014 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,263 +0,0 @@
    16.4 -/* BASICS */
    16.5 -
    16.6 -.CodeMirror {
    16.7 -  /* Set height, width, borders, and global font properties here */
    16.8 -  font-family: monospace;
    16.9 -  height: 300px;
   16.10 -}
   16.11 -.CodeMirror-scroll {
   16.12 -  /* Set scrolling behaviour here */
   16.13 -  overflow: auto;
   16.14 -}
   16.15 -
   16.16 -/* PADDING */
   16.17 -
   16.18 -.CodeMirror-lines {
   16.19 -  padding: 4px 0; /* Vertical padding around content */
   16.20 -}
   16.21 -.CodeMirror pre {
   16.22 -  padding: 0 4px; /* Horizontal padding of content */
   16.23 -}
   16.24 -
   16.25 -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
   16.26 -  background-color: white; /* The little square between H and V scrollbars */
   16.27 -}
   16.28 -
   16.29 -/* GUTTER */
   16.30 -
   16.31 -.CodeMirror-gutters {
   16.32 -  border-right: 1px solid #ddd;
   16.33 -  background-color: #f7f7f7;
   16.34 -  white-space: nowrap;
   16.35 -}
   16.36 -.CodeMirror-linenumbers {}
   16.37 -.CodeMirror-linenumber {
   16.38 -  padding: 0 3px 0 5px;
   16.39 -  min-width: 20px;
   16.40 -  text-align: right;
   16.41 -  color: #999;
   16.42 -}
   16.43 -
   16.44 -/* CURSOR */
   16.45 -
   16.46 -.CodeMirror div.CodeMirror-cursor {
   16.47 -  border-left: 1px solid black;
   16.48 -  z-index: 3;
   16.49 -}
   16.50 -/* Shown when moving in bi-directional text */
   16.51 -.CodeMirror div.CodeMirror-secondarycursor {
   16.52 -  border-left: 1px solid silver;
   16.53 -}
   16.54 -.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
   16.55 -  width: auto;
   16.56 -  border: 0;
   16.57 -  background: #7e7;
   16.58 -  z-index: 1;
   16.59 -}
   16.60 -/* Can style cursor different in overwrite (non-insert) mode */
   16.61 -.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
   16.62 -
   16.63 -.cm-tab { display: inline-block; }
   16.64 -
   16.65 -/* DEFAULT THEME */
   16.66 -
   16.67 -.cm-s-default .cm-keyword {color: #708;}
   16.68 -.cm-s-default .cm-atom {color: #219;}
   16.69 -.cm-s-default .cm-number {color: #164;}
   16.70 -.cm-s-default .cm-def {color: #00f;}
   16.71 -.cm-s-default .cm-variable {color: black;}
   16.72 -.cm-s-default .cm-variable-2 {color: #05a;}
   16.73 -.cm-s-default .cm-variable-3 {color: #085;}
   16.74 -.cm-s-default .cm-property {color: black;}
   16.75 -.cm-s-default .cm-operator {color: black;}
   16.76 -.cm-s-default .cm-comment {color: #a50;}
   16.77 -.cm-s-default .cm-string {color: #a11;}
   16.78 -.cm-s-default .cm-string-2 {color: #f50;}
   16.79 -.cm-s-default .cm-meta {color: #555;}
   16.80 -.cm-s-default .cm-qualifier {color: #555;}
   16.81 -.cm-s-default .cm-builtin {color: #30a;}
   16.82 -.cm-s-default .cm-bracket {color: #997;}
   16.83 -.cm-s-default .cm-tag {color: #170;}
   16.84 -.cm-s-default .cm-attribute {color: #00c;}
   16.85 -.cm-s-default .cm-header {color: blue;}
   16.86 -.cm-s-default .cm-quote {color: #090;}
   16.87 -.cm-s-default .cm-hr {color: #999;}
   16.88 -.cm-s-default .cm-link {color: #00c;}
   16.89 -
   16.90 -.cm-negative {color: #d44;}
   16.91 -.cm-positive {color: #292;}
   16.92 -.cm-header, .cm-strong {font-weight: bold;}
   16.93 -.cm-em {font-style: italic;}
   16.94 -.cm-link {text-decoration: underline;}
   16.95 -
   16.96 -.cm-s-default .cm-error {color: #f00;}
   16.97 -.cm-invalidchar {color: #f00;}
   16.98 -
   16.99 -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
  16.100 -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
  16.101 -.CodeMirror-activeline-background {background: #e8f2ff;}
  16.102 -
  16.103 -/* STOP */
  16.104 -
  16.105 -/* The rest of this file contains styles related to the mechanics of
  16.106 -   the editor. You probably shouldn't touch them. */
  16.107 -
  16.108 -.CodeMirror {
  16.109 -  line-height: 1;
  16.110 -  position: relative;
  16.111 -  overflow: hidden;
  16.112 -  background: white;
  16.113 -  color: black;
  16.114 -}
  16.115 -
  16.116 -.CodeMirror-scroll {
  16.117 -  /* 30px is the magic margin used to hide the element's real scrollbars */
  16.118 -  /* See overflow: hidden in .CodeMirror */
  16.119 -  margin-bottom: -30px; margin-right: -30px;
  16.120 -  padding-bottom: 30px; padding-right: 30px;
  16.121 -  height: 100%;
  16.122 -  outline: none; /* Prevent dragging from highlighting the element */
  16.123 -  position: relative;
  16.124 -  -moz-box-sizing: content-box;
  16.125 -  box-sizing: content-box;
  16.126 -}
  16.127 -.CodeMirror-sizer {
  16.128 -  position: relative;
  16.129 -}
  16.130 -
  16.131 -/* The fake, visible scrollbars. Used to force redraw during scrolling
  16.132 -   before actuall scrolling happens, thus preventing shaking and
  16.133 -   flickering artifacts. */
  16.134 -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
  16.135 -  position: absolute;
  16.136 -  z-index: 6;
  16.137 -  display: none;
  16.138 -}
  16.139 -.CodeMirror-vscrollbar {
  16.140 -  right: 0; top: 0;
  16.141 -  overflow-x: hidden;
  16.142 -  overflow-y: scroll;
  16.143 -}
  16.144 -.CodeMirror-hscrollbar {
  16.145 -  bottom: 0; left: 0;
  16.146 -  overflow-y: hidden;
  16.147 -  overflow-x: scroll;
  16.148 -}
  16.149 -.CodeMirror-scrollbar-filler {
  16.150 -  right: 0; bottom: 0;
  16.151 -}
  16.152 -.CodeMirror-gutter-filler {
  16.153 -  left: 0; bottom: 0;
  16.154 -}
  16.155 -
  16.156 -.CodeMirror-gutters {
  16.157 -  position: absolute; left: 0; top: 0;
  16.158 -  padding-bottom: 30px;
  16.159 -  z-index: 3;
  16.160 -}
  16.161 -.CodeMirror-gutter {
  16.162 -  white-space: normal;
  16.163 -  height: 100%;
  16.164 -  -moz-box-sizing: content-box;
  16.165 -  box-sizing: content-box;
  16.166 -  padding-bottom: 30px;
  16.167 -  margin-bottom: -32px;
  16.168 -  display: inline-block;
  16.169 -  /* Hack to make IE7 behave */
  16.170 -  *zoom:1;
  16.171 -  *display:inline;
  16.172 -}
  16.173 -.CodeMirror-gutter-elt {
  16.174 -  position: absolute;
  16.175 -  cursor: default;
  16.176 -  z-index: 4;
  16.177 -}
  16.178 -
  16.179 -.CodeMirror-lines {
  16.180 -  cursor: text;
  16.181 -}
  16.182 -.CodeMirror pre {
  16.183 -  /* Reset some styles that the rest of the page might have set */
  16.184 -  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  16.185 -  border-width: 0;
  16.186 -  background: transparent;
  16.187 -  font-family: inherit;
  16.188 -  font-size: inherit;
  16.189 -  margin: 0;
  16.190 -  white-space: pre;
  16.191 -  word-wrap: normal;
  16.192 -  line-height: inherit;
  16.193 -  color: inherit;
  16.194 -  z-index: 2;
  16.195 -  position: relative;
  16.196 -  overflow: visible;
  16.197 -}
  16.198 -.CodeMirror-wrap pre {
  16.199 -  word-wrap: break-word;
  16.200 -  white-space: pre-wrap;
  16.201 -  word-break: normal;
  16.202 -}
  16.203 -.CodeMirror-code pre {
  16.204 -  border-right: 30px solid transparent;
  16.205 -  width: -webkit-fit-content;
  16.206 -  width: -moz-fit-content;
  16.207 -  width: fit-content;
  16.208 -}
  16.209 -.CodeMirror-wrap .CodeMirror-code pre {
  16.210 -  border-right: none;
  16.211 -  width: auto;
  16.212 -}
  16.213 -.CodeMirror-linebackground {
  16.214 -  position: absolute;
  16.215 -  left: 0; right: 0; top: 0; bottom: 0;
  16.216 -  z-index: 0;
  16.217 -}
  16.218 -
  16.219 -.CodeMirror-linewidget {
  16.220 -  position: relative;
  16.221 -  z-index: 2;
  16.222 -  overflow: auto;
  16.223 -}
  16.224 -
  16.225 -.CodeMirror-widget {}
  16.226 -
  16.227 -.CodeMirror-wrap .CodeMirror-scroll {
  16.228 -  overflow-x: hidden;
  16.229 -}
  16.230 -
  16.231 -.CodeMirror-measure {
  16.232 -  position: absolute;
  16.233 -  width: 100%;
  16.234 -  height: 0;
  16.235 -  overflow: hidden;
  16.236 -  visibility: hidden;
  16.237 -}
  16.238 -.CodeMirror-measure pre { position: static; }
  16.239 -
  16.240 -.CodeMirror div.CodeMirror-cursor {
  16.241 -  position: absolute;
  16.242 -  visibility: hidden;
  16.243 -  border-right: none;
  16.244 -  width: 0;
  16.245 -}
  16.246 -.CodeMirror-focused div.CodeMirror-cursor {
  16.247 -  visibility: visible;
  16.248 -}
  16.249 -
  16.250 -.CodeMirror-selected { background: #d9d9d9; }
  16.251 -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
  16.252 -
  16.253 -.cm-searching {
  16.254 -  background: #ffa;
  16.255 -  background: rgba(255, 255, 0, .4);
  16.256 -}
  16.257 -
  16.258 -/* IE7 hack to prevent it from returning funny offsetTops on the spans */
  16.259 -.CodeMirror span { *vertical-align: text-bottom; }
  16.260 -
  16.261 -@media print {
  16.262 -  /* Hide the cursor when printing */
  16.263 -  .CodeMirror div.CodeMirror-cursor {
  16.264 -    visibility: hidden;
  16.265 -  }
  16.266 -}
    17.1 --- a/dew4nb/release/web4dew/js/codemirror/codemirror.js	Wed Jan 29 17:28:57 2014 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,5910 +0,0 @@
    17.4 -// CodeMirror version 3.19
    17.5 -//
    17.6 -// CodeMirror is the only global var we claim
    17.7 -window.CodeMirror = (function() {
    17.8 -  "use strict";
    17.9 -
   17.10 -  // BROWSER SNIFFING
   17.11 -
   17.12 -  // Crude, but necessary to handle a number of hard-to-feature-detect
   17.13 -  // bugs and behavior differences.
   17.14 -  var gecko = /gecko\/\d/i.test(navigator.userAgent);
   17.15 -  var ie = /MSIE \d/.test(navigator.userAgent);
   17.16 -  var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);
   17.17 -  var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
   17.18 -  var webkit = /WebKit\//.test(navigator.userAgent);
   17.19 -  var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
   17.20 -  var chrome = /Chrome\//.test(navigator.userAgent);
   17.21 -  var opera = /Opera\//.test(navigator.userAgent);
   17.22 -  var safari = /Apple Computer/.test(navigator.vendor);
   17.23 -  var khtml = /KHTML\//.test(navigator.userAgent);
   17.24 -  var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);
   17.25 -  var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
   17.26 -  var phantom = /PhantomJS/.test(navigator.userAgent);
   17.27 -
   17.28 -  var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
   17.29 -  // This is woefully incomplete. Suggestions for alternative methods welcome.
   17.30 -  var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
   17.31 -  var mac = ios || /Mac/.test(navigator.platform);
   17.32 -  var windows = /win/i.test(navigator.platform);
   17.33 -
   17.34 -  var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
   17.35 -  if (opera_version) opera_version = Number(opera_version[1]);
   17.36 -  if (opera_version && opera_version >= 15) { opera = false; webkit = true; }
   17.37 -  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
   17.38 -  var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));
   17.39 -  var captureMiddleClick = gecko || (ie && !ie_lt9);
   17.40 -
   17.41 -  // Optimize some code when these features are not used
   17.42 -  var sawReadOnlySpans = false, sawCollapsedSpans = false;
   17.43 -
   17.44 -  // CONSTRUCTOR
   17.45 -
   17.46 -  function CodeMirror(place, options) {
   17.47 -    if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
   17.48 -
   17.49 -    this.options = options = options || {};
   17.50 -    // Determine effective options based on given values and defaults.
   17.51 -    for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))
   17.52 -      options[opt] = defaults[opt];
   17.53 -    setGuttersForLineNumbers(options);
   17.54 -
   17.55 -    var docStart = typeof options.value == "string" ? 0 : options.value.first;
   17.56 -    var display = this.display = makeDisplay(place, docStart);
   17.57 -    display.wrapper.CodeMirror = this;
   17.58 -    updateGutters(this);
   17.59 -    if (options.autofocus && !mobile) focusInput(this);
   17.60 -
   17.61 -    this.state = {keyMaps: [],
   17.62 -                  overlays: [],
   17.63 -                  modeGen: 0,
   17.64 -                  overwrite: false, focused: false,
   17.65 -                  suppressEdits: false, pasteIncoming: false,
   17.66 -                  draggingText: false,
   17.67 -                  highlight: new Delayed()};
   17.68 -
   17.69 -    themeChanged(this);
   17.70 -    if (options.lineWrapping)
   17.71 -      this.display.wrapper.className += " CodeMirror-wrap";
   17.72 -
   17.73 -    var doc = options.value;
   17.74 -    if (typeof doc == "string") doc = new Doc(options.value, options.mode);
   17.75 -    operation(this, attachDoc)(this, doc);
   17.76 -
   17.77 -    // Override magic textarea content restore that IE sometimes does
   17.78 -    // on our hidden textarea on reload
   17.79 -    if (ie) setTimeout(bind(resetInput, this, true), 20);
   17.80 -
   17.81 -    registerEventHandlers(this);
   17.82 -    // IE throws unspecified error in certain cases, when
   17.83 -    // trying to access activeElement before onload
   17.84 -    var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }
   17.85 -    if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);
   17.86 -    else onBlur(this);
   17.87 -
   17.88 -    operation(this, function() {
   17.89 -      for (var opt in optionHandlers)
   17.90 -        if (optionHandlers.propertyIsEnumerable(opt))
   17.91 -          optionHandlers[opt](this, options[opt], Init);
   17.92 -      for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
   17.93 -    })();
   17.94 -  }
   17.95 -
   17.96 -  // DISPLAY CONSTRUCTOR
   17.97 -
   17.98 -  function makeDisplay(place, docStart) {
   17.99 -    var d = {};
  17.100 -
  17.101 -    var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");
  17.102 -    if (webkit) input.style.width = "1000px";
  17.103 -    else input.setAttribute("wrap", "off");
  17.104 -    // if border: 0; -- iOS fails to open keyboard (issue #1287)
  17.105 -    if (ios) input.style.border = "1px solid black";
  17.106 -    input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false");
  17.107 -
  17.108 -    // Wraps and hides input textarea
  17.109 -    d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
  17.110 -    // The actual fake scrollbars.
  17.111 -    d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar");
  17.112 -    d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar");
  17.113 -    d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
  17.114 -    d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
  17.115 -    // DIVs containing the selection and the actual code
  17.116 -    d.lineDiv = elt("div", null, "CodeMirror-code");
  17.117 -    d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
  17.118 -    // Blinky cursor, and element used to ensure cursor fits at the end of a line
  17.119 -    d.cursor = elt("div", "\u00a0", "CodeMirror-cursor");
  17.120 -    // Secondary cursor, shown when on a 'jump' in bi-directional text
  17.121 -    d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor");
  17.122 -    // Used to measure text size
  17.123 -    d.measure = elt("div", null, "CodeMirror-measure");
  17.124 -    // Wraps everything that needs to exist inside the vertically-padded coordinate system
  17.125 -    d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],
  17.126 -                         null, "position: relative; outline: none");
  17.127 -    // Moved around its parent to cover visible view
  17.128 -    d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
  17.129 -    // Set to the height of the text, causes scrolling
  17.130 -    d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
  17.131 -    // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers
  17.132 -    d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;");
  17.133 -    // Will contain the gutters, if any
  17.134 -    d.gutters = elt("div", null, "CodeMirror-gutters");
  17.135 -    d.lineGutter = null;
  17.136 -    // Provides scrolling
  17.137 -    d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
  17.138 -    d.scroller.setAttribute("tabIndex", "-1");
  17.139 -    // The element in which the editor lives.
  17.140 -    d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV,
  17.141 -                            d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
  17.142 -    // Work around IE7 z-index bug
  17.143 -    if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
  17.144 -    if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);
  17.145 -
  17.146 -    // Needed to hide big blue blinking cursor on Mobile Safari
  17.147 -    if (ios) input.style.width = "0px";
  17.148 -    if (!webkit) d.scroller.draggable = true;
  17.149 -    // Needed to handle Tab key in KHTML
  17.150 -    if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; }
  17.151 -    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
  17.152 -    else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px";
  17.153 -
  17.154 -    // Current visible range (may be bigger than the view window).
  17.155 -    d.viewOffset = d.lastSizeC = 0;
  17.156 -    d.showingFrom = d.showingTo = docStart;
  17.157 -
  17.158 -    // Used to only resize the line number gutter when necessary (when
  17.159 -    // the amount of lines crosses a boundary that makes its width change)
  17.160 -    d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
  17.161 -    // See readInput and resetInput
  17.162 -    d.prevInput = "";
  17.163 -    // Set to true when a non-horizontal-scrolling widget is added. As
  17.164 -    // an optimization, widget aligning is skipped when d is false.
  17.165 -    d.alignWidgets = false;
  17.166 -    // Flag that indicates whether we currently expect input to appear
  17.167 -    // (after some event like 'keypress' or 'input') and are polling
  17.168 -    // intensively.
  17.169 -    d.pollingFast = false;
  17.170 -    // Self-resetting timeout for the poller
  17.171 -    d.poll = new Delayed();
  17.172 -
  17.173 -    d.cachedCharWidth = d.cachedTextHeight = null;
  17.174 -    d.measureLineCache = [];
  17.175 -    d.measureLineCachePos = 0;
  17.176 -
  17.177 -    // Tracks when resetInput has punted to just putting a short
  17.178 -    // string instead of the (large) selection.
  17.179 -    d.inaccurateSelection = false;
  17.180 -
  17.181 -    // Tracks the maximum line length so that the horizontal scrollbar
  17.182 -    // can be kept static when scrolling.
  17.183 -    d.maxLine = null;
  17.184 -    d.maxLineLength = 0;
  17.185 -    d.maxLineChanged = false;
  17.186 -
  17.187 -    // Used for measuring wheel scrolling granularity
  17.188 -    d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
  17.189 -
  17.190 -    return d;
  17.191 -  }
  17.192 -
  17.193 -  // STATE UPDATES
  17.194 -
  17.195 -  // Used to get the editor into a consistent state again when options change.
  17.196 -
  17.197 -  function loadMode(cm) {
  17.198 -    cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
  17.199 -    cm.doc.iter(function(line) {
  17.200 -      if (line.stateAfter) line.stateAfter = null;
  17.201 -      if (line.styles) line.styles = null;
  17.202 -    });
  17.203 -    cm.doc.frontier = cm.doc.first;
  17.204 -    startWorker(cm, 100);
  17.205 -    cm.state.modeGen++;
  17.206 -    if (cm.curOp) regChange(cm);
  17.207 -  }
  17.208 -
  17.209 -  function wrappingChanged(cm) {
  17.210 -    if (cm.options.lineWrapping) {
  17.211 -      cm.display.wrapper.className += " CodeMirror-wrap";
  17.212 -      cm.display.sizer.style.minWidth = "";
  17.213 -    } else {
  17.214 -      cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", "");
  17.215 -      computeMaxLength(cm);
  17.216 -    }
  17.217 -    estimateLineHeights(cm);
  17.218 -    regChange(cm);
  17.219 -    clearCaches(cm);
  17.220 -    setTimeout(function(){updateScrollbars(cm);}, 100);
  17.221 -  }
  17.222 -
  17.223 -  function estimateHeight(cm) {
  17.224 -    var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
  17.225 -    var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
  17.226 -    return function(line) {
  17.227 -      if (lineIsHidden(cm.doc, line))
  17.228 -        return 0;
  17.229 -      else if (wrapping)
  17.230 -        return (Math.ceil(line.text.length / perLine) || 1) * th;
  17.231 -      else
  17.232 -        return th;
  17.233 -    };
  17.234 -  }
  17.235 -
  17.236 -  function estimateLineHeights(cm) {
  17.237 -    var doc = cm.doc, est = estimateHeight(cm);
  17.238 -    doc.iter(function(line) {
  17.239 -      var estHeight = est(line);
  17.240 -      if (estHeight != line.height) updateLineHeight(line, estHeight);
  17.241 -    });
  17.242 -  }
  17.243 -
  17.244 -  function keyMapChanged(cm) {
  17.245 -    var map = keyMap[cm.options.keyMap], style = map.style;
  17.246 -    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") +
  17.247 -      (style ? " cm-keymap-" + style : "");
  17.248 -    cm.state.disableInput = map.disableInput;
  17.249 -  }
  17.250 -
  17.251 -  function themeChanged(cm) {
  17.252 -    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
  17.253 -      cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
  17.254 -    clearCaches(cm);
  17.255 -  }
  17.256 -
  17.257 -  function guttersChanged(cm) {
  17.258 -    updateGutters(cm);
  17.259 -    regChange(cm);
  17.260 -    setTimeout(function(){alignHorizontally(cm);}, 20);
  17.261 -  }
  17.262 -
  17.263 -  function updateGutters(cm) {
  17.264 -    var gutters = cm.display.gutters, specs = cm.options.gutters;
  17.265 -    removeChildren(gutters);
  17.266 -    for (var i = 0; i < specs.length; ++i) {
  17.267 -      var gutterClass = specs[i];
  17.268 -      var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
  17.269 -      if (gutterClass == "CodeMirror-linenumbers") {
  17.270 -        cm.display.lineGutter = gElt;
  17.271 -        gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
  17.272 -      }
  17.273 -    }
  17.274 -    gutters.style.display = i ? "" : "none";
  17.275 -  }
  17.276 -
  17.277 -  function lineLength(doc, line) {
  17.278 -    if (line.height == 0) return 0;
  17.279 -    var len = line.text.length, merged, cur = line;
  17.280 -    while (merged = collapsedSpanAtStart(cur)) {
  17.281 -      var found = merged.find();
  17.282 -      cur = getLine(doc, found.from.line);
  17.283 -      len += found.from.ch - found.to.ch;
  17.284 -    }
  17.285 -    cur = line;
  17.286 -    while (merged = collapsedSpanAtEnd(cur)) {
  17.287 -      var found = merged.find();
  17.288 -      len -= cur.text.length - found.from.ch;
  17.289 -      cur = getLine(doc, found.to.line);
  17.290 -      len += cur.text.length - found.to.ch;
  17.291 -    }
  17.292 -    return len;
  17.293 -  }
  17.294 -
  17.295 -  function computeMaxLength(cm) {
  17.296 -    var d = cm.display, doc = cm.doc;
  17.297 -    d.maxLine = getLine(doc, doc.first);
  17.298 -    d.maxLineLength = lineLength(doc, d.maxLine);
  17.299 -    d.maxLineChanged = true;
  17.300 -    doc.iter(function(line) {
  17.301 -      var len = lineLength(doc, line);
  17.302 -      if (len > d.maxLineLength) {
  17.303 -        d.maxLineLength = len;
  17.304 -        d.maxLine = line;
  17.305 -      }
  17.306 -    });
  17.307 -  }
  17.308 -
  17.309 -  // Make sure the gutters options contains the element
  17.310 -  // "CodeMirror-linenumbers" when the lineNumbers option is true.
  17.311 -  function setGuttersForLineNumbers(options) {
  17.312 -    var found = indexOf(options.gutters, "CodeMirror-linenumbers");
  17.313 -    if (found == -1 && options.lineNumbers) {
  17.314 -      options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
  17.315 -    } else if (found > -1 && !options.lineNumbers) {
  17.316 -      options.gutters = options.gutters.slice(0);
  17.317 -      options.gutters.splice(found, 1);
  17.318 -    }
  17.319 -  }
  17.320 -
  17.321 -  // SCROLLBARS
  17.322 -
  17.323 -  // Re-synchronize the fake scrollbars with the actual size of the
  17.324 -  // content. Optionally force a scrollTop.
  17.325 -  function updateScrollbars(cm) {
  17.326 -    var d = cm.display, docHeight = cm.doc.height;
  17.327 -    var totalHeight = docHeight + paddingVert(d);
  17.328 -    d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
  17.329 -    d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
  17.330 -    var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);
  17.331 -    var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);
  17.332 -    var needsV = scrollHeight > (d.scroller.clientHeight + 1);
  17.333 -    if (needsV) {
  17.334 -      d.scrollbarV.style.display = "block";
  17.335 -      d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0";
  17.336 -      d.scrollbarV.firstChild.style.height =
  17.337 -        (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";
  17.338 -    } else {
  17.339 -      d.scrollbarV.style.display = "";
  17.340 -      d.scrollbarV.firstChild.style.height = "0";
  17.341 -    }
  17.342 -    if (needsH) {
  17.343 -      d.scrollbarH.style.display = "block";
  17.344 -      d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0";
  17.345 -      d.scrollbarH.firstChild.style.width =
  17.346 -        (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px";
  17.347 -    } else {
  17.348 -      d.scrollbarH.style.display = "";
  17.349 -      d.scrollbarH.firstChild.style.width = "0";
  17.350 -    }
  17.351 -    if (needsH && needsV) {
  17.352 -      d.scrollbarFiller.style.display = "block";
  17.353 -      d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px";
  17.354 -    } else d.scrollbarFiller.style.display = "";
  17.355 -    if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
  17.356 -      d.gutterFiller.style.display = "block";
  17.357 -      d.gutterFiller.style.height = scrollbarWidth(d.measure) + "px";
  17.358 -      d.gutterFiller.style.width = d.gutters.offsetWidth + "px";
  17.359 -    } else d.gutterFiller.style.display = "";
  17.360 -
  17.361 -    if (mac_geLion && scrollbarWidth(d.measure) === 0) {
  17.362 -      d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";
  17.363 -      d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = "none";
  17.364 -    }
  17.365 -  }
  17.366 -
  17.367 -  function visibleLines(display, doc, viewPort) {
  17.368 -    var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;
  17.369 -    if (typeof viewPort == "number") top = viewPort;
  17.370 -    else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}
  17.371 -    top = Math.floor(top - paddingTop(display));
  17.372 -    var bottom = Math.ceil(top + height);
  17.373 -    return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};
  17.374 -  }
  17.375 -
  17.376 -  // LINE NUMBERS
  17.377 -
  17.378 -  function alignHorizontally(cm) {
  17.379 -    var display = cm.display;
  17.380 -    if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
  17.381 -    var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
  17.382 -    var gutterW = display.gutters.offsetWidth, l = comp + "px";
  17.383 -    for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {
  17.384 -      for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;
  17.385 -    }
  17.386 -    if (cm.options.fixedGutter)
  17.387 -      display.gutters.style.left = (comp + gutterW) + "px";
  17.388 -  }
  17.389 -
  17.390 -  function maybeUpdateLineNumberWidth(cm) {
  17.391 -    if (!cm.options.lineNumbers) return false;
  17.392 -    var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
  17.393 -    if (last.length != display.lineNumChars) {
  17.394 -      var test = display.measure.appendChild(elt("div", [elt("div", last)],
  17.395 -                                                 "CodeMirror-linenumber CodeMirror-gutter-elt"));
  17.396 -      var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
  17.397 -      display.lineGutter.style.width = "";
  17.398 -      display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);
  17.399 -      display.lineNumWidth = display.lineNumInnerWidth + padding;
  17.400 -      display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
  17.401 -      display.lineGutter.style.width = display.lineNumWidth + "px";
  17.402 -      return true;
  17.403 -    }
  17.404 -    return false;
  17.405 -  }
  17.406 -
  17.407 -  function lineNumberFor(options, i) {
  17.408 -    return String(options.lineNumberFormatter(i + options.firstLineNumber));
  17.409 -  }
  17.410 -  function compensateForHScroll(display) {
  17.411 -    return getRect(display.scroller).left - getRect(display.sizer).left;
  17.412 -  }
  17.413 -
  17.414 -  // DISPLAY DRAWING
  17.415 -
  17.416 -  function updateDisplay(cm, changes, viewPort, forced) {
  17.417 -    var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;
  17.418 -    var visible = visibleLines(cm.display, cm.doc, viewPort);
  17.419 -    for (var first = true;; first = false) {
  17.420 -      var oldWidth = cm.display.scroller.clientWidth;
  17.421 -      if (!updateDisplayInner(cm, changes, visible, forced)) break;
  17.422 -      updated = true;
  17.423 -      changes = [];
  17.424 -      updateSelection(cm);
  17.425 -      updateScrollbars(cm);
  17.426 -      if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) {
  17.427 -        forced = true;
  17.428 -        continue;
  17.429 -      }
  17.430 -      forced = false;
  17.431 -
  17.432 -      // Clip forced viewport to actual scrollable area
  17.433 -      if (viewPort)
  17.434 -        viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight,
  17.435 -                            typeof viewPort == "number" ? viewPort : viewPort.top);
  17.436 -      visible = visibleLines(cm.display, cm.doc, viewPort);
  17.437 -      if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)
  17.438 -        break;
  17.439 -    }
  17.440 -
  17.441 -    if (updated) {
  17.442 -      signalLater(cm, "update", cm);
  17.443 -      if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)
  17.444 -        signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo);
  17.445 -    }
  17.446 -    return updated;
  17.447 -  }
  17.448 -
  17.449 -  // Uses a set of changes plus the current scroll position to
  17.450 -  // determine which DOM updates have to be made, and makes the
  17.451 -  // updates.
  17.452 -  function updateDisplayInner(cm, changes, visible, forced) {
  17.453 -    var display = cm.display, doc = cm.doc;
  17.454 -    if (!display.wrapper.clientWidth) {
  17.455 -      display.showingFrom = display.showingTo = doc.first;
  17.456 -      display.viewOffset = 0;
  17.457 -      return;
  17.458 -    }
  17.459 -
  17.460 -    // Bail out if the visible area is already rendered and nothing changed.
  17.461 -    if (!forced && changes.length == 0 &&
  17.462 -        visible.from > display.showingFrom && visible.to < display.showingTo)
  17.463 -      return;
  17.464 -
  17.465 -    if (maybeUpdateLineNumberWidth(cm))
  17.466 -      changes = [{from: doc.first, to: doc.first + doc.size}];
  17.467 -    var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px";
  17.468 -    display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0";
  17.469 -
  17.470 -    // Used to determine which lines need their line numbers updated
  17.471 -    var positionsChangedFrom = Infinity;
  17.472 -    if (cm.options.lineNumbers)
  17.473 -      for (var i = 0; i < changes.length; ++i)
  17.474 -        if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }
  17.475 -
  17.476 -    var end = doc.first + doc.size;
  17.477 -    var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);
  17.478 -    var to = Math.min(end, visible.to + cm.options.viewportMargin);
  17.479 -    if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);
  17.480 -    if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);
  17.481 -    if (sawCollapsedSpans) {
  17.482 -      from = lineNo(visualLine(doc, getLine(doc, from)));
  17.483 -      while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;
  17.484 -    }
  17.485 -
  17.486 -    // Create a range of theoretically intact lines, and punch holes
  17.487 -    // in that using the change info.
  17.488 -    var intact = [{from: Math.max(display.showingFrom, doc.first),
  17.489 -                   to: Math.min(display.showingTo, end)}];
  17.490 -    if (intact[0].from >= intact[0].to) intact = [];
  17.491 -    else intact = computeIntact(intact, changes);
  17.492 -    // When merged lines are present, we might have to reduce the
  17.493 -    // intact ranges because changes in continued fragments of the
  17.494 -    // intact lines do require the lines to be redrawn.
  17.495 -    if (sawCollapsedSpans)
  17.496 -      for (var i = 0; i < intact.length; ++i) {
  17.497 -        var range = intact[i], merged;
  17.498 -        while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {
  17.499 -          var newTo = merged.find().from.line;
  17.500 -          if (newTo > range.from) range.to = newTo;
  17.501 -          else { intact.splice(i--, 1); break; }
  17.502 -        }
  17.503 -      }
  17.504 -
  17.505 -    // Clip off the parts that won't be visible
  17.506 -    var intactLines = 0;
  17.507 -    for (var i = 0; i < intact.length; ++i) {
  17.508 -      var range = intact[i];
  17.509 -      if (range.from < from) range.from = from;
  17.510 -      if (range.to > to) range.to = to;
  17.511 -      if (range.from >= range.to) intact.splice(i--, 1);
  17.512 -      else intactLines += range.to - range.from;
  17.513 -    }
  17.514 -    if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {
  17.515 -      updateViewOffset(cm);
  17.516 -      return;
  17.517 -    }
  17.518 -    intact.sort(function(a, b) {return a.from - b.from;});
  17.519 -
  17.520 -    // Avoid crashing on IE's "unspecified error" when in iframes
  17.521 -    try {
  17.522 -      var focused = document.activeElement;
  17.523 -    } catch(e) {}
  17.524 -    if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none";
  17.525 -    patchDisplay(cm, from, to, intact, positionsChangedFrom);
  17.526 -    display.lineDiv.style.display = "";
  17.527 -    if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();
  17.528 -
  17.529 -    var different = from != display.showingFrom || to != display.showingTo ||
  17.530 -      display.lastSizeC != display.wrapper.clientHeight;
  17.531 -    // This is just a bogus formula that detects when the editor is
  17.532 -    // resized or the font size changes.
  17.533 -    if (different) {
  17.534 -      display.lastSizeC = display.wrapper.clientHeight;
  17.535 -      startWorker(cm, 400);
  17.536 -    }
  17.537 -    display.showingFrom = from; display.showingTo = to;
  17.538 -
  17.539 -    updateHeightsInViewport(cm);
  17.540 -    updateViewOffset(cm);
  17.541 -
  17.542 -    return true;
  17.543 -  }
  17.544 -
  17.545 -  function updateHeightsInViewport(cm) {
  17.546 -    var display = cm.display;
  17.547 -    var prevBottom = display.lineDiv.offsetTop;
  17.548 -    for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {
  17.549 -      if (ie_lt8) {
  17.550 -        var bot = node.offsetTop + node.offsetHeight;
  17.551 -        height = bot - prevBottom;
  17.552 -        prevBottom = bot;
  17.553 -      } else {
  17.554 -        var box = getRect(node);
  17.555 -        height = box.bottom - box.top;
  17.556 -      }
  17.557 -      var diff = node.lineObj.height - height;
  17.558 -      if (height < 2) height = textHeight(display);
  17.559 -      if (diff > .001 || diff < -.001) {
  17.560 -        updateLineHeight(node.lineObj, height);
  17.561 -        var widgets = node.lineObj.widgets;
  17.562 -        if (widgets) for (var i = 0; i < widgets.length; ++i)
  17.563 -          widgets[i].height = widgets[i].node.offsetHeight;
  17.564 -      }
  17.565 -    }
  17.566 -  }
  17.567 -
  17.568 -  function updateViewOffset(cm) {
  17.569 -    var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom));
  17.570 -    // Position the mover div to align with the current virtual scroll position
  17.571 -    cm.display.mover.style.top = off + "px";
  17.572 -  }
  17.573 -
  17.574 -  function computeIntact(intact, changes) {
  17.575 -    for (var i = 0, l = changes.length || 0; i < l; ++i) {
  17.576 -      var change = changes[i], intact2 = [], diff = change.diff || 0;
  17.577 -      for (var j = 0, l2 = intact.length; j < l2; ++j) {
  17.578 -        var range = intact[j];
  17.579 -        if (change.to <= range.from && change.diff) {
  17.580 -          intact2.push({from: range.from + diff, to: range.to + diff});
  17.581 -        } else if (change.to <= range.from || change.from >= range.to) {
  17.582 -          intact2.push(range);
  17.583 -        } else {
  17.584 -          if (change.from > range.from)
  17.585 -            intact2.push({from: range.from, to: change.from});
  17.586 -          if (change.to < range.to)
  17.587 -            intact2.push({from: change.to + diff, to: range.to + diff});
  17.588 -        }
  17.589 -      }
  17.590 -      intact = intact2;
  17.591 -    }
  17.592 -    return intact;
  17.593 -  }
  17.594 -
  17.595 -  function getDimensions(cm) {
  17.596 -    var d = cm.display, left = {}, width = {};
  17.597 -    for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
  17.598 -      left[cm.options.gutters[i]] = n.offsetLeft;
  17.599 -      width[cm.options.gutters[i]] = n.offsetWidth;
  17.600 -    }
  17.601 -    return {fixedPos: compensateForHScroll(d),
  17.602 -            gutterTotalWidth: d.gutters.offsetWidth,
  17.603 -            gutterLeft: left,
  17.604 -            gutterWidth: width,
  17.605 -            wrapperWidth: d.wrapper.clientWidth};
  17.606 -  }
  17.607 -
  17.608 -  function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
  17.609 -    var dims = getDimensions(cm);
  17.610 -    var display = cm.display, lineNumbers = cm.options.lineNumbers;
  17.611 -    if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
  17.612 -      removeChildren(display.lineDiv);
  17.613 -    var container = display.lineDiv, cur = container.firstChild;
  17.614 -
  17.615 -    function rm(node) {
  17.616 -      var next = node.nextSibling;
  17.617 -      if (webkit && mac && cm.display.currentWheelTarget == node) {
  17.618 -        node.style.display = "none";
  17.619 -        node.lineObj = null;
  17.620 -      } else {
  17.621 -        node.parentNode.removeChild(node);
  17.622 -      }
  17.623 -      return next;
  17.624 -    }
  17.625 -
  17.626 -    var nextIntact = intact.shift(), lineN = from;
  17.627 -    cm.doc.iter(from, to, function(line) {
  17.628 -      if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();
  17.629 -      if (lineIsHidden(cm.doc, line)) {
  17.630 -        if (line.height != 0) updateLineHeight(line, 0);
  17.631 -        if (line.widgets && cur && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {
  17.632 -          var w = line.widgets[i];
  17.633 -          if (w.showIfHidden) {
  17.634 -            var prev = cur.previousSibling;
  17.635 -            if (/pre/i.test(prev.nodeName)) {
  17.636 -              var wrap = elt("div", null, null, "position: relative");
  17.637 -              prev.parentNode.replaceChild(wrap, prev);
  17.638 -              wrap.appendChild(prev);
  17.639 -              prev = wrap;
  17.640 -            }
  17.641 -            var wnode = prev.appendChild(elt("div", [w.node], "CodeMirror-linewidget"));
  17.642 -            if (!w.handleMouseEvents) wnode.ignoreEvents = true;
  17.643 -            positionLineWidget(w, wnode, prev, dims);
  17.644 -          }
  17.645 -        }
  17.646 -      } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) {
  17.647 -        // This line is intact. Skip to the actual node. Update its
  17.648 -        // line number if needed.
  17.649 -        while (cur.lineObj != line) cur = rm(cur);
  17.650 -        if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber)
  17.651 -          setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN));
  17.652 -        cur = cur.nextSibling;
  17.653 -      } else {
  17.654 -        // For lines with widgets, make an attempt to find and reuse
  17.655 -        // the existing element, so that widgets aren't needlessly
  17.656 -        // removed and re-inserted into the dom
  17.657 -        if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling)
  17.658 -          if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; }
  17.659 -        // This line needs to be generated.
  17.660 -        var lineNode = buildLineElement(cm, line, lineN, dims, reuse);
  17.661 -        if (lineNode != reuse) {
  17.662 -          container.insertBefore(lineNode, cur);
  17.663 -        } else {
  17.664 -          while (cur != reuse) cur = rm(cur);
  17.665 -          cur = cur.nextSibling;
  17.666 -        }
  17.667 -
  17.668 -        lineNode.lineObj = line;
  17.669 -      }
  17.670 -      ++lineN;
  17.671 -    });
  17.672 -    while (cur) cur = rm(cur);
  17.673 -  }
  17.674 -
  17.675 -  function buildLineElement(cm, line, lineNo, dims, reuse) {
  17.676 -    var built = buildLineContent(cm, line), lineElement = built.pre;
  17.677 -    var markers = line.gutterMarkers, display = cm.display, wrap;
  17.678 -
  17.679 -    var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass;
  17.680 -    if (!cm.options.lineNumbers && !markers && !bgClass && !line.wrapClass && !line.widgets)
  17.681 -      return lineElement;
  17.682 -
  17.683 -    // Lines with gutter elements, widgets or a background class need
  17.684 -    // to be wrapped again, and have the extra elements added to the
  17.685 -    // wrapper div
  17.686 -
  17.687 -    if (reuse) {
  17.688 -      reuse.alignable = null;
  17.689 -      var isOk = true, widgetsSeen = 0, insertBefore = null;
  17.690 -      for (var n = reuse.firstChild, next; n; n = next) {
  17.691 -        next = n.nextSibling;
  17.692 -        if (!/\bCodeMirror-linewidget\b/.test(n.className)) {
  17.693 -          reuse.removeChild(n);
  17.694 -        } else {
  17.695 -          for (var i = 0; i < line.widgets.length; ++i) {
  17.696 -            var widget = line.widgets[i];
  17.697 -            if (widget.node == n.firstChild) {
  17.698 -              if (!widget.above && !insertBefore) insertBefore = n;
  17.699 -              positionLineWidget(widget, n, reuse, dims);
  17.700 -              ++widgetsSeen;
  17.701 -              break;
  17.702 -            }
  17.703 -          }
  17.704 -          if (i == line.widgets.length) { isOk = false; break; }
  17.705 -        }
  17.706 -      }
  17.707 -      reuse.insertBefore(lineElement, insertBefore);
  17.708 -      if (isOk && widgetsSeen == line.widgets.length) {
  17.709 -        wrap = reuse;
  17.710 -        reuse.className = line.wrapClass || "";
  17.711 -      }
  17.712 -    }
  17.713 -    if (!wrap) {
  17.714 -      wrap = elt("div", null, line.wrapClass, "position: relative");
  17.715 -      wrap.appendChild(lineElement);
  17.716 -    }
  17.717 -    // Kludge to make sure the styled element lies behind the selection (by z-index)
  17.718 -    if (bgClass)
  17.719 -      wrap.insertBefore(elt("div", null, bgClass + " CodeMirror-linebackground"), wrap.firstChild);
  17.720 -    if (cm.options.lineNumbers || markers) {
  17.721 -      var gutterWrap = wrap.insertBefore(elt("div", null, null, "position: absolute; left: " +
  17.722 -                                             (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),
  17.723 -                                         wrap.firstChild);
  17.724 -      if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);
  17.725 -      if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
  17.726 -        wrap.lineNumber = gutterWrap.appendChild(
  17.727 -          elt("div", lineNumberFor(cm.options, lineNo),
  17.728 -              "CodeMirror-linenumber CodeMirror-gutter-elt",
  17.729 -              "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
  17.730 -              + display.lineNumInnerWidth + "px"));
  17.731 -      if (markers)
  17.732 -        for (var k = 0; k < cm.options.gutters.length; ++k) {
  17.733 -          var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
  17.734 -          if (found)
  17.735 -            gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
  17.736 -                                       dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
  17.737 -        }
  17.738 -    }
  17.739 -    if (ie_lt8) wrap.style.zIndex = 2;
  17.740 -    if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
  17.741 -      var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
  17.742 -      if (!widget.handleMouseEvents) node.ignoreEvents = true;
  17.743 -      positionLineWidget(widget, node, wrap, dims);
  17.744 -      if (widget.above)
  17.745 -        wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);
  17.746 -      else
  17.747 -        wrap.appendChild(node);
  17.748 -      signalLater(widget, "redraw");
  17.749 -    }
  17.750 -    return wrap;
  17.751 -  }
  17.752 -
  17.753 -  function positionLineWidget(widget, node, wrap, dims) {
  17.754 -    if (widget.noHScroll) {
  17.755 -      (wrap.alignable || (wrap.alignable = [])).push(node);
  17.756 -      var width = dims.wrapperWidth;
  17.757 -      node.style.left = dims.fixedPos + "px";
  17.758 -      if (!widget.coverGutter) {
  17.759 -        width -= dims.gutterTotalWidth;
  17.760 -        node.style.paddingLeft = dims.gutterTotalWidth + "px";
  17.761 -      }
  17.762 -      node.style.width = width + "px";
  17.763 -    }
  17.764 -    if (widget.coverGutter) {
  17.765 -      node.style.zIndex = 5;
  17.766 -      node.style.position = "relative";
  17.767 -      if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
  17.768 -    }
  17.769 -  }
  17.770 -
  17.771 -  // SELECTION / CURSOR
  17.772 -
  17.773 -  function updateSelection(cm) {
  17.774 -    var display = cm.display;
  17.775 -    var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to);
  17.776 -    if (collapsed || cm.options.showCursorWhenSelecting)
  17.777 -      updateSelectionCursor(cm);
  17.778 -    else
  17.779 -      display.cursor.style.display = display.otherCursor.style.display = "none";
  17.780 -    if (!collapsed)
  17.781 -      updateSelectionRange(cm);
  17.782 -    else
  17.783 -      display.selectionDiv.style.display = "none";
  17.784 -
  17.785 -    // Move the hidden textarea near the cursor to prevent scrolling artifacts
  17.786 -    if (cm.options.moveInputWithCursor) {
  17.787 -      var headPos = cursorCoords(cm, cm.doc.sel.head, "div");
  17.788 -      var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv);
  17.789 -      display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
  17.790 -                                                        headPos.top + lineOff.top - wrapOff.top)) + "px";
  17.791 -      display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
  17.792 -                                                         headPos.left + lineOff.left - wrapOff.left)) + "px";
  17.793 -    }
  17.794 -  }
  17.795 -
  17.796 -  // No selection, plain cursor
  17.797 -  function updateSelectionCursor(cm) {
  17.798 -    var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div");
  17.799 -    display.cursor.style.left = pos.left + "px";
  17.800 -    display.cursor.style.top = pos.top + "px";
  17.801 -    display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
  17.802 -    display.cursor.style.display = "";
  17.803 -
  17.804 -    if (pos.other) {
  17.805 -      display.otherCursor.style.display = "";
  17.806 -      display.otherCursor.style.left = pos.other.left + "px";
  17.807 -      display.otherCursor.style.top = pos.other.top + "px";
  17.808 -      display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
  17.809 -    } else { display.otherCursor.style.display = "none"; }
  17.810 -  }
  17.811 -
  17.812 -  // Highlight selection
  17.813 -  function updateSelectionRange(cm) {
  17.814 -    var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
  17.815 -    var fragment = document.createDocumentFragment();
  17.816 -    var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);
  17.817 -
  17.818 -    function add(left, top, width, bottom) {
  17.819 -      if (top < 0) top = 0;
  17.820 -      fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
  17.821 -                               "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) +
  17.822 -                               "px; height: " + (bottom - top) + "px"));
  17.823 -    }
  17.824 -
  17.825 -    function drawForLine(line, fromArg, toArg) {
  17.826 -      var lineObj = getLine(doc, line);
  17.827 -      var lineLen = lineObj.text.length;
  17.828 -      var start, end;
  17.829 -      function coords(ch, bias) {
  17.830 -        return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
  17.831 -      }
  17.832 -
  17.833 -      iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {
  17.834 -        var leftPos = coords(from, "left"), rightPos, left, right;
  17.835 -        if (from == to) {
  17.836 -          rightPos = leftPos;
  17.837 -          left = right = leftPos.left;
  17.838 -        } else {
  17.839 -          rightPos = coords(to - 1, "right");
  17.840 -          if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }
  17.841 -          left = leftPos.left;
  17.842 -          right = rightPos.right;
  17.843 -        }
  17.844 -        if (fromArg == null && from == 0) left = pl;
  17.845 -        if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
  17.846 -          add(left, leftPos.top, null, leftPos.bottom);
  17.847 -          left = pl;
  17.848 -          if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);
  17.849 -        }
  17.850 -        if (toArg == null && to == lineLen) right = clientWidth;
  17.851 -        if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
  17.852 -          start = leftPos;
  17.853 -        if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
  17.854 -          end = rightPos;
  17.855 -        if (left < pl + 1) left = pl;
  17.856 -        add(left, rightPos.top, right - left, rightPos.bottom);
  17.857 -      });
  17.858 -      return {start: start, end: end};
  17.859 -    }
  17.860 -
  17.861 -    if (sel.from.line == sel.to.line) {
  17.862 -      drawForLine(sel.from.line, sel.from.ch, sel.to.ch);
  17.863 -    } else {
  17.864 -      var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line);
  17.865 -      var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine);
  17.866 -      var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end;
  17.867 -      var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start;
  17.868 -      if (singleVLine) {
  17.869 -        if (leftEnd.top < rightStart.top - 2) {
  17.870 -          add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
  17.871 -          add(pl, rightStart.top, rightStart.left, rightStart.bottom);
  17.872 -        } else {
  17.873 -          add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
  17.874 -        }
  17.875 -      }
  17.876 -      if (leftEnd.bottom < rightStart.top)
  17.877 -        add(pl, leftEnd.bottom, null, rightStart.top);
  17.878 -    }
  17.879 -
  17.880 -    removeChildrenAndAdd(display.selectionDiv, fragment);
  17.881 -    display.selectionDiv.style.display = "";
  17.882 -  }
  17.883 -
  17.884 -  // Cursor-blinking
  17.885 -  function restartBlink(cm) {
  17.886 -    if (!cm.state.focused) return;
  17.887 -    var display = cm.display;
  17.888 -    clearInterval(display.blinker);
  17.889 -    var on = true;
  17.890 -    display.cursor.style.visibility = display.otherCursor.style.visibility = "";
  17.891 -    if (cm.options.cursorBlinkRate > 0)
  17.892 -      display.blinker = setInterval(function() {
  17.893 -        display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";
  17.894 -      }, cm.options.cursorBlinkRate);
  17.895 -  }
  17.896 -
  17.897 -  // HIGHLIGHT WORKER
  17.898 -
  17.899 -  function startWorker(cm, time) {
  17.900 -    if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo)
  17.901 -      cm.state.highlight.set(time, bind(highlightWorker, cm));
  17.902 -  }
  17.903 -
  17.904 -  function highlightWorker(cm) {
  17.905 -    var doc = cm.doc;
  17.906 -    if (doc.frontier < doc.first) doc.frontier = doc.first;
  17.907 -    if (doc.frontier >= cm.display.showingTo) return;
  17.908 -    var end = +new Date + cm.options.workTime;
  17.909 -    var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
  17.910 -    var changed = [], prevChange;
  17.911 -    doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {
  17.912 -      if (doc.frontier >= cm.display.showingFrom) { // Visible
  17.913 -        var oldStyles = line.styles;
  17.914 -        line.styles = highlightLine(cm, line, state);
  17.915 -        var ischange = !oldStyles || oldStyles.length != line.styles.length;
  17.916 -        for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
  17.917 -        if (ischange) {
  17.918 -          if (prevChange && prevChange.end == doc.frontier) prevChange.end++;
  17.919 -          else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1});
  17.920 -        }
  17.921 -        line.stateAfter = copyState(doc.mode, state);
  17.922 -      } else {
  17.923 -        processLine(cm, line, state);
  17.924 -        line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
  17.925 -      }
  17.926 -      ++doc.frontier;
  17.927 -      if (+new Date > end) {
  17.928 -        startWorker(cm, cm.options.workDelay);
  17.929 -        return true;
  17.930 -      }
  17.931 -    });
  17.932 -    if (changed.length)
  17.933 -      operation(cm, function() {
  17.934 -        for (var i = 0; i < changed.length; ++i)
  17.935 -          regChange(this, changed[i].start, changed[i].end);
  17.936 -      })();
  17.937 -  }
  17.938 -
  17.939 -  // Finds the line to start with when starting a parse. Tries to
  17.940 -  // find a line with a stateAfter, so that it can start with a
  17.941 -  // valid state. If that fails, it returns the line with the
  17.942 -  // smallest indentation, which tends to need the least context to
  17.943 -  // parse correctly.
  17.944 -  function findStartLine(cm, n, precise) {
  17.945 -    var minindent, minline, doc = cm.doc;
  17.946 -    var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
  17.947 -    for (var search = n; search > lim; --search) {
  17.948 -      if (search <= doc.first) return doc.first;
  17.949 -      var line = getLine(doc, search - 1);
  17.950 -      if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
  17.951 -      var indented = countColumn(line.text, null, cm.options.tabSize);
  17.952 -      if (minline == null || minindent > indented) {
  17.953 -        minline = search - 1;
  17.954 -        minindent = indented;
  17.955 -      }
  17.956 -    }
  17.957 -    return minline;
  17.958 -  }
  17.959 -
  17.960 -  function getStateBefore(cm, n, precise) {
  17.961 -    var doc = cm.doc, display = cm.display;
  17.962 -    if (!doc.mode.startState) return true;
  17.963 -    var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
  17.964 -    if (!state) state = startState(doc.mode);
  17.965 -    else state = copyState(doc.mode, state);
  17.966 -    doc.iter(pos, n, function(line) {
  17.967 -      processLine(cm, line, state);
  17.968 -      var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;
  17.969 -      line.stateAfter = save ? copyState(doc.mode, state) : null;
  17.970 -      ++pos;
  17.971 -    });
  17.972 -    if (precise) doc.frontier = pos;
  17.973 -    return state;
  17.974 -  }
  17.975 -
  17.976 -  // POSITION MEASUREMENT
  17.977 -
  17.978 -  function paddingTop(display) {return display.lineSpace.offsetTop;}
  17.979 -  function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
  17.980 -  function paddingLeft(display) {
  17.981 -    var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x"));
  17.982 -    return e.offsetLeft;
  17.983 -  }
  17.984 -
  17.985 -  function measureChar(cm, line, ch, data, bias) {
  17.986 -    var dir = -1;
  17.987 -    data = data || measureLine(cm, line);
  17.988 -    if (data.crude) {
  17.989 -      var left = data.left + ch * data.width;
  17.990 -      return {left: left, right: left + data.width, top: data.top, bottom: data.bottom};
  17.991 -    }
  17.992 -
  17.993 -    for (var pos = ch;; pos += dir) {
  17.994 -      var r = data[pos];
  17.995 -      if (r) break;
  17.996 -      if (dir < 0 && pos == 0) dir = 1;
  17.997 -    }
  17.998 -    bias = pos > ch ? "left" : pos < ch ? "right" : bias;
  17.999 -    if (bias == "left" && r.leftSide) r = r.leftSide;
 17.1000 -    else if (bias == "right" && r.rightSide) r = r.rightSide;
 17.1001 -    return {left: pos < ch ? r.right : r.left,
 17.1002 -            right: pos > ch ? r.left : r.right,
 17.1003 -            top: r.top,
 17.1004 -            bottom: r.bottom};
 17.1005 -  }
 17.1006 -
 17.1007 -  function findCachedMeasurement(cm, line) {
 17.1008 -    var cache = cm.display.measureLineCache;
 17.1009 -    for (var i = 0; i < cache.length; ++i) {
 17.1010 -      var memo = cache[i];
 17.1011 -      if (memo.text == line.text && memo.markedSpans == line.markedSpans &&
 17.1012 -          cm.display.scroller.clientWidth == memo.width &&
 17.1013 -          memo.classes == line.textClass + "|" + line.wrapClass)
 17.1014 -        return memo;
 17.1015 -    }
 17.1016 -  }
 17.1017 -
 17.1018 -  function clearCachedMeasurement(cm, line) {
 17.1019 -    var exists = findCachedMeasurement(cm, line);
 17.1020 -    if (exists) exists.text = exists.measure = exists.markedSpans = null;
 17.1021 -  }
 17.1022 -
 17.1023 -  function measureLine(cm, line) {
 17.1024 -    // First look in the cache
 17.1025 -    var cached = findCachedMeasurement(cm, line);
 17.1026 -    if (cached) return cached.measure;
 17.1027 -
 17.1028 -    // Failing that, recompute and store result in cache
 17.1029 -    var measure = measureLineInner(cm, line);
 17.1030 -    var cache = cm.display.measureLineCache;
 17.1031 -    var memo = {text: line.text, width: cm.display.scroller.clientWidth,
 17.1032 -                markedSpans: line.markedSpans, measure: measure,
 17.1033 -                classes: line.textClass + "|" + line.wrapClass};
 17.1034 -    if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;
 17.1035 -    else cache.push(memo);
 17.1036 -    return measure;
 17.1037 -  }
 17.1038 -
 17.1039 -  function measureLineInner(cm, line) {
 17.1040 -    if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom)
 17.1041 -      return crudelyMeasureLine(cm, line);
 17.1042 -
 17.1043 -    var display = cm.display, measure = emptyArray(line.text.length);
 17.1044 -    var pre = buildLineContent(cm, line, measure, true).pre;
 17.1045 -
 17.1046 -    // IE does not cache element positions of inline elements between
 17.1047 -    // calls to getBoundingClientRect. This makes the loop below,
 17.1048 -    // which gathers the positions of all the characters on the line,
 17.1049 -    // do an amount of layout work quadratic to the number of
 17.1050 -    // characters. When line wrapping is off, we try to improve things
 17.1051 -    // by first subdividing the line into a bunch of inline blocks, so
 17.1052 -    // that IE can reuse most of the layout information from caches
 17.1053 -    // for those blocks. This does interfere with line wrapping, so it
 17.1054 -    // doesn't work when wrapping is on, but in that case the
 17.1055 -    // situation is slightly better, since IE does cache line-wrapping
 17.1056 -    // information and only recomputes per-line.
 17.1057 -    if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {
 17.1058 -      var fragment = document.createDocumentFragment();
 17.1059 -      var chunk = 10, n = pre.childNodes.length;
 17.1060 -      for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {
 17.1061 -        var wrap = elt("div", null, null, "display: inline-block");
 17.1062 -        for (var j = 0; j < chunk && n; ++j) {
 17.1063 -          wrap.appendChild(pre.firstChild);
 17.1064 -          --n;
 17.1065 -        }
 17.1066 -        fragment.appendChild(wrap);
 17.1067 -      }
 17.1068 -      pre.appendChild(fragment);
 17.1069 -    }
 17.1070 -
 17.1071 -    removeChildrenAndAdd(display.measure, pre);
 17.1072 -
 17.1073 -    var outer = getRect(display.lineDiv);
 17.1074 -    var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;
 17.1075 -    // Work around an IE7/8 bug where it will sometimes have randomly
 17.1076 -    // replaced our pre with a clone at this point.
 17.1077 -    if (ie_lt9 && display.measure.first != pre)
 17.1078 -      removeChildrenAndAdd(display.measure, pre);
 17.1079 -
 17.1080 -    function measureRect(rect) {
 17.1081 -      var top = rect.top - outer.top, bot = rect.bottom - outer.top;
 17.1082 -      if (bot > maxBot) bot = maxBot;
 17.1083 -      if (top < 0) top = 0;
 17.1084 -      for (var i = vranges.length - 2; i >= 0; i -= 2) {
 17.1085 -        var rtop = vranges[i], rbot = vranges[i+1];
 17.1086 -        if (rtop > bot || rbot < top) continue;
 17.1087 -        if (rtop <= top && rbot >= bot ||
 17.1088 -            top <= rtop && bot >= rbot ||
 17.1089 -            Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {
 17.1090 -          vranges[i] = Math.min(top, rtop);
 17.1091 -          vranges[i+1] = Math.max(bot, rbot);
 17.1092 -          break;
 17.1093 -        }
 17.1094 -      }
 17.1095 -      if (i < 0) { i = vranges.length; vranges.push(top, bot); }
 17.1096 -      return {left: rect.left - outer.left,
 17.1097 -              right: rect.right - outer.left,
 17.1098 -              top: i, bottom: null};
 17.1099 -    }
 17.1100 -    function finishRect(rect) {
 17.1101 -      rect.bottom = vranges[rect.top+1];
 17.1102 -      rect.top = vranges[rect.top];
 17.1103 -    }
 17.1104 -
 17.1105 -    for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {
 17.1106 -      var node = cur, rect = null;
 17.1107 -      // A widget might wrap, needs special care
 17.1108 -      if (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) {
 17.1109 -        if (cur.firstChild.nodeType == 1) node = cur.firstChild;
 17.1110 -        var rects = node.getClientRects();
 17.1111 -        if (rects.length > 1) {
 17.1112 -          rect = data[i] = measureRect(rects[0]);
 17.1113 -          rect.rightSide = measureRect(rects[rects.length - 1]);
 17.1114 -        }
 17.1115 -      }
 17.1116 -      if (!rect) rect = data[i] = measureRect(getRect(node));
 17.1117 -      if (cur.measureRight) rect.right = getRect(cur.measureRight).left;
 17.1118 -      if (cur.leftSide) rect.leftSide = measureRect(getRect(cur.leftSide));
 17.1119 -    }
 17.1120 -    removeChildren(cm.display.measure);
 17.1121 -    for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {
 17.1122 -      finishRect(cur);
 17.1123 -      if (cur.leftSide) finishRect(cur.leftSide);
 17.1124 -      if (cur.rightSide) finishRect(cur.rightSide);
 17.1125 -    }
 17.1126 -    return data;
 17.1127 -  }
 17.1128 -
 17.1129 -  function crudelyMeasureLine(cm, line) {
 17.1130 -    var copy = new Line(line.text.slice(0, 100), null);
 17.1131 -    if (line.textClass) copy.textClass = line.textClass;
 17.1132 -    var measure = measureLineInner(cm, copy);
 17.1133 -    var left = measureChar(cm, copy, 0, measure, "left");
 17.1134 -    var right = measureChar(cm, copy, 99, measure, "right");
 17.1135 -    return {crude: true, top: left.top, left: left.left, bottom: left.bottom, width: (right.right - left.left) / 100};
 17.1136 -  }
 17.1137 -
 17.1138 -  function measureLineWidth(cm, line) {
 17.1139 -    var hasBadSpan = false;
 17.1140 -    if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {
 17.1141 -      var sp = line.markedSpans[i];
 17.1142 -      if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;
 17.1143 -    }
 17.1144 -    var cached = !hasBadSpan && findCachedMeasurement(cm, line);
 17.1145 -    if (cached || line.text.length >= cm.options.crudeMeasuringFrom)
 17.1146 -      return measureChar(cm, line, line.text.length, cached && cached.measure, "right").right;
 17.1147 -
 17.1148 -    var pre = buildLineContent(cm, line, null, true).pre;
 17.1149 -    var end = pre.appendChild(zeroWidthElement(cm.display.measure));
 17.1150 -    removeChildrenAndAdd(cm.display.measure, pre);
 17.1151 -    return getRect(end).right - getRect(cm.display.lineDiv).left;
 17.1152 -  }
 17.1153 -
 17.1154 -  function clearCaches(cm) {
 17.1155 -    cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;
 17.1156 -    cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;
 17.1157 -    if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
 17.1158 -    cm.display.lineNumChars = null;
 17.1159 -  }
 17.1160 -
 17.1161 -  function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }
 17.1162 -  function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }
 17.1163 -
 17.1164 -  // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page"
 17.1165 -  function intoCoordSystem(cm, lineObj, rect, context) {
 17.1166 -    if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
 17.1167 -      var size = widgetHeight(lineObj.widgets[i]);
 17.1168 -      rect.top += size; rect.bottom += size;
 17.1169 -    }
 17.1170 -    if (context == "line") return rect;
 17.1171 -    if (!context) context = "local";
 17.1172 -    var yOff = heightAtLine(cm, lineObj);
 17.1173 -    if (context == "local") yOff += paddingTop(cm.display);
 17.1174 -    else yOff -= cm.display.viewOffset;
 17.1175 -    if (context == "page" || context == "window") {
 17.1176 -      var lOff = getRect(cm.display.lineSpace);
 17.1177 -      yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
 17.1178 -      var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
 17.1179 -      rect.left += xOff; rect.right += xOff;
 17.1180 -    }
 17.1181 -    rect.top += yOff; rect.bottom += yOff;
 17.1182 -    return rect;
 17.1183 -  }
 17.1184 -
 17.1185 -  // Context may be "window", "page", "div", or "local"/null
 17.1186 -  // Result is in "div" coords
 17.1187 -  function fromCoordSystem(cm, coords, context) {
 17.1188 -    if (context == "div") return coords;
 17.1189 -    var left = coords.left, top = coords.top;
 17.1190 -    // First move into "page" coordinate system
 17.1191 -    if (context == "page") {
 17.1192 -      left -= pageScrollX();
 17.1193 -      top -= pageScrollY();
 17.1194 -    } else if (context == "local" || !context) {
 17.1195 -      var localBox = getRect(cm.display.sizer);
 17.1196 -      left += localBox.left;
 17.1197 -      top += localBox.top;
 17.1198 -    }
 17.1199 -
 17.1200 -    var lineSpaceBox = getRect(cm.display.lineSpace);
 17.1201 -    return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
 17.1202 -  }
 17.1203 -
 17.1204 -  function charCoords(cm, pos, context, lineObj, bias) {
 17.1205 -    if (!lineObj) lineObj = getLine(cm.doc, pos.line);
 17.1206 -    return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context);
 17.1207 -  }
 17.1208 -
 17.1209 -  function cursorCoords(cm, pos, context, lineObj, measurement) {
 17.1210 -    lineObj = lineObj || getLine(cm.doc, pos.line);
 17.1211 -    if (!measurement) measurement = measureLine(cm, lineObj);
 17.1212 -    function get(ch, right) {
 17.1213 -      var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
 17.1214 -      if (right) m.left = m.right; else m.right = m.left;
 17.1215 -      return intoCoordSystem(cm, lineObj, m, context);
 17.1216 -    }
 17.1217 -    function getBidi(ch, partPos) {
 17.1218 -      var part = order[partPos], right = part.level % 2;
 17.1219 -      if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
 17.1220 -        part = order[--partPos];
 17.1221 -        ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
 17.1222 -        right = true;
 17.1223 -      } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
 17.1224 -        part = order[++partPos];
 17.1225 -        ch = bidiLeft(part) - part.level % 2;
 17.1226 -        right = false;
 17.1227 -      }
 17.1228 -      if (right && ch == part.to && ch > part.from) return get(ch - 1);
 17.1229 -      return get(ch, right);
 17.1230 -    }
 17.1231 -    var order = getOrder(lineObj), ch = pos.ch;
 17.1232 -    if (!order) return get(ch);
 17.1233 -    var partPos = getBidiPartAt(order, ch);
 17.1234 -    var val = getBidi(ch, partPos);
 17.1235 -    if (bidiOther != null) val.other = getBidi(ch, bidiOther);
 17.1236 -    return val;
 17.1237 -  }
 17.1238 -
 17.1239 -  function PosWithInfo(line, ch, outside, xRel) {
 17.1240 -    var pos = new Pos(line, ch);
 17.1241 -    pos.xRel = xRel;
 17.1242 -    if (outside) pos.outside = true;
 17.1243 -    return pos;
 17.1244 -  }
 17.1245 -
 17.1246 -  // Coords must be lineSpace-local
 17.1247 -  function coordsChar(cm, x, y) {
 17.1248 -    var doc = cm.doc;
 17.1249 -    y += cm.display.viewOffset;
 17.1250 -    if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
 17.1251 -    var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
 17.1252 -    if (lineNo > last)
 17.1253 -      return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
 17.1254 -    if (x < 0) x = 0;
 17.1255 -
 17.1256 -    for (;;) {
 17.1257 -      var lineObj = getLine(doc, lineNo);
 17.1258 -      var found = coordsCharInner(cm, lineObj, lineNo, x, y);
 17.1259 -      var merged = collapsedSpanAtEnd(lineObj);
 17.1260 -      var mergedPos = merged && merged.find();
 17.1261 -      if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
 17.1262 -        lineNo = mergedPos.to.line;
 17.1263 -      else
 17.1264 -        return found;
 17.1265 -    }
 17.1266 -  }
 17.1267 -
 17.1268 -  function coordsCharInner(cm, lineObj, lineNo, x, y) {
 17.1269 -    var innerOff = y - heightAtLine(cm, lineObj);
 17.1270 -    var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
 17.1271 -    var measurement = measureLine(cm, lineObj);
 17.1272 -
 17.1273 -    function getX(ch) {
 17.1274 -      var sp = cursorCoords(cm, Pos(lineNo, ch), "line",
 17.1275 -                            lineObj, measurement);
 17.1276 -      wrongLine = true;
 17.1277 -      if (innerOff > sp.bottom) return sp.left - adjust;
 17.1278 -      else if (innerOff < sp.top) return sp.left + adjust;
 17.1279 -      else wrongLine = false;
 17.1280 -      return sp.left;
 17.1281 -    }
 17.1282 -
 17.1283 -    var bidi = getOrder(lineObj), dist = lineObj.text.length;
 17.1284 -    var from = lineLeft(lineObj), to = lineRight(lineObj);
 17.1285 -    var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;
 17.1286 -
 17.1287 -    if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);
 17.1288 -    // Do a binary search between these bounds.
 17.1289 -    for (;;) {
 17.1290 -      if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
 17.1291 -        var ch = x < fromX || x - fromX <= toX - x ? from : to;
 17.1292 -        var xDiff = x - (ch == from ? fromX : toX);
 17.1293 -        while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;
 17.1294 -        var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,
 17.1295 -                              xDiff < 0 ? -1 : xDiff ? 1 : 0);
 17.1296 -        return pos;
 17.1297 -      }
 17.1298 -      var step = Math.ceil(dist / 2), middle = from + step;
 17.1299 -      if (bidi) {
 17.1300 -        middle = from;
 17.1301 -        for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);
 17.1302 -      }
 17.1303 -      var middleX = getX(middle);
 17.1304 -      if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}
 17.1305 -      else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}
 17.1306 -    }
 17.1307 -  }
 17.1308 -
 17.1309 -  var measureText;
 17.1310 -  function textHeight(display) {
 17.1311 -    if (display.cachedTextHeight != null) return display.cachedTextHeight;
 17.1312 -    if (measureText == null) {
 17.1313 -      measureText = elt("pre");
 17.1314 -      // Measure a bunch of lines, for browsers that compute
 17.1315 -      // fractional heights.
 17.1316 -      for (var i = 0; i < 49; ++i) {
 17.1317 -        measureText.appendChild(document.createTextNode("x"));
 17.1318 -        measureText.appendChild(elt("br"));
 17.1319 -      }
 17.1320 -      measureText.appendChild(document.createTextNode("x"));
 17.1321 -    }
 17.1322 -    removeChildrenAndAdd(display.measure, measureText);
 17.1323 -    var height = measureText.offsetHeight / 50;
 17.1324 -    if (height > 3) display.cachedTextHeight = height;
 17.1325 -    removeChildren(display.measure);
 17.1326 -    return height || 1;
 17.1327 -  }
 17.1328 -
 17.1329 -  function charWidth(display) {
 17.1330 -    if (display.cachedCharWidth != null) return display.cachedCharWidth;
 17.1331 -    var anchor = elt("span", "x");
 17.1332 -    var pre = elt("pre", [anchor]);
 17.1333 -    removeChildrenAndAdd(display.measure, pre);
 17.1334 -    var width = anchor.offsetWidth;
 17.1335 -    if (width > 2) display.cachedCharWidth = width;
 17.1336 -    return width || 10;
 17.1337 -  }
 17.1338 -
 17.1339 -  // OPERATIONS
 17.1340 -
 17.1341 -  // Operations are used to wrap changes in such a way that each
 17.1342 -  // change won't have to update the cursor and display (which would
 17.1343 -  // be awkward, slow, and error-prone), but instead updates are
 17.1344 -  // batched and then all combined and executed at once.
 17.1345 -
 17.1346 -  var nextOpId = 0;
 17.1347 -  function startOperation(cm) {
 17.1348 -    cm.curOp = {
 17.1349 -      // An array of ranges of lines that have to be updated. See
 17.1350 -      // updateDisplay.
 17.1351 -      changes: [],
 17.1352 -      forceUpdate: false,
 17.1353 -      updateInput: null,
 17.1354 -      userSelChange: null,
 17.1355 -      textChanged: null,
 17.1356 -      selectionChanged: false,
 17.1357 -      cursorActivity: false,
 17.1358 -      updateMaxLine: false,
 17.1359 -      updateScrollPos: false,
 17.1360 -      id: ++nextOpId
 17.1361 -    };
 17.1362 -    if (!delayedCallbackDepth++) delayedCallbacks = [];
 17.1363 -  }
 17.1364 -
 17.1365 -  function endOperation(cm) {
 17.1366 -    var op = cm.curOp, doc = cm.doc, display = cm.display;
 17.1367 -    cm.curOp = null;
 17.1368 -
 17.1369 -    if (op.updateMaxLine) computeMaxLength(cm);
 17.1370 -    if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {
 17.1371 -      var width = measureLineWidth(cm, display.maxLine);
 17.1372 -      display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px";
 17.1373 -      display.maxLineChanged = false;
 17.1374 -      var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);
 17.1375 -      if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)
 17.1376 -        setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);
 17.1377 -    }
 17.1378 -    var newScrollPos, updated;
 17.1379 -    if (op.updateScrollPos) {
 17.1380 -      newScrollPos = op.updateScrollPos;
 17.1381 -    } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible
 17.1382 -      var coords = cursorCoords(cm, doc.sel.head);
 17.1383 -      newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);
 17.1384 -    }
 17.1385 -    if (op.changes.length || op.forceUpdate || newScrollPos && newScrollPos.scrollTop != null) {
 17.1386 -      updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop, op.forceUpdate);
 17.1387 -      if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;
 17.1388 -    }
 17.1389 -    if (!updated && op.selectionChanged) updateSelection(cm);
 17.1390 -    if (op.updateScrollPos) {
 17.1391 -      display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop;
 17.1392 -      display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;
 17.1393 -      alignHorizontally(cm);
 17.1394 -      if (op.scrollToPos)
 17.1395 -        scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),
 17.1396 -                          clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);
 17.1397 -    } else if (newScrollPos) {
 17.1398 -      scrollCursorIntoView(cm);
 17.1399 -    }
 17.1400 -    if (op.selectionChanged) restartBlink(cm);
 17.1401 -
 17.1402 -    if (cm.state.focused && op.updateInput)
 17.1403 -      resetInput(cm, op.userSelChange);
 17.1404 -
 17.1405 -    var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
 17.1406 -    if (hidden) for (var i = 0; i < hidden.length; ++i)
 17.1407 -      if (!hidden[i].lines.length) signal(hidden[i], "hide");
 17.1408 -    if (unhidden) for (var i = 0; i < unhidden.length; ++i)
 17.1409 -      if (unhidden[i].lines.length) signal(unhidden[i], "unhide");
 17.1410 -
 17.1411 -    var delayed;
 17.1412 -    if (!--delayedCallbackDepth) {
 17.1413 -      delayed = delayedCallbacks;
 17.1414 -      delayedCallbacks = null;
 17.1415 -    }
 17.1416 -    if (op.textChanged)
 17.1417 -      signal(cm, "change", cm, op.textChanged);
 17.1418 -    if (op.cursorActivity) signal(cm, "cursorActivity", cm);
 17.1419 -    if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();
 17.1420 -  }
 17.1421 -
 17.1422 -  // Wraps a function in an operation. Returns the wrapped function.
 17.1423 -  function operation(cm1, f) {
 17.1424 -    return function() {
 17.1425 -      var cm = cm1 || this, withOp = !cm.curOp;
 17.1426 -      if (withOp) startOperation(cm);
 17.1427 -      try { var result = f.apply(cm, arguments); }
 17.1428 -      finally { if (withOp) endOperation(cm); }
 17.1429 -      return result;
 17.1430 -    };
 17.1431 -  }
 17.1432 -  function docOperation(f) {
 17.1433 -    return function() {
 17.1434 -      var withOp = this.cm && !this.cm.curOp, result;
 17.1435 -      if (withOp) startOperation(this.cm);
 17.1436 -      try { result = f.apply(this, arguments); }
 17.1437 -      finally { if (withOp) endOperation(this.cm); }
 17.1438 -      return result;
 17.1439 -    };
 17.1440 -  }
 17.1441 -  function runInOp(cm, f) {
 17.1442 -    var withOp = !cm.curOp, result;
 17.1443 -    if (withOp) startOperation(cm);
 17.1444 -    try { result = f(); }
 17.1445 -    finally { if (withOp) endOperation(cm); }
 17.1446 -    return result;
 17.1447 -  }
 17.1448 -
 17.1449 -  function regChange(cm, from, to, lendiff) {
 17.1450 -    if (from == null) from = cm.doc.first;
 17.1451 -    if (to == null) to = cm.doc.first + cm.doc.size;
 17.1452 -    cm.curOp.changes.push({from: from, to: to, diff: lendiff});
 17.1453 -  }
 17.1454 -
 17.1455 -  // INPUT HANDLING
 17.1456 -
 17.1457 -  function slowPoll(cm) {
 17.1458 -    if (cm.display.pollingFast) return;
 17.1459 -    cm.display.poll.set(cm.options.pollInterval, function() {
 17.1460 -      readInput(cm);
 17.1461 -      if (cm.state.focused) slowPoll(cm);
 17.1462 -    });
 17.1463 -  }
 17.1464 -
 17.1465 -  function fastPoll(cm) {
 17.1466 -    var missed = false;
 17.1467 -    cm.display.pollingFast = true;
 17.1468 -    function p() {
 17.1469 -      var changed = readInput(cm);
 17.1470 -      if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}
 17.1471 -      else {cm.display.pollingFast = false; slowPoll(cm);}
 17.1472 -    }
 17.1473 -    cm.display.poll.set(20, p);
 17.1474 -  }
 17.1475 -
 17.1476 -  // prevInput is a hack to work with IME. If we reset the textarea
 17.1477 -  // on every change, that breaks IME. So we look for changes
 17.1478 -  // compared to the previous content instead. (Modern browsers have
 17.1479 -  // events that indicate IME taking place, but these are not widely
 17.1480 -  // supported or compatible enough yet to rely on.)
 17.1481 -  function readInput(cm) {
 17.1482 -    var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
 17.1483 -    if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;
 17.1484 -    if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
 17.1485 -      input.value = input.value.substring(0, input.value.length - 1);
 17.1486 -      cm.state.fakedLastChar = false;
 17.1487 -    }
 17.1488 -    var text = input.value;
 17.1489 -    if (text == prevInput && posEq(sel.from, sel.to)) return false;
 17.1490 -    if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {
 17.1491 -      resetInput(cm, true);
 17.1492 -      return false;
 17.1493 -    }
 17.1494 -
 17.1495 -    var withOp = !cm.curOp;
 17.1496 -    if (withOp) startOperation(cm);
 17.1497 -    sel.shift = false;
 17.1498 -    var same = 0, l = Math.min(prevInput.length, text.length);
 17.1499 -    while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
 17.1500 -    var from = sel.from, to = sel.to;
 17.1501 -    if (same < prevInput.length)
 17.1502 -      from = Pos(from.line, from.ch - (prevInput.length - same));
 17.1503 -    else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)
 17.1504 -      to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same)));
 17.1505 -
 17.1506 -    var updateInput = cm.curOp.updateInput;
 17.1507 -    var changeEvent = {from: from, to: to, text: splitLines(text.slice(same)),
 17.1508 -                       origin: cm.state.pasteIncoming ? "paste" : "+input"};
 17.1509 -    makeChange(cm.doc, changeEvent, "end");
 17.1510 -    cm.curOp.updateInput = updateInput;
 17.1511 -    signalLater(cm, "inputRead", cm, changeEvent);
 17.1512 -
 17.1513 -    if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = "";
 17.1514 -    else cm.display.prevInput = text;
 17.1515 -    if (withOp) endOperation(cm);
 17.1516 -    cm.state.pasteIncoming = false;
 17.1517 -    return true;
 17.1518 -  }
 17.1519 -
 17.1520 -  function resetInput(cm, user) {
 17.1521 -    var minimal, selected, doc = cm.doc;
 17.1522 -    if (!posEq(doc.sel.from, doc.sel.to)) {
 17.1523 -      cm.display.prevInput = "";
 17.1524 -      minimal = hasCopyEvent &&
 17.1525 -        (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);
 17.1526 -      var content = minimal ? "-" : selected || cm.getSelection();
 17.1527 -      cm.display.input.value = content;
 17.1528 -      if (cm.state.focused) selectInput(cm.display.input);
 17.1529 -      if (ie && !ie_lt9) cm.display.inputHasSelection = content;
 17.1530 -    } else if (user) {
 17.1531 -      cm.display.prevInput = cm.display.input.value = "";
 17.1532 -      if (ie && !ie_lt9) cm.display.inputHasSelection = null;
 17.1533 -    }
 17.1534 -    cm.display.inaccurateSelection = minimal;
 17.1535 -  }
 17.1536 -
 17.1537 -  function focusInput(cm) {
 17.1538 -    if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))
 17.1539 -      cm.display.input.focus();
 17.1540 -  }
 17.1541 -
 17.1542 -  function isReadOnly(cm) {
 17.1543 -    return cm.options.readOnly || cm.doc.cantEdit;
 17.1544 -  }
 17.1545 -
 17.1546 -  // EVENT HANDLERS
 17.1547 -
 17.1548 -  function registerEventHandlers(cm) {
 17.1549 -    var d = cm.display;
 17.1550 -    on(d.scroller, "mousedown", operation(cm, onMouseDown));
 17.1551 -    if (ie)
 17.1552 -      on(d.scroller, "dblclick", operation(cm, function(e) {
 17.1553 -        if (signalDOMEvent(cm, e)) return;
 17.1554 -        var pos = posFromMouse(cm, e);
 17.1555 -        if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;
 17.1556 -        e_preventDefault(e);
 17.1557 -        var word = findWordAt(getLine(cm.doc, pos.line).text, pos);
 17.1558 -        extendSelection(cm.doc, word.from, word.to);
 17.1559 -      }));
 17.1560 -    else
 17.1561 -      on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
 17.1562 -    on(d.lineSpace, "selectstart", function(e) {
 17.1563 -      if (!eventInWidget(d, e)) e_preventDefault(e);
 17.1564 -    });
 17.1565 -    // Gecko browsers fire contextmenu *after* opening the menu, at
 17.1566 -    // which point we can't mess with it anymore. Context menu is
 17.1567 -    // handled in onMouseDown for Gecko.
 17.1568 -    if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
 17.1569 -
 17.1570 -    on(d.scroller, "scroll", function() {
 17.1571 -      if (d.scroller.clientHeight) {
 17.1572 -        setScrollTop(cm, d.scroller.scrollTop);
 17.1573 -        setScrollLeft(cm, d.scroller.scrollLeft, true);
 17.1574 -        signal(cm, "scroll", cm);
 17.1575 -      }
 17.1576 -    });
 17.1577 -    on(d.scrollbarV, "scroll", function() {
 17.1578 -      if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);
 17.1579 -    });
 17.1580 -    on(d.scrollbarH, "scroll", function() {
 17.1581 -      if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);
 17.1582 -    });
 17.1583 -
 17.1584 -    on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);});
 17.1585 -    on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);});
 17.1586 -
 17.1587 -    function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }
 17.1588 -    on(d.scrollbarH, "mousedown", reFocus);
 17.1589 -    on(d.scrollbarV, "mousedown", reFocus);
 17.1590 -    // Prevent wrapper from ever scrolling
 17.1591 -    on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
 17.1592 -
 17.1593 -    var resizeTimer;
 17.1594 -    function onResize() {
 17.1595 -      if (resizeTimer == null) resizeTimer = setTimeout(function() {
 17.1596 -        resizeTimer = null;
 17.1597 -        // Might be a text scaling operation, clear size caches.
 17.1598 -        d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null;
 17.1599 -        clearCaches(cm);
 17.1600 -        runInOp(cm, bind(regChange, cm));
 17.1601 -      }, 100);
 17.1602 -    }
 17.1603 -    on(window, "resize", onResize);
 17.1604 -    // Above handler holds on to the editor and its data structures.
 17.1605 -    // Here we poll to unregister it when the editor is no longer in
 17.1606 -    // the document, so that it can be garbage-collected.
 17.1607 -    function unregister() {
 17.1608 -      for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}
 17.1609 -      if (p) setTimeout(unregister, 5000);
 17.1610 -      else off(window, "resize", onResize);
 17.1611 -    }
 17.1612 -    setTimeout(unregister, 5000);
 17.1613 -
 17.1614 -    on(d.input, "keyup", operation(cm, function(e) {
 17.1615 -      if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
 17.1616 -      if (e.keyCode == 16) cm.doc.sel.shift = false;
 17.1617 -    }));
 17.1618 -    on(d.input, "input", function() {
 17.1619 -      if (ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;
 17.1620 -      fastPoll(cm);
 17.1621 -    });
 17.1622 -    on(d.input, "keydown", operation(cm, onKeyDown));
 17.1623 -    on(d.input, "keypress", operation(cm, onKeyPress));
 17.1624 -    on(d.input, "focus", bind(onFocus, cm));
 17.1625 -    on(d.input, "blur", bind(onBlur, cm));
 17.1626 -
 17.1627 -    function drag_(e) {
 17.1628 -      if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;
 17.1629 -      e_stop(e);
 17.1630 -    }
 17.1631 -    if (cm.options.dragDrop) {
 17.1632 -      on(d.scroller, "dragstart", function(e){onDragStart(cm, e);});
 17.1633 -      on(d.scroller, "dragenter", drag_);
 17.1634 -      on(d.scroller, "dragover", drag_);
 17.1635 -      on(d.scroller, "drop", operation(cm, onDrop));
 17.1636 -    }
 17.1637 -    on(d.scroller, "paste", function(e) {
 17.1638 -      if (eventInWidget(d, e)) return;
 17.1639 -      focusInput(cm);
 17.1640 -      fastPoll(cm);
 17.1641 -    });
 17.1642 -    on(d.input, "paste", function() {
 17.1643 -      // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206
 17.1644 -      // Add a char to the end of textarea before paste occur so that
 17.1645 -      // selection doesn't span to the end of textarea.
 17.1646 -      if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {
 17.1647 -        var start = d.input.selectionStart, end = d.input.selectionEnd;
 17.1648 -        d.input.value += "$";
 17.1649 -        d.input.selectionStart = start;
 17.1650 -        d.input.selectionEnd = end;
 17.1651 -        cm.state.fakedLastChar = true;
 17.1652 -      }
 17.1653 -      cm.state.pasteIncoming = true;
 17.1654 -      fastPoll(cm);
 17.1655 -    });
 17.1656 -
 17.1657 -    function prepareCopy() {
 17.1658 -      if (d.inaccurateSelection) {
 17.1659 -        d.prevInput = "";
 17.1660 -        d.inaccurateSelection = false;
 17.1661 -        d.input.value = cm.getSelection();
 17.1662 -        selectInput(d.input);
 17.1663 -      }
 17.1664 -    }
 17.1665 -    on(d.input, "cut", prepareCopy);
 17.1666 -    on(d.input, "copy", prepareCopy);
 17.1667 -
 17.1668 -    // Needed to handle Tab key in KHTML
 17.1669 -    if (khtml) on(d.sizer, "mouseup", function() {
 17.1670 -        if (document.activeElement == d.input) d.input.blur();
 17.1671 -        focusInput(cm);
 17.1672 -    });
 17.1673 -  }
 17.1674 -
 17.1675 -  function eventInWidget(display, e) {
 17.1676 -    for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
 17.1677 -      if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;
 17.1678 -    }
 17.1679 -  }
 17.1680 -
 17.1681 -  function posFromMouse(cm, e, liberal) {
 17.1682 -    var display = cm.display;
 17.1683 -    if (!liberal) {
 17.1684 -      var target = e_target(e);
 17.1685 -      if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
 17.1686 -          target == display.scrollbarV || target == display.scrollbarV.firstChild ||
 17.1687 -          target == display.scrollbarFiller || target == display.gutterFiller) return null;
 17.1688 -    }
 17.1689 -    var x, y, space = getRect(display.lineSpace);
 17.1690 -    // Fails unpredictably on IE[67] when mouse is dragged around quickly.
 17.1691 -    try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
 17.1692 -    return coordsChar(cm, x - space.left, y - space.top);
 17.1693 -  }
 17.1694 -
 17.1695 -  var lastClick, lastDoubleClick;
 17.1696 -  function onMouseDown(e) {
 17.1697 -    if (signalDOMEvent(this, e)) return;
 17.1698 -    var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
 17.1699 -    sel.shift = e.shiftKey;
 17.1700 -
 17.1701 -    if (eventInWidget(display, e)) {
 17.1702 -      if (!webkit) {
 17.1703 -        display.scroller.draggable = false;
 17.1704 -        setTimeout(function(){display.scroller.draggable = true;}, 100);
 17.1705 -      }
 17.1706 -      return;
 17.1707 -    }
 17.1708 -    if (clickInGutter(cm, e)) return;
 17.1709 -    var start = posFromMouse(cm, e);
 17.1710 -
 17.1711 -    switch (e_button(e)) {
 17.1712 -    case 3:
 17.1713 -      if (captureMiddleClick) onContextMenu.call(cm, cm, e);
 17.1714 -      return;
 17.1715 -    case 2:
 17.1716 -      if (webkit) cm.state.lastMiddleDown = +new Date;
 17.1717 -      if (start) extendSelection(cm.doc, start);
 17.1718 -      setTimeout(bind(focusInput, cm), 20);
 17.1719 -      e_preventDefault(e);
 17.1720 -      return;
 17.1721 -    }
 17.1722 -    // For button 1, if it was clicked inside the editor
 17.1723 -    // (posFromMouse returning non-null), we have to adjust the
 17.1724 -    // selection.
 17.1725 -    if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}
 17.1726 -
 17.1727 -    if (!cm.state.focused) onFocus(cm);
 17.1728 -
 17.1729 -    var now = +new Date, type = "single";
 17.1730 -    if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {
 17.1731 -      type = "triple";
 17.1732 -      e_preventDefault(e);
 17.1733 -      setTimeout(bind(focusInput, cm), 20);
 17.1734 -      selectLine(cm, start.line);
 17.1735 -    } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {
 17.1736 -      type = "double";
 17.1737 -      lastDoubleClick = {time: now, pos: start};
 17.1738 -      e_preventDefault(e);
 17.1739 -      var word = findWordAt(getLine(doc, start.line).text, start);
 17.1740 -      extendSelection(cm.doc, word.from, word.to);
 17.1741 -    } else { lastClick = {time: now, pos: start}; }
 17.1742 -
 17.1743 -    var last = start;
 17.1744 -    if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&
 17.1745 -        !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
 17.1746 -      var dragEnd = operation(cm, function(e2) {
 17.1747 -        if (webkit) display.scroller.draggable = false;
 17.1748 -        cm.state.draggingText = false;
 17.1749 -        off(document, "mouseup", dragEnd);
 17.1750 -        off(display.scroller, "drop", dragEnd);
 17.1751 -        if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
 17.1752 -          e_preventDefault(e2);
 17.1753 -          extendSelection(cm.doc, start);
 17.1754 -          focusInput(cm);
 17.1755 -        }
 17.1756 -      });
 17.1757 -      // Let the drag handler handle this.
 17.1758 -      if (webkit) display.scroller.draggable = true;
 17.1759 -      cm.state.draggingText = dragEnd;
 17.1760 -      // IE's approach to draggable
 17.1761 -      if (display.scroller.dragDrop) display.scroller.dragDrop();
 17.1762 -      on(document, "mouseup", dragEnd);
 17.1763 -      on(display.scroller, "drop", dragEnd);
 17.1764 -      return;
 17.1765 -    }
 17.1766 -    e_preventDefault(e);
 17.1767 -    if (type == "single") extendSelection(cm.doc, clipPos(doc, start));
 17.1768 -
 17.1769 -    var startstart = sel.from, startend = sel.to, lastPos = start;
 17.1770 -
 17.1771 -    function doSelect(cur) {
 17.1772 -      if (posEq(lastPos, cur)) return;
 17.1773 -      lastPos = cur;
 17.1774 -
 17.1775 -      if (type == "single") {
 17.1776 -        extendSelection(cm.doc, clipPos(doc, start), cur);
 17.1777 -        return;
 17.1778 -      }
 17.1779 -
 17.1780 -      startstart = clipPos(doc, startstart);
 17.1781 -      startend = clipPos(doc, startend);
 17.1782 -      if (type == "double") {
 17.1783 -        var word = findWordAt(getLine(doc, cur.line).text, cur);
 17.1784 -        if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);
 17.1785 -        else extendSelection(cm.doc, startstart, word.to);
 17.1786 -      } else if (type == "triple") {
 17.1787 -        if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));
 17.1788 -        else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));
 17.1789 -      }
 17.1790 -    }
 17.1791 -
 17.1792 -    var editorSize = getRect(display.wrapper);
 17.1793 -    // Used to ensure timeout re-tries don't fire when another extend
 17.1794 -    // happened in the meantime (clearTimeout isn't reliable -- at
 17.1795 -    // least on Chrome, the timeouts still happen even when cleared,
 17.1796 -    // if the clear happens after their scheduled firing time).
 17.1797 -    var counter = 0;
 17.1798 -
 17.1799 -    function extend(e) {
 17.1800 -      var curCount = ++counter;
 17.1801 -      var cur = posFromMouse(cm, e, true);
 17.1802 -      if (!cur) return;
 17.1803 -      if (!posEq(cur, last)) {
 17.1804 -        if (!cm.state.focused) onFocus(cm);
 17.1805 -        last = cur;
 17.1806 -        doSelect(cur);
 17.1807 -        var visible = visibleLines(display, doc);
 17.1808 -        if (cur.line >= visible.to || cur.line < visible.from)
 17.1809 -          setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
 17.1810 -      } else {
 17.1811 -        var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
 17.1812 -        if (outside) setTimeout(operation(cm, function() {
 17.1813 -          if (counter != curCount) return;
 17.1814 -          display.scroller.scrollTop += outside;
 17.1815 -          extend(e);
 17.1816 -        }), 50);
 17.1817 -      }
 17.1818 -    }
 17.1819 -
 17.1820 -    function done(e) {
 17.1821 -      counter = Infinity;
 17.1822 -      e_preventDefault(e);
 17.1823 -      focusInput(cm);
 17.1824 -      off(document, "mousemove", move);
 17.1825 -      off(document, "mouseup", up);
 17.1826 -    }
 17.1827 -
 17.1828 -    var move = operation(cm, function(e) {
 17.1829 -      if (!ie && !e_button(e)) done(e);
 17.1830 -      else extend(e);
 17.1831 -    });
 17.1832 -    var up = operation(cm, done);
 17.1833 -    on(document, "mousemove", move);
 17.1834 -    on(document, "mouseup", up);
 17.1835 -  }
 17.1836 -
 17.1837 -  function gutterEvent(cm, e, type, prevent, signalfn) {
 17.1838 -    try { var mX = e.clientX, mY = e.clientY; }
 17.1839 -    catch(e) { return false; }
 17.1840 -    if (mX >= Math.floor(getRect(cm.display.gutters).right)) return false;
 17.1841 -    if (prevent) e_preventDefault(e);
 17.1842 -
 17.1843 -    var display = cm.display;
 17.1844 -    var lineBox = getRect(display.lineDiv);
 17.1845 -
 17.1846 -    if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);
 17.1847 -    mY -= lineBox.top - display.viewOffset;
 17.1848 -
 17.1849 -    for (var i = 0; i < cm.options.gutters.length; ++i) {
 17.1850 -      var g = display.gutters.childNodes[i];
 17.1851 -      if (g && getRect(g).right >= mX) {
 17.1852 -        var line = lineAtHeight(cm.doc, mY);
 17.1853 -        var gutter = cm.options.gutters[i];
 17.1854 -        signalfn(cm, type, cm, line, gutter, e);
 17.1855 -        return e_defaultPrevented(e);
 17.1856 -      }
 17.1857 -    }
 17.1858 -  }
 17.1859 -
 17.1860 -  function contextMenuInGutter(cm, e) {
 17.1861 -    if (!hasHandler(cm, "gutterContextMenu")) return false;
 17.1862 -    return gutterEvent(cm, e, "gutterContextMenu", false, signal);
 17.1863 -  }
 17.1864 -
 17.1865 -  function clickInGutter(cm, e) {
 17.1866 -    return gutterEvent(cm, e, "gutterClick", true, signalLater);
 17.1867 -  }
 17.1868 -
 17.1869 -  // Kludge to work around strange IE behavior where it'll sometimes
 17.1870 -  // re-fire a series of drag-related events right after the drop (#1551)
 17.1871 -  var lastDrop = 0;
 17.1872 -
 17.1873 -  function onDrop(e) {
 17.1874 -    var cm = this;
 17.1875 -    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
 17.1876 -      return;
 17.1877 -    e_preventDefault(e);
 17.1878 -    if (ie) lastDrop = +new Date;
 17.1879 -    var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
 17.1880 -    if (!pos || isReadOnly(cm)) return;
 17.1881 -    if (files && files.length && window.FileReader && window.File) {
 17.1882 -      var n = files.length, text = Array(n), read = 0;
 17.1883 -      var loadFile = function(file, i) {
 17.1884 -        var reader = new FileReader;
 17.1885 -        reader.onload = function() {
 17.1886 -          text[i] = reader.result;
 17.1887 -          if (++read == n) {
 17.1888 -            pos = clipPos(cm.doc, pos);
 17.1889 -            makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around");
 17.1890 -          }
 17.1891 -        };
 17.1892 -        reader.readAsText(file);
 17.1893 -      };
 17.1894 -      for (var i = 0; i < n; ++i) loadFile(files[i], i);
 17.1895 -    } else {
 17.1896 -      // Don't do a replace if the drop happened inside of the selected text.
 17.1897 -      if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) {
 17.1898 -        cm.state.draggingText(e);
 17.1899 -        // Ensure the editor is re-focused
 17.1900 -        setTimeout(bind(focusInput, cm), 20);
 17.1901 -        return;
 17.1902 -      }
 17.1903 -      try {
 17.1904 -        var text = e.dataTransfer.getData("Text");
 17.1905 -        if (text) {
 17.1906 -          var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to;
 17.1907 -          setSelection(cm.doc, pos, pos);
 17.1908 -          if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste");
 17.1909 -          cm.replaceSelection(text, null, "paste");
 17.1910 -          focusInput(cm);
 17.1911 -          onFocus(cm);
 17.1912 -        }
 17.1913 -      }
 17.1914 -      catch(e){}
 17.1915 -    }
 17.1916 -  }
 17.1917 -
 17.1918 -  function onDragStart(cm, e) {
 17.1919 -    if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
 17.1920 -    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
 17.1921 -
 17.1922 -    var txt = cm.getSelection();
 17.1923 -    e.dataTransfer.setData("Text", txt);
 17.1924 -
 17.1925 -    // Use dummy image instead of default browsers image.
 17.1926 -    // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
 17.1927 -    if (e.dataTransfer.setDragImage && !safari) {
 17.1928 -      var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
 17.1929 -      img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
 17.1930 -      if (opera) {
 17.1931 -        img.width = img.height = 1;
 17.1932 -        cm.display.wrapper.appendChild(img);
 17.1933 -        // Force a relayout, or Opera won't use our image for some obscure reason
 17.1934 -        img._top = img.offsetTop;
 17.1935 -      }
 17.1936 -      e.dataTransfer.setDragImage(img, 0, 0);
 17.1937 -      if (opera) img.parentNode.removeChild(img);
 17.1938 -    }
 17.1939 -  }
 17.1940 -
 17.1941 -  function setScrollTop(cm, val) {
 17.1942 -    if (Math.abs(cm.doc.scrollTop - val) < 2) return;
 17.1943 -    cm.doc.scrollTop = val;
 17.1944 -    if (!gecko) updateDisplay(cm, [], val);
 17.1945 -    if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
 17.1946 -    if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;
 17.1947 -    if (gecko) updateDisplay(cm, []);
 17.1948 -    startWorker(cm, 100);
 17.1949 -  }
 17.1950 -  function setScrollLeft(cm, val, isScroller) {
 17.1951 -    if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
 17.1952 -    val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
 17.1953 -    cm.doc.scrollLeft = val;
 17.1954 -    alignHorizontally(cm);
 17.1955 -    if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;
 17.1956 -    if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;
 17.1957 -  }
 17.1958 -
 17.1959 -  // Since the delta values reported on mouse wheel events are
 17.1960 -  // unstandardized between browsers and even browser versions, and
 17.1961 -  // generally horribly unpredictable, this code starts by measuring
 17.1962 -  // the scroll effect that the first few mouse wheel events have,
 17.1963 -  // and, from that, detects the way it can convert deltas to pixel
 17.1964 -  // offsets afterwards.
 17.1965 -  //
 17.1966 -  // The reason we want to know the amount a wheel event will scroll
 17.1967 -  // is that it gives us a chance to update the display before the
 17.1968 -  // actual scrolling happens, reducing flickering.
 17.1969 -
 17.1970 -  var wheelSamples = 0, wheelPixelsPerUnit = null;
 17.1971 -  // Fill in a browser-detected starting value on browsers where we
 17.1972 -  // know one. These don't have to be accurate -- the result of them
 17.1973 -  // being wrong would just be a slight flicker on the first wheel
 17.1974 -  // scroll (if it is large enough).
 17.1975 -  if (ie) wheelPixelsPerUnit = -.53;
 17.1976 -  else if (gecko) wheelPixelsPerUnit = 15;
 17.1977 -  else if (chrome) wheelPixelsPerUnit = -.7;
 17.1978 -  else if (safari) wheelPixelsPerUnit = -1/3;
 17.1979 -
 17.1980 -  function onScrollWheel(cm, e) {
 17.1981 -    var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
 17.1982 -    if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
 17.1983 -    if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
 17.1984 -    else if (dy == null) dy = e.wheelDelta;
 17.1985 -
 17.1986 -    var display = cm.display, scroll = display.scroller;
 17.1987 -    // Quit if there's nothing to scroll here
 17.1988 -    if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
 17.1989 -          dy && scroll.scrollHeight > scroll.clientHeight)) return;
 17.1990 -
 17.1991 -    // Webkit browsers on OS X abort momentum scrolls when the target
 17.1992 -    // of the scroll event is removed from the scrollable element.
 17.1993 -    // This hack (see related code in patchDisplay) makes sure the
 17.1994 -    // element is kept around.
 17.1995 -    if (dy && mac && webkit) {
 17.1996 -      for (var cur = e.target; cur != scroll; cur = cur.parentNode) {
 17.1997 -        if (cur.lineObj) {
 17.1998 -          cm.display.currentWheelTarget = cur;
 17.1999 -          break;
 17.2000 -        }
 17.2001 -      }
 17.2002 -    }
 17.2003 -
 17.2004 -    // On some browsers, horizontal scrolling will cause redraws to
 17.2005 -    // happen before the gutter has been realigned, causing it to
 17.2006 -    // wriggle around in a most unseemly way. When we have an
 17.2007 -    // estimated pixels/delta value, we just handle horizontal
 17.2008 -    // scrolling entirely here. It'll be slightly off from native, but
 17.2009 -    // better than glitching out.
 17.2010 -    if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {
 17.2011 -      if (dy)
 17.2012 -        setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
 17.2013 -      setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
 17.2014 -      e_preventDefault(e);
 17.2015 -      display.wheelStartX = null; // Abort measurement, if in progress
 17.2016 -      return;
 17.2017 -    }
 17.2018 -
 17.2019 -    if (dy && wheelPixelsPerUnit != null) {
 17.2020 -      var pixels = dy * wheelPixelsPerUnit;
 17.2021 -      var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
 17.2022 -      if (pixels < 0) top = Math.max(0, top + pixels - 50);
 17.2023 -      else bot = Math.min(cm.doc.height, bot + pixels + 50);
 17.2024 -      updateDisplay(cm, [], {top: top, bottom: bot});
 17.2025 -    }
 17.2026 -
 17.2027 -    if (wheelSamples < 20) {
 17.2028 -      if (display.wheelStartX == null) {
 17.2029 -        display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
 17.2030 -        display.wheelDX = dx; display.wheelDY = dy;
 17.2031 -        setTimeout(function() {
 17.2032 -          if (display.wheelStartX == null) return;
 17.2033 -          var movedX = scroll.scrollLeft - display.wheelStartX;
 17.2034 -          var movedY = scroll.scrollTop - display.wheelStartY;
 17.2035 -          var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
 17.2036 -            (movedX && display.wheelDX && movedX / display.wheelDX);
 17.2037 -          display.wheelStartX = display.wheelStartY = null;
 17.2038 -          if (!sample) return;
 17.2039 -          wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
 17.2040 -          ++wheelSamples;
 17.2041 -        }, 200);
 17.2042 -      } else {
 17.2043 -        display.wheelDX += dx; display.wheelDY += dy;
 17.2044 -      }
 17.2045 -    }
 17.2046 -  }
 17.2047 -
 17.2048 -  function doHandleBinding(cm, bound, dropShift) {
 17.2049 -    if (typeof bound == "string") {
 17.2050 -      bound = commands[bound];
 17.2051 -      if (!bound) return false;
 17.2052 -    }
 17.2053 -    // Ensure previous input has been read, so that the handler sees a
 17.2054 -    // consistent view of the document
 17.2055 -    if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;
 17.2056 -    var doc = cm.doc, prevShift = doc.sel.shift, done = false;
 17.2057 -    try {
 17.2058 -      if (isReadOnly(cm)) cm.state.suppressEdits = true;
 17.2059 -      if (dropShift) doc.sel.shift = false;
 17.2060 -      done = bound(cm) != Pass;
 17.2061 -    } finally {
 17.2062 -      doc.sel.shift = prevShift;
 17.2063 -      cm.state.suppressEdits = false;
 17.2064 -    }
 17.2065 -    return done;
 17.2066 -  }
 17.2067 -
 17.2068 -  function allKeyMaps(cm) {
 17.2069 -    var maps = cm.state.keyMaps.slice(0);
 17.2070 -    if (cm.options.extraKeys) maps.push(cm.options.extraKeys);
 17.2071 -    maps.push(cm.options.keyMap);
 17.2072 -    return maps;
 17.2073 -  }
 17.2074 -
 17.2075 -  var maybeTransition;
 17.2076 -  function handleKeyBinding(cm, e) {
 17.2077 -    // Handle auto keymap transitions
 17.2078 -    var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;
 17.2079 -    clearTimeout(maybeTransition);
 17.2080 -    if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {
 17.2081 -      if (getKeyMap(cm.options.keyMap) == startMap) {
 17.2082 -        cm.options.keyMap = (next.call ? next.call(null, cm) : next);
 17.2083 -        keyMapChanged(cm);
 17.2084 -      }
 17.2085 -    }, 50);
 17.2086 -
 17.2087 -    var name = keyName(e, true), handled = false;
 17.2088 -    if (!name) return false;
 17.2089 -    var keymaps = allKeyMaps(cm);
 17.2090 -
 17.2091 -    if (e.shiftKey) {
 17.2092 -      // First try to resolve full name (including 'Shift-'). Failing
 17.2093 -      // that, see if there is a cursor-motion command (starting with
 17.2094 -      // 'go') bound to the keyname without 'Shift-'.
 17.2095 -      handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})
 17.2096 -             || lookupKey(name, keymaps, function(b) {
 17.2097 -                  if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
 17.2098 -                    return doHandleBinding(cm, b);
 17.2099 -                });
 17.2100 -    } else {
 17.2101 -      handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });
 17.2102 -    }
 17.2103 -
 17.2104 -    if (handled) {
 17.2105 -      e_preventDefault(e);
 17.2106 -      restartBlink(cm);
 17.2107 -      if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
 17.2108 -      signalLater(cm, "keyHandled", cm, name, e);
 17.2109 -    }
 17.2110 -    return handled;
 17.2111 -  }
 17.2112 -
 17.2113 -  function handleCharBinding(cm, e, ch) {
 17.2114 -    var handled = lookupKey("'" + ch + "'", allKeyMaps(cm),
 17.2115 -                            function(b) { return doHandleBinding(cm, b, true); });
 17.2116 -    if (handled) {
 17.2117 -      e_preventDefault(e);
 17.2118 -      restartBlink(cm);
 17.2119 -      signalLater(cm, "keyHandled", cm, "'" + ch + "'", e);
 17.2120 -    }
 17.2121 -    return handled;
 17.2122 -  }
 17.2123 -
 17.2124 -  var lastStoppedKey = null;
 17.2125 -  function onKeyDown(e) {
 17.2126 -    var cm = this;
 17.2127 -    if (!cm.state.focused) onFocus(cm);
 17.2128 -    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
 17.2129 -    if (ie && e.keyCode == 27) e.returnValue = false;
 17.2130 -    var code = e.keyCode;
 17.2131 -    // IE does strange things with escape.
 17.2132 -    cm.doc.sel.shift = code == 16 || e.shiftKey;
 17.2133 -    // First give onKeyEvent option a chance to handle this.
 17.2134 -    var handled = handleKeyBinding(cm, e);
 17.2135 -    if (opera) {
 17.2136 -      lastStoppedKey = handled ? code : null;
 17.2137 -      // Opera has no cut event... we try to at least catch the key combo
 17.2138 -      if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
 17.2139 -        cm.replaceSelection("");
 17.2140 -    }
 17.2141 -  }
 17.2142 -
 17.2143 -  function onKeyPress(e) {
 17.2144 -    var cm = this;
 17.2145 -    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
 17.2146 -    var keyCode = e.keyCode, charCode = e.charCode;
 17.2147 -    if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
 17.2148 -    if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;
 17.2149 -    var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
 17.2150 -    if (this.options.electricChars && this.doc.mode.electricChars &&
 17.2151 -        this.options.smartIndent && !isReadOnly(this) &&
 17.2152 -        this.doc.mode.electricChars.indexOf(ch) > -1)
 17.2153 -      setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, "smart");}), 75);
 17.2154 -    if (handleCharBinding(cm, e, ch)) return;
 17.2155 -    if (ie && !ie_lt9) cm.display.inputHasSelection = null;
 17.2156 -    fastPoll(cm);
 17.2157 -  }
 17.2158 -
 17.2159 -  function onFocus(cm) {
 17.2160 -    if (cm.options.readOnly == "nocursor") return;
 17.2161 -    if (!cm.state.focused) {
 17.2162 -      signal(cm, "focus", cm);
 17.2163 -      cm.state.focused = true;
 17.2164 -      if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
 17.2165 -        cm.display.wrapper.className += " CodeMirror-focused";
 17.2166 -      if (!cm.curOp) {
 17.2167 -        resetInput(cm, true);
 17.2168 -        if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730
 17.2169 -      }
 17.2170 -    }
 17.2171 -    slowPoll(cm);
 17.2172 -    restartBlink(cm);
 17.2173 -  }
 17.2174 -  function onBlur(cm) {
 17.2175 -    if (cm.state.focused) {
 17.2176 -      signal(cm, "blur", cm);
 17.2177 -      cm.state.focused = false;
 17.2178 -      cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", "");
 17.2179 -    }
 17.2180 -    clearInterval(cm.display.blinker);
 17.2181 -    setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150);
 17.2182 -  }
 17.2183 -
 17.2184 -  var detectingSelectAll;
 17.2185 -  function onContextMenu(cm, e) {
 17.2186 -    if (signalDOMEvent(cm, e, "contextmenu")) return;
 17.2187 -    var display = cm.display, sel = cm.doc.sel;
 17.2188 -    if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;
 17.2189 -
 17.2190 -    var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
 17.2191 -    if (!pos || opera) return; // Opera is difficult.
 17.2192 -
 17.2193 -    // Reset the current text selection only if the click is done outside of the selection
 17.2194 -    // and 'resetSelectionOnContextMenu' option is true.
 17.2195 -    var reset = cm.options.resetSelectionOnContextMenu;
 17.2196 -    if (reset && (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)))
 17.2197 -      operation(cm, setSelection)(cm.doc, pos, pos);
 17.2198 -
 17.2199 -    var oldCSS = display.input.style.cssText;
 17.2200 -    display.inputDiv.style.position = "absolute";
 17.2201 -    display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
 17.2202 -      "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" +
 17.2203 -      "border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";
 17.2204 -    focusInput(cm);
 17.2205 -    resetInput(cm, true);
 17.2206 -    // Adds "Select all" to context menu in FF
 17.2207 -    if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " ";
 17.2208 -
 17.2209 -    function prepareSelectAllHack() {
 17.2210 -      if (display.input.selectionStart != null) {
 17.2211 -        var extval = display.input.value = "\u200b" + (posEq(sel.from, sel.to) ? "" : display.input.value);
 17.2212 -        display.prevInput = "\u200b";
 17.2213 -        display.input.selectionStart = 1; display.input.selectionEnd = extval.length;
 17.2214 -      }
 17.2215 -    }
 17.2216 -    function rehide() {
 17.2217 -      display.inputDiv.style.position = "relative";
 17.2218 -      display.input.style.cssText = oldCSS;
 17.2219 -      if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;
 17.2220 -      slowPoll(cm);
 17.2221 -
 17.2222 -      // Try to detect the user choosing select-all
 17.2223 -      if (display.input.selectionStart != null) {
 17.2224 -        if (!ie || ie_lt9) prepareSelectAllHack();
 17.2225 -        clearTimeout(detectingSelectAll);
 17.2226 -        var i = 0, poll = function(){
 17.2227 -          if (display.prevInput == " " && display.input.selectionStart == 0)
 17.2228 -            operation(cm, commands.selectAll)(cm);
 17.2229 -          else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);
 17.2230 -          else resetInput(cm);
 17.2231 -        };
 17.2232 -        detectingSelectAll = setTimeout(poll, 200);
 17.2233 -      }
 17.2234 -    }
 17.2235 -
 17.2236 -    if (ie && !ie_lt9) prepareSelectAllHack();
 17.2237 -    if (captureMiddleClick) {
 17.2238 -      e_stop(e);
 17.2239 -      var mouseup = function() {
 17.2240 -        off(window, "mouseup", mouseup);
 17.2241 -        setTimeout(rehide, 20);
 17.2242 -      };
 17.2243 -      on(window, "mouseup", mouseup);
 17.2244 -    } else {
 17.2245 -      setTimeout(rehide, 50);
 17.2246 -    }
 17.2247 -  }
 17.2248 -
 17.2249 -  // UPDATING
 17.2250 -
 17.2251 -  var changeEnd = CodeMirror.changeEnd = function(change) {
 17.2252 -    if (!change.text) return change.to;
 17.2253 -    return Pos(change.from.line + change.text.length - 1,
 17.2254 -               lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));
 17.2255 -  };
 17.2256 -
 17.2257 -  // Make sure a position will be valid after the given change.
 17.2258 -  function clipPostChange(doc, change, pos) {
 17.2259 -    if (!posLess(change.from, pos)) return clipPos(doc, pos);
 17.2260 -    var diff = (change.text.length - 1) - (change.to.line - change.from.line);
 17.2261 -    if (pos.line > change.to.line + diff) {
 17.2262 -      var preLine = pos.line - diff, lastLine = doc.first + doc.size - 1;
 17.2263 -      if (preLine > lastLine) return Pos(lastLine, getLine(doc, lastLine).text.length);
 17.2264 -      return clipToLen(pos, getLine(doc, preLine).text.length);
 17.2265 -    }
 17.2266 -    if (pos.line == change.to.line + diff)
 17.2267 -      return clipToLen(pos, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0) +
 17.2268 -                       getLine(doc, change.to.line).text.length - change.to.ch);
 17.2269 -    var inside = pos.line - change.from.line;
 17.2270 -    return clipToLen(pos, change.text[inside].length + (inside ? 0 : change.from.ch));
 17.2271 -  }
 17.2272 -
 17.2273 -  // Hint can be null|"end"|"start"|"around"|{anchor,head}
 17.2274 -  function computeSelAfterChange(doc, change, hint) {
 17.2275 -    if (hint && typeof hint == "object") // Assumed to be {anchor, head} object
 17.2276 -      return {anchor: clipPostChange(doc, change, hint.anchor),
 17.2277 -              head: clipPostChange(doc, change, hint.head)};
 17.2278 -
 17.2279 -    if (hint == "start") return {anchor: change.from, head: change.from};
 17.2280 -
 17.2281 -    var end = changeEnd(change);
 17.2282 -    if (hint == "around") return {anchor: change.from, head: end};
 17.2283 -    if (hint == "end") return {anchor: end, head: end};
 17.2284 -
 17.2285 -    // hint is null, leave the selection alone as much as possible
 17.2286 -    var adjustPos = function(pos) {
 17.2287 -      if (posLess(pos, change.from)) return pos;
 17.2288 -      if (!posLess(change.to, pos)) return end;
 17.2289 -
 17.2290 -      var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
 17.2291 -      if (pos.line == change.to.line) ch += end.ch - change.to.ch;
 17.2292 -      return Pos(line, ch);
 17.2293 -    };
 17.2294 -    return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)};
 17.2295 -  }
 17.2296 -
 17.2297 -  function filterChange(doc, change, update) {
 17.2298 -    var obj = {
 17.2299 -      canceled: false,
 17.2300 -      from: change.from,
 17.2301 -      to: change.to,
 17.2302 -      text: change.text,
 17.2303 -      origin: change.origin,
 17.2304 -      cancel: function() { this.canceled = true; }
 17.2305 -    };
 17.2306 -    if (update) obj.update = function(from, to, text, origin) {
 17.2307 -      if (from) this.from = clipPos(doc, from);
 17.2308 -      if (to) this.to = clipPos(doc, to);
 17.2309 -      if (text) this.text = text;
 17.2310 -      if (origin !== undefined) this.origin = origin;
 17.2311 -    };
 17.2312 -    signal(doc, "beforeChange", doc, obj);
 17.2313 -    if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj);
 17.2314 -
 17.2315 -    if (obj.canceled) return null;
 17.2316 -    return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};
 17.2317 -  }
 17.2318 -
 17.2319 -  // Replace the range from from to to by the strings in replacement.
 17.2320 -  // change is a {from, to, text [, origin]} object
 17.2321 -  function makeChange(doc, change, selUpdate, ignoreReadOnly) {
 17.2322 -    if (doc.cm) {
 17.2323 -      if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, selUpdate, ignoreReadOnly);
 17.2324 -      if (doc.cm.state.suppressEdits) return;
 17.2325 -    }
 17.2326 -
 17.2327 -    if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
 17.2328 -      change = filterChange(doc, change, true);
 17.2329 -      if (!change) return;
 17.2330 -    }
 17.2331 -
 17.2332 -    // Possibly split or suppress the update based on the presence
 17.2333 -    // of read-only spans in its range.
 17.2334 -    var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
 17.2335 -    if (split) {
 17.2336 -      for (var i = split.length - 1; i >= 1; --i)
 17.2337 -        makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: [""]});
 17.2338 -      if (split.length)
 17.2339 -        makeChangeNoReadonly(doc, {from: split[0].from, to: split[0].to, text: change.text}, selUpdate);
 17.2340 -    } else {
 17.2341 -      makeChangeNoReadonly(doc, change, selUpdate);
 17.2342 -    }
 17.2343 -  }
 17.2344 -
 17.2345 -  function makeChangeNoReadonly(doc, change, selUpdate) {
 17.2346 -    if (change.text.length == 1 && change.text[0] == "" && posEq(change.from, change.to)) return;
 17.2347 -    var selAfter = computeSelAfterChange(doc, change, selUpdate);
 17.2348 -    addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
 17.2349 -
 17.2350 -    makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));
 17.2351 -    var rebased = [];
 17.2352 -
 17.2353 -    linkedDocs(doc, function(doc, sharedHist) {
 17.2354 -      if (!sharedHist && indexOf(rebased, doc.history) == -1) {
 17.2355 -        rebaseHist(doc.history, change);
 17.2356 -        rebased.push(doc.history);
 17.2357 -      }
 17.2358 -      makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));
 17.2359 -    });
 17.2360 -  }
 17.2361 -
 17.2362 -  function makeChangeFromHistory(doc, type) {
 17.2363 -    if (doc.cm && doc.cm.state.suppressEdits) return;
 17.2364 -
 17.2365 -    var hist = doc.history;
 17.2366 -    var event = (type == "undo" ? hist.done : hist.undone).pop();
 17.2367 -    if (!event) return;
 17.2368 -
 17.2369 -    var anti = {changes: [], anchorBefore: event.anchorAfter, headBefore: event.headAfter,
 17.2370 -                anchorAfter: event.anchorBefore, headAfter: event.headBefore,
 17.2371 -                generation: hist.generation};
 17.2372 -    (type == "undo" ? hist.undone : hist.done).push(anti);
 17.2373 -    hist.generation = event.generation || ++hist.maxGeneration;
 17.2374 -
 17.2375 -    var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange");
 17.2376 -
 17.2377 -    for (var i = event.changes.length - 1; i >= 0; --i) {
 17.2378 -      var change = event.changes[i];
 17.2379 -      change.origin = type;
 17.2380 -      if (filter && !filterChange(doc, change, false)) {
 17.2381 -        (type == "undo" ? hist.done : hist.undone).length = 0;
 17.2382 -        return;
 17.2383 -      }
 17.2384 -
 17.2385 -      anti.changes.push(historyChangeFromChange(doc, change));
 17.2386 -
 17.2387 -      var after = i ? computeSelAfterChange(doc, change, null)
 17.2388 -                    : {anchor: event.anchorBefore, head: event.headBefore};
 17.2389 -      makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
 17.2390 -      var rebased = [];
 17.2391 -
 17.2392 -      linkedDocs(doc, function(doc, sharedHist) {
 17.2393 -        if (!sharedHist && indexOf(rebased, doc.history) == -1) {
 17.2394 -          rebaseHist(doc.history, change);
 17.2395 -          rebased.push(doc.history);
 17.2396 -        }
 17.2397 -        makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));
 17.2398 -      });
 17.2399 -    }
 17.2400 -  }
 17.2401 -
 17.2402 -  function shiftDoc(doc, distance) {
 17.2403 -    function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);}
 17.2404 -    doc.first += distance;
 17.2405 -    if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance);
 17.2406 -    doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor);
 17.2407 -    doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to);
 17.2408 -  }
 17.2409 -
 17.2410 -  function makeChangeSingleDoc(doc, change, selAfter, spans) {
 17.2411 -    if (doc.cm && !doc.cm.curOp)
 17.2412 -      return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);
 17.2413 -
 17.2414 -    if (change.to.line < doc.first) {
 17.2415 -      shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
 17.2416 -      return;
 17.2417 -    }
 17.2418 -    if (change.from.line > doc.lastLine()) return;
 17.2419 -
 17.2420 -    // Clip the change to the size of this doc
 17.2421 -    if (change.from.line < doc.first) {
 17.2422 -      var shift = change.text.length - 1 - (doc.first - change.from.line);
 17.2423 -      shiftDoc(doc, shift);
 17.2424 -      change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
 17.2425 -                text: [lst(change.text)], origin: change.origin};
 17.2426 -    }
 17.2427 -    var last = doc.lastLine();
 17.2428 -    if (change.to.line > last) {
 17.2429 -      change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
 17.2430 -                text: [change.text[0]], origin: change.origin};
 17.2431 -    }
 17.2432 -
 17.2433 -    change.removed = getBetween(doc, change.from, change.to);
 17.2434 -
 17.2435 -    if (!selAfter) selAfter = computeSelAfterChange(doc, change, null);
 17.2436 -    if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans, selAfter);
 17.2437 -    else updateDoc(doc, change, spans, selAfter);
 17.2438 -  }
 17.2439 -
 17.2440 -  function makeChangeSingleDocInEditor(cm, change, spans, selAfter) {
 17.2441 -    var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
 17.2442 -
 17.2443 -    var recomputeMaxLength = false, checkWidthStart = from.line;
 17.2444 -    if (!cm.options.lineWrapping) {
 17.2445 -      checkWidthStart = lineNo(visualLine(doc, getLine(doc, from.line)));
 17.2446 -      doc.iter(checkWidthStart, to.line + 1, function(line) {
 17.2447 -        if (line == display.maxLine) {
 17.2448 -          recomputeMaxLength = true;
 17.2449 -          return true;
 17.2450 -        }
 17.2451 -      });
 17.2452 -    }
 17.2453 -
 17.2454 -    if (!posLess(doc.sel.head, change.from) && !posLess(change.to, doc.sel.head))
 17.2455 -      cm.curOp.cursorActivity = true;
 17.2456 -
 17.2457 -    updateDoc(doc, change, spans, selAfter, estimateHeight(cm));
 17.2458 -
 17.2459 -    if (!cm.options.lineWrapping) {
 17.2460 -      doc.iter(checkWidthStart, from.line + change.text.length, function(line) {
 17.2461 -        var len = lineLength(doc, line);
 17.2462 -        if (len > display.maxLineLength) {
 17.2463 -          display.maxLine = line;
 17.2464 -          display.maxLineLength = len;
 17.2465 -          display.maxLineChanged = true;
 17.2466 -          recomputeMaxLength = false;
 17.2467 -        }
 17.2468 -      });
 17.2469 -      if (recomputeMaxLength) cm.curOp.updateMaxLine = true;
 17.2470 -    }
 17.2471 -
 17.2472 -    // Adjust frontier, schedule worker
 17.2473 -    doc.frontier = Math.min(doc.frontier, from.line);
 17.2474 -    startWorker(cm, 400);
 17.2475 -
 17.2476 -    var lendiff = change.text.length - (to.line - from.line) - 1;
 17.2477 -    // Remember that these lines changed, for updating the display
 17.2478 -    regChange(cm, from.line, to.line + 1, lendiff);
 17.2479 -
 17.2480 -    if (hasHandler(cm, "change")) {
 17.2481 -      var changeObj = {from: from, to: to,
 17.2482 -                       text: change.text,
 17.2483 -                       removed: change.removed,
 17.2484 -                       origin: change.origin};
 17.2485 -      if (cm.curOp.textChanged) {
 17.2486 -        for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {}
 17.2487 -        cur.next = changeObj;
 17.2488 -      } else cm.curOp.textChanged = changeObj;
 17.2489 -    }
 17.2490 -  }
 17.2491 -
 17.2492 -  function replaceRange(doc, code, from, to, origin) {
 17.2493 -    if (!to) to = from;
 17.2494 -    if (posLess(to, from)) { var tmp = to; to = from; from = tmp; }
 17.2495 -    if (typeof code == "string") code = splitLines(code);
 17.2496 -    makeChange(doc, {from: from, to: to, text: code, origin: origin}, null);
 17.2497 -  }
 17.2498 -
 17.2499 -  // POSITION OBJECT
 17.2500 -
 17.2501 -  function Pos(line, ch) {
 17.2502 -    if (!(this instanceof Pos)) return new Pos(line, ch);
 17.2503 -    this.line = line; this.ch = ch;
 17.2504 -  }
 17.2505 -  CodeMirror.Pos = Pos;
 17.2506 -
 17.2507 -  function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}
 17.2508 -  function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}
 17.2509 -  function copyPos(x) {return Pos(x.line, x.ch);}
 17.2510 -
 17.2511 -  // SELECTION
 17.2512 -
 17.2513 -  function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
 17.2514 -  function clipPos(doc, pos) {
 17.2515 -    if (pos.line < doc.first) return Pos(doc.first, 0);
 17.2516 -    var last = doc.first + doc.size - 1;
 17.2517 -    if (pos.line > last) return Pos(last, getLine(doc, last).text.length);
 17.2518 -    return clipToLen(pos, getLine(doc, pos.line).text.length);
 17.2519 -  }
 17.2520 -  function clipToLen(pos, linelen) {
 17.2521 -    var ch = pos.ch;
 17.2522 -    if (ch == null || ch > linelen) return Pos(pos.line, linelen);
 17.2523 -    else if (ch < 0) return Pos(pos.line, 0);
 17.2524 -    else return pos;
 17.2525 -  }
 17.2526 -  function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}
 17.2527 -
 17.2528 -  // If shift is held, this will move the selection anchor. Otherwise,
 17.2529 -  // it'll set the whole selection.
 17.2530 -  function extendSelection(doc, pos, other, bias) {
 17.2531 -    if (doc.sel.shift || doc.sel.extend) {
 17.2532 -      var anchor = doc.sel.anchor;
 17.2533 -      if (other) {
 17.2534 -        var posBefore = posLess(pos, anchor);
 17.2535 -        if (posBefore != posLess(other, anchor)) {
 17.2536 -          anchor = pos;
 17.2537 -          pos = other;
 17.2538 -        } else if (posBefore != posLess(pos, other)) {
 17.2539 -          pos = other;
 17.2540 -        }
 17.2541 -      }
 17.2542 -      setSelection(doc, anchor, pos, bias);
 17.2543 -    } else {
 17.2544 -      setSelection(doc, pos, other || pos, bias);
 17.2545 -    }
 17.2546 -    if (doc.cm) doc.cm.curOp.userSelChange = true;
 17.2547 -  }
 17.2548 -
 17.2549 -  function filterSelectionChange(doc, anchor, head) {
 17.2550 -    var obj = {anchor: anchor, head: head};
 17.2551 -    signal(doc, "beforeSelectionChange", doc, obj);
 17.2552 -    if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
 17.2553 -    obj.anchor = clipPos(doc, obj.anchor); obj.head = clipPos(doc, obj.head);
 17.2554 -    return obj;
 17.2555 -  }
 17.2556 -
 17.2557 -  // Update the selection. Last two args are only used by
 17.2558 -  // updateDoc, since they have to be expressed in the line
 17.2559 -  // numbers before the update.
 17.2560 -  function setSelection(doc, anchor, head, bias, checkAtomic) {
 17.2561 -    if (!checkAtomic && hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) {
 17.2562 -      var filtered = filterSelectionChange(doc, anchor, head);
 17.2563 -      head = filtered.head;
 17.2564 -      anchor = filtered.anchor;
 17.2565 -    }
 17.2566 -
 17.2567 -    var sel = doc.sel;
 17.2568 -    sel.goalColumn = null;
 17.2569 -    if (bias == null) bias = posLess(head, sel.head) ? -1 : 1;
 17.2570 -    // Skip over atomic spans.
 17.2571 -    if (checkAtomic || !posEq(anchor, sel.anchor))
 17.2572 -      anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push");
 17.2573 -    if (checkAtomic || !posEq(head, sel.head))
 17.2574 -      head = skipAtomic(doc, head, bias, checkAtomic != "push");
 17.2575 -
 17.2576 -    if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;
 17.2577 -
 17.2578 -    sel.anchor = anchor; sel.head = head;
 17.2579 -    var inv = posLess(head, anchor);
 17.2580 -    sel.from = inv ? head : anchor;
 17.2581 -    sel.to = inv ? anchor : head;
 17.2582 -
 17.2583 -    if (doc.cm)
 17.2584 -      doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged =
 17.2585 -        doc.cm.curOp.cursorActivity = true;
 17.2586 -
 17.2587 -    signalLater(doc, "cursorActivity", doc);
 17.2588 -  }
 17.2589 -
 17.2590 -  function reCheckSelection(cm) {
 17.2591 -    setSelection(cm.doc, cm.doc.sel.from, cm.doc.sel.to, null, "push");
 17.2592 -  }
 17.2593 -
 17.2594 -  function skipAtomic(doc, pos, bias, mayClear) {
 17.2595 -    var flipped = false, curPos = pos;
 17.2596 -    var dir = bias || 1;
 17.2597 -    doc.cantEdit = false;
 17.2598 -    search: for (;;) {
 17.2599 -      var line = getLine(doc, curPos.line);
 17.2600 -      if (line.markedSpans) {
 17.2601 -        for (var i = 0; i < line.markedSpans.length; ++i) {
 17.2602 -          var sp = line.markedSpans[i], m = sp.marker;
 17.2603 -          if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&
 17.2604 -              (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {
 17.2605 -            if (mayClear) {
 17.2606 -              signal(m, "beforeCursorEnter");
 17.2607 -              if (m.explicitlyCleared) {
 17.2608 -                if (!line.markedSpans) break;
 17.2609 -                else {--i; continue;}
 17.2610 -              }
 17.2611 -            }
 17.2612 -            if (!m.atomic) continue;
 17.2613 -            var newPos = m.find()[dir < 0 ? "from" : "to"];
 17.2614 -            if (posEq(newPos, curPos)) {
 17.2615 -              newPos.ch += dir;
 17.2616 -              if (newPos.ch < 0) {
 17.2617 -                if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));
 17.2618 -                else newPos = null;
 17.2619 -              } else if (newPos.ch > line.text.length) {
 17.2620 -                if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0);
 17.2621 -                else newPos = null;
 17.2622 -              }
 17.2623 -              if (!newPos) {
 17.2624 -                if (flipped) {
 17.2625 -                  // Driven in a corner -- no valid cursor position found at all
 17.2626 -                  // -- try again *with* clearing, if we didn't already
 17.2627 -                  if (!mayClear) return skipAtomic(doc, pos, bias, true);
 17.2628 -                  // Otherwise, turn off editing until further notice, and return the start of the doc
 17.2629 -                  doc.cantEdit = true;
 17.2630 -                  return Pos(doc.first, 0);
 17.2631 -                }
 17.2632 -                flipped = true; newPos = pos; dir = -dir;
 17.2633 -              }
 17.2634 -            }
 17.2635 -            curPos = newPos;
 17.2636 -            continue search;
 17.2637 -          }
 17.2638 -        }
 17.2639 -      }
 17.2640 -      return curPos;
 17.2641 -    }
 17.2642 -  }
 17.2643 -
 17.2644 -  // SCROLLING
 17.2645 -
 17.2646 -  function scrollCursorIntoView(cm) {
 17.2647 -    var coords = scrollPosIntoView(cm, cm.doc.sel.head, null, cm.options.cursorScrollMargin);
 17.2648 -    if (!cm.state.focused) return;
 17.2649 -    var display = cm.display, box = getRect(display.sizer), doScroll = null;
 17.2650 -    if (coords.top + box.top < 0) doScroll = true;
 17.2651 -    else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;
 17.2652 -    if (doScroll != null && !phantom) {
 17.2653 -      var hidden = display.cursor.style.display == "none";
 17.2654 -      if (hidden) {
 17.2655 -        display.cursor.style.display = "";
 17.2656 -        display.cursor.style.left = coords.left + "px";
 17.2657 -        display.cursor.style.top = (coords.top - display.viewOffset) + "px";
 17.2658 -      }
 17.2659 -      display.cursor.scrollIntoView(doScroll);
 17.2660 -      if (hidden) display.cursor.style.display = "none";
 17.2661 -    }
 17.2662 -  }
 17.2663 -
 17.2664 -  function scrollPosIntoView(cm, pos, end, margin) {
 17.2665 -    if (margin == null) margin = 0;
 17.2666 -    for (;;) {
 17.2667 -      var changed = false, coords = cursorCoords(cm, pos);
 17.2668 -      var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
 17.2669 -      var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
 17.2670 -                                         Math.min(coords.top, endCoords.top) - margin,
 17.2671 -                                         Math.max(coords.left, endCoords.left),
 17.2672 -                                         Math.max(coords.bottom, endCoords.bottom) + margin);
 17.2673 -      var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
 17.2674 -      if (scrollPos.scrollTop != null) {
 17.2675 -        setScrollTop(cm, scrollPos.scrollTop);
 17.2676 -        if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;
 17.2677 -      }
 17.2678 -      if (scrollPos.scrollLeft != null) {
 17.2679 -        setScrollLeft(cm, scrollPos.scrollLeft);
 17.2680 -        if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;
 17.2681 -      }
 17.2682 -      if (!changed) return coords;
 17.2683 -    }
 17.2684 -  }
 17.2685 -
 17.2686 -  function scrollIntoView(cm, x1, y1, x2, y2) {
 17.2687 -    var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);
 17.2688 -    if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);
 17.2689 -    if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);
 17.2690 -  }
 17.2691 -
 17.2692 -  function calculateScrollPos(cm, x1, y1, x2, y2) {
 17.2693 -    var display = cm.display, snapMargin = textHeight(cm.display);
 17.2694 -    if (y1 < 0) y1 = 0;
 17.2695 -    var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {};
 17.2696 -    var docBottom = cm.doc.height + paddingVert(display);
 17.2697 -    var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;
 17.2698 -    if (y1 < screentop) {
 17.2699 -      result.scrollTop = atTop ? 0 : y1;
 17.2700 -    } else if (y2 > screentop + screen) {
 17.2701 -      var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);
 17.2702 -      if (newTop != screentop) result.scrollTop = newTop;
 17.2703 -    }
 17.2704 -
 17.2705 -    var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft;
 17.2706 -    x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;
 17.2707 -    var gutterw = display.gutters.offsetWidth;
 17.2708 -    var atLeft = x1 < gutterw + 10;
 17.2709 -    if (x1 < screenleft + gutterw || atLeft) {
 17.2710 -      if (atLeft) x1 = 0;
 17.2711 -      result.scrollLeft = Math.max(0, x1 - 10 - gutterw);
 17.2712 -    } else if (x2 > screenw + screenleft - 3) {
 17.2713 -      result.scrollLeft = x2 + 10 - screenw;
 17.2714 -    }
 17.2715 -    return result;
 17.2716 -  }
 17.2717 -
 17.2718 -  function updateScrollPos(cm, left, top) {
 17.2719 -    cm.curOp.updateScrollPos = {scrollLeft: left == null ? cm.doc.scrollLeft : left,
 17.2720 -                                scrollTop: top == null ? cm.doc.scrollTop : top};
 17.2721 -  }
 17.2722 -
 17.2723 -  function addToScrollPos(cm, left, top) {
 17.2724 -    var pos = cm.curOp.updateScrollPos || (cm.curOp.updateScrollPos = {scrollLeft: cm.doc.scrollLeft, scrollTop: cm.doc.scrollTop});
 17.2725 -    var scroll = cm.display.scroller;
 17.2726 -    pos.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, pos.scrollTop + top));
 17.2727 -    pos.scrollLeft = Math.max(0, Math.min(scroll.scrollWidth - scroll.clientWidth, pos.scrollLeft + left));
 17.2728 -  }
 17.2729 -
 17.2730 -  // API UTILITIES
 17.2731 -
 17.2732 -  function indentLine(cm, n, how, aggressive) {
 17.2733 -    var doc = cm.doc;
 17.2734 -    if (how == null) how = "add";
 17.2735 -    if (how == "smart") {
 17.2736 -      if (!cm.doc.mode.indent) how = "prev";
 17.2737 -      else var state = getStateBefore(cm, n);
 17.2738 -    }
 17.2739 -
 17.2740 -    var tabSize = cm.options.tabSize;
 17.2741 -    var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);
 17.2742 -    var curSpaceString = line.text.match(/^\s*/)[0], indentation;
 17.2743 -    if (how == "smart") {
 17.2744 -      indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);
 17.2745 -      if (indentation == Pass) {
 17.2746 -        if (!aggressive) return;
 17.2747 -        how = "prev";
 17.2748 -      }
 17.2749 -    }
 17.2750 -    if (how == "prev") {
 17.2751 -      if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);
 17.2752 -      else indentation = 0;
 17.2753 -    } else if (how == "add") {
 17.2754 -      indentation = curSpace + cm.options.indentUnit;
 17.2755 -    } else if (how == "subtract") {
 17.2756 -      indentation = curSpace - cm.options.indentUnit;
 17.2757 -    } else if (typeof how == "number") {
 17.2758 -      indentation = curSpace + how;
 17.2759 -    }
 17.2760 -    indentation = Math.max(0, indentation);
 17.2761 -
 17.2762 -    var indentString = "", pos = 0;
 17.2763 -    if (cm.options.indentWithTabs)
 17.2764 -      for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
 17.2765 -    if (pos < indentation) indentString += spaceStr(indentation - pos);
 17.2766 -
 17.2767 -    if (indentString != curSpaceString)
 17.2768 -      replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
 17.2769 -    line.stateAfter = null;
 17.2770 -  }
 17.2771 -
 17.2772 -  function changeLine(cm, handle, op) {
 17.2773 -    var no = handle, line = handle, doc = cm.doc;
 17.2774 -    if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle));
 17.2775 -    else no = lineNo(handle);
 17.2776 -    if (no == null) return null;
 17.2777 -    if (op(line, no)) regChange(cm, no, no + 1);
 17.2778 -    else return null;
 17.2779 -    return line;
 17.2780 -  }
 17.2781 -
 17.2782 -  function findPosH(doc, pos, dir, unit, visually) {
 17.2783 -    var line = pos.line, ch = pos.ch, origDir = dir;
 17.2784 -    var lineObj = getLine(doc, line);
 17.2785 -    var possible = true;
 17.2786 -    function findNextLine() {
 17.2787 -      var l = line + dir;
 17.2788 -      if (l < doc.first || l >= doc.first + doc.size) return (possible = false);
 17.2789 -      line = l;
 17.2790 -      return lineObj = getLine(doc, l);
 17.2791 -    }
 17.2792 -    function moveOnce(boundToLine) {
 17.2793 -      var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);
 17.2794 -      if (next == null) {
 17.2795 -        if (!boundToLine && findNextLine()) {
 17.2796 -          if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
 17.2797 -          else ch = dir < 0 ? lineObj.text.length : 0;
 17.2798 -        } else return (possible = false);
 17.2799 -      } else ch = next;
 17.2800 -      return true;
 17.2801 -    }
 17.2802 -
 17.2803 -    if (unit == "char") moveOnce();
 17.2804 -    else if (unit == "column") moveOnce(true);
 17.2805 -    else if (unit == "word" || unit == "group") {
 17.2806 -      var sawType = null, group = unit == "group";
 17.2807 -      for (var first = true;; first = false) {
 17.2808 -        if (dir < 0 && !moveOnce(!first)) break;
 17.2809 -        var cur = lineObj.text.charAt(ch) || "\n";
 17.2810 -        var type = isWordChar(cur) ? "w"
 17.2811 -          : !group ? null
 17.2812 -          : /\s/.test(cur) ? null
 17.2813 -          : "p";
 17.2814 -        if (sawType && sawType != type) {
 17.2815 -          if (dir < 0) {dir = 1; moveOnce();}
 17.2816 -          break;
 17.2817 -        }
 17.2818 -        if (type) sawType = type;
 17.2819 -        if (dir > 0 && !moveOnce(!first)) break;
 17.2820 -      }
 17.2821 -    }
 17.2822 -    var result = skipAtomic(doc, Pos(line, ch), origDir, true);
 17.2823 -    if (!possible) result.hitSide = true;
 17.2824 -    return result;
 17.2825 -  }
 17.2826 -
 17.2827 -  function findPosV(cm, pos, dir, unit) {
 17.2828 -    var doc = cm.doc, x = pos.left, y;
 17.2829 -    if (unit == "page") {
 17.2830 -      var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
 17.2831 -      y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));
 17.2832 -    } else if (unit == "line") {
 17.2833 -      y = dir > 0 ? pos.bottom + 3 : pos.top - 3;
 17.2834 -    }
 17.2835 -    for (;;) {
 17.2836 -      var target = coordsChar(cm, x, y);
 17.2837 -      if (!target.outside) break;
 17.2838 -      if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }
 17.2839 -      y += dir * 5;
 17.2840 -    }
 17.2841 -    return target;
 17.2842 -  }
 17.2843 -
 17.2844 -  function findWordAt(line, pos) {
 17.2845 -    var start = pos.ch, end = pos.ch;
 17.2846 -    if (line) {
 17.2847 -      if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;
 17.2848 -      var startChar = line.charAt(start);
 17.2849 -      var check = isWordChar(startChar) ? isWordChar
 17.2850 -        : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);}
 17.2851 -        : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);};
 17.2852 -      while (start > 0 && check(line.charAt(start - 1))) --start;
 17.2853 -      while (end < line.length && check(line.charAt(end))) ++end;
 17.2854 -    }
 17.2855 -    return {from: Pos(pos.line, start), to: Pos(pos.line, end)};
 17.2856 -  }
 17.2857 -
 17.2858 -  function selectLine(cm, line) {
 17.2859 -    extendSelection(cm.doc, Pos(line, 0), clipPos(cm.doc, Pos(line + 1, 0)));
 17.2860 -  }
 17.2861 -
 17.2862 -  // PROTOTYPE
 17.2863 -
 17.2864 -  // The publicly visible API. Note that operation(null, f) means
 17.2865 -  // 'wrap f in an operation, performed on its `this` parameter'
 17.2866 -
 17.2867 -  CodeMirror.prototype = {
 17.2868 -    constructor: CodeMirror,
 17.2869 -    focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);},
 17.2870 -
 17.2871 -    setOption: function(option, value) {
 17.2872 -      var options = this.options, old = options[option];
 17.2873 -      if (options[option] == value && option != "mode") return;
 17.2874 -      options[option] = value;
 17.2875 -      if (optionHandlers.hasOwnProperty(option))
 17.2876 -        operation(this, optionHandlers[option])(this, value, old);
 17.2877 -    },
 17.2878 -
 17.2879 -    getOption: function(option) {return this.options[option];},
 17.2880 -    getDoc: function() {return this.doc;},
 17.2881 -
 17.2882 -    addKeyMap: function(map, bottom) {
 17.2883 -      this.state.keyMaps[bottom ? "push" : "unshift"](map);
 17.2884 -    },
 17.2885 -    removeKeyMap: function(map) {
 17.2886 -      var maps = this.state.keyMaps;
 17.2887 -      for (var i = 0; i < maps.length; ++i)
 17.2888 -        if (maps[i] == map || (typeof maps[i] != "string" && maps[i].name == map)) {
 17.2889 -          maps.splice(i, 1);
 17.2890 -          return true;
 17.2891 -        }
 17.2892 -    },
 17.2893 -
 17.2894 -    addOverlay: operation(null, function(spec, options) {
 17.2895 -      var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);
 17.2896 -      if (mode.startState) throw new Error("Overlays may not be stateful.");
 17.2897 -      this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});
 17.2898 -      this.state.modeGen++;
 17.2899 -      regChange(this);
 17.2900 -    }),
 17.2901 -    removeOverlay: operation(null, function(spec) {
 17.2902 -      var overlays = this.state.overlays;
 17.2903 -      for (var i = 0; i < overlays.length; ++i) {
 17.2904 -        var cur = overlays[i].modeSpec;
 17.2905 -        if (cur == spec || typeof spec == "string" && cur.name == spec) {
 17.2906 -          overlays.splice(i, 1);
 17.2907 -          this.state.modeGen++;
 17.2908 -          regChange(this);
 17.2909 -          return;
 17.2910 -        }
 17.2911 -      }
 17.2912 -    }),
 17.2913 -
 17.2914 -    indentLine: operation(null, function(n, dir, aggressive) {
 17.2915 -      if (typeof dir != "string" && typeof dir != "number") {
 17.2916 -        if (dir == null) dir = this.options.smartIndent ? "smart" : "prev";
 17.2917 -        else dir = dir ? "add" : "subtract";
 17.2918 -      }
 17.2919 -      if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);
 17.2920 -    }),
 17.2921 -    indentSelection: operation(null, function(how) {
 17.2922 -      var sel = this.doc.sel;
 17.2923 -      if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how);
 17.2924 -      var e = sel.to.line - (sel.to.ch ? 0 : 1);
 17.2925 -      for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how);
 17.2926 -    }),
 17.2927 -
 17.2928 -    // Fetch the parser token for a given character. Useful for hacks
 17.2929 -    // that want to inspect the mode state (say, for completion).
 17.2930 -    getTokenAt: function(pos, precise) {
 17.2931 -      var doc = this.doc;
 17.2932 -      pos = clipPos(doc, pos);
 17.2933 -      var state = getStateBefore(this, pos.line, precise), mode = this.doc.mode;
 17.2934 -      var line = getLine(doc, pos.line);
 17.2935 -      var stream = new StringStream(line.text, this.options.tabSize);
 17.2936 -      while (stream.pos < pos.ch && !stream.eol()) {
 17.2937 -        stream.start = stream.pos;
 17.2938 -        var style = mode.token(stream, state);
 17.2939 -      }
 17.2940 -      return {start: stream.start,
 17.2941 -              end: stream.pos,
 17.2942 -              string: stream.current(),
 17.2943 -              className: style || null, // Deprecated, use 'type' instead
 17.2944 -              type: style || null,
 17.2945 -              state: state};
 17.2946 -    },
 17.2947 -
 17.2948 -    getTokenTypeAt: function(pos) {
 17.2949 -      pos = clipPos(this.doc, pos);
 17.2950 -      var styles = getLineStyles(this, getLine(this.doc, pos.line));
 17.2951 -      var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;
 17.2952 -      if (ch == 0) return styles[2];
 17.2953 -      for (;;) {
 17.2954 -        var mid = (before + after) >> 1;
 17.2955 -        if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;
 17.2956 -        else if (styles[mid * 2 + 1] < ch) before = mid + 1;
 17.2957 -        else return styles[mid * 2 + 2];
 17.2958 -      }
 17.2959 -    },
 17.2960 -
 17.2961 -    getModeAt: function(pos) {
 17.2962 -      var mode = this.doc.mode;
 17.2963 -      if (!mode.innerMode) return mode;
 17.2964 -      return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;
 17.2965 -    },
 17.2966 -
 17.2967 -    getHelper: function(pos, type) {
 17.2968 -      if (!helpers.hasOwnProperty(type)) return;
 17.2969 -      var help = helpers[type], mode = this.getModeAt(pos);
 17.2970 -      return mode[type] && help[mode[type]] ||
 17.2971 -        mode.helperType && help[mode.helperType] ||
 17.2972 -        help[mode.name];
 17.2973 -    },
 17.2974 -
 17.2975 -    getStateAfter: function(line, precise) {
 17.2976 -      var doc = this.doc;
 17.2977 -      line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
 17.2978 -      return getStateBefore(this, line + 1, precise);
 17.2979 -    },
 17.2980 -
 17.2981 -    cursorCoords: function(start, mode) {
 17.2982 -      var pos, sel = this.doc.sel;
 17.2983 -      if (start == null) pos = sel.head;
 17.2984 -      else if (typeof start == "object") pos = clipPos(this.doc, start);
 17.2985 -      else pos = start ? sel.from : sel.to;
 17.2986 -      return cursorCoords(this, pos, mode || "page");
 17.2987 -    },
 17.2988 -
 17.2989 -    charCoords: function(pos, mode) {
 17.2990 -      return charCoords(this, clipPos(this.doc, pos), mode || "page");
 17.2991 -    },
 17.2992 -
 17.2993 -    coordsChar: function(coords, mode) {
 17.2994 -      coords = fromCoordSystem(this, coords, mode || "page");
 17.2995 -      return coordsChar(this, coords.left, coords.top);
 17.2996 -    },
 17.2997 -
 17.2998 -    lineAtHeight: function(height, mode) {
 17.2999 -      height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top;
 17.3000 -      return lineAtHeight(this.doc, height + this.display.viewOffset);
 17.3001 -    },
 17.3002 -    heightAtLine: function(line, mode) {
 17.3003 -      var end = false, last = this.doc.first + this.doc.size - 1;
 17.3004 -      if (line < this.doc.first) line = this.doc.first;
 17.3005 -      else if (line > last) { line = last; end = true; }
 17.3006 -      var lineObj = getLine(this.doc, line);
 17.3007 -      return intoCoordSystem(this, getLine(this.doc, line), {top: 0, left: 0}, mode || "page").top +
 17.3008 -        (end ? lineObj.height : 0);
 17.3009 -    },
 17.3010 -
 17.3011 -    defaultTextHeight: function() { return textHeight(this.display); },
 17.3012 -    defaultCharWidth: function() { return charWidth(this.display); },
 17.3013 -
 17.3014 -    setGutterMarker: operation(null, function(line, gutterID, value) {
 17.3015 -      return changeLine(this, line, function(line) {
 17.3016 -        var markers = line.gutterMarkers || (line.gutterMarkers = {});
 17.3017 -        markers[gutterID] = value;
 17.3018 -        if (!value && isEmpty(markers)) line.gutterMarkers = null;
 17.3019 -        return true;
 17.3020 -      });
 17.3021 -    }),
 17.3022 -
 17.3023 -    clearGutter: operation(null, function(gutterID) {
 17.3024 -      var cm = this, doc = cm.doc, i = doc.first;
 17.3025 -      doc.iter(function(line) {
 17.3026 -        if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
 17.3027 -          line.gutterMarkers[gutterID] = null;
 17.3028 -          regChange(cm, i, i + 1);
 17.3029 -          if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;
 17.3030 -        }
 17.3031 -        ++i;
 17.3032 -      });
 17.3033 -    }),
 17.3034 -
 17.3035 -    addLineClass: operation(null, function(handle, where, cls) {
 17.3036 -      return changeLine(this, handle, function(line) {
 17.3037 -        var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass";
 17.3038 -        if (!line[prop]) line[prop] = cls;
 17.3039 -        else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false;
 17.3040 -        else line[prop] += " " + cls;
 17.3041 -        return true;
 17.3042 -      });
 17.3043 -    }),
 17.3044 -
 17.3045 -    removeLineClass: operation(null, function(handle, where, cls) {
 17.3046 -      return changeLine(this, handle, function(line) {
 17.3047 -        var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass";
 17.3048 -        var cur = line[prop];
 17.3049 -        if (!cur) return false;
 17.3050 -        else if (cls == null) line[prop] = null;
 17.3051 -        else {
 17.3052 -          var found = cur.match(new RegExp("(?:^|\\s+)" + cls + "(?:$|\\s+)"));
 17.3053 -          if (!found) return false;
 17.3054 -          var end = found.index + found[0].length;
 17.3055 -          line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null;
 17.3056 -        }
 17.3057 -        return true;
 17.3058 -      });
 17.3059 -    }),
 17.3060 -
 17.3061 -    addLineWidget: operation(null, function(handle, node, options) {
 17.3062 -      return addLineWidget(this, handle, node, options);
 17.3063 -    }),
 17.3064 -
 17.3065 -    removeLineWidget: function(widget) { widget.clear(); },
 17.3066 -
 17.3067 -    lineInfo: function(line) {
 17.3068 -      if (typeof line == "number") {
 17.3069 -        if (!isLine(this.doc, line)) return null;
 17.3070 -        var n = line;
 17.3071 -        line = getLine(this.doc, line);
 17.3072 -        if (!line) return null;
 17.3073 -      } else {
 17.3074 -        var n = lineNo(line);
 17.3075 -        if (n == null) return null;
 17.3076 -      }
 17.3077 -      return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
 17.3078 -              textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
 17.3079 -              widgets: line.widgets};
 17.3080 -    },
 17.3081 -
 17.3082 -    getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};},
 17.3083 -
 17.3084 -    addWidget: function(pos, node, scroll, vert, horiz) {
 17.3085 -      var display = this.display;
 17.3086 -      pos = cursorCoords(this, clipPos(this.doc, pos));
 17.3087 -      var top = pos.bottom, left = pos.left;
 17.3088 -      node.style.position = "absolute";
 17.3089 -      display.sizer.appendChild(node);
 17.3090 -      if (vert == "over") {
 17.3091 -        top = pos.top;
 17.3092 -      } else if (vert == "above" || vert == "near") {
 17.3093 -        var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
 17.3094 -        hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);
 17.3095 -        // Default to positioning above (if specified and possible); otherwise default to positioning below
 17.3096 -        if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
 17.3097 -          top = pos.top - node.offsetHeight;
 17.3098 -        else if (pos.bottom + node.offsetHeight <= vspace)
 17.3099 -          top = pos.bottom;
 17.3100 -        if (left + node.offsetWidth > hspace)
 17.3101 -          left = hspace - node.offsetWidth;
 17.3102 -      }
 17.3103 -      node.style.top = top + "px";
 17.3104 -      node.style.left = node.style.right = "";
 17.3105 -      if (horiz == "right") {
 17.3106 -        left = display.sizer.clientWidth - node.offsetWidth;
 17.3107 -        node.style.right = "0px";
 17.3108 -      } else {
 17.3109 -        if (horiz == "left") left = 0;
 17.3110 -        else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2;
 17.3111 -        node.style.left = left + "px";
 17.3112 -      }
 17.3113 -      if (scroll)
 17.3114 -        scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);
 17.3115 -    },
 17.3116 -
 17.3117 -    triggerOnKeyDown: operation(null, onKeyDown),
 17.3118 -
 17.3119 -    execCommand: function(cmd) {return commands[cmd](this);},
 17.3120 -
 17.3121 -    findPosH: function(from, amount, unit, visually) {
 17.3122 -      var dir = 1;
 17.3123 -      if (amount < 0) { dir = -1; amount = -amount; }
 17.3124 -      for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
 17.3125 -        cur = findPosH(this.doc, cur, dir, unit, visually);
 17.3126 -        if (cur.hitSide) break;
 17.3127 -      }
 17.3128 -      return cur;
 17.3129 -    },
 17.3130 -
 17.3131 -    moveH: operation(null, function(dir, unit) {
 17.3132 -      var sel = this.doc.sel, pos;
 17.3133 -      if (sel.shift || sel.extend || posEq(sel.from, sel.to))
 17.3134 -        pos = findPosH(this.doc, sel.head, dir, unit, this.options.rtlMoveVisually);
 17.3135 -      else
 17.3136 -        pos = dir < 0 ? sel.from : sel.to;
 17.3137 -      extendSelection(this.doc, pos, pos, dir);
 17.3138 -    }),
 17.3139 -
 17.3140 -    deleteH: operation(null, function(dir, unit) {
 17.3141 -      var sel = this.doc.sel;
 17.3142 -      if (!posEq(sel.from, sel.to)) replaceRange(this.doc, "", sel.from, sel.to, "+delete");
 17.3143 -      else replaceRange(this.doc, "", sel.from, findPosH(this.doc, sel.head, dir, unit, false), "+delete");
 17.3144 -      this.curOp.userSelChange = true;
 17.3145 -    }),
 17.3146 -
 17.3147 -    findPosV: function(from, amount, unit, goalColumn) {
 17.3148 -      var dir = 1, x = goalColumn;
 17.3149 -      if (amount < 0) { dir = -1; amount = -amount; }
 17.3150 -      for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
 17.3151 -        var coords = cursorCoords(this, cur, "div");
 17.3152 -        if (x == null) x = coords.left;
 17.3153 -        else coords.left = x;
 17.3154 -        cur = findPosV(this, coords, dir, unit);
 17.3155 -        if (cur.hitSide) break;
 17.3156 -      }
 17.3157 -      return cur;
 17.3158 -    },
 17.3159 -
 17.3160 -    moveV: operation(null, function(dir, unit) {
 17.3161 -      var sel = this.doc.sel;
 17.3162 -      var pos = cursorCoords(this, sel.head, "div");
 17.3163 -      if (sel.goalColumn != null) pos.left = sel.goalColumn;
 17.3164 -      var target = findPosV(this, pos, dir, unit);
 17.3165 -
 17.3166 -      if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top);
 17.3167 -      extendSelection(this.doc, target, target, dir);
 17.3168 -      sel.goalColumn = pos.left;
 17.3169 -    }),
 17.3170 -
 17.3171 -    toggleOverwrite: function(value) {
 17.3172 -      if (value != null && value == this.state.overwrite) return;
 17.3173 -      if (this.state.overwrite = !this.state.overwrite)
 17.3174 -        this.display.cursor.className += " CodeMirror-overwrite";
 17.3175 -      else
 17.3176 -        this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", "");
 17.3177 -    },
 17.3178 -    hasFocus: function() { return this.state.focused; },
 17.3179 -
 17.3180 -    scrollTo: operation(null, function(x, y) {
 17.3181 -      updateScrollPos(this, x, y);
 17.3182 -    }),
 17.3183 -    getScrollInfo: function() {
 17.3184 -      var scroller = this.display.scroller, co = scrollerCutOff;
 17.3185 -      return {left: scroller.scrollLeft, top: scroller.scrollTop,
 17.3186 -              height: scroller.scrollHeight - co, width: scroller.scrollWidth - co,
 17.3187 -              clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};
 17.3188 -    },
 17.3189 -
 17.3190 -    scrollIntoView: operation(null, function(range, margin) {
 17.3191 -      if (range == null) range = {from: this.doc.sel.head, to: null};
 17.3192 -      else if (typeof range == "number") range = {from: Pos(range, 0), to: null};
 17.3193 -      else if (range.from == null) range = {from: range, to: null};
 17.3194 -      if (!range.to) range.to = range.from;
 17.3195 -      if (!margin) margin = 0;
 17.3196 -
 17.3197 -      var coords = range;
 17.3198 -      if (range.from.line != null) {
 17.3199 -        this.curOp.scrollToPos = {from: range.from, to: range.to, margin: margin};
 17.3200 -        coords = {from: cursorCoords(this, range.from),
 17.3201 -                  to: cursorCoords(this, range.to)};
 17.3202 -      }
 17.3203 -      var sPos = calculateScrollPos(this, Math.min(coords.from.left, coords.to.left),
 17.3204 -                                    Math.min(coords.from.top, coords.to.top) - margin,
 17.3205 -                                    Math.max(coords.from.right, coords.to.right),
 17.3206 -                                    Math.max(coords.from.bottom, coords.to.bottom) + margin);
 17.3207 -      updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop);
 17.3208 -    }),
 17.3209 -
 17.3210 -    setSize: operation(null, function(width, height) {
 17.3211 -      function interpret(val) {
 17.3212 -        return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val;
 17.3213 -      }
 17.3214 -      if (width != null) this.display.wrapper.style.width = interpret(width);
 17.3215 -      if (height != null) this.display.wrapper.style.height = interpret(height);
 17.3216 -      if (this.options.lineWrapping)
 17.3217 -        this.display.measureLineCache.length = this.display.measureLineCachePos = 0;
 17.3218 -      this.curOp.forceUpdate = true;
 17.3219 -    }),
 17.3220 -
 17.3221 -    operation: function(f){return runInOp(this, f);},
 17.3222 -
 17.3223 -    refresh: operation(null, function() {
 17.3224 -      var badHeight = this.display.cachedTextHeight == null;
 17.3225 -      clearCaches(this);
 17.3226 -      updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop);
 17.3227 -      regChange(this);
 17.3228 -      if (badHeight) estimateLineHeights(this);
 17.3229 -    }),
 17.3230 -
 17.3231 -    swapDoc: operation(null, function(doc) {
 17.3232 -      var old = this.doc;
 17.3233 -      old.cm = null;
 17.3234 -      attachDoc(this, doc);
 17.3235 -      clearCaches(this);
 17.3236 -      resetInput(this, true);
 17.3237 -      updateScrollPos(this, doc.scrollLeft, doc.scrollTop);
 17.3238 -      signalLater(this, "swapDoc", this, old);
 17.3239 -      return old;
 17.3240 -    }),
 17.3241 -
 17.3242 -    getInputField: function(){return this.display.input;},
 17.3243 -    getWrapperElement: function(){return this.display.wrapper;},
 17.3244 -    getScrollerElement: function(){return this.display.scroller;},
 17.3245 -    getGutterElement: function(){return this.display.gutters;}
 17.3246 -  };
 17.3247 -  eventMixin(CodeMirror);
 17.3248 -
 17.3249 -  // OPTION DEFAULTS
 17.3250 -
 17.3251 -  var optionHandlers = CodeMirror.optionHandlers = {};
 17.3252 -
 17.3253 -  // The default configuration options.
 17.3254 -  var defaults = CodeMirror.defaults = {};
 17.3255 -
 17.3256 -  function option(name, deflt, handle, notOnInit) {
 17.3257 -    CodeMirror.defaults[name] = deflt;
 17.3258 -    if (handle) optionHandlers[name] =
 17.3259 -      notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;
 17.3260 -  }
 17.3261 -
 17.3262 -  var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}};
 17.3263 -
 17.3264 -  // These two are, on init, called from the constructor because they
 17.3265 -  // have to be initialized before the editor can start at all.
 17.3266 -  option("value", "", function(cm, val) {
 17.3267 -    cm.setValue(val);
 17.3268 -  }, true);
 17.3269 -  option("mode", null, function(cm, val) {
 17.3270 -    cm.doc.modeOption = val;
 17.3271 -    loadMode(cm);
 17.3272 -  }, true);
 17.3273 -
 17.3274 -  option("indentUnit", 2, loadMode, true);
 17.3275 -  option("indentWithTabs", false);
 17.3276 -  option("smartIndent", true);
 17.3277 -  option("tabSize", 4, function(cm) {
 17.3278 -    loadMode(cm);
 17.3279 -    clearCaches(cm);
 17.3280 -    regChange(cm);
 17.3281 -  }, true);
 17.3282 -  option("electricChars", true);
 17.3283 -  option("rtlMoveVisually", !windows);
 17.3284 -
 17.3285 -  option("theme", "default", function(cm) {
 17.3286 -    themeChanged(cm);
 17.3287 -    guttersChanged(cm);
 17.3288 -  }, true);
 17.3289 -  option("keyMap", "default", keyMapChanged);
 17.3290 -  option("extraKeys", null);
 17.3291 -
 17.3292 -  option("onKeyEvent", null);
 17.3293 -  option("onDragEvent", null);
 17.3294 -
 17.3295 -  option("lineWrapping", false, wrappingChanged, true);
 17.3296 -  option("gutters", [], function(cm) {
 17.3297 -    setGuttersForLineNumbers(cm.options);
 17.3298 -    guttersChanged(cm);
 17.3299 -  }, true);
 17.3300 -  option("fixedGutter", true, function(cm, val) {
 17.3301 -    cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0";
 17.3302 -    cm.refresh();
 17.3303 -  }, true);
 17.3304 -  option("coverGutterNextToScrollbar", false, updateScrollbars, true);
 17.3305 -  option("lineNumbers", false, function(cm) {
 17.3306 -    setGuttersForLineNumbers(cm.options);
 17.3307 -    guttersChanged(cm);
 17.3308 -  }, true);
 17.3309 -  option("firstLineNumber", 1, guttersChanged, true);
 17.3310 -  option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);
 17.3311 -  option("showCursorWhenSelecting", false, updateSelection, true);
 17.3312 -
 17.3313 -  option("resetSelectionOnContextMenu", true);
 17.3314 -
 17.3315 -  option("readOnly", false, function(cm, val) {
 17.3316 -    if (val == "nocursor") {onBlur(cm); cm.display.input.blur();}
 17.3317 -    else if (!val) resetInput(cm, true);
 17.3318 -  });
 17.3319 -  option("dragDrop", true);
 17.3320 -
 17.3321 -  option("cursorBlinkRate", 530);
 17.3322 -  option("cursorScrollMargin", 0);
 17.3323 -  option("cursorHeight", 1);
 17.3324 -  option("workTime", 100);
 17.3325 -  option("workDelay", 100);
 17.3326 -  option("flattenSpans", true);
 17.3327 -  option("pollInterval", 100);
 17.3328 -  option("undoDepth", 40, function(cm, val){cm.doc.history.undoDepth = val;});
 17.3329 -  option("historyEventDelay", 500);
 17.3330 -  option("viewportMargin", 10, function(cm){cm.refresh();}, true);
 17.3331 -  option("maxHighlightLength", 10000, function(cm){loadMode(cm); cm.refresh();}, true);
 17.3332 -  option("crudeMeasuringFrom", 10000);
 17.3333 -  option("moveInputWithCursor", true, function(cm, val) {
 17.3334 -    if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0;
 17.3335 -  });
 17.3336 -
 17.3337 -  option("tabindex", null, function(cm, val) {
 17.3338 -    cm.display.input.tabIndex = val || "";
 17.3339 -  });
 17.3340 -  option("autofocus", null);
 17.3341 -
 17.3342 -  // MODE DEFINITION AND QUERYING
 17.3343 -
 17.3344 -  // Known modes, by name and by MIME
 17.3345 -  var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
 17.3346 -
 17.3347 -  CodeMirror.defineMode = function(name, mode) {
 17.3348 -    if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name;
 17.3349 -    if (arguments.length > 2) {
 17.3350 -      mode.dependencies = [];
 17.3351 -      for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);
 17.3352 -    }
 17.3353 -    modes[name] = mode;
 17.3354 -  };
 17.3355 -
 17.3356 -  CodeMirror.defineMIME = function(mime, spec) {
 17.3357 -    mimeModes[mime] = spec;
 17.3358 -  };
 17.3359 -
 17.3360 -  CodeMirror.resolveMode = function(spec) {
 17.3361 -    if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
 17.3362 -      spec = mimeModes[spec];
 17.3363 -    } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
 17.3364 -      var found = mimeModes[spec.name];
 17.3365 -      spec = createObj(found, spec);
 17.3366 -      spec.name = found.name;
 17.3367 -    } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
 17.3368 -      return CodeMirror.resolveMode("application/xml");
 17.3369 -    }
 17.3370 -    if (typeof spec == "string") return {name: spec};
 17.3371 -    else return spec || {name: "null"};
 17.3372 -  };
 17.3373 -
 17.3374 -  CodeMirror.getMode = function(options, spec) {
 17.3375 -    var spec = CodeMirror.resolveMode(spec);
 17.3376 -    var mfactory = modes[spec.name];
 17.3377 -    if (!mfactory) return CodeMirror.getMode(options, "text/plain");
 17.3378 -    var modeObj = mfactory(options, spec);
 17.3379 -    if (modeExtensions.hasOwnProperty(spec.name)) {
 17.3380 -      var exts = modeExtensions[spec.name];
 17.3381 -      for (var prop in exts) {
 17.3382 -        if (!exts.hasOwnProperty(prop)) continue;
 17.3383 -        if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop];
 17.3384 -        modeObj[prop] = exts[prop];
 17.3385 -      }
 17.3386 -    }
 17.3387 -    modeObj.name = spec.name;
 17.3388 -
 17.3389 -    return modeObj;
 17.3390 -  };
 17.3391 -
 17.3392 -  CodeMirror.defineMode("null", function() {
 17.3393 -    return {token: function(stream) {stream.skipToEnd();}};
 17.3394 -  });
 17.3395 -  CodeMirror.defineMIME("text/plain", "null");
 17.3396 -
 17.3397 -  var modeExtensions = CodeMirror.modeExtensions = {};
 17.3398 -  CodeMirror.extendMode = function(mode, properties) {
 17.3399 -    var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
 17.3400 -    copyObj(properties, exts);
 17.3401 -  };
 17.3402 -
 17.3403 -  // EXTENSIONS
 17.3404 -
 17.3405 -  CodeMirror.defineExtension = function(name, func) {
 17.3406 -    CodeMirror.prototype[name] = func;
 17.3407 -  };
 17.3408 -  CodeMirror.defineDocExtension = function(name, func) {
 17.3409 -    Doc.prototype[name] = func;
 17.3410 -  };
 17.3411 -  CodeMirror.defineOption = option;
 17.3412 -
 17.3413 -  var initHooks = [];
 17.3414 -  CodeMirror.defineInitHook = function(f) {initHooks.push(f);};
 17.3415 -
 17.3416 -  var helpers = CodeMirror.helpers = {};
 17.3417 -  CodeMirror.registerHelper = function(type, name, value) {
 17.3418 -    if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {};
 17.3419 -    helpers[type][name] = value;
 17.3420 -  };
 17.3421 -
 17.3422 -  // UTILITIES
 17.3423 -
 17.3424 -  CodeMirror.isWordChar = isWordChar;
 17.3425 -
 17.3426 -  // MODE STATE HANDLING
 17.3427 -
 17.3428 -  // Utility functions for working with state. Exported because modes
 17.3429 -  // sometimes need to do this.
 17.3430 -  function copyState(mode, state) {
 17.3431 -    if (state === true) return state;
 17.3432 -    if (mode.copyState) return mode.copyState(state);
 17.3433 -    var nstate = {};
 17.3434 -    for (var n in state) {
 17.3435 -      var val = state[n];
 17.3436 -      if (val instanceof Array) val = val.concat([]);
 17.3437 -      nstate[n] = val;
 17.3438 -    }
 17.3439 -    return nstate;
 17.3440 -  }
 17.3441 -  CodeMirror.copyState = copyState;
 17.3442 -
 17.3443 -  function startState(mode, a1, a2) {
 17.3444 -    return mode.startState ? mode.startState(a1, a2) : true;
 17.3445 -  }
 17.3446 -  CodeMirror.startState = startState;
 17.3447 -
 17.3448 -  CodeMirror.innerMode = function(mode, state) {
 17.3449 -    while (mode.innerMode) {
 17.3450 -      var info = mode.innerMode(state);
 17.3451 -      if (!info || info.mode == mode) break;
 17.3452 -      state = info.state;
 17.3453 -      mode = info.mode;
 17.3454 -    }
 17.3455 -    return info || {mode: mode, state: state};
 17.3456 -  };
 17.3457 -
 17.3458 -  // STANDARD COMMANDS
 17.3459 -
 17.3460 -  var commands = CodeMirror.commands = {
 17.3461 -    selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()));},
 17.3462 -    killLine: function(cm) {
 17.3463 -      var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to);
 17.3464 -      if (!sel && cm.getLine(from.line).length == from.ch)
 17.3465 -        cm.replaceRange("", from, Pos(from.line + 1, 0), "+delete");
 17.3466 -      else cm.replaceRange("", from, sel ? to : Pos(from.line), "+delete");
 17.3467 -    },
 17.3468 -    deleteLine: function(cm) {
 17.3469 -      var l = cm.getCursor().line;
 17.3470 -      cm.replaceRange("", Pos(l, 0), Pos(l), "+delete");
 17.3471 -    },
 17.3472 -    delLineLeft: function(cm) {
 17.3473 -      var cur = cm.getCursor();
 17.3474 -      cm.replaceRange("", Pos(cur.line, 0), cur, "+delete");
 17.3475 -    },
 17.3476 -    undo: function(cm) {cm.undo();},
 17.3477 -    redo: function(cm) {cm.redo();},
 17.3478 -    goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},
 17.3479 -    goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},
 17.3480 -    goLineStart: function(cm) {
 17.3481 -      cm.extendSelection(lineStart(cm, cm.getCursor().line));
 17.3482 -    },
 17.3483 -    goLineStartSmart: function(cm) {
 17.3484 -      var cur = cm.getCursor(), start = lineStart(cm, cur.line);
 17.3485 -      var line = cm.getLineHandle(start.line);
 17.3486 -      var order = getOrder(line);
 17.3487 -      if (!order || order[0].level == 0) {
 17.3488 -        var firstNonWS = Math.max(0, line.text.search(/\S/));
 17.3489 -        var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch;
 17.3490 -        cm.extendSelection(Pos(start.line, inWS ? 0 : firstNonWS));
 17.3491 -      } else cm.extendSelection(start);
 17.3492 -    },
 17.3493 -    goLineEnd: function(cm) {
 17.3494 -      cm.extendSelection(lineEnd(cm, cm.getCursor().line));
 17.3495 -    },
 17.3496 -    goLineRight: function(cm) {
 17.3497 -      var top = cm.charCoords(cm.getCursor(), "div").top + 5;
 17.3498 -      cm.extendSelection(cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"));
 17.3499 -    },
 17.3500 -    goLineLeft: function(cm) {
 17.3501 -      var top = cm.charCoords(cm.getCursor(), "div").top + 5;
 17.3502 -      cm.extendSelection(cm.coordsChar({left: 0, top: top}, "div"));
 17.3503 -    },
 17.3504 -    goLineUp: function(cm) {cm.moveV(-1, "line");},
 17.3505 -    goLineDown: function(cm) {cm.moveV(1, "line");},
 17.3506 -    goPageUp: function(cm) {cm.moveV(-1, "page");},
 17.3507 -    goPageDown: function(cm) {cm.moveV(1, "page");},
 17.3508 -    goCharLeft: function(cm) {cm.moveH(-1, "char");},
 17.3509 -    goCharRight: function(cm) {cm.moveH(1, "char");},
 17.3510 -    goColumnLeft: function(cm) {cm.moveH(-1, "column");},
 17.3511 -    goColumnRight: function(cm) {cm.moveH(1, "column");},
 17.3512 -    goWordLeft: function(cm) {cm.moveH(-1, "word");},
 17.3513 -    goGroupRight: function(cm) {cm.moveH(1, "group");},
 17.3514 -    goGroupLeft: function(cm) {cm.moveH(-1, "group");},
 17.3515 -    goWordRight: function(cm) {cm.moveH(1, "word");},
 17.3516 -    delCharBefore: function(cm) {cm.deleteH(-1, "char");},
 17.3517 -    delCharAfter: function(cm) {cm.deleteH(1, "char");},
 17.3518 -    delWordBefore: function(cm) {cm.deleteH(-1, "word");},
 17.3519 -    delWordAfter: function(cm) {cm.deleteH(1, "word");},
 17.3520 -    delGroupBefore: function(cm) {cm.deleteH(-1, "group");},
 17.3521 -    delGroupAfter: function(cm) {cm.deleteH(1, "group");},
 17.3522 -    indentAuto: function(cm) {cm.indentSelection("smart");},
 17.3523 -    indentMore: function(cm) {cm.indentSelection("add");},
 17.3524 -    indentLess: function(cm) {cm.indentSelection("subtract");},
 17.3525 -    insertTab: function(cm) {cm.replaceSelection("\t", "end", "+input");},
 17.3526 -    defaultTab: function(cm) {
 17.3527 -      if (cm.somethingSelected()) cm.indentSelection("add");
 17.3528 -      else cm.replaceSelection("\t", "end", "+input");
 17.3529 -    },
 17.3530 -    transposeChars: function(cm) {
 17.3531 -      var cur = cm.getCursor(), line = cm.getLine(cur.line);
 17.3532 -      if (cur.ch > 0 && cur.ch < line.length - 1)
 17.3533 -        cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1),
 17.3534 -                        Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
 17.3535 -    },
 17.3536 -    newlineAndIndent: function(cm) {
 17.3537 -      operation(cm, function() {
 17.3538 -        cm.replaceSelection("\n", "end", "+input");
 17.3539 -        cm.indentLine(cm.getCursor().line, null, true);
 17.3540 -      })();
 17.3541 -    },
 17.3542 -    toggleOverwrite: function(cm) {cm.toggleOverwrite();}
 17.3543 -  };
 17.3544 -
 17.3545 -  // STANDARD KEYMAPS
 17.3546 -
 17.3547 -  var keyMap = CodeMirror.keyMap = {};
 17.3548 -  keyMap.basic = {
 17.3549 -    "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
 17.3550 -    "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
 17.3551 -    "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
 17.3552 -    "Tab": "defaultTab", "Shift-Tab": "indentAuto",
 17.3553 -    "Enter": "newlineAndIndent", "Insert": "toggleOverwrite"
 17.3554 -  };
 17.3555 -  // Note that the save and find-related commands aren't defined by
 17.3556 -  // default. Unknown commands are simply ignored.
 17.3557 -  keyMap.pcDefault = {
 17.3558 -    "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
 17.3559 -    "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd",
 17.3560 -    "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
 17.3561 -    "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
 17.3562 -    "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
 17.3563 -    "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
 17.3564 -    fallthrough: "basic"
 17.3565 -  };
 17.3566 -  keyMap.macDefault = {
 17.3567 -    "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
 17.3568 -    "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
 17.3569 -    "Alt-Right": "goGroupRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delGroupBefore",
 17.3570 -    "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
 17.3571 -    "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
 17.3572 -    "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delLineLeft",
 17.3573 -    fallthrough: ["basic", "emacsy"]
 17.3574 -  };
 17.3575 -  keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;
 17.3576 -  keyMap.emacsy = {
 17.3577 -    "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
 17.3578 -    "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
 17.3579 -    "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
 17.3580 -    "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"
 17.3581 -  };
 17.3582 -
 17.3583 -  // KEYMAP DISPATCH
 17.3584 -
 17.3585 -  function getKeyMap(val) {
 17.3586 -    if (typeof val == "string") return keyMap[val];
 17.3587 -    else return val;
 17.3588 -  }
 17.3589 -
 17.3590 -  function lookupKey(name, maps, handle) {
 17.3591 -    function lookup(map) {
 17.3592 -      map = getKeyMap(map);
 17.3593 -      var found = map[name];
 17.3594 -      if (found === false) return "stop";
 17.3595 -      if (found != null && handle(found)) return true;
 17.3596 -      if (map.nofallthrough) return "stop";
 17.3597 -
 17.3598 -      var fallthrough = map.fallthrough;
 17.3599 -      if (fallthrough == null) return false;
 17.3600 -      if (Object.prototype.toString.call(fallthrough) != "[object Array]")
 17.3601 -        return lookup(fallthrough);
 17.3602 -      for (var i = 0, e = fallthrough.length; i < e; ++i) {
 17.3603 -        var done = lookup(fallthrough[i]);
 17.3604 -        if (done) return done;
 17.3605 -      }
 17.3606 -      return false;
 17.3607 -    }
 17.3608 -
 17.3609 -    for (var i = 0; i < maps.length; ++i) {
 17.3610 -      var done = lookup(maps[i]);
 17.3611 -      if (done) return done != "stop";
 17.3612 -    }
 17.3613 -  }
 17.3614 -  function isModifierKey(event) {
 17.3615 -    var name = keyNames[event.keyCode];
 17.3616 -    return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";
 17.3617 -  }
 17.3618 -  function keyName(event, noShift) {
 17.3619 -    if (opera && event.keyCode == 34 && event["char"]) return false;
 17.3620 -    var name = keyNames[event.keyCode];
 17.3621 -    if (name == null || event.altGraphKey) return false;
 17.3622 -    if (event.altKey) name = "Alt-" + name;
 17.3623 -    if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = "Ctrl-" + name;
 17.3624 -    if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = "Cmd-" + name;
 17.3625 -    if (!noShift && event.shiftKey) name = "Shift-" + name;
 17.3626 -    return name;
 17.3627 -  }
 17.3628 -  CodeMirror.lookupKey = lookupKey;
 17.3629 -  CodeMirror.isModifierKey = isModifierKey;
 17.3630 -  CodeMirror.keyName = keyName;
 17.3631 -
 17.3632 -  // FROMTEXTAREA
 17.3633 -
 17.3634 -  CodeMirror.fromTextArea = function(textarea, options) {
 17.3635 -    if (!options) options = {};
 17.3636 -    options.value = textarea.value;
 17.3637 -    if (!options.tabindex && textarea.tabindex)
 17.3638 -      options.tabindex = textarea.tabindex;
 17.3639 -    if (!options.placeholder && textarea.placeholder)
 17.3640 -      options.placeholder = textarea.placeholder;
 17.3641 -    // Set autofocus to true if this textarea is focused, or if it has
 17.3642 -    // autofocus and no other element is focused.
 17.3643 -    if (options.autofocus == null) {
 17.3644 -      var hasFocus = document.body;
 17.3645 -      // doc.activeElement occasionally throws on IE
 17.3646 -      try { hasFocus = document.activeElement; } catch(e) {}
 17.3647 -      options.autofocus = hasFocus == textarea ||
 17.3648 -        textarea.getAttribute("autofocus") != null && hasFocus == document.body;
 17.3649 -    }
 17.3650 -
 17.3651 -    function save() {textarea.value = cm.getValue();}
 17.3652 -    if (textarea.form) {
 17.3653 -      on(textarea.form, "submit", save);
 17.3654 -      // Deplorable hack to make the submit method do the right thing.
 17.3655 -      if (!options.leaveSubmitMethodAlone) {
 17.3656 -        var form = textarea.form, realSubmit = form.submit;
 17.3657 -        try {
 17.3658 -          var wrappedSubmit = form.submit = function() {
 17.3659 -            save();
 17.3660 -            form.submit = realSubmit;
 17.3661 -            form.submit();
 17.3662 -            form.submit = wrappedSubmit;
 17.3663 -          };
 17.3664 -        } catch(e) {}
 17.3665 -      }
 17.3666 -    }
 17.3667 -
 17.3668 -    textarea.style.display = "none";
 17.3669 -    var cm = CodeMirror(function(node) {
 17.3670 -      textarea.parentNode.insertBefore(node, textarea.nextSibling);
 17.3671 -    }, options);
 17.3672 -    cm.save = save;
 17.3673 -    cm.getTextArea = function() { return textarea; };
 17.3674 -    cm.toTextArea = function() {
 17.3675 -      save();
 17.3676 -      textarea.parentNode.removeChild(cm.getWrapperElement());
 17.3677 -      textarea.style.display = "";
 17.3678 -      if (textarea.form) {
 17.3679 -        off(textarea.form, "submit", save);
 17.3680 -        if (typeof textarea.form.submit == "function")
 17.3681 -          textarea.form.submit = realSubmit;
 17.3682 -      }
 17.3683 -    };
 17.3684 -    return cm;
 17.3685 -  };
 17.3686 -
 17.3687 -  // STRING STREAM
 17.3688 -
 17.3689 -  // Fed to the mode parsers, provides helper functions to make
 17.3690 -  // parsers more succinct.
 17.3691 -
 17.3692 -  // The character stream used by a mode's parser.
 17.3693 -  function StringStream(string, tabSize) {
 17.3694 -    this.pos = this.start = 0;
 17.3695 -    this.string = string;
 17.3696 -    this.tabSize = tabSize || 8;
 17.3697 -    this.lastColumnPos = this.lastColumnValue = 0;
 17.3698 -  }
 17.3699 -
 17.3700 -  StringStream.prototype = {
 17.3701 -    eol: function() {return this.pos >= this.string.length;},
 17.3702 -    sol: function() {return this.pos == 0;},
 17.3703 -    peek: function() {return this.string.charAt(this.pos) || undefined;},
 17.3704 -    next: function() {
 17.3705 -      if (this.pos < this.string.length)
 17.3706 -        return this.string.charAt(this.pos++);
 17.3707 -    },
 17.3708 -    eat: function(match) {
 17.3709 -      var ch = this.string.charAt(this.pos);
 17.3710 -      if (typeof match == "string") var ok = ch == match;
 17.3711 -      else var ok = ch && (match.test ? match.test(ch) : match(ch));
 17.3712 -      if (ok) {++this.pos; return ch;}
 17.3713 -    },
 17.3714 -    eatWhile: function(match) {
 17.3715 -      var start = this.pos;
 17.3716 -      while (this.eat(match)){}
 17.3717 -      return this.pos > start;
 17.3718 -    },
 17.3719 -    eatSpace: function() {
 17.3720 -      var start = this.pos;
 17.3721 -      while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
 17.3722 -      return this.pos > start;
 17.3723 -    },
 17.3724 -    skipToEnd: function() {this.pos = this.string.length;},
 17.3725 -    skipTo: function(ch) {
 17.3726 -      var found = this.string.indexOf(ch, this.pos);
 17.3727 -      if (found > -1) {this.pos = found; return true;}
 17.3728 -    },
 17.3729 -    backUp: function(n) {this.pos -= n;},
 17.3730 -    column: function() {
 17.3731 -      if (this.lastColumnPos < this.start) {
 17.3732 -        this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
 17.3733 -        this.lastColumnPos = this.start;
 17.3734 -      }
 17.3735 -      return this.lastColumnValue;
 17.3736 -    },
 17.3737 -    indentation: function() {return countColumn(this.string, null, this.tabSize);},
 17.3738 -    match: function(pattern, consume, caseInsensitive) {
 17.3739 -      if (typeof pattern == "string") {
 17.3740 -        var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
 17.3741 -        var substr = this.string.substr(this.pos, pattern.length);
 17.3742 -        if (cased(substr) == cased(pattern)) {
 17.3743 -          if (consume !== false) this.pos += pattern.length;
 17.3744 -          return true;
 17.3745 -        }
 17.3746 -      } else {
 17.3747 -        var match = this.string.slice(this.pos).match(pattern);
 17.3748 -        if (match && match.index > 0) return null;
 17.3749 -        if (match && consume !== false) this.pos += match[0].length;
 17.3750 -        return match;
 17.3751 -      }
 17.3752 -    },
 17.3753 -    current: function(){return this.string.slice(this.start, this.pos);}
 17.3754 -  };
 17.3755 -  CodeMirror.StringStream = StringStream;
 17.3756 -
 17.3757 -  // TEXTMARKERS
 17.3758 -
 17.3759 -  function TextMarker(doc, type) {
 17.3760 -    this.lines = [];
 17.3761 -    this.type = type;
 17.3762 -    this.doc = doc;
 17.3763 -  }
 17.3764 -  CodeMirror.TextMarker = TextMarker;
 17.3765 -  eventMixin(TextMarker);
 17.3766 -
 17.3767 -  TextMarker.prototype.clear = function() {
 17.3768 -    if (this.explicitlyCleared) return;
 17.3769 -    var cm = this.doc.cm, withOp = cm && !cm.curOp;
 17.3770 -    if (withOp) startOperation(cm);
 17.3771 -    if (hasHandler(this, "clear")) {
 17.3772 -      var found = this.find();
 17.3773 -      if (found) signalLater(this, "clear", found.from, found.to);
 17.3774 -    }
 17.3775 -    var min = null, max = null;
 17.3776 -    for (var i = 0; i < this.lines.length; ++i) {
 17.3777 -      var line = this.lines[i];
 17.3778 -      var span = getMarkedSpanFor(line.markedSpans, this);
 17.3779 -      if (span.to != null) max = lineNo(line);
 17.3780 -      line.markedSpans = removeMarkedSpan(line.markedSpans, span);
 17.3781 -      if (span.from != null)
 17.3782 -        min = lineNo(line);
 17.3783 -      else if (this.collapsed && !lineIsHidden(this.doc, line) && cm)
 17.3784 -        updateLineHeight(line, textHeight(cm.display));
 17.3785 -    }
 17.3786 -    if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {
 17.3787 -      var visual = visualLine(cm.doc, this.lines[i]), len = lineLength(cm.doc, visual);
 17.3788 -      if (len > cm.display.maxLineLength) {
 17.3789 -        cm.display.maxLine = visual;
 17.3790 -        cm.display.maxLineLength = len;
 17.3791 -        cm.display.maxLineChanged = true;
 17.3792 -      }
 17.3793 -    }
 17.3794 -
 17.3795 -    if (min != null && cm) regChange(cm, min, max + 1);
 17.3796 -    this.lines.length = 0;
 17.3797 -    this.explicitlyCleared = true;
 17.3798 -    if (this.atomic && this.doc.cantEdit) {
 17.3799 -      this.doc.cantEdit = false;
 17.3800 -      if (cm) reCheckSelection(cm);
 17.3801 -    }
 17.3802 -    if (withOp) endOperation(cm);
 17.3803 -  };
 17.3804 -
 17.3805 -  TextMarker.prototype.find = function() {
 17.3806 -    var from, to;
 17.3807 -    for (var i = 0; i < this.lines.length; ++i) {
 17.3808 -      var line = this.lines[i];
 17.3809 -      var span = getMarkedSpanFor(line.markedSpans, this);
 17.3810 -      if (span.from != null || span.to != null) {
 17.3811 -        var found = lineNo(line);
 17.3812 -        if (span.from != null) from = Pos(found, span.from);
 17.3813 -        if (span.to != null) to = Pos(found, span.to);
 17.3814 -      }
 17.3815 -    }
 17.3816 -    if (this.type == "bookmark") return from;
 17.3817 -    return from && {from: from, to: to};
 17.3818 -  };
 17.3819 -
 17.3820 -  TextMarker.prototype.changed = function() {
 17.3821 -    var pos = this.find(), cm = this.doc.cm;
 17.3822 -    if (!pos || !cm) return;
 17.3823 -    if (this.type != "bookmark") pos = pos.from;
 17.3824 -    var line = getLine(this.doc, pos.line);
 17.3825 -    clearCachedMeasurement(cm, line);
 17.3826 -    if (pos.line >= cm.display.showingFrom && pos.line < cm.display.showingTo) {
 17.3827 -      for (var node = cm.display.lineDiv.firstChild; node; node = node.nextSibling) if (node.lineObj == line) {
 17.3828 -        if (node.offsetHeight != line.height) updateLineHeight(line, node.offsetHeight);
 17.3829 -        break;
 17.3830 -      }
 17.3831 -      runInOp(cm, function() {
 17.3832 -        cm.curOp.selectionChanged = cm.curOp.forceUpdate = cm.curOp.updateMaxLine = true;
 17.3833 -      });
 17.3834 -    }
 17.3835 -  };
 17.3836 -
 17.3837 -  TextMarker.prototype.attachLine = function(line) {
 17.3838 -    if (!this.lines.length && this.doc.cm) {
 17.3839 -      var op = this.doc.cm.curOp;
 17.3840 -      if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
 17.3841 -        (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);
 17.3842 -    }
 17.3843 -    this.lines.push(line);
 17.3844 -  };
 17.3845 -  TextMarker.prototype.detachLine = function(line) {
 17.3846 -    this.lines.splice(indexOf(this.lines, line), 1);
 17.3847 -    if (!this.lines.length && this.doc.cm) {
 17.3848 -      var op = this.doc.cm.curOp;
 17.3849 -      (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);
 17.3850 -    }
 17.3851 -  };
 17.3852 -
 17.3853 -  function markText(doc, from, to, options, type) {
 17.3854 -    if (options && options.shared) return markTextShared(doc, from, to, options, type);
 17.3855 -    if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);
 17.3856 -
 17.3857 -    var marker = new TextMarker(doc, type);
 17.3858 -    if (type == "range" && !posLess(from, to)) return marker;
 17.3859 -    if (options) copyObj(options, marker);
 17.3860 -    if (marker.replacedWith) {
 17.3861 -      marker.collapsed = true;
 17.3862 -      marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget");
 17.3863 -      if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true;
 17.3864 -    }
 17.3865 -    if (marker.collapsed) sawCollapsedSpans = true;
 17.3866 -
 17.3867 -    if (marker.addToHistory)
 17.3868 -      addToHistory(doc, {from: from, to: to, origin: "markText"},
 17.3869 -                   {head: doc.sel.head, anchor: doc.sel.anchor}, NaN);
 17.3870 -
 17.3871 -    var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd, cm = doc.cm, updateMaxLine;
 17.3872 -    doc.iter(curLine, to.line + 1, function(line) {
 17.3873 -      if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine)
 17.3874 -        updateMaxLine = true;
 17.3875 -      var span = {from: null, to: null, marker: marker};
 17.3876 -      size += line.text.length;
 17.3877 -      if (curLine == from.line) {span.from = from.ch; size -= from.ch;}
 17.3878 -      if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;}
 17.3879 -      if (marker.collapsed) {
 17.3880 -        if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch);
 17.3881 -        if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch);
 17.3882 -        else updateLineHeight(line, 0);
 17.3883 -      }
 17.3884 -      addMarkedSpan(line, span);
 17.3885 -      ++curLine;
 17.3886 -    });
 17.3887 -    if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {
 17.3888 -      if (lineIsHidden(doc, line)) updateLineHeight(line, 0);
 17.3889 -    });
 17.3890 -
 17.3891 -    if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); });
 17.3892 -
 17.3893 -    if (marker.readOnly) {
 17.3894 -      sawReadOnlySpans = true;
 17.3895 -      if (doc.history.done.length || doc.history.undone.length)
 17.3896 -        doc.clearHistory();
 17.3897 -    }
 17.3898 -    if (marker.collapsed) {
 17.3899 -      if (collapsedAtStart != collapsedAtEnd)
 17.3900 -        throw new Error("Inserting collapsed marker overlapping an existing one");
 17.3901 -      marker.size = size;
 17.3902 -      marker.atomic = true;
 17.3903 -    }
 17.3904 -    if (cm) {
 17.3905 -      if (updateMaxLine) cm.curOp.updateMaxLine = true;
 17.3906 -      if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.collapsed)
 17.3907 -        regChange(cm, from.line, to.line + 1);
 17.3908 -      if (marker.atomic) reCheckSelection(cm);
 17.3909 -    }
 17.3910 -    return marker;
 17.3911 -  }
 17.3912 -
 17.3913 -  // SHARED TEXTMARKERS
 17.3914 -
 17.3915 -  function SharedTextMarker(markers, primary) {
 17.3916 -    this.markers = markers;
 17.3917 -    this.primary = primary;
 17.3918 -    for (var i = 0, me = this; i < markers.length; ++i) {
 17.3919 -      markers[i].parent = this;
 17.3920 -      on(markers[i], "clear", function(){me.clear();});
 17.3921 -    }
 17.3922 -  }
 17.3923 -  CodeMirror.SharedTextMarker = SharedTextMarker;
 17.3924 -  eventMixin(SharedTextMarker);
 17.3925 -
 17.3926 -  SharedTextMarker.prototype.clear = function() {
 17.3927 -    if (this.explicitlyCleared) return;
 17.3928 -    this.explicitlyCleared = true;
 17.3929 -    for (var i = 0; i < this.markers.length; ++i)
 17.3930 -      this.markers[i].clear();
 17.3931 -    signalLater(this, "clear");
 17.3932 -  };
 17.3933 -  SharedTextMarker.prototype.find = function() {
 17.3934 -    return this.primary.find();
 17.3935 -  };
 17.3936 -
 17.3937 -  function markTextShared(doc, from, to, options, type) {
 17.3938 -    options = copyObj(options);
 17.3939 -    options.shared = false;
 17.3940 -    var markers = [markText(doc, from, to, options, type)], primary = markers[0];
 17.3941 -    var widget = options.replacedWith;
 17.3942 -    linkedDocs(doc, function(doc) {
 17.3943 -      if (widget) options.replacedWith = widget.cloneNode(true);
 17.3944 -      markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
 17.3945 -      for (var i = 0; i < doc.linked.length; ++i)
 17.3946 -        if (doc.linked[i].isParent) return;
 17.3947 -      primary = lst(markers);
 17.3948 -    });
 17.3949 -    return new SharedTextMarker(markers, primary);
 17.3950 -  }
 17.3951 -
 17.3952 -  // TEXTMARKER SPANS
 17.3953 -
 17.3954 -  function getMarkedSpanFor(spans, marker) {
 17.3955 -    if (spans) for (var i = 0; i < spans.length; ++i) {
 17.3956 -      var span = spans[i];
 17.3957 -      if (span.marker == marker) return span;
 17.3958 -    }
 17.3959 -  }
 17.3960 -  function removeMarkedSpan(spans, span) {
 17.3961 -    for (var r, i = 0; i < spans.length; ++i)
 17.3962 -      if (spans[i] != span) (r || (r = [])).push(spans[i]);
 17.3963 -    return r;
 17.3964 -  }
 17.3965 -  function addMarkedSpan(line, span) {
 17.3966 -    line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
 17.3967 -    span.marker.attachLine(line);
 17.3968 -  }
 17.3969 -
 17.3970 -  function markedSpansBefore(old, startCh, isInsert) {
 17.3971 -    if (old) for (var i = 0, nw; i < old.length; ++i) {
 17.3972 -      var span = old[i], marker = span.marker;
 17.3973 -      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
 17.3974 -      if (startsBefore || marker.type == "bookmark" && span.from == startCh && (!isInsert || !span.marker.insertLeft)) {
 17.3975 -        var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
 17.3976 -        (nw || (nw = [])).push({from: span.from,
 17.3977 -                                to: endsAfter ? null : span.to,
 17.3978 -                                marker: marker});
 17.3979 -      }
 17.3980 -    }
 17.3981 -    return nw;
 17.3982 -  }
 17.3983 -
 17.3984 -  function markedSpansAfter(old, endCh, isInsert) {
 17.3985 -    if (old) for (var i = 0, nw; i < old.length; ++i) {
 17.3986 -      var span = old[i], marker = span.marker;
 17.3987 -      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
 17.3988 -      if (endsAfter || marker.type == "bookmark" && span.from == endCh && (!isInsert || span.marker.insertLeft)) {
 17.3989 -        var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
 17.3990 -        (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,
 17.3991 -                                to: span.to == null ? null : span.to - endCh,
 17.3992 -                                marker: marker});
 17.3993 -      }
 17.3994 -    }
 17.3995 -    return nw;
 17.3996 -  }
 17.3997 -
 17.3998 -  function stretchSpansOverChange(doc, change) {
 17.3999 -    var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
 17.4000 -    var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
 17.4001 -    if (!oldFirst && !oldLast) return null;
 17.4002 -
 17.4003 -    var startCh = change.from.ch, endCh = change.to.ch, isInsert = posEq(change.from, change.to);
 17.4004 -    // Get the spans that 'stick out' on both sides
 17.4005 -    var first = markedSpansBefore(oldFirst, startCh, isInsert);
 17.4006 -    var last = markedSpansAfter(oldLast, endCh, isInsert);
 17.4007 -
 17.4008 -    // Next, merge those two ends
 17.4009 -    var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);
 17.4010 -    if (first) {
 17.4011 -      // Fix up .to properties of first
 17.4012 -      for (var i = 0; i < first.length; ++i) {
 17.4013 -        var span = first[i];
 17.4014 -        if (span.to == null) {
 17.4015 -          var found = getMarkedSpanFor(last, span.marker);
 17.4016 -          if (!found) span.to = startCh;
 17.4017 -          else if (sameLine) span.to = found.to == null ? null : found.to + offset;
 17.4018 -        }
 17.4019 -      }
 17.4020 -    }
 17.4021 -    if (last) {
 17.4022 -      // Fix up .from in last (or move them into first in case of sameLine)
 17.4023 -      for (var i = 0; i < last.length; ++i) {
 17.4024 -        var span = last[i];
 17.4025 -        if (span.to != null) span.to += offset;
 17.4026 -        if (span.from == null) {
 17.4027 -          var found = getMarkedSpanFor(first, span.marker);
 17.4028 -          if (!found) {
 17.4029 -            span.from = offset;
 17.4030 -            if (sameLine) (first || (first = [])).push(span);
 17.4031 -          }
 17.4032 -        } else {
 17.4033 -          span.from += offset;
 17.4034 -          if (sameLine) (first || (first = [])).push(span);
 17.4035 -        }
 17.4036 -      }
 17.4037 -    }
 17.4038 -    if (sameLine && first) {
 17.4039 -      // Make sure we didn't create any zero-length spans
 17.4040 -      for (var i = 0; i < first.length; ++i)
 17.4041 -        if (first[i].from != null && first[i].from == first[i].to && first[i].marker.type != "bookmark")
 17.4042 -          first.splice(i--, 1);
 17.4043 -      if (!first.length) first = null;
 17.4044 -    }
 17.4045 -
 17.4046 -    var newMarkers = [first];
 17.4047 -    if (!sameLine) {
 17.4048 -      // Fill gap with whole-line-spans
 17.4049 -      var gap = change.text.length - 2, gapMarkers;
 17.4050 -      if (gap > 0 && first)
 17.4051 -        for (var i = 0; i < first.length; ++i)
 17.4052 -          if (first[i].to == null)
 17.4053 -            (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker});
 17.4054 -      for (var i = 0; i < gap; ++i)
 17.4055 -        newMarkers.push(gapMarkers);
 17.4056 -      newMarkers.push(last);
 17.4057 -    }
 17.4058 -    return newMarkers;
 17.4059 -  }
 17.4060 -
 17.4061 -  function mergeOldSpans(doc, change) {
 17.4062 -    var old = getOldSpans(doc, change);
 17.4063 -    var stretched = stretchSpansOverChange(doc, change);
 17.4064 -    if (!old) return stretched;
 17.4065 -    if (!stretched) return old;
 17.4066 -
 17.4067 -    for (var i = 0; i < old.length; ++i) {
 17.4068 -      var oldCur = old[i], stretchCur = stretched[i];
 17.4069 -      if (oldCur && stretchCur) {
 17.4070 -        spans: for (var j = 0; j < stretchCur.length; ++j) {
 17.4071 -          var span = stretchCur[j];
 17.4072 -          for (var k = 0; k < oldCur.length; ++k)
 17.4073 -            if (oldCur[k].marker == span.marker) continue spans;
 17.4074 -          oldCur.push(span);
 17.4075 -        }
 17.4076 -      } else if (stretchCur) {
 17.4077 -        old[i] = stretchCur;
 17.4078 -      }
 17.4079 -    }
 17.4080 -    return old;
 17.4081 -  }
 17.4082 -
 17.4083 -  function removeReadOnlyRanges(doc, from, to) {
 17.4084 -    var markers = null;
 17.4085 -    doc.iter(from.line, to.line + 1, function(line) {
 17.4086 -      if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
 17.4087 -        var mark = line.markedSpans[i].marker;
 17.4088 -        if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
 17.4089 -          (markers || (markers = [])).push(mark);
 17.4090 -      }
 17.4091 -    });
 17.4092 -    if (!markers) return null;
 17.4093 -    var parts = [{from: from, to: to}];
 17.4094 -    for (var i = 0; i < markers.length; ++i) {
 17.4095 -      var mk = markers[i], m = mk.find();
 17.4096 -      for (var j = 0; j < parts.length; ++j) {
 17.4097 -        var p = parts[j];
 17.4098 -        if (posLess(p.to, m.from) || posLess(m.to, p.from)) continue;
 17.4099 -        var newParts = [j, 1];
 17.4100 -        if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from))
 17.4101 -          newParts.push({from: p.from, to: m.from});
 17.4102 -        if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to))
 17.4103 -          newParts.push({from: m.to, to: p.to});
 17.4104 -        parts.splice.apply(parts, newParts);
 17.4105 -        j += newParts.length - 1;
 17.4106 -      }
 17.4107 -    }
 17.4108 -    return parts;
 17.4109 -  }
 17.4110 -
 17.4111 -  function collapsedSpanAt(line, ch) {
 17.4112 -    var sps = sawCollapsedSpans && line.markedSpans, found;
 17.4113 -    if (sps) for (var sp, i = 0; i < sps.length; ++i) {
 17.4114 -      sp = sps[i];
 17.4115 -      if (!sp.marker.collapsed) continue;
 17.4116 -      if ((sp.from == null || sp.from < ch) &&
 17.4117 -          (sp.to == null || sp.to > ch) &&
 17.4118 -          (!found || found.width < sp.marker.width))
 17.4119 -        found = sp.marker;
 17.4120 -    }
 17.4121 -    return found;
 17.4122 -  }
 17.4123 -  function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); }
 17.4124 -  function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); }
 17.4125 -
 17.4126 -  function visualLine(doc, line) {
 17.4127 -    var merged;
 17.4128 -    while (merged = collapsedSpanAtStart(line))
 17.4129 -      line = getLine(doc, merged.find().from.line);
 17.4130 -    return line;
 17.4131 -  }
 17.4132 -
 17.4133 -  function lineIsHidden(doc, line) {
 17.4134 -    var sps = sawCollapsedSpans && line.markedSpans;
 17.4135 -    if (sps) for (var sp, i = 0; i < sps.length; ++i) {
 17.4136 -      sp = sps[i];
 17.4137 -      if (!sp.marker.collapsed) continue;
 17.4138 -      if (sp.from == null) return true;
 17.4139 -      if (sp.marker.replacedWith) continue;
 17.4140 -      if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
 17.4141 -        return true;
 17.4142 -    }
 17.4143 -  }
 17.4144 -  function lineIsHiddenInner(doc, line, span) {
 17.4145 -    if (span.to == null) {
 17.4146 -      var end = span.marker.find().to, endLine = getLine(doc, end.line);
 17.4147 -      return lineIsHiddenInner(doc, endLine, getMarkedSpanFor(endLine.markedSpans, span.marker));
 17.4148 -    }
 17.4149 -    if (span.marker.inclusiveRight && span.to == line.text.length)
 17.4150 -      return true;
 17.4151 -    for (var sp, i = 0; i < line.markedSpans.length; ++i) {
 17.4152 -      sp = line.markedSpans[i];
 17.4153 -      if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to &&
 17.4154 -          (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
 17.4155 -          lineIsHiddenInner(doc, line, sp)) return true;
 17.4156 -    }
 17.4157 -  }
 17.4158 -
 17.4159 -  function detachMarkedSpans(line) {
 17.4160 -    var spans = line.markedSpans;
 17.4161 -    if (!spans) return;
 17.4162 -    for (var i = 0; i < spans.length; ++i)
 17.4163 -      spans[i].marker.detachLine(line);
 17.4164 -    line.markedSpans = null;
 17.4165 -  }
 17.4166 -
 17.4167 -  function attachMarkedSpans(line, spans) {
 17.4168 -    if (!spans) return;
 17.4169 -    for (var i = 0; i < spans.length; ++i)
 17.4170 -      spans[i].marker.attachLine(line);
 17.4171 -    line.markedSpans = spans;
 17.4172 -  }
 17.4173 -
 17.4174 -  // LINE WIDGETS
 17.4175 -
 17.4176 -  var LineWidget = CodeMirror.LineWidget = function(cm, node, options) {
 17.4177 -    if (options) for (var opt in options) if (options.hasOwnProperty(opt))
 17.4178 -      this[opt] = options[opt];
 17.4179 -    this.cm = cm;
 17.4180 -    this.node = node;
 17.4181 -  };
 17.4182 -  eventMixin(LineWidget);
 17.4183 -  function widgetOperation(f) {
 17.4184 -    return function() {
 17.4185 -      var withOp = !this.cm.curOp;
 17.4186 -      if (withOp) startOperation(this.cm);
 17.4187 -      try {var result = f.apply(this, arguments);}
 17.4188 -      finally {if (withOp) endOperation(this.cm);}
 17.4189 -      return result;
 17.4190 -    };
 17.4191 -  }
 17.4192 -  LineWidget.prototype.clear = widgetOperation(function() {
 17.4193 -    var ws = this.line.widgets, no = lineNo(this.line);
 17.4194 -    if (no == null || !ws) return;
 17.4195 -    for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);
 17.4196 -    if (!ws.length) this.line.widgets = null;
 17.4197 -    var aboveVisible = heightAtLine(this.cm, this.line) < this.cm.doc.scrollTop;
 17.4198 -    updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this)));
 17.4199 -    if (aboveVisible) addToScrollPos(this.cm, 0, -this.height);
 17.4200 -    regChange(this.cm, no, no + 1);
 17.4201 -  });
 17.4202 -  LineWidget.prototype.changed = widgetOperation(function() {
 17.4203 -    var oldH = this.height;
 17.4204 -    this.height = null;
 17.4205 -    var diff = widgetHeight(this) - oldH;
 17.4206 -    if (!diff) return;
 17.4207 -    updateLineHeight(this.line, this.line.height + diff);
 17.4208 -    var no = lineNo(this.line);
 17.4209 -    regChange(this.cm, no, no + 1);
 17.4210 -  });
 17.4211 -
 17.4212 -  function widgetHeight(widget) {
 17.4213 -    if (widget.height != null) return widget.height;
 17.4214 -    if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1)
 17.4215 -      removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative"));
 17.4216 -    return widget.height = widget.node.offsetHeight;
 17.4217 -  }
 17.4218 -
 17.4219 -  function addLineWidget(cm, handle, node, options) {
 17.4220 -    var widget = new LineWidget(cm, node, options);
 17.4221 -    if (widget.noHScroll) cm.display.alignWidgets = true;
 17.4222 -    changeLine(cm, handle, function(line) {
 17.4223 -      var widgets = line.widgets || (line.widgets = []);
 17.4224 -      if (widget.insertAt == null) widgets.push(widget);
 17.4225 -      else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);
 17.4226 -      widget.line = line;
 17.4227 -      if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {
 17.4228 -        var aboveVisible = heightAtLine(cm, line) < cm.doc.scrollTop;
 17.4229 -        updateLineHeight(line, line.height + widgetHeight(widget));
 17.4230 -        if (aboveVisible) addToScrollPos(cm, 0, widget.height);
 17.4231 -      }
 17.4232 -      return true;
 17.4233 -    });
 17.4234 -    return widget;
 17.4235 -  }
 17.4236 -
 17.4237 -  // LINE DATA STRUCTURE
 17.4238 -
 17.4239 -  // Line objects. These hold state related to a line, including
 17.4240 -  // highlighting info (the styles array).
 17.4241 -  var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) {
 17.4242 -    this.text = text;
 17.4243 -    attachMarkedSpans(this, markedSpans);
 17.4244 -    this.height = estimateHeight ? estimateHeight(this) : 1;
 17.4245 -  };
 17.4246 -  eventMixin(Line);
 17.4247 -
 17.4248 -  function updateLine(line, text, markedSpans, estimateHeight) {
 17.4249 -    line.text = text;
 17.4250 -    if (line.stateAfter) line.stateAfter = null;
 17.4251 -    if (line.styles) line.styles = null;
 17.4252 -    if (line.order != null) line.order = null;
 17.4253 -    detachMarkedSpans(line);
 17.4254 -    attachMarkedSpans(line, markedSpans);
 17.4255 -    var estHeight = estimateHeight ? estimateHeight(line) : 1;
 17.4256 -    if (estHeight != line.height) updateLineHeight(line, estHeight);
 17.4257 -  }
 17.4258 -
 17.4259 -  function cleanUpLine(line) {
 17.4260 -    line.parent = null;
 17.4261 -    detachMarkedSpans(line);
 17.4262 -  }
 17.4263 -
 17.4264 -  // Run the given mode's parser over a line, update the styles
 17.4265 -  // array, which contains alternating fragments of text and CSS
 17.4266 -  // classes.
 17.4267 -  function runMode(cm, text, mode, state, f) {
 17.4268 -    var flattenSpans = mode.flattenSpans;
 17.4269 -    if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;
 17.4270 -    var curStart = 0, curStyle = null;
 17.4271 -    var stream = new StringStream(text, cm.options.tabSize), style;
 17.4272 -    if (text == "" && mode.blankLine) mode.blankLine(state);
 17.4273 -    while (!stream.eol()) {
 17.4274 -      if (stream.pos > cm.options.maxHighlightLength) {
 17.4275 -        flattenSpans = false;
 17.4276 -        stream.pos = text.length;
 17.4277 -        style = null;
 17.4278 -      } else {
 17.4279 -        style = mode.token(stream, state);
 17.4280 -      }
 17.4281 -      if (!flattenSpans || curStyle != style) {
 17.4282 -        if (curStart < stream.start) f(stream.start, curStyle);
 17.4283 -        curStart = stream.start; curStyle = style;
 17.4284 -      }
 17.4285 -      stream.start = stream.pos;
 17.4286 -    }
 17.4287 -    while (curStart < stream.pos) {
 17.4288 -      // Webkit seems to refuse to render text nodes longer than 57444 characters
 17.4289 -      var pos = Math.min(stream.pos, curStart + 50000);
 17.4290 -      f(pos, curStyle);
 17.4291 -      curStart = pos;
 17.4292 -    }
 17.4293 -  }
 17.4294 -
 17.4295 -  function highlightLine(cm, line, state) {
 17.4296 -    // A styles array always starts with a number identifying the
 17.4297 -    // mode/overlays that it is based on (for easy invalidation).
 17.4298 -    var st = [cm.state.modeGen];
 17.4299 -    // Compute the base array of styles
 17.4300 -    runMode(cm, line.text, cm.doc.mode, state, function(end, style) {st.push(end, style);});
 17.4301 -
 17.4302 -    // Run overlays, adjust style array.
 17.4303 -    for (var o = 0; o < cm.state.overlays.length; ++o) {
 17.4304 -      var overlay = cm.state.overlays[o], i = 1, at = 0;
 17.4305 -      runMode(cm, line.text, overlay.mode, true, function(end, style) {
 17.4306 -        var start = i;
 17.4307 -        // Ensure there's a token end at the current position, and that i points at it
 17.4308 -        while (at < end) {
 17.4309 -          var i_end = st[i];
 17.4310 -          if (i_end > end)
 17.4311 -            st.splice(i, 1, end, st[i+1], i_end);
 17.4312 -          i += 2;
 17.4313 -          at = Math.min(end, i_end);
 17.4314 -        }
 17.4315 -        if (!style) return;
 17.4316 -        if (overlay.opaque) {
 17.4317 -          st.splice(start, i - start, end, style);
 17.4318 -          i = start + 2;
 17.4319 -        } else {
 17.4320 -          for (; start < i; start += 2) {
 17.4321 -            var cur = st[start+1];
 17.4322 -            st[start+1] = cur ? cur + " " + style : style;
 17.4323 -          }
 17.4324 -        }
 17.4325 -      });
 17.4326 -    }
 17.4327 -
 17.4328 -    return st;
 17.4329 -  }
 17.4330 -
 17.4331 -  function getLineStyles(cm, line) {
 17.4332 -    if (!line.styles || line.styles[0] != cm.state.modeGen)
 17.4333 -      line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));
 17.4334 -    return line.styles;
 17.4335 -  }
 17.4336 -
 17.4337 -  // Lightweight form of highlight -- proceed over this line and
 17.4338 -  // update state, but don't save a style array.
 17.4339 -  function processLine(cm, line, state) {
 17.4340 -    var mode = cm.doc.mode;
 17.4341 -    var stream = new StringStream(line.text, cm.options.tabSize);
 17.4342 -    if (line.text == "" && mode.blankLine) mode.blankLine(state);
 17.4343 -    while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {
 17.4344 -      mode.token(stream, state);
 17.4345 -      stream.start = stream.pos;
 17.4346 -    }
 17.4347 -  }
 17.4348 -
 17.4349 -  var styleToClassCache = {};
 17.4350 -  function interpretTokenStyle(style, builder) {
 17.4351 -    if (!style) return null;
 17.4352 -    for (;;) {
 17.4353 -      var lineClass = style.match(/(?:^|\s)line-(background-)?(\S+)/);
 17.4354 -      if (!lineClass) break;
 17.4355 -      style = style.slice(0, lineClass.index) + style.slice(lineClass.index + lineClass[0].length);
 17.4356 -      var prop = lineClass[1] ? "bgClass" : "textClass";
 17.4357 -      if (builder[prop] == null)
 17.4358 -        builder[prop] = lineClass[2];
 17.4359 -      else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(builder[prop]))
 17.4360 -        builder[prop] += " " + lineClass[2];
 17.4361 -    }
 17.4362 -    return styleToClassCache[style] ||
 17.4363 -      (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-"));
 17.4364 -  }
 17.4365 -
 17.4366 -  function buildLineContent(cm, realLine, measure, copyWidgets) {
 17.4367 -    var merged, line = realLine, empty = true;
 17.4368 -    while (merged = collapsedSpanAtStart(line))
 17.4369 -      line = getLine(cm.doc, merged.find().from.line);
 17.4370 -
 17.4371 -    var builder = {pre: elt("pre"), col: 0, pos: 0,
 17.4372 -                   measure: null, measuredSomething: false, cm: cm,
 17.4373 -                   copyWidgets: copyWidgets};
 17.4374 -
 17.4375 -    do {
 17.4376 -      if (line.text) empty = false;
 17.4377 -      builder.measure = line == realLine && measure;
 17.4378 -      builder.pos = 0;
 17.4379 -      builder.addToken = builder.measure ? buildTokenMeasure : buildToken;
 17.4380 -      if ((ie || webkit) && cm.getOption("lineWrapping"))
 17.4381 -        builder.addToken = buildTokenSplitSpaces(builder.addToken);
 17.4382 -      var next = insertLineContent(line, builder, getLineStyles(cm, line));
 17.4383 -      if (measure && line == realLine && !builder.measuredSomething) {
 17.4384 -        measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure));
 17.4385 -        builder.measuredSomething = true;
 17.4386 -      }
 17.4387 -      if (next) line = getLine(cm.doc, next.to.line);
 17.4388 -    } while (next);
 17.4389 -
 17.4390 -    if (measure && !builder.measuredSomething && !measure[0])
 17.4391 -      measure[0] = builder.pre.appendChild(empty ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure));
 17.4392 -    if (!builder.pre.firstChild && !lineIsHidden(cm.doc, realLine))
 17.4393 -      builder.pre.appendChild(document.createTextNode("\u00a0"));
 17.4394 -
 17.4395 -    var order;
 17.4396 -    // Work around problem with the reported dimensions of single-char
 17.4397 -    // direction spans on IE (issue #1129). See also the comment in
 17.4398 -    // cursorCoords.
 17.4399 -    if (measure && ie && (order = getOrder(line))) {
 17.4400 -      var l = order.length - 1;
 17.4401 -      if (order[l].from == order[l].to) --l;
 17.4402 -      var last = order[l], prev = order[l - 1];
 17.4403 -      if (last.from + 1 == last.to && prev && last.level < prev.level) {
 17.4404 -        var span = measure[builder.pos - 1];
 17.4405 -        if (span) span.parentNode.insertBefore(span.measureRight = zeroWidthElement(cm.display.measure),
 17.4406 -                                               span.nextSibling);
 17.4407 -      }
 17.4408 -    }
 17.4409 -
 17.4410 -    var textClass = builder.textClass ? builder.textClass + " " + (realLine.textClass || "") : realLine.textClass;
 17.4411 -    if (textClass) builder.pre.className = textClass;
 17.4412 -
 17.4413 -    signal(cm, "renderLine", cm, realLine, builder.pre);
 17.4414 -    return builder;
 17.4415 -  }
 17.4416 -
 17.4417 -  var tokenSpecialChars = /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;
 17.4418 -  function buildToken(builder, text, style, startStyle, endStyle, title) {
 17.4419 -    if (!text) return;
 17.4420 -    if (!tokenSpecialChars.test(text)) {
 17.4421 -      builder.col += text.length;
 17.4422 -      var content = document.createTextNode(text);
 17.4423 -    } else {
 17.4424 -      var content = document.createDocumentFragment(), pos = 0;
 17.4425 -      while (true) {
 17.4426 -        tokenSpecialChars.lastIndex = pos;
 17.4427 -        var m = tokenSpecialChars.exec(text);
 17.4428 -        var skipped = m ? m.index - pos : text.length - pos;
 17.4429 -        if (skipped) {
 17.4430 -          content.appendChild(document.createTextNode(text.slice(pos, pos + skipped)));
 17.4431 -          builder.col += skipped;
 17.4432 -        }
 17.4433 -        if (!m) break;
 17.4434 -        pos += skipped + 1;
 17.4435 -        if (m[0] == "\t") {
 17.4436 -          var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;
 17.4437 -          content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));
 17.4438 -          builder.col += tabWidth;
 17.4439 -        } else {
 17.4440 -          var token = elt("span", "\u2022", "cm-invalidchar");
 17.4441 -          token.title = "\\u" + m[0].charCodeAt(0).toString(16);
 17.4442 -          content.appendChild(token);
 17.4443 -          builder.col += 1;
 17.4444 -        }
 17.4445 -      }
 17.4446 -    }
 17.4447 -    if (style || startStyle || endStyle || builder.measure) {
 17.4448 -      var fullStyle = style || "";
 17.4449 -      if (startStyle) fullStyle += startStyle;
 17.4450 -      if (endStyle) fullStyle += endStyle;
 17.4451 -      var token = elt("span", [content], fullStyle);
 17.4452 -      if (title) token.title = title;
 17.4453 -      return builder.pre.appendChild(token);
 17.4454 -    }
 17.4455 -    builder.pre.appendChild(content);
 17.4456 -  }
 17.4457 -
 17.4458 -  function buildTokenMeasure(builder, text, style, startStyle, endStyle) {
 17.4459 -    var wrapping = builder.cm.options.lineWrapping;
 17.4460 -    for (var i = 0; i < text.length; ++i) {
 17.4461 -      var ch = text.charAt(i), start = i == 0;
 17.4462 -      if (ch >= "\ud800" && ch < "\udbff" && i < text.length - 1) {
 17.4463 -        ch = text.slice(i, i + 2);
 17.4464 -        ++i;
 17.4465 -      } else if (i && wrapping && spanAffectsWrapping(text, i)) {
 17.4466 -        builder.pre.appendChild(elt("wbr"));
 17.4467 -      }
 17.4468 -      var old = builder.measure[builder.pos];
 17.4469 -      var span = builder.measure[builder.pos] =
 17.4470 -        buildToken(builder, ch, style,
 17.4471 -                   start && startStyle, i == text.length - 1 && endStyle);
 17.4472 -      if (old) span.leftSide = old.leftSide || old;
 17.4473 -      // In IE single-space nodes wrap differently than spaces
 17.4474 -      // embedded in larger text nodes, except when set to
 17.4475 -      // white-space: normal (issue #1268).
 17.4476 -      if (ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) &&
 17.4477 -          i < text.length - 1 && !/\s/.test(text.charAt(i + 1)))
 17.4478 -        span.style.whiteSpace = "normal";
 17.4479 -      builder.pos += ch.length;
 17.4480 -    }
 17.4481 -    if (text.length) builder.measuredSomething = true;
 17.4482 -  }
 17.4483 -
 17.4484 -  function buildTokenSplitSpaces(inner) {
 17.4485 -    function split(old) {
 17.4486 -      var out = " ";
 17.4487 -      for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0";
 17.4488 -      out += " ";
 17.4489 -      return out;
 17.4490 -    }
 17.4491 -    return function(builder, text, style, startStyle, endStyle, title) {
 17.4492 -      return inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title);
 17.4493 -    };
 17.4494 -  }
 17.4495 -
 17.4496 -  function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
 17.4497 -    var widget = !ignoreWidget && marker.replacedWith;
 17.4498 -    if (widget) {
 17.4499 -      if (builder.copyWidgets) widget = widget.cloneNode(true);
 17.4500 -      builder.pre.appendChild(widget);
 17.4501 -      if (builder.measure) {
 17.4502 -        if (size) {
 17.4503 -          builder.measure[builder.pos] = widget;
 17.4504 -        } else {
 17.4505 -          var elt = zeroWidthElement(builder.cm.display.measure);
 17.4506 -          if (marker.type == "bookmark" && !marker.insertLeft)
 17.4507 -            builder.measure[builder.pos] = builder.pre.appendChild(elt);
 17.4508 -          else if (builder.measure[builder.pos])
 17.4509 -            return;
 17.4510 -          else
 17.4511 -            builder.measure[builder.pos] = builder.pre.insertBefore(elt, widget);
 17.4512 -        }
 17.4513 -        builder.measuredSomething = true;
 17.4514 -      }
 17.4515 -    }
 17.4516 -    builder.pos += size;
 17.4517 -  }
 17.4518 -
 17.4519 -  // Outputs a number of spans to make up a line, taking highlighting
 17.4520 -  // and marked text into account.
 17.4521 -  function insertLineContent(line, builder, styles) {
 17.4522 -    var spans = line.markedSpans, allText = line.text, at = 0;
 17.4523 -    if (!spans) {
 17.4524 -      for (var i = 1; i < styles.length; i+=2)
 17.4525 -        builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));
 17.4526 -      return;
 17.4527 -    }
 17.4528 -
 17.4529 -    var len = allText.length, pos = 0, i = 1, text = "", style;
 17.4530 -    var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;
 17.4531 -    for (;;) {
 17.4532 -      if (nextChange == pos) { // Update current marker set
 17.4533 -        spanStyle = spanEndStyle = spanStartStyle = title = "";
 17.4534 -        collapsed = null; nextChange = Infinity;
 17.4535 -        var foundBookmarks = [];
 17.4536 -        for (var j = 0; j < spans.length; ++j) {
 17.4537 -          var sp = spans[j], m = sp.marker;
 17.4538 -          if (sp.from <= pos && (sp.to == null || sp.to > pos)) {
 17.4539 -            if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; }
 17.4540 -            if (m.className) spanStyle += " " + m.className;
 17.4541 -            if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
 17.4542 -            if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
 17.4543 -            if (m.title && !title) title = m.title;
 17.4544 -            if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))
 17.4545 -              collapsed = sp;
 17.4546 -          } else if (sp.from > pos && nextChange > sp.from) {
 17.4547 -            nextChange = sp.from;
 17.4548 -          }
 17.4549 -          if (m.type == "bookmark" && sp.from == pos && m.replacedWith) foundBookmarks.push(m);
 17.4550 -        }
 17.4551 -        if (collapsed && (collapsed.from || 0) == pos) {
 17.4552 -          buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,
 17.4553 -                             collapsed.marker, collapsed.from == null);
 17.4554 -          if (collapsed.to == null) return collapsed.marker.find();
 17.4555 -        }
 17.4556 -        if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)
 17.4557 -          buildCollapsedSpan(builder, 0, foundBookmarks[j]);
 17.4558 -      }
 17.4559 -      if (pos >= len) break;
 17.4560 -
 17.4561 -      var upto = Math.min(len, nextChange);
 17.4562 -      while (true) {
 17.4563 -        if (text) {
 17.4564 -          var end = pos + text.length;
 17.4565 -          if (!collapsed) {
 17.4566 -            var tokenText = end > upto ? text.slice(0, upto - pos) : text;
 17.4567 -            builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
 17.4568 -                             spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title);
 17.4569 -          }
 17.4570 -          if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
 17.4571 -          pos = end;
 17.4572 -          spanStartStyle = "";
 17.4573 -        }
 17.4574 -        text = allText.slice(at, at = styles[i++]);
 17.4575 -        style = interpretTokenStyle(styles[i++], builder);
 17.4576 -      }
 17.4577 -    }
 17.4578 -  }
 17.4579 -
 17.4580 -  // DOCUMENT DATA STRUCTURE
 17.4581 -
 17.4582 -  function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {
 17.4583 -    function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
 17.4584 -    function update(line, text, spans) {
 17.4585 -      updateLine(line, text, spans, estimateHeight);
 17.4586 -      signalLater(line, "change", line, change);
 17.4587 -    }
 17.4588 -
 17.4589 -    var from = change.from, to = change.to, text = change.text;
 17.4590 -    var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
 17.4591 -    var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;
 17.4592 -
 17.4593 -    // First adjust the line structure
 17.4594 -    if (from.ch == 0 && to.ch == 0 && lastText == "") {
 17.4595 -      // This is a whole-line replace. Treated specially to make
 17.4596 -      // sure line objects move the way they are supposed to.
 17.4597 -      for (var i = 0, e = text.length - 1, added = []; i < e; ++i)
 17.4598 -        added.push(new Line(text[i], spansFor(i), estimateHeight));
 17.4599 -      update(lastLine, lastLine.text, lastSpans);
 17.4600 -      if (nlines) doc.remove(from.line, nlines);
 17.4601 -      if (added.length) doc.insert(from.line, added);
 17.4602 -    } else if (firstLine == lastLine) {
 17.4603 -      if (text.length == 1) {
 17.4604 -        update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
 17.4605 -      } else {
 17.4606 -        for (var added = [], i = 1, e = text.length - 1; i < e; ++i)
 17.4607 -          added.push(new Line(text[i], spansFor(i), estimateHeight));
 17.4608 -        added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));
 17.4609 -        update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
 17.4610 -        doc.insert(from.line + 1, added);
 17.4611 -      }
 17.4612 -    } else if (text.length == 1) {
 17.4613 -      update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
 17.4614 -      doc.remove(from.line + 1, nlines);
 17.4615 -    } else {
 17.4616 -      update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
 17.4617 -      update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
 17.4618 -      for (var i = 1, e = text.length - 1, added = []; i < e; ++i)
 17.4619 -        added.push(new Line(text[i], spansFor(i), estimateHeight));
 17.4620 -      if (nlines > 1) doc.remove(from.line + 1, nlines - 1);
 17.4621 -      doc.insert(from.line + 1, added);
 17.4622 -    }
 17.4623 -
 17.4624 -    signalLater(doc, "change", doc, change);
 17.4625 -    setSelection(doc, selAfter.anchor, selAfter.head, null, true);
 17.4626 -  }
 17.4627 -
 17.4628 -  function LeafChunk(lines) {
 17.4629 -    this.lines = lines;
 17.4630 -    this.parent = null;
 17.4631 -    for (var i = 0, e = lines.length, height = 0; i < e; ++i) {
 17.4632 -      lines[i].parent = this;
 17.4633 -      height += lines[i].height;
 17.4634 -    }
 17.4635 -    this.height = height;
 17.4636 -  }
 17.4637 -
 17.4638 -  LeafChunk.prototype = {
 17.4639 -    chunkSize: function() { return this.lines.length; },
 17.4640 -    removeInner: function(at, n) {
 17.4641 -      for (var i = at, e = at + n; i < e; ++i) {
 17.4642 -        var line = this.lines[i];
 17.4643 -        this.height -= line.height;
 17.4644 -        cleanUpLine(line);
 17.4645 -        signalLater(line, "delete");
 17.4646 -      }
 17.4647 -      this.lines.splice(at, n);
 17.4648 -    },
 17.4649 -    collapse: function(lines) {
 17.4650 -      lines.splice.apply(lines, [lines.length, 0].concat(this.lines));
 17.4651 -    },
 17.4652 -    insertInner: function(at, lines, height) {
 17.4653 -      this.height += height;
 17.4654 -      this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
 17.4655 -      for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this;
 17.4656 -    },
 17.4657 -    iterN: function(at, n, op) {
 17.4658 -      for (var e = at + n; at < e; ++at)
 17.4659 -        if (op(this.lines[at])) return true;
 17.4660 -    }
 17.4661 -  };
 17.4662 -
 17.4663 -  function BranchChunk(children) {
 17.4664 -    this.children = children;
 17.4665 -    var size = 0, height = 0;
 17.4666 -    for (var i = 0, e = children.length; i < e; ++i) {
 17.4667 -      var ch = children[i];
 17.4668 -      size += ch.chunkSize(); height += ch.height;
 17.4669 -      ch.parent = this;
 17.4670 -    }
 17.4671 -    this.size = size;
 17.4672 -    this.height = height;
 17.4673 -    this.parent = null;
 17.4674 -  }
 17.4675 -
 17.4676 -  BranchChunk.prototype = {
 17.4677 -    chunkSize: function() { return this.size; },
 17.4678 -    removeInner: function(at, n) {
 17.4679 -      this.size -= n;
 17.4680 -      for (var i = 0; i < this.children.length; ++i) {
 17.4681 -        var child = this.children[i], sz = child.chunkSize();
 17.4682 -        if (at < sz) {
 17.4683 -          var rm = Math.min(n, sz - at), oldHeight = child.height;
 17.4684 -          child.removeInner(at, rm);
 17.4685 -          this.height -= oldHeight - child.height;
 17.4686 -          if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }
 17.4687 -          if ((n -= rm) == 0) break;
 17.4688 -          at = 0;
 17.4689 -        } else at -= sz;
 17.4690 -      }
 17.4691 -      if (this.size - n < 25) {
 17.4692 -        var lines = [];
 17.4693 -        this.collapse(lines);
 17.4694 -        this.children = [new LeafChunk(lines)];
 17.4695 -        this.children[0].parent = this;
 17.4696 -      }
 17.4697 -    },
 17.4698 -    collapse: function(lines) {
 17.4699 -      for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines);
 17.4700 -    },
 17.4701 -    insertInner: function(at, lines, height) {
 17.4702 -      this.size += lines.length;
 17.4703 -      this.height += height;
 17.4704 -      for (var i = 0, e = this.children.length; i < e; ++i) {
 17.4705 -        var child = this.children[i], sz = child.chunkSize();
 17.4706 -        if (at <= sz) {
 17.4707 -          child.insertInner(at, lines, height);
 17.4708 -          if (child.lines && child.lines.length > 50) {
 17.4709 -            while (child.lines.length > 50) {
 17.4710 -              var spilled = child.lines.splice(child.lines.length - 25, 25);
 17.4711 -              var newleaf = new LeafChunk(spilled);
 17.4712 -              child.height -= newleaf.height;
 17.4713 -              this.children.splice(i + 1, 0, newleaf);
 17.4714 -              newleaf.parent = this;
 17.4715 -            }
 17.4716 -            this.maybeSpill();
 17.4717 -          }
 17.4718 -          break;
 17.4719 -        }
 17.4720 -        at -= sz;
 17.4721 -      }
 17.4722 -    },
 17.4723 -    maybeSpill: function() {
 17.4724 -      if (this.children.length <= 10) return;
 17.4725 -      var me = this;
 17.4726 -      do {
 17.4727 -        var spilled = me.children.splice(me.children.length - 5, 5);
 17.4728 -        var sibling = new BranchChunk(spilled);
 17.4729 -        if (!me.parent) { // Become the parent node
 17.4730 -          var copy = new BranchChunk(me.children);
 17.4731 -          copy.parent = me;
 17.4732 -          me.children = [copy, sibling];
 17.4733 -          me = copy;
 17.4734 -        } else {
 17.4735 -          me.size -= sibling.size;
 17.4736 -          me.height -= sibling.height;
 17.4737 -          var myIndex = indexOf(me.parent.children, me);
 17.4738 -          me.parent.children.splice(myIndex + 1, 0, sibling);
 17.4739 -        }
 17.4740 -        sibling.parent = me.parent;
 17.4741 -      } while (me.children.length > 10);
 17.4742 -      me.parent.maybeSpill();
 17.4743 -    },
 17.4744 -    iterN: function(at, n, op) {
 17.4745 -      for (var i = 0, e = this.children.length; i < e; ++i) {
 17.4746 -        var child = this.children[i], sz = child.chunkSize();
 17.4747 -        if (at < sz) {
 17.4748 -          var used = Math.min(n, sz - at);
 17.4749 -          if (child.iterN(at, used, op)) return true;
 17.4750 -          if ((n -= used) == 0) break;
 17.4751 -          at = 0;
 17.4752 -        } else at -= sz;
 17.4753 -      }
 17.4754 -    }
 17.4755 -  };
 17.4756 -
 17.4757 -  var nextDocId = 0;
 17.4758 -  var Doc = CodeMirror.Doc = function(text, mode, firstLine) {
 17.4759 -    if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);
 17.4760 -    if (firstLine == null) firstLine = 0;
 17.4761 -
 17.4762 -    BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
 17.4763 -    this.first = firstLine;
 17.4764 -    this.scrollTop = this.scrollLeft = 0;
 17.4765 -    this.cantEdit = false;
 17.4766 -    this.history = makeHistory();
 17.4767 -    this.cleanGeneration = 1;
 17.4768 -    this.frontier = firstLine;
 17.4769 -    var start = Pos(firstLine, 0);
 17.4770 -    this.sel = {from: start, to: start, head: start, anchor: start, shift: false, extend: false, goalColumn: null};
 17.4771 -    this.id = ++nextDocId;
 17.4772 -    this.modeOption = mode;
 17.4773 -
 17.4774 -    if (typeof text == "string") text = splitLines(text);
 17.4775 -    updateDoc(this, {from: start, to: start, text: text}, null, {head: start, anchor: start});
 17.4776 -  };
 17.4777 -
 17.4778 -  Doc.prototype = createObj(BranchChunk.prototype, {
 17.4779 -    constructor: Doc,
 17.4780 -    iter: function(from, to, op) {
 17.4781 -      if (op) this.iterN(from - this.first, to - from, op);
 17.4782 -      else this.iterN(this.first, this.first + this.size, from);
 17.4783 -    },
 17.4784 -
 17.4785 -    insert: function(at, lines) {
 17.4786 -      var height = 0;
 17.4787 -      for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height;
 17.4788 -      this.insertInner(at - this.first, lines, height);
 17.4789 -    },
 17.4790 -    remove: function(at, n) { this.removeInner(at - this.first, n); },
 17.4791 -
 17.4792 -    getValue: function(lineSep) {
 17.4793 -      var lines = getLines(this, this.first, this.first + this.size);
 17.4794 -      if (lineSep === false) return lines;
 17.4795 -      return lines.join(lineSep || "\n");
 17.4796 -    },
 17.4797 -    setValue: function(code) {
 17.4798 -      var top = Pos(this.first, 0), last = this.first + this.size - 1;
 17.4799 -      makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
 17.4800 -                        text: splitLines(code), origin: "setValue"},
 17.4801 -                 {head: top, anchor: top}, true);
 17.4802 -    },
 17.4803 -    replaceRange: function(code, from, to, origin) {
 17.4804 -      from = clipPos(this, from);
 17.4805 -      to = to ? clipPos(this, to) : from;
 17.4806 -      replaceRange(this, code, from, to, origin);
 17.4807 -    },
 17.4808 -    getRange: function(from, to, lineSep) {
 17.4809 -      var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
 17.4810 -      if (lineSep === false) return lines;
 17.4811 -      return lines.join(lineSep || "\n");
 17.4812 -    },
 17.4813 -
 17.4814 -    getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},
 17.4815 -    setLine: function(line, text) {
 17.4816 -      if (isLine(this, line))
 17.4817 -        replaceRange(this, text, Pos(line, 0), clipPos(this, Pos(line)));
 17.4818 -    },
 17.4819 -    removeLine: function(line) {
 17.4820 -      if (line) replaceRange(this, "", clipPos(this, Pos(line - 1)), clipPos(this, Pos(line)));
 17.4821 -      else replaceRange(this, "", Pos(0, 0), clipPos(this, Pos(1, 0)));
 17.4822 -    },
 17.4823 -
 17.4824 -    getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},
 17.4825 -    getLineNumber: function(line) {return lineNo(line);},
 17.4826 -
 17.4827 -    getLineHandleVisualStart: function(line) {
 17.4828 -      if (typeof line == "number") line = getLine(this, line);
 17.4829 -      return visualLine(this, line);
 17.4830 -    },
 17.4831 -
 17.4832 -    lineCount: function() {return this.size;},
 17.4833 -    firstLine: function() {return this.first;},
 17.4834 -    lastLine: function() {return this.first + this.size - 1;},
 17.4835 -
 17.4836 -    clipPos: function(pos) {return clipPos(this, pos);},
 17.4837 -
 17.4838 -    getCursor: function(start) {
 17.4839 -      var sel = this.sel, pos;
 17.4840 -      if (start == null || start == "head") pos = sel.head;
 17.4841 -      else if (start == "anchor") pos = sel.anchor;
 17.4842 -      else if (start == "end" || start === false) pos = sel.to;
 17.4843 -      else pos = sel.from;
 17.4844 -      return copyPos(pos);
 17.4845 -    },
 17.4846 -    somethingSelected: function() {return !posEq(this.sel.head, this.sel.anchor);},
 17.4847 -
 17.4848 -    setCursor: docOperation(function(line, ch, extend) {
 17.4849 -      var pos = clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line);
 17.4850 -      if (extend) extendSelection(this, pos);
 17.4851 -      else setSelection(this, pos, pos);
 17.4852 -    }),
 17.4853 -    setSelection: docOperation(function(anchor, head, bias) {
 17.4854 -      setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), bias);
 17.4855 -    }),
 17.4856 -    extendSelection: docOperation(function(from, to, bias) {
 17.4857 -      extendSelection(this, clipPos(this, from), to && clipPos(this, to), bias);
 17.4858 -    }),
 17.4859 -
 17.4860 -    getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);},
 17.4861 -    replaceSelection: function(code, collapse, origin) {
 17.4862 -      makeChange(this, {from: this.sel.from, to: this.sel.to, text: splitLines(code), origin: origin}, collapse || "around");
 17.4863 -    },
 17.4864 -    undo: docOperation(function() {makeChangeFromHistory(this, "undo");}),
 17.4865 -    redo: docOperation(function() {makeChangeFromHistory(this, "redo");}),
 17.4866 -
 17.4867 -    setExtending: function(val) {this.sel.extend = val;},
 17.4868 -
 17.4869 -    historySize: function() {
 17.4870 -      var hist = this.history;
 17.4871 -      return {undo: hist.done.length, redo: hist.undone.length};
 17.4872 -    },
 17.4873 -    clearHistory: function() {this.history = makeHistory(this.history.maxGeneration);},
 17.4874 -
 17.4875 -    markClean: function() {
 17.4876 -      this.cleanGeneration = this.changeGeneration();
 17.4877 -    },
 17.4878 -    changeGeneration: function() {
 17.4879 -      this.history.lastOp = this.history.lastOrigin = null;
 17.4880 -      return this.history.generation;
 17.4881 -    },
 17.4882 -    isClean: function (gen) {
 17.4883 -      return this.history.generation == (gen || this.cleanGeneration);
 17.4884 -    },
 17.4885 -
 17.4886 -    getHistory: function() {
 17.4887 -      return {done: copyHistoryArray(this.history.done),
 17.4888 -              undone: copyHistoryArray(this.history.undone)};
 17.4889 -    },
 17.4890 -    setHistory: function(histData) {
 17.4891 -      var hist = this.history = makeHistory(this.history.maxGeneration);
 17.4892 -      hist.done = histData.done.slice(0);
 17.4893 -      hist.undone = histData.undone.slice(0);
 17.4894 -    },
 17.4895 -
 17.4896 -    markText: function(from, to, options) {
 17.4897 -      return markText(this, clipPos(this, from), clipPos(this, to), options, "range");
 17.4898 -    },
 17.4899 -    setBookmark: function(pos, options) {
 17.4900 -      var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
 17.4901 -                      insertLeft: options && options.insertLeft};
 17.4902 -      pos = clipPos(this, pos);
 17.4903 -      return markText(this, pos, pos, realOpts, "bookmark");
 17.4904 -    },
 17.4905 -    findMarksAt: function(pos) {
 17.4906 -      pos = clipPos(this, pos);
 17.4907 -      var markers = [], spans = getLine(this, pos.line).markedSpans;
 17.4908 -      if (spans) for (var i = 0; i < spans.length; ++i) {
 17.4909 -        var span = spans[i];
 17.4910 -        if ((span.from == null || span.from <= pos.ch) &&
 17.4911 -            (span.to == null || span.to >= pos.ch))
 17.4912 -          markers.push(span.marker.parent || span.marker);
 17.4913 -      }
 17.4914 -      return markers;
 17.4915 -    },
 17.4916 -    getAllMarks: function() {
 17.4917 -      var markers = [];
 17.4918 -      this.iter(function(line) {
 17.4919 -        var sps = line.markedSpans;
 17.4920 -        if (sps) for (var i = 0; i < sps.length; ++i)
 17.4921 -          if (sps[i].from != null) markers.push(sps[i].marker);
 17.4922 -      });
 17.4923 -      return markers;
 17.4924 -    },
 17.4925 -
 17.4926 -    posFromIndex: function(off) {
 17.4927 -      var ch, lineNo = this.first;
 17.4928 -      this.iter(function(line) {
 17.4929 -        var sz = line.text.length + 1;
 17.4930 -        if (sz > off) { ch = off; return true; }
 17.4931 -        off -= sz;
 17.4932 -        ++lineNo;
 17.4933 -      });
 17.4934 -      return clipPos(this, Pos(lineNo, ch));
 17.4935 -    },
 17.4936 -    indexFromPos: function (coords) {
 17.4937 -      coords = clipPos(this, coords);
 17.4938 -      var index = coords.ch;
 17.4939 -      if (coords.line < this.first || coords.ch < 0) return 0;
 17.4940 -      this.iter(this.first, coords.line, function (line) {
 17.4941 -        index += line.text.length + 1;
 17.4942 -      });
 17.4943 -      return index;
 17.4944 -    },
 17.4945 -
 17.4946 -    copy: function(copyHistory) {
 17.4947 -      var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first);
 17.4948 -      doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
 17.4949 -      doc.sel = {from: this.sel.from, to: this.sel.to, head: this.sel.head, anchor: this.sel.anchor,
 17.4950 -                 shift: this.sel.shift, extend: false, goalColumn: this.sel.goalColumn};
 17.4951 -      if (copyHistory) {
 17.4952 -        doc.history.undoDepth = this.history.undoDepth;
 17.4953 -        doc.setHistory(this.getHistory());
 17.4954 -      }
 17.4955 -      return doc;
 17.4956 -    },
 17.4957 -
 17.4958 -    linkedDoc: function(options) {
 17.4959 -      if (!options) options = {};
 17.4960 -      var from = this.first, to = this.first + this.size;
 17.4961 -      if (options.from != null && options.from > from) from = options.from;
 17.4962 -      if (options.to != null && options.to < to) to = options.to;
 17.4963 -      var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from);
 17.4964 -      if (options.sharedHist) copy.history = this.history;
 17.4965 -      (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
 17.4966 -      copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
 17.4967 -      return copy;
 17.4968 -    },
 17.4969 -    unlinkDoc: function(other) {
 17.4970 -      if (other instanceof CodeMirror) other = other.doc;
 17.4971 -      if (this.linked) for (var i = 0; i < this.linked.length; ++i) {
 17.4972 -        var link = this.linked[i];
 17.4973 -        if (link.doc != other) continue;
 17.4974 -        this.linked.splice(i, 1);
 17.4975 -        other.unlinkDoc(this);
 17.4976 -        break;
 17.4977 -      }
 17.4978 -      // If the histories were shared, split them again
 17.4979 -      if (other.history == this.history) {
 17.4980 -        var splitIds = [other.id];
 17.4981 -        linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);
 17.4982 -        other.history = makeHistory();
 17.4983 -        other.history.done = copyHistoryArray(this.history.done, splitIds);
 17.4984 -        other.history.undone = copyHistoryArray(this.history.undone, splitIds);
 17.4985 -      }
 17.4986 -    },
 17.4987 -    iterLinkedDocs: function(f) {linkedDocs(this, f);},
 17.4988 -
 17.4989 -    getMode: function() {return this.mode;},
 17.4990 -    getEditor: function() {return this.cm;}
 17.4991 -  });
 17.4992 -
 17.4993 -  Doc.prototype.eachLine = Doc.prototype.iter;
 17.4994 -
 17.4995 -  // The Doc methods that should be available on CodeMirror instances
 17.4996 -  var dontDelegate = "iter insert remove copy getEditor".split(" ");
 17.4997 -  for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
 17.4998 -    CodeMirror.prototype[prop] = (function(method) {
 17.4999 -      return function() {return method.apply(this.doc, arguments);};
 17.5000 -    })(Doc.prototype[prop]);
 17.5001 -
 17.5002 -  eventMixin(Doc);
 17.5003 -
 17.5004 -  function linkedDocs(doc, f, sharedHistOnly) {
 17.5005 -    function propagate(doc, skip, sharedHist) {
 17.5006 -      if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {
 17.5007 -        var rel = doc.linked[i];
 17.5008 -        if (rel.doc == skip) continue;
 17.5009 -        var shared = sharedHist && rel.sharedHist;
 17.5010 -        if (sharedHistOnly && !shared) continue;
 17.5011 -        f(rel.doc, shared);
 17.5012 -        propagate(rel.doc, doc, shared);
 17.5013 -      }
 17.5014 -    }
 17.5015 -    propagate(doc, null, true);
 17.5016 -  }
 17.5017 -
 17.5018 -  function attachDoc(cm, doc) {
 17.5019 -    if (doc.cm) throw new Error("This document is already in use.");
 17.5020 -    cm.doc = doc;
 17.5021 -    doc.cm = cm;
 17.5022 -    estimateLineHeights(cm);
 17.5023 -    loadMode(cm);
 17.5024 -    if (!cm.options.lineWrapping) computeMaxLength(cm);
 17.5025 -    cm.options.mode = doc.modeOption;
 17.5026 -    regChange(cm);
 17.5027 -  }
 17.5028 -
 17.5029 -  // LINE UTILITIES
 17.5030 -
 17.5031 -  function getLine(chunk, n) {
 17.5032 -    n -= chunk.first;
 17.5033 -    while (!chunk.lines) {
 17.5034 -      for (var i = 0;; ++i) {
 17.5035 -        var child = chunk.children[i], sz = child.chunkSize();
 17.5036 -        if (n < sz) { chunk = child; break; }
 17.5037 -        n -= sz;
 17.5038 -      }
 17.5039 -    }
 17.5040 -    return chunk.lines[n];
 17.5041 -  }
 17.5042 -
 17.5043 -  function getBetween(doc, start, end) {
 17.5044 -    var out = [], n = start.line;
 17.5045 -    doc.iter(start.line, end.line + 1, function(line) {
 17.5046 -      var text = line.text;
 17.5047 -      if (n == end.line) text = text.slice(0, end.ch);
 17.5048 -      if (n == start.line) text = text.slice(start.ch);
 17.5049 -      out.push(text);
 17.5050 -      ++n;
 17.5051 -    });
 17.5052 -    return out;
 17.5053 -  }
 17.5054 -  function getLines(doc, from, to) {
 17.5055 -    var out = [];
 17.5056 -    doc.iter(from, to, function(line) { out.push(line.text); });
 17.5057 -    return out;
 17.5058 -  }
 17.5059 -
 17.5060 -  function updateLineHeight(line, height) {
 17.5061 -    var diff = height - line.height;
 17.5062 -    for (var n = line; n; n = n.parent) n.height += diff;
 17.5063 -  }
 17.5064 -
 17.5065 -  function lineNo(line) {
 17.5066 -    if (line.parent == null) return null;
 17.5067 -    var cur = line.parent, no = indexOf(cur.lines, line);
 17.5068 -    for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
 17.5069 -      for (var i = 0;; ++i) {
 17.5070 -        if (chunk.children[i] == cur) break;
 17.5071 -        no += chunk.children[i].chunkSize();
 17.5072 -      }
 17.5073 -    }
 17.5074 -    return no + cur.first;
 17.5075 -  }
 17.5076 -
 17.5077 -  function lineAtHeight(chunk, h) {
 17.5078 -    var n = chunk.first;
 17.5079 -    outer: do {
 17.5080 -      for (var i = 0, e = chunk.children.length; i < e; ++i) {
 17.5081 -        var child = chunk.children[i], ch = child.height;
 17.5082 -        if (h < ch) { chunk = child; continue outer; }
 17.5083 -        h -= ch;
 17.5084 -        n += child.chunkSize();
 17.5085 -      }
 17.5086 -      return n;
 17.5087 -    } while (!chunk.lines);
 17.5088 -    for (var i = 0, e = chunk.lines.length; i < e; ++i) {
 17.5089 -      var line = chunk.lines[i], lh = line.height;
 17.5090 -      if (h < lh) break;
 17.5091 -      h -= lh;
 17.5092 -    }
 17.5093 -    return n + i;
 17.5094 -  }
 17.5095 -
 17.5096 -  function heightAtLine(cm, lineObj) {
 17.5097 -    lineObj = visualLine(cm.doc, lineObj);
 17.5098 -
 17.5099 -    var h = 0, chunk = lineObj.parent;
 17.5100 -    for (var i = 0; i < chunk.lines.length; ++i) {
 17.5101 -      var line = chunk.lines[i];
 17.5102 -      if (line == lineObj) break;
 17.5103 -      else h += line.height;
 17.5104 -    }
 17.5105 -    for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
 17.5106 -      for (var i = 0; i < p.children.length; ++i) {
 17.5107 -        var cur = p.children[i];
 17.5108 -        if (cur == chunk) break;
 17.5109 -        else h += cur.height;
 17.5110 -      }
 17.5111 -    }
 17.5112 -    return h;
 17.5113 -  }
 17.5114 -
 17.5115 -  function getOrder(line) {
 17.5116 -    var order = line.order;
 17.5117 -    if (order == null) order = line.order = bidiOrdering(line.text);
 17.5118 -    return order;
 17.5119 -  }
 17.5120 -
 17.5121 -  // HISTORY
 17.5122 -
 17.5123 -  function makeHistory(startGen) {
 17.5124 -    return {
 17.5125 -      // Arrays of history events. Doing something adds an event to
 17.5126 -      // done and clears undo. Undoing moves events from done to
 17.5127 -      // undone, redoing moves them in the other direction.
 17.5128 -      done: [], undone: [], undoDepth: Infinity,
 17.5129 -      // Used to track when changes can be merged into a single undo
 17.5130 -      // event
 17.5131 -      lastTime: 0, lastOp: null, lastOrigin: null,
 17.5132 -      // Used by the isClean() method
 17.5133 -      generation: startGen || 1, maxGeneration: startGen || 1
 17.5134 -    };
 17.5135 -  }
 17.5136 -
 17.5137 -  function attachLocalSpans(doc, change, from, to) {
 17.5138 -    var existing = change["spans_" + doc.id], n = 0;
 17.5139 -    doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {
 17.5140 -      if (line.markedSpans)
 17.5141 -        (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans;
 17.5142 -      ++n;
 17.5143 -    });
 17.5144 -  }
 17.5145 -
 17.5146 -  function historyChangeFromChange(doc, change) {
 17.5147 -    var from = { line: change.from.line, ch: change.from.ch };
 17.5148 -    var histChange = {from: from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};
 17.5149 -    attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);
 17.5150 -    linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);
 17.5151 -    return histChange;
 17.5152 -  }
 17.5153 -
 17.5154 -  function addToHistory(doc, change, selAfter, opId) {
 17.5155 -    var hist = doc.history;
 17.5156 -    hist.undone.length = 0;
 17.5157 -    var time = +new Date, cur = lst(hist.done);
 17.5158 -
 17.5159 -    if (cur &&
 17.5160 -        (hist.lastOp == opId ||
 17.5161 -         hist.lastOrigin == change.origin && change.origin &&
 17.5162 -         ((change.origin.charAt(0) == "+" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) ||
 17.5163 -          change.origin.charAt(0) == "*"))) {
 17.5164 -      // Merge this change into the last event
 17.5165 -      var last = lst(cur.changes);
 17.5166 -      if (posEq(change.from, change.to) && posEq(change.from, last.to)) {
 17.5167 -        // Optimized case for simple insertion -- don't want to add
 17.5168 -        // new changesets for every character typed
 17.5169 -        last.to = changeEnd(change);
 17.5170 -      } else {
 17.5171 -        // Add new sub-event
 17.5172 -        cur.changes.push(historyChangeFromChange(doc, change));
 17.5173 -      }
 17.5174 -      cur.anchorAfter = selAfter.anchor; cur.headAfter = selAfter.head;
 17.5175 -    } else {
 17.5176 -      // Can not be merged, start a new event.
 17.5177 -      cur = {changes: [historyChangeFromChange(doc, change)],
 17.5178 -             generation: hist.generation,
 17.5179 -             anchorBefore: doc.sel.anchor, headBefore: doc.sel.head,
 17.5180 -             anchorAfter: selAfter.anchor, headAfter: selAfter.head};
 17.5181 -      hist.done.push(cur);
 17.5182 -      hist.generation = ++hist.maxGeneration;
 17.5183 -      while (hist.done.length > hist.undoDepth)
 17.5184 -        hist.done.shift();
 17.5185 -    }
 17.5186 -    hist.lastTime = time;
 17.5187 -    hist.lastOp = opId;
 17.5188 -    hist.lastOrigin = change.origin;
 17.5189 -  }
 17.5190 -
 17.5191 -  function removeClearedSpans(spans) {
 17.5192 -    if (!spans) return null;
 17.5193 -    for (var i = 0, out; i < spans.length; ++i) {
 17.5194 -      if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
 17.5195 -      else if (out) out.push(spans[i]);
 17.5196 -    }
 17.5197 -    return !out ? spans : out.length ? out : null;
 17.5198 -  }
 17.5199 -
 17.5200 -  function getOldSpans(doc, change) {
 17.5201 -    var found = change["spans_" + doc.id];
 17.5202 -    if (!found) return null;
 17.5203 -    for (var i = 0, nw = []; i < change.text.length; ++i)
 17.5204 -      nw.push(removeClearedSpans(found[i]));
 17.5205 -    return nw;
 17.5206 -  }
 17.5207 -
 17.5208 -  // Used both to provide a JSON-safe object in .getHistory, and, when
 17.5209 -  // detaching a document, to split the history in two
 17.5210 -  function copyHistoryArray(events, newGroup) {
 17.5211 -    for (var i = 0, copy = []; i < events.length; ++i) {
 17.5212 -      var event = events[i], changes = event.changes, newChanges = [];
 17.5213 -      copy.push({changes: newChanges, anchorBefore: event.anchorBefore, headBefore: event.headBefore,
 17.5214 -                 anchorAfter: event.anchorAfter, headAfter: event.headAfter});
 17.5215 -      for (var j = 0; j < changes.length; ++j) {
 17.5216 -        var change = changes[j], m;
 17.5217 -        newChanges.push({from: change.from, to: change.to, text: change.text});
 17.5218 -        if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) {
 17.5219 -          if (indexOf(newGroup, Number(m[1])) > -1) {
 17.5220 -            lst(newChanges)[prop] = change[prop];
 17.5221 -            delete change[prop];
 17.5222 -          }
 17.5223 -        }
 17.5224 -      }
 17.5225 -    }
 17.5226 -    return copy;
 17.5227 -  }
 17.5228 -
 17.5229 -  // Rebasing/resetting history to deal with externally-sourced changes
 17.5230 -
 17.5231 -  function rebaseHistSel(pos, from, to, diff) {
 17.5232 -    if (to < pos.line) {
 17.5233 -      pos.line += diff;
 17.5234 -    } else if (from < pos.line) {
 17.5235 -      pos.line = from;
 17.5236 -      pos.ch = 0;
 17.5237 -    }
 17.5238 -  }
 17.5239 -
 17.5240 -  // Tries to rebase an array of history events given a change in the
 17.5241 -  // document. If the change touches the same lines as the event, the
 17.5242 -  // event, and everything 'behind' it, is discarded. If the change is
 17.5243 -  // before the event, the event's positions are updated. Uses a
 17.5244 -  // copy-on-write scheme for the positions, to avoid having to
 17.5245 -  // reallocate them all on every rebase, but also avoid problems with
 17.5246 -  // shared position objects being unsafely updated.
 17.5247 -  function rebaseHistArray(array, from, to, diff) {
 17.5248 -    for (var i = 0; i < array.length; ++i) {
 17.5249 -      var sub = array[i], ok = true;
 17.5250 -      for (var j = 0; j < sub.changes.length; ++j) {
 17.5251 -        var cur = sub.changes[j];
 17.5252 -        if (!sub.copied) { cur.from = copyPos(cur.from); cur.to = copyPos(cur.to); }
 17.5253 -        if (to < cur.from.line) {
 17.5254 -          cur.from.line += diff;
 17.5255 -          cur.to.line += diff;
 17.5256 -        } else if (from <= cur.to.line) {
 17.5257 -          ok = false;
 17.5258 -          break;
 17.5259 -        }
 17.5260 -      }
 17.5261 -      if (!sub.copied) {
 17.5262 -        sub.anchorBefore = copyPos(sub.anchorBefore); sub.headBefore = copyPos(sub.headBefore);
 17.5263 -        sub.anchorAfter = copyPos(sub.anchorAfter); sub.readAfter = copyPos(sub.headAfter);
 17.5264 -        sub.copied = true;
 17.5265 -      }
 17.5266 -      if (!ok) {
 17.5267 -        array.splice(0, i + 1);
 17.5268 -        i = 0;
 17.5269 -      } else {
 17.5270 -        rebaseHistSel(sub.anchorBefore); rebaseHistSel(sub.headBefore);
 17.5271 -        rebaseHistSel(sub.anchorAfter); rebaseHistSel(sub.headAfter);
 17.5272 -      }
 17.5273 -    }
 17.5274 -  }
 17.5275 -
 17.5276 -  function rebaseHist(hist, change) {
 17.5277 -    var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;
 17.5278 -    rebaseHistArray(hist.done, from, to, diff);
 17.5279 -    rebaseHistArray(hist.undone, from, to, diff);
 17.5280 -  }
 17.5281 -
 17.5282 -  // EVENT OPERATORS
 17.5283 -
 17.5284 -  function stopMethod() {e_stop(this);}
 17.5285 -  // Ensure an event has a stop method.
 17.5286 -  function addStop(event) {
 17.5287 -    if (!event.stop) event.stop = stopMethod;
 17.5288 -    return event;
 17.5289 -  }
 17.5290 -
 17.5291 -  function e_preventDefault(e) {
 17.5292 -    if (e.preventDefault) e.preventDefault();
 17.5293 -    else e.returnValue = false;
 17.5294 -  }
 17.5295 -  function e_stopPropagation(e) {
 17.5296 -    if (e.stopPropagation) e.stopPropagation();
 17.5297 -    else e.cancelBubble = true;
 17.5298 -  }
 17.5299 -  function e_defaultPrevented(e) {
 17.5300 -    return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;
 17.5301 -  }
 17.5302 -  function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
 17.5303 -  CodeMirror.e_stop = e_stop;
 17.5304 -  CodeMirror.e_preventDefault = e_preventDefault;
 17.5305 -  CodeMirror.e_stopPropagation = e_stopPropagation;
 17.5306 -
 17.5307 -  function e_target(e) {return e.target || e.srcElement;}
 17.5308 -  function e_button(e) {
 17.5309 -    var b = e.which;
 17.5310 -    if (b == null) {
 17.5311 -      if (e.button & 1) b = 1;
 17.5312 -      else if (e.button & 2) b = 3;
 17.5313 -      else if (e.button & 4) b = 2;
 17.5314 -    }
 17.5315 -    if (mac && e.ctrlKey && b == 1) b = 3;
 17.5316 -    return b;
 17.5317 -  }
 17.5318 -
 17.5319 -  // EVENT HANDLING
 17.5320 -
 17.5321 -  function on(emitter, type, f) {
 17.5322 -    if (emitter.addEventListener)
 17.5323 -      emitter.addEventListener(type, f, false);
 17.5324 -    else if (emitter.attachEvent)
 17.5325 -      emitter.attachEvent("on" + type, f);
 17.5326 -    else {
 17.5327 -      var map = emitter._handlers || (emitter._handlers = {});
 17.5328 -      var arr = map[type] || (map[type] = []);
 17.5329 -      arr.push(f);
 17.5330 -    }
 17.5331 -  }
 17.5332 -
 17.5333 -  function off(emitter, type, f) {
 17.5334 -    if (emitter.removeEventListener)
 17.5335 -      emitter.removeEventListener(type, f, false);
 17.5336 -    else if (emitter.detachEvent)
 17.5337 -      emitter.detachEvent("on" + type, f);
 17.5338 -    else {
 17.5339 -      var arr = emitter._handlers && emitter._handlers[type];
 17.5340 -      if (!arr) return;
 17.5341 -      for (var i = 0; i < arr.length; ++i)
 17.5342 -        if (arr[i] == f) { arr.splice(i, 1); break; }
 17.5343 -    }
 17.5344 -  }
 17.5345 -
 17.5346 -  function signal(emitter, type /*, values...*/) {
 17.5347 -    var arr = emitter._handlers && emitter._handlers[type];
 17.5348 -    if (!arr) return;
 17.5349 -    var args = Array.prototype.slice.call(arguments, 2);
 17.5350 -    for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);
 17.5351 -  }
 17.5352 -
 17.5353 -  var delayedCallbacks, delayedCallbackDepth = 0;
 17.5354 -  function signalLater(emitter, type /*, values...*/) {
 17.5355 -    var arr = emitter._handlers && emitter._handlers[type];
 17.5356 -    if (!arr) return;
 17.5357 -    var args = Array.prototype.slice.call(arguments, 2);
 17.5358 -    if (!delayedCallbacks) {
 17.5359 -      ++delayedCallbackDepth;
 17.5360 -      delayedCallbacks = [];
 17.5361 -      setTimeout(fireDelayed, 0);
 17.5362 -    }
 17.5363 -    function bnd(f) {return function(){f.apply(null, args);};};
 17.5364 -    for (var i = 0; i < arr.length; ++i)
 17.5365 -      delayedCallbacks.push(bnd(arr[i]));
 17.5366 -  }
 17.5367 -
 17.5368 -  function signalDOMEvent(cm, e, override) {
 17.5369 -    signal(cm, override || e.type, cm, e);
 17.5370 -    return e_defaultPrevented(e) || e.codemirrorIgnore;
 17.5371 -  }
 17.5372 -
 17.5373 -  function fireDelayed() {
 17.5374 -    --delayedCallbackDepth;
 17.5375 -    var delayed = delayedCallbacks;
 17.5376 -    delayedCallbacks = null;
 17.5377 -    for (var i = 0; i < delayed.length; ++i) delayed[i]();
 17.5378 -  }
 17.5379 -
 17.5380 -  function hasHandler(emitter, type) {
 17.5381 -    var arr = emitter._handlers && emitter._handlers[type];
 17.5382 -    return arr && arr.length > 0;
 17.5383 -  }
 17.5384 -
 17.5385 -  CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal;
 17.5386 -
 17.5387 -  function eventMixin(ctor) {
 17.5388 -    ctor.prototype.on = function(type, f) {on(this, type, f);};
 17.5389 -    ctor.prototype.off = function(type, f) {off(this, type, f);};
 17.5390 -  }
 17.5391 -
 17.5392 -  // MISC UTILITIES
 17.5393 -
 17.5394 -  // Number of pixels added to scroller and sizer to hide scrollbar
 17.5395 -  var scrollerCutOff = 30;
 17.5396 -
 17.5397 -  // Returned or thrown by various protocols to signal 'I'm not
 17.5398 -  // handling this'.
 17.5399 -  var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}};
 17.5400 -
 17.5401 -  function Delayed() {this.id = null;}
 17.5402 -  Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}};
 17.5403 -
 17.5404 -  // Counts the column offset in a string, taking tabs into account.
 17.5405 -  // Used mostly to find indentation.
 17.5406 -  function countColumn(string, end, tabSize, startIndex, startValue) {
 17.5407 -    if (end == null) {
 17.5408 -      end = string.search(/[^\s\u00a0]/);
 17.5409 -      if (end == -1) end = string.length;
 17.5410 -    }
 17.5411 -    for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {
 17.5412 -      if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
 17.5413 -      else ++n;
 17.5414 -    }
 17.5415 -    return n;
 17.5416 -  }
 17.5417 -  CodeMirror.countColumn = countColumn;
 17.5418 -
 17.5419 -  var spaceStrs = [""];
 17.5420 -  function spaceStr(n) {
 17.5421 -    while (spaceStrs.length <= n)
 17.5422 -      spaceStrs.push(lst(spaceStrs) + " ");
 17.5423 -    return spaceStrs[n];
 17.5424 -  }
 17.5425 -
 17.5426 -  function lst(arr) { return arr[arr.length-1]; }
 17.5427 -
 17.5428 -  function selectInput(node) {
 17.5429 -    if (ios) { // Mobile Safari apparently has a bug where select() is broken.
 17.5430 -      node.selectionStart = 0;
 17.5431 -      node.selectionEnd = node.value.length;
 17.5432 -    } else {
 17.5433 -      // Suppress mysterious IE10 errors
 17.5434 -      try { node.select(); }
 17.5435 -      catch(_e) {}
 17.5436 -    }
 17.5437 -  }
 17.5438 -
 17.5439 -  function indexOf(collection, elt) {
 17.5440 -    if (collection.indexOf) return collection.indexOf(elt);
 17.5441 -    for (var i = 0, e = collection.length; i < e; ++i)
 17.5442 -      if (collection[i] == elt) return i;
 17.5443 -    return -1;
 17.5444 -  }
 17.5445 -
 17.5446 -  function createObj(base, props) {
 17.5447 -    function Obj() {}
 17.5448 -    Obj.prototype = base;
 17.5449 -    var inst = new Obj();
 17.5450 -    if (props) copyObj(props, inst);
 17.5451 -    return inst;
 17.5452 -  }
 17.5453 -
 17.5454 -  function copyObj(obj, target) {
 17.5455 -    if (!target) target = {};
 17.5456 -    for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
 17.5457 -    return target;
 17.5458 -  }
 17.5459 -
 17.5460 -  function emptyArray(size) {
 17.5461 -    for (var a = [], i = 0; i < size; ++i) a.push(undefined);
 17.5462 -    return a;
 17.5463 -  }
 17.5464 -
 17.5465 -  function bind(f) {
 17.5466 -    var args = Array.prototype.slice.call(arguments, 1);
 17.5467 -    return function(){return f.apply(null, args);};
 17.5468 -  }
 17.5469 -
 17.5470 -  var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
 17.5471 -  function isWordChar(ch) {
 17.5472 -    return /\w/.test(ch) || ch > "\x80" &&
 17.5473 -      (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));
 17.5474 -  }
 17.5475 -
 17.5476 -  function isEmpty(obj) {
 17.5477 -    for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;
 17.5478 -    return true;
 17.5479 -  }
 17.5480 -
 17.5481 -  var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;
 17.5482 -
 17.5483 -  // DOM UTILITIES
 17.5484 -
 17.5485 -  function elt(tag, content, className, style) {
 17.5486 -    var e = document.createElement(tag);
 17.5487 -    if (className) e.className = className;
 17.5488 -    if (style) e.style.cssText = style;
 17.5489 -    if (typeof content == "string") setTextContent(e, content);
 17.5490 -    else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
 17.5491 -    return e;
 17.5492 -  }
 17.5493 -
 17.5494 -  function removeChildren(e) {
 17.5495 -    for (var count = e.childNodes.length; count > 0; --count)
 17.5496 -      e.removeChild(e.firstChild);
 17.5497 -    return e;
 17.5498 -  }
 17.5499 -
 17.5500 -  function removeChildrenAndAdd(parent, e) {
 17.5501 -    return removeChildren(parent).appendChild(e);
 17.5502 -  }
 17.5503 -
 17.5504 -  function setTextContent(e, str) {
 17.5505 -    if (ie_lt9) {
 17.5506 -      e.innerHTML = "";
 17.5507 -      e.appendChild(document.createTextNode(str));
 17.5508 -    } else e.textContent = str;
 17.5509 -  }
 17.5510 -
 17.5511 -  function getRect(node) {
 17.5512 -    return node.getBoundingClientRect();
 17.5513 -  }
 17.5514 -  CodeMirror.replaceGetRect = function(f) { getRect = f; };
 17.5515 -
 17.5516 -  // FEATURE DETECTION
 17.5517 -
 17.5518 -  // Detect drag-and-drop
 17.5519 -  var dragAndDrop = function() {
 17.5520 -    // There is *some* kind of drag-and-drop support in IE6-8, but I
 17.5521 -    // couldn't get it to work yet.
 17.5522 -    if (ie_lt9) return false;
 17.5523 -    var div = elt('div');
 17.5524 -    return "draggable" in div || "dragDrop" in div;
 17.5525 -  }();
 17.5526 -
 17.5527 -  // For a reason I have yet to figure out, some browsers disallow
 17.5528 -  // word wrapping between certain characters *only* if a new inline
 17.5529 -  // element is started between them. This makes it hard to reliably
 17.5530 -  // measure the position of things, since that requires inserting an
 17.5531 -  // extra span. This terribly fragile set of tests matches the
 17.5532 -  // character combinations that suffer from this phenomenon on the
 17.5533 -  // various browsers.
 17.5534 -  function spanAffectsWrapping() { return false; }
 17.5535 -  if (gecko) // Only for "$'"
 17.5536 -    spanAffectsWrapping = function(str, i) {
 17.5537 -      return str.charCodeAt(i - 1) == 36 && str.charCodeAt(i) == 39;
 17.5538 -    };
 17.5539 -  else if (safari && !/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent))
 17.5540 -    spanAffectsWrapping = function(str, i) {
 17.5541 -      return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1));
 17.5542 -    };
 17.5543 -  else if (webkit && /Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent))
 17.5544 -    spanAffectsWrapping = function(str, i) {
 17.5545 -      var code = str.charCodeAt(i - 1);
 17.5546 -      return code >= 8208 && code <= 8212;
 17.5547 -    };
 17.5548 -  else if (webkit)
 17.5549 -    spanAffectsWrapping = function(str, i) {
 17.5550 -      if (i > 1 && str.charCodeAt(i - 1) == 45) {
 17.5551 -        if (/\w/.test(str.charAt(i - 2)) && /[^\-?\.]/.test(str.charAt(i))) return true;
 17.5552 -        if (i > 2 && /[\d\.,]/.test(str.charAt(i - 2)) && /[\d\.,]/.test(str.charAt(i))) return false;
 17.5553 -      }
 17.5554 -      return /[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1));
 17.5555 -    };
 17.5556 -
 17.5557 -  var knownScrollbarWidth;
 17.5558 -  function scrollbarWidth(measure) {
 17.5559 -    if (knownScrollbarWidth != null) return knownScrollbarWidth;
 17.5560 -    var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll");
 17.5561 -    removeChildrenAndAdd(measure, test);
 17.5562 -    if (test.offsetWidth)
 17.5563 -      knownScrollbarWidth = test.offsetHeight - test.clientHeight;
 17.5564 -    return knownScrollbarWidth || 0;
 17.5565 -  }
 17.5566 -
 17.5567 -  var zwspSupported;
 17.5568 -  function zeroWidthElement(measure) {
 17.5569 -    if (zwspSupported == null) {
 17.5570 -      var test = elt("span", "\u200b");
 17.5571 -      removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
 17.5572 -      if (measure.firstChild.offsetHeight != 0)
 17.5573 -        zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8;
 17.5574 -    }
 17.5575 -    if (zwspSupported) return elt("span", "\u200b");
 17.5576 -    else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
 17.5577 -  }
 17.5578 -
 17.5579 -  // See if "".split is the broken IE version, if so, provide an
 17.5580 -  // alternative way to split lines.
 17.5581 -  var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
 17.5582 -    var pos = 0, result = [], l = string.length;
 17.5583 -    while (pos <= l) {
 17.5584 -      var nl = string.indexOf("\n", pos);
 17.5585 -      if (nl == -1) nl = string.length;
 17.5586 -      var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl);
 17.5587 -      var rt = line.indexOf("\r");
 17.5588 -      if (rt != -1) {
 17.5589 -        result.push(line.slice(0, rt));
 17.5590 -        pos += rt + 1;
 17.5591 -      } else {
 17.5592 -        result.push(line);
 17.5593 -        pos = nl + 1;
 17.5594 -      }
 17.5595 -    }
 17.5596 -    return result;
 17.5597 -  } : function(string){return string.split(/\r\n?|\n/);};
 17.5598 -  CodeMirror.splitLines = splitLines;
 17.5599 -
 17.5600 -  var hasSelection = window.getSelection ? function(te) {
 17.5601 -    try { return te.selectionStart != te.selectionEnd; }
 17.5602 -    catch(e) { return false; }
 17.5603 -  } : function(te) {
 17.5604 -    try {var range = te.ownerDocument.selection.createRange();}
 17.5605 -    catch(e) {}
 17.5606 -    if (!range || range.parentElement() != te) return false;
 17.5607 -    return range.compareEndPoints("StartToEnd", range) != 0;
 17.5608 -  };
 17.5609 -
 17.5610 -  var hasCopyEvent = (function() {
 17.5611 -    var e = elt("div");
 17.5612 -    if ("oncopy" in e) return true;
 17.5613 -    e.setAttribute("oncopy", "return;");
 17.5614 -    return typeof e.oncopy == 'function';
 17.5615 -  })();
 17.5616 -
 17.5617 -  // KEY NAMING
 17.5618 -
 17.5619 -  var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
 17.5620 -                  19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
 17.5621 -                  36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
 17.5622 -                  46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete",
 17.5623 -                  186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
 17.5624 -                  221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home",
 17.5625 -                  63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"};
 17.5626 -  CodeMirror.keyNames = keyNames;
 17.5627 -  (function() {
 17.5628 -    // Number keys
 17.5629 -    for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i);
 17.5630 -    // Alphabetic keys
 17.5631 -    for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);
 17.5632 -    // Function keys
 17.5633 -    for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i;
 17.5634 -  })();
 17.5635 -
 17.5636 -  // BIDI HELPERS
 17.5637 -
 17.5638 -  function iterateBidiSections(order, from, to, f) {
 17.5639 -    if (!order) return f(from, to, "ltr");
 17.5640 -    var found = false;
 17.5641 -    for (var i = 0; i < order.length; ++i) {
 17.5642 -      var part = order[i];
 17.5643 -      if (part.from < to && part.to > from || from == to && part.to == from) {
 17.5644 -        f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
 17.5645 -        found = true;
 17.5646 -      }
 17.5647 -    }
 17.5648 -    if (!found) f(from, to, "ltr");
 17.5649 -  }
 17.5650 -
 17.5651 -  function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }
 17.5652 -  function bidiRight(part) { return part.level % 2 ? part.from : part.to; }
 17.5653 -
 17.5654 -  function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }
 17.5655 -  function lineRight(line) {
 17.5656 -    var order = getOrder(line);
 17.5657 -    if (!order) return line.text.length;
 17.5658 -    return bidiRight(lst(order));
 17.5659 -  }
 17.5660 -
 17.5661 -  function lineStart(cm, lineN) {
 17.5662 -    var line = getLine(cm.doc, lineN);
 17.5663 -    var visual = visualLine(cm.doc, line);
 17.5664 -    if (visual != line) lineN = lineNo(visual);
 17.5665 -    var order = getOrder(visual);
 17.5666 -    var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);
 17.5667 -    return Pos(lineN, ch);
 17.5668 -  }
 17.5669 -  function lineEnd(cm, lineN) {
 17.5670 -    var merged, line;
 17.5671 -    while (merged = collapsedSpanAtEnd(line = getLine(cm.doc, lineN)))
 17.5672 -      lineN = merged.find().to.line;
 17.5673 -    var order = getOrder(line);
 17.5674 -    var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);
 17.5675 -    return Pos(lineN, ch);
 17.5676 -  }
 17.5677 -
 17.5678 -  function compareBidiLevel(order, a, b) {
 17.5679 -    var linedir = order[0].level;
 17.5680 -    if (a == linedir) return true;
 17.5681 -    if (b == linedir) return false;
 17.5682 -    return a < b;
 17.5683 -  }
 17.5684 -  var bidiOther;
 17.5685 -  function getBidiPartAt(order, pos) {
 17.5686 -    for (var i = 0, found; i < order.length; ++i) {
 17.5687 -      var cur = order[i];
 17.5688 -      if (cur.from < pos && cur.to > pos) { bidiOther = null; return i; }
 17.5689 -      if (cur.from == pos || cur.to == pos) {
 17.5690 -        if (found == null) {
 17.5691 -          found = i;
 17.5692 -        } else if (compareBidiLevel(order, cur.level, order[found].level)) {
 17.5693 -          bidiOther = found;
 17.5694 -          return i;
 17.5695 -        } else {
 17.5696 -          bidiOther = i;
 17.5697 -          return found;
 17.5698 -        }
 17.5699 -      }
 17.5700 -    }
 17.5701 -    bidiOther = null;
 17.5702 -    return found;
 17.5703 -  }
 17.5704 -
 17.5705 -  function moveInLine(line, pos, dir, byUnit) {
 17.5706 -    if (!byUnit) return pos + dir;
 17.5707 -    do pos += dir;
 17.5708 -    while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));
 17.5709 -    return pos;
 17.5710 -  }
 17.5711 -
 17.5712 -  // This is somewhat involved. It is needed in order to move
 17.5713 -  // 'visually' through bi-directional text -- i.e., pressing left
 17.5714 -  // should make the cursor go left, even when in RTL text. The
 17.5715 -  // tricky part is the 'jumps', where RTL and LTR text touch each
 17.5716 -  // other. This often requires the cursor offset to move more than
 17.5717 -  // one unit, in order to visually move one unit.
 17.5718 -  function moveVisually(line, start, dir, byUnit) {
 17.5719 -    var bidi = getOrder(line);
 17.5720 -    if (!bidi) return moveLogically(line, start, dir, byUnit);
 17.5721 -    var pos = getBidiPartAt(bidi, start), part = bidi[pos];
 17.5722 -    var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);
 17.5723 -
 17.5724 -    for (;;) {
 17.5725 -      if (target > part.from && target < part.to) return target;
 17.5726 -      if (target == part.from || target == part.to) {
 17.5727 -        if (getBidiPartAt(bidi, target) == pos) return target;
 17.5728 -        part = bidi[pos += dir];
 17.5729 -        return (dir > 0) == part.level % 2 ? part.to : part.from;
 17.5730 -      } else {
 17.5731 -        part = bidi[pos += dir];
 17.5732 -        if (!part) return null;
 17.5733 -        if ((dir > 0) == part.level % 2)
 17.5734 -          target = moveInLine(line, part.to, -1, byUnit);
 17.5735 -        else
 17.5736 -          target = moveInLine(line, part.from, 1, byUnit);
 17.5737 -      }
 17.5738 -    }
 17.5739 -  }
 17.5740 -
 17.5741 -  function moveLogically(line, start, dir, byUnit) {
 17.5742 -    var target = start + dir;
 17.5743 -    if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir;
 17.5744 -    return target < 0 || target > line.text.length ? null : target;
 17.5745 -  }
 17.5746 -
 17.5747 -  // Bidirectional ordering algorithm
 17.5748 -  // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
 17.5749 -  // that this (partially) implements.
 17.5750 -
 17.5751 -  // One-char codes used for character types:
 17.5752 -  // L (L):   Left-to-Right
 17.5753 -  // R (R):   Right-to-Left
 17.5754 -  // r (AL):  Right-to-Left Arabic
 17.5755 -  // 1 (EN):  European Number
 17.5756 -  // + (ES):  European Number Separator
 17.5757 -  // % (ET):  European Number Terminator
 17.5758 -  // n (AN):  Arabic Number
 17.5759 -  // , (CS):  Common Number Separator
 17.5760 -  // m (NSM): Non-Spacing Mark
 17.5761 -  // b (BN):  Boundary Neutral
 17.5762 -  // s (B):   Paragraph Separator
 17.5763 -  // t (S):   Segment Separator
 17.5764 -  // w (WS):  Whitespace
 17.5765 -  // N (ON):  Other Neutrals
 17.5766 -
 17.5767 -  // Returns null if characters are ordered as they appear
 17.5768 -  // (left-to-right), or an array of sections ({from, to, level}
 17.5769 -  // objects) in the order in which they occur visually.
 17.5770 -  var bidiOrdering = (function() {
 17.5771 -    // Character types for codepoints 0 to 0xff
 17.5772 -    var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
 17.5773 -    // Character types for codepoints 0x600 to 0x6ff
 17.5774 -    var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
 17.5775 -    function charType(code) {
 17.5776 -      if (code <= 0xff) return lowTypes.charAt(code);
 17.5777 -      else if (0x590 <= code && code <= 0x5f4) return "R";
 17.5778 -      else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600);
 17.5779 -      else if (0x700 <= code && code <= 0x8ac) return "r";
 17.5780 -      else return "L";
 17.5781 -    }
 17.5782 -
 17.5783 -    var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
 17.5784 -    var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;
 17.5785 -    // Browsers seem to always treat the boundaries of block elements as being L.
 17.5786 -    var outerType = "L";
 17.5787 -
 17.5788 -    return function(str) {
 17.5789 -      if (!bidiRE.test(str)) return false;
 17.5790 -      var len = str.length, types = [];
 17.5791 -      for (var i = 0, type; i < len; ++i)
 17.5792 -        types.push(type = charType(str.charCodeAt(i)));
 17.5793 -
 17.5794 -      // W1. Examine each non-spacing mark (NSM) in the level run, and
 17.5795 -      // change the type of the NSM to the type of the previous
 17.5796 -      // character. If the NSM is at the start of the level run, it will
 17.5797 -      // get the type of sor.
 17.5798 -      for (var i = 0, prev = outerType; i < len; ++i) {
 17.5799 -        var type = types[i];
 17.5800 -        if (type == "m") types[i] = prev;
 17.5801 -        else prev = type;
 17.5802 -      }
 17.5803 -
 17.5804 -      // W2. Search backwards from each instance of a European number
 17.5805 -      // until the first strong type (R, L, AL, or sor) is found. If an
 17.5806 -      // AL is found, change the type of the European number to Arabic
 17.5807 -      // number.
 17.5808 -      // W3. Change all ALs to R.
 17.5809 -      for (var i = 0, cur = outerType; i < len; ++i) {
 17.5810 -        var type = types[i];
 17.5811 -        if (type == "1" && cur == "r") types[i] = "n";
 17.5812 -        else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; }
 17.5813 -      }
 17.5814 -
 17.5815 -      // W4. A single European separator between two European numbers
 17.5816 -      // changes to a European number. A single common separator between
 17.5817 -      // two numbers of the same type changes to that type.
 17.5818 -      for (var i = 1, prev = types[0]; i < len - 1; ++i) {
 17.5819 -        var type = types[i];
 17.5820 -        if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1";
 17.5821 -        else if (type == "," && prev == types[i+1] &&
 17.5822 -                 (prev == "1" || prev == "n")) types[i] = prev;
 17.5823 -        prev = type;
 17.5824 -      }
 17.5825 -
 17.5826 -      // W5. A sequence of European terminators adjacent to European
 17.5827 -      // numbers changes to all European numbers.
 17.5828 -      // W6. Otherwise, separators and terminators change to Other
 17.5829 -      // Neutral.
 17.5830 -      for (var i = 0; i < len; ++i) {
 17.5831 -        var type = types[i];
 17.5832 -        if (type == ",") types[i] = "N";
 17.5833 -        else if (type == "%") {
 17.5834 -          for (var end = i + 1; end < len && types[end] == "%"; ++end) {}
 17.5835 -          var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N";
 17.5836 -          for (var j = i; j < end; ++j) types[j] = replace;
 17.5837 -          i = end - 1;
 17.5838 -        }
 17.5839 -      }
 17.5840 -
 17.5841 -      // W7. Search backwards from each instance of a European number
 17.5842 -      // until the first strong type (R, L, or sor) is found. If an L is
 17.5843 -      // found, then change the type of the European number to L.
 17.5844 -      for (var i = 0, cur = outerType; i < len; ++i) {
 17.5845 -        var type = types[i];
 17.5846 -        if (cur == "L" && type == "1") types[i] = "L";
 17.5847 -        else if (isStrong.test(type)) cur = type;
 17.5848 -      }
 17.5849 -
 17.5850 -      // N1. A sequence of neutrals takes the direction of the
 17.5851 -      // surrounding strong text if the text on both sides has the same
 17.5852 -      // direction. European and Arabic numbers act as if they were R in
 17.5853 -      // terms of their influence on neutrals. Start-of-level-run (sor)
 17.5854 -      // and end-of-level-run (eor) are used at level run boundaries.
 17.5855 -      // N2. Any remaining neutrals take the embedding direction.
 17.5856 -      for (var i = 0; i < len; ++i) {
 17.5857 -        if (isNeutral.test(types[i])) {
 17.5858 -          for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}
 17.5859 -          var before = (i ? types[i-1] : outerType) == "L";
 17.5860 -          var after = (end < len - 1 ? types[end] : outerType) == "L";
 17.5861 -          var replace = before || after ? "L" : "R";
 17.5862 -          for (var j = i; j < end; ++j) types[j] = replace;
 17.5863 -          i = end - 1;
 17.5864 -        }
 17.5865 -      }
 17.5866 -
 17.5867 -      // Here we depart from the documented algorithm, in order to avoid
 17.5868 -      // building up an actual levels array. Since there are only three
 17.5869 -      // levels (0, 1, 2) in an implementation that doesn't take
 17.5870 -      // explicit embedding into account, we can build up the order on
 17.5871 -      // the fly, without following the level-based algorithm.
 17.5872 -      var order = [], m;
 17.5873 -      for (var i = 0; i < len;) {
 17.5874 -        if (countsAsLeft.test(types[i])) {
 17.5875 -          var start = i;
 17.5876 -          for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}
 17.5877 -          order.push({from: start, to: i, level: 0});
 17.5878 -        } else {
 17.5879 -          var pos = i, at = order.length;
 17.5880 -          for (++i; i < len && types[i] != "L"; ++i) {}
 17.5881 -          for (var j = pos; j < i;) {
 17.5882 -            if (countsAsNum.test(types[j])) {
 17.5883 -              if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1});
 17.5884 -              var nstart = j;
 17.5885 -              for (++j; j < i && countsAsNum.test(types[j]); ++j) {}
 17.5886 -              order.splice(at, 0, {from: nstart, to: j, level: 2});
 17.5887 -              pos = j;
 17.5888 -            } else ++j;
 17.5889 -          }
 17.5890 -          if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1});
 17.5891 -        }
 17.5892 -      }
 17.5893 -      if (order[0].level == 1 && (m = str.match(/^\s+/))) {
 17.5894 -        order[0].from = m[0].length;
 17.5895 -        order.unshift({from: 0, to: m[0].length, level: 0});
 17.5896 -      }
 17.5897 -      if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
 17.5898 -        lst(order).to -= m[0].length;
 17.5899 -        order.push({from: len - m[0].length, to: len, level: 0});
 17.5900 -      }
 17.5901 -      if (order[0].level != lst(order).level)
 17.5902 -        order.push({from: len, to: len, level: order[0].level});
 17.5903 -
 17.5904 -      return order;
 17.5905 -    };
 17.5906 -  })();
 17.5907 -
 17.5908 -  // THE END
 17.5909 -
 17.5910 -  CodeMirror.version = "3.19.0";
 17.5911 -
 17.5912 -  return CodeMirror;
 17.5913 -})();
    18.1 --- a/dew4nb/release/web4dew/js/codemirror/mode/clike.js	Wed Jan 29 17:28:57 2014 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,300 +0,0 @@
    18.4 -CodeMirror.defineMode("clike", function(config, parserConfig) {
    18.5 -  var indentUnit = config.indentUnit,
    18.6 -      statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
    18.7 -      keywords = parserConfig.keywords || {},
    18.8 -      builtin = parserConfig.builtin || {},
    18.9 -      blockKeywords = parserConfig.blockKeywords || {},
   18.10 -      atoms = parserConfig.atoms || {},
   18.11 -      hooks = parserConfig.hooks || {},
   18.12 -      multiLineStrings = parserConfig.multiLineStrings;
   18.13 -  var isOperatorChar = /[+\-*&%=<>!?|\/]/;
   18.14 -
   18.15 -  var curPunc;
   18.16 -
   18.17 -  function tokenBase(stream, state) {
   18.18 -    var ch = stream.next();
   18.19 -    if (hooks[ch]) {
   18.20 -      var result = hooks[ch](stream, state);
   18.21 -      if (result !== false) return result;
   18.22 -    }
   18.23 -    if (ch == '"' || ch == "'") {
   18.24 -      state.tokenize = tokenString(ch);
   18.25 -      return state.tokenize(stream, state);
   18.26 -    }
   18.27 -    if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
   18.28 -      curPunc = ch;
   18.29 -      return null;
   18.30 -    }
   18.31 -    if (/\d/.test(ch)) {
   18.32 -      stream.eatWhile(/[\w\.]/);
   18.33 -      return "number";
   18.34 -    }
   18.35 -    if (ch == "/") {
   18.36 -      if (stream.eat("*")) {
   18.37 -        state.tokenize = tokenComment;
   18.38 -        return tokenComment(stream, state);
   18.39 -      }
   18.40 -      if (stream.eat("/")) {
   18.41 -        stream.skipToEnd();
   18.42 -        return "comment";
   18.43 -      }
   18.44 -    }
   18.45 -    if (isOperatorChar.test(ch)) {
   18.46 -      stream.eatWhile(isOperatorChar);
   18.47 -      return "operator";
   18.48 -    }
   18.49 -    stream.eatWhile(/[\w\$_]/);
   18.50 -    var cur = stream.current();
   18.51 -    if (keywords.propertyIsEnumerable(cur)) {
   18.52 -      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
   18.53 -      return "keyword";
   18.54 -    }
   18.55 -    if (builtin.propertyIsEnumerable(cur)) {
   18.56 -      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
   18.57 -      return "builtin";
   18.58 -    }
   18.59 -    if (atoms.propertyIsEnumerable(cur)) return "atom";
   18.60 -    return "variable";
   18.61 -  }
   18.62 -
   18.63 -  function tokenString(quote) {
   18.64 -    return function(stream, state) {
   18.65 -      var escaped = false, next, end = false;
   18.66 -      while ((next = stream.next()) != null) {
   18.67 -        if (next == quote && !escaped) {end = true; break;}
   18.68 -        escaped = !escaped && next == "\\";
   18.69 -      }
   18.70 -      if (end || !(escaped || multiLineStrings))
   18.71 -        state.tokenize = null;
   18.72 -      return "string";
   18.73 -    };
   18.74 -  }
   18.75 -
   18.76 -  function tokenComment(stream, state) {
   18.77 -    var maybeEnd = false, ch;
   18.78 -    while (ch = stream.next()) {
   18.79 -      if (ch == "/" && maybeEnd) {
   18.80 -        state.tokenize = null;
   18.81 -        break;
   18.82 -      }
   18.83 -      maybeEnd = (ch == "*");
   18.84 -    }
   18.85 -    return "comment";
   18.86 -  }
   18.87 -
   18.88 -  function Context(indented, column, type, align, prev) {
   18.89 -    this.indented = indented;
   18.90 -    this.column = column;
   18.91 -    this.type = type;
   18.92 -    this.align = align;
   18.93 -    this.prev = prev;
   18.94 -  }
   18.95 -  function pushContext(state, col, type) {
   18.96 -    var indent = state.indented;
   18.97 -    if (state.context && state.context.type == "statement")
   18.98 -      indent = state.context.indented;
   18.99 -    return state.context = new Context(indent, col, type, null, state.context);
  18.100 -  }
  18.101 -  function popContext(state) {
  18.102 -    var t = state.context.type;
  18.103 -    if (t == ")" || t == "]" || t == "}")
  18.104 -      state.indented = state.context.indented;
  18.105 -    return state.context = state.context.prev;
  18.106 -  }
  18.107 -
  18.108 -  // Interface
  18.109 -
  18.110 -  return {
  18.111 -    startState: function(basecolumn) {
  18.112 -      return {
  18.113 -        tokenize: null,
  18.114 -        context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
  18.115 -        indented: 0,
  18.116 -        startOfLine: true
  18.117 -      };
  18.118 -    },
  18.119 -
  18.120 -    token: function(stream, state) {
  18.121 -      var ctx = state.context;
  18.122 -      if (stream.sol()) {
  18.123 -        if (ctx.align == null) ctx.align = false;
  18.124 -        state.indented = stream.indentation();
  18.125 -        state.startOfLine = true;
  18.126 -      }
  18.127 -      if (stream.eatSpace()) return null;
  18.128 -      curPunc = null;
  18.129 -      var style = (state.tokenize || tokenBase)(stream, state);
  18.130 -      if (style == "comment" || style == "meta") return style;
  18.131 -      if (ctx.align == null) ctx.align = true;
  18.132 -
  18.133 -      if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
  18.134 -      else if (curPunc == "{") pushContext(state, stream.column(), "}");
  18.135 -      else if (curPunc == "[") pushContext(state, stream.column(), "]");
  18.136 -      else if (curPunc == "(") pushContext(state, stream.column(), ")");
  18.137 -      else if (curPunc == "}") {
  18.138 -        while (ctx.type == "statement") ctx = popContext(state);
  18.139 -        if (ctx.type == "}") ctx = popContext(state);
  18.140 -        while (ctx.type == "statement") ctx = popContext(state);
  18.141 -      }
  18.142 -      else if (curPunc == ctx.type) popContext(state);
  18.143 -      else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
  18.144 -        pushContext(state, stream.column(), "statement");
  18.145 -      state.startOfLine = false;
  18.146 -      return style;
  18.147 -    },
  18.148 -
  18.149 -    indent: function(state, textAfter) {
  18.150 -      if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
  18.151 -      var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
  18.152 -      if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  18.153 -      var closing = firstChar == ctx.type;
  18.154 -      if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  18.155 -      else if (ctx.align) return ctx.column + (closing ? 0 : 1);
  18.156 -      else return ctx.indented + (closing ? 0 : indentUnit);
  18.157 -    },
  18.158 -
  18.159 -    electricChars: "{}"
  18.160 -  };
  18.161 -});
  18.162 -
  18.163 -(function() {
  18.164 -  function words(str) {
  18.165 -    var obj = {}, words = str.split(" ");
  18.166 -    for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
  18.167 -    return obj;
  18.168 -  }
  18.169 -  var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
  18.170 -    "double static else struct entry switch extern typedef float union for unsigned " +
  18.171 -    "goto while enum void const signed volatile";
  18.172 -
  18.173 -  function cppHook(stream, state) {
  18.174 -    if (!state.startOfLine) return false;
  18.175 -    for (;;) {
  18.176 -      if (stream.skipTo("\\")) {
  18.177 -        stream.next();
  18.178 -        if (stream.eol()) {
  18.179 -          state.tokenize = cppHook;
  18.180 -          break;
  18.181 -        }
  18.182 -      } else {
  18.183 -        stream.skipToEnd();
  18.184 -        state.tokenize = null;
  18.185 -        break;
  18.186 -      }
  18.187 -    }
  18.188 -    return "meta";
  18.189 -  }
  18.190 -
  18.191 -  // C#-style strings where "" escapes a quote.
  18.192 -  function tokenAtString(stream, state) {
  18.193 -    var next;
  18.194 -    while ((next = stream.next()) != null) {
  18.195 -      if (next == '"' && !stream.eat('"')) {
  18.196 -        state.tokenize = null;
  18.197 -        break;
  18.198 -      }
  18.199 -    }
  18.200 -    return "string";
  18.201 -  }
  18.202 -
  18.203 -  function mimes(ms, mode) {
  18.204 -    for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode);
  18.205 -  }
  18.206 -
  18.207 -  mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], {
  18.208 -    name: "clike",
  18.209 -    keywords: words(cKeywords),
  18.210 -    blockKeywords: words("case do else for if switch while struct"),
  18.211 -    atoms: words("null"),
  18.212 -    hooks: {"#": cppHook}
  18.213 -  });
  18.214 -  mimes(["text/x-c++src", "text/x-c++hdr"], {
  18.215 -    name: "clike",
  18.216 -    keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
  18.217 -                    "static_cast typeid catch operator template typename class friend private " +
  18.218 -                    "this using const_cast inline public throw virtual delete mutable protected " +
  18.219 -                    "wchar_t"),
  18.220 -    blockKeywords: words("catch class do else finally for if struct switch try while"),
  18.221 -    atoms: words("true false null"),
  18.222 -    hooks: {"#": cppHook}
  18.223 -  });
  18.224 -  CodeMirror.defineMIME("text/x-java", {
  18.225 -    name: "clike",
  18.226 -    keywords: words("abstract assert boolean break byte case catch char class const continue default " + 
  18.227 -                    "do double else enum extends final finally float for goto if implements import " +
  18.228 -                    "instanceof int interface long native new package private protected public " +
  18.229 -                    "return short static strictfp super switch synchronized this throw throws transient " +
  18.230 -                    "try void volatile while"),
  18.231 -    blockKeywords: words("catch class do else finally for if switch try while"),
  18.232 -    atoms: words("true false null"),
  18.233 -    hooks: {
  18.234 -      "@": function(stream) {
  18.235 -        stream.eatWhile(/[\w\$_]/);
  18.236 -        return "meta";
  18.237 -      }
  18.238 -    }
  18.239 -  });
  18.240 -  CodeMirror.defineMIME("text/x-csharp", {
  18.241 -    name: "clike",
  18.242 -    keywords: words("abstract as base break case catch checked class const continue" + 
  18.243 -                    " default delegate do else enum event explicit extern finally fixed for" + 
  18.244 -                    " foreach goto if implicit in interface internal is lock namespace new" + 
  18.245 -                    " operator out override params private protected public readonly ref return sealed" + 
  18.246 -                    " sizeof stackalloc static struct switch this throw try typeof unchecked" + 
  18.247 -                    " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + 
  18.248 -                    " global group into join let orderby partial remove select set value var yield"),
  18.249 -    blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
  18.250 -    builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +
  18.251 -                    " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +
  18.252 -                    " UInt64 bool byte char decimal double short int long object"  +
  18.253 -                    " sbyte float string ushort uint ulong"),
  18.254 -    atoms: words("true false null"),
  18.255 -    hooks: {
  18.256 -      "@": function(stream, state) {
  18.257 -        if (stream.eat('"')) {
  18.258 -          state.tokenize = tokenAtString;
  18.259 -          return tokenAtString(stream, state);
  18.260 -        }
  18.261 -        stream.eatWhile(/[\w\$_]/);
  18.262 -        return "meta";
  18.263 -      }
  18.264 -    }
  18.265 -  });
  18.266 -  CodeMirror.defineMIME("text/x-scala", {
  18.267 -    name: "clike",
  18.268 -    keywords: words(
  18.269 -      
  18.270 -      /* scala */
  18.271 -      "abstract case catch class def do else extends false final finally for forSome if " +
  18.272 -      "implicit import lazy match new null object override package private protected return " +
  18.273 -      "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +
  18.274 -      "<% >: # @ " +
  18.275 -                    
  18.276 -      /* package scala */
  18.277 -      "assert assume require print println printf readLine readBoolean readByte readShort " +
  18.278 -      "readChar readInt readLong readFloat readDouble " +
  18.279 -      
  18.280 -      "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
  18.281 -      "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
  18.282 -      "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
  18.283 -      "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
  18.284 -      "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " +
  18.285 -      
  18.286 -      /* package java.lang */            
  18.287 -      "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
  18.288 -      "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
  18.289 -      "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
  18.290 -      "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
  18.291 -      
  18.292 -      
  18.293 -    ),
  18.294 -    blockKeywords: words("catch class do else finally for forSome if match switch try while"),
  18.295 -    atoms: words("true false null"),
  18.296 -    hooks: {
  18.297 -      "@": function(stream) {
  18.298 -        stream.eatWhile(/[\w\$_]/);
  18.299 -        return "meta";
  18.300 -      }
  18.301 -    }
  18.302 -  });
  18.303 -}());
    19.1 --- a/dew4nb/release/web4dew/js/codemirror/mode/xml.js	Wed Jan 29 17:28:57 2014 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,324 +0,0 @@
    19.4 -CodeMirror.defineMode("xml", function(config, parserConfig) {
    19.5 -  var indentUnit = config.indentUnit;
    19.6 -  var Kludges = parserConfig.htmlMode ? {
    19.7 -    autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
    19.8 -                      'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
    19.9 -                      'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
   19.10 -                      'track': true, 'wbr': true},
   19.11 -    implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
   19.12 -                       'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
   19.13 -                       'th': true, 'tr': true},
   19.14 -    contextGrabbers: {
   19.15 -      'dd': {'dd': true, 'dt': true},
   19.16 -      'dt': {'dd': true, 'dt': true},
   19.17 -      'li': {'li': true},
   19.18 -      'option': {'option': true, 'optgroup': true},
   19.19 -      'optgroup': {'optgroup': true},
   19.20 -      'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
   19.21 -            'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
   19.22 -            'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
   19.23 -            'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
   19.24 -            'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
   19.25 -      'rp': {'rp': true, 'rt': true},
   19.26 -      'rt': {'rp': true, 'rt': true},
   19.27 -      'tbody': {'tbody': true, 'tfoot': true},
   19.28 -      'td': {'td': true, 'th': true},
   19.29 -      'tfoot': {'tbody': true},
   19.30 -      'th': {'td': true, 'th': true},
   19.31 -      'thead': {'tbody': true, 'tfoot': true},
   19.32 -      'tr': {'tr': true}
   19.33 -    },
   19.34 -    doNotIndent: {"pre": true},
   19.35 -    allowUnquoted: true,
   19.36 -    allowMissing: true
   19.37 -  } : {
   19.38 -    autoSelfClosers: {},
   19.39 -    implicitlyClosed: {},
   19.40 -    contextGrabbers: {},
   19.41 -    doNotIndent: {},
   19.42 -    allowUnquoted: false,
   19.43 -    allowMissing: false
   19.44 -  };
   19.45 -  var alignCDATA = parserConfig.alignCDATA;
   19.46 -
   19.47 -  // Return variables for tokenizers
   19.48 -  var tagName, type;
   19.49 -
   19.50 -  function inText(stream, state) {
   19.51 -    function chain(parser) {
   19.52 -      state.tokenize = parser;
   19.53 -      return parser(stream, state);
   19.54 -    }
   19.55 -
   19.56 -    var ch = stream.next();
   19.57 -    if (ch == "<") {
   19.58 -      if (stream.eat("!")) {
   19.59 -        if (stream.eat("[")) {
   19.60 -          if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
   19.61 -          else return null;
   19.62 -        }
   19.63 -        else if (stream.match("--")) return chain(inBlock("comment", "-->"));
   19.64 -        else if (stream.match("DOCTYPE", true, true)) {
   19.65 -          stream.eatWhile(/[\w\._\-]/);
   19.66 -          return chain(doctype(1));
   19.67 -        }
   19.68 -        else return null;
   19.69 -      }
   19.70 -      else if (stream.eat("?")) {
   19.71 -        stream.eatWhile(/[\w\._\-]/);
   19.72 -        state.tokenize = inBlock("meta", "?>");
   19.73 -        return "meta";
   19.74 -      }
   19.75 -      else {
   19.76 -        var isClose = stream.eat("/");
   19.77 -        tagName = "";
   19.78 -        var c;
   19.79 -        while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
   19.80 -        if (!tagName) return "error";
   19.81 -        type = isClose ? "closeTag" : "openTag";
   19.82 -        state.tokenize = inTag;
   19.83 -        return "tag";
   19.84 -      }
   19.85 -    }
   19.86 -    else if (ch == "&") {
   19.87 -      var ok;
   19.88 -      if (stream.eat("#")) {
   19.89 -        if (stream.eat("x")) {
   19.90 -          ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");          
   19.91 -        } else {
   19.92 -          ok = stream.eatWhile(/[\d]/) && stream.eat(";");
   19.93 -        }
   19.94 -      } else {
   19.95 -        ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
   19.96 -      }
   19.97 -      return ok ? "atom" : "error";
   19.98 -    }
   19.99 -    else {
  19.100 -      stream.eatWhile(/[^&<]/);
  19.101 -      return null;
  19.102 -    }
  19.103 -  }
  19.104 -
  19.105 -  function inTag(stream, state) {
  19.106 -    var ch = stream.next();
  19.107 -    if (ch == ">" || (ch == "/" && stream.eat(">"))) {
  19.108 -      state.tokenize = inText;
  19.109 -      type = ch == ">" ? "endTag" : "selfcloseTag";
  19.110 -      return "tag";
  19.111 -    }
  19.112 -    else if (ch == "=") {
  19.113 -      type = "equals";
  19.114 -      return null;
  19.115 -    }
  19.116 -    else if (/[\'\"]/.test(ch)) {
  19.117 -      state.tokenize = inAttribute(ch);
  19.118 -      return state.tokenize(stream, state);
  19.119 -    }
  19.120 -    else {
  19.121 -      stream.eatWhile(/[^\s\u00a0=<>\"\']/);
  19.122 -      return "word";
  19.123 -    }
  19.124 -  }
  19.125 -
  19.126 -  function inAttribute(quote) {
  19.127 -    return function(stream, state) {
  19.128 -      while (!stream.eol()) {
  19.129 -        if (stream.next() == quote) {
  19.130 -          state.tokenize = inTag;
  19.131 -          break;
  19.132 -        }
  19.133 -      }
  19.134 -      return "string";
  19.135 -    };
  19.136 -  }
  19.137 -
  19.138 -  function inBlock(style, terminator) {
  19.139 -    return function(stream, state) {
  19.140 -      while (!stream.eol()) {
  19.141 -        if (stream.match(terminator)) {
  19.142 -          state.tokenize = inText;
  19.143 -          break;
  19.144 -        }
  19.145 -        stream.next();
  19.146 -      }
  19.147 -      return style;
  19.148 -    };
  19.149 -  }
  19.150 -  function doctype(depth) {
  19.151 -    return function(stream, state) {
  19.152 -      var ch;
  19.153 -      while ((ch = stream.next()) != null) {
  19.154 -        if (ch == "<") {
  19.155 -          state.tokenize = doctype(depth + 1);
  19.156 -          return state.tokenize(stream, state);
  19.157 -        } else if (ch == ">") {
  19.158 -          if (depth == 1) {
  19.159 -            state.tokenize = inText;
  19.160 -            break;
  19.161 -          } else {
  19.162 -            state.tokenize = doctype(depth - 1);
  19.163 -            return state.tokenize(stream, state);
  19.164 -          }
  19.165 -        }
  19.166 -      }
  19.167 -      return "meta";
  19.168 -    };
  19.169 -  }
  19.170 -
  19.171 -  var curState, setStyle;
  19.172 -  function pass() {
  19.173 -    for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
  19.174 -  }
  19.175 -  function cont() {
  19.176 -    pass.apply(null, arguments);
  19.177 -    return true;
  19.178 -  }
  19.179 -
  19.180 -  function pushContext(tagName, startOfLine) {
  19.181 -    var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
  19.182 -    curState.context = {
  19.183 -      prev: curState.context,
  19.184 -      tagName: tagName,
  19.185 -      indent: curState.indented,
  19.186 -      startOfLine: startOfLine,
  19.187 -      noIndent: noIndent
  19.188 -    };
  19.189 -  }
  19.190 -  function popContext() {
  19.191 -    if (curState.context) curState.context = curState.context.prev;
  19.192 -  }
  19.193 -
  19.194 -  function element(type) {
  19.195 -    if (type == "openTag") {
  19.196 -      curState.tagName = tagName;
  19.197 -      return cont(attributes, endtag(curState.startOfLine));
  19.198 -    } else if (type == "closeTag") {
  19.199 -      var err = false;
  19.200 -      if (curState.context) {
  19.201 -        if (curState.context.tagName != tagName) {
  19.202 -          if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
  19.203 -            popContext();
  19.204 -          }
  19.205 -          err = !curState.context || curState.context.tagName != tagName;
  19.206 -        }
  19.207 -      } else {
  19.208 -        err = true;
  19.209 -      }
  19.210 -      if (err) setStyle = "error";
  19.211 -      return cont(endclosetag(err));
  19.212 -    }
  19.213 -    return cont();
  19.214 -  }
  19.215 -  function endtag(startOfLine) {
  19.216 -    return function(type) {
  19.217 -      var tagName = curState.tagName;
  19.218 -      curState.tagName = null;
  19.219 -      if (type == "selfcloseTag" ||
  19.220 -          (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) {
  19.221 -        maybePopContext(tagName.toLowerCase());
  19.222 -        return cont();
  19.223 -      }
  19.224 -      if (type == "endTag") {
  19.225 -        maybePopContext(tagName.toLowerCase());
  19.226 -        pushContext(tagName, startOfLine);
  19.227 -        return cont();
  19.228 -      }
  19.229 -      return cont();
  19.230 -    };
  19.231 -  }
  19.232 -  function endclosetag(err) {
  19.233 -    return function(type) {
  19.234 -      if (err) setStyle = "error";
  19.235 -      if (type == "endTag") { popContext(); return cont(); }
  19.236 -      setStyle = "error";
  19.237 -      return cont(arguments.callee);
  19.238 -    };
  19.239 -  }
  19.240 -  function maybePopContext(nextTagName) {
  19.241 -    var parentTagName;
  19.242 -    while (true) {
  19.243 -      if (!curState.context) {
  19.244 -        return;
  19.245 -      }
  19.246 -      parentTagName = curState.context.tagName.toLowerCase();
  19.247 -      if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
  19.248 -          !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
  19.249 -        return;
  19.250 -      }
  19.251 -      popContext();
  19.252 -    }
  19.253 -  }
  19.254 -
  19.255 -  function attributes(type) {
  19.256 -    if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
  19.257 -    if (type == "endTag" || type == "selfcloseTag") return pass();
  19.258 -    setStyle = "error";
  19.259 -    return cont(attributes);
  19.260 -  }
  19.261 -  function attribute(type) {
  19.262 -    if (type == "equals") return cont(attvalue, attributes);
  19.263 -    if (!Kludges.allowMissing) setStyle = "error";
  19.264 -    else if (type == "word") setStyle = "attribute";
  19.265 -    return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
  19.266 -  }
  19.267 -  function attvalue(type) {
  19.268 -    if (type == "string") return cont(attvaluemaybe);
  19.269 -    if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
  19.270 -    setStyle = "error";
  19.271 -    return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
  19.272 -  }
  19.273 -  function attvaluemaybe(type) {
  19.274 -    if (type == "string") return cont(attvaluemaybe);
  19.275 -    else return pass();
  19.276 -  }
  19.277 -
  19.278 -  return {
  19.279 -    startState: function() {
  19.280 -      return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
  19.281 -    },
  19.282 -
  19.283 -    token: function(stream, state) {
  19.284 -      if (stream.sol()) {
  19.285 -        state.startOfLine = true;
  19.286 -        state.indented = stream.indentation();
  19.287 -      }
  19.288 -      if (stream.eatSpace()) return null;
  19.289 -
  19.290 -      setStyle = type = tagName = null;
  19.291 -      var style = state.tokenize(stream, state);
  19.292 -      state.type = type;
  19.293 -      if ((style || type) && style != "comment") {
  19.294 -        curState = state;
  19.295 -        while (true) {
  19.296 -          var comb = state.cc.pop() || element;
  19.297 -          if (comb(type || style)) break;
  19.298 -        }
  19.299 -      }
  19.300 -      state.startOfLine = false;
  19.301 -      return setStyle || style;
  19.302 -    },
  19.303 -
  19.304 -    indent: function(state, textAfter, fullLine) {
  19.305 -      var context = state.context;
  19.306 -      if ((state.tokenize != inTag && state.tokenize != inText) ||
  19.307 -          context && context.noIndent)
  19.308 -        return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
  19.309 -      if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
  19.310 -      if (context && /^<\//.test(textAfter))
  19.311 -        context = context.prev;
  19.312 -      while (context && !context.startOfLine)
  19.313 -        context = context.prev;
  19.314 -      if (context) return context.indent + indentUnit;
  19.315 -      else return 0;
  19.316 -    },
  19.317 -
  19.318 -    electricChars: "/",
  19.319 -
  19.320 -    configuration: parserConfig.htmlMode ? "html" : "xml"
  19.321 -  };
  19.322 -});
  19.323 -
  19.324 -CodeMirror.defineMIME("text/xml", "xml");
  19.325 -CodeMirror.defineMIME("application/xml", "xml");
  19.326 -if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
  19.327 -  CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
    20.1 --- a/dew4nb/release/web4dew/js/codemirror/theme/elegant.css	Wed Jan 29 17:28:57 2014 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,10 +0,0 @@
    20.4 -.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
    20.5 -.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
    20.6 -.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
    20.7 -.cm-s-elegant span.cm-variable {color: black;}
    20.8 -.cm-s-elegant span.cm-variable-2 {color: #b11;}
    20.9 -.cm-s-elegant span.cm-qualifier {color: #555;}
   20.10 -.cm-s-elegant span.cm-keyword {color: #730;}
   20.11 -.cm-s-elegant span.cm-builtin {color: #30a;}
   20.12 -.cm-s-elegant span.cm-error {background-color: #fdd;}
   20.13 -.cm-s-elegant span.cm-link {color: #762;}
    21.1 --- a/remote.project.finder/src/org/netbeans/modules/remote/project/finder/RepositoryWorkspaceResolver.java	Wed Jan 29 17:28:57 2014 +0100
    21.2 +++ b/remote.project.finder/src/org/netbeans/modules/remote/project/finder/RepositoryWorkspaceResolver.java	Wed Jan 29 18:23:26 2014 +0100
    21.3 @@ -58,7 +58,7 @@
    21.4   * @author Tomas Zezula
    21.5   */
    21.6  @ServiceProvider(service = WorkspaceResolver.class, position = 9_000)
    21.7 -public final class RepositoryWorkspaceResolver implements WorkspaceResolver {
    21.8 +public final class RepositoryWorkspaceResolver extends WorkspaceResolver {
    21.9  
   21.10      // path format users/{user}/workspaces/{workspace}/projects
   21.11      private static final Pattern LOCAL_PATH_PARSER = Pattern.compile(