trill_on_swish/commit

trill_on_swish v. 2.0

authorrzese
Fri Jul 15 12:19:33 2016 +0200
committerrzese
Fri Jul 15 12:19:33 2016 +0200
commit548de31b39b068258ec1e5efb4e17d9b9181ed5a
tree078575a5d18fd272fcbc8487b15468df8363b57d
parente9cdf8884b6869c54e1aa125322f2d9df4fe5255
Diff style: patch stat
diff --git a/Makefile b/Makefile
index 61d1be4..adf9222 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,23 @@
 # Create a ClioPatria SWISH package from the SWISH distribution.
 
 FONTDIR=web/bower_components/bootstrap/dist/fonts
-DIRS=lib/trill_on_swish lib/trill_on_swish/render web/icons web/help client $(FONTDIR)
+DIRS=lib/trill_on_swish lib/trill_on_swish/render web/icons web/help client $(FONTDIR) \
+     web/bower_components/codemirror/mode/htmlmixed \
+     web/bower_components/codemirror/mode/css \
+     web/bower_components/codemirror/mode/javascript
 SWISHLIB=storage.pl page.pl help.pl examples.pl config.pl gitty.pl \
 	 highlight.pl render.pl template_hint.pl search.pl form.pl \
-	 include.pl csv.pl logging.pl trace.pl markdown.pl \
-	 translate_rdf.pl trill/trill.pl
+	 include.pl swish_csv.pl logging.pl trace.pl markdown.pl \
+	 gitty_driver_files.pl gitty_driver_bdb.pl gitty_tools.pl \
+	 swish_debug.pl profiles.pl procps.pl
 RENDER=table.pl graphviz.pl c3.pl
 LIBS=	$(addprefix lib/trill_on_swish/, $(SWISHLIB)) \
 	$(addprefix lib/trill_on_swish/render/, $(RENDER))
-JS=web/js/trill_on_swish-min.js web/js/trill_on_swish-min.js.gz web/js/require.js
-CSS=web/css/trill_on_swish-min.css web/css/trill_on_swish-min.css.gz web/css/print.css
+JS=web/js/swish-min.js web/js/swish-min.js.gz web/js/require.js
+CSS=web/css/swish-min.css web/css/swish-min.css.gz web/css/print.css
 ICON_FILES=dead.png error.png running.gif page-fold-20.png \
 	   red_bird.svg red_bird_op.svg pl.png swinb.png owl.png \
-	   select.png favicon.ico trill-touch-icon.png
+	   select.png  wip.png rb_favicon.ico trill-touch-icon.png
 ICONS=$(addprefix web/icons/, $(ICON_FILES))
 HELP=$(addprefix web/help/, $(notdir $(wildcard src/web/help/*.html)))
 FONTFILES=glyphicons-halflings-regular.ttf \
@@ -21,10 +25,21 @@ FONTFILES=glyphicons-halflings-regular.ttf \
 	  glyphicons-halflings-regular.woff \
 	  glyphicons-halflings-regular.woff2
 FONTS=$(addprefix $(FONTDIR)/, $(FONTFILES))
-CLIENTFILES=trill_on_swish-ask.sh README.md sin-table.html
+CLIENTFILES=swish-ask.sh README.md sin-table.html
 CLIENTS=$(addprefix client/, $(CLIENTFILES))
+EXAMPLESFILES=biopaxLevel3.pl BRCA.pl DBPedia.pl examples.swinb \
+              peoplePets.pl vicodi.pl commander.pl johnEmployee.pl index.json
+EXAMPLES=$(addprefix examples/, $(EXAMPLESFILES))
+PROFILESFILES=00-Empty.pl 00-Empty.swinb 10-Non-Probabilistic.pl \
+             10-Non-Probabilistic.swinb 20-Probabilistic.pl 20-Probabilistic.swinb
+PROFILES=$(addprefix profiles/, $(PROFILESFILES))
+CMFILES=mode/htmlmixed/htmlmixed.js \
+	mode/javascript/javascript.js \
+	mode/css/css.js
+CM=$(addprefix web/bower_components/codemirror/, $(CMFILES))
 
-all:	$(DIRS) $(LIBS) $(JS) $(CSS) $(ICONS) $(HELP) $(FONTS) $(CLIENTS)
+all:	$(DIRS) $(LIBS) $(JS) $(CSS) $(ICONS) $(HELP) $(FONTS) $(CLIENTS) \
+	$(CM) $(EXAMPLES) $(PROFILES)
 
 $(DIRS):
 	mkdir -p $@
@@ -33,13 +48,13 @@ lib/trill_on_swish/%: src/lib/%
 	rsync -u $< $@
 client/%: src/client/%
 	rsync -u $< $@
-client/trill_on_swish-ask.sh: src/client/trill_on_swish-ask.sh
+client/swish-ask.sh: src/client/swish-ask.sh
 	sed -e 's/:3050}/:3020}/' -e 's/-prolog}/-rdf}/' $< > $@
 	chmod +x $@
 
-web/js/trill_on_swish-min.js: src/web/js/trill_on_swish-min.js
+web/js/swish-min.js: src/web/js/swish-min.js
 	rsync -u $< $@
-web/js/trill_on_swish-min.js.gz: src/web/js/trill_on_swish-min.js.gz
+web/js/swish-min.js.gz: src/web/js/swish-min.js.gz
 	rsync -u $< $@
 web/js/require.js: src/web/bower_components/requirejs/require.js
 	rsync -u $< $@
@@ -53,8 +68,17 @@ web/icons/%: src/web/icons/%
 web/help/%: src/web/help/%
 	rsync -u $< $@
 
+examples/%: src/examples/%
+	rsync -u $< $@
+
+profiles/%: src/profiles/%
+	rsync -u $< $@
+
 $(FONTDIR)/%: src/$(FONTDIR)/%
 	rsync -u $< $@
 
+web/bower_components/codemirror/%: src/web/bower_components/codemirror/%
+	rsync -u $< $@
+
 clean::
 	rm -f $(LIBS) $(JS) $(CSS) $(ICONS) $(HELP)
diff --git a/applications/trill_on_swish.pl b/applications/trill_on_swish.pl
index 3be8999..4ce55aa 100644
--- a/applications/trill_on_swish.pl
+++ b/applications/trill_on_swish.pl
@@ -27,10 +27,11 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_app,
+:- module(swish_app,
 	  [
 	  ]).
 :- use_module(library(pengines)).
+:- use_module(library(option)).
 :- use_module(library(http/http_dispatch)).
 :- use_module(library(http/http_server_files)).
 :- use_module(library(http/http_json)).
@@ -40,8 +41,9 @@
 :- use_module(library(trill_on_swish/page), []).
 :- use_module(library(trill_on_swish/storage)).
 :- use_module(library(trill_on_swish/include)).
-:- use_module(library(trill_on_swish/csv)).
+:- use_module(library(trill_on_swish/swish_csv)).
 :- use_module(library(trill_on_swish/examples)).
+:- use_module(library(trill_on_swish/profiles)).
 :- use_module(library(trill_on_swish/help)).
 :- use_module(library(trill_on_swish/highlight)).
 :- use_module(library(trill_on_swish/markdown)).
@@ -53,8 +55,9 @@
 		 *	       PATHS		*
 		 *******************************/
 
-http:location(trill_on_swish, root(trill_on_swish), []).
+http:location(swish, root(trill_on_swish), []).
 
+user:file_search_path(swish, cp_application(cpack/trill_on_swish)).
 user:file_search_path(render, library(trill_on_swish/render)).
 
 
@@ -63,13 +66,13 @@ user:file_search_path(render, library(trill_on_swish/render)).
 		 *******************************/
 
 :- multifile
-	trill_on_swish_config:config/2,
-	trill_on_swish_config:source_alias/2.
+	swish_config:config/2,
+	swish_config:source_alias/2.
 
-%%	trill_on_swish_config:config(?Config, ?Value) is nondet.
+%%	swish_config:config(?Config, ?Value) is nondet.
 %
 %	All solutions of this predicate are  available in the JavaScript
-%	object config.trill_on_swish.Config. Config must be an  atom that is also
+%	object config.swish.Config. Config must be an  atom that is also
 %	a valid JavaScript identifier. Value  must   be  a value that is
 %	valid for json_write_dict/2. Most configurations  are also saved
 %	in the application preferences. These   are  marked [P]. Defined
@@ -90,14 +93,21 @@ user:file_search_path(render, library(trill_on_swish/render)).
 %        only running queries and saving files is restricted. Note
 %        that this flag has no effect if no authentication module is
 %        loaded.
-
-trill_on_swish_config:config(show_beware,    false).
-trill_on_swish_config:config(tabled_results, false).
-trill_on_swish_config:config(application,    trill_on_swish).
-trill_on_swish_config:config(csv_formats,    [rdf, prolog]).
-trill_on_swish_config:config(public_access,  true).
-
-%%     trill_on_swish_config:source_alias(Alias, Options) is nondet.
+%        - ping
+%        Ping pengine status every N seconds.  Updates sparkline
+%        chart with stack usage.
+%         - nb_eval_script
+%         Evaluate scripts in HTML cells of notebooks?
+
+swish_config:config(show_beware,    false).
+swish_config:config(tabled_results, false).
+swish_config:config(application,    swish).
+swish_config:config(csv_formats,    [rdf, prolog]).
+swish_config:config(public_access,  true).
+swish_config:config(ping,           10).
+swish_config:config(notebook,       _{eval_script: true}).
+
+%%     swish_config:source_alias(Alias, Options) is nondet.
 %
 %      Specify access for files below a given _alias_. Options define
 %
@@ -113,9 +123,11 @@ trill_on_swish_config:config(public_access,  true).
 		 *	        CSV		*
 		 *******************************/
 
-:- multifile trill_on_swish_csv:write_answers/2.
+:- multifile
+	swish_csv:write_answers/2,
+	swish_csv:write_answers/3.
 
-trill_on_swish_csv:write_answers(Answers, VarTerm) :-
+swish_csv:write_answers(Answers, VarTerm) :-
         Answers = [H|_],
         functor(H, rdf, _), !,
         sparql_write_csv_result(
@@ -123,6 +135,33 @@ trill_on_swish_csv:write_answers(Answers, VarTerm) :-
             select(VarTerm, Answers),
             []).
 
+swish_csv:write_answers(Answers, VarTerm, Options) :-
+        Answers = [H|_],
+        functor(H, rdf, _),
+	option(page(1), Options), !,
+        sparql_write_csv_result(
+            current_output,
+            select(VarTerm, Answers),
+            [ bnode_state(_-BNodes)
+	    ]),
+	nb_setval(rdf_csv_bnodes, BNodes).
+swish_csv:write_answers(Answers, VarTerm, Options) :-
+        Answers = [H|_],
+        functor(H, rdf, _),
+	option(page(Page), Options),
+	Page > 1, !,
+	nb_getval(rdf_csv_bnodes, BNodes0),
+        sparql_write_csv_result(
+            current_output,
+            select(VarTerm, Answers),
+            [ http_header(false),
+	      header_row(false),
+	      bnode_state(BNodes0-BNodes)
+	    ]),
+	nb_setval(rdf_csv_bnodes, BNodes).
+swish_csv:write_answers(Answers, VarTerm, _Options) :-
+	swish_csv:write_answers(Answers, VarTerm).
+
 
                  /*******************************
                  *   CREATE SWISH APPLICATION   *
@@ -131,17 +170,18 @@ trill_on_swish_csv:write_answers(Answers, VarTerm) :-
 :- multifile
 	pengines:prepare_module/3.
 
-:- pengine_application(trill_on_swish).
-:- use_rendering(trill_on_swish:rdf).
-:- use_module(trill_on_swish:library(trill_on_swish/render)).
-:- use_module(trill_on_swish:library(trill_on_swish/trace)).
-:- use_module(trill_on_swish:library(pengines_io)).
-:- use_module(trill_on_swish:library(semweb/rdf_db)).
-:- use_module(trill_on_swish:library(semweb/rdfs)).
-:- use_module(trill_on_swish:library(semweb/rdf_optimise)).
-:- use_module(trill_on_swish:library(semweb/rdf_litindex)).
-:- use_module(trill_on_swish:library(aggregate)).
-pengines:prepare_module(Module, trill_on_swish, _Options) :-
+:- pengine_application(swish).
+:- use_rendering(swish:rdf).
+:- use_module(swish:library(trill_on_swish/render)).
+:- use_module(swish:library(trill_on_swish/trace)).
+:- use_module(swish:library(pengines_io)).
+:- use_module(swish:library(semweb/rdf_db)).
+:- use_module(swish:library(semweb/rdfs)).
+:- use_module(swish:library(semweb/rdf_optimise)).
+:- use_module(swish:library(semweb/rdf_litindex)).
+:- use_module(swish:library(solution_sequences)).
+:- use_module(swish:library(aggregate)).
+pengines:prepare_module(Module, swish, _Options) :-
 	pengines_io:pengine_bind_io_to_html(Module).
 
 % Libraries that are nice to have in SWISH, but cannot be loaded
@@ -150,6 +190,9 @@ pengines:prepare_module(Module, trill_on_swish, _Options) :-
 
 :- use_module(library(clpfd), []).
 :- use_module(library(clpb), []).
+:- if(exists_source(library(semweb/rdf11))).
+:- use_module(library(semweb/rdf11), []).
+:- endif.
 
 % rendering libraries
 
@@ -157,3 +200,5 @@ pengines:prepare_module(Module, trill_on_swish, _Options) :-
 :- use_module(library(trill_on_swish/render/rdf),      []).
 :- use_module(library(trill_on_swish/render/graphviz), []).
 :- use_module(library(trill_on_swish/render/c3),	      []).
+
+:- use_module(library(trill)).
diff --git a/client/trill_on_swish-ask.sh b/client/trill_on_swish-ask.sh
deleted file mode 100755
index d009dd5..0000000
--- a/client/trill_on_swish-ask.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Ask information from a Pengines/SWISH server from the shell.
-#
-# This program allows you to download query  results from a SWISH server
-# as CSV data.
-
-server=${SWISH_SERVER-http://localhost:3020}
-srctext=
-format=${SWISH_FORMAT-rdf}
-program=$(basename $0)
-
-usage()
-{
-cat << _EOM_
-Usage: $program "[--server=URL] [--format=rdf|prolog]" file.pl ... projection query
-
-Where
-
-  - server is by default "$server".  Environment: SWISH_SERVER
-  - format is by default "$format".  Environment: SWISH_FORMAT
-  - file.pl ... are files saved in SWISH.  Zero or more files are allowed
-  - projection is a comma-separated list of Prolog variables that define
-    the CSV columns.
-  - query is a Prolog goal using the variables from projection.
-
-For example
-
-  $program X 'X is 1<<100'
-  X
-  1267650600228229401496703205376
-
-  $program factbook.pl Code,Country 'country(Country,Code)'
-  Code,Country
-  af,http://www4.wiwiss.fu-berlin.de/factbook/resource/Afghanistan
-  ax,http://www4.wiwiss.fu-berlin.de/factbook/resource/Akrotiri
-  ...
-_EOM_
-}
-
-done=false
-while [ $done = false ]; do
-    case "$1" in
-        --server=*)
-            server=$(echo $1 | sed 's/.*=//')
-            shift
-            ;;
-	--format=*)
-	    format=$(echo $1 | sed 's/.*=//')
-	    case "$format" in
-	        rdf|prolog)
-		    ;;
-		*)
-		    usage
-		    exit 1
-		    ;;
-	    esac
-            shift
-            ;;
-	*.pl)
-            script=$(echo $1 | sed 's/.*=//')
-	    srctext+=":- include('$script'). "
-	    shift
-	    ;;
-	*)
-	    done=true
-	    ;;
-    esac
-done
-
-vars="$1"
-query="$2"
-
-if [ -z "$vars" -o -z "$query" ]; then
-  usage
-  exit 1
-fi
-
-curl -s \
-     -d ask="$query" \
-     -d template="$format($vars)" \
-     -d application="swish" \
-     -d src_text="$srctext" \
-     -d format=csv \
-     -d chunk=100000000 \
-     $server/pengine/create
diff --git a/config-available/trill_on_swish.pl b/config-available/trill_on_swish.pl
index 4b5f7c3..e27586a 100644
--- a/config-available/trill_on_swish.pl
+++ b/config-available/trill_on_swish.pl
@@ -1,4 +1,4 @@
-:- module(conf_trill_on_swish, []).
+:- module(conf_swish, []).
 :- use_module(cliopatria(hooks)).
 
 /** <module> Add Prolog interaction to ClioPatria
@@ -6,30 +6,34 @@
 
 :- multifile
 	user:file_search_path/2,
-	trill_on_swish_config:config/2.
+	swish_config:config/2.
 
-% tell trill_on_swish where to find its parts.   The last clause allows adding an
+% tell SWISH where to find its parts.   The last clause allows adding an
 % =examples=  directory  in  the  main   directory  holding  application
 % specific examples.
 
-user:file_search_path(trill_on_swish_web, web(.)).
+user:file_search_path(swish_web, web(.)).
 user:file_search_path(example,   cpacks(trill_on_swish/examples)).
-%user:file_search_path(example,	 examples).
+user:file_search_path(example,	 examples).
 
-% Load trill_on_swish.  You need this.
+% Load swish.  You need this.
 :- use_module(applications(trill_on_swish)).
 % Load the authentication hook. When loaded, ClioPatria users with admin
-% rights can use trill_on_swish without sandboxing security
+% rights can use SWISH without sandboxing security
 :- use_module(library(trill_on_swish/cp_authenticate)).
-% Enable logging of trill_on_swish queries and sources if HTTP logging is enabled
+% Enable logging of SWISH queries and sources if HTTP logging is enabled
 :- use_module(library(trill_on_swish/logging)).
+% Make side-effect-free RDF predicates safe
+:- if(exists_source(library(semweb/rdf_sandbox))).
+:- use_module(library(semweb/rdf_sandbox)).
+:- endif.
 
 % Allows users to extend the Examples menu by ticking the Example
 % checkbox.
-trill_on_swish_config:config(community_examples, false).
+swish_config:config(community_examples, true).
 
 %%      cliopatria:menu_item(-Item, -Label) is nondet.
 %
-%       Add trill_on_swish to the Query menu.
+%       Add TRILL on SWISH to the Query menu.
 
-cliopatria:menu_item(300=query/trill_on_swish, 'TRILL on SWISH Prolog shell').
+cliopatria:menu_item(300=query/swish, 'TRILL on SWISH Prolog shell').
diff --git a/examples/BRCA.owl b/examples/BRCA.owl
deleted file mode 100644
index 0d5747f..0000000
--- a/examples/BRCA.owl
+++ /dev/null
@@ -1,2474 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-Model of risk factor of breast cancer, from
-Klinov, P., Parsia, B.: Optimization and evaluation of reasoning in probabilistic
-description logic: Towards a systematic approach. In: International Semantic Web
-Conference. LNCS, vol. 5318, pp. 213–228. Springer (2008)
-
-/** <examples>
-
-?- prob_instanceOf(\'cancer_ra:WomanUnderLifetimeBRCRisk\',\'cancer_ra:Helen\',Prob).
-?- instanceOf(\'cancer_ra:WomanUnderLifetimeBRCRisk\',\'cancer_ra:Helen\',ListExpl).
-
-?- prob_sub_class(\'WomanAged3040\',\'WomanUnderLifetimeBRCRisk\',Prob).
-?- sub_class(\'WomanAged3040\',\'WomanUnderLifetimeBRCRisk\',ListExpl).
-
-*/
--->
-
-<!DOCTYPE rdf:RDF [
-    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
-    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
-    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
-    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
-    <!ENTITY cancer_ra "http://clarkparsia.com/pronto/cancer_ra.owl#" >
-    <!ENTITY bundle "https://sites.google.com/a/unife.it/ml/bundle#" >
-    <!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" >
-]>
-
-
-<rdf:RDF xmlns="&cancer_ra;"
-     xml:base="http://clarkparsia.com/pronto/cancer_ra.owl#"
-     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-     xmlns:cancer_ra="http://clarkparsia.com/pronto/cancer_ra.owl#"
-     xmlns:owl="http://www.w3.org/2002/07/owl#"
-     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-     xmlns:bundle="https://sites.google.com/a/unife.it/ml/bundle#"
-     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#">
-    <owl:Ontology rdf:about="file:examples/brc/ontologies/cancer_ra.owl"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Annotation properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- https://sites.google.com/a/unife.it/ml/disponte#probability -->
-
-    <owl:AnnotationProperty rdf:about="&disponte;probability"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Object Properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#hasAge -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;hasAge">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:range rdf:resource="&cancer_ra;Age"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-        <rdfs:subPropertyOf rdf:resource="&cancer_ra;hasRiskFactor"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#hasGender -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;hasGender">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:range rdf:resource="&cancer_ra;Gender"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#hasRace -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;hasRace">
-        <rdfs:range rdf:resource="&cancer_ra;Ethnicity"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#hasRisk -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;hasRisk">
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-        <rdfs:range rdf:resource="&cancer_ra;Risk"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#hasRiskFactor -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;hasRiskFactor">
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-        <rdfs:range rdf:resource="&cancer_ra;RiskFactor"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#relatedToDisease -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;relatedToDisease">
-        <rdfs:range rdf:resource="&cancer_ra;Disease"/>
-        <rdfs:domain rdf:resource="&cancer_ra;RiskFactor"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#riskCategory -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;riskCategory">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Risk"/>
-        <rdfs:range rdf:resource="&cancer_ra;RiskCategory"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#riskOf -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;riskOf">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:range rdf:resource="&cancer_ra;Disease"/>
-        <rdfs:domain rdf:resource="&cancer_ra;RiskType"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#riskType -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;riskType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Risk"/>
-        <rdfs:range rdf:resource="&cancer_ra;RiskType"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#willDevelop -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;willDevelop">
-        <rdfs:range rdf:resource="&cancer_ra;Disease"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#willDevelopInLongTerm -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;willDevelopInLongTerm">
-        <rdfs:range rdf:resource="&cancer_ra;Disease"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-        <rdfs:subPropertyOf rdf:resource="&cancer_ra;willDevelop"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#willDevelopInShortTerm -->
-
-    <owl:ObjectProperty rdf:about="&cancer_ra;willDevelopInShortTerm">
-        <rdfs:range rdf:resource="&cancer_ra;Disease"/>
-        <rdfs:domain rdf:resource="&cancer_ra;Person"/>
-        <rdfs:subPropertyOf rdf:resource="&cancer_ra;willDevelop"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Data properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#increaseFactor -->
-
-    <owl:DatatypeProperty rdf:about="&cancer_ra;increaseFactor">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:domain rdf:resource="&cancer_ra;RelativeRiskCategory"/>
-        <rdfs:range rdf:resource="&xsd;decimal"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.w3.org/2006/12/owl11#maxExclusive -->
-
-    <owl:DatatypeProperty rdf:about="http://www.w3.org/2006/12/owl11#maxExclusive"/>
-    
-
-
-    <!-- http://www.w3.org/2006/12/owl11#minExclusive -->
-
-    <owl:DatatypeProperty rdf:about="http://www.w3.org/2006/12/owl11#minExclusive"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Classes
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AbsoluteBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;AbsoluteBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;BRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;AbsoluteRiskCategory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AbsoluteRiskCategory -->
-
-    <owl:Class rdf:about="&cancer_ra;AbsoluteRiskCategory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AfricanAmerican -->
-
-    <owl:Class rdf:about="&cancer_ra;AfricanAmerican">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Ethnicity"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;AshkenaziJew"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AfricanAmericanWoman -->
-
-    <owl:Class rdf:about="&cancer_ra;AfricanAmericanWoman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRace"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AfricanAmerican"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AfterMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;AfterMenopause">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;BeforeMenopause"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age -->
-
-    <owl:Class rdf:about="&cancer_ra;Age">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age2030 -->
-
-    <owl:Class rdf:about="&cancer_ra;Age2030">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AgeUnder50"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age3040"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age4050"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age5060"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age6070"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age70Plus"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;AgeUnder20"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age3040 -->
-
-    <owl:Class rdf:about="&cancer_ra;Age3040">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AgeUnder50"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age4050"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age5060"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age6070"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age70Plus"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;AgeUnder20"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age4050 -->
-
-    <owl:Class rdf:about="&cancer_ra;Age4050">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AgeUnder50"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age5060"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age6070"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age70Plus"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;AgeUnder20"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age5060 -->
-
-    <owl:Class rdf:about="&cancer_ra;Age5060">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Age"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age6070"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age70Plus"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age50Plus -->
-
-    <owl:Class rdf:about="&cancer_ra;Age50Plus">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Age5060"/>
-                    <rdf:Description rdf:about="&cancer_ra;Age6070"/>
-                    <rdf:Description rdf:about="&cancer_ra;Age70Plus"/>
-                </owl:unionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Age"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;AgeUnder50"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age6070 -->
-
-    <owl:Class rdf:about="&cancer_ra;Age6070">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Age"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;Age70Plus"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Age70Plus -->
-
-    <owl:Class rdf:about="&cancer_ra;Age70Plus">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Age"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AgeUnder20 -->
-
-    <owl:Class rdf:about="&cancer_ra;AgeUnder20">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AgeUnder50"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AgeUnder50 -->
-
-    <owl:Class rdf:about="&cancer_ra;AgeUnder50">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Age"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Alcohol -->
-
-    <owl:Class rdf:about="&cancer_ra;Alcohol">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AshkenaziJew -->
-
-    <owl:Class rdf:about="&cancer_ra;AshkenaziJew">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Ethnicity"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AshkenaziJewishWoman -->
-
-    <owl:Class rdf:about="&cancer_ra;AshkenaziJewishWoman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRace"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AshkenaziJew"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanWithBRCAMutation"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.025</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;AshkenaziJewishWoman"/>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanWithBRCAMutation"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#AtypicalHyperplasia -->
-
-    <owl:Class rdf:about="&cancer_ra;AtypicalHyperplasia">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BenignBreastDisease"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;UsualHyperplasia"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BRCA1Mutation -->
-
-    <owl:Class rdf:about="&cancer_ra;BRCA1Mutation">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BRCAMutation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BRCA2Mutation -->
-
-    <owl:Class rdf:about="&cancer_ra;BRCA2Mutation">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BRCAMutation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BRCAMutation -->
-
-    <owl:Class rdf:about="&cancer_ra;BRCAMutation">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BRCRType -->
-
-    <owl:Class rdf:about="&cancer_ra;BRCRType">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;RiskType"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskOf"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BreastCancer"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;BRCRisk">
-        <rdfs:subClassOf>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Risk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskType"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BRCRType"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </rdfs:subClassOf>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BeforeMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;BeforeMenopause">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;LateMenopause"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BenignBreastDisease -->
-
-    <owl:Class rdf:about="&cancer_ra;BenignBreastDisease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BirthControlPills -->
-
-    <owl:Class rdf:about="&cancer_ra;BirthControlPills">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#BreastCancer -->
-
-    <owl:Class rdf:about="&cancer_ra;BreastCancer">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Cancer"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Cancer -->
-
-    <owl:Class rdf:about="&cancer_ra;Cancer">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Disease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#CarcinomaInSitu -->
-
-    <owl:Class rdf:about="&cancer_ra;CarcinomaInSitu">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Disease -->
-
-    <owl:Class rdf:about="&cancer_ra;Disease">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#EarlyFirstChild -->
-
-    <owl:Class rdf:about="&cancer_ra;EarlyFirstChild">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;LateFirstChild"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#EarlyMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;EarlyMenopause">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;LateMenopause"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Estrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;Estrogen">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#EstrogenProgestin -->
-
-    <owl:Class rdf:about="&cancer_ra;EstrogenProgestin">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Estrogen"/>
-                    <rdf:Description rdf:about="&cancer_ra;Progestin"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#EstrogenTestosterone -->
-
-    <owl:Class rdf:about="&cancer_ra;EstrogenTestosterone">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Estrogen"/>
-                    <rdf:Description rdf:about="&cancer_ra;Testosterone"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Ethnicity -->
-
-    <owl:Class rdf:about="&cancer_ra;Ethnicity">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#FamilyCancerHistory -->
-
-    <owl:Class rdf:about="&cancer_ra;FamilyCancerHistory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Female -->
-
-    <owl:Class rdf:about="&cancer_ra;Female">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Gender"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#FirstPeriodBefore12 -->
-
-    <owl:Class rdf:about="&cancer_ra;FirstPeriodBefore12">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Gender -->
-
-    <owl:Class rdf:about="&cancer_ra;Gender">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#HighBoneDensity -->
-
-    <owl:Class rdf:about="&cancer_ra;HighBoneDensity">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#HighBreastDensity -->
-
-    <owl:Class rdf:about="&cancer_ra;HighBreastDensity">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#HighLevelOfEstrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;HighLevelOfEstrogen">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;InferredFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#IncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;IncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;RelativeBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;IncreasedRiskCategory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RelativeBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#IncreasedRiskCategory -->
-
-    <owl:Class rdf:about="&cancer_ra;IncreasedRiskCategory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RelativeRiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#InferredFactor -->
-
-    <owl:Class rdf:about="&cancer_ra;InferredFactor">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RiskFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#KnownFactor -->
-
-    <owl:Class rdf:about="&cancer_ra;KnownFactor">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RiskFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#LackOfExercise -->
-
-    <owl:Class rdf:about="&cancer_ra;LackOfExercise">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#LateFirstChild -->
-
-    <owl:Class rdf:about="&cancer_ra;LateFirstChild">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#LateMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;LateMenopause">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#LifetimeBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;LifetimeBRCRisk">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AbsoluteBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Male -->
-
-    <owl:Class rdf:about="&cancer_ra;Male">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Gender"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ModerateDecrease -->
-
-    <owl:Class rdf:about="&cancer_ra;ModerateDecrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedRiskCategory"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;StrongDecrease"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WeakDecrease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ModerateIncrease -->
-
-    <owl:Class rdf:about="&cancer_ra;ModerateIncrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedRiskCategory"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;StrongIncrease"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WeakIncrease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ModeratelyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;ModeratelyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;IncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;ModerateIncrease"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ModeratelyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;ModeratelyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                <owl:allValuesFrom rdf:resource="&cancer_ra;ModerateDecrease"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#MotherAffected -->
-
-    <owl:Class rdf:about="&cancer_ra;MotherAffected">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;FamilyCancerHistory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#MotherAffectedAfterAge60 -->
-
-    <owl:Class rdf:about="&cancer_ra;MotherAffectedAfterAge60">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;MotherAffected"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;MotherAffectedBeforeAge60"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#MotherAffectedBeforeAge60 -->
-
-    <owl:Class rdf:about="&cancer_ra;MotherAffectedBeforeAge60">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;MotherAffected"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#NoBreastfeeding -->
-
-    <owl:Class rdf:about="&cancer_ra;NoBreastfeeding">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#NoChildren -->
-
-    <owl:Class rdf:about="&cancer_ra;NoChildren">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;NoBreastfeeding"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Overweight -->
-
-    <owl:Class rdf:about="&cancer_ra;Overweight">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#OverweightWoman -->
-
-    <owl:Class rdf:about="&cancer_ra;OverweightWoman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Overweight"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Person -->
-
-    <owl:Class rdf:about="&cancer_ra;Person">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasGender"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Gender"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PersonUnderRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;PersonUnderRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Person"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Risk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PersonalBRCHistory -->
-
-    <owl:Class rdf:about="&cancer_ra;PersonalBRCHistory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalHormones -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalHormones">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWoman -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWoman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AfterMenopause"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;PremenopausalWoman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanTakingEstrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanTakingEstrogen">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Estrogen"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.67</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;PostmenopausalWomanTakingEstrogen"/>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanTakingEstrogenAndProgestin -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanTakingEstrogenAndProgestin">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Estrogen"/>
-                    </owl:Restriction>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Progestin"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.35</disponte:probability>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-        <owl:annotatedSource rdf:resource="&cancer_ra;PostmenopausalWomanTakingEstrogenAndProgestin"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanTakingEstrogenAndTestosterone -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanTakingEstrogenAndTestosterone">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Estrogen"/>
-                    </owl:Restriction>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Testosterone"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.91</disponte:probability>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-        <owl:annotatedSource rdf:resource="&cancer_ra;PostmenopausalWomanTakingEstrogenAndTestosterone"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanTakingProgestin -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanTakingProgestin">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Progestin"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.13</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;PostmenopausalWomanTakingProgestin"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Progestin"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanTakingTestosterone -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanTakingTestosterone">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Testosterone"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.85</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;PostmenopausalWomanTakingTestosterone"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Testosterone"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PostmenopausalWomanWithHighLevelOfEstrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;PostmenopausalWomanWithHighLevelOfEstrogen">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;PostmenopausalWoman"/>
-                    <rdf:Description rdf:about="&cancer_ra;WomanWithHighLevelOfEstrogen"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#PremenopausalWoman -->
-
-    <owl:Class rdf:about="&cancer_ra;PremenopausalWoman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BeforeMenopause"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Progestin -->
-
-    <owl:Class rdf:about="&cancer_ra;Progestin">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RadiationExposureDuringYouth -->
-
-    <owl:Class rdf:about="&cancer_ra;RadiationExposureDuringYouth">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;KnownFactor"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;ReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;RelativeBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;ReducedRiskCategory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RelativeBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ReducedRiskCategory -->
-
-    <owl:Class rdf:about="&cancer_ra;ReducedRiskCategory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RelativeRiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RelativeBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;RelativeBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;BRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;RelativeRiskCategory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RelativeRiskCategory -->
-
-    <owl:Class rdf:about="&cancer_ra;RelativeRiskCategory">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;RiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Risk -->
-
-    <owl:Class rdf:about="&cancer_ra;Risk">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RiskCategory -->
-
-    <owl:Class rdf:about="&cancer_ra;RiskCategory">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RiskFactor -->
-
-    <owl:Class rdf:about="&cancer_ra;RiskFactor">
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;relatedToDisease"/>
-                <owl:allValuesFrom rdf:resource="&cancer_ra;Disease"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#RiskType -->
-
-    <owl:Class rdf:about="&cancer_ra;RiskType">
-        <rdfs:subClassOf>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&owl;Thing"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskOf"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Disease"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </rdfs:subClassOf>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#SeniorWomanWithMotherBRCAffected -->
-
-    <owl:Class rdf:about="&cancer_ra;SeniorWomanWithMotherBRCAffected">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <owl:Class>
-                        <owl:intersectionOf rdf:parseType="Collection">
-                            <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                            <owl:Restriction>
-                                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                                <owl:someValuesFrom rdf:resource="&cancer_ra;MotherAffected"/>
-                            </owl:Restriction>
-                        </owl:intersectionOf>
-                    </owl:Class>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Age50Plus"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#ShortTermBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;ShortTermBRCRisk">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;AbsoluteBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#StrongDecrease -->
-
-    <owl:Class rdf:about="&cancer_ra;StrongDecrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedRiskCategory"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WeakDecrease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#StrongIncrease -->
-
-    <owl:Class rdf:about="&cancer_ra;StrongIncrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedRiskCategory"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WeakIncrease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#StronglyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;StronglyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;IncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;StrongIncrease"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#StronglyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;StronglyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                <owl:allValuesFrom rdf:resource="&cancer_ra;StrongDecrease"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Testosterone -->
-
-    <owl:Class rdf:about="&cancer_ra;Testosterone">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#TwoImmediateRelativesAffected -->
-
-    <owl:Class rdf:about="&cancer_ra;TwoImmediateRelativesAffected">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;FamilyCancerHistory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#UsualHyperplasia -->
-
-    <owl:Class rdf:about="&cancer_ra;UsualHyperplasia">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;BenignBreastDisease"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WeakDecrease -->
-
-    <owl:Class rdf:about="&cancer_ra;WeakDecrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedRiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WeakIncrease -->
-
-    <owl:Class rdf:about="&cancer_ra;WeakIncrease">
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedRiskCategory"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WeakelyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WeakelyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;IncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                        <owl:allValuesFrom rdf:resource="&cancer_ra;WeakIncrease"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;IncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WeakelyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WeakelyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;riskCategory"/>
-                <owl:allValuesFrom rdf:resource="&cancer_ra;WeakDecrease"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;ReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Woman -->
-
-    <owl:Class rdf:about="&cancer_ra;Woman">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Person"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasGender"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Female"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.123</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;Woman"/>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAbusingAlcohol -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAbusingAlcohol">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Alcohol"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged2030 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged2030">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Age2030"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderShortTermBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged3040 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged3040">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Age3040"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderShortTermBRCRisk"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.112</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;WomanAged3040"/>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanUnderShortTermBRCRisk"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged4050 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged4050">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Age4050"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged5060 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged5060">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Age5060"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderShortTermBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged50Plus -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged50Plus">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;Age50Plus"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged6070 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged6070">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Age6070"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged70Plus -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAged70Plus">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Age70Plus"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAgedUnder20 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAgedUnder20">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;AgeUnder20"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanAgedUnder50 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanAgedUnder50">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasAge"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AgeUnder50"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanWithRiskFactors"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanExposedToRadiationDuringYouth -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanExposedToRadiationDuringYouth">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;RadiationExposureDuringYouth"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanHavingFirstPeriodBefore12 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanHavingFirstPeriodBefore12">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;FirstPeriodBefore12"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanLackingExercise -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanLackingExercise">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;LackOfExercise"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanTakingBirthControlPills -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanTakingBirthControlPills">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BirthControlPills"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanTakingEstrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanTakingEstrogen">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Estrogen"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanTakingPostmenopausalHormones -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanTakingPostmenopausalHormones">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;PostmenopausalHormones"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanTakingProgestin -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanTakingProgestin">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;Progestin"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderAbsoluteBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderAbsoluteBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AbsoluteBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanUnderBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;IncreasedBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderLifetimeBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;LifetimeBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderAbsoluteBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderModeratelyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;ModeratelyIncreasedBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderStronglyIncreasedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderWeakelyIncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderModeratelyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderModeratelyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;ModeratelyReducedBRCRisk"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderReducedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderStronglyReducedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderWeakelyReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanUnderBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;ReducedBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderRelativeBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderRelativeBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;RelativeBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderShortTermBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderShortTermBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;ShortTermBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderAbsoluteBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderStronglyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderStronglyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;StronglyIncreasedBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderWeakelyIncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderStronglyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderStronglyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;StronglyReducedBRCRisk"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderReducedBRCRisk"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanUnderWeakelyReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderWeakelyIncreasedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderWeakelyIncreasedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;WeakelyIncreasedBRCRisk"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderIncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderWeakelyReducedBRCRisk -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanUnderWeakelyReducedBRCRisk">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRisk"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;WeakelyReducedBRCRisk"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderReducedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithAtypicalHyperplasia -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithAtypicalHyperplasia">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;AtypicalHyperplasia"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithBRCA1Mutation -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithBRCA1Mutation">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BRCA1Mutation"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.8</disponte:probability>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-        <owl:annotatedSource rdf:resource="&cancer_ra;WomanWithBRCA1Mutation"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithBRCA2Mutation -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithBRCA2Mutation">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BRCA2Mutation"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithBRCAMutation -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithBRCAMutation">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;BRCAMutation"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanWithRiskFactors"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.85</disponte:probability>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanUnderLifetimeBRCRisk"/>
-        <owl:annotatedSource rdf:resource="&cancer_ra;WomanWithBRCAMutation"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithCarcinomaInSitu -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithCarcinomaInSitu">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;CarcinomaInSitu"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithEarlyFirstChild -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithEarlyFirstChild">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;EarlyFirstChild"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanWithLateFirstChild"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanWithoutChildren"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithEarlyFirstPeriodAndLateMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithEarlyFirstPeriodAndLateMenopause">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;WomanHavingFirstPeriodBefore12"/>
-                    <rdf:Description rdf:about="&cancer_ra;WomanWithLateMenopause"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithEarlyMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithEarlyMenopause">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;EarlyMenopause"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithFamilyBRCHistory -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithFamilyBRCHistory">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;FamilyCancerHistory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithHighBoneDensity -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithHighBoneDensity">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;HighBreastDensity"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithHighBreastDensity -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithHighBreastDensity">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;HighBreastDensity"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithHighLevelOfEstrogen -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithHighLevelOfEstrogen">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;HighLevelOfEstrogen"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithImmediateRelativesBRCAffected -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithImmediateRelativesBRCAffected">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;TwoImmediateRelativesAffected"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithLateFirstChild -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithLateFirstChild">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;LateFirstChild"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <owl:disjointWith rdf:resource="&cancer_ra;WomanWithoutChildren"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithLateMenopause -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithLateMenopause">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;LateMenopause"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithMotherAffectedAfterAge60 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithMotherAffectedAfterAge60">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;MotherAffectedAfterAge60"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanWithMotherBRCAffected"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedSource rdf:resource="&cancer_ra;WomanWithMotherAffectedAfterAge60"/>
-        <owl:annotatedTarget rdf:resource="&cancer_ra;WomanWithMotherBRCAffected"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithMotherAffectedBeforeAge60 -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithMotherAffectedBeforeAge60">
-        <owl:equivalentClass>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                <owl:someValuesFrom rdf:resource="&cancer_ra;MotherAffectedBeforeAge60"/>
-            </owl:Restriction>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanWithMotherBRCAffected"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithMotherBRCAffected -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithMotherBRCAffected">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;MotherAffected"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithPersonalBRCHistory -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithPersonalBRCHistory">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;PersonalBRCHistory"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithRiskFactors -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithRiskFactors">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;RiskFactor"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithUsualHyperplasia -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithUsualHyperplasia">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;UsualHyperplasia"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;WomanUnderModeratelyIncreasedBRCRisk"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithoutBreastfeeding -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithoutBreastfeeding">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;NoBreastfeeding"/>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#WomanWithoutChildren -->
-
-    <owl:Class rdf:about="&cancer_ra;WomanWithoutChildren">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="&cancer_ra;Woman"/>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom rdf:resource="&cancer_ra;NoChildren"/>
-                    </owl:Restriction>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="&cancer_ra;hasRiskFactor"/>
-                        <owl:someValuesFrom>
-                            <owl:Class>
-                                <owl:unionOf rdf:parseType="Collection">
-                                    <rdf:Description rdf:about="&cancer_ra;Age3040"/>
-                                    <rdf:Description rdf:about="&cancer_ra;Age4050"/>
-                                    <rdf:Description rdf:about="&cancer_ra;Age50Plus"/>
-                                </owl:unionOf>
-                            </owl:Class>
-                        </owl:someValuesFrom>
-                    </owl:Restriction>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-        <rdfs:subClassOf rdf:resource="&cancer_ra;Woman"/>
-    </owl:Class>
-    
-
-
-    <!-- http://www.w3.org/2002/07/owl#Thing -->
-
-    <owl:Class rdf:about="&owl;Thing"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Individuals
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://clarkparsia.com/pronto/cancer_ra.owl#Helen -->
-
-    <owl:NamedIndividual rdf:about="&cancer_ra;Helen">
-        <rdf:type rdf:resource="&cancer_ra;PostmenopausalWoman"/>
-        <rdf:type rdf:resource="&cancer_ra;Woman"/>
-        <rdf:type rdf:resource="&cancer_ra;WomanAged3040"/>
-        <rdf:type rdf:resource="&cancer_ra;WomanTakingEstrogen"/>
-        <rdfs:label>Helen</rdfs:label>
-    </owl:NamedIndividual>
-</rdf:RDF>
-
-
-
-<!-- Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net -->
-
diff --git a/examples/DBPedia.owl b/examples/DBPedia.owl
deleted file mode 100644
index 480bbea..0000000
--- a/examples/DBPedia.owl
+++ /dev/null
@@ -1,1260 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-An extract of the DBPedia ontology, it contains structured information from Wikipedia.
-http://dbpedia.org/
-
-/** <examples>
-
-?- prob_sub_class(\'Village\',\'PopulatedPlace\',Prob).
-?- sub_class(\'Village\',\'PopulatedPlace\',ListExpl).
-
-*/
--->
-
-<!DOCTYPE rdf:RDF [
-    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
-    <!ENTITY Work "http://dbpedia.org/ontology/Work/" >
-    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
-    <!ENTITY Lake "http://dbpedia.org/ontology/Lake/" >
-    <!ENTITY Drug "http://dbpedia.org/ontology/Drug/" >
-    <!ENTITY Canal "http://dbpedia.org/ontology/Canal/" >
-    <!ENTITY Bridge "http://dbpedia.org/ontology/Bridge/" >
-    <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" >
-    <!ENTITY Stream "http://dbpedia.org/ontology/Stream/" >
-    <!ENTITY School "http://dbpedia.org/ontology/School/" >
-    <!ENTITY Weapon "http://dbpedia.org/ontology/Weapon/" >
-    <!ENTITY Person "http://dbpedia.org/ontology/Person/" >
-    <!ENTITY Rocket "http://dbpedia.org/ontology/Rocket/" >
-    <!ENTITY Planet "http://dbpedia.org/ontology/Planet/" >
-    <!ENTITY Software "http://dbpedia.org/ontology/Software/" >
-    <!ENTITY Building "http://dbpedia.org/ontology/Building/" >
-    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
-    <!ENTITY Mountain "http://dbpedia.org/ontology/Mountain/" >
-    <!ENTITY GrandPrix "http://dbpedia.org/ontology/GrandPrix/" >
-    <!ENTITY Astronaut "http://dbpedia.org/ontology/Astronaut/" >
-    <!ENTITY Automobile "http://dbpedia.org/ontology/Automobile/" >
-    <!ENTITY Spacecraft "http://dbpedia.org/ontology/Spacecraft/" >
-    <!ENTITY wgs84_pos "http://www.w3.org/2003/01/geo/wgs84_pos#" >
-    <!ENTITY LunarCrater "http://dbpedia.org/ontology/LunarCrater/" >
-    <!ENTITY SpaceShuttle "http://dbpedia.org/ontology/SpaceShuttle/" >
-    <!ENTITY SpaceStation "http://dbpedia.org/ontology/SpaceStation/" >
-    <!ENTITY SpaceMission "http://dbpedia.org/ontology/SpaceMission/" >
-    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
-    <!ENTITY PopulatedPlace "http://dbpedia.org/ontology/PopulatedPlace/" >
-    <!ENTITY Infrastructure "http://dbpedia.org/ontology/Infrastructure/" >
-    <!ENTITY AutomobileEngine "http://dbpedia.org/ontology/AutomobileEngine/" >
-    <!ENTITY ChemicalCompound "http://dbpedia.org/ontology/ChemicalCompound/" >
-    <!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" >
-    <!ENTITY MeanOfTransportation "http://dbpedia.org/ontology/MeanOfTransportation/" >
-    <!ENTITY GeopoliticalOrganisation "http://dbpedia.org/ontology/GeopoliticalOrganisation/" >
-]>
-
-
-<rdf:RDF xmlns="http://dbpedia.org/ontology/"
-     xml:base="http://dbpedia.org/ontology/"
-     xmlns:Software="http://dbpedia.org/ontology/Software/"
-     xmlns:Astronaut="http://dbpedia.org/ontology/Astronaut/"
-     xmlns:SpaceStation="http://dbpedia.org/ontology/SpaceStation/"
-     xmlns:Building="http://dbpedia.org/ontology/Building/"
-     xmlns:Bridge="http://dbpedia.org/ontology/Bridge/"
-     xmlns:Work="http://dbpedia.org/ontology/Work/"
-     xmlns:GrandPrix="http://dbpedia.org/ontology/GrandPrix/"
-     xmlns:Spacecraft="http://dbpedia.org/ontology/Spacecraft/"
-     xmlns:MeanOfTransportation="http://dbpedia.org/ontology/MeanOfTransportation/"
-     xmlns:Infrastructure="http://dbpedia.org/ontology/Infrastructure/"
-     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-     xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#"
-     xmlns:PopulatedPlace="http://dbpedia.org/ontology/PopulatedPlace/"
-     xmlns:Drug="http://dbpedia.org/ontology/Drug/"
-     xmlns:ChemicalCompound="http://dbpedia.org/ontology/ChemicalCompound/"
-     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#"
-     xmlns:SpaceShuttle="http://dbpedia.org/ontology/SpaceShuttle/"
-     xmlns:Lake="http://dbpedia.org/ontology/Lake/"
-     xmlns:LunarCrater="http://dbpedia.org/ontology/LunarCrater/"
-     xmlns:School="http://dbpedia.org/ontology/School/"
-     xmlns:Rocket="http://dbpedia.org/ontology/Rocket/"
-     xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#"
-     xmlns:GeopoliticalOrganisation="http://dbpedia.org/ontology/GeopoliticalOrganisation/"
-     xmlns:AutomobileEngine="http://dbpedia.org/ontology/AutomobileEngine/"
-     xmlns:Automobile="http://dbpedia.org/ontology/Automobile/"
-     xmlns:Canal="http://dbpedia.org/ontology/Canal/"
-     xmlns:SpaceMission="http://dbpedia.org/ontology/SpaceMission/"
-     xmlns:Planet="http://dbpedia.org/ontology/Planet/"
-     xmlns:Stream="http://dbpedia.org/ontology/Stream/"
-     xmlns:Weapon="http://dbpedia.org/ontology/Weapon/"
-     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-     xmlns:owl="http://www.w3.org/2002/07/owl#"
-     xmlns:Person="http://dbpedia.org/ontology/Person/"
-     xmlns:Mountain="http://dbpedia.org/ontology/Mountain/">
-    <owl:Ontology rdf:about="http://dbpedia.org/ontology/">
-        <owl:versionInfo xml:lang="en">Version 3.5</owl:versionInfo>
-    </owl:Ontology>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Annotation properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- https://sites.google.com/a/unife.it/ml/disponte#probability -->
-
-    <owl:AnnotationProperty rdf:about="&disponte;probability"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Classes
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://dbpedia.org/ontology/Actor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Actor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/AdministrativeRegion -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/AdministrativeRegion">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/AdultActor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/AdultActor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Airport -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Airport">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Album -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Album">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Ambassador -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Ambassador">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/AmericanFootballPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/AmericanFootballPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Architect -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Architect">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Artist -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Artist">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Astronaut -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Astronaut">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Athlete -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Athlete">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/BadmintonPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/BadmintonPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/BaseballPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/BaseballPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/BasketballPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/BasketballPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/BodyOfWater -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/BodyOfWater">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Book -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Book">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Boxer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Boxer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Bridge -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Bridge">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/BritishRoyalty -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/BritishRoyalty">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Building -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Building">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Canal -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Canal">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Cardinal -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Cardinal">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Cave -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Cave">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Chancellor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Chancellor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/ChristianBishop -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/ChristianBishop">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/City -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/City">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Cleric -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Cleric">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/CollegeCoach -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/CollegeCoach">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Comedian -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Comedian">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/ComicsCharacter -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/ComicsCharacter">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/ComicsCreator -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/ComicsCreator">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Congressman -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Congressman">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Continent -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Continent">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Country -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Country">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Cricketer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Cricketer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Criminal -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Criminal">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Cyclist -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Cyclist">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/EurovisionSongContestEntry -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/EurovisionSongContestEntry">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/FictionalCharacter -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/FictionalCharacter">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/FigureSkater -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/FigureSkater">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Film -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Film">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/FormulaOneRacer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/FormulaOneRacer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/GaelicGamesPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/GaelicGamesPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Governor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Governor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/GridironFootballPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/GridironFootballPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/HistoricPlace -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/HistoricPlace">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Hospital -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Hospital">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/IceHockeyPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/IceHockeyPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Island -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Island">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Journalist -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Journalist">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Judge -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Judge">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Lake -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Lake">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/LaunchPad -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/LaunchPad">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Lighthouse -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Lighthouse">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/LunarCrater -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/LunarCrater">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Magazine -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Magazine">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Mayor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Mayor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/MemberOfParliament -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/MemberOfParliament">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/MilitaryPerson -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/MilitaryPerson">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Model -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Model">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Monarch -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Monarch">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Monument -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Monument">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Mountain -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Mountain">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/MountainRange -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/MountainRange">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Musical -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Musical">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/MusicalArtist -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/MusicalArtist">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/MusicalWork -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/MusicalWork">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/NascarDriver -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/NascarDriver">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/NationalCollegiateAthleticAssociationAthlete -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/NationalCollegiateAthleticAssociationAthlete">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Newspaper -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Newspaper">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/OfficeHolder -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/OfficeHolder">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Park -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Park">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Person -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Person"/>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Philosopher -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Philosopher">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Place -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Place">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.31</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.71</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.32</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/PlayboyPlaymate -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/PlayboyPlaymate">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/PokerPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/PokerPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Politician -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Politician">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Pope -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Pope">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/PopulatedPlace -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/PopulatedPlace">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/President -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/President">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/PrimeMinister -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/PrimeMinister">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/ProtectedArea -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/ProtectedArea">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/River -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/River">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/RugbyPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/RugbyPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Saint -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Saint">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Scientist -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Scientist">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Senator -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Senator">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Settlement -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Settlement">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.11</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.81</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.41</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/ShoppingMall -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/ShoppingMall">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Single -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Single">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/SiteOfSpecialScientificInterest -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/SiteOfSpecialScientificInterest">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/SkiArea -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/SkiArea">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Skyscraper -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Skyscraper">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/SoccerManager -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/SoccerManager">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/SoccerPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/SoccerPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Software -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Software">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Song -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Song">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Stadium -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Stadium">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Station -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Station">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Stream -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Stream">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/TelevisionEpisode -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/TelevisionEpisode">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/TelevisionShow -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/TelevisionShow">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/TennisPlayer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/TennisPlayer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Town -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Town">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Valley -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Valley">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/VideoGame -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/VideoGame">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Work"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Village -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Village">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_A0_144_"/>
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.23</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/PopulatedPlace"/>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.32</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/Place"/>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.21</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A73_A0_144_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.3</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.91</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/Settlement"/>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.67</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/Village"/>
-        <owl:annotatedTarget rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/VoiceActor -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/VoiceActor">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/WineRegion -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/WineRegion">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Work -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Work"/>
-    
-
-
-    <!-- http://dbpedia.org/ontology/WorldHeritageSite -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/WorldHeritageSite">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Place"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Wrestler -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Wrestler">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/Writer -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/Writer">
-        <rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/Person"/>
-    </owl:Class>
-    
-
-
-    <!-- http://dbpedia.org/ontology/A0_144_ -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/A0_144_">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.71</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/A0_144_"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/A73_A0_ -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/A73_A0_">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.7</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/A73_A0_"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/A73_A0_144_ -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/A73_A0_144_">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.81</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/A73_A0_144_"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/PopulatedPlace"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://dbpedia.org/ontology/A73_144_ -->
-
-    <owl:Class rdf:about="http://dbpedia.org/ontology/A73_144_">
-        <owl:equivalentClass>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:equivalentClass>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.51</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://dbpedia.org/ontology/A73_144_"/>
-        <owl:annotatedProperty rdf:resource="&owl;equivalentClass"/>
-        <owl:annotatedTarget>
-            <owl:Class>
-                <owl:intersectionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Place"/>
-                    <rdf:Description rdf:about="http://dbpedia.org/ontology/Settlement"/>
-                </owl:intersectionOf>
-            </owl:Class>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-</rdf:RDF>
-
-
-
-<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
-
diff --git a/examples/biopaxLevel3.owl b/examples/biopaxLevel3.owl
deleted file mode 100644
index 520c805..0000000
--- a/examples/biopaxLevel3.owl
+++ /dev/null
@@ -1,3063 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-Model of metabolic pathways.
-http://www.biopax.org/
-
-/** <examples>
-
-?- prob_sub_class(\'TransportWithBiochemicalReaction\',\'Entity\',Prob).
-?- sub_class(\'TransportWithBiochemicalReaction\',\'Entity\',ListExpl).
-
-*/
--->
-
-<!DOCTYPE rdf:RDF [
-    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
-    <!ENTITY swrl "http://www.w3.org/2003/11/swrl#" >
-    <!ENTITY swrlb "http://www.w3.org/2003/11/swrlb#" >
-    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
-    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
-    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
-    <!ENTITY protege "http://protege.stanford.edu/plugins/owl/protege#" >
-    <!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" >
-    <!ENTITY xsp "http://www.owl-ontologies.com/2005/08/07/xsp.owl#" >
-]>
-
-
-<rdf:RDF xmlns="http://www.biopax.org/release/biopax-level3.owl#"
-     xml:base="http://www.biopax.org/release/biopax-level3.owl"
-     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-     xmlns:swrl="http://www.w3.org/2003/11/swrl#"
-     xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
-     xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
-     xmlns:owl="http://www.w3.org/2002/07/owl#"
-     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-     xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
-     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#">
-    <owl:Ontology rdf:about="http://www.biopax.org/release/biopax-level3.owl">
-        <rdfs:comment rdf:datatype="&xsd;string">This is version 1.0 of the BioPAX Level 3 ontology.  The goal of the BioPAX group is to develop a common exchange format for biological pathway data.  More information is available at http://www.biopax.org.  This ontology is freely available under the LGPL (http://www.gnu.org/copyleft/lesser.html).</rdfs:comment>
-    </owl:Ontology>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Annotation properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- https://sites.google.com/a/unife.it/ml/disponte#probability -->
-
-    <owl:AnnotationProperty rdf:about="&disponte;probability"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Object Properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#absoluteRegion -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#absoluteRegion">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Absolute location as defined by the referenced sequence database record. E.g. an operon has a absolute region on the DNA molecule referenced by the UnificationXref.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#bindsTo -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#bindsTo">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
-        <rdf:type rdf:resource="&owl;SymmetricProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A binding feature represents a &quot;half&quot; of the bond between two entities. This property points to another binding feature which represents the other half. The bond can be covalent or non-covalent.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-        <owl:inverseOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#bindsTo"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#cellType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#cellType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">A cell type, e.g. &apos;HeLa&apos;. This should reference a term in a controlled vocabulary of cell types. Best practice is to refer to OBO Cell Ontology. http://www.obofoundry.org/cgi-bin/detail.cgi?id=cell</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BioSource"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#CellVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#cellularLocation -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#cellularLocation">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A cellular location, e.g. &apos;cytoplasm&apos;. This should reference a term in the Gene Ontology Cellular Component ontology. The location referred to by this property should be as specific as is known. If an interaction is known to occur in multiple locations, separate interactions (and physicalEntities) must be created for each different location.  If the location of a participant in a complex is unspecified, it may be assumed to be the same location as that of the complex. 
-
- A molecule in two different cellular locations are considered two different physical entities.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#CellularLocationVocabulary"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#cofactor -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#cofactor">
-        <rdfs:comment xml:lang="en">Any cofactor(s) or coenzyme(s) required for catalysis of the conversion by the enzyme. COFACTOR is a sub-property of PARTICIPANTS.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Catalysis"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#component -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#component">
-        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Complex"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#componentStoichiometry -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#componentStoichiometry">
-        <rdfs:comment rdf:datatype="&xsd;string">The stoichiometry of components in a complex</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Complex"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#confidence -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#confidence">
-        <rdfs:comment rdf:datatype="&xsd;string">Confidence in the containing instance.  Usually a statistical measure.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#controlled -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#controlled">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The entity that is controlled, e.g., in a biochemical reaction, the reaction is controlled by an enzyme. CONTROLLED is a sub-property of PARTICIPANTS.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#controller -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#controller">
-        <rdfs:comment xml:lang="en">The controlling entity, e.g., in a biochemical reaction, an enzyme is the controlling entity of the reaction. CONTROLLER is a sub-property of PARTICIPANTS.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#dataSource -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#dataSource">
-        <rdfs:comment rdf:datatype="&xsd;string">A free text description of the source of this data, e.g. a database or person name. This property should be used to describe the source of the data. This is meant to be used by databases that export their data to the BioPAX format or by systems that are integrating data from multiple sources. The granularity of use (specifying the data source in many or few instances) is up to the user. It is intended that this property report the last data source, not all data sources that the data has passed through from creation.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#deltaG -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#deltaG">
-        <rdfs:comment rdf:datatype="&xsd;string">For biochemical reactions, this property refers to the standard transformed Gibbs energy change for a reaction written in terms of biochemical reactants (sums of species), delta-G
-
-Since Delta-G can change based on multiple factors including ionic strength and temperature a reaction can have multiple DeltaG values.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#entityFeature -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#entityFeature">
-        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Variable features that are observed for this entity - such as known PTM or methylation sites and non-covalent bonds.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#entityReference -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#entityReference">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Reference entity for this physical entity.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Dna"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegion"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#entityReferenceType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#entityReferenceType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A controlled vocabulary term that is used to describe the type of grouping such as homology or functional group.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReferenceTypeVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#evidence -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#evidence">
-        <rdfs:comment rdf:datatype="&xsd;string">Scientific evidence supporting the existence of the entity as described.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#evidenceCode -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#evidenceCode">
-        <rdfs:comment rdf:datatype="&xsd;string">A pointer to a term in an external controlled vocabulary, such as the GO, PSI-MI or BioCyc evidence codes, that describes the nature of the support, such as &apos;traceable author statement&apos; or &apos;yeast two-hybrid&apos;.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#experimentalFeature -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#experimentalFeature">
-        <rdfs:comment rdf:datatype="&xsd;string">A feature of the experimental form of the participant of the interaction, such as a protein tag. It is not expected to occur in vivo or be necessary for the interaction.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#experimentalForm -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#experimentalForm">
-        <rdfs:comment rdf:datatype="&xsd;string">The experimental forms associated with an evidence instance.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#experimentalFormDescription -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#experimentalFormDescription">
-        <rdfs:comment rdf:datatype="&xsd;string">Descriptor of this experimental form from a controlled vocabulary.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#experimentalFormEntity -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#experimentalFormEntity">
-        <rdfs:comment rdf:datatype="&xsd;string">The gene or physical entity that this experimental form describes.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Gene"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#feature -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#feature">
-        <rdfs:comment rdf:datatype="&xsd;string">Sequence features of the owner physical entity.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#featureLocation -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#featureLocation">
-        <rdfs:comment rdf:datatype="&xsd;string">Location of the feature on the sequence of the interactor. One feature may have more than one location, used e.g. for features which involve sequence positions close in the folded, three-dimensional state of a protein, but non-continuous along the sequence.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#featureLocationType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#featureLocationType">
-        <rdfs:comment rdf:datatype="&xsd;string">A controlled vocabulary term describing the type of the sequence location such as C-Terminal or SH2 Domain.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#interactionScore -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#interactionScore">
-        <rdfs:comment rdf:datatype="&xsd;string">The score of an interaction e.g. a genetic interaction score.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#interactionType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#interactionType">
-        <rdfs:comment rdf:datatype="&xsd;string">External controlled vocabulary annotating the interaction type, for example &quot;phosphorylation&quot;. This is annotation useful for e.g. display on a web page or database searching, but may not be suitable for other computing tasks, like reasoning.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#kEQ -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#kEQ">
-        <rdfs:comment rdf:datatype="&xsd;string">This quantity is dimensionless and is usually a single number. The measured equilibrium constant for a biochemical reaction, encoded by the slot KEQ, is actually the apparent equilibrium constant, K&apos;.  Concentrations in the equilibrium constant equation refer to the total concentrations of  all forms of particular biochemical reactants. For example, in the equilibrium constant equation for the biochemical reaction in which ATP is hydrolyzed to ADP and inorganic phosphate:
-
-K&apos; = [ADP][P&lt;sub&gt;i&lt;/sub&gt;]/[ATP],
-
-The concentration of ATP refers to the total concentration of all of the following species:
-
-[ATP] = [ATP&lt;sup&gt;4-&lt;/sup&gt;] + [HATP&lt;sup&gt;3-&lt;/sup&gt;] + [H&lt;sub&gt;2&lt;/sub&gt;ATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgHATP&lt;sup&gt;-&lt;/sup&gt;] + [Mg&lt;sub&gt;2&lt;/sub&gt;ATP].
-
-The apparent equilibrium constant is formally dimensionless, and can be kept so by inclusion of as many of the terms (1 mol/dm&lt;sup&gt;3&lt;/sup&gt;) in the numerator or denominator as necessary.  It is a function of temperature (T), ionic strength (I), pH, and pMg (pMg = -log&lt;sub&gt;10&lt;/sub&gt;[Mg&lt;sup&gt;2+&lt;/sup&gt;]). Therefore, these quantities must be specified to be precise, and values for KEQ for biochemical reactions may be represented as 5-tuples of the form (K&apos; T I pH pMg).  This property may have multiple values, representing different measurements for K&apos; obtained under the different experimental conditions listed in the 5-tuple. (This definition adapted from EcoCyc)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#left -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#left">
-        <rdfs:comment rdf:datatype="&xsd;string">The participants on the left side of the conversion interaction. Since conversion interactions may proceed in either the left-to-right or right-to-left direction, occupants of the LEFT property may be either reactants or products. LEFT is a sub-property of PARTICIPANTS.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#memberEntityReference -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#memberEntityReference">
-        <rdfs:comment rdf:datatype="&xsd;string">An entity reference that qualifies for the definition of this group. For example a member of a PFAM protein family.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#memberFeature -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#memberFeature">
-        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">An entity feature  that belongs to this homology grouping. Example: a homologous phosphorylation site across a protein family.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity">
-        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">This property stores the members of a generic physical entity. 
-
-For representing homology generics a better way is to use generic entity references and generic features. However not all generic logic can be captured by this, such as complex generics or rare cases where feature cardinality is variable. Usages of this property should be limited to such cases.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#modificationType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#modificationType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Description and classification of the feature.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ModificationFeature"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#nextStep -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#nextStep">
-        <rdfs:comment rdf:datatype="&xsd;string">The next step(s) of the pathway.  Contains zero or more pathwayStep instances.  If there is no next step, this property is empty. Multiple pathwayStep instances indicate pathway branching.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#notFeature -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#notFeature">
-        <rdfs:comment rdf:datatype="&xsd;string">Sequence features where the owner physical entity has a feature. If not specified, other potential features are not known.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#organism -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#organism">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">An organism, e.g. &apos;Homo sapiens&apos;. This is the organism that the entity is found in. Pathways may not have an organism associated with them, for instance, reference pathways from KEGG. Sequence-based entities (DNA, protein, RNA) may contain an xref to a sequence database that contains organism information, in which case the information should be consistent with the value for ORGANISM.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BioSource"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Gene"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#participant -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#participant">
-        <rdfs:comment rdf:datatype="&xsd;string">This property lists the entities that participate in this interaction. For example, in a biochemical reaction, the participants are the union of the reactants and the products of the reaction. This property has a number of sub-properties, such as LEFT and RIGHT used in the biochemicalInteraction class. Any participant listed in a sub-property will automatically be assumed to also be in PARTICIPANTS by a number of software systems, including Protege, so this property should not contain any instances if there are instances contained in a sub-property.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#participantStoichiometry -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#participantStoichiometry">
-        <rdfs:comment rdf:datatype="&xsd;string">Stoichiometry of the left and right participants.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#pathwayComponent -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#pathwayComponent">
-        <rdfs:comment rdf:datatype="&xsd;string">The set of interactions and/or pathwaySteps in this pathway/network. Each instance of the pathwayStep class defines: 1) a set of interactions that together define a particular step in the pathway, for example a catalysis instance and the conversion that it catalyzes; 2) an order relationship to one or more other pathway steps (via the NEXT-STEP property). Note: This ordering is not necessarily temporal - the order described may simply represent connectivity between adjacent steps. Temporal ordering information should only be inferred from the direction of each interaction.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#pathwayOrder -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#pathwayOrder">
-        <rdfs:comment rdf:datatype="&xsd;string">The ordering of components (interactions and pathways) in the context of this pathway. This is useful to specific circular or branched pathways or orderings when component biochemical reactions are normally reversible, but are directed in the context of this pathway.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#phenotype -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#phenotype">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The phenotype quality used to define this genetic interaction e.g. viability.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#physicalEntity -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#physicalEntity">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The physical entity to be annotated with stoichiometry.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#product -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#product">
-        <rdfs:comment rdf:datatype="&xsd;string">The product of a template reaction.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Dna"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#regionType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#regionType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#relationshipType -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#relationshipType">
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipXref"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#right -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#right">
-        <rdfs:comment rdf:datatype="&xsd;string">The participants on the right side of the conversion interaction. Since conversion interactions may proceed in either the left-to-right or right-to-left direction, occupants of the RIGHT property may be either reactants or products. RIGHT is a sub-property of PARTICIPANTS.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#scoreSource -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#scoreSource">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#sequenceIntervalBegin -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#sequenceIntervalBegin">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The begin position of a sequence interval.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceInterval"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceSite"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#sequenceIntervalEnd -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#sequenceIntervalEnd">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The end position of a sequence interval.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceInterval"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceSite"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#stepConversion -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#stepConversion">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The central process that take place at this step of the biochemical pathway.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalPathwayStep"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#stepProcess"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#stepProcess -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#stepProcess">
-        <rdfs:comment rdf:datatype="&xsd;string">An interaction or a pathway that are a part of this pathway step.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#structure -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#structure">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">Defines the chemical structure and other information about this molecule, using an instance of class chemicalStructure.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure"/>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#subRegion -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#subRegion">
-        <rdfs:comment rdf:datatype="&xsd;string">The sub region of a region or nucleic acid molecule. The sub region must be wholly part of the region, not outside of it.</rdfs:comment>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#template -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#template">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The template molecule that is used in this template reaction.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-        <rdfs:range>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Dna"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegion"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:range>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#tissue -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#tissue">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">An external controlled vocabulary of tissue types.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BioSource"/>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#xref -->
-
-    <owl:ObjectProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#xref">
-        <rdfs:comment xml:lang="en">Values of this property define external cross-references from this entity to entities in external databases.</rdfs:comment>
-        <rdfs:range rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#BioSource"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Data properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#author -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#author">
-        <rdfs:comment xml:lang="en">The authors of this publication, one per property value.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#availability -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#availability">
-        <rdfs:comment xml:lang="en">Describes the availability of this data (e.g. a copyright statement).</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#catalysisDirection -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#catalysisDirection">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">This property represents the direction of this catalysis under all
-physiological conditions if there is one.
-
-Note that chemically a catalyst will increase the rate of the reaction
-in both directions. In biology, however, there are cases where the
-enzyme is expressed only when the controlled bidirectional conversion is
-on one side of the chemical equilibrium [todo : example]. If that is the
-case and the controller, under biological conditions, is always
-catalyzing the conversion in one direction then this fact can be
-captured using this property. If the enzyme is active for both
-directions, or the conversion is not bidirectional, this property should
-be left empty.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Catalysis"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">LEFT-TO-RIGHT</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">RIGHT-TO-LEFT</rdf:first>
-                                <rdf:rest rdf:resource="&rdf;nil"/>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#chemicalFormula -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#chemicalFormula">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The chemical formula of the small molecule. Note: chemical formula can also be stored in the STRUCTURE property (in CML). In case of disagreement between the value of this property and that in the CML file, the CML value takes precedence.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#comment -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#comment">
-        <rdfs:comment rdf:datatype="&xsd;string">Comment on the data in the container class. This property should be used instead of the OWL documentation elements (rdfs:comment) for instances because information in &apos;comment&apos; is data to be exchanged, whereas the rdfs:comment field is used for metadata about the structure of the BioPAX ontology.</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;string"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#controlType -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#controlType">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Defines the nature of the control relationship between the CONTROLLER and the CONTROLLED entities.
-
-The following terms are possible values:
-
-ACTIVATION: General activation. Compounds that activate the specified enzyme activity by an unknown mechanism. The mechanism is defined as unknown, because either the mechanism has yet to be elucidated in the experimental literature, or the paper(s) curated thus far do not define the mechanism, and a full literature search has yet to be performed.
-
-The following term can not be used in the catalysis class:
-INHIBITION: General inhibition. Compounds that inhibit the specified enzyme activity by an unknown mechanism. The mechanism is defined as unknown, because either the mechanism has yet to be elucidated in the experimental literature, or the paper(s) curated thus far do not define the mechanism, and a full literature search has yet to be performed.
-
-The following terms can only be used in the modulation class (these definitions from EcoCyc):
-INHIBITION-ALLOSTERIC
-Allosteric inhibitors decrease the specified enzyme activity by binding reversibly to the enzyme and inducing a conformational change that decreases the affinity of the enzyme to its substrates without affecting its VMAX. Allosteric inhibitors can be competitive or noncompetitive inhibitors, therefore, those inhibition categories can be used in conjunction with this category.
-
-INHIBITION-COMPETITIVE
-Competitive inhibitors are compounds that competitively inhibit the specified enzyme activity by binding reversibly to the enzyme and preventing the substrate from binding. Binding of the inhibitor and substrate are mutually exclusive because it is assumed that the inhibitor and substrate can both bind only to the free enzyme. A competitive inhibitor can either bind to the active site of the enzyme, directly excluding the substrate from binding there, or it can bind to another site on the enzyme, altering the conformation of the enzyme such that the substrate can not bind to the active site.
-
-INHIBITION-IRREVERSIBLE
-Irreversible inhibitors are compounds that irreversibly inhibit the specified enzyme activity by binding to the enzyme and dissociating so slowly that it is considered irreversible. For example, alkylating agents, such as iodoacetamide, irreversibly inhibit the catalytic activity of some enzymes by modifying cysteine side chains.
-
-INHIBITION-NONCOMPETITIVE
-Noncompetitive inhibitors are compounds that noncompetitively inhibit the specified enzyme by binding reversibly to both the free enzyme and to the enzyme-substrate complex. The inhibitor and substrate may be bound to the enzyme simultaneously and do not exclude each other. However, only the enzyme-substrate complex (not the enzyme-substrate-inhibitor complex) is catalytically active.
-
-INHIBITION-OTHER
-Compounds that inhibit the specified enzyme activity by a mechanism that has been characterized, but that cannot be clearly classified as irreversible, competitive, noncompetitive, uncompetitive, or allosteric.
-
-INHIBITION-UNCOMPETITIVE
-Uncompetitive inhibitors are compounds that uncompetitively inhibit the specified enzyme activity by binding reversibly to the enzyme-substrate complex but not to the enzyme alone.
-
-ACTIVATION-NONALLOSTERIC
-Nonallosteric activators increase the specified enzyme activity by means other than allosteric.
-
-ACTIVATION-ALLOSTERIC
-Allosteric activators increase the specified enzyme activity by binding reversibly to the enzyme and inducing a conformational change that increases the affinity of the enzyme to its substrates without affecting its VMAX.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">ACTIVATION</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">ACTIVATION-ALLOSTERIC</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">ACTIVATION-NONALLOSTERIC</rdf:first>
-                                        <rdf:rest>
-                                            <rdf:Description>
-                                                <rdf:type rdf:resource="&rdf;List"/>
-                                                <rdf:first rdf:datatype="&xsd;string">INHIBITION</rdf:first>
-                                                <rdf:rest>
-                                                    <rdf:Description>
-                                                        <rdf:type rdf:resource="&rdf;List"/>
-                                                        <rdf:first rdf:datatype="&xsd;string">INHIBITION-ALLOSTERIC</rdf:first>
-                                                        <rdf:rest>
-                                                            <rdf:Description>
-                                                                <rdf:type rdf:resource="&rdf;List"/>
-                                                                <rdf:first rdf:datatype="&xsd;string">INHIBITION-COMPETITIVE</rdf:first>
-                                                                <rdf:rest>
-                                                                    <rdf:Description>
-                                                                        <rdf:type rdf:resource="&rdf;List"/>
-                                                                        <rdf:first rdf:datatype="&xsd;string">INHIBITION-IRREVERSIBLE</rdf:first>
-                                                                        <rdf:rest>
-                                                                            <rdf:Description>
-                                                                                <rdf:type rdf:resource="&rdf;List"/>
-                                                                                <rdf:first rdf:datatype="&xsd;string">INHIBITION-NONCOMPETITIVE</rdf:first>
-                                                                                <rdf:rest>
-                                                                                    <rdf:Description>
-                                                                                        <rdf:type rdf:resource="&rdf;List"/>
-                                                                                        <rdf:first rdf:datatype="&xsd;string">INHIBITION-OTHER</rdf:first>
-                                                                                        <rdf:rest>
-                                                                                            <rdf:Description>
-                                                                                                <rdf:type rdf:resource="&rdf;List"/>
-                                                                                                <rdf:first rdf:datatype="&xsd;string">INHIBITION-UNCOMPETITIVE</rdf:first>
-                                                                                                <rdf:rest rdf:resource="&rdf;nil"/>
-                                                                                            </rdf:Description>
-                                                                                        </rdf:rest>
-                                                                                    </rdf:Description>
-                                                                                </rdf:rest>
-                                                                            </rdf:Description>
-                                                                        </rdf:rest>
-                                                                    </rdf:Description>
-                                                                </rdf:rest>
-                                                            </rdf:Description>
-                                                        </rdf:rest>
-                                                    </rdf:Description>
-                                                </rdf:rest>
-                                            </rdf:Description>
-                                        </rdf:rest>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#conversionDirection -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#conversionDirection">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">This property represents the direction of the reaction. If a reaction is fundamentally irreversible, then it will run in a single direction under all contexts. Otherwise it is reversible.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">LEFT-TO-RIGHT</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">REVERSIBLE</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">RIGHT-TO-LEFT</rdf:first>
-                                        <rdf:rest rdf:resource="&rdf;nil"/>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#db -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#db">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The name of the external database to which this xref refers.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#dbVersion -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#dbVersion">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The version of the external database in which this xref was last known to be valid. Resources may have recommendations for referencing dataset versions. For instance, the Gene Ontology recommends listing the date the GO terms were downloaded.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#deltaGPrime0 -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#deltaGPrime0">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">For biochemical reactions, this property refers to the standard transformed Gibbs energy change for a reaction written in terms of biochemical reactants (sums of species), delta-G&apos;&lt;sup&gt;o&lt;/sup&gt;.
-
-  delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; = -RT lnK&apos;
-and
-  delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; = delta-H&apos;&lt;sup&gt;o&lt;/sup&gt; - T delta-S&apos;&lt;sup&gt;o&lt;/sup&gt;
-
-delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; has units of kJ/mol.  Like K&apos;, it is a function of temperature (T), ionic strength (I), pH, and pMg (pMg = -log&lt;sub&gt;10&lt;/sub&gt;[Mg&lt;sup&gt;2+&lt;/sup&gt;]). Therefore, these quantities must be specified, and values for DELTA-G for biochemical reactions are represented as 5-tuples of the form (delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; T I pH pMg).
-
-(This definition from EcoCyc)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#deltaH -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#deltaH">
-        <rdfs:comment rdf:datatype="&xsd;string">For biochemical reactions, this property refers to the standard transformed enthalpy change for a reaction written in terms of biochemical reactants (sums of species), delta-H&apos;&lt;sup&gt;o&lt;/sup&gt;.
-
-  delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; = delta-H&apos;&lt;sup&gt;o&lt;/sup&gt; - T delta-S&apos;&lt;sup&gt;o&lt;/sup&gt;
-
-Units: kJ/mole
-
-(This definition from EcoCyc)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#deltaS -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#deltaS">
-        <rdfs:comment rdf:datatype="&xsd;string">For biochemical reactions, this property refers to the standard transformed entropy change for a reaction written in terms of biochemical reactants (sums of species), delta-S&apos;&lt;sup&gt;o&lt;/sup&gt;.
-
-  delta-G&apos;&lt;sup&gt;o&lt;/sup&gt; = delta-H&apos;&lt;sup&gt;o&lt;/sup&gt; - T delta-S&apos;&lt;sup&gt;o&lt;/sup&gt;
-
-(This definition from EcoCyc)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#displayName -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#displayName">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">An abbreviated name for this entity, preferably a name that is short enough to be used in a visualization application to label a graphical element that represents this entity. If no short name is available, an xref may be used for this purpose by the visualization application.</rdfs:comment>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#name"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#eCNumber -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#eCNumber">
-        <rdfs:comment rdf:datatype="&xsd;string">The unique number assigned to a reaction by the Enzyme Commission of the International Union of Biochemistry and Molecular Biology.
-
-Note that not all biochemical reactions currently have EC numbers assigned to them.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#id -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#id">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The primary identifier in the external database of the object to which this xref refers.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#idVersion -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#idVersion">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The version number of the identifier (ID). E.g. The RefSeq accession number NM_005228.3 should be split into NM_005228 as the ID and 3 as the ID-VERSION.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#intraMolecular -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#intraMolecular">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">This flag represents whether the binding feature is within the same molecule or not.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-        <rdfs:range rdf:resource="&xsd;boolean"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ionicStrength -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#ionicStrength">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The ionic strength is defined as half of the total sum of the concentration (ci) of every ionic species (i) in the solution times the square of its charge (zi). For example, the ionic strength of a 0.1 M solution of CaCl2 is 0.5 x (0.1 x 22 + 0.2 x 12) = 0.3 M
-(Definition from http://www.lsbu.ac.uk/biology/enztech/ph.html)</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;float"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#kPrime -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#kPrime">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The apparent equilibrium constant K&apos;. Concentrations in the equilibrium constant equation refer to the total concentrations of  all forms of particular biochemical reactants. For example, in the equilibrium constant equation for the biochemical reaction in which ATP is hydrolyzed to ADP and inorganic phosphate:
-
-K&apos; = [ADP][P&lt;sub&gt;i&lt;/sub&gt;]/[ATP],
-
-The concentration of ATP refers to the total concentration of all of the following species:
-
-[ATP] = [ATP&lt;sup&gt;4-&lt;/sup&gt;] + [HATP&lt;sup&gt;3-&lt;/sup&gt;] + [H&lt;sub&gt;2&lt;/sub&gt;ATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgHATP&lt;sup&gt;-&lt;/sup&gt;] + [Mg&lt;sub&gt;2&lt;/sub&gt;ATP].
-
-The apparent equilibrium constant is formally dimensionless, and can be kept so by inclusion of as many of the terms (1 mol/dm&lt;sup&gt;3&lt;/sup&gt;) in the numerator or denominator as necessary.  It is a function of temperature (T), ionic strength (I), pH, and pMg (pMg = -log&lt;sub&gt;10&lt;/sub&gt;[Mg&lt;sup&gt;2+&lt;/sup&gt;]).
-(Definition from EcoCyc)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#molecularWeight -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#molecularWeight">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">Defines the molecular weight of the molecule, in daltons.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#name -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#name">
-        <rdfs:comment xml:lang="en">One or more synonyms for the name of this individual. This should include the values of the standardName and displayName property so that it is easy to find all known names in one place.</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;string"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#BioSource"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#pMg -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#pMg">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A measure of the concentration of magnesium (Mg) in solution. (pMg = -log&lt;sub&gt;10&lt;/sub&gt;[Mg&lt;sup&gt;2+&lt;/sup&gt;])</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;float"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#patoData -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#patoData">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The phenotype data from PATO, formatted as PhenoXML (defined at http://www.fruitfly.org/~cjm/obd/formats.html)</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ph -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#ph">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A measure of acidity and alkalinity of a solution that is a number on a scale on which a value of 7 represents neutrality and lower numbers indicate increasing acidity and higher numbers increasing alkalinity and on which each unit of change represents a tenfold change in acidity or alkalinity and that is the negative logarithm of the effective hydrogen-ion concentration or hydrogen-ion activity in gram equivalents per liter of the solution. (Definition from Merriam-Webster Dictionary)</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;float"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#positionStatus -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#positionStatus">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The confidence status of the sequence position. This could be:
-EQUAL: The SEQUENCE-POSITION is known to be at the SEQUENCE-POSITION.
-GREATER-THAN: The site is greater than the SEQUENCE-POSITION.
-LESS-THAN: The site is less than the SEQUENCE-POSITION.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceSite"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">EQUAL</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">GREATER-THAN</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">LESS-THAN</rdf:first>
-                                        <rdf:rest rdf:resource="&rdf;nil"/>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#sequence -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#sequence">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">Polymer sequence in uppercase letters. For DNA, usually A,C,G,T letters representing the nucleosides of adenine, cytosine, guanine and thymine, respectively; for RNA, usually A, C, U, G; for protein, usually the letters corresponding to the 20 letter IUPAC amino acid code.</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;string"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#sequencePosition -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#sequencePosition">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The integer listed gives the position. The first base or amino acid is position 1. In combination with the numeric value, the property &apos;POSITION-STATUS&apos; allows to express fuzzy positions, e.g. &apos;less than 4&apos;.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceSite"/>
-        <rdfs:range rdf:resource="&xsd;int"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#source -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#source">
-        <rdfs:comment rdf:datatype="&xsd;string">The source  in which the reference was published, such as: a book title, or a journal title and volume and pages.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#spontaneous -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#spontaneous">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Specifies whether a conversion occurs spontaneously or not. If the spontaneity is not known, the SPONTANEOUS property should be left empty.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:range rdf:resource="&xsd;boolean"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#standardName -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#standardName">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The preferred full name for this entity.</rdfs:comment>
-        <rdfs:subPropertyOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#name"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#stepDirection -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#stepDirection">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Direction of the conversion in this particular pathway context. 
-This property can be used for annotating direction of enzymatic activity. Even if an enzyme catalyzes a reaction reversibly, the flow of matter through the pathway will force the equilibrium in a given direction for that particular pathway.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalPathwayStep"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">LEFT-TO-RIGHT</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">REVERSIBLE</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">RIGHT-TO-LEFT</rdf:first>
-                                        <rdf:rest rdf:resource="&rdf;nil"/>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#stoichiometricCoefficient -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#stoichiometricCoefficient">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Stoichiometric coefficient for one of the entities in an interaction or complex. This value can be any rational number. Generic values such as &quot;n&quot; or &quot;n+1&quot; should not be used - polymers are currently not covered.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <rdfs:range rdf:resource="&xsd;float"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#structureData -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#structureData">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">This property holds a string of data defining chemical structure or other information, in either the CML or SMILES format, as specified in property Structure-Format. If, for example, the CML format is used, then the value of this property is a string containing the XML encoding of the CML data.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#structureFormat -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#structureFormat">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">This property specifies which format is used to define chemical structure data.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">CML</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">InChI</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">SMILES</rdf:first>
-                                        <rdf:rest rdf:resource="&rdf;nil"/>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#temperature -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#temperature">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Temperature in Celsius</rdfs:comment>
-        <rdfs:range rdf:resource="&xsd;float"/>
-        <rdfs:domain>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-                    <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:domain>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#templateDirection -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#templateDirection">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The direction of the template reaction on the template.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-        <rdfs:range>
-            <rdfs:Datatype>
-                <owl:oneOf>
-                    <rdf:Description>
-                        <rdf:type rdf:resource="&rdf;List"/>
-                        <rdf:first rdf:datatype="&xsd;string">FORWARD</rdf:first>
-                        <rdf:rest>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">REVERSE</rdf:first>
-                                <rdf:rest rdf:resource="&rdf;nil"/>
-                            </rdf:Description>
-                        </rdf:rest>
-                    </rdf:Description>
-                </owl:oneOf>
-            </rdfs:Datatype>
-        </rdfs:range>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#term -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#term">
-        <rdfs:comment rdf:datatype="&xsd;string">The external controlled vocabulary term.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#title -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#title">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The title of the publication.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#url -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#url">
-        <rdfs:comment xml:lang="en">The URL at which the publication can be found, if it is available through the Web.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#value -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#value">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment rdf:datatype="&xsd;string">The value of the score.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <rdfs:range rdf:resource="&xsd;string"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#year -->
-
-    <owl:DatatypeProperty rdf:about="http://www.biopax.org/release/biopax-level3.owl#year">
-        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
-        <rdfs:comment xml:lang="en">The year in which this publication was published.</rdfs:comment>
-        <rdfs:domain rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-        <rdfs:range rdf:resource="&xsd;int"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Classes
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#BindingFeature -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#BindingFeature">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#FragmentFeature"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition : An entity feature that represent the bound state of a physical entity. A pair of binding features represents a bond. 
-
-Rationale: A physical entity in a molecular complex is considered as a new state of an entity as it is structurally and functionally different. Binding features provide facilities for describing these states. Similar to other features, a molecule can have bound and not-bound states. 
-
-Usage: Typically, binding features are present in pairs, each describing the binding characteristic for one of the interacting physical entities. One exception is using a binding feature with no paired feature to describe any potential binding. For example, an unbound receptor can be described by using a &quot;not-feature&quot; property with an unpaired binding feature as its value.  BindingSiteType and featureLocation allows annotating the binding location.
-
-IntraMolecular property should be set to &quot;true&quot; if the bond links two parts of the same molecule. A pair of binding features are still used where they are owned by the same physical entity. 
-
-If the binding is due to the covalent interactions, for example in the case of lipoproteins, CovalentBindingFeature subclass should be used instead of this class.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#BioSource -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#BioSource">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The biological source (organism, tissue or cell type) of an Entity. 
-
-Usage: Some entities are considered source-neutral (e.g. small molecules), and the biological source of others can be deduced from their constituentss (e.g. complex, pathway).
-
-Instances: HeLa cells, Homo sapiens, and mouse liver tissue.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#BiochemicalPathwayStep -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#BiochemicalPathwayStep">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#stepProcess"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Imposes ordering on a step in a biochemical pathway. 
-Retionale: A biochemical reaction can be reversible by itself, but can be physiologically directed in the context of a pathway, for instance due to flux of reactants and products. 
-Usage: Only one conversion interaction can be ordered at a time, but multiple catalysis or modulation instances can be part of one step.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ComplexAssembly"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Degradation"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A conversion in which molecules of one or more physicalEntity pools, undergo covalent modifications and become a member of one or more other physicalEntity pools. The substrates of biochemical reactions are defined in terms of sums of species. This is a convention in biochemistry, and, in principle, all EC reactions should be biochemical reactions.
-
-Examples: ATP + H2O = ADP + Pi
-
-Comment: In the example reaction above, ATP is considered to be an equilibrium mixture of several species, namely ATP4-, HATP3-, H2ATP2-, MgATP2-, MgHATP-, and Mg2ATP. Additional species may also need to be considered if other ions (e.g. Ca2+) that bind ATP are present. Similar considerations apply to ADP and to inorganic phosphate (Pi). When writing biochemical reactions, it is not necessary to attach charges to the biochemical reactants or to include ions such as H+ and Mg2+ in the equation. The reaction is written in the direction specified by the EC nomenclature system, if applicable, regardless of the physiological direction(s) in which the reaction proceeds. Polymerization reactions involving large polymers whose structure is not explicitly captured should generally be represented as unbalanced reactions in which the monomer is consumed but the polymer remains unchanged, e.g. glycogen + glucose = glycogen. A better coverage for polymerization will be developed.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Catalysis -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Catalysis">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controlled"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controlType"/>
-                <owl:hasValue rdf:datatype="&xsd;string">ACTIVATION</owl:hasValue>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Modulation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReactionRegulation"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A control interaction in which a physical entity (a catalyst) increases the rate of a conversion interaction by lowering its activation energy. Instances of this class describe a pairing between a catalyzing entity and a catalyzed conversion.
-Rationale: Catalysis, theoretically, is always bidirectional since it acts by lowering the activation energy. Physiologically, however, it can have a direction because of the concentration of the participants. For example, the oxidative decarboxylation catalyzed by Isocitrate dehydrogenase always happens in one direction under physiological conditions since the produced carbon dioxide is constantly removed from the system.
-   
-Usage: A separate catalysis instance should be created for each different conversion that a physicalEntity may catalyze and for each different physicalEntity that may catalyze a conversion. For example, a bifunctional enzyme that catalyzes two different biochemical reactions would be linked to each of those biochemical reactions by two separate instances of the catalysis class. Also, catalysis reactions from multiple different organisms could be linked to the same generic biochemical reaction (a biochemical reaction is generic if it only includes small molecules). Generally, the enzyme catalyzing a conversion is known and the use of this class is obvious, however, in the cases where a catalyzed reaction is known to occur but the enzyme is not known, a catalysis instance can be created without a controller specified.
-Synonyms: facilitation, acceleration.
-Examples: The catalysis of a biochemical reaction by an enzyme, the enabling of a transport interaction by a membrane pore complex, and the facilitation of a complex assembly by a scaffold protein. Hexokinase -&gt; (The &quot;Glucose + ATP -&gt; Glucose-6-phosphate +ADP&quot; reaction). A plasma membrane Na+/K+ ATPase is an active transporter (antiport pump) using the energy of ATP to pump Na+ out of the cell and K+ in. Na+ from cytoplasm to extracellular space would be described in a transport instance. K+ from extracellular space to cytoplasm would be described in a transport instance. The ATPase pump would be stored in a catalysis instance controlling each of the above transport instances. A biochemical reaction that does not occur by itself under physiological conditions, but has been observed to occur in the presence of cell extract, likely via one or more unknown enzymes present in the extract, would be stored in the CONTROLLED property, with the CONTROLLER property empty.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#CellVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#CellVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#CellularLocationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReferenceTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the Cell Type Ontology (CL). Homepage at http://obofoundry.org/cgi-bin/detail.cgi?cell.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=CL</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#CellularLocationVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#CellularLocationVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReferenceTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the Gene Ontology Cellular Component (GO CC) ontology. Homepage at http://www.geneontology.org.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=GO</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ChemicalStructure">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#structureData"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#structureFormat"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The chemical structure of a small molecule. 
-
-Usage: Structure information is stored in the property structureData, in one of three formats: the CML format (see URL www.xml-cml.org), the SMILES format (see URL www.daylight.com/dayhtml/smiles/) or the InChI format (http://www.iupac.org/inchi/). The structureFormat property specifies which format is used.
-
-Examples: The following SMILES string describes the structure of glucose-6-phosphate:
-&apos;C(OP(=O)(O)O)[CH]1([CH](O)[CH](O)[CH](O)[CH](O)O1)&apos;.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Complex -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Complex">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Complex"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Dna"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A physical entity whose structure is comprised of other physical entities bound to each other covalently or non-covalently, at least one of which is a macromolecule (e.g. protein, DNA, or RNA) and the Stoichiometry of the components are known. 
-
-Comment: Complexes must be stable enough to function as a biological unit; in general, the temporary association of an enzyme with its substrate(s) should not be considered or represented as a complex. A complex is the physical product of an interaction (complexAssembly) and is not itself considered an interaction.
-The boundaries on the size of complexes described by this class are not defined here, although possible, elements of the cell  such a mitochondria would typically not be described using this class (later versions of this ontology may include a cellularComponent class to represent these). The strength of binding cannot be described currently, but may be included in future versions of the ontology, depending on community need.
-Examples: Ribosome, RNA polymerase II. Other examples of this class include complexes of multiple protein monomers and complexes of proteins and small molecules.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ComplexAssembly -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ComplexAssembly">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Degradation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Transport"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A conversion interaction in which a set of physical entities, at least one being a macromolecule (e.g. protein, RNA, DNA), aggregate to from a complex physicalEntity. One of the participants of a complexAssembly must be an instance of the class Complex. The modification of the physicalentities involved in the ComplexAssembly is captured via BindingFeature class.
-
-Usage: This class is also used to represent complex disassembly. The assembly or disassembly of a complex is often a spontaneous process, in which case the direction of the complexAssembly (toward either assembly or disassembly) should be specified via the SPONTANEOUS property. Conversions in which participants obtain or lose CovalentBindingFeatures ( e.g. glycolysation of proteins) should be modeled with BiochemicalReaction.
-
-Synonyms: aggregation, complex formation
-
-Examples: Assembly of the TFB2 and TFB3 proteins into the TFIIH complex, and assembly of the ribosome through aggregation of its subunits.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Control -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Control">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#MolecularInteraction"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An interaction in which one entity regulates, modifies, or otherwise influences a continuant entity, i.e. pathway or interaction. 
-
-Usage: Conceptually, physical entities are involved in interactions (or events) and the events are controlled or modified, not the physical entities themselves. For example, a kinase activating a protein is a frequent event in signaling pathways and is usually represented as an &apos;activation&apos; arrow from the kinase to the substrate in signaling diagrams. This is an abstraction, called &quot;Activity Flow&quot; representation,  that can be ambiguous without context. In BioPAX, this information should be captured as the kinase catalyzing (via an instance of the catalysis class) a Biochemical Reaction in which the substrate is phosphorylated. 
-Subclasses of control define types specific to the biological process that is being controlled and should be used instead of the generic &quot;control&quot; class when applicable. 
-
-A control can potentially have multiple controllers. This acts as a logical AND, i.e. both controllers are needed to regulate the  controlled event. Alternatively multiple controllers can control the same event and this acts as a logical OR, i.e. any one of them is sufficient to regulate the controlled event. Using this structure it is possible to describe arbitrary control logic using BioPAX.
-
-Rationale: Control can be temporally non-atomic, for example a pathway can control another pathway in BioPAX.  
-Synonyms: regulation, mediation
-
-Examples: A small molecule that inhibits a pathway by an unknown mechanism.</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.7</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#xref"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UnificationXref"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DeltaG"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Used to reference terms from external controlled vocabularies (CVs) from the ontology. To support consistency and compatibility, open, freely available CVs should be used whenever possible, such as the Gene Ontology (GO)15 or other open biological CVs listed on the OBO website (http://obo.sourceforge.net/). See the section on controlled vocabularies in Section 4 for more information.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Conversion -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Conversion">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An interaction in which molecules of one or more physicalEntity pools are physically transformed and become a member of one or more other physicalEntity pools.
-
-Comments: Conversions in BioPAX are stoichiometric and closed world, i.e. it is assumed that all of the participants are listed. Both properties are due to the law of mass conservation. 
-
-Usage: Subclasses of conversion represent different types of transformation reflected by the properties of different physicalEntity. BiochemicalReactions will change the ModificationFeatures on a PhysicalEntity , Transport will change the CellularLocation and ComplexAssembly will change BindingFeatures. Generic Conversion class should only be used when the modification does not fit into one of these classes. 
-
-Example: Opening of a voltage gated channel.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#CovalentBindingFeature -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#CovalentBindingFeature">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ModificationFeature"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition : An entity feature that represent the covalently bound state of  a physical entity. 
-
-Rationale: Most frequent covalent modifications to proteins and DNA, such as phosphorylation and metylation are covered by the ModificationFeature class. In these cases, the added groups are simple and stateless therefore they can be captured by a controlled vocabulary. In other cases, such as ThiS-Thilacyl-disulfide, the covalently linked molecules are best represented as a molecular complex. CovalentBindingFeature should be used to model such covalently linked complexes.
-
-Usage: Using this construct, it is possible to represent small molecules as a covalent complex of two other small molecules. The demarcation of small molecules is a general problem and is delegated to small molecule databases.The best practice is not to model using covalent complexes unless at least one of the participants is a protein, DNA or RNA.
-
-Examples:
-disulfide bond
-UhpC + glc-6P -&gt; Uhpc-glc-6p
-acetyl-ACP -&gt; decenoyl-ACP
-charged tRNA</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Degradation -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Degradation">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#conversionDirection"/>
-                <owl:hasValue rdf:datatype="&xsd;string">LEFT-TO-RIGHT</owl:hasValue>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Transport"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A conversion in which a pool of macromolecules are degraded into their elementary units.
-
-Usage: This conversion always has a direction of left-to-right and is irreversible. Degraded molecules are always represented on the left, degradation products on the right. 
-
-Comments: Degradation is a complex abstraction over multiple reactions. Although it obeys law of mass conservation and stoichiometric, the products are rarely specified since they are ubiquitous.
-
-Example:  Degradation of a protein to amino acids.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#DeltaG -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#DeltaG">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#deltaGPrime0"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Standard transformed Gibbs energy change for a reaction written in terms of biochemical reactants.  
-Usage: Delta-G is represented as a 5-tuple of delta-G&apos;&lt;sup&gt;0&lt;/sup&gt;, temperature, ionic strength , pH, and pMg . A conversion in BioPAX may have multiple Delta-G values, representing different measurements for delta-G&apos;&lt;sup&gt;0&lt;/sup&gt; obtained under the different experimental conditions.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Dna -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Dna">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Dna"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A physical entity consisting of a sequence of deoxyribonucleotide monophosphates; a deoxyribonucleic acid.
-Usage: DNA should be used for pools of individual DNA molecules. For describing subregions on those molecules use DNARegion.
-Examples: a chromosome, a plasmid. A specific example is chromosome 7 of Homo sapiens.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#DnaReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberEntityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#subRegion"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A DNA reference is a grouping of several DNA entities that are common in sequence.  Members can differ in celular location, sequence features, SNPs, mutations and bound partners.
-
-Comments : Note that this is not a reference gene. Genes are non-physical,stateless continuants. Their physical manifestations can span multiple DNA molecules, sometimes even across chromosomes due to regulatory regions. Similarly a gene is not necessarily made up of deoxyribonucleic acid and can be present in multiple copies ( which are different DNA regions).</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#DnaRegion -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegion">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegion"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A region on a DNA molecule. 
-Usage:  DNARegion is not a pool of independent molecules but a subregion on these molecules. As such, every DNARegion has a defining DNA molecule.  
-Examples: Protein encoding region, promoter</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#subRegion"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#DnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A DNARegionReference is a grouping of several DNARegion entities that are common in sequence and genomic position.  Members can differ in cellular location, sequence features, SNPs, mutations and bound partners.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Entity -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Entity">
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A discrete biological unit used when describing pathways. 
-
-Rationale: Entity is the most abstract class for representing interacting 
-    elements in a pathway. It includes both occurents (interactions and 
-    pathways) and continuants (physical entities and genes). Loosely speaking, 
-    BioPAX Entity is an atomic scientific statement with an associated source, 
-    evidence and references. 
-Synonyms: element, thing, object, bioentity, statement.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#EntityFeature -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityFeature">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Description: A characteristic of a physical entity that can change while the entity still retains its biological identity. 
-
-Rationale: Two phosphorylated forms of a protein are strictly speaking different chemical  molecules. It is, however, standard in biology to treat them as different states of the same entity, where the entity is loosely defined based on sequence. Entity Feature class and its subclassses captures these variable characteristics. A Physical Entity in BioPAX represents a pool of  molecules rather than an individual molecule. This is a notion imported from chemistry( See PhysicalEntity). Pools are defined by a set of Entity Features in the sense that a single molecule must have all of the features in the set in order to be considered a member of the pool. Since it is impossible to list and experimentally test all potential features for an  entity, features that are not listed in the selection criteria is neglected Pools can also be defined by the converse by specifying features  that are known to NOT exist in a specific context. As DNA, RNA and Proteins can be hierarchicaly organized into families based on sequence homology so can entity features. The memberFeature property allows capturing such hierarchical classifications among entity features.
-
-
-Usage: Subclasses of entity feature describe most common biological instances and should be preferred whenever possible. One common usecase for instantiating  entity feature is, for describing active/inactive states of proteins where more specific feature information is not available.  
-
-Examples: Open/close conformational state of channel proteins, &quot;active&quot;/&quot;inactive&quot; states, excited states of photoreactive groups.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#EntityReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Evidence"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An entity reference is a grouping of several physical entities across different contexts and molecular states, that share common physical properties and often named and treated as a single entity with multiple states by biologists. 
-
-Rationale:   Many protein, small molecule and gene databases share this point of view, and such a grouping is an important prerequisite for interoperability with those databases. Biologists would often group different pools of molecules in different contexts under the same name. For example cytoplasmic and extracellular calcium have different effects on the cell&apos;s behavior, but they are still called calcium. For DNA, RNA and Proteins the grouping is defined based on a wildtype sequence, for small molecules it is defined by the chemical structure.
-
-Usage: Entity references store the information common to a set of molecules in various states described in the BioPAX document, including database cross-references. For instance, the P53 protein can be phosphorylated in multiple different ways. Each separate P53 protein (pool) in a phosphorylation state would be represented as a different protein (child of physicalEntity) and all things common to all P53 proteins, including all possible phosphorylation sites, the sequence common to all of them and common references to protein databases containing more information about P53 would be stored in a Entity Reference.  
-
-Comments: This grouping has three semantic implications:
-
-1.  Members of different pools share many physical and biochemical properties. This includes their chemical structure, sequence, organism and set of molecules they react with. They will also share a lot of secondary information such as their names, functional groupings, annotation terms and database identifiers.
-
-2. A small number of transitions seperates these pools. In other words it is relatively easy and frequent for a molecule to transform from one physical entity to another that belong to the same reference entity. For example an extracellular calcium can become cytoplasmic, and p53 can become phosphorylated. However no calcium virtually becomes sodium, or no p53 becomes mdm2. In the former it is the sheer energy barrier of a nuclear reaction, in the latter sheer statistical improbability of synthesizing the same sequence without a template. If one thinks about the biochemical network as molecules transforming into each other, and remove edges that respond to transcription, translation, degradation and covalent modification of small molecules, each remaining component is a reference entity.
-
-3. Some of the pools in the same group can overlap. p53-p@ser15 can overlap with p53-p@thr18. Most of the experiments in molecular biology will only check for one state variable, rarely multiple, and never for the all possible combinations. So almost all statements that refer to the state of the molecule talk about a pool that can overlap with other pools. However no overlaps is possible between molecules of different groups.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#EntityReferenceTypeVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#EntityReferenceTypeVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definiiton: A reference to a term from an entity reference group ontology. As of the writing of this documentation, there is no standard ontology of these terms, though a common type is ‘homology’.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Evidence -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Evidence">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Class>
-                <owl:unionOf rdf:parseType="Collection">
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#confidence"/>
-                        <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
-                    </owl:Restriction>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#evidenceCode"/>
-                        <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
-                    </owl:Restriction>
-                    <owl:Restriction>
-                        <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#experimentalForm"/>
-                        <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
-                    </owl:Restriction>
-                </owl:unionOf>
-            </owl:Class>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The support for a particular assertion, such as the existence of an interaction or pathway. 
-Usage: At least one of confidence, evidenceCode, or experimentalForm must be instantiated when creating an evidence instance. XREF may reference a publication describing the experimental evidence using a publicationXref or may store a description of the experiment in an experimental description database using a unificationXref (if the referenced experiment is the same) or relationshipXref (if it is not identical, but similar in some way e.g. similar in protocol). Evidence is meant to provide more information than just an xref to the source paper.
-Examples: A description of a molecular binding assay that was used to detect a protein-protein interaction.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#EvidenceCodeVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the PSI Molecular Interaction ontology (MI) experimental method types, including &quot;interaction detection method&quot;, &quot;participant identification method&quot;, &quot;feature detection method&quot;. Homepage at http://www.psidev.info/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI
-
-Terms from the Pathway Tools Evidence Ontology may also be used. Homepage http://brg.ai.sri.com/evidence-ontology/</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ExperimentalForm">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#experimentalFormDescription"/>
-                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#KPrime"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The form of a physical entity in a particular experiment, as it may be modified for purposes of experimental design.
-Examples: A His-tagged protein in a binding assay. A protein can be tagged by multiple tags, so can have more than 1 experimental form type terms</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ExperimentalFormVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the PSI Molecular Interaction ontology (MI) participant identification method (e.g. mass spectrometry), experimental role (e.g. bait, prey), experimental preparation (e.g. expression level) type. Homepage at http://www.psidev.info/.  Browse http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0002&amp;termName=participant%20identification%20method
-
-http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0495&amp;termName=experimental%20role
-
-http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0346&amp;termName=experimental%20preparation</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#FragmentFeature -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#FragmentFeature">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ModificationFeature"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An entity feature that represents the resulting physical entity subsequent to a cleavage or degradation event. 
-
-Usage: Fragment Feature can be used to cover multiple types of modfications to the sequence of the physical entity: 
-1.    A protein with a single cleavage site that converts the protein into two fragments (e.g. pro-insulin converted to insulin and C-peptide). TODO: CV term for sequence fragment?  PSI-MI CV term for cleavage site?
-2.    A protein with two cleavage sites that removes an internal sequence e.g. an intein i.e. ABC -&gt; A
-3.    Cleavage of a circular sequence e.g. a plasmid.
-
-In the case of removal ( e.g. intron)  the fragment that is *removed* is specified in the feature location property. In the case of a &quot;cut&quot; (e.g. restriction enzyme cut site) the location of the cut is specified instead.
-Examples: Insulin Hormone</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Gene -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Gene">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#organism"/>
-                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A continuant that encodes information that can be inherited through replication. 
-Rationale: Gene is an abstract continuant that can be best described as a &quot;schema&quot;, a common conception commonly used by biologists to demark a component within genome. In BioPAX, Gene is considered a generalization over eukaryotic and prokaryotic genes and is used only in genetic interactions.  Gene is often confused with DNA and RNA fragments, however, these are considered the physical encoding of a gene.  N.B. Gene expression regulation makes use of DNA and RNA physical entities and not this class.
-Usage: Gene should only be used for describing GeneticInteractions.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#interactionType"/>
-                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#phenotype"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Gene"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:minCardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#MolecularInteraction"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition : Genetic interactions between genes occur when two genetic perturbations (e.g. mutations) have a combined phenotypic effect not caused by either perturbation alone. A gene participant in a genetic interaction represents the gene that is perturbed. Genetic interactions are not physical interactions but logical (AND) relationships. Their physical manifestations can be complex and span an arbitarily long duration. 
-
-Rationale: Currently,  BioPAX provides a simple definition that can capture most genetic interactions described in the literature. In the future, if required, the definition can be extended to capture other logical relationships and different, participant specific phenotypes. 
-
-Example: A synthetic lethal interaction occurs when cell growth is possible without either gene A OR B, but not without both gene A AND B. If you knock out A and B together, the cell will die.</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.7</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#GeneticInteraction"/>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Interaction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Interaction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A biological relationship between two or more entities. 
-
-Rationale: In BioPAX, interactions are atomic from a database modeling perspective, i.e. interactions can not be decomposed into sub-interactions. When representing non-atomic continuants with explicit subevents the pathway class should be used instead. Interactions are not necessarily  temporally atomic, for example genetic interactions cover a large span of time. Interactions as a formal concept is a continuant, it retains its identitiy regardless of time, or any differences in specific states or properties.
-
-Usage: Interaction is a highly abstract class and in almost all cases it is more appropriate to use one of the subclasses of interaction. 
-It is partially possible to define generic reactions by using generic participants. A more comprehensive method is planned for BioPAX L4 for covering all generic cases like oxidization of a generic alcohol.   
-
-Synonyms: Process, relationship, event.
-
-Examples: protein-protein interaction, biochemical reaction, enzyme catalysis</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.89</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <owl:annotatedProperty rdf:resource="&owl;disjointWith"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#InteractionVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the PSI Molecular Interaction ontology (MI) interaction type. Homepage at http://www.psidev.info/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0190&amp;termName=interaction%20type</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#KPrime -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#KPrime">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#kPrime"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PathwayStep"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The apparent equilibrium constant, K&apos;, and associated values. 
-Usage: Concentrations in the equilibrium constant equation refer to the total concentrations of  all forms of particular biochemical reactants. For example, in the equilibrium constant equation for the biochemical reaction in which ATP is hydrolyzed to ADP and inorganic phosphate:
-
-K&apos; = [ADP][P&lt;sub&gt;i&lt;/sub&gt;]/[ATP],
-
-The concentration of ATP refers to the total concentration of all of the following species:
-
-[ATP] = [ATP&lt;sup&gt;4-&lt;/sup&gt;] + [HATP&lt;sup&gt;3-&lt;/sup&gt;] + [H&lt;sub&gt;2&lt;/sub&gt;ATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgATP&lt;sup&gt;2-&lt;/sup&gt;] + [MgHATP&lt;sup&gt;-&lt;/sup&gt;] + [Mg&lt;sub&gt;2&lt;/sub&gt;ATP].
-
-The apparent equilibrium constant is formally dimensionless, and can be kept so by inclusion of as many of the terms (1 mol/dm&lt;sup&gt;3&lt;/sup&gt;) in the numerator or denominator as necessary.  It is a function of temperature (T), ionic strength (I), pH, and pMg (pMg = -log&lt;sub&gt;10&lt;/sub&gt;[Mg&lt;sup&gt;2+&lt;/sup&gt;]). Therefore, these quantities must be specified to be precise, and values for KEQ for biochemical reactions may be represented as 5-tuples of the form (K&apos; T I pH pMg).  This property may have multiple values, representing different measurements for K&apos; obtained under the different experimental conditions listed in the 5-tuple. (This definition adapted from EcoCyc)
-
-See http://www.chem.qmul.ac.uk/iubmb/thermod/ for a thermodynamics tutorial.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ModificationFeature -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ModificationFeature">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityFeature"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An entity feature that represents  the covalently modified state of a dna, rna or a protein. 
-
-Rationale: In Biology, identity of DNA, RNA and Protein entities are defined around a wildtype sequence. Covalent modifications to this basal sequence are represented using modificaton features. Since small molecules are identified based on their chemical structure, not sequence, a covalent modification to a small molecule would result in a different molecule. 
-
-Usage: The added groups should be simple and stateless, such as phosphate or methyl groups and are captured by the modificationType controlled vocabulary. In other cases, such as covalently linked proteins, use CovalentBindingFeature instead. 
-
-Instances: A phosphorylation on a protein, a methylation on a DNA.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Modulation -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Modulation">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controller"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controlled"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Catalysis"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReactionRegulation"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A control interaction in which a physical entity modulates a catalysis interaction. 
-
-Rationale: Biologically, most modulation interactions describe an interaction in which a small molecule alters the ability of an enzyme to catalyze a specific reaction. Instances of this class describe a pairing between a modulating entity and a catalysis interaction.
-
-Usage:  A typical modulation instance has a small molecule as the controller entity and a catalysis instance as the controlled entity. A separate modulation instance should be created for each different catalysis instance that a physical entity may modulate, and for each different physical entity that may modulate a catalysis instance.
-Examples: Allosteric activation and competitive inhibition of an enzyme&apos;s ability to catalyze a specific reaction.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#MolecularInteraction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#MolecularInteraction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An interaction in which participants bind physically to each other, directly or indirectly through intermediary molecules.
-
-Rationale: There is a large body of interaction data, mostly produced by high throughput systems, that does not satisfy the level of detail required to model them with ComplexAssembly class. Specifically, what is lacking is the stoichiometric information and completeness (closed-world) of participants required to model them as chemical processes. Nevertheless interaction data is extremely useful and can be captured in BioPAX using this class. 
- 
-Usage: This class should be used by default for representing molecular interactions such as those defined by PSI-MI level 2.5. The participants in a molecular interaction should be listed in the PARTICIPANT slot. Note that this is one of the few cases in which the PARTICPANT slot should be directly populated with instances (see comments on the PARTICPANTS property in the interaction class description). If all participants are known with exact stoichiometry, ComplexAssembly class should be used instead.
-
-Example: Two proteins observed to interact in a yeast-two-hybrid experiment where there is not enough experimental evidence to suggest that the proteins are forming a complex by themselves without any indirect involvement of other proteins. This is the case for most large-scale yeast two-hybrid screens.</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.2</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#MolecularInteraction"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-        <owl:annotatedTarget>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </owl:annotatedTarget>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Pathway -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Pathway">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A set or series of interactions, often forming a network, which biologists have found useful to group together for organizational, historic, biophysical or other reasons.
-
-Usage: Pathways can be used for demarcating any subnetwork of a BioPAX model. It is also possible to define a pathway without specifying the interactions within the pathway. In this case, the pathway instance could consist simply of a name and could be treated as a &apos;black box&apos;.  Pathways can also soverlap, i.e. a single interaction might belong to multiple pathways. Pathways can also contain sub-pathways. Pathways are continuants.
-
-Synonyms: network, module, cascade,  
-Examples: glycolysis, valine biosynthesis, EGFR signaling</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.89</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <owl:annotatedProperty rdf:resource="&owl;disjointWith"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Pathway"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#PathwayStep -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#PathwayStep">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Provenance"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A step in an ordered pathway.
-Rationale: Some pathways can have a temporal order. For example,  if the pathway boundaries are based on a perturbation phenotype link, the pathway might start with the perturbing agent and end at gene expression leading to the observed changes. Pathway steps can represent directed compound graphs.
-Usage: Multiple interactions may occur in a pathway step, each should be listed in the stepProcess property. Order relationships between pathway steps may be established with the nextStep slot. If the reaction contained in the step is a reversible biochemical reaction but physiologically has a direction in the context of this pathway, use the subclass BiochemicalPathwayStep.
-
-Example: A metabolic pathway may contain a pathway step composed of one biochemical reaction (BR1) and one catalysis (CAT1) instance, where CAT1 describes the catalysis of BR1. The M phase of the cell cycle, defined as a pathway, precedes the G1 phase, also defined as a pathway.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#PhenotypeVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The phenotype measured in the experiment e.g. growth rate or viability of a cell. This is only the type, not the value e.g. for a synthetic lethal interaction, the phenotype is viability, specified by ID: PATO:0000169, &quot;viability&quot;, not the value (specified by ID: PATO:0000718, &quot;lethal (sensu genetics)&quot;. A single term in a phenotype controlled vocabulary can be referenced using the xref, or the PhenoXML describing the PATO EQ model phenotype description can be stored as a string in PATO-DATA.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Entity"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A pool of molecules or molecular complexes. 
-
-Comments: Each PhysicalEntity is defined by a  sequence or structure based on an EntityReference AND any set of Features that are given. For example,  ser46 phosphorylated p53 is a physical entity in BioPAX defined by the p53 sequence and the phosphorylation feature on the serine at position 46 in the sequence.  Features are any combination of cellular location, covalent and non-covalent bonds with other molecules and covalent modifications.  
-
-For a specific molecule to be a member of the pool it has to satisfy all of the specified features. Unspecified features are treated as unknowns or unneccesary. Features that are known to not be on the molecules should be explicitly stated with the &quot;not feature&quot; property. 
-A physical entity in BioPAX  never represents a specific molecular instance. 
-
-Physical Entity can be heterogenous and potentially overlap, i.e. a single molecule can be counted as a member of multiple pools. This makes BioPAX semantics different than regular chemical notation but is necessary for dealing with combinatorial complexity. 
-
-Synonyms: part, interactor, object, species
-
-Examples: extracellular calcium, ser 64 phosphorylated p53</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Protein -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Protein">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Protein"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A physical entity consisting of a sequence of amino acids; a protein monomer; a single polypeptide chain.
-Examples: The epidermal growth factor receptor (EGFR) protein.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#ProteinReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#ProteinReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberEntityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ProteinReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:comment rdf:datatype="&xsd;string">A protein reference is a grouping of several protein entities that are encoded by the same gene.  Members can differ in celular location, sequence features and bound partners. Currently conformational states (such as open and closed) are not covered.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Provenance -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Provenance">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#xref"/>
-                <owl:allValuesFrom>
-                    <owl:Class>
-                        <owl:unionOf rdf:parseType="Collection">
-                            <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#PublicationXref"/>
-                            <rdf:Description rdf:about="http://www.biopax.org/release/biopax-level3.owl#UnificationXref"/>
-                        </owl:unionOf>
-                    </owl:Class>
-                </owl:allValuesFrom>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Score"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: The direct source of pathway data or score.
-Usage: This does not store the trail of sources from the generation of the data to this point, only the last known source, such as a database, tool or algorithm. The xref property may contain a publicationXref referencing a publication describing the data source (e.g. a database publication). A unificationXref may be used when pointing to an entry in a database of databases describing this database.
-Examples: A database, scoring method or person name.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#PublicationXref -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#PublicationXref">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UnificationXref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An xref that defines a reference to a publication such as a book, journal article, web page, or software manual.
-Usage:  The reference may or may not be in a database, although references to PubMed are preferred when possible. The publication should make a direct reference to the instance it is attached to. Publication xrefs should make use of PubMed IDs wherever possible. The DB property of an xref to an entry in PubMed should use the string &quot;PubMed&quot; and not &quot;MEDLINE&quot;.
-Examples: PubMed:10234245</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#RelationshipTypeVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Vocabulary for defining relationship Xref types. A reference to the PSI Molecular Interaction ontology (MI) Cross Reference type. Homepage at http://www.psidev.info/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0353&amp;termName=cross-reference%20type</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#RelationshipXref -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#RelationshipXref">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An xref that defines a reference to an entity in an external resource that does not have the same biological identity as the referring entity.
-Usage: There is currently no controlled vocabulary of relationship types for BioPAX, although one will be created in the future if a need develops.
-Examples: A link between a gene G in a BioPAX data collection, and the protein product P of that gene in an external database. This is not a unification xref because G and P are different biological entities (one is a gene and one is a protein). Another example is a relationship xref for a protein that refers to the Gene Ontology biological process, e.g. &apos;immune response,&apos; that the protein is involved in.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Rna -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Rna">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Rna"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A physical entity consisting of a sequence of ribonucleotide monophosphates; a ribonucleic acid.
-Usage: RNA should be used for pools of individual RNA molecules. For describing subregions on those molecules use RNARegion.
-Examples: messengerRNA, microRNA, ribosomalRNA. A specific example is the let-7 microRNA.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#RnaReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#subRegion"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberEntityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Defintion: A RNA  reference is a grouping of several RNA entities that are either encoded by the same gene or replicates of the same genome.  Members can differ in celular location, sequence features and bound partners. Currently conformational states (such as hairpin) are not covered.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#RnaRegion -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegion">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegion"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A region on a RNA molecule. 
-Usage: RNARegion is not a pool of independent molecules but a subregion on these molecules. As such, every RNARegion has a defining RNA molecule.  
-Examples: CDS, 3&apos; UTR, Hairpin</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#subRegion"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#RnaRegionReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A RNARegion reference is a grouping of several RNARegion entities that are common in sequence and genomic position.  Members can differ in celular location, sequence features, mutations and bound partners.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Score -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Score">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#value"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A score associated with a publication reference describing how the score was determined, the name of the method and a comment briefly describing the method.
-Usage:  The xref must contain at least one publication that describes the method used to determine the score value. There is currently no standard way of describing  values, so any string is valid.
-Examples: The statistical significance of a result, e.g. &quot;p&lt;0.05&quot;.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SequenceInterval -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SequenceInterval">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceSite"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An interval on a sequence. 
-Usage: Interval is defined as an ordered pair of SequenceSites. All of the sequence from the begin site to the end site (inclusive) is described, not any subset.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SequenceLocation -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A location on a nucleotide or amino acid sequence.
-Usage: For most purposes it is more appropriate to use subclasses of this class. Direct instances of SequenceLocation can be used for uknown locations that can not be classified neither as an interval nor a site.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SequenceModificationVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definiiton: A reference to the PSI Molecular Interaction ontology (MI) of covalent sequence modifications. Homepage at http://www.psidev.info/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=MI&amp;termId=MI%3A0252&amp;termName=biological%20feature. Only children that are covelent modifications at specific positions can be used.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SequenceRegionVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to a controlled vocabulary of sequence regions, such as InterPro or Sequence Ontology (SO). Homepage at http://www.sequenceontology.org/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=SO</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SequenceSite -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SequenceSite">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SequenceLocation"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Describes a site on a sequence, i.e. the position of a single nucleotide or amino acid.
-Usage: A sequence site is always defined based on the reference sequence of the owning entity. For DNARegion and RNARegion it is relative to the region itself not the genome or full RNA molecule.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SmallMolecule -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#feature"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#notFeature"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BindingFeature"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#entityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberPhysicalEntity"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMolecule"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A pool of molecules that are neither complexes nor are genetically encoded.
-
-Rationale: Identity of small molecules are based on structure, rather than sequence as in the case of DNA, RNA or Protein. A small molecule reference is a grouping of several small molecule entities  that have the same chemical structure.  
-
-Usage : Smalle Molecules can have a cellular location and binding features. They can&apos;t have modification features as covalent modifications of small molecules are not considered as state changes but treated as different molecules.
-Some non-genomic macromolecules, such as large complex carbohydrates are currently covered by small molecules despite they lack a static structure. Better coverage for such molecules require representation of generic stoichiometry and polymerization, currently planned for BioPAX level 4.
-
-Examples: glucose, penicillin, phosphatidylinositol</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#EntityReference"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#memberEntityReference"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#SmallMoleculeReference"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">A small molecule reference is a grouping of several small molecule entities  that have the same chemical structure.  Members can differ in celular location and bound partners. Covalent modifications of small molecules are not considered as state changes but treated as different molecules.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Stoichiometry -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Stoichiometry">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#stoichiometricCoefficient"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#physicalEntity"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <owl:disjointWith rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Stoichiometric coefficient of a physical entity in the context of a conversion or complex.
-Usage: For each participating element there must be 0 or 1 stoichiometry element. A non-existing stoichiometric element is treated as unknown.
-This is an n-ary bridge for left, right and component properties. Relative stoichiometries ( e.g n, n+1) often used for describing polymerization is not supported.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#TemplateReaction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Interaction"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#participant"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definiton: An interaction where a macromolecule is polymerized from a 
-    template macromolecule. 
-
-Rationale: This is an abstraction over multiple (not explicitly stated) biochemical 
-    reactions. The ubiquitous molecules (NTP and amino acids) consumed are also usually
-    omitted. Template reaction is non-stoichiometric, does not obey law of 
-    mass conservation and temporally non-atomic. It, however, provides a 
-    mechanism to capture processes that are central to all living organisms.  
-
-Usage: Regulation of TemplateReaction, e.g. via a transcription factor can be 
-    captured using TemplateReactionRegulation. TemplateReaction can also be 
-    indirect  for example, it is not necessary to represent intermediary mRNA 
-    for describing expression of a protein. It was decided to not subclass 
-    TemplateReaction to subtypes such as transcription of translation for the 
-    sake of  simplicity. If needed these subclasses can be added in the 
-    future. 
-
-Examples: Transcription, translation, replication, reverse transcription. E.g. 
-    DNA to RNA is transcription, RNA to protein is translation and DNA to 
-    protein is protein expression from DNA.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#TemplateReactionRegulation -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#TemplateReactionRegulation">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Control"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controlled"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TemplateReaction"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controlType"/>
-                <owl:allValuesFrom>
-                    <rdfs:Datatype>
-                        <owl:oneOf>
-                            <rdf:Description>
-                                <rdf:type rdf:resource="&rdf;List"/>
-                                <rdf:first rdf:datatype="&xsd;string">ACTIVATION</rdf:first>
-                                <rdf:rest>
-                                    <rdf:Description>
-                                        <rdf:type rdf:resource="&rdf;List"/>
-                                        <rdf:first rdf:datatype="&xsd;string">INHIBITION</rdf:first>
-                                        <rdf:rest rdf:resource="&rdf;nil"/>
-                                    </rdf:Description>
-                                </rdf:rest>
-                            </rdf:Description>
-                        </owl:oneOf>
-                    </rdfs:Datatype>
-                </owl:allValuesFrom>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#controller"/>
-                <owl:allValuesFrom rdf:resource="http://www.biopax.org/release/biopax-level3.owl#PhysicalEntity"/>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: Regulation of an expression reaction by a controlling element such as a transcription factor or microRNA. 
-
-Usage: To represent the binding of the transcription factor to a regulatory element in the TemplateReaction, create a complex of the transcription factor and the regulatory element and set that as the controller.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#TissueVocabulary">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#ControlledVocabulary"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference to the BRENDA (BTO). Homepage at http://www.brenda-enzymes.info/.  Browse at http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=BTO</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Transport -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Transport">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Conversion"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: An conversion in which molecules of one or more physicalEntity pools change their subcellular location and become a member of one or more other physicalEntity pools. A transport interaction does not include the transporter entity, even if one is required in order for the transport to occur. Instead, transporters are linked to transport interactions via the catalysis class.
-
-Usage: If there is a simultaneous chemical modification of the participant(s), use transportWithBiochemicalReaction class.
-
-Synonyms: translocation.
-
-Examples: The movement of Na+ into the cell through an open voltage-gated channel.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Transport"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A conversion interaction that is both a biochemicalReaction and a transport. In transportWithBiochemicalReaction interactions, one or more of the substrates changes both their location and their physical structure. Active transport reactions that use ATP as an energy source fall under this category, even if the only covalent change is the hydrolysis of ATP to ADP.
-
-Rationale: This class was added to support a large number of transport events in pathway databases that have a biochemical reaction during the transport process. It is not expected that other double inheritance subclasses will be added to the ontology at the same level as this class.
-
-Examples: In the PEP-dependent phosphotransferase system, transportation of sugar into an E. coli cell is accompanied by the sugar&apos;s phosphorylation as it crosses the plasma membrane.</rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction"/>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.8</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Transport"/>
-        <owl:annotatedSource rdf:resource="http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#UnificationXref -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#UnificationXref">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#Xref"/>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#db"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:subClassOf>
-            <owl:Restriction>
-                <owl:onProperty rdf:resource="http://www.biopax.org/release/biopax-level3.owl#id"/>
-                <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
-            </owl:Restriction>
-        </rdfs:subClassOf>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A unification xref defines a reference to an entity in an external resource that has the same biological identity as the referring entity
-Rationale: Unification xrefs are critically important for data integration. In the future they may be replaced by direct miriam links and rdf:id based identity management. 
-
-Usage: For example, if one wished to link from a database record, C, describing a chemical compound in a BioPAX data collection to a record, C&apos;, describing the same chemical compound in an external database, one would use a unification xref since records C and C&apos; describe the same biological identity. Generally, unification xrefs should be used whenever possible, although there are cases where they might not be useful, such as application to application data exchange.Identity of interactions can be computed based on the  identity of its participants. An xref in a protein pointing to a gene, e.g. in the LocusLink database17, would not be a unification xref since the two entities do not have the same biological identity (one is a protein, the other is a gene). Instead, this link should be a captured as a relationship xref. References to an external controlled vocabulary term within the OpenControlledVocabulary class should use a unification xref where possible (e.g. GO:0005737).
-Examples: An xref in a protein instance pointing to an entry in the Swiss-Prot database, and an xref in an RNA instance pointing to the corresponding RNA sequence in the RefSeq database..</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#UtilityClass -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#UtilityClass">
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: This is a placeholder for classes, used for annotating the &quot;Entity&quot; and its subclasses. Mostly, these are not  an &quot;Entity&quot; themselves. Examples include references to external databases, controlled vocabularies, evidence and provenance.
-
-Rationale: Utility classes are created when simple slots are insufficient to describe an aspect of an entity or to increase compatibility of this ontology with other standards.  
-
-Usage: The utilityClass class is actually a metaclass and is only present to organize the other helper classes under one class hierarchy; instances of utilityClass should never be created.</rdfs:comment>
-    </owl:Class>
-    
-
-
-    <!-- http://www.biopax.org/release/biopax-level3.owl#Xref -->
-
-    <owl:Class rdf:about="http://www.biopax.org/release/biopax-level3.owl#Xref">
-        <rdfs:subClassOf rdf:resource="http://www.biopax.org/release/biopax-level3.owl#UtilityClass"/>
-        <rdfs:comment rdf:datatype="&xsd;string">Definition: A reference from an instance of a class in this ontology to an object in an external resource.
-Rationale: Xrefs in the future can be removed in the future in favor of explicit miram links. 
-Usage: For most cases one of the subclasses of xref should be used.</rdfs:comment>
-    </owl:Class>
-</rdf:RDF>
-
-
-
-<!-- Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net -->
-
diff --git a/examples/examples.swinb b/examples/examples.swinb
index 96c2b02..e8cb0a0 100644
--- a/examples/examples.swinb
+++ b/examples/examples.swinb
@@ -1,17 +1,19 @@
 <div class="notebook">
 
 <div class="nb-cell markdown">
-# Welcome to SWISH
+# Welcome to TRILL on SWISH
 
-You are reading a SWISH _notebook_.  A notebook is a mixture of _text_, _programs_ and _queries_.  This notebook gives an overview of example programs shipped with SWISH.
+You are reading a TRILL on SWISH _notebook_.  A notebook is a mixture of _text_, _programs_ and _queries_.  This notebook gives an overview of example programs shipped with TRILL on SWISH.
 
 - *Examples*
-  - [Biopax](example/biopaxLevel3.owl) models metabolic pathways ([Home Page](http://www.biopax.org/)).
-  - [BRCA](example/BRCA.owl) models risk factor of breast cancer, from Klinov, P., Parsia, B.: _Optimization and evaluation of reasoning in probabilistic
+  - [Biopax](example/biopaxLevel3.pl) models metabolic pathways ([Home Page](http://www.biopax.org/)).
+  - [BRCA](example/BRCA.pl) models risk factor of breast cancer, from Klinov, P., Parsia, B.: _Optimization and evaluation of reasoning in probabilistic
     description logic: Towards a systematic approach_. In: International Semantic Web Conference. LNCS, vol. 5318, pp. 213-228. Springer (2008).
-  - [DBPedia](example/DBPedia.owl) is an extract of the DBPedia ontology, it contains structured information from Wikipedia ([Home Page](http://dbpedia.org/)).
-  - [people+pets](example/peoplePets.owl) is inpired by the people+pets ontology from Patel-Schneider, P, F., Horrocks, I., and Bechhofer, S. 2003. _Tutorial  on OWL_. The knowledge base indicates that the individuals that own an animal which is a pet are nature lovers, from Zese, R.: _Reasoning with Probabilistic Logics_. ArXiv e-prints 1405.0915v3. Doctoral Consortium of the 30th International Conference on Logic Programming (ICLP 2014), July 19-22, Vienna, Austria.
-  - [Vicodi](example/vicodi.owl) is an extract of the Vicodi knowledge base that contains information on European history ([Home Page](http://www.vicodi.org/)).
+  - [DBPedia](example/DBPedia.pl) is an extract of the DBPedia ontology, it contains structured information from Wikipedia ([Home Page](http://dbpedia.org/)).
+  - [people+pets](example/peoplePets.pl) uses both RDF/XML and Prolog syntax. It is inpired by the people+pets ontology from Patel-Schneider, P, F., Horrocks, I., and Bechhofer, S. 2003. _Tutorial  on OWL_. The knowledge base indicates that the individuals that own an animal which is a pet are nature lovers, from Zese, R.: _Reasoning with Probabilistic Logics_. ArXiv e-prints 1405.0915v3. Doctoral Consortium of the 30th International Conference on Logic Programming (ICLP 2014), July 19-22, Vienna, Austria.
+  - [Vicodi](example/vicodi.pl) is an extract of the Vicodi knowledge base that contains information on European history ([Home Page](http://www.vicodi.org/)).
+  - [Commander](example/commander.pl) is an example using only Prolog syntax.
+  - [John employee](example/johnEmployee.pl) is the example shown in help.
 </div>
 
 </div>
diff --git a/examples/index.json b/examples/index.json
index dd23c25..faf211d 100644
--- a/examples/index.json
+++ b/examples/index.json
@@ -3,9 +3,11 @@
 [
 { "file":"examples.swinb",	"title":"Example programs" },
 "--",
-{ "file":"biopaxLevel3.owl",	"title":"Biopax" },
-{ "file":"BRCA.owl",		"title":"BRCA" },
-{ "file":"DBPedia.owl",		"title":"DBPedia" },
-{ "file":"peoplePets.owl",	"title":"people+pets" },
-{ "file":"vicodi.owl",		"title":"Vicodi" },
+{ "file":"biopaxLevel3.pl",	"title":"Biopax" },
+{ "file":"BRCA.pl",		"title":"BRCA" },
+{ "file":"DBPedia.pl",		"title":"DBPedia" },
+{ "file":"peoplePets.pl",	"title":"people+pets" },
+{ "file":"vicodi.pl",		"title":"Vicodi" },
+{ "file":"commander.pl",	"title":"Commander" },
+{ "file":"johnEmployee.pl",	"title":"John employee"}
 ]
diff --git a/examples/peoplePets.owl b/examples/peoplePets.owl
deleted file mode 100644
index 9dbcf44..0000000
--- a/examples/peoplePets.owl
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-This knowledge base is inpired by the people+pets ontology from
-Patel-Schneider, P, F., Horrocks, I., and Bechhofer, S. 2003. Tutorial on OWL.
-The knowledge base indicates that the individuals that own an animal which is a pet are nature lovers, from
-Zese, R.: Reasoning with Probabilistic Logics. ArXiv e-prints 1405.0915v3. 
-Doctoral Consortium of the 30th International Conference on Logic Programming (ICLP 2014), July 19-22, Vienna, Austria.
-
-/** <examples>
-
-?- prob_instanceOf(\'natureLover\',\'Kevin\',Prob).
-?- instanceOf(\'natureLover\',\'Kevin\',ListExpl).
-
-*/
--->
-
-<!DOCTYPE rdf:RDF [
-    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
-    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
-    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
-    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
-    <!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" >
-]>
-
-
-<rdf:RDF xmlns="http://cohse.semanticweb.org/ontologies/people#"
-     xml:base="http://cohse.semanticweb.org/ontologies/people"
-     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-     xmlns:owl="http://www.w3.org/2002/07/owl#"
-     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#">
-    <owl:Ontology rdf:about="http://cohse.semanticweb.org/ontologies/people"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Annotation properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- https://sites.google.com/a/unife.it/ml/disponte#probability -->
-
-    <owl:AnnotationProperty rdf:about="&disponte;probability"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Object Properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#has_animal -->
-
-    <owl:ObjectProperty rdf:about="http://cohse.semanticweb.org/ontologies/people#has_animal">
-        <rdfs:label>has_animal</rdfs:label>
-        <rdfs:comment></rdfs:comment>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Classes
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#cat -->
-
-    <owl:Class rdf:about="http://cohse.semanticweb.org/ontologies/people#cat">
-        <rdfs:label>cat</rdfs:label>
-        <rdfs:subClassOf rdf:resource="http://cohse.semanticweb.org/ontologies/people#pet"/>
-        <rdfs:comment></rdfs:comment>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.6</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://cohse.semanticweb.org/ontologies/people#cat"/>
-        <owl:annotatedTarget rdf:resource="http://cohse.semanticweb.org/ontologies/people#pet"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#natureLover -->
-
-    <owl:Class rdf:about="http://cohse.semanticweb.org/ontologies/people#natureLover"/>
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#pet -->
-
-    <owl:Class rdf:about="http://cohse.semanticweb.org/ontologies/people#pet"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Individuals
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#Fluffy -->
-
-    <owl:NamedIndividual rdf:about="http://cohse.semanticweb.org/ontologies/people#Fluffy">
-        <rdf:type rdf:resource="http://cohse.semanticweb.org/ontologies/people#cat"/>
-        <rdfs:label>Fuffy</rdfs:label>
-        <rdfs:comment></rdfs:comment>
-    </owl:NamedIndividual>
-    <owl:Axiom>
-        <disponte:probability>0.4</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://cohse.semanticweb.org/ontologies/people#Fluffy"/>
-        <owl:annotatedTarget rdf:resource="http://cohse.semanticweb.org/ontologies/people#cat"/>
-        <owl:annotatedProperty rdf:resource="&rdf;type"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#Kevin -->
-
-    <owl:NamedIndividual rdf:about="http://cohse.semanticweb.org/ontologies/people#Kevin">
-        <rdfs:label>Kevin</rdfs:label>
-        <rdfs:comment></rdfs:comment>
-        <has_animal rdf:resource="http://cohse.semanticweb.org/ontologies/people#Fluffy"/>
-        <has_animal rdf:resource="http://cohse.semanticweb.org/ontologies/people#Tom"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://cohse.semanticweb.org/ontologies/people#Tom -->
-
-    <owl:NamedIndividual rdf:about="http://cohse.semanticweb.org/ontologies/people#Tom">
-        <rdf:type rdf:resource="http://cohse.semanticweb.org/ontologies/people#cat"/>
-        <rdfs:label>Tom</rdfs:label>
-        <rdfs:comment></rdfs:comment>
-    </owl:NamedIndividual>
-    <owl:Axiom>
-        <disponte:probability>0.3</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://cohse.semanticweb.org/ontologies/people#Tom"/>
-        <owl:annotatedTarget rdf:resource="http://cohse.semanticweb.org/ontologies/people#cat"/>
-        <owl:annotatedProperty rdf:resource="&rdf;type"/>
-    </owl:Axiom>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // General axioms
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    <owl:Axiom>
-        <owl:annotatedTarget rdf:resource="http://cohse.semanticweb.org/ontologies/people#natureLover"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-        <owl:annotatedSource>
-            <owl:Restriction>
-                <rdfs:subClassOf rdf:resource="http://cohse.semanticweb.org/ontologies/people#natureLover"/>
-                <owl:onProperty rdf:resource="http://cohse.semanticweb.org/ontologies/people#has_animal"/>
-                <owl:someValuesFrom rdf:resource="http://cohse.semanticweb.org/ontologies/people#pet"/>
-            </owl:Restriction>
-        </owl:annotatedSource>
-    </owl:Axiom>
-</rdf:RDF>
diff --git a/examples/vicodi.owl b/examples/vicodi.owl
deleted file mode 100644
index aa6f964..0000000
--- a/examples/vicodi.owl
+++ /dev/null
@@ -1,1703 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-/** <examples>
-
-This knowledge base is an extract of the Vicodi knowledge base that contains information on European history.
-http://www.vicodi.org/
-
-?- prob_instanceOf(\'vicodi:Role\',\'vicodi:Anthony-van-Dyck-is-Painter-in-Flanders\',Prob).
-?- instanceOf(\'vicodi:Role\',\'vicodi:Anthony-van-Dyck-is-Painter-in-Flanders\',ListExpl).
-
-?- prob_sub_class(\'vicodi:Painter\',\'vicodi:Role\',Prob).
-?- sub_class(\'vicodi:Painter\',\'vicodi:Role\',ListExpl).
-
-*/
--->
-
-<!DOCTYPE rdf:RDF [
-    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
-    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
-    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
-    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
-    <!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" >
-]>
-
-
-<rdf:RDF xmlns="http://example.org#"
-     xml:base="http://example.org"
-     xmlns:vicodi="http://vicodi.org/ontology#"
-     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-     xmlns:owl="http://www.w3.org/2002/07/owl#"
-     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#">
-    <owl:Ontology rdf:about="http://example.org"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Annotation properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- https://sites.google.com/a/unife.it/ml/disponte#probability -->
-
-    <owl:AnnotationProperty rdf:about="&disponte;probability"/>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Object Properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://vicodi.org/ontology#exists -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#exists">
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#Time"/>
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#Time-Dependent"/>
-        <rdfs:subPropertyOf rdf:resource="http://vicodi.org/ontology#related"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#hasCategory -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#hasCategory">
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#Category"/>
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#Time-Dependent"/>
-        <rdfs:subPropertyOf rdf:resource="http://vicodi.org/ontology#related"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#hasLocationPart -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#hasLocationPart">
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#Location"/>
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#Location"/>
-        <rdfs:subPropertyOf rdf:resource="http://vicodi.org/ontology#related"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#hasRole -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#hasRole">
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#Flavour"/>
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#Role"/>
-        <rdfs:subPropertyOf rdf:resource="http://vicodi.org/ontology#related"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#isLocationPartOf -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#isLocationPartOf">
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#Location"/>
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#Location"/>
-        <rdfs:subPropertyOf rdf:resource="http://vicodi.org/ontology#related"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#related -->
-
-    <owl:ObjectProperty rdf:about="http://vicodi.org/ontology#related">
-        <rdfs:range rdf:resource="http://vicodi.org/ontology#VicodiOI"/>
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#VicodiOI"/>
-    </owl:ObjectProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Data properties
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://vicodi.org/ontology#intervalEnd -->
-
-    <owl:DatatypeProperty rdf:about="http://vicodi.org/ontology#intervalEnd">
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#TemporalInterval"/>
-        <rdfs:range rdf:resource="&rdfs;Literal"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- http://vicodi.org/ontology#intervalStart -->
-
-    <owl:DatatypeProperty rdf:about="http://vicodi.org/ontology#intervalStart">
-        <rdfs:domain rdf:resource="http://vicodi.org/ontology#TemporalInterval"/>
-        <rdfs:range rdf:resource="&rdfs;Literal"/>
-    </owl:DatatypeProperty>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Classes
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://kaon.semanticweb.org/2001/11/kaon-lexical#Root -->
-
-    <owl:Class rdf:about="http://kaon.semanticweb.org/2001/11/kaon-lexical#Root"/>
-    
-
-
-    <!-- http://vicodi.org/ontology#Abbey -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Abbey">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Building"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Abstract-Notion -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Abstract-Notion">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Animal -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Animal">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Natural-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Architect -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Architect">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Creator"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Armament -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Armament">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Artefact -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Artefact">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Artist -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Artist">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Creator"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.85</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://vicodi.org/ontology#Artist"/>
-        <owl:annotatedTarget rdf:resource="http://vicodi.org/ontology#Creator"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://vicodi.org/ontology#Artistic-Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Artistic-Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Movement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Artistic-Style -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Artistic-Style">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Author -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Author">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Creator"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Badge -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Badge">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Conceptual-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Battle -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Battle">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Board -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Board">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Management-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Book -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Book">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Writing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Building -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Building">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Category -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Category">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#VicodiOI"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Cathedral -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Cathedral">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Building"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Church -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Church">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Building"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Church-Reformer -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Church-Reformer">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#City -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#City">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Settlement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Cleric -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Cleric">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Clerical-Leader -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Clerical-Leader">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Clothing -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Clothing">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Commodity -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Commodity">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Natural-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Composer -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Composer">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artist"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Conceptual-Object -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Conceptual-Object">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Country -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Country">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Location"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Creator -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Creator">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.8</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://vicodi.org/ontology#Creator"/>
-        <owl:annotatedTarget rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://vicodi.org/ontology#Crime -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Crime">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Cultural-Agreement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Cultural-Agreement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Cultural-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Cultural-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Diplomat -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Diplomat">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Functionary"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Disaster -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Disaster">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Discoverer -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Discoverer">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Disease -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Disease">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Natural-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Dynasty -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Dynasty">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Social-Group"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Ecclesiarch -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Ecclesiarch">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Economic-Enterprise -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Economic-Enterprise">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Economic-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Economic-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Economic-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Economic-Symbol -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Economic-Symbol">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Symbol"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Educational-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Educational-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Election -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Election">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Emperor -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Emperor">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Head-of-State"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Engineer -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Engineer">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Creator"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Environment -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Environment">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Natural-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Ethnic-Group -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Ethnic-Group">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Social-Group"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Event -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Event">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Fictional-Event -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Fictional-Event">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Fictional-Person -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Fictional-Person">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Individual"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Field-of-Knowledge -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Field-of-Knowledge">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Intellectual-Construct"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Flavour -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Flavour">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Time-Dependent"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Food -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Food">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Natural-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Functionary -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Functionary">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Geographical-Discovery -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Geographical-Discovery">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Geographical-Feature -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Geographical-Feature">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Location"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Geographical-Region -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Geographical-Region">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Geographical-Feature"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Governmental-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Governmental-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Political-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Head-of-Government -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Head-of-Government">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Secular-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Head-of-State -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Head-of-State">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Secular-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Idea -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Idea">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Ideology -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Ideology">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Illness -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Illness">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Life-Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Individual -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Individual">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Intellectual-Construct -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Intellectual-Construct">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Intellectual-Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Intellectual-Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Movement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#International-Alliance -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#International-Alliance">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Political-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#International-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#International-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Intra-State-Group -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Intra-State-Group">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Location"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Inventor -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Inventor">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Journal -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Journal">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Writing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#King -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#King">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Head-of-State"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Landmark -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Landmark">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Geographical-Feature"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Language -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Language">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Leader -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Leader">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#League -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#League">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Political-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Legislation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Legislation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Life-Event -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Life-Event">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Liturgical-Object -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Liturgical-Object">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Location -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Location">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Magnate -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Magnate">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Secular-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Management-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Management-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Masonic-Lodge -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Masonic-Lodge">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Cultural-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Measurable-Trend -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Measurable-Trend">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Abstract-Notion"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Meeting -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Meeting">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Military-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Military-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Military-Person -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Military-Person">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Military-Unit -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Military-Unit">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Military-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Minister -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Minister">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Functionary"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Monastery -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Monastery">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Building"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Social-Group"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#National-Symbol -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#National-Symbol">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Symbol"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Natural-Object -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Natural-Object">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Newspaper -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Newspaper">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Writing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Non-Military-Conflict -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Non-Military-Conflict">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Object -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Object">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Other-Religious-Leader -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Other-Religious-Leader">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Other-Religious-Person -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Other-Religious-Person">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Painter -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Painter">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artist"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.5</disponte:probability>
-        <owl:annotatedTarget rdf:resource="http://vicodi.org/ontology#Artist"/>
-        <owl:annotatedSource rdf:resource="http://vicodi.org/ontology#Painter"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://vicodi.org/ontology#Painting -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Painting">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Work-of-Art"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Pamphlet -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Pamphlet">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Writing"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Party -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Party">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Political-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Pastime -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Pastime">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Conceptual-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Period -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Period">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Period-in-Office -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Period-in-Office">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Person -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Person">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Individual"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Person-Role -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Person-Role">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Role"/>
-    </owl:Class>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-        <owl:annotatedTarget rdf:resource="http://vicodi.org/ontology#Role"/>
-        <owl:annotatedProperty rdf:resource="&rdfs;subClassOf"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://vicodi.org/ontology#Philanthropist -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Philanthropist">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Philosopher -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Philosopher">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Scientist"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Piece-of-Music -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Piece-of-Music">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Work-of-Art"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Political-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Political-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Political-Region -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Political-Region">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Location"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Political-Symbol -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Political-Symbol">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Symbol"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Politician -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Politician">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Functionary"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Pollution -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Pollution">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Pope -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Pope">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Population-Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Population-Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Prince -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Prince">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Head-of-State"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Public-Oration -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Public-Oration">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Publisher -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Publisher">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Creator"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Queen -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Queen">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Head-of-State"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Relic -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Relic">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Community -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Community">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Ideology -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Ideology">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Ideology"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Leader -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Leader">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Movement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Order -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Order">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Religious-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Organisation -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Organisation">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Cultural-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Practice -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Practice">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Conceptual-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Religious-Symbol -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Religious-Symbol">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Symbol"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Representative-Institution -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Representative-Institution">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Political-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Ritual -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Ritual">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Conceptual-Object"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Role -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Role">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Time-Dependent"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Saint -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Saint">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Scandal -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Scandal">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Scientific-Instrument -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Scientific-Instrument">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Scientist -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Scientist">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Person-Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Sculptor -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Sculptor">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artist"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Sculpture -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Sculpture">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Work-of-Art"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Secular-Ideology -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Secular-Ideology">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Ideology"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Secular-Leader -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Secular-Leader">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Leader"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Secular-Movement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Secular-Movement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Movement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Settlement -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Settlement">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Location"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Ship -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Ship">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Vehicle"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Social-Group -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Social-Group">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Flavour"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Social-Stratum -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Social-Stratum">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Social-Group"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Stereotype-Group -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Stereotype-Group">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Social-Group"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Structure -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Structure">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Sultan -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Sultan">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Head-of-State"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Symbol -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Symbol">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Role"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Technical-Scientific-Advance -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Technical-Scientific-Advance">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#TemporalInterval -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#TemporalInterval">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Time"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Time -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Time">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#VicodiOI"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Time-Dependent -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Time-Dependent">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#VicodiOI"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Trade-Association -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Trade-Association">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Economic-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Trades-Union -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Trades-Union">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Economic-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Train -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Train">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Vehicle"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Treaty -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Treaty">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#University -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#University">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Educational-Organisation"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Uprising -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Uprising">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Vehicle -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Vehicle">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#VicodiOI -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#VicodiOI">
-        <rdfs:subClassOf rdf:resource="http://kaon.semanticweb.org/2001/11/kaon-lexical#Root"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Village -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Village">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Settlement"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#War -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#War">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Water -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Water">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Geographical-Feature"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Work-of-Art -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Work-of-Art">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- http://vicodi.org/ontology#Writing -->
-
-    <owl:Class rdf:about="http://vicodi.org/ontology#Writing">
-        <rdfs:subClassOf rdf:resource="http://vicodi.org/ontology#Artefact"/>
-    </owl:Class>
-    
-
-
-    <!-- 
-    ///////////////////////////////////////////////////////////////////////////////////////
-    //
-    // Individuals
-    //
-    ///////////////////////////////////////////////////////////////////////////////////////
-     -->
-
-    
-
-
-    <!-- http://vicodi.org/ontology#Anthony-van-Dyck -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#Anthony-van-Dyck">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Painter"/>
-    </owl:NamedIndividual>
-    <owl:Axiom>
-        <disponte:probability rdf:datatype="&xsd;decimal">0.9</disponte:probability>
-        <owl:annotatedSource rdf:resource="http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders"/>
-        <owl:annotatedTarget rdf:resource="http://vicodi.org/ontology#Painter"/>
-        <owl:annotatedProperty rdf:resource="&rdf;type"/>
-    </owl:Axiom>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-Dynasty -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-Dynasty">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Dynasty"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-Goncz -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-Goncz">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-Goncz-is-Head-of-Government-in-Hungary-between-1990-2000 -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-Goncz-is-Head-of-Government-in-Hungary-between-1990-2000">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Head-of-Government"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-Szakasits -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-Szakasits">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-Szakasits-is-Head-of-Government-in-Hungary-between-1948-1950 -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-Szakasits-is-Head-of-Government-in-Hungary-between-1948-1950">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Head-of-Government"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-of-Hungary -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-of-Hungary">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%81rp%C3%A1d-of-Hungary-is-Prince-in-Hungary-between-896-907 -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%81rp%C3%A1d-of-Hungary-is-Prince-in-Hungary-between-896-907">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Prince"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%86thelwulf-King-of-Wessex -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%86thelwulf-King-of-Wessex">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%89douard-Drumont -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%89douard-Drumont">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%89douard-Herriot -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%89douard-Herriot">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%89douard-Valliant -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%89douard-Valliant">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#%C3%89mile-Vandervelde -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#%C3%89mile-Vandervelde">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Person"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#1st-Abdication-of-Napoleon -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#1st-Abdication-of-Napoleon">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Event"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#1st-Battle-of-Poitiers -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#1st-Battle-of-Poitiers">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Battle"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#1st-Battle-of-St-Albans -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#1st-Battle-of-St-Albans">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Battle"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#12-year-truce -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#12-year-truce">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Non-Military-Conflict"/>
-    </owl:NamedIndividual>
-    
-
-
-    <!-- http://vicodi.org/ontology#20-year-building-programme-for-German-high-seas-fleet -->
-
-    <owl:NamedIndividual rdf:about="http://vicodi.org/ontology#20-year-building-programme-for-German-high-seas-fleet">
-        <rdf:type rdf:resource="http://vicodi.org/ontology#Legislation"/>
-    </owl:NamedIndividual>
-</rdf:RDF>
-
-
-
-<!-- Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net -->
-
diff --git a/lib/trill_on_swish/config.pl b/lib/trill_on_swish/config.pl
index b109af7..9ca6978 100644
--- a/lib/trill_on_swish/config.pl
+++ b/lib/trill_on_swish/config.pl
@@ -27,10 +27,10 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_config,
-	  [ swish_reply_config/1,	% +Request
+:- module(swish_config,
+	  [ swish_reply_config/2,	% +Request, +Options
 	    swish_config/2,		% ?Type, ?Config
-	    swish_config_hash/1		% -HASH
+	    swish_config_hash/2		% -HASH, +Options
 	  ]).
 :- use_module(library(http/http_dispatch)).
 :- use_module(library(http/http_json)).
@@ -38,6 +38,7 @@
 
 :- multifile
 	config/2,			% ?Key, ?Value
+	config/3,			% ?Key, ?Value, +Options
 	source_alias/2,			% ?Alias, ?Options
 	authenticate/2.			% +Request, -User
 
@@ -48,31 +49,31 @@
 		 *	       CONFIG		*
 		 *******************************/
 
-%%	swish_reply_config(+Request) is semidet.
+%%	swish_reply_config(+Request, +Options) is semidet.
 %
 %	Emit a configuration object to the client if the client requests
 %	for '.../swish_config.json', regardless  of   the  path  prefix.
 
-swish_reply_config(Request) :-
+swish_reply_config(Request, Options) :-
 	option(path(Path), Request),
-	file_base_name(Path, 'trill_on_swish_config.json'),
-	json_config(JSON),
+	file_base_name(Path, 'swish_config.json'),
+	json_config(JSON, Options),
 	reply_json(JSON).
 
-%%	swish_config_hash(-Hash) is det.
+%%	swish_config_hash(-Hash, +Options) is det.
 %
 %	True if Hash is the SHA1 of the SWISH config.
 
-swish_config_hash(Hash) :-
-	json_config(Config),
+swish_config_hash(Hash, Options) :-
+	json_config(Config, Options),
 	variant_sha1(Config, Hash).
 
 json_config(json{ http: json{ locations:JSON
 			    },
-		  trill_on_swish: SWISHConfig
-		}) :-
+		  swish: SWISHConfig
+		}, Options) :-
 	http_locations(JSON),
-	swish_config(SWISHConfig).
+	swish_config_dict(SWISHConfig, Options).
 
 http_locations(JSON) :-
 	findall(ID-Path,
@@ -101,12 +102,12 @@ same_ids([Id-Path|T0], Id, T, [Path|TP]) :- !,
 same_ids(T, _, T, []).
 
 
-%%	swish_config(-Config:dict) is det.
+%%	swish_config_dict(-Config:dict, +Options) is det.
 %
-%	Obtain name-value pairs from trill_on_swish_config:config/2
+%	Obtain name-value pairs from swish_config:config/2
 
-swish_config(Config) :-
-	findall(Key-Value, config(Key, Value), Pairs),
+swish_config_dict(Config, Options) :-
+	findall(Key-Value, swish_config(Key, Value, Options), Pairs),
 	dict_pairs(Config, json, Pairs).
 
 %%	config(-Key, -Value) is nondet.
@@ -116,6 +117,11 @@ swish_config(Config) :-
 %	object (see =web/js/config.js=)
 
 swish_config(Key, Value) :-
+	swish_config(Key, Value, []).
+
+swish_config(Key, Value, Options) :-
+	config(Key, Value, Options).
+swish_config(Key, Value, _) :-
 	config(Key, Value).
 
 %%	source_alias(?Alias, ?Options) is nondet.
diff --git a/lib/trill_on_swish/cp_authenticate.pl b/lib/trill_on_swish/cp_authenticate.pl
index 0bd3597..803bd2e 100644
--- a/lib/trill_on_swish/cp_authenticate.pl
+++ b/lib/trill_on_swish/cp_authenticate.pl
@@ -51,6 +51,10 @@ the server will challenge the user.  The   logged  in  user is available
 through pengine_user/1.
 */
 
+%pengines:authentication_hook(_Request, _Application, User) :-
+%	logged_on(User).
 pengines:authentication_hook(_Request, _Application, anonymous).
 
+%pengines:not_sandboxed(User, _Application) :-
+%	catch(check_permission(User, admin(swish)), _, fail).
 pengines:not_sandboxed(_User, _Application).
diff --git a/lib/trill_on_swish/csv.pl b/lib/trill_on_swish/csv.pl
deleted file mode 100644
index 9f5135a..0000000
--- a/lib/trill_on_swish/csv.pl
+++ /dev/null
@@ -1,110 +0,0 @@
-/*  Part of SWI-Prolog
-
-    Author:        Jan Wielemaker
-    E-mail:        J.Wielemaker@cs.vu.nl
-    WWW:           http://www.swi-prolog.org
-    Copyright (C): 2015, VU University Amsterdam
-
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    as published by the Free Software Foundation; either version 2
-    of the License, or (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-    As a special exception, if you link this library with other files,
-    compiled with a Free Software compiler, to produce an executable, this
-    library does not by itself cause the resulting executable to be covered
-    by the GNU General Public License. This exception does not however
-    invalidate any other reasons why the executable file might be covered by
-    the GNU General Public License.
-*/
-
-:- module(trill_on_swish_csv, []).
-:- use_module(library(pengines), []).
-:- use_module(library(pairs)).
-:- use_module(library(csv)).
-:- use_module(library(apply)).
-:- use_module(library(pprint)).
-
-/** <module> Support CSV output from a Pengines server
-
-This module defines the result-format  `csv`   for  Pengines.  It allows
-SWISH users to post a query against the   core  Prolog system or a saved
-SWISH program and obtain the results using   a simple web client such as
-`curl`. An example shell script is provided in =client/trill_on_swish-ask.sh=.
-
-@tbd	Provide streaming output
-*/
-
-:- multifile
-	pengines:write_result/3,
-	write_answers/2.
-
-%%	pengines:write_result(+Format, +Event, +VarNames) is semidet.
-%
-%	Hook into library(pengines) that  makes   pengines  support  CSV
-%	output.
-
-pengines:write_result(csv, Event, VarNames) :-
-	csv(Event, VarNames).
-
-csv(create(_Id, Features), VarNames) :- !,
-	memberchk(answer(Answer), Features),
-	csv(Answer, VarNames).
-csv(destroy(_Id, Wrapped), VarNames) :- !,
-	csv(Wrapped, VarNames).
-csv(success(_Id, Answers, _Time, _More), VarNames) :- !,
-	VarTerm =.. [row|VarNames],
-	success(Answers, VarTerm).
-csv(error(_Id, Error), _VarNames) :- !,
-	message_to_string(Error, Msg),
-	format('Status: 400 Bad request~n'),
-	format('Content-type: text/plain~n~n'),
-	format('ERROR: ~w~n', [Msg]).
-csv(output(_Id, message(_Term, _Class, HTML, _Where)), _VarNames) :- !,
-	format('Status: 400 Bad request~n'),
-	format('Content-type: text/html~n~n'),
-	format('<html>~n~s~n</html>~n', [HTML]).
-csv(Event, _VarNames) :-
-	print_term(Event, [output(user_error)]).
-
-success(Answers, VarTerm) :-
-	write_answers(Answers, VarTerm), !.
-success(Answers, VarTerm) :-
-	maplist(csv_answer, Answers, Rows),
-	format('Content-disposition: attachment; filename="swish-result.csv"~n'),
-	format('Content-type: text/csv~n~n'),
-	csv_write_stream(current_output, [VarTerm|Rows], []).
-
-csv_answer(JSON, Row) :-
-	is_dict(JSON), !,
-	dict_pairs(JSON, _, Pairs),
-	pairs_values(Pairs, Values),
-	maplist(csv_value, Values, CVSValues),
-	Row =.. [row|CVSValues].
-csv_answer(RowIn, Row) :-
-	compound(RowIn), !,
-	RowIn =.. [_|Values],
-	maplist(csv_value, Values, CVSValues),
-	Row =.. [row|CVSValues].
-
-csv_value(Var, '') :-
-	var(Var), !.
-csv_value(Number, Number) :-
-	number(Number), !.
-csv_value(Atom, Atom) :-
-	atom(Atom), !.
-csv_value(String, String) :-
-	string(String), !.
-csv_value(Term, Value) :-
-	term_string(Term, Value).
-
-
diff --git a/lib/trill_on_swish/examples.pl b/lib/trill_on_swish/examples.pl
index 452295f..ff4a89a 100644
--- a/lib/trill_on_swish/examples.pl
+++ b/lib/trill_on_swish/examples.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_examples, []).
+:- module(swish_examples, []).
 :- use_module(library(http/http_dispatch)).
 :- use_module(library(http/http_json)).
 :- use_module(library(http/json)).
@@ -50,15 +50,15 @@ two sources:
 
 :- multifile
 	user:file_search_path/2,
-	trill_on_swish_config:config/2,
-	trill_on_swish_config:source_alias/2.
+	swish_config:config/2,
+	swish_config:source_alias/2.
 
 % make example(File) find the example data
-user:file_search_path(example, trill_on_swish(examples)).
+user:file_search_path(example, swish(examples)).
 % make SWISH serve /example/File as example(File).
-trill_on_swish_config:source_alias(example, [access(read), search('*.{owl,swinb}')]).
+swish_config:source_alias(example, [access(read), search('*.{pl,swinb}')]).
 
-:- http_handler(trill_on_swish(list_examples),
+:- http_handler(swish(list_examples),
 		list_examples, [id(swish_examples)]).
 
 
@@ -83,7 +83,7 @@ list_examples(_Request) :-
 %	  - title:String
 
 example_files(AllExamples) :-
-	http_absolute_location(trill_on_swish(example), HREF, []),
+	http_absolute_location(swish(example), HREF, []),
 	findall(Index,
 		absolute_file_name(example(.), Index,
 				   [ access(read),
@@ -101,7 +101,7 @@ index_json(HREF, Dir, JSON) :-
 	read_file_to_json(File, JSON0),
 	maplist(add_href(HREF), JSON0, JSON).
 index_json(HREF, Dir, JSON) :-
-	string_concat(Dir, "/*.owl", Pattern),
+	string_concat(Dir, "/*.pl", Pattern),
 	expand_file_name(Pattern, Files),
 	maplist(ex_file_json(HREF), Files, JSON).
 
@@ -137,14 +137,14 @@ ex_file_json(HREF0, Path, json{file:File, href:HREF, title:Base}) :-
 %	Extract examples from the gitty store.
 
 storage_examples(List) :-
-	trill_on_swish_config:config(community_examples, true),
+	swish_config:config(community_examples, true),
 	findall(Ex, gitty_example(Ex), List1),
 	List1 \== [], !,
 	List = [json{type:"divider"}|List1].
 storage_examples([]).
 
 gitty_example(json{title:Title, file:File, type:"store"}) :-
-	setting(trill_on_swish_web_storage:directory, Store),
+	setting(web_storage:directory, Store),
 	gitty_file(Store, File, _),
 	gitty_commit(Store, File, Meta),
 	Meta.get(example) == true,
diff --git a/lib/trill_on_swish/form.pl b/lib/trill_on_swish/form.pl
index 74ceabc..b93e755 100644
--- a/lib/trill_on_swish/form.pl
+++ b/lib/trill_on_swish/form.pl
@@ -27,17 +27,247 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_form, []).
-:- use_module(library(http/http_dispatch)).
-:- use_module(library(http/http_server_files)).
+:- module(swish_form,
+	  [ validate_form/2,		% +Dict, +Fields
+	    validate_field/4,		% +Dict, +Field, -Value, +Options
+	    input_error/2		% +Field, +Error
+	  ]).
 
-/** <module> Show forms in SWISH
+/** <module> Form handling utilities
 
-This module serves forms for SWISH.
+This module simplifies handling input from forms in the SWISH interface.
+The  values  from  a  form  can   be    turned   into  an  object  using
+`notebook.formData(form)`.  The  returned  dict  may   be  passed  to  a
+predicate inside SWISH.
 */
 
-:- http_handler(trill_on_swish(form), serve_files_in_directory(swish_form),
-		[id(form),prefix]).
 
-user:file_search_path(swish_form, trill_on_swish(web/form)).
+%%	validate_form(+Dict, +Fields) is det.
+%
+%	Run validate_field/4 on all  specified   fields,  combining  the
+%	error message.  Fields is a list of terms of the form
+%
+%	    field(Name, Value, Options)
 
+validate_form(Dict, Fields) :-
+	validate_form(Fields, Dict, Errors),
+	(   Errors == []
+	->  true
+	;   throw(error(form_error(Errors), _))
+	).
+
+validate_form([], _, []).
+validate_form([field(Field, Value, Options)|T], Dict, Errors) :-
+	catch(validate_field(Dict, Field, Value, Options),
+	      error(input_error(Field, Error),_),
+	      true),
+	(   var(Error)
+	->  Errors = Errors1
+	;   Errors = [input_error(Field, Error)|Errors1]
+	),
+	validate_form(T, Dict, Errors1).
+
+
+%%	validate_field(+Dict, +Field, -Value, +Options) is det.
+%
+%	True when Value is a valid value   for Field from Dict according
+%	to Options. Options is  a  list   of  processing  steps taken to
+%	convert and validate the value.  Defined steps are:
+%
+%	  - alnum
+%	  All characters must be alphanumeric
+%	  - alnum_and_spaces
+%	  All characters must be alphanumeric or spaces
+%	  - atom
+%	  Convert input to an atom
+%	  - default(Term)
+%	  Use Term as value if no value appears in the input.
+%	  - downcase
+%	  Convert input to lower case
+%	  - email
+%	  Input must be a value E-mail address.
+%	  - float
+%	  Value is converted to a floating point number.
+%	  - integer
+%	  Value is converted to an integer.
+%	  - length > N
+%	  The value must have at more than N characters
+%	  - length >= N
+%	  The value must have at least N characters
+%	  - length =< N
+%	  The value must have at most N characters
+%	  - length < N
+%	  The value must have at less than N characters
+%	  - number
+%	  Value is converted to a number (integer or float)
+%	  - oneof(List)
+%	  Input must be a member of List.
+%	  - password
+%	  Input must be a reasonable password.
+%	  - strip
+%	  Strip leading and trailing white space and normalize
+%	  internal white space to a single space.
+
+
+validate_field(Dict, Field, Value, Options) :-
+	(   Value0 = Dict.get(Field)
+	->  validate_value(Options, Value0, Value, Field)
+	;   memberchk(default(Value), Options)
+	->  true
+	;   input_error(Field, required)
+	).
+
+validate_value([], Value, Value, _).
+validate_value([H|T], Value0, Value, Field) :-
+	(   validate_step(H, Value0, Value1)
+	->  true
+	;   validate_failed(H, Value0, Field)
+	),
+	validate_value(T, Value1, Value, Field).
+
+%%	validate_step(+Step, +Value0, -Value) is semidet.
+
+validate_step(alnum, Value, Value) :-
+	forall(sub_atom(Value, _, 1, _, Char),
+	       char_type(Char, alnum)).
+validate_step(length >= N, Value, Value) :-
+	string_length(Value, Len),
+	Len >= N.
+validate_step(length > N, Value, Value) :-
+	string_length(Value, Len),
+	Len > N.
+validate_step(length < N, Value, Value) :-
+	string_length(Value, Len),
+	Len < N.
+validate_step(length =< N, Value, Value) :-
+	string_length(Value, Len),
+	Len =< N.
+validate_step(strip, Value0, Value) :-
+	normalize_space(string(Value), Value0).
+validate_step(alnum_and_spaces, Value, Value) :-
+	forall(sub_atom(Value, _, 1, _, Char),
+	       alnum_or_space(Char)).
+validate_step(email, Value, Value) :-
+	string_codes(Value, Codes),
+	phrase(email, Codes).
+validate_step(downcase, Value0, Value) :-
+	string_lower(Value0, Value).
+validate_step(atom, Value0, Value) :-
+	atom_string(Value, Value0).
+validate_step(number, Value0, Value) :-
+	number_string(Value, Value0).
+validate_step(integer, Value0, Value) :-
+	number_string(Value, Value0),
+	integer(Value).
+validate_step(float, Value0, Value) :-
+	number_string(Value1, Value0),
+	Value is float(Value1).
+validate_step(oneof(List), Value, Value) :-
+	memberchk(Value, List).
+validate_step(password, Value, Value) :-
+	string_length(Value, Len),
+	Len >= 6.
+validate_step(default(_), Value, Value).
+
+alnum_or_space(' ') :- !.
+alnum_or_space(Char) :-
+	char_type(Char, alnum).
+
+email --> user_name, "@", domain_name.
+user_name --> user_name_char, user_name_chars.
+domain_name --> domain_name_segment, ".", domain_name_segments.
+
+user_name_chars --> user_name_char, !, user_name_chars.
+user_name_chars --> "".
+
+user_name_char -->
+	[C],
+	{ between(1, 127, C),
+	  (   code_type(C, alnum)
+	  ->  true
+	  ;   name_special(C)
+	  )
+	}.
+
+name_special(0'.).
+name_special(0'-).
+
+domain_name_segment --> domain_name_char, domain_name_chars.
+domain_name_segments -->
+	domain_name_segment,
+	(   "."
+	->  domain_name_segments
+	;   ""
+	).
+
+domain_name_chars --> domain_name_char, !, domain_name_chars.
+domain_name_chars --> "".
+
+domain_name_char -->
+	[C],
+	{ between(1, 127, C),
+	  (   code_type(C, alnum)
+	  ->  true
+	  ;   domain_special(C)
+	  )
+	}.
+
+domain_special(0'-).
+domain_special(0'_).
+
+validate_failed(H, _Value0, Field) :-
+	input_error(Field, H).
+
+input_error(Field, Error) :-
+	throw(error(input_error(Field, Error), _)).
+
+
+		 /*******************************
+		 *	     MESSAGES		*
+		 *******************************/
+
+:- multifile prolog:error_message//1.
+
+prolog:error_message(input_error(Field, Expected)) -->
+	[ '~w: '-[Field] ],
+	expected(Expected).
+prolog:error_message(form_error(Errors)) -->
+	field_errors(Errors).
+
+field_errors([]) --> [].
+field_errors([H|T]) -->
+	prolog:error_message(H),
+	(   {T==[]}
+	->  []
+	;   [nl],
+	    field_errors(T)
+	).
+
+
+expected(oneof(List)) --> !,
+	[ 'One of '-[] ],
+	oneof(List).
+expected(required) --> !,
+	[ 'This field is required'-[] ].
+expected(length > N) --> !,
+	[ 'Needs at more than ~d characters'-[N] ].
+expected(length >= N) --> !,
+	[ 'Needs at least ~d characters'-[N] ].
+expected(length =< N) --> !,
+	[ 'Needs at most ~d characters'-[N] ].
+expected(length < N) --> !,
+	[ 'Needs less than ~d characters'-[N] ].
+expected(matching_password) -->
+	[ 'The password does not match'-[] ].
+expected(new_user) -->
+	[ 'A user with this name already exists'-[] ].
+expected(Expected) --> !,
+	[ 'This field must hold a valid ~w'-[Expected] ].
+
+oneof([One]) --> !,
+	[ '~w'-[One] ].
+oneof([One, Two]) --> !,
+	[ '~w or ~w'-[One, Two] ].
+oneof([H|T]) -->
+	[ '~w, '-[H] ],
+	oneof(T).
diff --git a/lib/trill_on_swish/gitty.pl b/lib/trill_on_swish/gitty.pl
index dbba360..bcb118f 100644
--- a/lib/trill_on_swish/gitty.pl
+++ b/lib/trill_on_swish/gitty.pl
@@ -27,16 +27,18 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_gitty,
-	  [ gitty_file/3,		% +Store, ?Name, ?Hash
+:- module(gitty,
+	  [ gitty_open/2,		% +Store, +Options
+	    gitty_close/1,		% +Store
+
+	    gitty_file/3,		% +Store, ?Name, ?Hash
 	    gitty_create/5,		% +Store, +Name, +Data, +Meta, -Commit
 	    gitty_update/5,		% +Store, +Name, +Data, +Meta, -Commit
 	    gitty_commit/3,		% +Store, +Name, -Meta
 	    gitty_data/4,		% +Store, +Name, -Data, -Meta
 	    gitty_history/4,		% +Store, +Name, -History, +Options
-	    gitty_scan/1,		% +Store
-	    gitty_rescan/1,		% ?Store
 	    gitty_hash/2,		% +Store, ?Hash
+
 	    gitty_reserved_meta/1,	% ?Key
 
 	    gitty_diff/4,		% +Store, ?Start, +End, -Diff
@@ -44,15 +46,20 @@
 	    data_diff/3,		% +String1, +String2, -Diff
 	    udiff_string/2		% +Diff, -String
 	  ]).
-:- use_module(library(zlib)).
-:- use_module(library(filesex)).
 :- use_module(library(sha)).
 :- use_module(library(lists)).
 :- use_module(library(apply)).
 :- use_module(library(option)).
 :- use_module(library(process)).
 :- use_module(library(debug)).
-:- use_module(library(dcg/basics)).
+:- use_module(library(error)).
+:- use_module(library(filesex)).
+
+:- if(exists_source(library(bdb))).
+:- use_module(gitty_driver_bdb, []).
+:- endif.
+:- use_module(gitty_driver_files, []).
+
 
 /** <module> Single-file GIT like version system
 
@@ -78,24 +85,62 @@ the newly created (gitty_create/5) or updated object (gitty_update/5).
 */
 
 :- dynamic
-	head/3,				% Store, Name, Hash
-	store/2,			% Store, Updated
-	heads_input_stream_cache/2.	% Store, Stream
-:- volatile
-	head/3,
-	store/2,
-	heads_input_stream_cache/2.	% Store, Stream
-
-% enable/disable syncing remote servers running on  the same file store.
-% This facility requires shared access to files and thus doesn't work on
-% Windows.
-
-:- if(current_prolog_flag(windows, true)).
-remote_sync(false).
-:- else.
-remote_sync(true).
-:- endif.
+	gitty_store_type/2.		% +Store, -Module
 
+%%	gitty_open(+Store, +Options) is det.
+%
+%	Open a gitty store according to Options.  Defined
+%	options are:
+%
+%	  - driver(+Driver)
+%	  Backend driver to use.  One of =files= or =bdb=.  When
+%	  omitted and the store exists, the current store is
+%	  examined.  If the store does not exist, the default
+%	  is =files=.
+
+gitty_open(Store, Options) :-
+	(   exists_directory(Store)
+	->  true
+	;   existence_error(directory, Store)
+	),
+	(   option(driver(Driver), Options)
+	->  true
+	;   default_driver(Store, Driver)
+	),
+	set_driver(Store, Driver).
+
+default_driver(Store, Driver) :-
+	directory_file_path(Store, ref, RefDir),
+	exists_directory(RefDir), !,
+	Driver = files.
+default_driver(Store, Driver) :-
+	directory_file_path(Store, heads, RefDir),
+	exists_file(RefDir), !,
+	Driver = bdb.
+default_driver(_, files).
+
+set_driver(Store, Driver) :-
+	must_be(atom, Store),
+	(   driver_module(Driver, Module)
+	->  retractall(gitty_store_type(Store, _)),
+	    asserta(gitty_store_type(Store, Module))
+	;   domain_error(gitty_driver, Driver)
+	).
+
+driver_module(files, gitty_driver_files).
+driver_module(bdb,   gitty_driver_bdb).
+
+store_driver_module(Store, Module) :-
+	atom(Store), !,
+	gitty_store_type(Store, Module).
+
+%%	gitty_close(+Store) is det.
+%
+%	Close access to the Store.
+
+gitty_close(Store) :-
+	store_driver_module(Store, M),
+	M:gitty_close(Store).
 
 %%	gitty_file(+Store, ?File, ?Head) is nondet.
 %
@@ -103,8 +148,8 @@ remote_sync(true).
 %	revision.
 
 gitty_file(Store, Head, Hash) :-
-	gitty_scan(Store),
-	head(Store, Head, Hash).
+	store_driver_module(Store, M),
+	M:gitty_file(Store, Head, Hash).
 
 %%	gitty_create(+Store, +Name, +Data, +Meta, -Commit) is det.
 %
@@ -113,17 +158,15 @@ gitty_file(Store, Head, Hash) :-
 %	@arg Commit is a dit describing the new Commit
 
 gitty_create(Store, Name, _Data, _Meta, _) :-
-	gitty_scan(Store),
-	head(Store, Name, _), !,
+	gitty_file(Store, Name, _Hash), !,
 	throw(error(gitty(file_exists(Name)),_)).
 gitty_create(Store, Name, Data, Meta, CommitRet) :-
 	save_object(Store, Data, blob, Hash),
 	get_time(Now),
-	Commit = gitty{}.put(Meta)
-		        .put(_{ name:Name,
-				time:Now,
-				data:Hash
-			      }),
+	Commit = gitty{time:Now}.put(Meta)
+		                .put(_{ name:Name,
+					data:Hash
+				      }),
 	format(string(CommitString), '~q.~n', [Commit]),
 	save_object(Store, CommitString, commit, CommitHash),
 	CommitRet = Commit.put(commit, CommitHash),
@@ -137,19 +180,18 @@ gitty_create(Store, Name, Data, Meta, CommitRet) :-
 %	Update document Name using Data and the given meta information
 
 gitty_update(Store, Name, Data, Meta, CommitRet) :-
-	gitty_scan(Store),
-	head(Store, Name, OldHead),
+	gitty_file(Store, Name, OldHead),
 	(   _{previous:OldHead} >:< Meta
 	->  true
-	;   throw(error(gitty(commit_version(OldHead, Meta.previous)), _))
+	;   throw(error(gitty(commit_version(Name, OldHead, Meta.previous)), _))
 	),
 	load_plain_commit(Store, OldHead, OldMeta),
 	get_time(Now),
 	save_object(Store, Data, blob, Hash),
 	Commit = gitty{}.put(OldMeta)
+			.put(_{time:Now})
 		        .put(Meta)
 		        .put(_{ name:Name,
-				time:Now,
 				data:Hash,
 				previous:OldHead
 			      }),
@@ -161,17 +203,29 @@ gitty_update(Store, Name, Data, Meta, CommitRet) :-
 	      ( delete_object(Store, CommitHash),
 		throw(E))).
 
+%%	gitty_update_head(+Store, +Name, +OldCommit, +NewCommit) is det.
+%
+%	Update the head of a gitty  store   for  Name.  OldCommit is the
+%	current head and NewCommit is the new  head. If Name is created,
+%	and thus there is no head, OldCommit must be `-`.
+%
+%	This operation can fail because another   writer has updated the
+%	head.  This can both be in-process or another process.
+%
+%	@error gitty(file_exists(Name) if the file already exists
+%	@error gitty(not_at_head(Name, OldCommit) if the head was moved
+%	       by someone else.
+
+gitty_update_head(Store, Name, OldCommit, NewCommit) :-
+	store_driver_module(Store, Module),
+	Module:gitty_update_head(Store, Name, OldCommit, NewCommit).
+
 %%	gitty_data(+Store, +NameOrHash, -Data, -Meta) is semidet.
 %
 %	Get the data in object Name and its meta-data
 
 gitty_data(Store, Name, Data, Meta) :-
-	gitty_scan(Store),
-	head(Store, Name, Head), !,
-	load_commit(Store, Head, Meta),
-	load_object(Store, Meta.data, Data).
-gitty_data(Store, Hash, Data, Meta) :-
-	load_commit(Store, Hash, Meta),
+	gitty_commit(Store, Name, Meta),
 	load_object(Store, Meta.data, Data).
 
 %%	gitty_commit(+Store, +NameOrHash, -Meta) is semidet.
@@ -180,8 +234,8 @@ gitty_data(Store, Hash, Data, Meta) :-
 %	is added to the meta-data to specify the commit hash.
 
 gitty_commit(Store, Name, Meta) :-
-	gitty_scan(Store),
-	head(Store, Name, Head), !,
+	must_be(atom, Name),
+	gitty_file(Store, Name, Head), !,
 	load_commit(Store, Head, Meta).
 gitty_commit(Store, Hash, Meta) :-
 	load_commit(Store, Hash, Meta).
@@ -189,14 +243,14 @@ gitty_commit(Store, Hash, Meta) :-
 load_commit(Store, Hash, Meta) :-
 	load_plain_commit(Store, Hash, Meta0),
 	Meta1 = Meta0.put(commit, Hash),
-	(   head(Store, Meta0.name, Hash)
+	(   gitty_file(Store, Meta0.name, Hash)
 	->  Meta = Meta1.put(symbolic, "HEAD")
 	;   Meta = Meta1
 	).
 
 load_plain_commit(Store, Hash, Meta) :-
-	load_object(Store, Hash, String),
-	term_string(Meta, String, []).
+	store_driver_module(Store, Module),
+	Module:load_plain_commit(Store, Hash, Meta).
 
 %%	gitty_history(+Store, +NameOrHash, -History, +Options) is det.
 %
@@ -225,8 +279,7 @@ gitty_history(Store, Name, History, Options) :-
 	).
 
 history_hash_start(Store, Name, Hash) :-
-	gitty_scan(Store),
-	head(Store, Name, Head), !,
+	gitty_file(Store, Name, Head), !,
 	Hash = Head.
 history_hash_start(_, Hash, Hash).
 
@@ -261,35 +314,28 @@ list_prefix(N, [H|T0], [H|T]) :-
 	list_prefix(N2, T0, T).
 
 
-%%	save_object(+Store, +Data, +Type, -Hash)
+%%	save_object(+Store, +Data:string, +Type, -Hash) is det.
 %
 %	Save an object in a git compatible   way. Data provides the data
 %	as a string.
 %
 %	@see http://www.gitguys.com/topics/what-is-the-format-of-a-git-blob/
+%	@bug We currently delete objects if the head cannot be moved.
+%	This can lead to a race condition.   We need to leave that
+%	to GC.
 
 save_object(Store, Data, Type, Hash) :-
-	sha_new_ctx(Ctx0, []),
 	size_in_bytes(Data, Size),
 	format(string(Hdr), '~w ~d\u0000', [Type, Size]),
+	sha_new_ctx(Ctx0, []),
 	sha_hash_ctx(Ctx0, Hdr, Ctx1, _),
 	sha_hash_ctx(Ctx1, Data, _, HashBin),
 	hash_atom(HashBin, Hash),
-	sub_atom(Hash, 0, 2, _, Dir0),
-	sub_atom(Hash, 2, 2, _, Dir1),
-	sub_atom(Hash, 4, _, 0, File),
-	directory_file_path(Store, Dir0, D0),
-	ensure_directory(D0),
-	directory_file_path(D0, Dir1, D1),
-	ensure_directory(D1),
-	directory_file_path(D1, File, Path),
-	(   exists_file(Path)
-	->  true
-	;   setup_call_cleanup(
-		gzopen(Path, write, Out, [encoding(utf8)]),
-		format(Out, '~s~s', [Hdr, Data]),
-		close(Out))
-	).
+	store_object(Store, Hash, Hdr, Data).
+
+store_object(Store, Hash, Hdr, Data) :-
+	store_driver_module(Store, Module),
+	Module:store_object(Store, Hash, Hdr, Data).
 
 size_in_bytes(Data, Size) :-
 	setup_call_cleanup(
@@ -299,10 +345,20 @@ size_in_bytes(Data, Size) :-
 	    ),
 	    close(Out)).
 
-ensure_directory(Dir) :-
-	exists_directory(Dir), !.
-ensure_directory(Dir) :-
-	make_directory(Dir).
+
+%%	fsck_object(+Store, +Hash) is semidet.
+%
+%	Test the integrity of object Hash in Store.
+
+:- public fsck_object/2.
+fsck_object(Store, Hash) :-
+	load_object(Store, Hash, Data, Type, Size),
+	format(string(Hdr), '~w ~d\u0000', [Type, Size]),
+	sha_new_ctx(Ctx0, []),
+	sha_hash_ctx(Ctx0, Hdr, Ctx1, _),
+	sha_hash_ctx(Ctx1, Data, _, HashBin),
+	hash_atom(HashBin, Hash).
+
 
 %%	load_object(+Store, +Hash, -Data) is det.
 %%	load_object(+Store, +Hash, -Data, -Type, -Size) is det.
@@ -312,124 +368,24 @@ ensure_directory(Dir) :-
 load_object(Store, Hash, Data) :-
 	load_object(Store, Hash, Data, _, _).
 load_object(Store, Hash, Data, Type, Size) :-
-	hash_file(Store, Hash, Path),
-	setup_call_cleanup(
-	    gzopen(Path, read, In, [encoding(utf8)]),
-	    read_object(In, Data, Type, Size),
-	    close(In)).
-
-read_object(In, Data, Type, Size) :-
-	get_code(In, C0),
-	read_hdr(C0, In, Hdr),
-	phrase((nonblanks(TypeChars), " ", integer(Size)), Hdr),
-	atom_codes(Type, TypeChars),
-	read_string(In, _, Data).
-
-read_hdr(C, In, [C|T]) :-
-	C > 0, !,
-	get_code(In, C1),
-	read_hdr(C1, In, T).
-read_hdr(_, _, []).
-
-%%	gitty_rescan(?Store) is det.
-%
-%	Update our view of the shared   storage  for all stores matching
-%	Store.
-
-gitty_rescan(Store) :-
-	retractall(store(Store, _)).
-
-%%	gitty_scan(+Store) is det.
-%
-%	Scan gitty store for files (entries),   filling  head/3. This is
-%	performed lazily at first access to the store.
-%
-%	@tdb	Possibly we need to maintain a cached version of this
-%		index to avoid having to open all objects of the gitty
-%		store.
-
-gitty_scan(Store) :-
-	store(Store, _), !,
-	(   remote_sync(true)
-	->  with_mutex(gitty, remote_updates(Store))
-	;   true
-	).
-gitty_scan(Store) :-
-	with_mutex(gitty, gitty_scan_sync(Store)).
-
-:- thread_local
-	latest/3.
-
-gitty_scan_sync(Store) :-
-	store(Store, _), !.
-gitty_scan_sync(Store) :-
-	gitty_scan_latest(Store),
-	forall(retract(latest(Name, Hash, _Time)),
-	       assert(head(Store, Name, Hash))),
-	get_time(Now),
-	assertz(store(Store, Now)).
-
-%%	gitty_scan_latest(+Store)
-%
-%	Scans the gitty store, extracting  the   latest  version of each
-%	named entry.
-
-gitty_scan_latest(Store) :-
-	retractall(head(Store, _, _)),
-	retractall(latest(_, _, _)),
-	(   gitty_hash(Store, Hash),
-	    load_object(Store, Hash, Data, commit, _Size),
-	    term_string(Meta, Data, []),
-	    _{name:Name, time:Time} :< Meta,
-	    (	latest(Name, _, OldTime),
-		OldTime > Time
-	    ->	true
-	    ;	retractall(latest(Name, _, _)),
-		assertz(latest(Name, Hash, Time))
-	    ),
-	    fail
-	;   true
-	).
-
+	store_driver_module(Store, Module),
+	Module:load_object(Store, Hash, Data, Type, Size).
 
 %%	gitty_hash(+Store, ?Hash) is nondet.
 %
 %	True when Hash is an object in the store.
 
 gitty_hash(Store, Hash) :-
-	var(Hash), !,
-	access_file(Store, exist),
-	directory_files(Store, Level0),
-	member(E0, Level0),
-	E0 \== '..',
-	atom_length(E0, 2),
-	directory_file_path(Store, E0, Dir0),
-	directory_files(Dir0, Level1),
-	member(E1, Level1),
-	E1 \== '..',
-	atom_length(E1, 2),
-	directory_file_path(Dir0, E1, Dir),
-	directory_files(Dir, Files),
-	member(File, Files),
-	atom_length(File, 36),
-	atomic_list_concat([E0,E1,File], Hash).
-gitty_hash(Store, Hash) :-
-	hash_file(Store, Hash, File),
-	exists_file(File).
+	store_driver_module(Store, Module),
+	Module:gitty_hash(Store, Hash).
 
 %%	delete_object(+Store, +Hash)
 %
 %	Delete an existing object
 
 delete_object(Store, Hash) :-
-	hash_file(Store, Hash, File),
-	delete_file(File).
-
-hash_file(Store, Hash, Path) :-
-	sub_atom(Hash, 0, 2, _, Dir0),
-	sub_atom(Hash, 2, 2, _, Dir1),
-	sub_atom(Hash, 4, _, 0, File),
-	atomic_list_concat([Store, Dir0, Dir1, File], /, Path).
+	store_driver_module(Store, Module),
+	Module:delete_object(Store, Hash).
 
 %%	gitty_reserved_meta(?Key) is nondet.
 %
@@ -440,126 +396,32 @@ gitty_reserved_meta(time).
 gitty_reserved_meta(data).
 gitty_reserved_meta(previous).
 
-
 		 /*******************************
-		 *	      SYNCING		*
+		 *	    FSCK SUPPORT	*
 		 *******************************/
 
-%%	gitty_update_head(+Store, +Name, +OldCommit, +NewCommit) is det.
-%
-%	Update the head of a gitty  store   for  Name.  OldCommit is the
-%	current head and NewCommit is the new  head. If Name is created,
-%	and thus there is no head, OldCommit must be `-`.
-%
-%	This operation can fail because another   writer has updated the
-%	head.  This can both be in-process or another process.
-
-gitty_update_head(Store, Name, OldCommit, NewCommit) :-
-	with_mutex(gitty,
-		   gitty_update_head_sync(Store, Name, OldCommit, NewCommit)).
-
-gitty_update_head_sync(Store, Name, OldCommit, NewCommit) :-
-	remote_sync(true), !,
-	setup_call_cleanup(
-	    heads_output_stream(Store, HeadsOut),
-	    gitty_update_head_sync(Store, Name, OldCommit, NewCommit, HeadsOut),
-	    close(HeadsOut)).
-gitty_update_head_sync(Store, Name, OldCommit, NewCommit) :-
-	gitty_update_head_sync2(Store, Name, OldCommit, NewCommit).
-
-gitty_update_head_sync(Store, Name, OldCommit, NewCommit, HeadsOut) :-
-	gitty_update_head_sync2(Store, Name, OldCommit, NewCommit),
-	format(HeadsOut, '~q.~n', [head(Name, OldCommit, NewCommit)]).
-
-gitty_update_head_sync2(Store, Name, OldCommit, NewCommit) :-
-	gitty_scan(Store),		% fetch remote changes
-	(   OldCommit == (-)
-	->  (   head(Store, Name, _)
-	    ->	throw(error(gitty(file_exists(Name),_)))
-	    ;	assertz(head(Store, Name, NewCommit))
-	    )
-	;   (   retract(head(Store, Name, OldCommit))
-	    ->	assertz(head(Store, Name, NewCommit))
-	    ;	throw(error(gitty(not_at_head(Name, OldCommit)), _))
-	    )
-	).
+:- public
+	delete_object/2,
+	delete_head/2,
+	set_head/3.
 
-remote_updates(Store) :-
-	remote_updates(Store, List),
-	maplist(update_head(Store), List).
+%%	delete_head(+Store, +Head) is det.
+%
+%	Delete Head from the administration.  Used if the head is
+%	inconsistent.
 
-update_head(Store, head(Name, OldCommit, NewCommit)) :-
-	(   OldCommit == (-)
-	->  \+ head(Store, Name, _)
-	;   retract(head(Store, Name, OldCommit))
-	), !,
-	assert(head(Store, Name, NewCommit)).
-update_head(_, _).
+delete_head(Store, Head) :-
+	store_driver_module(Store, Module),
+	Module:delete_head(Store, Head).
 
-%%	remote_updates(+Store, -List) is det.
+%%	set_head(+Store, +File, +Head) is det.
 %
-%	Find updates from other gitties  on   the  same filesystem. Note
-%	that we have to push/pop the input   context to avoid creating a
-%	notion of an  input  context   which  possibly  relate  messages
-%	incorrectly to the sync file.
-
-remote_updates(Store, List) :-
-	heads_input_stream(Store, Stream),
-	setup_call_cleanup(
-	    '$push_input_context'(gitty_sync),
-	    read_new_terms(Stream, List),
-	    '$pop_input_context').
-
-read_new_terms(Stream, Terms) :-
-	read(Stream, First),
-	read_new_terms(First, Stream, Terms).
-
-read_new_terms(end_of_file, _, List) :- !,
-	List = [].
-read_new_terms(Term, Stream, [Term|More]) :-
-	read(Stream, Term2),
-	read_new_terms(Term2, Stream, More).
-
-heads_output_stream(Store, Out) :-
-	heads_file(Store, HeadsFile),
-	open(HeadsFile, append, Out,
-	     [ encoding(utf8),
-	       lock(exclusive)
-	     ]).
-
-heads_input_stream(Store, Stream) :-
-	heads_input_stream_cache(Store, Stream0), !,
-	Stream = Stream0.
-heads_input_stream(Store, Stream) :-
-	heads_file(Store, File),
-	between(1, 2, _),
-	catch(open(File, read, In,
-		   [ encoding(utf8),
-		     eof_action(reset)
-		   ]),
-	      _,
-	      create_heads_file(Store)), !,
-	assert(heads_input_stream_cache(Store, In)),
-	Stream = In.
-
-create_heads_file(Store) :-
-	call_cleanup(
-	    heads_output_stream(Store, Out),
-	    close(Out)),
-	fail.					% always fail!
+%	Register Head as the Head hash for File, removing possible
+%	old head.
 
-heads_file(Store, HeadsFile) :-
-	ensure_directory(Store),
-	directory_file_path(Store, ref, RefDir),
-	ensure_directory(RefDir),
-	directory_file_path(RefDir, head, HeadsFile).
-
-:- multifile
-	prolog:error_message//1.
-
-prolog:error_message(gitty(not_at_head(Name, _OldCommit))) -->
-	[ 'Gitty: cannot update head for "~w" because it was \c
-	   updated by someone else'-[Name] ].
+set_head(Store, File, Head) :-
+	store_driver_module(Store, Module),
+	Module:set_head(Store, File, Head).
 
 
 		 /*******************************
@@ -877,3 +739,19 @@ longest(L1, L2, Longest) :-
 	->  Longest = L1
 	;   Longest = L2
 	).
+
+		 /*******************************
+		 *	      MESSAGES		*
+		 *******************************/
+:- multifile
+	prolog:error_message//1.
+
+prolog:error_message(gitty(not_at_head(Name, _OldCommit))) -->
+	[ 'Gitty: cannot update head for "~w" because it was \c
+	   updated by someone else'-[Name] ].
+prolog:error_message(gitty(file_exists(Name))) -->
+	[ 'Gitty: File exists: ~p'-[Name] ].
+prolog:error_message(gitty(commit_version(Name, _Head, _Previous))) -->
+	[ 'Gitty: ~p: cannot update (modified by someone else)'-[Name] ].
+
+
diff --git a/lib/trill_on_swish/help.pl b/lib/trill_on_swish/help.pl
index b7b0630..3b7b904 100644
--- a/lib/trill_on_swish/help.pl
+++ b/lib/trill_on_swish/help.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_help, []).
+:- module(swish_help, []).
 :- use_module(library(http/http_dispatch)).
 :- use_module(library(http/http_server_files)).
 
@@ -38,8 +38,8 @@ This module serves help information for SWISH.
 @tbd	Server SWI-Prolog Markdown files.
 */
 
-:- http_handler(trill_on_swish(help), serve_files_in_directory(swish_help),
+:- http_handler(swish(help), serve_files_in_directory(swish_help),
 		[id(help),prefix]).
 
-user:file_search_path(swish_help, trill_on_swish(web/help)).
+user:file_search_path(swish_help, swish(web/help)).
 
diff --git a/lib/trill_on_swish/highlight.pl b/lib/trill_on_swish/highlight.pl
index ca708f3..7d29b17 100644
--- a/lib/trill_on_swish/highlight.pl
+++ b/lib/trill_on_swish/highlight.pl
@@ -27,8 +27,8 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_highlight,
-	  [
+:- module(swish_highlight,
+	  [ current_highlight_state/2
 	  ]).
 :- use_module(library(debug)).
 :- use_module(library(http/http_dispatch)).
@@ -46,7 +46,7 @@
 :- use_module(library(helpidx), [predicate/5]).
 :- endif.
 
-http:location(codemirror, trill_on_swish(cm), []).
+http:location(codemirror, swish(cm), []).
 
 :- http_handler(codemirror(.),      http_404([]),      [id(cm_highlight)]).
 :- http_handler(codemirror(change), codemirror_change, []).
@@ -154,13 +154,13 @@ insert([H|T], TB, ChPos0, ChPos, Changed) :-
 	->  Len	= 0
 	;   Changed = true,
 	    string_length(H, Len),
-	    debug(trill_on_swish(change), 'Insert ~q at ~d', [H, ChPos0]),
+	    debug(cm(change), 'Insert ~q at ~d', [H, ChPos0]),
 	    insert_memory_file(TB, ChPos0, H)
 	),
 	ChPos1 is ChPos0+Len,
 	(   T == []
 	->  ChPos2 = ChPos1
-	;   debug(trill_on_swish(change), 'Adding newline at ~d', [ChPos1]),
+	;   debug(cm(change), 'Adding newline at ~d', [ChPos1]),
 	    Changed = true,
 	    insert_memory_file(TB, ChPos1, '\n'),
 	    ChPos2 is ChPos1+1
@@ -168,7 +168,8 @@ insert([H|T], TB, ChPos0, ChPos, Changed) :-
 	insert(T, TB, ChPos2, ChPos, Changed).
 
 :- dynamic
-	current_editor/3,			% UUID, MemFile, Role
+	current_editor/4,			% UUID, MemFile, Role, Time
+	editor_last_access/2,			% UUID, Time
 	xref_upto_data/1.			% UUID
 
 create_editor(UUID, Editor, Change) :-
@@ -179,7 +180,25 @@ create_editor(UUID, Editor, Change) :-
 	->  atom_string(Role, RoleString)
 	;   Role = source
 	),
-	asserta(current_editor(UUID, Editor, Role)).
+	get_time(Now),
+	asserta(current_editor(UUID, Editor, Role, Now)).
+
+%%	current_highlight_state(?UUID, -State) is nondet.
+%
+%	Return info on the current highlighter
+
+current_highlight_state(UUID,
+			highlight{data:Editor,
+				  role:Role,
+				  created:Created,
+				  access:Access
+				 }) :-
+	current_editor(UUID, Editor, Role, Created),
+	(   editor_last_access(Editor, Access)
+	->  true
+	;   Access = Created
+	).
+
 
 %%	uuid_like(+UUID) is semidet.
 %
@@ -190,7 +209,7 @@ create_editor(UUID, Editor, Change) :-
 uuid_like(UUID) :-
 	split_string(UUID, "-", "", Parts),
 	maplist(string_length, Parts, [8,4,4,4,12]),
-	\+ current_editor(UUID, _, _).
+	\+ current_editor(UUID, _, _, _).
 
 %%	destroy_editor(+UUID)
 %
@@ -200,27 +219,96 @@ uuid_like(UUID) :-
 destroy_editor(UUID) :-
 	must_be(atom, UUID),
 	retractall(xref_upto_data(UUID)),
-	current_editor(UUID, Editor, _), !,
+	retractall(editor_last_access(UUID, _)),
+	current_editor(UUID, Editor, _, _), !,
 	(   xref_source_id(Editor, SourceID)
 	->  xref_clean(SourceID),
 	    destroy_state_module(UUID)
 	;   true
 	),
 	% destroy late to make xref_source_identifier/2 work.
-	retractall(current_editor(UUID, Editor, _)),
+	retractall(current_editor(UUID, Editor, _, _)),
 	free_memory_file(Editor).
 destroy_editor(_).
 
+%%	gc_editors
+%
+%	Garbage collect all editors that have   not been accessed for 60
+%	minutes.
+%
+%	@tbd  Normally,  deleting  a  highlight    state   can  be  done
+%	aggressively as it will be recreated  on demand. But, coloring a
+%	query passes the UUIDs of related sources and as yet there is no
+%	way to restore this. We could fix  that by replying to the query
+%	colouring with the UUIDs for which we do not have sources, after
+%	which the client retry the query-color request with all relevant
+%	sources.
+
+:- dynamic
+	gced_editors/1.
+
+editor_max_idle_time(3600).
+
+gc_editors :-
+	get_time(Now),
+	(   gced_editors(Then),
+	    editor_max_idle_time(MaxIdle),
+	    Now - Then < MaxIdle/3
+	->  true
+	;   retractall(gced_editors(_)),
+	    asserta(gced_editors(Now)),
+	    fail
+	).
+gc_editors :-
+	editor_max_idle_time(MaxIdle),
+	forall(garbage_editor(UUID, MaxIdle),
+	       destroy_old_editor(UUID)).
+
+garbage_editor(UUID, TimeOut) :-
+	get_time(Now),
+	current_editor(UUID, _TB, _Role, Created),
+	Now - Created > TimeOut,
+	(   editor_last_access(UUID, Access)
+	->  Now - Access > TimeOut
+	;   true
+	).
+
+destroy_old_editor(UUID) :-
+	with_mutex(swish_gc_editor,
+		   destroy_old_editor_sync(UUID)).
+
+destroy_old_editor_sync(UUID) :-
+	editor_max_idle_time(MaxIdle),
+	garbage_editor(UUID, MaxIdle), !,
+	debug(cm(gc), 'GC highlight state for ~q', [UUID]),
+	destroy_editor(UUID).
+destroy_old_editor_sync(_).
+
+%%	fetch_editor(+UUID, -MemFile) is semidet.
+%
+%	Fetch existing editor for source UUID. Make sure the last access
+%	time is updated to avoid concurrent GC of the editor.
+
+fetch_editor(UUID, TB) :-
+	with_mutex(swish_gc_editor,
+		   ( current_editor(UUID, TB, _Role, _),
+		     update_access(UUID)
+		   )).
+
+update_access(UUID) :-
+	get_time(Now),
+	retractall(editor_last_access(UUID, _)),
+	asserta(editor_last_access(UUID, Now)).
 
 :- multifile
 	prolog:xref_source_identifier/2,
 	prolog:xref_open_source/2.
 
 prolog:xref_source_identifier(UUID, UUID) :-
-	current_editor(UUID, _, _).
+	current_editor(UUID, _, _, _).
 
 prolog:xref_open_source(UUID, Stream) :-
-	current_editor(UUID, TB, _Role), !,
+	current_editor(UUID, TB, _Role, _), !,
 	open_memory_file(TB, read, Stream).
 
 
@@ -234,8 +322,8 @@ codemirror_leave(Request) :-
 	http_read_json_dict(Request, Data, []),
 	debug(cm(leave), 'Leaving editor ~p', [Data]),
 	(   atom_string(UUID, Data.get(uuid))
-	->  forall(current_editor(UUID, _TB, _Role),
-		   destroy_editor(UUID))
+	->  forall(current_editor(UUID, _TB, _Role, _),
+		   with_mutex(swish_gc_editor, destroy_editor(UUID)))
 	;   true
 	),
 	reply_json_dict(true).
@@ -246,7 +334,7 @@ codemirror_leave(Request) :-
 
 mark_changed(MemFile, Changed) :-
 	(   Changed == true
-	->  current_editor(UUID, MemFile, _Role),
+	->  current_editor(UUID, MemFile, _Role, _),
 	    retractall(xref_upto_data(UUID))
 	;   true
 	).
@@ -256,7 +344,7 @@ mark_changed(MemFile, Changed) :-
 xref(UUID) :-
 	xref_upto_data(UUID), !.
 xref(UUID) :-
-	current_editor(UUID, MF, _Role),
+	current_editor(UUID, MF, _Role, _),
 	xref_source_id(MF, SourceId),
 	xref_state_module(MF, Module),
 	xref_source(SourceId,
@@ -280,7 +368,7 @@ xref(UUID) :-
 %	;   SourceId = Master
 %	).
 xref_source_id(TB, UUID) :-
-	current_editor(UUID, TB, _Role).
+	current_editor(UUID, TB, _Role, _).
 
 %%	xref_state_module(+TB, -Module) is semidet.
 %
@@ -288,11 +376,11 @@ xref_source_id(TB, UUID) :-
 %	temporary module based on the UUID of the source.
 
 xref_state_module(TB, UUID) :-
-	current_editor(UUID, TB, _Role),
+	current_editor(UUID, TB, _Role, _),
 	(   module_property(UUID, class(temporary))
 	->  true
 	;   set_module(UUID:class(temporary)),
-	    add_import_module(UUID, trill_on_swish, start)
+	    add_import_module(UUID, swish, start)
 	).
 
 destroy_state_module(UUID) :-
@@ -320,29 +408,52 @@ codemirror_tokens(Request) :-
 	    ;	change_failed(Data.uuid, Reason)
 	    )
 	;   reply_json_dict(json{tokens:[[]]})
-	).
+	),
+	gc_editors.
 
 
 enriched_tokens(TB, _Data, Tokens) :-		% source window
-	current_editor(UUID, TB, source), !,
+	current_editor(UUID, TB, source, _), !,
 	xref(UUID),
 	server_tokens(TB, Tokens).
 enriched_tokens(TB, Data, Tokens) :-		% query window
-	(   [SourceIdS|_] = Data.get(sourceID)
-	->  true
-	;   SourceIdS = Data.get(sourceID),
-	    atomic(SourceIdS)
-	), !,
-	atom_string(SourceID, SourceIdS),
+	json_source_id(Data.get(sourceID), SourceID), !,
 	memory_file_to_string(TB, Query),
 	with_mutex(swish_highlight_query,
 		   prolog_colourise_query(Query, SourceID, colour_item(TB))),
 	collect_tokens(TB, Tokens).
 enriched_tokens(TB, _Data, Tokens) :-
 	memory_file_to_string(TB, Query),
-	prolog_colourise_query(Query, module(trill_on_swish), colour_item(TB)),
+	prolog_colourise_query(Query, module(swish), colour_item(TB)),
 	collect_tokens(TB, Tokens).
 
+%%	json_source_id(+Input, -SourceID)
+%
+%	Translate the Input, which is  either  a   string  or  a list of
+%	strings into an  atom  or  list   of  atoms.  Older  versions of
+%	SWI-Prolog only accept a single atom source id.
+
+:- if(current_predicate(prolog_colour:to_list/2)).
+json_source_id(StringList, SourceIDList) :-
+	is_list(StringList),
+	StringList \== [], !,
+	maplist(string_source_id, StringList, SourceIDList).
+:- else.				% old version (=< 7.3.7)
+json_source_id([String|_], SourceID) :-
+	maplist(string_source_id, String, SourceID).
+:- endif.
+json_source_id(String, SourceID) :-
+	string(String),
+	string_source_id(String, SourceID).
+
+string_source_id(String, SourceID) :-
+	atom_string(SourceID, String),
+	(   fetch_editor(SourceID, _TB)
+	->  true
+	;   true
+	).
+
+
 %%	shadow_editor(+Data, -MemoryFile) is det.
 %
 %	Get our shadow editor:
@@ -362,7 +473,7 @@ enriched_tokens(TB, _Data, Tokens) :-
 
 shadow_editor(Data, TB) :-
 	atom_string(UUID, Data.get(uuid)),
-	current_editor(UUID, TB, _Role), !,
+	fetch_editor(UUID, TB), !,
 	(   Text = Data.get(text)
 	->  size_memory_file(TB, Size),
 	    delete_memory_file(TB, 0, Size),
@@ -379,7 +490,7 @@ shadow_editor(Data, TB) :-
 	Text = Data.get(text), !,
 	atom_string(UUID, Data.uuid),
 	create_editor(UUID, TB, Data),
-	debug(trill_on_swish(change), 'Initialising editor to ~q', [Text]),
+	debug(cm(change), 'Initialising editor to ~q', [Text]),
 	insert_memory_file(TB, 0, Text).
 shadow_editor(Data, TB) :-
 	_{role:_} :< Data, !,
@@ -407,12 +518,12 @@ shadow_editor(_Data, _TB) :-
 	server_tokens/1.
 
 show_mirror(Role) :-
-	current_editor(_UUID, TB, Role), !,
+	current_editor(_UUID, TB, Role, _), !,
 	memory_file_to_string(TB, String),
 	write(user_error, String).
 
 server_tokens(Role) :-
-	current_editor(_UUID, TB, Role), !,
+	current_editor(_UUID, TB, Role, _), !,
 	enriched_tokens(TB, _{}, Tokens),
 	print_term(Tokens, [output(user_error)]).
 
@@ -422,7 +533,7 @@ server_tokens(Role) :-
 %		represents the tokens found in a single toplevel term.
 
 server_tokens(TB, GroupedTokens) :-
-	current_editor(UUID, TB, _Role),
+	current_editor(UUID, TB, _Role, _),
 	setup_call_cleanup(
 	    open_memory_file(TB, read, Stream),
 	    ( set_stream_file(TB, Stream),
@@ -535,7 +646,7 @@ colour_item(_TB, Style, Start, Len) :-
 %	Attributes.
 %
 %	Additional translations can be defined by   adding rules for the
-%	multifile predicate trill_on_swish:style/3. The base   type, which refers
+%	multifile predicate swish:style/3. The base   type, which refers
 %	to the type generated by the   SWISH tokenizer must be specified
 %	by adding an  attribute  base(BaseType).   For  example,  if the
 %	colour system classifies an  atom  as   refering  to  a database
@@ -543,7 +654,7 @@ colour_item(_TB, Style, Start, Len) :-
 %	following rule should ensure consistent mapping:
 %
 %	  ==
-%	  trill_on_swish_highlight:style(db_column(Name),
+%	  swish_highlight:style(db_column(Name),
 %				db_column, [text, base(atom)]).
 %	  ==
 
@@ -579,6 +690,7 @@ style(meta(_Spec),	 meta,				   []).
 style(op_type(_Type),	 op_type,			   [text]).
 style(functor,		 functor,			   [text]).
 style(control,		 control,			   [text]).
+style(delimiter,	 delimiter,			   [text]).
 style(identifier,	 identifier,			   [text]).
 style(module(_Module),   module,			   [text]).
 style(error,		 error,				   [text]).
@@ -602,11 +714,13 @@ style(dict_function(F),  dict_function,			   [text(F)]).
 style(empty_list,	 list_open-list_close,		   []).
 style(list,		 list_open-list_close,		   []).
 style(dcg(terminal),	 list_open-list_close,		   []).
+style(dcg(string),	 string_terminal,		   []).
 style(dcg(plain),	 brace_term_open-brace_term_close, []).
 style(brace_term,	 brace_term_open-brace_term_close, []).
 style(dict_content,	 dict_open-dict_close,             []).
 style(expanded,		 expanded,			   [text]).
 style(comment_string,	 comment_string,		   []).
+style(ext_quant,	 ext_quant,			   []).
 					% from library(http/html_write)
 style(html(_Element),	 html,				   []).
 style(entity(_Element),	 entity,			   []).
@@ -629,21 +743,21 @@ neck_text(method(send), (:->)).
 neck_text(method(get),  (:<-)).
 neck_text(directive,    (:-)).
 
-head_type(exported,	head_exported).
-head_type(public(_),	head_public).
-head_type(extern(_),	head_extern).
-head_type(dynamic,	head_dynamic).
-head_type(multifile,	head_multifile).
-head_type(unreferenced,	head_unreferenced).
-head_type(hook,		head_hook).
-head_type(meta,		head_meta).
-head_type(constraint,	head_constraint).
-head_type(imported,	head_imported).
-head_type(built_in,	head_built_in).
-head_type(iso,		head_iso).
-head_type(def_iso,	head_def_iso).
-head_type(def_swi,	head_def_swi).
-head_type(_,		head).
+head_type(exported,	 head_exported).
+head_type(public(_),	 head_public).
+head_type(extern(_),	 head_extern).
+head_type(dynamic,	 head_dynamic).
+head_type(multifile,	 head_multifile).
+head_type(unreferenced,	 head_unreferenced).
+head_type(hook,		 head_hook).
+head_type(meta,		 head_meta).
+head_type(constraint(_), head_constraint).
+head_type(imported,	 head_imported).
+head_type(built_in,	 head_built_in).
+head_type(iso,		 head_iso).
+head_type(def_iso,	 head_def_iso).
+head_type(def_swi,	 head_def_swi).
+head_type(_,		 head).
 
 goal_type(built_in,	      goal_built_in,	 []).
 goal_type(imported(File),     goal_imported,	 [file(File)]).
@@ -677,10 +791,10 @@ goal_arity(Goal, Arity) :-
 		 *******************************/
 
 :- multifile
-	trill_on_swish_config:config/2,
+	swish_config:config/2,
 	css/3.				% ?Context, ?Selector, -Attributes
 
-%%	trill_on_swish_config:config(-Name, -Styles) is nondet.
+%%	swish_config:config(-Name, -Styles) is nondet.
 %
 %	Provides the object `config.swish.style`,  a   JSON  object that
 %	maps   style   properties   of    user-defined   extensions   of
@@ -689,12 +803,12 @@ goal_arity(Goal, Arity) :-
 %
 %	@tbd	Provide summary information
 
-trill_on_swish_config:config(cm_style, Styles) :-
+swish_config:config(cm_style, Styles) :-
 	findall(Name-Style, highlight_style(Name, Style), Pairs),
 	keysort(Pairs, Sorted),
 	remove_duplicate_styles(Sorted, Unique),
 	dict_pairs(Styles, json, Unique).
-trill_on_swish_config:config(cm_hover_style, Styles) :-
+swish_config:config(cm_hover_style, Styles) :-
 	findall(Sel-Attrs, css_dict(hover, Sel, Attrs), Pairs),
 	dict_pairs(Styles, json, Pairs).
 
diff --git a/lib/trill_on_swish/include.pl b/lib/trill_on_swish/include.pl
index 49bac5a..c01c7a0 100644
--- a/lib/trill_on_swish/include.pl
+++ b/lib/trill_on_swish/include.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_include,
+:- module(swish_include,
 	  [
 	  ]).
 :- use_module(gitty).
@@ -50,21 +50,23 @@ We allow for hierarchical and circular includes.
 */
 
 
-trill_on_swish:term_expansion(:- include(FileIn), Expansion) :-
+swish:term_expansion(:- include(FileIn), Expansion) :-
 	atomic(FileIn),
 	atom_string(File, FileIn),
 	(   prolog_load_context(module, Module),
-	    clause(Module:'trill_on_swish included'(File), true)
+	    clause(Module:'swish included'(File), true)
 	->  Expansion = []
-	;   Expansion = [ (:- discontiguous('trill_on_swish included'/1)),
-		          'trill_on_swish included'(File),
+	;   Expansion = [ (:- discontiguous('swish included'/1)),
+		          'swish included'(File),
 		          (:- include(stream(Id, Stream, [close(true)])))
 			],
-	    setting(trill_on_swish_web_storage:directory, Store),
+	    '$push_input_context'(swish_include),
+	    setting(web_storage:directory, Store),
 	    add_extension(File, FileExt),
 	    catch(gitty_data(Store, FileExt, Data, _Meta), _, fail),
-	    atom_concat('trill_on_swish://', FileExt, Id),
-	    open_string(Data, Stream)
+	    atom_concat('swish://', FileExt, Id),
+	    open_string(Data, Stream),
+	    '$pop_input_context'
 	).
 
 add_extension(File, FileExt) :-
@@ -90,7 +92,7 @@ is_hash(Name) :-
 
 sandbox:safe_directive(M:include(stream(Id, Stream, [close(true)]))) :-
 	is_stream(Stream),
-	sub_atom(Id, 0, _, _, 'trill_on_swish://'),
+	sub_atom(Id, 0, _, _, 'swish://'),
 	prolog_load_context(module, M).
 
 
@@ -109,10 +111,10 @@ prolog_colour:term_colours((:- include(File)),
 			   ]) :-
 	debug(include, 'Classifying ~p', [File]),
 	(   atomic(File),
-	    setting(trill_on_swish_web_storage:directory, Store),
+	    setting(web_storage:directory, Store),
 	    add_extension(File, FileExt),
 	    catch(gitty_commit(Store, FileExt, _Meta), _, fail)
-	->  atom_concat('trill_on_swish://', FileExt, Id),
+	->  atom_concat('swish://', FileExt, Id),
 	    FileClass = file(Id)
 	;   FileClass = nofile
 	),
@@ -125,13 +127,46 @@ prolog_colour:term_colours((:- include(File)),
 
 :- multifile
 	prolog:xref_open_source/2,
-	prolog:xref_source_file/3.
+	prolog:xref_source_file/3,
+	prolog:xref_source_identifier/2,
+	prolog:xref_source_time/2.
+
+%%	prolog:xref_source_identifier(+Src, -Id) is semidet.
+%%	prolog:xref_open_source(+File, -Stream) is det.
+%%	prolog:xref_source_time(+File, -Modified) is det.
+%
+%	Map swish://file to a file from the gitty store.
+
+prolog:xref_source_identifier(Src, Id) :-
+	atom(Src),
+	sub_atom(Src, 0, _, _, 'swish://'), !,
+	Id = Src.
 
 prolog:xref_open_source(File, Stream) :-
-	atom_concat('trill_on_swish://', Name, File),
-	setting(trill_on_swish_web_storage:directory, Store),
+	atom(File),
+	atom_concat('swish://', Name, File),
+	setting(web_storage:directory, Store),
 	catch(gitty_data(Store, Name, Data, _Meta), _, fail),
 	open_string(Data, Stream).
 
+prolog:xref_source_time(File, Modified) :-
+	atom(File),
+	atom_concat('swish://', Name, File),
+	setting(web_storage:directory, Store),
+	catch(gitty_commit(Store, Name, Meta), _, fail),
+	Modified = Meta.get(time).
+
+%%	prolog:xref_source_file(+Term, -Path, +Options)
+%
+%	Deal with the above expansion for :- include(program) to support
+%	the cross-referencer.
+
 prolog:xref_source_file(stream(Id, _Stream, [close(true)]), Id, _).
+prolog:xref_source_file(File, Id, Options) :-
+	atom(File),
+	option(relative_to(Src), Options),
+	atom(Src),
+	sub_atom(Src, 0, _, _, 'swish://'),
+	add_extension(File, FileExt),
+	atom_concat('swish://', FileExt, Id).
 
diff --git a/lib/trill_on_swish/logging.pl b/lib/trill_on_swish/logging.pl
index 55f10e5..55339aa 100644
--- a/lib/trill_on_swish/logging.pl
+++ b/lib/trill_on_swish/logging.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_logging,
+:- module(swish_logging,
 	  [
 	  ]).
 :- use_module(library(http/http_log)).
@@ -46,26 +46,50 @@ and just `Hash` for subsequent occurrences.
   ==
 */
 
-:- setting(trill_on_swish:logging, boolean, true,
+:- setting(swish:logging, boolean, true,
 	   "Enable/disable logging of SWISH query execution").
 
-:- listen(pengine(Action), trill_on_swish_log(Action)).
+:- listen(pengine(Action), swish_log(Action)).
 
-trill_on_swish_log(create(Pengine, Application, Options0)) :-
+swish_log(create(Pengine, Application, Options0)) :-
 	maplist(hash_option, Options0, Options),
 	get_time(Now),
 	format_time(string(HDate), '%+', Now),
 	http_log('/*~s*/ pengine(~3f, ~q).~n',
 		 [HDate, Now, create(Pengine, Application, Options)]).
+swish_log(send(Pengine, Event)) :-
+	get_time(Now),
+	format_time(string(HDate), '%+', Now),
+	http_log('/*~s*/ pengine(~3f, ~q).~n',
+		 [HDate, Now, send(Pengine, Event)]).
 
 :- dynamic
-	text_hash/2.
+	text_hash/3,
+	gc_text_hash_time/1.
 
 hash_option(src_text(Text), src_text(Result)) :- !,
-	(   text_hash(Text, Hash)
+	(   text_hash(Text, _, Hash)
 	->  Result = Hash
 	;   variant_sha1(Text, Hash),
-	    assert(text_hash(Text, Hash)),
+	    get_time(Now),
+	    assert(text_hash(Text, Now, Hash)),
+	    gc_text_hash,
 	    Result = Hash-Text
 	).
 hash_option(Option, Option).
+
+gc_text_hash :-
+	gc_text_hash_time(Last),
+	get_time(Now),
+	Now - Last < 900, !.
+gc_text_hash :-
+	get_time(Now),
+	retractall(gc_text_hash_time(_)),
+	asserta(gc_text_hash_time(Now)),
+	Before is Now - 3600,
+	(   text_hash(Text, Time, Hash),
+	    Time < Before,
+	    retractall(text_hash(Text, Time, Hash)),
+	    fail
+	;   true
+	).
diff --git a/lib/trill_on_swish/markdown.pl b/lib/trill_on_swish/markdown.pl
index 4eb0150..eb39d8e 100644
--- a/lib/trill_on_swish/markdown.pl
+++ b/lib/trill_on_swish/markdown.pl
@@ -27,9 +27,10 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_markdown, []).
+:- module(swish_markdown, []).
 :- use_module(library(http/http_dispatch)).
 :- use_module(library(http/http_parameters)).
+:- use_module(library(http/http_client)).
 :- use_module(library(http/html_write)).
 :- use_module(library(http/html_head)).
 :- use_module(library(pldoc/doc_html),
@@ -47,7 +48,7 @@
 This module translates markdown cells for teh SWISH Notebook into HTML
 */
 
-:- http_handler(trill_on_swish(markdown), markdown, [id(markdown)]).
+:- http_handler(swish(markdown), markdown, [id(markdown)]).
 
 %%	markdown(+Request)
 %
@@ -55,6 +56,7 @@ This module translates markdown cells for teh SWISH Notebook into HTML
 %	document.
 
 markdown(Request) :-
+	option(method(get), Request), !,
         http_parameters(Request,
                         [ text(Data, [optional(true), default('')])
                         ]),
@@ -63,6 +65,13 @@ markdown(Request) :-
         phrase(html(DOM), Tokens),
         format('Content-type: text/html; charset=UTF-8\n\n'),
         print_html(Tokens).
+markdown(Request) :-
+	option(method(post), Request), !,
+	http_read_data(Request, Codes, [to(codes)]),
+	wiki_file_codes_to_dom(Codes, '/', DOM),
+	phrase(html(DOM), Tokens),
+        format('Content-type: text/html; charset=UTF-8\n\n'),
+        print_html(Tokens).
 
 %%      wiki_codes_to_dom(+Codes, +File, -DOM)
 %
@@ -91,8 +100,6 @@ wiki_file_codes_to_dom(String, File, DOM) :-
 
 prolog:doc_autolink_extension(swinb, notebook).
 
-prolog:doc_autolink_extension(owl, program).
-
 :- public
 	file//2.
 
@@ -108,21 +115,21 @@ prolog:doc_autolink_extension(owl, program).
 %	  ```
 
 :- multifile
-	trill_on_swish_config:source_alias/2.
+	swish_config:source_alias/2.
 
 file(File, Options) -->
 	{ once(sub_atom(File, Pre, _, _Post, /)),
 	  sub_atom(File, 0, Pre, _, Alias),
-	  trill_on_swish_config:source_alias(Alias, _Options),
+	  swish_config:source_alias(Alias, _Options),
 	  option(label(Label), Options),
-	  http_location_by_id(trill_on_swish, Swish),
+	  http_location_by_id(swish, Swish),
 	  directory_file_path(Swish, File, HREF)
 	}, !,
 	html(a([class([alias,file]), href(HREF)], Label)).
 file(File, Options) -->
 	{ storage_file(File),
 	  option(label(Label), Options),
-	  http_location_by_id(trill_on_swish, Swish),
+	  http_location_by_id(swish, Swish),
 	  directory_file_path(Swish, p, StoreDir),
 	  directory_file_path(StoreDir, File, HREF)
 	}, !,
diff --git a/lib/trill_on_swish/page.pl b/lib/trill_on_swish/page.pl
index 88a4655..066d3d9 100644
--- a/lib/trill_on_swish/page.pl
+++ b/lib/trill_on_swish/page.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_page,
+:- module(swish_page,
 	  [ swish_reply/2,			% +Options, +Request
 	    swish_page//1,			% +Options
 
@@ -60,7 +60,6 @@
 
 :- use_module(config).
 :- use_module(help).
-:- use_module(form).
 :- use_module(search).
 
 /** <module> Provide the SWISH application as Prolog HTML component
@@ -70,15 +69,15 @@ grammer rules. This allows for server-side   generated  pages to include
 swish or parts of swish easily into a page.
 */
 
-http:location(pldoc, trill_on_swish(pldoc), [priority(100)]).
+http:location(pldoc, swish(pldoc), [priority(100)]).
 
-:- http_handler(trill_on_swish(.), swish_reply([]), [id(trill_on_swish), prefix]).
+:- http_handler(swish(.), swish_reply([]), [id(swish), prefix]).
 
 :- multifile
-	trill_on_swish_config:source_alias/2,
-	trill_on_swish_config:reply_page/1,
-	trill_on_swish_config:verify_write_access/3, % +Request, +File, +Options
-	trill_on_swish_config:authenticate/2.	    % +Request, -User
+	swish_config:source_alias/2,
+	swish_config:reply_page/1,
+	swish_config:verify_write_access/3, % +Request, +File, +Options
+	swish_config:authenticate/2.	    % +Request, -User
 
 %%	swish_reply(+Options, +Request)
 %
@@ -96,47 +95,50 @@ http:location(pldoc, trill_on_swish(pldoc), [priority(100)]).
 %	  - q(Query)
 %	  Use Query as the initial query.
 
-swish_reply(_Options, Request) :-
-	trill_on_swish_config:authenticate(Request, _User), % must throw to deny access
-	fail.
 swish_reply(Options, Request) :-
+	swish_config:authenticate(Request, User), !, % must throw to deny access
+	swish_reply2([user(User)|Options], Request).
+swish_reply(Options, Request) :-
+	swish_reply2(Options, Request).
+
+swish_reply2(Options, Request) :-
 	option(method(Method), Request),
-	Method \== get, !,
+	Method \== get, Method \== head, !,
 	swish_rest_reply(Method, Request, Options).
-swish_reply(_, Request) :-
+swish_reply2(_, Request) :-
 	serve_resource(Request), !.
-swish_reply(_, Request) :-
-	swish_reply_config(Request), !.
-swish_reply(SwishOptions, Request) :-
+swish_reply2(Options, Request) :-
+	swish_reply_config(Request, Options), !.
+swish_reply2(SwishOptions, Request) :-
 	Params = [ code(_,	 [optional(true)]),
 		   background(_, [optional(true)]),
 		   examples(_,   [optional(true)]),
 		   q(_,          [optional(true)]),
-		   format(_,     [oneof([trill_on_swish,raw,json]), default(trill_on_swish)])
+		   format(_,     [oneof([swish,raw,json]), default(swish)])
 		 ],
 	http_parameters(Request, Params),
 	params_options(Params, Options0),
 	merge_options(Options0, SwishOptions, Options1),
 	source_option(Request, Options1, Options2),
 	option(format(Format), Options2),
-	swish_reply2(Format, Options2).
+	swish_reply3(Format, Options2).
 
-swish_reply2(raw, Options) :-
+swish_reply3(raw, Options) :-
 	option(code(Code), Options), !,
 	format('Content-type: text/x-prolog~n~n'),
 	format('~s', [Code]).
-swish_reply2(json, Options) :-
+swish_reply3(json, Options) :-
 	option(code(Code), Options), !,
 	option(meta(Meta), Options, _{}),
 	reply_json_dict(json{data:Code, meta:Meta}).
-swish_reply2(_, Options) :-
-	trill_on_swish_config:reply_page(Options), !.
-swish_reply2(_, Options) :-
+swish_reply3(_, Options) :-
+	swish_config:reply_page(Options), !.
+swish_reply3(_, Options) :-
 	reply_html_page(
-	    trill_on_swish(main),
+	    swish(main),
 	    [ title('TRILL on SWISH -- Probabilistic Reasoner for Description Logics in Prolog'),
 	      link([ rel('shortcut icon'),
-		     href('/icons/favicon.ico')
+		     href('/icons/rb_favicon.ico')
 		   ]),
 	      link([ rel('apple-touch-icon'),
 		     href('/icons/trill-touch-icon.png')
@@ -161,16 +163,16 @@ params_options([_|T0], T) :-
 
 source_option(_Request, Options0, Options) :-
 	option(code(Code), Options0),
-	option(format(trill_on_swish), Options0), !,
+	option(format(swish), Options0), !,
 	(   uri_is_global(Code)
-	->  Options = [url(Code)|Options0]
+	->  Options = [url(Code),st_type(external)|Options0]
 	;   Options = Options0
 	).
 source_option(Request, Options0, Options) :-
 	source_file(Request, File, Options0), !,
 	option(path(Path), Request),
 	(   source_data(File, String, Options1)
-	->  append([ [code(String), url(Path)],
+	->  append([ [code(String), url(Path), st_type(filesys)],
 		     Options1,
 		     Options0
 		   ], Options)
@@ -185,7 +187,7 @@ source_option(_, Options, Options).
 %	exist, an HTTP 404 exception is returned.  Options:
 %
 %	  - alias(-Alias)
-%	    Get the trill_on_swish_config:source_alias/2 Alias name that
+%	    Get the swish_config:source_alias/2 Alias name that
 %	    was used to find File.
 
 source_file(Request, File, Options) :-
@@ -200,7 +202,7 @@ path_info_file(PathInfo, Path, Options) :-
 	sub_atom(PathInfo, B, _, A, /),
 	sub_atom(PathInfo, 0, B, _, Alias),
 	sub_atom(PathInfo, _, A, 0, File),
-	catch(trill_on_swish_config:source_alias(Alias, AliasOptions), E,
+	catch(swish_config:source_alias(Alias, AliasOptions), E,
 	      (print_message(warning, E), fail)),
 	Spec =.. [Alias,File],
 	http_safe_file(Spec, []),
@@ -248,7 +250,7 @@ source_metadata(Path, _Code, modified_since_loaded, true) :-
 	ModifiedWhenLoaded \== Modified.
 source_metadata(Path, _Code, module, Module) :-
 	file_name_extension(_, Ext, Path),
-	prolog_file_type(Ext, prolog),
+	user:prolog_file_type(Ext, prolog),
 	xref_public_list(Path, _, [module(Module)]).
 
 confirm_access(Path, Options) :-
@@ -262,13 +264,13 @@ eval_condition(loaded, Path) :-
 
 %%	serve_resource(+Request) is semidet.
 %
-%	Serve /trill_on_swish/Resource files.
+%	Serve /swish/Resource files.
 
 serve_resource(Request) :-
 	option(path_info(Info), Request),
 	resource_prefix(Prefix),
 	sub_atom(Info, 0, _, _, Prefix), !,
-	http_reply_file(trill_on_swish_web(Info), [], Request).
+	http_reply_file(swish_web(Info), [], Request).
 
 resource_prefix('css/').
 resource_prefix('help/').
@@ -342,7 +344,7 @@ pengine_logo(_Options) -->
 	},
 	html(a([href(HREF), class('pengine-logo')], &(nbsp))).
 swish_logo(_Options) -->
-	{ http_absolute_location(trill_on_swish(.), HREF, [])
+	{ http_absolute_location(swish(.), HREF, [])
 	},
 	html(a([href(HREF), class('swish-logo')], &(nbsp))).
 
@@ -367,8 +369,8 @@ swish_content(Options) -->
 	{ document_type(Type, Options)
 	},
 	swish_resources,
-	swish_config_hash,
-	html(div([id(content), class([container, trill_on_swish])],
+	swish_config_hash(Options),
+	html(div([id(content), class([container, swish])],
 		 [ div([class([tile, horizontal]), 'data-split'('50%')],
 		       [ div([ class([editors, tabbed])
 			     ],
@@ -385,17 +387,17 @@ swish_content(Options) -->
 		 ])).
 
 
-%%	swish_config_hash//
+%%	swish_config_hash(+Options)//
 %
 %	Set `window.swish.config_hash` to a  hash   that  represents the
 %	current configuration. This is used by   config.js  to cache the
 %	configuration in the browser's local store.
 
-swish_config_hash -->
-	{ swish_config_hash(Hash) },
+swish_config_hash(Options) -->
+	{ swish_config_hash(Hash, Options) },
 	js_script({|javascript(Hash)||
-		   window.trill_on_swish = window.trill_on_swish||{};
-		   window.trill_on_swish.config_hash = Hash;
+		   window.swish = window.swish||{};
+		   window.swish.config_hash = Hash;
 		   |}).
 
 
@@ -436,7 +438,8 @@ source_data_attrs(Options) -->
 	(source_file_data(Options) -> [] ; []),
 	(source_url_data(Options) -> [] ; []),
 	(source_title_data(Options) -> [] ; []),
-	(source_meta_data(Options) -> [] ; []).
+	(source_meta_data(Options) -> [] ; []),
+	(source_st_type_data(Options) -> [] ; []).
 
 source_file_data(Options) -->
 	{ option(file(File), Options) },
@@ -447,6 +450,9 @@ source_url_data(Options) -->
 source_title_data(Options) -->
 	{ option(title(File), Options) },
 	['data-title'(File)].
+source_st_type_data(Options) -->
+	{ option(st_type(Type), Options) },
+	['data-st_type'(Type)].
 source_meta_data(Options) -->
 	{ option(meta(Meta), Options), !,
 	  atom_json_dict(Text, Meta, [])
@@ -499,7 +505,7 @@ notebooks(swinb, Options) -->
 	  download_source(Spec, NoteBookText, Options),
 	  phrase(source_data_attrs(Options), Extra)
 	},
-	html(div([ class('notebook'),
+	html(div([ class('notebook fullscreen'),
 		   'data-label'('Notebook')		% Use file?
 		 ],
 		 [ pre([ class('notebook-data'),
@@ -600,15 +606,15 @@ swish_css --> html_post(head, \include_swish_css).
 include_swish_js -->
 	{ swish_resource(js, JS),
 	  swish_resource(rjs, RJS),
-	  http_absolute_location(trill_on_swish(js/JS), SwishJS, []),
-	  http_absolute_location(trill_on_swish(RJS),   SwishRJS, [])
+	  http_absolute_location(swish(js/JS), SwishJS, []),
+	  http_absolute_location(swish(RJS),   SwishRJS, [])
 	},
 	rjs_timeout(JS),
 	html(script([ src(SwishRJS),
 		      'data-main'(SwishJS)
 		    ], [])).
 
-rjs_timeout('trill_on_swish-min') --> !,
+rjs_timeout('swish-min') --> !,
 	js_script({|javascript||
 // Override RequireJS timeout, until main file is loaded.
 window.require = { waitSeconds: 0 };
@@ -618,7 +624,7 @@ rjs_timeout(_) --> [].
 
 include_swish_css -->
 	{ swish_resource(css, CSS),
-	  http_absolute_location(trill_on_swish(css/CSS), SwishCSS, [])
+	  http_absolute_location(swish(css/CSS), SwishCSS, [])
 	},
 	html(link([ rel(stylesheet),
 		    href(SwishCSS)
@@ -630,13 +636,13 @@ swish_resource(Type, ID) :-
 	;   absolute_file_name(File, _P, [file_errors(fail), access(read)])
 	), !.
 
-alt(js,  'trill_on_swish-min',     trill_on_swish_web('js/trill_on_swish-min.js')) :-
+alt(js,  'swish-min',     swish_web('js/swish-min.js')) :-
 	\+ debugging(nominified).
-alt(js,  'trill_on_swish',         trill_on_swish_web('js/trill_on_swish.js')).
-alt(css, 'trill_on_swish-min.css', trill_on_swish_web('css/trill_on_swish-min.css')) :-
+alt(js,  'swish',         swish_web('js/swish.js')).
+alt(css, 'swish-min.css', swish_web('css/swish-min.css')) :-
 	\+ debugging(nominified).
-alt(css, 'swish.css',     trill_on_swish_web('css/swish.css')).
-alt(rjs, 'js/require.js', trill_on_swish_web('js/require.js')) :-
+alt(css, 'swish.css',     swish_web('css/swish.css')).
+alt(rjs, 'js/require.js', swish_web('js/require.js')) :-
 	\+ debugging(nominified).
 alt(rjs, 'bower_components/requirejs/require.js', -).
 
@@ -670,7 +676,7 @@ read_data(media(Type,_), Request, Data, Meta) :-
 read_data(media(text/_,_), Request, Data, _{}) :-
 	http_read_data(Request, Data, [to(string)]).
 
-%%	trill_on_swish_config:verify_write_access(+Request, +File, +Options) is
+%%	swish_config:verify_write_access(+Request, +File, +Options) is
 %%	nondet.
 %
 %	Hook that verifies that the HTTP Request  may write to File. The
@@ -679,10 +685,10 @@ read_data(media(text/_,_), Request, Data, _{}) :-
 %	reply.  By default, the following options are passed:
 %
 %	  - alias(+Alias)
-%	    The trill_on_swish_config:source_alias/2 Alias used to find File.
+%	    The swish_config:source_alias/2 Alias used to find File.
 
 verify_write_access(Request, File, Options) :-
-	trill_on_swish_config:verify_write_access(Request, File, Options), !.
+	swish_config:verify_write_access(Request, File, Options), !.
 verify_write_access(Request, _File, _Options) :-
 	option(path(Path), Request),
 	throw(http_reply(forbidden(Path))).
diff --git a/lib/trill_on_swish/render.pl b/lib/trill_on_swish/render.pl
index b05fdd9..e4e1679 100644
--- a/lib/trill_on_swish/render.pl
+++ b/lib/trill_on_swish/render.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_render,
+:- module(swish_render,
 	  [ use_rendering/1,		% +Renderer
 	    use_rendering/2,		% +Renderer, +Options
 
@@ -80,7 +80,7 @@ means it must call html//1 to generate HTML tokens).
 
 :- multifile user:file_search_path/2.
 
-user:file_search_path(render, trill_on_swish('lib/render')).
+user:file_search_path(render, swish('lib/render')).
 
 
 %%	use_rendering(+FileOrID)
@@ -90,7 +90,7 @@ user:file_search_path(render, trill_on_swish('lib/render')).
 %
 %	@see use_rendering/2.
 
-:- multifile user:term_expansion/2.
+:- multifile system:term_expansion/2.
 
 use_rendering(Rendering) :-
 	use_rendering(Rendering, []).
@@ -108,20 +108,24 @@ use_rendering(Rendering, Options) :-
 	->  true
 	;   existence_error(renderer, Renderer)
 	),
-	retractall(Into:'trill_on_swish renderer'(Renderer, _)),
-	assertz(Into:'trill_on_swish renderer'(Renderer, Options)).
+	retractall(Into:'swish renderer'(Renderer, _)),
+	assertz(Into:'swish renderer'(Renderer, Options)).
 
-user:term_expansion((:- use_rendering(Renderer)), Expanded) :-
+system:term_expansion((:- use_rendering(Renderer)), Expanded) :-
 	expand_rendering(Renderer, [], Expanded).
-user:term_expansion((:- use_rendering(Renderer, Options)), Expanded) :-
+system:term_expansion((:- use_rendering(Renderer, Options)), Expanded) :-
 	expand_rendering(Renderer, Options, Expanded).
 
 expand_rendering(Module:Renderer, Options,
-		 Module:'trill_on_swish renderer'(Renderer, Options)) :- !,
+		 [ (:- discontiguous(Module:'swish renderer'/2)),
+		   Module:'swish renderer'(Renderer, Options)
+		 ]) :- !,
 	must_be(atom, Module),
 	must_be(atom, Renderer).
 expand_rendering(Renderer, Options,
-		 'trill_on_swish renderer'(Renderer, Options)) :-
+		 [ (:- discontiguous('swish renderer'/2)),
+		   'swish renderer'(Renderer, Options)
+		 ]) :-
 	must_be(atom, Renderer).
 
 %%	pengines_io:binding_term(+Term, +Vars, +Options) is semidet.
@@ -148,8 +152,8 @@ pengines_io:binding_term(Term, Vars, Options) -->
 call_term_rendering(Module, Term, Vars, Options, Tokens) :-
 	State = state([]),
 	default_module(Module, Target),
-	current_predicate(Target:'trill_on_swish renderer'/2),
-	Target:'trill_on_swish renderer'(Name, RenderOptions),
+	current_predicate(Target:'swish renderer'/2),
+	Target:'swish renderer'(Name, RenderOptions),
 	atom(Name),
 	is_new(State, Name),
 	renderer(Name, RenderModule, _Comment),
@@ -220,6 +224,6 @@ register_renderer(Name, Comment) :-
 	throw(error(context_error(nodirective, register_renderer(Name, Comment)),
 		    _)).
 
-user:term_expansion((:- register_renderer(Name, Comment)),
-		    trill_on_swish_render:renderer(Name, Module, Comment)) :-
+system:term_expansion((:- register_renderer(Name, Comment)),
+		    swish_render:renderer(Name, Module, Comment)) :-
 	prolog_load_context(module, Module).
diff --git a/lib/trill_on_swish/render/c3.pl b/lib/trill_on_swish/render/c3.pl
index d59e9fc..dba189e 100644
--- a/lib/trill_on_swish/render/c3.pl
+++ b/lib/trill_on_swish/render/c3.pl
@@ -30,10 +30,16 @@
 :- module(swish_render_c3,
 	  [ term_rendering//3			% +Term, +Vars, +Options
 	  ]).
+:- use_module(library(apply)).
+:- use_module(library(lists)).
 :- use_module(library(gensym)).
 :- use_module(library(error)).
+:- use_module(library(dif)).
 :- use_module(library(http/html_write)).
 :- use_module(library(http/js_write)).
+:- if(exists_source(library(dicts))).
+:- use_module(library(dicts)).
+:- endif.
 :- use_module('../render').
 
 :- register_renderer(c3, "Render data as tables").
@@ -48,14 +54,19 @@ Render data as a chart.
 %	Renders Term as a C3.js chart. This renderer recognises C3, as a
 %	dict with tag `c3`.
 
-term_rendering(C3, _Vars, _Options) -->
-	{ is_dict(C3, c3),
-	  valid_c3(C3),
+% This renderer hooks into SWISH using two event-handlers and associated
+% classes. The `reactive-size` is called  after   the  window or pane is
+% resized and the `export-dom` is called from the _download_ button.
+
+term_rendering(C30, _Vars, _Options) -->
+	{ is_dict(C30, Tag),
+	  Tag == c3,
+	  valid_c3(C30, C3),
 	  gensym('c3js', Id),
 	  atom_concat(#, Id, RefId),
 	  put_dict(bindto, C3, RefId, C3b)
 	},
-	html(div([ class(['render-C3', 'reactive-size']),
+	html(div([ class(['render-C3', 'reactive-size', 'export-dom']),
 		   'data-render'('As C3 chart')
 		 ],
 		 [ div(id(Id), []),
@@ -68,6 +79,17 @@ term_rendering(C3, _Vars, _Options) -->
     var sizing = {};
     var tmo;
 
+    div.on("export-dom", function(ev, r) {
+      var svg = div.find("svg");
+      svg.attr("xmlns", "http://www.w3.org/2000/svg");
+      svg.css("font", "10px sans-serif");
+      svg.find(".c3-path,.c3-line,.tick,.domain").css("fill", "none");
+      svg.find(".tick,.domain").css("stroke", "#000");
+      r.element = svg[0];
+      r.extension = "svg";
+      r.contentType = "image/svg+xml";
+    });
+
     div.on("reactive-resize", function() {
       if ( chart ) {
 	if ( tmo ) clearTimeout(tmo);
@@ -105,22 +127,71 @@ term_rendering(C3, _Vars, _Options) -->
 		 ])).
 
 
-%%	valid_c3(+C3) is det.
+%%	valid_c3(+C3In, -C3Out) is det.
 %
 %	Perform sanity tests on the C3 representation.
 
-valid_c3(C3) :-
-	valid_c3_data(C3.data).
-
-valid_c3_data(C3) :-
-	valid_c3_array(C3.get(rows)), !.
-valid_c3_data(C3) :-
-	valid_c3_array(C3.get(columns)), !.
-valid_c3_data(C3) :-
-	throw(error(c3_no_data(C3), _)).
-
-valid_c3_array(Array) :-
-	must_be(list(list(ground)), Array).
+valid_c3(C30, C31) :-
+	Data0 = C30.data,
+	valid_c3_data(Data0, Data),
+	(   same_term(Data0, Data)
+	->  C31 = C30
+	;   C31 = C30.put(data,Data)
+	).
+
+valid_c3_data(Data0, Data) :-
+	Rows0 = Data0.get(rows), !,
+	must_be(acyclic, Rows0),
+	rows_to_matrix(Rows0, Rows),
+	must_be(list(ground), Rows),
+	(   same_term(Rows0, Rows)
+	->  Data0 = Data
+	;   Data = Data0.put(rows,Rows)
+	).
+valid_c3_data(Data, Data) :-
+	Columns = Data.get(columns), !,
+	must_be(acyclic, Columns),
+	must_be(list,Columns),
+	maplist(must_be(list),Columns).
+
+valid_c3_data(Data, Data) :-
+	throw(error(c3_no_data(Data), _)).
+
+%%	rows_to_matrix(+RowsIn, -Rows) is semidet.
+%
+%	Translate alternative row representations into  a list of lists.
+%	Recognised input rows are:
+%
+%	  * Dicts having the same set of keys (if library(dicts) is
+%	    available)
+%	  * Compounds having same name and arity, e.g., pairs.
+%	  * Lists having the same length
+
+:- if(current_predicate(dicts_to_compounds/4)).
+rows_to_matrix(Dicts, [Keys|Rows]) :-
+	maplist(is_dict, Dicts), !,
+	maplist(dict_keys, Dicts, KeysList),
+	append(KeysList, Keys0),
+	sort(Keys0, Keys),
+	dicts_to_compounds(Dicts, Keys, dict_fill(undefined), Compounds),
+	maplist(compound_arguments, Compounds, Rows).
+:- endif.
+rows_to_matrix(Compounds, Rows) :-
+	dif(Name/Arity, []/2),		% avoid lists
+	maplist(name_arity_compound(Name, Arity), Compounds, Rows), !.
+rows_to_matrix(Lists, Lists) :-
+	maplist(length_list(_Columns), Lists).
+
+name_arity_compound(Name, Arity, Compound, Arguments) :-
+	compound(Compound),
+	compound_name_arity(Compound, Name, Arity),
+	compound_name_arguments(Compound, Name, Arguments).
+
+compound_arguments(Compound, Arguments) :-
+	compound_name_arguments(Compound, _, Arguments).
+
+length_list(Length, List) :-
+	length(List, Length).
 
 :- multifile
 	prolog:error_message//1.
diff --git a/lib/trill_on_swish/render/graphviz.pl b/lib/trill_on_swish/render/graphviz.pl
index 0ebf23f..74d4329 100644
--- a/lib/trill_on_swish/render/graphviz.pl
+++ b/lib/trill_on_swish/render/graphviz.pl
@@ -82,7 +82,7 @@ as follows:
   ```
 */
 
-:- http_handler(trill_on_swish(graphviz), swish_send_graphviz, []).
+:- http_handler(swish(graphviz), swish_send_graphviz, []).
 
 :- dynamic
 	dot_data/3.				% +Hash, +Data, +Time
@@ -139,6 +139,7 @@ render_dot(DOTString, Program, _Options) -->	% <svg> rendering
 			   read_string(ErrorOut, _, Error)
 		       ),
 		       (   process_wait(PID, _Status),
+			   close(ErrorOut, [force(true)]),
 			   close(XDotOut)
 		       ))
 	},
@@ -158,7 +159,6 @@ render_dot(DOTString, Program, _Options) -->	% <svg> rendering
      var pan;
 
      function updateSize() {
-       console.log("updateSize");
        var w = svg.closest("div.answer").innerWidth();
 
        function reactive() {
@@ -248,6 +248,7 @@ swish_send_graphviz(Request) :-
 		       read_string(ErrorOut, _, Error)
 		     ),
 		     (	 process_wait(PID, _Status),
+			 close(ErrorOut, [force(true)]),
 			 close(XDotOut)
 		     )),
 	(   Error == ""
@@ -455,7 +456,7 @@ attribute(NameValue, _O)  -->
 
 value(Name, Value) -->
 	{ string_attribute(Name), !,
-	  atom_codes(Value, Codes)
+	  value_codes(Value, Codes)
 	},
 	"\"", cstring(Codes), "\"".
 value(_Name, Value, List, Tail) :-
@@ -479,6 +480,11 @@ spaces(N) -->
 	" ",
 	spaces(N2).
 
+value_codes(Value, Codes) :-
+	atomic(Value), !,
+	format(codes(Codes), '~w', [Value]).
+value_codes(Value, Codes) :-
+	format(codes(Codes), '~p', [Value]).
 
 
 		 /*******************************
@@ -495,6 +501,8 @@ string_attribute(href).
 string_attribute(id).
 string_attribute('URL').
 string_attribute(fillcolor).
+string_attribute(fontcolor).
+string_attribute(fontname).
 string_attribute(style).
 string_attribute(size).
 
diff --git a/lib/trill_on_swish/render/rdf.pl b/lib/trill_on_swish/render/rdf.pl
index 24ab205..a2c1291 100644
--- a/lib/trill_on_swish/render/rdf.pl
+++ b/lib/trill_on_swish/render/rdf.pl
@@ -47,15 +47,17 @@ Render RDF data.
 %	Renders Term as a uri.  Furt
 
 term_rendering(Term, _Vars, Options) -->
-	{ is_rdf(Term)
+	{ ground(Term),
+	  is_rdf(Term)
 	}, !,
 	rdf_link(Term, [target('cliopatria-localview')|Options]).
 
 is_rdf(Term) :-
 	is_uri(Term), !.
 is_rdf(literal(Value)) :-
-	ground(Value),
 	is_literal(Value).
+is_rdf(^^(_,Type)) :- atom(Type).
+is_rdf(@(_,Lang)) :- atom(Lang).
 
 is_uri(Term) :-
 	atom(Term),
diff --git a/lib/trill_on_swish/render/table.pl b/lib/trill_on_swish/render/table.pl
index d11962e..6bd6639 100644
--- a/lib/trill_on_swish/render/table.pl
+++ b/lib/trill_on_swish/render/table.pl
@@ -32,6 +32,8 @@
 	  ]).
 :- use_module(library(apply)).
 :- use_module(library(lists)).
+:- use_module(library(pairs)).
+:- use_module(library(dicts)).
 :- use_module(library(option)).
 :- use_module(library(http/html_write)).
 :- use_module(library(http/term_html)).
@@ -54,62 +56,90 @@ Render table-like data.
 %
 %	@tbd: recognise more formats
 
+term_rendering(Term, _Vars, Options) -->
+	{ is_list_of_dicts(Term, _Rows, ColNames)
+	}, !,
+	html(div([ style('display:inline-block'),
+		   'data-render'('List of terms as a table')
+		 ],
+		 [ table(class('render-table'),
+			 [ \header_row(ColNames),
+			   \rows(Term, Options)
+			 ])
+		 ])).
 term_rendering(Term, _Vars, Options) -->
 	{ is_list_of_terms(Term, _Rows, _Cols),
-	  header(Term, Header, Options)
+	  header(Term, Header, Options, Options1)
 	}, !,
 	html(div([ style('display:inline-block'),
 		   'data-render'('List of terms as a table')
 		 ],
 		 [ table(class('render-table'),
 			 [ \header_row(Header),
-			   \rows(Term)
+			   \rows(Term, Options1)
 			 ])
 		 ])).
 term_rendering(Term, _Vars, Options) -->
 	{ is_list_of_lists(Term, _Rows, _Cols),
-	  header(Term, Header, Options)
+	  header(Term, Header, Options, Options1)
 	}, !,
 	html(div([ style('display:inline-block'),
 		   'data-render'('List of lists as a table')
 		 ],
 		 [ table(class('render-table'),
 			 [ \header_row(Header),
-			   \rows(Term)
+			   \rows(Term, Options1)
 			 ])
 		 ])).
 
-rows([]) --> [].
-rows([H|T]) -->
+rows([], _) --> [].
+rows([H|T], Options) -->
 	{ cells(H, Cells) },
-	html(tr(\row(Cells))),
-	rows(T).
-
-row([]) --> [].
-row([H|T]) -->
+	html(tr(\row(Cells, Options))),
+	rows(T, Options).
+
+row([], _) --> [].
+row([H|T], Options) -->
+	html(td(\term(H, Options))),
+	row(T, Options).
+row([H|T], Options) -->
 	html(td(\term(H, []))),
-	row(T).
+	row(T, Options).
 
 cells(Row, Cells) :-
 	is_list(Row), !,
 	Cells = Row.
+cells(Row, Cells) :-
+	is_dict(Row), !,
+	dict_pairs(Row, _Tag, Pairs),
+	pairs_values(Pairs, Cells).
 cells(Row, Cells) :-
 	compound(Row),
 	compound_name_arguments(Row, _, Cells).
 
-%%	header(+Table, -Header:list(Term), +Options) is semidet.
+%%	header(+Table, -Header:list(Term), +Options, -RestOptions) is semidet.
 %
 %	Compute the header to use. Fails if   a  header is specified but
 %	does not match.
 
-header(_, _, Options) :-
-	\+ option(header(_), Options), !.
-header([Row|_], ColHead, Options) :-
-	member(header(Header), Options),
+header(_, _, Options0, Options) :-
+	\+ option(header(_), Options0), !,
+	Options = Options0.
+header([Row|_], ColHead, Options0, Options) :-
+	partition(is_header, Options0, HeaderOptions, Options),
+	member(HeaderOption, HeaderOptions),
+	header(HeaderOption, Header),
 	generalise(Row, GRow),
 	generalise(Header, GRow), !,
 	header_list(Header, ColHead).
 
+is_header(0) :- !, fail.
+is_header(header(_)).
+is_header(header=_).
+
+header(header(H), H).
+header(header=H, H).
+
 generalise(List, VList) :-
 	is_list(List), !,
 	length(List, Len),
@@ -156,6 +186,20 @@ is_term_row(Name, Arity, Term) :-
 	compound(Term),
 	compound_name_arity(Term, Name, Arity).
 
+%%	is_list_of_dicts(@Term, -Rows, -ColNames) is semidet.
+%
+%	True when Term is a list of Rows dicts, each holding ColNames as
+%	keys.
+
+is_list_of_dicts(Term, Rows, ColNames) :-
+	is_list(Term), Term \== [],
+	length(Term, Rows),
+	maplist(is_dict_row(ColNames), Term).
+
+is_dict_row(ColNames, Dict) :-
+	is_dict(Dict),
+	dict_keys(Dict, ColNames).
+
 %%	is_list_of_lists(@Term, -Rows, -Cols) is semidet.
 %
 %	Recognise a list of lists of equal length.
diff --git a/lib/trill_on_swish/search.pl b/lib/trill_on_swish/search.pl
index aa2f050..0bb0f8b 100644
--- a/lib/trill_on_swish/search.pl
+++ b/lib/trill_on_swish/search.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_search,
+:- module(swish_search,
 	  [ search_box//1,		% +Options
 	    match/3			% +Line, +Query, +Options
 	  ]).
@@ -57,8 +57,8 @@ search from the server side. What do we want to search for?
       these?
 */
 
-:- http_handler(trill_on_swish(typeahead), typeahead, [id(swish_typeahead)]).
-:- http_handler(trill_on_swish(search),    search,    [id(swish_search)]).
+:- http_handler(swish(typeahead), typeahead, [id(swish_typeahead)]).
+:- http_handler(swish(search),    search,    [id(swish_search)]).
 
 %%	search_box(+Options)//
 %
@@ -112,7 +112,7 @@ typeahead(Request) :-
 %	@tbd: Limit number of hits?
 
 :- multifile
-	trill_on_swish_config:source_alias/2.
+	swish_config:source_alias/2.
 
 typeahead(predicates, Query, Template, _) :-
 	swish_config(templates, Templates),
@@ -122,7 +122,7 @@ typeahead(predicates, Query, Template, _) :-
 typeahead(sources, Query, Hit, Options) :-
 	source_file(Path),
 	(   file_alias_path(Alias, Dir),
-	    once(trill_on_swish_config:source_alias(Alias, _)),
+	    once(swish_config:source_alias(Alias, _)),
 	    atom_concat(Dir, File, Path)
 	->  true
 	),
@@ -135,7 +135,7 @@ typeahead(sources, Query, Hit, Options) :-
 	).
 typeahead(sources, Query, hit{alias:Alias, file:Base, ext:Ext,
 			      query:Query, line:LineNo, text:Line}, Options) :-
-	trill_on_swish_config:source_alias(Alias, AliasOptions),
+	swish_config:source_alias(Alias, AliasOptions),
 	option(search(Pattern), AliasOptions),
 	DirSpec =.. [Alias,.],
 	absolute_file_name(DirSpec, Dir,
@@ -154,7 +154,7 @@ typeahead(sources, Query, hit{alias:Alias, file:Base, ext:Ext,
 	limit(5, search_file(Path, Query, LineNo, Line, Options)).
 
 search_file(Path, Query, LineNo, Line, Options) :-
-	debug(trill_on_swish(search), 'Searching ~q for ~q (~q)', [Path, Query, Options]),
+	debug(swish(search), 'Searching ~q for ~q (~q)', [Path, Query, Options]),
 	setup_call_cleanup(
 	    open(Path, read, In),
 	    read_string(In, _, String),
@@ -181,29 +181,13 @@ sow(Text, Offset) :-
 	Pre is Offset-1,
 	sub_atom(Text, Pre, 1, _, Before),
 	sub_atom(Text, Offset, 1, _, Start),
-	char_class(Start, Class),
-	\+ char_class(Before, Class).
-
-char_class(C, Class) :-
-	var(Class), !,
-	(   target_class(Class),
-	    char_type(C, Class)
-	->  true
-	;   Class = other
-	).
-char_class(C, Class) :-
-	(   target_class(Class)
-	->  char_type(C, Class)
-	;   \+ ( target_class(T),
-	         char_type(C, T)
-	       )
-	).
-
-target_class(lower).
-target_class(upper).
-target_class(digit).
-target_class(space).
-target_class(punct).
+	(   \+ char_type(Before, csym),
+	    char_type(Start, csym)
+	;   Before == '_',
+	    char_type(Start, csym)
+	;   char_type(Start, upper),
+	    char_type(Before, lower)
+	), !.
 
 %%	search(+Request)
 %
diff --git a/lib/trill_on_swish/storage.pl b/lib/trill_on_swish/storage.pl
index 5cf5fdd..fe629c6 100644
--- a/lib/trill_on_swish/storage.pl
+++ b/lib/trill_on_swish/storage.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_web_storage,
+:- module(web_storage,
 	  [ storage_file/1,			% ?File
 	    storage_file/3			% +File, -Data, -Meta
 	  ]).
@@ -59,7 +59,18 @@ their own version.
 
 :- setting(directory, atom, storage, 'The directory for storing files.').
 
-:- http_handler(trill_on_swish('tos/'), web_storage, [ id(web_storage), prefix ]).
+:- http_handler(swish('p/'), web_storage, [ id(web_storage), prefix ]).
+
+:- initialization open_gittystore.
+
+open_gittystore :-
+	setting(directory, Dir),
+	(   exists_directory(Dir)
+	->  true
+	;   make_directory(Dir)
+	),
+	gitty_open(Dir, []).
+
 
 %%	web_storage(+Request) is det.
 %
@@ -72,10 +83,17 @@ web_storage(Request) :-
 	option(method(Method), Request),
 	storage(Method, Request).
 
+:- multifile
+	swish_config:authenticate/2.
+
 storage(get, Request) :-
+	(   swish_config:authenticate(Request, User)
+	->  Options = [user(User)]
+	;   Options = []
+	),
 	http_parameters(Request,
-			[ format(Fmt,  [ oneof([trill_on_swish,raw,json,history,diff]),
-					 default(trill_on_swish),
+			[ format(Fmt,  [ oneof([swish,raw,json,history,diff]),
+					 default(swish),
 					 description('How to render')
 				       ]),
 			  depth(Depth, [ default(5),
@@ -95,7 +113,8 @@ storage(get, Request) :-
 	->  Format = diff(RelTo)
 	;   Format = Fmt
 	),
-	storage_get(Request, Format).
+	storage_get(Request, Format, Options).
+
 storage(post, Request) :-
 	http_read_json_dict(Request, Dict),
 	option(data(Data), Dict, ""),
@@ -209,13 +228,13 @@ meta_allowed(tags,	     list(string)).
 meta_allowed(description,    string).
 meta_allowed(commit_message, string).
 
-%%	storage_get(+Request, +Format) is det.
+%%	storage_get(+Request, +Format, +Options) is det.
 %
 %	HTTP handler that returns information a given gitty file.
 %
 %	@arg Format is one of
 %
-%	     - trill_on_swish
+%	     - swish
 %	     Serve file embedded in a SWISH application
 %	     - raw
 %	     Serve the raw file
@@ -227,16 +246,17 @@ meta_allowed(commit_message, string).
 %	     Reply with diff relative to RelTo.  Default is the
 %	     previous commit.
 
-storage_get(Request, trill_on_swish) :-
-	swish_reply_config(Request), !.
-storage_get(Request, Format) :-
+storage_get(Request, swish, Options) :-
+	swish_reply_config(Request, Options), !.
+storage_get(Request, Format, _) :-
 	setting(directory, Dir),
 	request_file_or_hash(Request, Dir, FileOrHash, Type),
 	storage_get(Format, Dir, Type, FileOrHash, Request).
 
-storage_get(trill_on_swish, Dir, _, FileOrHash, Request) :-
+storage_get(swish, Dir, _, FileOrHash, Request) :-
 	gitty_data(Dir, FileOrHash, Code, Meta),
-	swish_reply([code(Code),file(FileOrHash),meta(Meta)], Request).
+	swish_reply([code(Code),file(FileOrHash),st_type(gitty),meta(Meta)],
+		    Request).
 storage_get(raw, Dir, _, FileOrHash, _Request) :-
 	gitty_data(Dir, FileOrHash, Code, Meta),
 	file_mime_type(Meta.name, MIME),
@@ -289,7 +309,7 @@ authentity(Request) -->
 	pengines:authentication_hook/3.
 
 user(Request) -->
-	{ pengines:authentication_hook(Request, trill_on_swish, User),
+	{ pengines:authentication_hook(Request, swish, User),
 	  ground(User)
 	},
 	[ user-User ].
@@ -339,9 +359,9 @@ storage_file(File, Data, Meta) :-
 		 *******************************/
 
 :- multifile
-	trill_on_swish_search:typeahead/4.	% +Set, +Query, -Match, +Options
+	swish_search:typeahead/4.	% +Set, +Query, -Match, +Options
 
-%%	trill_on_swish_search:typeahead(+Set, +Query, -Match) is nondet.
+%%	swish_search:typeahead(+Set, +Query, -Match) is nondet.
 %
 %	Find files using typeahead  from  the   SWISH  search  box. This
 %	version defines the following sets:
@@ -354,7 +374,7 @@ storage_file(File, Data, Meta) :-
 %	@tbd caching?
 %	@tbd We should only demand public on public servers.
 
-trill_on_swish_search:typeahead(file, Query, FileInfo, _Options) :-
+swish_search:typeahead(file, Query, FileInfo, _Options) :-
 	setting(directory, Dir),
 	gitty_file(Dir, File, Head),
 	gitty_commit(Dir, Head, Meta),
@@ -381,7 +401,7 @@ meta_match_query(Query, Meta) :-
 	    \+ char_type(C, csym)
 	).
 
-trill_on_swish_search:typeahead(store_content, Query, FileInfo, Options) :-
+swish_search:typeahead(store_content, Query, FileInfo, Options) :-
 	limit(25, search_store_content(Query, FileInfo, Options)).
 
 search_store_content(Query, FileInfo, Options) :-
diff --git a/lib/trill_on_swish/template_hint.pl b/lib/trill_on_swish/template_hint.pl
index 72d1232..8a53388 100644
--- a/lib/trill_on_swish/template_hint.pl
+++ b/lib/trill_on_swish/template_hint.pl
@@ -27,7 +27,7 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_template_hint,
+:- module(swish_template_hint,
 	  [ visible_predicate/3,	% ?PI, +Module, +Options
 	    predicate_template/2,	% +PI, -TemplateDict
 	    visible_predicate_templates/3 %  +Module, +Options, -Templates
@@ -500,8 +500,8 @@ file_type(Path, _, Type) :-
 	Type = directory.
 file_type(_, Name, Type) :-
 	file_name_extension(_, Ext, Name),
-	prolog_file_type(Ext, prolog),
-	\+ prolog_file_type(Ext, qlf),
+	user:prolog_file_type(Ext, prolog),
+	\+ user:prolog_file_type(Ext, qlf),
 	Type = prolog.
 
 %%	library_template_from(+From:list, -Template) is det.
@@ -577,7 +577,7 @@ imported_from(Module, FromModule) :-
 		 *******************************/
 
 swish_templates(Template) :-
-	setof(From, visible_lib(trill_on_swish, From), FromList),
+	setof(From, visible_lib(swish, From), FromList),
 	swish_templates(Template, [from(FromList)]).
 
 /*swish_templates(Template, Options) :-
@@ -585,7 +585,7 @@ swish_templates(Template) :-
 swish_templates(Template, _Options) :-
 	rendering_template(Template).
 /*swish_templates(Templates, Options) :-
-	visible_predicate_templates(trill_on_swish, Templates, Options).*/
+	visible_predicate_templates(swish, Templates, Options).*/
 
 %%	visible_lib(+Module, -Lib) is nondet.
 %
@@ -644,11 +644,11 @@ visible_lib(library(when)).
 		 *	    SWISH CONFIG	*
 		 *******************************/
 
-%%	trill_on_swish_config:config(-Name, -Styles) is det.
+%%	swish_config:config(-Name, -Styles) is det.
 %
-%	Provides the object `config.trill_on_swish.templates`, a JSON object that
+%	Provides the object `config.swish.templates`, a JSON object that
 %	provides the templates for hinting in CodeMirror.
 
-trill_on_swish_config:config(templates, Templates) :-
+swish_config:config(templates, Templates) :-
 	findall(Templ, swish_templates(Templ), Templates0),
 	flatten(Templates0, Templates).
diff --git a/lib/trill_on_swish/trace.pl b/lib/trill_on_swish/trace.pl
index d85ddd2..f009aad 100644
--- a/lib/trill_on_swish/trace.pl
+++ b/lib/trill_on_swish/trace.pl
@@ -27,8 +27,8 @@
     the GNU General Public License.
 */
 
-:- module(trill_on_swish_trace,
-	  [ '$trill_on_swish wrapper'/1		% +Goal
+:- module(swish_trace,
+	  [ '$swish wrapper'/2		% +Goal, -Residuals
 	  ]).
 :- use_module(library(debug)).
 :- use_module(library(settings)).
@@ -47,18 +47,18 @@
 
 :- use_module(storage).
 
-:- if(current_setting(trill_on_trill_on_swish:debug_info)).
-:- set_setting(trill_on_trill_on_swish:debug_info, true).
+:- if(current_setting(swish:debug_info)).
+:- set_setting(swish:debug_info, true).
 :- endif.
 
 :- set_prolog_flag(generate_debug_info, false).
 
 :- meta_predicate
-	'$trill_on_swish wrapper'(0).
+	'$swish wrapper'(0, -).
 
 /** <module>
 
-Allow tracing pengine execution under trill_on_swish.
+Allow tracing pengine execution under SWISH.
 */
 
 :- multifile
@@ -132,9 +132,9 @@ wrapper_frame(Frame0, Frame) :-
 	parent_frame(Frame0, Frame),
 	prolog_frame_attribute(Frame, predicate_indicator, PI),
 	debug(trace, 'Parent: ~p', [PI]),
-	(   PI == trill_on_swish_call/1
+	(   PI == swish_call/1
 	->  true
-	;   PI == trill_on_trill_on_swish_trace:trill_on_swish_call/1
+	;   PI == swish_trace:swish_call/1
 	), !.
 
 parent_frame(Frame, Frame).
@@ -177,18 +177,20 @@ strip_stack(error(Error, context(prolog_stack(S), Msg)),
 	nonvar(S).
 strip_stack(Error, Error).
 
-%%	'$trill_on_swish wrapper'(:Goal)
+%%	'$swish wrapper'(:Goal, -Residuals)
 %
-%	Wrap a trill_on_swish goal in '$trill_on_swish  wrapper'. This has two advantages:
-%	we can detect that the tracer is   operating  on a trill_on_swish goal by
+%	Wrap a SWISH goal in '$swish  wrapper'. This has two advantages:
+%	we can detect that the tracer is   operating  on a SWISH goal by
 %	inspecting the stack and we can  save/restore the debug state to
 %	deal with debugging next solutions.
 
-:- meta_predicate trill_on_swish_call(0).
+:- meta_predicate swish_call(0).
 
-'$trill_on_swish wrapper'(Goal) :-
-	catch(trill_on_swish_call(Goal), E, throw(E)),
+'$swish wrapper'(Goal, '$residuals'(Residuals)) :-
+	catch(swish_call(Goal), E, throw(E)),
 	deterministic(Det),
+	Goal = M:_,
+	residuals(M, Residuals),
 	(   tracing,
 	    Det == false
 	->  (   notrace,
@@ -200,16 +202,40 @@ strip_stack(Error, Error).
 	;   notrace
 	).
 
-trill_on_swish_call(Goal) :-
+swish_call(Goal) :-
 	Goal,
 	no_lco.
 
 no_lco.
 
-:- '$hide'(trill_on_swish_call/1).
+:- '$hide'(swish_call/1).
 :- '$hide'(no_lco/0).
 
 
+%%	residuals(+PengineModule, -Goals:list(callable)) is det.
+%
+%	Find residual goals  that  are  not   bound  to  the  projection
+%	variables. We must do so while  we   are  in  the Pengine as the
+%	goals typically live in global variables   that  are not visible
+%	when formulating the answer  from   the  projection variables as
+%	done in library(pengines_io).
+%
+%	This relies on the SWI-Prolog 7.3.14 residual goal extension.
+
+:- if(current_predicate(prolog:residual_goals//0)).
+residuals(TypeIn, Goals) :-
+	phrase(prolog:residual_goals, Goals0),
+	maplist(unqualify_residual(TypeIn), Goals0, Goals).
+
+unqualify_residual(M, M:G, G) :- !.
+unqualify_residual(T, M:G, G) :-
+	predicate_property(T:G, imported_from(M)), !.
+unqualify_residual(_, G, G).
+:- else.
+residuals(_, []).
+:- endif.
+
+
 		 /*******************************
 		 *	  SOURCE LOCATION	*
 		 *******************************/
@@ -291,12 +317,12 @@ frame_file(Frame, File) :-
 %%	pengine_file(+File) is semidet.
 %
 %	True if File is a Pengine controlled file. This is currently the
-%	main file (pengine://) and (trill_on_trill_on_swish://) for included files.
+%	main file (pengine://) and (swish://) for included files.
 
 pengine_file(File) :-
 	sub_atom(File, 0, _, _, 'pengine://'), !.
 pengine_file(File) :-
-	sub_atom(File, 0, _, _, 'trill_on_trill_on_swish://').
+	sub_atom(File, 0, _, _, 'swish://').
 
 %%	clause_position(+PC) is semidet.
 %
@@ -452,7 +478,7 @@ set_file_breakpoints(_Pengine, PFile, Text, Dict) :-
 	->  debug(trace(break), 'Pengine main source', []),
 	    maplist(set_pengine_breakpoint(File, File, Text), List)
 	;   source_file_property(PFile, includes(File, _Time)),
-	    atom_concat('trill_on_trill_on_swish://', StoreFile, File)
+	    atom_concat('swish://', StoreFile, File)
 	->  debug(trace(break), 'Pengine included source ~p', [StoreFile]),
 	    storage_file(StoreFile, IncludedText, _Meta),
 	    maplist(set_pengine_breakpoint(PFile, File, IncludedText), List)
@@ -503,7 +529,7 @@ bp_by_file(Dict, File-Lines) :-
 add_breakpoint(PFile, PFile, Text, Line) :- !,
 	set_pengine_breakpoint(PFile, PFile, Text, Line).
 add_breakpoint(PFile, File, _Text, Line) :-
-	atom_concat('trill_on_trill_on_swish://', Store, File), !,
+	atom_concat('swish://', Store, File), !,
 	storage_file(Store, Text, _Meta),
 	set_pengine_breakpoint(PFile, File, Text, Line).
 add_breakpoint(_, _, _, _Line).			% not in our files.
@@ -530,7 +556,7 @@ current_pengine_breakpoint(PFile, File-(Id-Line)) :-
 
 %%	prolog_clause:open_source(+File, -Stream) is semidet.
 %
-%	Open trill_on_swish non-file sources.
+%	Open SWISH non-file sources.
 
 :- multifile prolog_clause:open_source/2.
 
@@ -543,7 +569,7 @@ prolog_clause:open_source(File, Stream) :-
 	pengine_property(Pengine, source(File, Source)),
 	open_string(Source, Stream).
 prolog_clause:open_source(File, Stream) :-
-	atom_concat('trill_on_swish://', GittyFile, File), !,
+	atom_concat('swish://', GittyFile, File), !,
 	storage_file(GittyFile, Data, _Meta),
 	open_string(Data, Stream).
 
@@ -558,9 +584,10 @@ prolog_clause:open_source(File, Stream) :-
 
 exception_hook(Ex, Ex, _Frame, Catcher) :-
 	Catcher \== none,
+	Catcher \== 'C',
 	prolog_frame_attribute(Catcher, predicate_indicator, PI),
 	debug(trace(exception), 'Ex: ~p, catcher: ~p', [Ex, PI]),
-	PI == '$trill_on_swish wrapper'/1,
+	PI == '$swish wrapper'/1,
 	trace,
 	fail.
 
@@ -596,6 +623,7 @@ sandbox:safe_primitive(system:notrace).
 sandbox:safe_primitive(system:tracing).
 sandbox:safe_primitive(edinburgh:debug).
 sandbox:safe_primitive(system:deterministic(_)).
+sandbox:safe_primitive(swish_trace:residuals(_,_)).
 
 
 		 /*******************************
diff --git a/lib/trill_on_swish/translate_rdf.pl b/lib/trill_on_swish/translate_rdf.pl
deleted file mode 100644
index 0122010..0000000
--- a/lib/trill_on_swish/translate_rdf.pl
+++ /dev/null
@@ -1,2947 +0,0 @@
-:- module(translate_rdf, [load_owl/1, query_expand/1]).
-
-
-:- thread_local
-        classAssertion/2,
-        propertyAssertion/3,
-        subPropertyOf/2,
-        subClassOf/2,
-        equivalentClasses/1,
-        differentIndividuals/1,
-        sameIndividual/1,
-        intersectionOf/1,
-        unionOf/1,
-        propertyRange/2,
-        propertyDomain/2,
-        annotationAssertion/3,
-        exactCardinality/2,
-        exactCardinality/3,
-        maxCardinality/2,
-        maxCardinality/3,
-        minCardinality/2,
-        minCardinality/3.
-
-:- use_module(library(lists),[member/2]).
-:- use_module(library(pengines)).
-:- use_module(library(trill_on_swish/trill/trill)).
-
-
-:- discontiguous(valid_axiom/1).
-:- discontiguous(axiompred/1).
-:- discontiguous(axiom_arguments/2).
-
-
-builtin_class('http://www.w3.org/2002/07/owl#Thing').
-builtin_class('http://www.w3.org/2002/07/owl#Nothing').
-is_class(C) :- class(C).
-is_class(C) :- builtin_class(C).
-
-
-% TODO: hasKey
-
-/****************************************
-  AXIOMS
-  ****************************************/
-
-%% entity(?IRI)
-% the fundamental building blocks of owl 2 ontologies, and they define the vocabulary (the named terms) of an ontology
-%
-% @see individual/1, property/1, class/1, datatype/1
-entity(A) :- individual(A).
-entity(A) :- property(A).
-entity(A) :- class(A).
-entity(A) :- datatype(A).
-axiom_arguments(entity,[iri]).
-valid_axiom(entity(A)) :- subsumed_by([A],[iri]).
-
-%declarationAxiom(individual(A)) :- individual(A). % TODO - check this
-declarationAxiom(namedIndividual(A)) :- namedIndividual(A).
-declarationAxiom(objectProperty(A)) :- objectProperty(A).
-declarationAxiom(dataProperty(A)) :- dataProperty(A).
-declarationAxiom(annotationProperty(A)) :- annotationProperty(A).  % VV added 9/3/2010
-declarationAxiom(class(A)) :- class(A).
-declarationAxiom(datatype(A)) :- datatype(A).
-% TODO: check. here we treat the ontology declaration as an axiom;
-% this liberal definition of axiom allows us to iterate over axiom/1
-% to find every piece of information in the ontology.
-declarationAxiom(ontology(A)) :- ontology(A).
-
-%% class(?IRI)
-% Classes can be understood as sets of individuals
-:- thread_local(class/1).
-
-axiompred(class/1).
-axiom_arguments(class,[iri]).
-valid_axiom(class(A)) :- subsumed_by([A],[iri]).
-
-%% datatype(?IRI)
-% Datatypes are entities that refer to sets of values described by a datatype map
-:- thread_local(datatype/1).
-
-axiompred(datatype/1).
-axiom_arguments(datatype,[iri]).
-valid_axiom(datatype(A)) :- subsumed_by([A],[iri]).
-
-%% property(?IRI)
-% Properties connect individuals with either other individuals or with literals
-%
-% @see dataProperty/1, objectProperty/1, annotationProperty/1
-property(A) :- dataProperty(A).
-property(A) :- objectProperty(A).
-property(A) :- annotationProperty(A).
-axiom_arguments(property,[iri]).
-valid_axiom(property(A)) :- subsumed_by([A],[iri]).
-
-%% objectProperty(?IRI)
-% Object properties connect pairs of individuals
-:- thread_local(objectProperty/1).
-
-axiompred(objectProperty/1).
-axiom_arguments(objectProperty,[iri]).
-valid_axiom(objectProperty(A)) :- subsumed_by([A],[iri]).
-
-%% dataProperty(?IRI)
-% Data properties connect individuals with literals. In some knowledge representation systems, functional data properties are called attributes.
-:- thread_local(dataProperty/1).
-
-axiompred(dataProperty/1).
-axiom_arguments(dataProperty,[iri]).
-valid_axiom(dataProperty(A)) :- subsumed_by([A],[iri]).
-
-%% annotationProperty(?IRI)
-% Annotation properties can be used to provide an annotation for an ontology, axiom, or an IRI
-:- thread_local(annotationProperty/1).
-
-axiompred(annotationProperty/1).
-axiom_arguments(annotationProperty,[iri]).
-valid_axiom(annotationProperty(A)) :- subsumed_by([A],[iri]).
-
-
-%% individual(?IRI)
-% Individuals represent actual objects from the domain being modeled
-% @see anonymousIndividual/1, namedIndividual/1
-individual(A) :- anonymousIndividual(A).
-individual(A) :- namedIndividual(A).
-%individual(A) :- nonvar(A),iri(A),\+property(A),\+class(A),\+ontology(A). % TODO: check: make individuals the default
-axiom_arguments(individual,[iri]).
-valid_axiom(individual(A)) :- subsumed_by([A],[iri]).
-
-%% namedIndividual(?IRI)
-% Named individuals are given an explicit name that can be used in any ontology in the import closure to refer to the same individual
-:- thread_local(namedIndividual/1).
-
-axiompred(namedIndividual/1).
-axiom_arguments(namedIndividual,[iri]).
-valid_axiom(namedIndividual(A)) :- subsumed_by([A],[iri]).
-
-%% anonymousIndividual(?IRI)
-% Anonymous individuals are local to the ontology they are contained in. Analagous to bnodes
-% @see construct/1
-:- thread_local(anonymousIndividual/1).
-
-axiompred(anonymousIndividual/1).
-axiom_arguments(anonymousIndividual,[iri]).
-valid_axiom(anonymousIndividual(A)) :- subsumed_by([A],[iri]).
-
-%% construct(?IRI)
-% @see axiom/1, annotation/1, ontology/1
-construct(A) :- axiom(A).
-construct(A) :- annotation(A).
-construct(A) :- ontology(A).
-axiom_arguments(construct,[iri]).
-valid_axiom(construct(A)) :- subsumed_by([A],[iri]).
-
-%% axiom(?Axiom)
-% The main component of an OWL 2 ontology is a set of axioms - statements that say what is true in the domain being modeled.
-% @see classAxiom/1, propertyAxiom/1, fact/1
-axiom(A) :- classAxiom(A).
-axiom(A) :- propertyAxiom(A).
-axiom(hasKey(A,B)) :- hasKey(A,B).
-axiom(A) :- fact(A).
-axiom(A) :- declarationAxiom(A).
-%axiom(annotation(A,B,C)) :-
-%	annotation(A,B,C). % CJM-treat annotations as axioms
-axiom_arguments(axiom,[axiom]).
-valid_axiom(axiom(A)) :- subsumed_by([A],[axiom]).
-
-%% classAxiom(?Axiom)
-% OWL 2 provides axioms that allow relationships to be established between class expressions. This predicate reifies the actual axiom
-% @see equivalentClasses/1, disjointClasses/1, subClassOf/2, disjointUnion/2
-classAxiom(equivalentClasses(A)) :- equivalentClasses(A).
-classAxiom(disjointClasses(A)) :- disjointClasses(A).
-classAxiom(subClassOf(A, B)) :- subClassOf(A, B).
-classAxiom(disjointUnion(A, B)) :- disjointUnion(A, B).
-axiom_arguments(classAxiom,[axiom]).
-valid_axiom(classAxiom(A)) :- subsumed_by([A],[axiom]).
-
-%% subClassOf(?SubClass:ClassExpression, ?SuperClass:ClassExpression)
-% A subclass axiom SubClassOf( CE1 CE2 ) states that the class expression CE1 is a subclass of the class expression CE2
-%
-%   @param SubClass a classExpression/1 representing the more specific class
-%   @param SuperClass a classExpression/1 representing the more general class
-:- thread_local(subClassOf/2).
-
-axiompred(subClassOf/2).
-axiom_arguments(subClassOf,[classExpression, classExpression]).
-valid_axiom(subClassOf(A, B)) :- subsumed_by([A, B],[classExpression, classExpression]).
-
-
-%% equivalentClasses(?ClassExpressions:set(ClassExpression))
-% An equivalent classes axiom EquivalentClasses( CE1 ... CEn ) states that all of the class expressions CEi, 1 <= i <= n, are semantically equivalent to each other.
-:- thread_local(equivalentClasses/1).
-
-axiompred(equivalentClasses/1).
-axiom_arguments(equivalentClasses,[set(classExpression)]).
-valid_axiom(equivalentClasses(A)) :- subsumed_by([A],[set(classExpression)]).
-
-%% disjointClasses(?ClassExpressions:set(ClassExpression))
-% A disjoint classes axiom DisjointClasses( CE1 ... CEn ) states that all of the class expressions CEi, 1 <= i <= n, are pairwise disjoint; that is, no individual can be at the same time an instance of both CEi and CEj for i != j
-:- thread_local(disjointClasses/1).
-
-axiompred(disjointClasses/1).
-axiom_arguments(disjointClasses,[set(classExpression)]).
-valid_axiom(disjointClasses(A)) :- subsumed_by([A],[set(classExpression)]).
-
-%% disjointUnion(?ClassExpression, ?ClassExpressions:set(ClassExpression))
-% A disjoint union axiom DisjointUnion( C CE1 ... CEn ) states that a class C is a disjoint union of the class expressions CEi, 1 <= i <= n, all of which are pairwise disjoint.
-:- thread_local(disjointUnion/2).
-
-axiompred(disjointUnion/2).
-axiom_arguments(disjointUnion,[classExpression,set(classExpression)]).
-valid_axiom(disjointUnion(A,B)) :- subsumed_by([A,B],[classExpression,set(classExpression)]).
-
-%% propertyAxiom(?Axiom)
-% OWL 2 provides axioms that can be used to characterize and establish relationships between object property expressions. This predicate reifies the actual axiom
-%
-% @see symmetricProperty/1, inverseFunctionalProperty/1, transitiveProperty/1, asymmetricProperty/1, subPropertyOf/2, functionalProperty/1, irreflexiveProperty/1, disjointProperties/1, propertyDomain/2, reflexiveProperty/1, propertyRange/2, equivalentProperties/1, inverseProperties/2
-propertyAxiom(symmetricProperty(A)) :- symmetricProperty(A).
-propertyAxiom(inverseFunctionalProperty(A)) :- inverseFunctionalProperty(A).
-propertyAxiom(transitiveProperty(A)) :- transitiveProperty(A).
-propertyAxiom(asymmetricProperty(A)) :- asymmetricProperty(A).
-propertyAxiom(subPropertyOf(A, B)) :- subPropertyOf(A, B).
-propertyAxiom(functionalProperty(A)) :- functionalProperty(A).
-propertyAxiom(irreflexiveProperty(A)) :- irreflexiveProperty(A).
-propertyAxiom(disjointProperties(A)) :- disjointProperties(A).
-propertyAxiom(propertyDomain(A, B)) :- propertyDomain(A, B).
-propertyAxiom(reflexiveProperty(A)) :- reflexiveProperty(A).
-propertyAxiom(propertyRange(A, B)) :- propertyRange(A, B).
-propertyAxiom(equivalentProperties(A)) :- equivalentProperties(A).
-propertyAxiom(inverseProperties(A, B)) :- inverseProperties(A, B).
-axiom_arguments(propertyAxiom,[axiom]).
-valid_axiom(propertyAxiom(A)) :- subsumed_by([A],[axiom]).
-
-
-%% subPropertyOf(?Sub:PropertyExpression, ?Super:ObjectPropertyExpression)
-% subproperty axioms are analogous to subclass axioms
-% (extensional predicate - can be asserted)
-:- thread_local(subPropertyOf/2).
-
-axiompred(subPropertyOf/2).
-axiom_arguments(subPropertyOf,[propertyExpression, objectPropertyExpression]).
-valid_axiom(subPropertyOf(A, B)) :- subsumed_by([A, B],[propertyExpression, objectPropertyExpression]).
-
-%% subObjectPropertyOf(?Sub:ObjectPropertyExpressionOrChain, ?Super:ObjectPropertyExpression)
-% The basic form is SubPropertyOf( OPE1 OPE2 ). This axiom states that the object property expression OPE1 is a subproperty of the object property expression OPE2 - that is, if an individual x is connected by OPE1 to an individual y, then x is also connected by OPE2 to y. The more complex form is SubPropertyOf( PropertyChain( OPE1 ... OPEn ) OPE ). This axiom states that, if an individual x is connected by a sequence of object property expressions OPE1, ..., OPEn with an individual y, then x is also connected with y by the object property expression OPE
-subObjectPropertyOf(A, B) :- subPropertyOf(A, B),subsumed_by([A, B],[objectPropertyExpressionOrChain, objectPropertyExpression]).
-axiom_arguments(subObjectPropertyOf,[objectPropertyExpressionOrChain, objectPropertyExpression]).
-valid_axiom(subObjectPropertyOf(A, B)) :- subsumed_by([A, B],[objectPropertyExpressionOrChain, objectPropertyExpression]).
-
-%% subDataPropertyOf(?Sub:DataPropertyExpression, ?Super:DataPropertyExpression)
-% A data subproperty axiom SubPropertyOf( DPE1 DPE2 ) states that the data property expression DPE1 is a subproperty of the data property expression DPE2 - that is, if an individual x is connected by OPE1 to a literal y, then x is connected by OPE2 to y as well.
-subDataPropertyOf(A, B) :- subPropertyOf(A, B),subsumed_by([A, B],[dataPropertyExpression, dataPropertyExpression]).
-axiom_arguments(subDataPropertyOf,[dataPropertyExpression, dataPropertyExpression]).
-valid_axiom(subDataPropertyOf(A, B)) :- subsumed_by([A, B],[dataPropertyExpression, dataPropertyExpression]).
-
-%% subAnnotationPropertyOf(?Sub:AnnotationProperty, ?Super:AnnotationProperty)
-% An annotation subproperty axiom SubPropertyOf( AP1 AP2 ) states that the annotation property AP1 is a subproperty of the annotation property AP2
-subAnnotationPropertyOf(A, B) :- subPropertyOf(A, B),subsumed_by([A, B],[annotationProperty, annotationProperty]).
-axiom_arguments(subAnnotationPropertyOf,[annotationProperty, annotationProperty]).
-valid_axiom(subAnnotationPropertyOf(A, B)) :- subsumed_by([A, B],[annotationProperty, annotationProperty]).
-
-%% equivalentProperties(?PropertyExpressions:set(PropertyExpression))
-% An equivalent object properties axiom EquivalentProperties( OPE1 ... OPEn ) states that all of the object property expressions OPEi, 1 <= i <= n, are semantically equivalent to each other
-% (extensional predicate - can be asserted)
-:- thread_local(equivalentProperties/1).
-
-axiompred(equivalentProperties/1).
-axiom_arguments(equivalentProperties,[set(propertyExpression)]).
-valid_axiom(equivalentProperties(A)) :- subsumed_by([A],[set(propertyExpression)]).
-
-%% equivalentObjectProperties(?PropertyExpressions:set(ObjectPropertyExpression))
-% An equivalent object properties axiom EquivalentObjectProperties( OPE1 ... OPEn ) states that all of the object property expressions OPEi, 1 <= i <= n, are semantically equivalent to each other
-equivalentObjectProperties(A) :- equivalentProperties(A),subsumed_by([A],[set(objectPropertyExpression)]).
-axiom_arguments(equivalentObjectProperties,[set(objectPropertyExpression)]).
-valid_axiom(equivalentObjectProperties(A)) :- subsumed_by([A],[set(objectPropertyExpression)]).
-
-%% equivalentDataProperties(?PropertyExpressions:set(DataPropertyExpression))
-% An equivalent data properties axiom EquivalentProperties( DPE1 ... DPEn ) states that all the data property expressions DPEi, 1 <= i <= n, are semantically equivalent to each other. This axiom allows one to use each DPEi as a synonym for each DPEj - that is, in any expression in the ontology containing such an axiom, DPEi can be replaced with DPEj without affecting the meaning of the ontology
-equivalentDataProperties(A) :- equivalentProperties(A),subsumed_by([A],[set(dataPropertyExpression)]).
-axiom_arguments(equivalentDataProperties,[set(dataPropertyExpression)]).
-valid_axiom(equivalentDataProperties(A)) :- subsumed_by([A],[set(dataPropertyExpression)]).
-
-%% disjointProperties(?PropertyExpressions:set(PropertyExpression))
-% A disjoint properties axiom DisjointProperties( PE1 ... PEn ) states that all of the property expressions PEi, 1 <= i <= n, are pairwise disjoint
-% (extensional predicate - can be asserted)
-:- thread_local(disjointProperties/1).
-
-axiompred(disjointProperties/1).
-axiom_arguments(disjointProperties,[set(propertyExpression)]).
-valid_axiom(disjointProperties(A)) :- subsumed_by([A],[set(propertyExpression)]).
-
-%% disjointObjectProperties(?PropertyExpressions:set(ObjectPropertyExpression))
-% A disjoint object properties axiom DisjointProperties( OPE1 ... OPEn ) states that all of the object property expressions OPEi, 1 <= i <= n, are pairwise disjoint; that is, no individual x can be connected to an individual y by both OPEi and OPEj for i != j.
-disjointObjectProperties(A) :- disjointProperties(A),subsumed_by([A],[set(objectPropertyExpression)]).
-axiom_arguments(disjointObjectProperties,[set(objectPropertyExpression)]).
-valid_axiom(disjointObjectProperties(A)) :- subsumed_by([A],[set(objectPropertyExpression)]).
-
-%% disjointDataProperties(?PropertyExpressions:set(DataPropertyExpression))
-% A disjoint data properties axiom DisjointProperties( DPE1 ... DPEn ) states that all of the data property expressions DPEi, 1 <= i <= n, are pairwise disjoint; that is, no individual x can be connected to a literal y by both DPEi and DPEj for i !- j.
-disjointDataProperties(A) :- disjointProperties(A),subsumed_by([A],[set(dataPropertyExpression)]).
-axiom_arguments(disjointDataProperties,[set(dataPropertyExpression)]).
-valid_axiom(disjointDataProperties(A)) :- subsumed_by([A],[set(dataPropertyExpression)]).
-
-%% inverseProperties(?ObjectPropertyExpression1:ObjectPropertyExpression, ?ObjectPropertyExpression2:ObjectPropertyExpression)
-% An inverse object properties axiom InverseProperties( OPE1 OPE2 ) states that the object property expression OPE1 is an inverse of the object property expression OPE2
-% (note there are no inverse data properties, as literals are not connected to individuals)
-% Example:
-% =|inverseProperties(partOf,hasPart)|=
-% (extensional predicate - can be asserted)
-:- thread_local(inverseProperties/2).
-
-axiompred(inverseProperties/2).
-axiom_arguments(inverseProperties,[objectPropertyExpression, objectPropertyExpression]).
-valid_axiom(inverseProperties(A, B)) :- subsumed_by([A, B],[objectPropertyExpression, objectPropertyExpression]).
-
-%% propertyDomain(?PropertyExpression, ?CE)
-%  A property domain axiom PropertyDomain( PE CE ) states that the
-%  domain of the property expression PE is CE
-% (extensional predicate - can be asserted)
-
-:- thread_local(propertyDomain/2).
-
-axiompred(propertyDomain/2).
-axiom_arguments(propertyDomain,[propertyExpression, classExpression]).
-valid_axiom(propertyDomain(A, B)) :- subsumed_by([A, B],[propertyExpression, classExpression]).
-
-%% objectPropertyDomain(?ObjectPropertyExpression, ?ClassExpression)
-% An object property domain axiom PropertyDomain( OPE CE ) states that the domain of the object property expression OPE is the class expression CE - that is, if an individual x is connected by OPE with some other individual, then x is an instance of CE
-objectPropertyDomain(A, B) :- propertyDomain(A, B),subsumed_by([A, B],[objectPropertyExpression, classExpression]).
-axiom_arguments(objectPropertyDomain,[objectPropertyExpression, classExpression]).
-valid_axiom(objectPropertyDomain(A, B)) :- subsumed_by([A, B],[objectPropertyExpression, classExpression]).
-
-%% dataPropertyDomain(?DataPropertyExpression, ?ClassExpression)
-% A data property domain axiom PropertyDomain( DPE CE ) states that the domain of the data property expression DPE is the class expression CE - that is, if an individual x is connected by DPE with some literal, then x is an instance of CE
-dataPropertyDomain(A, B) :- propertyDomain(A, B),subsumed_by([A, B],[dataPropertyExpression, classExpression]).
-axiom_arguments(dataPropertyDomain,[dataPropertyExpression, classExpression]).
-valid_axiom(dataPropertyDomain(A, B)) :- subsumed_by([A, B],[dataPropertyExpression, classExpression]).
-
-%% annotationPropertyDomain(?AnnotationProperty, ?IRI)
-% An annotation property domain axiom PropertyDomain( AP U ) states that the domain of the annotation property AP is the IRI U. Such axioms have no effect on the Direct Semantics of OWL 2
-annotationPropertyDomain(A, B) :- propertyDomain(A, B),subsumed_by([A, B],[annotationProperty, iri]).
-axiom_arguments(annotationPropertyDomain,[annotationProperty, iri]).
-valid_axiom(annotationPropertyDomain(A, B)) :- subsumed_by([A, B],[annotationProperty, iri]).
-
-%% propertyRange(?PropertyExpression, ?ClassExpression)
-% An object property domain axiom PropertyRange( OPE CE ) states that the domain of the object property expression OPE is the class expression CE - that is, if an individual x is connected by OPE with some other individual, then x is an instance of CE
-% (extensional predicate - can be asserted)
-:- thread_local(propertyRange/2).
-
-axiompred(propertyRange/2).
-axiom_arguments(propertyRange,[propertyExpression, classExpression]).
-valid_axiom(propertyRange(A, B)) :- subsumed_by([A, B],[propertyExpression, classExpression]).
-
-%% objectPropertyRange(?ObjectPropertyExpression, ?ClassExpression)
-% An object property domain axiom PropertyRange( OPE CE ) states that the domain of the object property expression OPE is the class expression CE - that is, if an individual x is connected by OPE with some other individual, then x is an instance of CE
-objectPropertyRange(A, B) :- propertyRange(A, B),subsumed_by([A, B],[objectPropertyExpression, classExpression]).
-axiom_arguments(objectPropertyRange,[objectPropertyExpression, classExpression]).
-valid_axiom(objectPropertyRange(A, B)) :- subsumed_by([A, B],[objectPropertyExpression, classExpression]).
-
-%% dataPropertyRange(?ObjectPropertyExpression, ?DataRange)
-% A data property range axiom PropertyRange( DPE DR ) states that the range of the data property expression DPE is the data range DR - that is, if some individual is connected by DPE with a literal x, then x is in DR. The arity of DR MUST be one
-dataPropertyRange(A, B) :- propertyRange(A, B),subsumed_by([A, B],[dataPropertyExpression, dataRange]).
-axiom_arguments(dataPropertyRange,[objectPropertyExpression, dataRange]).
-valid_axiom(dataPropertyRange(A, B)) :- subsumed_by([A, B],[objectPropertyExpression, dataRange]).
-
-%% annotationPropertyRange(?AnnotationProperty, ?IRI)
-% An annotation property range axiom PropertyRange( AP U ) states that the range of the annotation property AP is the IRI U. Such axioms have no effect on the Direct Semantics of OWL 2
-annotationPropertyRange(A, B) :- propertyRange(A, B),subsumed_by([A, B],[annotationProperty, iri]).
-axiom_arguments(annotationPropertyRange,[annotationProperty, iri]).
-valid_axiom(annotationPropertyRange(A, B)) :- subsumed_by([A, B],[annotationProperty, iri]).
-
-%% functionalProperty(?PropertyExpression)
-% An object property functionality axiom FunctionalProperty( OPE ) states that the object property expression OPE is functional - that is, for each individual x, there can be at most one distinct individual y such that x is connected by OPE to y
-% (extensional predicate - can be asserted)
-:- thread_local(functionalProperty/1).
-
-axiompred(functionalProperty/1).
-axiom_arguments(functionalProperty,[propertyExpression]).
-valid_axiom(functionalProperty(A)) :- subsumed_by([A],[propertyExpression]).
-
-%% functionalObjectProperty(?ObjectPropertyExpression)
-% An object property functionality axiom FunctionalProperty( OPE ) states that the object property expression OPE is functional - that is, for each individual x, there can be at most one distinct individual y such that x is connected by OPE to y
-functionalObjectProperty(A) :- functionalProperty(A),subsumed_by([A],[objectPropertyExpression]).
-axiom_arguments(functionalObjectProperty,[objectPropertyExpression]).
-valid_axiom(functionalObjectProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% functionalDataProperty(?DataPropertyExpression)
-% A data property functionality axiom FunctionalProperty( DPE ) states that the data property expression DPE is functional - that is, for each individual x, there can be at most one distinct literal y such that x is connected by DPE with y
-functionalDataProperty(A) :- functionalProperty(A),subsumed_by([A],[dataPropertyExpression]).
-axiom_arguments(functionalDataProperty,[dataPropertyExpression]).
-valid_axiom(functionalDataProperty(A)) :- subsumed_by([A],[dataPropertyExpression]).
-
-%% inverseFunctionalProperty(?ObjectPropertyExpression)
-% An object property inverse functionality axiom InverseFunctionalProperty( OPE ) states that the object property expression OPE is inverse-functional - that is, for each individual x, there can be at most one individual y such that y is connected by OPE with x. Note there are no InverseFunctional DataProperties
-:- thread_local(inverseFunctionalProperty/1).
-
-axiompred(inverseFunctionalProperty/1).
-axiom_arguments(inverseFunctionalProperty,[objectPropertyExpression]).
-valid_axiom(inverseFunctionalProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% reflexiveProperty(?ObjectPropertyExpression)
-% An object property reflexivity axiom ReflexiveProperty( OPE ) states that the object property expression OPE is reflexive - that is, each individual is connected by OPE to itself
-:- thread_local(reflexiveProperty/1).
-
-axiompred(reflexiveProperty/1).
-axiom_arguments(reflexiveProperty,[objectPropertyExpression]).
-valid_axiom(reflexiveProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% irreflexiveProperty(?ObjectPropertyExpression)
-% An object property reflexivity axiom ReflexiveProperty( OPE ) states that the object property expression OPE is reflexive - that is, no individual is connected by OPE to itsel
-:- thread_local(irreflexiveProperty/1).
-
-axiompred(irreflexiveProperty/1).
-axiom_arguments(irreflexiveProperty,[objectPropertyExpression]).
-valid_axiom(irreflexiveProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% symmetricProperty(?ObjectPropertyExpression)
-% An object property symmetry axiom SymmetricProperty( OPE ) states that the object property expression OPE is symmetric - that is, if an individual x is connected by OPE to an individual y, then y is also connected by OPE to x
-:- thread_local(symmetricProperty/1).
-
-axiompred(symmetricProperty/1).
-axiom_arguments(symmetricProperty,[objectPropertyExpression]).
-valid_axiom(symmetricProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% asymmetricProperty(?ObjectPropertyExpression)
-% An object property asymmetry axiom AsymmetricProperty( OPE ) states that the object property expression OPE is asymmetric - that is, if an individual x is connected by OPE to an individual y, then y cannot be connected by OPE to x
-:- thread_local(asymmetricProperty/1).
-
-axiompred(asymmetricProperty/1).
-axiom_arguments(asymmetricProperty,[objectPropertyExpression]).
-valid_axiom(asymmetricProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% transitiveProperty(?ObjectPropertyExpression)
-% An object property transitivity axiom TransitiveProperty( OPE ) states that the object property expression OPE is transitive - that is, if an individual x is connected by OPE to an individual y that is connected by OPE to an individual z, then x is also connected by OPE to z
-:- thread_local(transitiveProperty/1).
-
-axiompred(transitiveProperty/1).
-axiom_arguments(transitiveProperty,[objectPropertyExpression]).
-valid_axiom(transitiveProperty(A)) :- subsumed_by([A],[objectPropertyExpression]).
-
-%% hasKey(?ClassExpression,?PropertyExpression)
-% A key axiom HasKey( CE PE1 ... PEn ) states that each (named) instance of the class expression CE is uniquely identified by the (data or object) property expressions PEi - that is, no two distinct (named) instances of CE can coincide on the values of all property expressions PEi
-:- thread_local(hasKey/2).
-
-axiompred(hasKey/2).
-axiom_arguments(hasKey,[classExpression,propertyExpression]).
-valid_axiom(hasKey(CE,PE)) :- subsumed_by([CE,PE],[classExpression,propertyExpression]).
-
-
-%% fact(?Axiom)
-% OWL 2 supports a rich set of axioms for stating assertions - axioms about individuals that are often also called facts. The fact/1 predicate reifies the fact predicate
-%
-% @see annotationAssertion/3, differentIndividuals/1, negativePropertyAssertion/3, propertyAssertion/3, sameIndividual/1, classAssertion/2
-fact(annotationAssertion(A, B, C)) :- annotationAssertion(A, B, C).
-fact(differentIndividuals(A)) :- differentIndividuals(A).
-fact(negativePropertyAssertion(A, B, C)) :- negativePropertyAssertion(A, B, C).
-fact(propertyAssertion(A, B, C)) :- propertyAssertion(A, B, C).
-fact(sameIndividual(A)) :- sameIndividual(A).
-fact(classAssertion(A, B)) :- classAssertion(A, B).
-axiom_arguments(fact,[axiom]).
-valid_axiom(fact(A)) :- subsumed_by([A],[axiom]).
-
-%% sameIndividual(?Individuals:set(Individual))
-% An individual equality axiom SameIndividual( a1 ... an ) states that all of the individuals ai, 1 <= i <= n, are equal to each other.
-% note that despite the name of this predicate, it accepts a list of individuals as argument
-:- thread_local(sameIndividual/1).
-
-axiompred(sameIndividual/1).
-axiom_arguments(sameIndividual,[set(individual)]).
-valid_axiom(sameIndividual(A)) :- subsumed_by([A],[set(individual)]).
-
-%% differentIndividuals(?Individuals:set(Individual))
-% An individual inequality axiom DifferentIndividuals( a1 ... an ) states that all of the individuals ai, 1 <= i <= n, are different from each other
-:- thread_local(differentIndividuals/1).
-
-axiompred(differentIndividuals/1).
-axiom_arguments(differentIndividuals,[set(individual)]).
-valid_axiom(differentIndividuals(A)) :- subsumed_by([A],[set(individual)]).
-
-%% classAssertion(?ClassExpression, ?Individual)
-% A class assertion ClassAssertion( CE a ) states that the individual a is an instance of the class expression CE
-:- thread_local(classAssertion/2).
-
-axiompred(classAssertion/2).
-axiom_arguments(classAssertion,[classExpression, individual]).
-valid_axiom(classAssertion(A, B)) :- subsumed_by([A, B],[classExpression, individual]).
-
-%% propertyAssertion(?PropertyExpression, ?SourceIndividual:Individual, ?TargetIndividual:Individual)
-% A positive object property assertion PropertyAssertion( OPE a1 a2 ) states that the individual a1 is connected by the object property expression OPE to the individual a2
-% (extensional predicate - can be asserted)
-:- thread_local(propertyAssertion/3).
-
-axiompred(propertyAssertion/3).
-axiom_arguments(propertyAssertion,[propertyExpression, individual, individual]).
-valid_axiom(propertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[propertyExpression, individual, individual]).
-
-%% objectPropertyAssertion(?ObjectPropertyExpression, ?SourceIndividual:Individual, ?TargetIndividual:Individual)
-% A positive object property assertion PropertyAssertion( OPE a1 a2 ) states that the individual a1 is connected by the object property expression OPE to the individual a2
-objectPropertyAssertion(A, B, C) :- propertyAssertion(A, B, C),subsumed_by([A, B, C],[objectPropertyExpression, individual, individual]).
-axiom_arguments(objectPropertyAssertion,[objectPropertyExpression, individual, individual]).
-valid_axiom(objectPropertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[objectPropertyExpression, individual, individual]).
-
-%% dataPropertyAssertion(?ObjectPropertyExpression, ?SourceIndividual:Individual, ?TargetValue:Literal)
-% A positive data property assertion PropertyAssertion( DPE a lt ) states that the individual a is connected by the data property expression DPE to the literal lt
-dataPropertyAssertion(A, B, C) :- propertyAssertion(A, B, C),subsumed_by([A, B, C],[dataPropertyExpression, individual, literal]).
-axiom_arguments(dataPropertyAssertion,[objectPropertyExpression, individual, literal]).
-valid_axiom(dataPropertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[dataPropertyExpression, individual, literal]).
-
-%% negativePropertyAssertion(?PropertyExpression, ?SourceIndividual:Individual, ?TargetIndividual:Individual)
-% A negative object property assertion NegativePropertyAssertion( OPE a1 a2 ) states that the individual a1 is not connected by the object property expression OPE to the individual a2
-% (extensional predicate - can be asserted)
-:- thread_local(negativePropertyAssertion/3).
-
-axiompred(negativePropertyAssertion/3).
-axiom_arguments(negativePropertyAssertion,[propertyExpression, individual, individual]).
-valid_axiom(negativePropertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[propertyExpression, individual, individual]).
-
-%% negativeObjectPropertyAssertion(?ObjectPropertyExpression, ?SourceIndividual:Individual, ?TargetIndividual:Individual)
-% A negative object property assertion NegativePropertyAssertion( OPE a1 a2 ) states that the individual a1 is not connected by the object property expression OPE to the individual a2
-negativeObjectPropertyAssertion(A, B, C) :- negativePropertyAssertion(A, B, C),subsumed_by([A, B, C],[objectPropertyExpression, individual, individual]).
-axiom_arguments(negativeObjectPropertyAssertion,[objectPropertyExpression, individual, individual]).
-valid_axiom(negativeObjectPropertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[objectPropertyExpression, individual, individual]).
-
-%% negativeDataPropertyAssertion(?DataPropertyExpression, ?SourceIndividual:Individual, ?TargetValue:Literal)
-% A negative data property assertion NegativePropertyAssertion( DPE a lt ) states that the individual a is not connected by the data property expression DPE to the literal lt
-negativeDataPropertyAssertion(A, B, C) :- negativePropertyAssertion(A, B, C),subsumed_by([A, B, C],[dataPropertyExpression, individual, literal]).
-axiom_arguments(negativeDataPropertyAssertion,[dataPropertyExpression, individual, literal]).
-valid_axiom(negativeDataPropertyAssertion(A, B, C)) :- subsumed_by([A, B, C],[dataPropertyExpression, individual, literal]).
-
-%% annotationAssertion(?AnnotationProperty, ?AnnotationSubject, ?AnnotationValue)
-% An annotation assertion AnnotationAssertion( AP as av ) states that the annotation subject as - an IRI or an anonymous individual - is annotated with the annotation property AP and the annotation value av
-:- thread_local(annotationAssertion/3).
-
-axiompred(annotationAssertion/3).
-axiom_arguments(annotationAssertion,[annotationProperty, annotationSubject, annotationValue]).
-valid_axiom(annotationAssertion(A, B, C)) :- subsumed_by([A, B, C],[annotationProperty, annotationSubject, annotationValue]).
-annotationSubject(_).
-annotationValue(_).
-
-%% annotation(?IRI,?AnnotationProperty,?AnnotationValue)
-%
-% @see annotationAnnotation/3, ontologyAnnotation/3, axiomAnnotation/3
-:- thread_local(annotation/3).
-
-axiompred(annotation/3).
-
-annotation(annotationAnnotation(A, B, C)) :- annotationAnnotation(A, B, C).
-annotation(axiomAnnotation(A, B, C)) :- axiomAnnotation(A, B, C).
-axiom_arguments(annotation,[iri,annotationProperty,annotationValue]).
-valid_axiom(annotation(A,B,C)) :- subsumed_by([A,B,C],[iri,annotationProperty,annotationValue]).
-
-%% ontologyAnnotation(?Ontology, ?AnnotationProperty, ?AnnotationValue)
-ontologyAnnotation(Ontology,AP,AV) :-
-	annotation(Ontology,AP,AV),
-	ontology(Ontology).
-axiom_arguments(ontologyAnnotation,[ontology, annotationProperty, annotationValue]).
-valid_axiom(ontologyAnnotation(A, B, C)) :- subsumed_by([A, B, C],[ontology, annotationProperty, annotationValue]).
-
-%% axiomAnnotation(?Axiom, ?AnnotationProperty, ?AnnotationValue)
-axiomAnnotation(Axiom,AP,AV) :-
-	annotation(Axiom,AP,AV),
-	axiom(Axiom).
-axiom_arguments(axiomAnnotation,[axiom, annotationProperty, annotationValue]).
-valid_axiom(axiomAnnotation(A, B, C)) :- subsumed_by([A, B, C],[axiom, annotationProperty, annotationValue]).
-
-%% annotationAnnotation(?Annotation, ?AnnotationProperty, ?AnnotationValue)
-annotationAnnotation(Annotation,AP,AV) :-
-	annotation(Annotation,AP,AV),
-	annotation(Annotation).
-axiom_arguments(annotationAnnotation,[annotation, annotationProperty, annotationValue]).
-valid_axiom(annotationAnnotation(A, B, C)) :- subsumed_by([A, B, C],[annotation, annotationProperty, annotationValue]).
-
-%% ontology(?IRI)
-% An ontology in OWL2 is a collection of OWL Axioms
-:- thread_local(ontology/1).
-
-axiompred(ontology/1).
-axiom_arguments(ontology,[iri]).
-valid_axiom(ontology(A)) :- subsumed_by([A],[iri]).
-
-%% ontologyDirective(?OntologyIRI,?IRI)
-% @see ontologyImport/2, ontologyAxiom/2
-ontologyDirective(A, B) :- ontologyImport(A, B).
-ontologyDirective(A, B) :- ontologyAxiom(A, B).
-ontologyDirective(A, B) :- ontologyVersionInfo(A, B).
-axiom_arguments(ontologyDirective,[ontology, iri]).
-valid_axiom(ontologyDirective(A, B)) :- subsumed_by([A, B],[ontology, iri]).
-
-%% ontologyAxiom(?Ontology, ?Axiom)
-% True if Ontology contains Axiom.
-% Axiom is a prolog term that is typically asserted and separately and can thus can be executed as a goal.
-% For example, an ontology http://example.org# will contain redundant assertions:
-% ==
-% subClassOf('http://example.org#a', 'http://example.org#b').
-% ontologyAxiom('http://example.org#', subClassOf('http://example.org#a','http://example.org#b')).
-% ==
-:- thread_local(ontologyAxiom/2).
-
-axiompred(ontologyAxiom/2).
-axiom_arguments(ontologyAxiom,[ontology, axiom]).
-valid_axiom(ontologyAxiom(A, B)) :- subsumed_by([A, B],[ontology, axiom]).
-
-%% ontologyImport(?Ontology, ?IRI)
-% True of Ontology imports document IRI
-:- thread_local(ontologyImport/2).
-
-axiompred(ontologyImport/2).
-axiom_arguments(ontologyImport,[ontology, iri]).
-valid_axiom(ontologyImport(A, B)) :- subsumed_by([A, B],[ontology, iri]).
-
-%% ontologyVersionInfo(?Ontology, ?IRI)
-:- thread_local(ontologyVersionInfo/2).
-
-axiompred(ontologyVersionInfo/2).
-axiom_arguments(ontologyVersionInfo,[ontology, iri]).
-valid_axiom(ontologyVersionInfo(A, B)) :- subsumed_by([A, B],[ontology, iri]).
-
-/****************************************
-  RESTRICTIONS ON AXIOMS
-  ****************************************/
-
-% 11.1
-% An object property expression OPE is simple in Ax if, for each object property expression OPE' such that OPE' ->* OPE holds, OPE' is not composite.
-% (The property hierarchy relation ->* is the reflexive-transitive closure of ->)
-%simpleObjectPropertyExpresion(OPE) :-
-%        objectPropertyExpression(OPE),
-
-
-/****************************************
-  EXPRESSIONS
-  ****************************************/
-
-subsumed_by(X,_) :- var(X),!.
-subsumed_by([],[]) :- !.
-subsumed_by([I|IL],[T|TL]) :-
-	!,
-	subsumed_by(I,T),
-	subsumed_by(IL,TL).
-subsumed_by(L,set(T)):-
-        !,
-        forall(member(I,L),
-               subsumed_by(I,T)).
-subsumed_by(I,T):-
-        !,
-	G=..[T,I],
-	G.
-
-
-%% iri(?IRI)
-% true if IRI is an IRI. TODO: currently underconstrained, any atomic term can be an IRI
-iri(IRI) :- atomic(IRI).	%
-
-%% literal(?Lit)
-% true if Lit is an rdf literal
-%literal(_).			% TODO
-literal(literal(_)).			% TODO
-
-propertyExpression(E) :- objectPropertyExpression(E) ; dataPropertyExpression(E).
-
-%% objectPropertyExpression(?OPE)
-% true if OPE is an ObjectPropertyExpression
-% ObjectPropertyExpression := ObjectProperty | InverseObjectProperty
-objectPropertyExpression(E) :- objectProperty(E) ; inverseObjectProperty(E).
-
-% give benefit of doubt; e.g. rdfs:label
-% in the OWL2 spec we have DataProperty := IRI
-% here dataProperty/1 is an asserted fact
-objectPropertyExpression(E) :- nonvar(E),iri(E).
-
-objectPropertyExpressionOrChain(propertyChain(PL)) :- forall(member(P,PL),objectPropertyExpression(P)).
-objectPropertyExpressionOrChain(PE) :- objectPropertyExpression(PE).
-
-
-inverseObjectProperty(inverseOf(OP)) :- objectProperty(OP).
-
-dataPropertyExpression(E) :- dataProperty(E).
-
-dataPropertyExpression(DPEs) :-
-	(   is_list(DPEs)
-	->  forall(member(DPE,DPEs),
-		   dataPropertyExpression(DPE))
-	;   dataPropertyExpression(DPEs)).
-
-% give benefit of doubt; e.g. rdfs:label
-% in the OWL2 spec we have DataProperty := IRI
-% here dataProperty/1 is an asserted fact
-dataPropertyExpression(E) :- nonvar(E),iri(E).
-
-%already declared as entity
-%datatype(IRI) :- iri(IRI).
-
-%% dataRange(+DR) is semidet
-dataRange(DR) :-
-    datatype(DR) ;
-    dataIntersectionOf(DR );
-    dataUnionOf(DR) ;
-    dataComplementOf(DR) ;
-    dataOneOf(DR) ;
-    datatypeRestriction(DR).
-
-%% classExpression(+CE) is semidet
-%
-% true if CE is a class expression term, as defined in OWL2
-%
-% Example: =|classExpression(intersectionOf([car,someValuesFrom(hasColor,blue)])))|=
-%
-% Union of:
-%
-%    class/1 | objectIntersectionOf/1 | objectUnionOf/1 |
-%    objectComplementOf/1 | objectOneOf/1 | objectSomeValuesFrom/1 |
-%    objectAllValuesFrom/1 | objectHasValue/1 | objectHasSelf/1 |
-%    objectMinCardinality/1 | objectMaxCardinality/1 |
-%    objectExactCardinality/1 | dataSomeValuesFrom/1 |
-%    dataAllValuesFrom/1 | dataHasValue/1 | dataMinCardinality/1 |
-%    dataMaxCardinality/1 | dataExactCardinality/1
-classExpression(CE):-
-        iri(CE) ;               % NOTE: added to allow cases where class is not imported
-    class(CE) ;
-    objectIntersectionOf(CE) ; objectUnionOf(CE) ; objectComplementOf(CE) ; objectOneOf(CE) ;
-    objectSomeValuesFrom(CE) ; objectAllValuesFrom(CE) ; objectHasValue(CE) ; objectHasSelf(CE) ;
-    objectMinCardinality(CE) ; objectMaxCardinality(CE) ; objectExactCardinality(CE) ;
-    dataSomeValuesFrom(CE) ; dataAllValuesFrom(CE) ; dataHasValue(CE) ;
-    dataMinCardinality(CE) ; dataMaxCardinality(CE) ; dataExactCardinality(CE).
-
-%% objectIntersectionOf(+CE) is semidet
-% true if CE is a term intersectionOf(ClassExpression:list)
-%
-% An intersection class expression IntersectionOf( CE1 ... CEn ) contains all individuals that are instances of all class expressions CEi for 1 <= i <= n.
-objectIntersectionOf(intersectionOf(CEs)) :-
-	forall(member(CE,CEs),
-	       classExpression(CE)).
-
-%% objectUnionOf(+CE) is semidet
-% A union class expression UnionOf( CE1 ... CEn ) contains all individuals that are instances of at least one class expression CEi for 1 <= i <= n
-objectUnionOf(unionOf(CEs)) :-
-	forall(member(CE,CEs),
-	       classExpression(CE)).
-
-%% objectComplementOf(+CE) is semidet
-%
-objectComplementOf(complementOf(CE)) :-
-	classExpression(CE).
-
-%% objectOneOf(+CE) is semidet
-% An enumeration of individuals OneOf( a1 ... an ) contains exactly the individuals ai with 1 <= i <= n.
-objectOneOf(oneOf(Is)) :-
-        is_list(Is). % TODO: check if we need to strengthen this check
-%objectOneOf(oneOf(Is)) :-
-%	forall(member(I,Is),
-%	       individual(I)).
-
-%% objectSomeValuesFrom(+R) is semidet
-% An existential class expression SomeValuesFrom( OPE CE ) consists of an object property expression OPE and a class expression CE, and it contains all those individuals that are connected by OPE to an individual that is an instance of CE
-objectSomeValuesFrom(someValuesFrom(OPE,CE)) :-
-	objectPropertyExpression(OPE),
-	classExpression(CE).
-
-%% objectAllValuesFrom(+R) is semidet
-% A universal class expression AllValuesFrom( OPE CE ) consists of an object property expression OPE and a class expression CE, and it contains all those individuals that are connected by OPE only to individuals that are instances of CE
-objectAllValuesFrom(allValuesFrom(OPE,CE)) :-
-	objectPropertyExpression(OPE),
-	classExpression(CE).
-
-%% objectHasValue(+R) is semidet
-% A has-value class expression HasValue( OPE a ) consists of an object property expression OPE and an individual a, and it contains all those individuals that are connected by OPE to a
-objectHasValue(hasValue(OPE,I)) :-
-	objectPropertyExpression(OPE),
-	individual(I).
-
-%% objectHasSelf(+R) is semidet
-% A self-restriction HasSelf( OPE ) consists of an object property expression OPE, and it contains all those individuals that are connected by OPE to themselves
-objectHasSelf(hasSelf(OPE)) :-
-	objectPropertyExpression(OPE).
-
-%% objectMinCardinality(+CR) is semidet
-% A minimum cardinality expression MinCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE to at least n different individuals that are instances of CE. If CE is missing, it is taken to be owl:Thing
-objectMinCardinality(minCardinality(C,OPE,CE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE),
-	classExpression(CE).
-objectMinCardinality(minCardinality(C,OPE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE).
-
-
-%% objectMaxCardinality(+CR) is semidet
-% A maximum cardinality expression MaxCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE to at most n different individuals that are instances of CE. If CE is missing, it is taken to be owl:Thing
-objectMaxCardinality(maxCardinality(C,OPE,CE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE),
-	classExpression(CE).
-objectMaxCardinality(maxCardinality(C,OPE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE).
-
-%% objectExactCardinality(+CR) is semidet
-% An exact cardinality expression ExactCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE to exactly n different individuals that are instances of CE. If CE is missing, it is taken to be owl:Thing
-objectExactCardinality(exactCardinality(C,OPE,CE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE),
-	classExpression(CE).
-objectExactCardinality(exactCardinality(C,OPE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE).
-% NON-NORMATIVE: we accept this in order to maximize compatibility with Thea1
-objectExactCardinality(cardinality(C,OPE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE).
-
-
-%% dataIntersectionOf(+DR:dataIntersectionOf) is semidet
-% An intersection data range IntersectionOf( DR1 ... DRn ) contains all data values that are contained in the value space of every data range DRi for 1 <= i <= n. All data ranges DRi must be of the same arity
-dataIntersectionOf(intersectionOf(DRs)) :-
-	forall(member(DR,DRs),
-	       dataRange(DR)).
-
-%% dataUnionOf(+DR:dataUnionOf) is semidet
-% A union data range UnionOf( DR1 ... DRn ) contains all data values that are contained in the value space of at least one data range DRi for 1 <= i <= n. All data ranges DRi must be of the same arity
-dataUnionOf(unionOf(DRs)) :-
-	forall(member(DR,DRs),
-	       dataRange(DR)).
-
-%% dataComplementOf(+DR:dataComplementOf) is semidet
-% A complement data range ComplementOf( DR ) contains all literals that are not contained in the data range DR
-dataComplementOf(complementOf(DR)) :-
-	dataRange(DR).
-
-%% dataOneOf(+DR:dataOneOf) is semidet
-% An enumeration of literals OneOf( lt1 ... ltn ) contains exactly the explicitly specified literals lti with 1 <= i <= n
-dataOneOf(oneOf(DRs)) :-
-	forall(member(DR,DRs),
-	       dataRange(DR)).
-
-%% datatypeRestriction(+DR) is semidet
-%
-% TODO: multiple args
-datatypeRestriction(datatypeRestriction(DR,FacetValues)):-
-	datatype(DR),
-	FacetValues=[_|_].
-
-%% dataSomeValuesFrom(+DR) is semidet
-dataSomeValuesFrom(someValuesFrom(DPE,DR)):-
-	dataPropertyExpression(DPE),
-	dataRange(DR).
-
-%% dataAllValuesFrom(+DR) is semidet
-dataAllValuesFrom(allValuesFrom(DPE,DR)):-
-	dataPropertyExpression(DPE),
-	dataRange(DR).
-
-%% dataHasValue(+DR) is semidet
-% A has-value class expression HasValue( DPE lt ) consists of a data property expression DPE and a literal lt, and it contains all those individuals that are connected by DPE to lt. Each such class expression can be seen as a syntactic shortcut for the class expression SomeValuesFrom( DPE OneOf( lt ) )
-dataHasValue(hasValue(DPE,L)):-
-	dataPropertyExpression(DPE),
-	literal(L).
-
-%% dataMinCardinality(+DR) is semidet
-% A minimum cardinality expression MinCardinality( n DPE DR ) consists of a nonnegative integer n, a data property expression DPE, and a unary data range DR, and it contains all those individuals that are connected by DPE to at least n different literals in DR. If DR is not present, it is taken to be rdfs:Literal
-dataMinCardinality(minCardinality(C,DPE,DR)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE),
-	dataRange(DR).
-dataMinCardinality(minCardinality(C,DPE)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE).
-
-
-
-%% dataMaxCardinality(+DR) is semidet
-% A maximum cardinality expression MaxCardinality( n DPE DR ) consists of a nonnegative integer n, a data property expression DPE, and a unary data range DR, and it contains all those individuals that are connected by DPE to at most n different literals in DR. If DR is not present, it is taken to be rdfs:Literal.
-dataMaxCardinality(maxCardinality(C,DPE,DR)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE),
-	dataRange(DR).
-dataMaxCardinality(maxCardinality(C,DPE)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE).
-
-
-%% dataExactCardinality(+DR) is semidet
-% An exact cardinality expression ExactCardinality( n DPE DR ) consists of a nonnegative integer n, a data property expression DPE, and a unary data range DR, and it contains all those individuals that are connected by DPE to exactly n different literals in DR. If DR is not present, it is taken to be rdfs:Literal
-dataExactCardinality(exactCardinality(C,DPE,DR)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE),
-	dataRange(DR).
-dataExactCardinality(exactCardinality(C,DPE)):-
-	number(C),
-	C>=0,
-	dataPropertyExpression(DPE).
-% NON-NORMATIVE: we accept this in order to maximize compatibility with Thea1
-dataExactCardinality(cardinality(C,OPE)):-
-	number(C),
-	C>=0,
-	objectPropertyExpression(OPE).
-
-
-%% valid_axiom(?Axiom) is nondet
-% true if Axiom passes typechecking
-
-
-%% is_valid_axiom(?Axiom) is semidet
-% true if Axiom passes typechecking
-is_valid_axiom(Axiom) :- \+ \+ valid_axiom(Axiom).
-
-
-/****************************************
-  VIEW PREDICATES
-  ****************************************/
-
-%% equivalent_to(?X,?Y)
-% note: this is currently slow for bound values of X and Y
-equivalent_to(X,Y) :- equivalentClasses(L),member(X,L),member(Y,L),X\=Y.
-equivalent_to(X,Y) :- equivalentProperties(L),member(X,L),member(Y,L),X\=Y.
-
-disjoint_with(X,Y) :- disjointClasses(L),member(X,L),member(Y,L),X\=Y.
-
-%% anyPropertyAssertion(?Property,?Entity,?Value)
-% subsumes propertyAssertion/3 and annotationAssertion/3
-anyPropertyAssertion(P,E,V) :- propertyAssertion(P,E,V).
-anyPropertyAssertion(P,E,V) :- annotationAssertion(P,E,V).
-
-
-%% labelAnnotation_value(?X,?Val)
-labelAnnotation_value(X,Val) :-
-        anyPropertyAssertion('http://www.w3.org/2000/01/rdf-schema#label', X, literal(type(_,Val))),atom(Val).
-labelAnnotation_value(X,Val) :-
-        anyPropertyAssertion('http://www.w3.org/2000/01/rdf-schema#label', X, literal(lang(_,Val))),atom(Val).
-labelAnnotation_value(X,Val) :-
-        anyPropertyAssertion('http://www.w3.org/2000/01/rdf-schema#label', X, literal(Val)),atom(Val).
-
-/****************************************
-  META-PREDICATES
-  ****************************************/
-
-
-%% axiom_directly_about(?Ax,?About)
-% true if Ax is an axiom whose first argument is equal to About.
-%
-% e.g. axiom_directly_about( subClassOf(X,_), X).
-%
-% also include property assertions whose second argument is equal to About.
-%
-% e.g. axiom_directly_about( propertyAssertion(P,X,_), X).
-%
-axiom_directly_about(Ax,About) :-
-        axiom(Ax),
-        Ax =.. [_,Arg1|_],
-        (   is_list(Arg1)
-        ->  member(About,Arg1)
-        ;   About=Arg1).
-axiom_directly_about(Ax,About) :-
-	Ax=propertyAssertion(_,About,_),
-        axiom(Ax).
-axiom_directly_about(Ax,About) :-
-	Ax=annotationAssertion(_,About,_),
-        axiom(Ax).
-axiom_directly_about(Ax,About) :-
-	Ax=classAssertion(_,About),
-        axiom(Ax).
-
-
-%% axiom_directly_references(?Ax:axiom,?Ref)
-%
-% Ref may be
-%  - an axiom
-%  - a named entity
-%  - an expression
-axiom_directly_references(Ax,Ref) :-
-        axiom(Ax),
-        axiom_or_expression_references(Ax,Ref).
-
-axiom_or_expression_references(X,Ref) :-
-        X =.. [P|Args],
-        P\=literal,
-        member(Arg,Args),
-        (   is_list(Arg)
-        ->  member(Ref,Arg)
-        ;   Ref=Arg).
-
-axiom_about(Ax,About) :-
-        axiom_directly_about(Ax,About).
-axiom_about(Ax,About) :-
-        axiom_directly_about(Ax,X),
-        axiom_about(X,About).
-
-axiom_references(Ax,Ref) :-
-        axiom_directly_references(Ax,Ref).
-axiom_references(Ax,Ref) :-
-        axiom_directly_references(Ax,X),
-        axiom_or_expression_references(X,Ref).
-
-axiom_contains_expression(Ax,Ex) :-
-        axiom_contains_expression(Ax,Ex,_).
-axiom_contains_expression(Ax,Ex,D) :-
-        axiom(Ax),
-        expression_has_subexpression(Ax,Ex,[],Chain),
-        length(Chain,D).
-
-expression_has_subexpression(Ex,Ex,Accum,Accum).
-expression_has_subexpression(Ex,SubEx,Accum,Results) :-
-        Ex =.. [F|Args],
-        member(A,Args),
-        expression_has_subexpression(A,SubEx,[F|Accum],Results).
-
-
-
-%% referenced_description(?Desc) is nondet
-% true if Desc is either a class or a class expression using the set of ontologies loaded.
-% Example: if the ontology contains
-% ==
-% subClassOf(a,intersectionOf([b,someValuesFrom(p,c)]))
-% ==
-% then Desc will be a member of [a, b, c, b and p some c, p some c]
-referenced_description(C) :-
-        setof(C,referenced_description_1(C),Cs),
-        member(C,Cs).
-
-referenced_description_1(C) :- class(C).
-referenced_description_1(C) :-
-        subClassOf(A,B),
-        (   referenced_description(A,C)
-        ;   referenced_description(B,C)).
-referenced_description_1(C) :-
-        equivalentClasses(L),
-        member(A,L),
-        referenced_description(A,C).
-referenced_description_1(C) :-
-        classAssertion(A,_),
-        referenced_description(A,C).
-
-% TODO - this is incomplete
-referenced_description(X,X) :- ground(X).
-referenced_description(someValuesFrom(_,X),Y) :- referenced_description(X,Y).
-referenced_description(allValuesFrom(_,X),Y) :- referenced_description(X,Y).
-referenced_description(intersectionOf(L),Y) :- member(X,L),referenced_description(X,Y).
-referenced_description(unionOf(L),Y) :- member(X,L),referenced_description(X,Y).
-
-
-/****************************************
-  UTILITY
-  ****************************************/
-
-
-:- thread_local assert_axiom_hook/1.
-
-%% assert_axiom(+Axiom:axiom)
-%
-% writes an axiom to the prolog database.
-% typically this will just be a matter of calling assert/1. However, in future we
-% will have different backing stores (rdf_db, sql), and in these cases calls to
-% this predicate will perform the appropriate actions.
-%
-% this also asserts ontologyAxiom/2, using nb_getval with current_ontology
-assert_axiom(Axiom) :-
-        assert_axiom_hook(Axiom),
-        !.
-assert_axiom(Axiom) :-
-        assert(Axiom),
-	(   nb_current(current_ontology,O)
-        ->  assert(ontologyAxiom(O,Axiom))
-        ;   true),
-        !.
-  
-%% assert_axiom(+Axiom:axiom,+Ontology:ontology) is det
-%
-% as assert_axiom/1, but also asserts to ontologyAxiom/2
-assert_axiom(Axiom,O) :-
-        assert(Axiom),
-	assert(ontologyAxiom(O,Axiom)),
-        !.
-
-
-:- thread_local retract_axiom_hook/1.
-
-%% retract_axiom(+Axiom:axiom)
-%
-% removes an axiom from the prolog database.
-% typically this will just be a matter of calling retract/1. However, in future we
-% will have different backing stores (rdf_db, sql), and in these cases calls to
-% this predicate will perform the appropriate actions.
-%
-% also removes ontologyAxiom/2 from ALL ontologies
-retract_axiom(Axiom) :-
-        retract_axiom_hook(Axiom),
-        !.
-retract_axiom(Axiom) :-
-        retractall(Axiom),
-	retractall(ontologyAxiom(_,Axiom)),
-        !.
-
-%% retract_axiom(+Axiom:axiom,+Ontology)
-% retracts axioms from a specified ontology
-retract_axiom(Axiom,Ontology) :-
-        \+ var(Ontology),
-	retractall(ontologyAxiom(Ontology,Axiom)),
-        (   \+ ontologyAxiom(_,Axiom)
-        ->  retractall(Axiom)
-        ;   true),              % still exists in other ontology..
-        !.
-
-
-retract_all_axioms :-
-        findall(A,axiom(A),Axioms),
-        maplist(retract,Axioms),
-        findall(ontologyAxiom(O,A),ontologyAxiom(O,A),OAxioms),
-        maplist(retract,OAxioms),
-	!.
-
-
-owl2_model_init :-
-	assert(annotationProperty('http://www.w3.org/2000/01/rdf-schema#label')),
-	assert(annotationProperty('http://www.w3.org/2000/01/rdf-schema#comment')).
-
-consult_axioms(File) :-
-        consult(File).
-
-axiom_type(A,T) :- functor(A,T,_).
-
-/** <module> Ontology language axioms and expressions
-
----+ Synopsis
-
-    Example OWL2 ontology as a prolog database:
-==
-class(organism).
-class(animal).
-class(carnivore).
-class(herbivore).
-objectProperty(eats).
-subClassOf(animal,organism).
-equivalentClasses([carnivore,intersectionOf([animal,someValuesFrom(eats,animal)])]).
-disjointClasses([herbivore,carnivore]).
-==
-
-Example of use:
-
-==
-:- use_module(library(thea2/owl2_io)).
-:- use_module(library(thea2/owl2_model)).
-
-show_superclasses(OntFile,Class) :-
-        load_axioms(OntFile),
-        forall(subClassOf(Class,Super),
-               writeln(Super)).
-==
-
----+ Details
-
-This module is a prolog model of the OWL2 language. It consists of predicates for both OWL2 axioms and expressions.
-
-This model is intended to closely parallel Structural Specification and Functional-Style Syntax for OWL2 (http://www.w3.org/TR/owl2-syntax).
-
-* Axioms and Declarations are modeled as prolog predicates (e.g. SubClassOf --> subClassOf/2)
-* Class and Property Expressions are modeled as prolog terms. These can be checked via semi-deterministic predicates (e.g. objectIntersectionOf/1)
-* Axiom Annotations are modeled as prolog predicates taking a reified axiom clause head as an argument (axiomAnnotation/3)
-* The names should correspond exactly, with the leading uppercase character substituted for a lowercase (to avoid quoting in prolog) - the one exception is Import, which maps to the prolog predicate ontologyImport/2 (to avoid confusion with prolog import/1)
-* Axioms with variable arguments are modeled as prolog predicates that take prolog lists as arguments (e.g. equivalentClasses/1)
-* For programmatic convenience we provide additional abstract predicates that do not necessarily correspond to the OWL syntax (e.g. property/1,fact/1)
-
-
----++ Axioms
-
-Extensional predicates are declared for all terminal axiom symbols in the functional syntax;  i.e. subPropertyOf/2, subClassOf/2.
-These can be directly asserted, or compiled from a prolog file.
-
-The terms from the OWL2 structural syntax are taken as primitive,
-i.e. they are extensional / unit-clauses, and designed to be asserted
-or compiled.
-
-Some predicates such as property/1 are intensional - these generalize
-over the OWL2 axioms are defined by prolog rules, and should not be
-asserted.  In this case property/1 is defined as annotationProperty/1
-or dataProperty/1 or objectProperty/1.
-
-For the strong typed model, we also provide intensional predicates
-such as subObjectPropertyOf/2 - satisfaction of this predicate is
-determined at runtime based on type-checking, if subPropertyOf/2 holds.
-
-
----++ Expressions and Type checking
-
-OWL Axioms can take either entities or expressions as arguments.
- Entities are simply prolog atoms corresponding to the IRI.
- Expressions are prolog terms;
- e.g. =|intersectionOf(a,someValuesFrom(inverseOf(p),b))|=
-
- (Class expressions are also known as Descriptions)
-
- Optional run-time checking of predicates using valid_axiom/1.
-
- For example =|subClassOf(intersectionOf(c1,c2),unionOf(c3,c4))|= is
- valid if c1,c2,c3,c4 are all class expressions, but
- =|subClassOf(p1,c1)|= is not valid if p1 is a property
-
- We can also make checks for specific types: e.g objectIntersectionOf/1
-
----++ Annotations
-
-  In OWL Syntax, axiom annotations are written using an optional annotation list argument.
-  We opt not to do this here; instead we use axiomAnnotation/3 where the first argument is the reified predicate head.
-  E.g.
-
-==
-subClassOf(cat,mammal).
-axiomAnnotation(SubClassOf(cat,mammal),author,linnaeus).
-==
-
-
-  ---++ Ontologies
-
-  We use a similar scheme for annotations:
-
-==
-subClassOf(cat,mammal).
-ontologyAxiom(linnaenTaxonomy,SubClassOf(cat,mammal)).
-ontology(linnaenTaxonomy).
-==
-
-TODO: check edge cases, eg two ontologies have the same axioms but different annotations
-
----++ IRIs
-
-By default there is no type checking of IRIs, so =|class(polarBear)|=
-is allowed, even though polarBear is not an IRI - this makes for
-convenience in working with example ontologies.
-
-See prefix_IRIs/1 in owl2_util.pl for converting between short names
-and valid IRIs.
-
----+ Open Issues
-
----++ Enumeration of expressions
-
-We provide semi-deterministic predicates of the form
-  ?type(+Expression).  Should the mode be extended to allow
-  enumeration of all descriptions/expressions? This would probably
-  require forcing all expressions to be bnodes OR possibly recursively
-  analyzing the term Axiom in a call axiom(Axiom)
-
----++ Type checking
-
-  Is Tom Schrijvers type checking system going to be integrated into SWI and Yap? Should we use that?
-
-  I am attempting to put as much typing info in the pldoc comments,
-  but unsure of the conventions for complex terms.
-
-  LATEST: see owl2_metamodel.pl
-
----++ Ontologies
-
-  continue using ontologyAxiom/2? Alternatively use builtin prolog module mechanism..?
-
----+ See Also
-
-* owl2_from_rdf.pl
-* swrl.pl
-
----+ Additional Information
-
-@see     README
-@license License
-
-*/
-
-:- use_module(library(debug)).
-:- use_module(library('semweb/rdf_db')).
-:- use_module(library('semweb/rdf_edit')).
-:- use_module(library('semweb/rdfs')).
-:- use_module(library('url')).
-:- use_module(library('http/http_open')).
-:- use_module(library(charsio)).
-
-:- thread_local(owl/4).
-%% blanknode(Node,Description,Used)
-% see owl_get_bnode/2
-% Node - bNodeId
-% Description - prolog term corresponding to owl Description
-% Used - used | shared
-:- thread_local(blanknode/3).
-:- thread_local(outstream/1).
-
-:- thread_local(aNN/3). % implements the ANN(X) function.
-:- thread_local(annotation_r_node/4).  % annotation_r_node(S,P,O,Node)
-:- thread_local(axiom_r_node/4).       % axiom_r_node(S,P,O,Node)
-:- thread_local(owl_repository/2). % implements a simple OWL repository: if URL not found, Ontology is read from a repository (local) RURL
-
-
-% we make this discontiguous so that the code can follow the structure of the document as much as possible
-
-:- discontiguous owl_parse_axiom/3.
-:- discontiguous dothislater/1.
-
-% hookable
-
-
-% -----------------------------------------------------------------------
-%                                UTILITY Predicates
-% -----------------------------------------------------------------------
-
-
-%%       owl_clear_as
-%
-%       Clears the prolog terms that store the Abstract Syntax
-%       implementation of the OWL ontology.
-
-owl_clear_as :-
-        debug(owl_parser,'Clearing abstract syntax',[]),
-        forall((axiompred(PredSpec),predspec_head(PredSpec,Head)),
-               retractall(Head)).
-
-predspec_head(Pred/A,Head) :- functor(Head,Pred,A).
-
-u_assert(Term) :-
-	call(Term), !; assert(Term).
-
-
-convert(T,V,typed_value(T,V)).
-
-
-%%	rdf_2_owl(+Base, +Ont) is det
-%
-%       Converts RDF triples to OWL/4 triples so that
-%	their use can tracked by the OWL parser.
-
-
-rdf_2_owl(_Base,Ont) :-
-%	debug(owl_parser, 'Removing existing owl triples',[]),
-%	retractall(owl(_,_,_,Ont)),
-%  pengine_self(Self),
-%  pengine_property(Self,module(M)),
-	debug(owl_parser,'Copying RDF triples to OWL triples for Ontology ~w',[Ont]),
-	pengine_self(Self),
-        pengine_property(Self,module(M)),
-	M:myrdf(X,Y,Z),
-%	owl_fix_no(X,X1), owl_fix_no(Y,Y1), owl_fix_no(Z,Z1),
-	assert(owl(X,Y,Z,Ont)), fail.
-
-rdf_2_owl(_,Ont) :-
-	owl_count(Ont,Z),
-	debug(owl_parser,'Number of owl triples copied: ~w',[Z]).
-
-
-%%	owl_count(?U).
-%       Returns/Checks the number of unused OWL triples.
-
-owl_count(O,U) :-
-	findall(1,owl(_,_,_,O),X), length(X,U).
-
-%% expand_and_assert(S,P,O) is det
-%
-% adds a owl(S,P,O,not_used) after expanding namespaces.
-% this is required for the triple replacement rules,
-% which use shortened rdfs/owl namespaces.
-% (or we could just use the expanded forms here which
-%  may be faster..)
-expand_and_assert(X1,Y1,Z1) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),!,
-	retractall(owl(X,Y,Z, used1)),
-	assert(owl(X,Y,Z, not_used)).
-
-
-%%       test_use_owl(+Triples:list) is nondet
-%
-%       As use_owl/1, but does not consume the triple.  If owl(S,P,O)
-%       in Triples has a non-ground variable then this will succeed
-%       non-deterministically.  If all variables are ground, then this
-%       will succeed semi-deterministically.
-test_use_owl([]).
-test_use_owl([owl(S,P,O)|Rest]) :-
-	test_use_owl(S,P,O),
-	test_use_owl(Rest).
-
-
-%%       test_use_owl(?S,?P,?O)
-%	As use_owl/3, but does not consume the triple. Expands the S,P,O.
-%
-%       If any of S, P or O is non-ground then this will succeed
-%       non-deterministically.  If all variables are ground, then this
-%       will succeed semi-deterministically.
-test_use_owl(X1,Y1,Z1) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),!,
-	owl(X,Y,Z, not_used).
-
-test_use_owl(X1,Y1,Z1,named) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),
-	owl(X,Y,Z, not_used),
-	\+ sub_string(X,0,1,_,'_').
-
-
-%%       use_owl(+Triples:list)
-%	Marks a list of OWL triples as used, but only if all match. Expands the S,P,O.
-
-use_owl(Triples) :-
-        test_use_owl(Triples),
-        use_owl_2(Triples).
-
-% consume all triples; we have already tested the list and know that all match
-use_owl_2([]).
-use_owl_2([owl(S,P,O)|Triples]) :-
-        use_owl(S,P,O),
-        use_owl_2(Triples).
-
-
-use_owl(X1,Y1,Z1) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),
-	owl(X,Y,Z, not_used),
-	debug(owl_parser_detail,'using ~w ~w ~w',[X,Y,Z]),
-	retract(owl(X,Y,Z, not_used)),
-	assert(owl(X,Y,Z,used1)).
-
-use_owl(X1,Y1,Z1,named) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),
-	owl(X,Y,Z, not_used),
-	\+ sub_string(X,0,1,_,'_'),
-	retract(owl(X,Y,Z, not_used)),
-	assert(owl(X,Y,Z,used2)).
-
-use_owl(X1,Y1,Z1,Term) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),
-	owl(X,Y,Z, not_used),
-	debug(owl_parser_detail,'using ~w ~w ~w',[X,Y,Z]),
-	retract(owl(X,Y,Z, not_used)),
-	assert(owl(X,Y,Z,used(Term))).
-
-
-%%	use_owl(?S,?P,?O,+Named,Term)
-%
-%       Named = named: Same as use_owl/3, but marks only if S 	is Named URI (i.e. non blank node).
-
-use_owl(X1,Y1,Z1,named,Term) :-
-	expand_ns(X1,X),
-	expand_ns(Y1,Y),
-	expand_ns(Z1,Z),
-	owl(X,Y,Z, not_used),
-	\+ sub_string(X,0,1,_,'_'),
-	retract(owl(X,Y,Z, not_used)),
-	assert(owl(X,Y,Z,used(Term))).
-
-
-%%       expand_ns(+NS_URL, ?Full_URL)
-%
-%       Expands a 'namespaced' URI of the form ns:fragment to a full URI
-%       substituting the full expansion for ns from the ns/2 facts
-expand_ns(NS_URL, Full_URL) :-
-	nonvar(NS_URL),
-	NS_URL \= literal(_),
-	uri_split(NS_URL,Short_NS,Term, ':'),
-	rdf_db:ns(Short_NS,Long_NS),!,
-	concat_atom([Long_NS,Term],Full_URL).
-
-expand_ns(URL, URL).
-
-
-%%       collapse_ns(+FullURL, ?NSURL, +Char, +Options)
-%
-%	Collapses a full URI of the form Path#fragment to a Namespaced
-%	URI NS:fragment substituting the full expansion for ns from
-%	the ns/2 facts
-%	Char is either ':' for normal ns notation or '_' for builing
-%	prolog terms.
-%	Options supported: no_base(ShortNs): Use only term!
-
-
-collapse_ns(FullURL, NSURL,Char,Options) :-
-	nonvar(FullURL),
-	FullURL \= literal(_),
-	uri_split(FullURL,LongNS, Term, '#'),
-	concat(LongNS,'#',LongNS1),
-	rdf_db:ns(ShortNS,LongNS1),
-	(   member(no_base(ShortNS),Options), ! , NSURL = Term
-	;
-	concat_atom([ShortNS,Char,Term],NSURL)
-	),!.
-% CJM
-collapse_ns(FullURL, NSURL,_Char,Options) :-
-	nonvar(FullURL),
-	\+ FullURL = literal(_),
-	uri_split(FullURL,LongNS, Term, '#'),
-	member(no_base(LongNS),Options),
-        !,
-        NSURL = Term.
-
-
-collapse_ns(URL, URL,_,_).
-
-
-
-%%       uri_split(+URI,-Namespace,-Term,+Split_Char) is det
-%
-%       Splits a URI into the Namespace and the Term parts
-%       separated by the Split_Char character.
-%       It supposes URI = concat(Namespace,Split_Char,Term)
-
-uri_split(URI,Namespace,Term,Split_Char) :-
-	sub_atom(URI,Start,_,After,Split_Char),
-	sub_atom(URI,0,Start,_,Namespace),
-	Start1 is Start + 1,
-	sub_atom(URI,Start1,After,_,Term).
-
-
-%%       owl_collect_linked_nodes(+Node,+Predicate, +InList,-OutList)
-
-%	Appends Node to the InList, and recursively, all other
-%	Nodes that are linked with the Predicate to the Node. The
-%	result is returned to OutList.
-
-owl_collect_linked_nodes(Node,Predicate,InList,OutList) :-
-	use_owl(Node,Predicate,A),!,
-	owl_collect_linked_nodes(Node,Predicate,InList,List1),
-	owl_collect_linked_nodes(A,Predicate,List1,OutList).
-
-owl_collect_linked_nodes(Node,Predicate,InList,OutList) :-
-	use_owl(A,Predicate,Node),!,
-	owl_collect_linked_nodes(Node,Predicate,InList,List1),
-	owl_collect_linked_nodes(A,Predicate,List1,OutList).
-
-owl_collect_linked_nodes(Node,_,List, [Node|List]) :-
-	\+ memberchk(Node, List),!.
-
-owl_collect_linked_nodes(_,_,List, List) :- !.
-
-
-% ----------------------------------------------------------------
-%                OWL Parser implementation predicates
-% ----------------------------------------------------------------
-
-
-%%       owl_get_bnode(+Node,+Description)
-%
-%	if Node is a blank (not named) node, then it is asserted in
-%	the database as a blanknode(Node,Description,used) term.
-%	The purpose is to record when a blank node has been used, so
-%	subsequent uses of it will result in structure sharing.
-
-owl_get_bnode(Node,Description) :-
-	sub_string(Node,0,1,_,'_'),!,
-	\+ blanknode(Node,_,_),
-	assert(blanknode(Node,Description, used)).
-
-owl_get_bnode(_,_).
-
-
-
-% -----------------------------------------------------------------------
-%                                Top Level  Predicates
-% -----------------------------------------------------------------------
-
-/*:- multifile owl2_io:load_axioms_hook/3.
-
-owl2_io:load_axioms_hook(File,owl,Opts) :-
-        owl_parse_rdf(File,Opts).
-
-owl2_io:load_axioms_hook(File,ttl,Opts) :-
-        ensure_loaded(library('semweb/rdf_turtle')),
-        owl_parse_rdf(File,Opts).
-*/
-%% owl_parse_rdf(+File)
-% as owl_parse_rdf/1 with empty Opts
-owl_parse_rdf(F):-
-	owl_parse_rdf(F,[]).
-
-%% owl_parse_rdf(+File,+Opts:list)
-% @param Opts
-%  * imports(ImportFlag:Boolean) if true, follow imports
-%  * clear(Clear) if Clear=complete, clears all axioms in owl2_model
-owl_parse_rdf(F,Opts):-
-	(   member(imports(Imports),Opts)
-	->  true
-	;   Imports=false),
-	(   member(clear(Clear),Opts)
-	->  true
-	;   Clear=false),
-	owl_parse(F,Clear,Clear,Imports),
-	debug(owl_parser,'parsed ~w',[F]).
-
-
-
-
-%% owl_parse(+URL, +RDF_Load_Mode, +OWL_Parse_Mode, +ImportFlag:boolean)
-%
-%  Top level: parse a set of RDF triples and produce an
-%  AS representation of an OWL ontology.
-%
-%	Calls the rdf_load_stream predicate to parse RDF stream in URL.
-%       If RDF_Load_Mode = complete it first retacts all rdf triples.
-%       If ImportFlag = true it handles owl:import clause at RDF level.
-%
-% This implements the mapping defined here:
-% http://www.w3.org/TR/2008/WD-owl2-mapping-to-rdf-20081202/
-owl_parse(URL, RDF_Load_Mode, OWL_Parse_Mode,ImportFlag) :-
-	(   RDF_Load_Mode=complete
-	->  rdf_retractall(_,_,_), retractall(rdf_db:rdf_source(_,_,_,_))
-        ;   true),
-	(   OWL_Parse_Mode=complete
-        ->  owl_clear_as,retractall(blanknode(_,_,_)), retractall(owl(_,_,_,_))
-        ;   true),
-        !,
-        debug(owl_parser,'Loading stream ~w',[URL]),
-	owl_canonical_parse_2([URL],URL,ImportFlag,[],ProcessedIRIs),
-        debug(owl_parser,'rdf_db populated, the following IRIs were processed: ~w',[ProcessedIRIs]),
-	owl2_model_init,
-	owl_canonical_parse_3(ProcessedIRIs).
-
-%% owl_canonical_parse_2(+IRIs:list,+ParentIRI,+ImportFlag:boolean,+ProcessedURIsIn:list,?ProcessedURIsOut:list) is det
-% recursively parses all ontologies in IRIs into rdf_db, ensuring none are processed twice.
-owl_canonical_parse_2([],_,_,Processed,Processed) :- !.
-
-owl_canonical_parse_2([IRI|ToProcessRest],Parent,ImportFlag,ProcessedIn,ProcessedOut) :-
-	member(IRI,ProcessedIn),
-        !,
-	owl_canonical_parse_2(ToProcessRest,Parent,ImportFlag,ProcessedIn,ProcessedOut).
-
-owl_canonical_parse_2([IRI|ToProcessRest],Parent,ImportFlag,ProcessedIn,ProcessedOut) :-
-	% Get rdf triples, *Ontology* and Imports
-	rdf_load_stream(IRI,O,BaseURI,Imports),
-	(   nonvar(O)
-        ->  Ont = O
-        ;   Ont = Parent), % in the include case we may need to remove the import...
-        debug(owl_parser,'Commencing rdf_2_owl. Generating owl/4',[]),
-	rdf_2_owl(BaseURI,Ont),  	% move the RDF triples into the owl-Ont/4 facts
-	(   ImportFlag = true
-        ->  owl_canonical_parse_2(Imports,Ont,ImportFlag,[Ont|ProcessedIn],ProcessedIn1)
-        ;   ProcessedIn1=[Ont|ProcessedIn]),
-	owl_canonical_parse_2(ToProcessRest,Parent,ImportFlag,ProcessedIn1,ProcessedOut).
-
-
-%% owl_canonical_parse_3(+IRIs:list) is det
-% translate the current rdf_db into owl2_model axioms.
-% First owl/4 facts are populated, and then these are translated
-% according to:
-% http://www.w3.org/TR/2008/WD-owl2-mapping-to-rdf-20081202/
-% (table references refer to this document).
-% we use an intermediate owl/4 database because the mapping
-% is non-monotonic, and triples are 'consumed'
-owl_canonical_parse_3([]).
-
-owl_canonical_parse_3([IRI|Rest]) :-
-	% Remove any existing not used owl fact
-	retractall(owl(_,_,_,not_used)),
-	% Copy the owl facts of the IRI document to the 'not_used'
-	forall(owl(S,P,O,IRI),assert(owl(S,P,O,not_used))),
-
-        debug(owl_parser,'Anon individuals in reification [see table 8]',[]),
-
-
-	collect_r_nodes,
-
-	% First parse the Ontology axiom
-        owl_parse_annotated_axioms(ontology/1),
-
-        debug(owl_parser,'Replacing patterns [see table 5]',[]),
-	% remove triples based on pattern match (Table 5)
-	(   forall((triple_remove(Pattern,Remove), test_use_owl(Pattern)),
-	        forall(member(owl(S,P,O),Remove),use_owl(S,P,O,removed))) -> true ; true),
-
-
-        % temporary fix to make up for bug in rdf parsing
-        % see email to JanW July-1-2009
-        forall((test_use_owl(S,P,BNode),
-                atom(BNode),
-                sub_atom(BNode,0,1,_,'_'),
-                test_use_owl(BNode,'http://www.w3.org/1999/02/22-rdf-syntax-ns#datatype',literal(_))),
-               (   use_owl(S,P,BNode,datatype_fix),
-                   use_owl(BNode,'http://www.w3.org/1999/02/22-rdf-syntax-ns#datatype',literal(_)),
-                   expand_and_assert(S,P,literal('')))),
-
-	% replace matched patterns (Table 6)
-        debug(owl_parser,'Replacing patterns [see table 6]',[]),
-	(   setof(ReplaceWith,
-                  Pattern^(   triple_replace(Pattern,ReplaceWith), % +Triples:list, ?Triples:list
-                              use_owl(Pattern),
-                              debug(owl_parser,'Replacing ~w ==> ~w [see table 6]',[Pattern,ReplaceWith])),
-                  ReplacementSetList)
-        ->  forall((member(ReplacementSet,ReplacementSetList),member(owl(S,P,O),ReplacementSet)),
-                   expand_and_assert(S,P,O))
-        ;   debug(owl_parser,'No replacements required',[])),
-
-        /*
-	forall(triple_replace(Pattern,ReplaceWith),
-               forall(use_owl(Pattern),
-                      forall(member(owl(S,P,O),ReplaceWith),
-                             (   expand_and_assert(S,P,O),
-                                 debug(owl_parser,'Replacing ~w ==> ~w [see table 6]',[Pattern,owl(S,P,O)]))))),
-        */
-
-	% continue with parsing using the rules...
-	% Table 8, get the set of RIND - anonymous individuals in reification
-	findall(X, (member(Y,['owl:Axiom','owl:Annotation',
-			      'owl:AllDisjointClasses','owl:AllDisljointProperties',
-			      'owl:AllDifferent','owl:NegativePropertyAssertion']),
-                    test_use_owl(X,'rdf:type',Y)
-                   ),
-                RIND),
-	nb_setval(rind,RIND),
-
-        % Table 9, row 5
-	% VV 10/3/2010 get the annotation properties before collecting the annotations.
-        debug(owl_parser,'asserting annotationProperty/1 for all APs',[]),
-	forall( test_use_owl(D,'rdf:type','owl:AnnotationProperty'),
-		assert_axiom(annotationProperty(D))),
-
-        % TODO - make this faster
-        debug(owl_parser,'Implements function ANN(x) 3.2.2 Table 10.',[]),
-	findall(_,ann(_,_),_), % find all annotations, assert annotation(X,AP,AV) axioms.
-
-        debug(owl_parser,'Commencing parse of annotated axioms',[]),
-        forall((axiompred(PredSpec),\+dothislater(PredSpec),\+omitthis(PredSpec)),
-               owl_parse_annotated_axioms(PredSpec)),
-        forall((axiompred(PredSpec),dothislater(PredSpec),\+omitthis(PredSpec)),
-               owl_parse_annotated_axioms(PredSpec)),
-
-        debug(owl_parser_detail,'Commencing parse of unannotated axioms',[]),
-        forall((axiompred(PredSpec),\+dothislater(PredSpec),\+omitthis(PredSpec)),
-               owl_parse_nonannotated_axioms(PredSpec)),
-        forall((axiompred(PredSpec),dothislater(PredSpec),\+omitthis(PredSpec)),
-               owl_parse_nonannotated_axioms(PredSpec)),!,
-	% annotation Assertion
-	parse_annotation_assertions,
-	forall(owl_parse_compatibility_DL(Axiom),assert_axiom(Axiom)),
-	owl_canonical_parse_3(Rest).
-
-rdf_db_to_owl :-
-	owl2_model_init,
-        findall(BaseURI,
-                (   rdf(Ont,'http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://www.w3.org/2002/07/owl#Ontology',BaseURI:_),
-                    rdf_2_owl(BaseURI,Ont),
-                    owl_canonical_parse_3(IRIs)),
-                IRIs).
-
-%% translate_rdf_db(+IRI)
-% translates a graph in current rdf_db instance into an owl2_model.pl set of facts.
-% assumes that IRI has already been loaded using the semweb package
-translate_rdf_db(BaseURI) :-
-        rdf(Ont,'http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://www.w3.org/2002/07/owl#Ontology',BaseURI:_),
-        !,
-        rdf_2_owl(BaseURI,Ont),
-        owl2_model_init,
-        owl_canonical_parse_3(BaseURI).
-
-
-omitthis(ontology/1).
-
-
-owl_parse_annotated_axioms(Pred/Arity) :-
-        debug(owl_parser_detail,'[ann] Parsing all of type: ~w',[Pred]),
-        functor(Head,Pred,Arity),
-%        forall(owl_parse_axiom(Mod:Head),
-%               (   debug(owl_parser_detail,' parsed: [~w] ~w',[Mod,Head]),
-%                   assert(Mod:Head))).
-	forall(owl_parse_axiom(Head,true,Annotations),
-	       (   assert_axiom(Head),
-	           debug(owl_parser_detail_anns,' parsed: ~w : anns: ~w',[Head,Annotations]),
-		   forall(member(X,Annotations),
-			  forall(aNN(X,AP,AV),
-				 assert_axiom(annotation(Head,AP,AV))
-		          )
-			 )
-	       )
-	      ),
-        debug(owl_parser_detail,'[ann] Done parsing all of type: ~w',[Pred]).
-
-owl_parse_nonannotated_axioms(Pred/Arity) :-
-        debug(owl_parser_detail,'[unann] Parsing all of type: ~w',[Pred]),
-        functor(Head,Pred,Arity),
-	forall(owl_parse_axiom(Head,false,_),
-	       assert_axiom(Head)
-	      ).
-
-
-
-%%       rdf_load_stream(+URL, -Ontology, -BaseURI, -Imports:list) is det
-%
-%	This predicate calls the rdf parser to parse the RDF/XML URL
-%	into RDF triples. URL can be a local file or a URL.
-%	The predicate returns all Imports based on the 	owl:imports predicate.
-%	Also the Ontology of the URL if an owl:Ontology exists, var
-%	otherise.
-%
-%       If owl_repository/2 is defined, then this is used to map URLs
-%       prior to loading.
-
-
-rdf_load_stream(URL,Ontology,BaseURI,Imports) :-
-        owl_repository(URL,RURL),
-        !,
-        % note: users responsibility to avoid infinite loops by avoid cycles in repository mappings!
-        rdf_load_stream(RURL,Ontology,BaseURI,Imports).
-
-rdf_load_stream(URL,Ontology,BaseURI,Imports) :-
-	BaseURI = URL,
-  	(   sub_atom(URL,0,4,_,'http')
-        ->  catch((http_open(URL,RDF_Stream,[]),
-	      rdf_load(RDF_Stream,[if(true),base_uri(BaseURI),blank_nodes(noshare),
-				   result(Action, Triples, MD5),register_namespaces(true)]),
-		   debug(owl_parser,' Loaded ~w stream: ~w Action: ~w Triples:~w MD5: ~w',[URL,RDF_Stream,Action,Triples,MD5]),
-                   close(RDF_Stream)),
-                  Message,
-                  throw(io_error(URL,'rdf_load/2 failed',Message))) % re-throw with more information
-        ;  RDF_Stream = URL, rdf_load(RDF_Stream,[blank_nodes(noshare),if(true),base_uri(BaseURI),register_namespaces(true)])
-	),
-        % collect all imports directives
-	(   rdf(Ontology,'http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://www.w3.org/2002/07/owl#Ontology',BaseURI:_)
-        ->  findall(I,rdf(Ontology,'http://www.w3.org/2002/07/owl#imports',I,BaseURI:_),Imports)
-	;   Imports = []
-	).
-
-
-
-% ----------------------------------------------------------------
-% 3 Mapping from RDF Graphs to the Structural Specification
-% ----------------------------------------------------------------
-
-/*
-
-  This section specifies the results of steps CP-2.2 and CP-3.3 of the
-  canonical parsing process from Section 3.6 of the OWL 2
-  Specification [OWL 2 Specification] on an ontology document D that
-  can be parsed into an RDF graph G. ...
-
-  */
-
-%       owl_description_list(+Node, -List)
-%
-%       If +Node is defined as rdf:type rdf:List, then List returns
-%       a prolog list of descriptions for this Node.
-
-owl_description_list('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',[]) :- !.
-
-owl_description_list(X,[F|R]) :-
-	% use_owl(X,'rdf:type','rdf:List',list), % this is now removed from graph
-	use_owl(X,'rdf:first',Element,first),
-	owl_description(Element,F),
-	use_owl(X,'rdf:rest',Y,rest),
-	!,owl_description_list(Y,R).
-
-
-%       owl_individual_list(+Node, -List)
-%
-%       If +Node is defined as rdf:type rdf:List, then List returns
-%       a prolog list of individuals for this Node.
-
-owl_individual_list('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',[]) :- !.
-
-owl_individual_list(X,[F|R]) :-
-	% use_owl(X,'rdf:type','rdf:List',list), % this is now removed from graph
-	use_owl(X,'rdf:first',F,first),
-	use_owl(X,'rdf:rest',Y,rest),
-	!,owl_individual_list(Y,R).
-
-%       owl_property_list(+Node, -List)
-%
-%       If +Node is defined as rdf:type rdf:List, then List returns
-%       a prolog list of properties for this Node.
-
-owl_property_list('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',[]) :- !.
-
-owl_property_list(X,[F|R]) :-
-	% use_owl(X,'rdf:type','rdf:List',list), % this is now removed from graph
-	use_owl(X,'rdf:first',Element,first),
-	owl_property_expression(Element,F),
-	use_owl(X,'rdf:rest',Y,rest),
-	!,owl_property_list(Y,R).
-
-%       owl_datarange_list(+Node, -List)
-%
-%       If +Node is defined as rdf:type rdf:List, then List returns
-%       a prolog list of dataranges for this Node.
-
-owl_datarange_list('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',[]) :- !.
-
-owl_datarange_list(X,[F|R]) :-
-	% use_owl(X,'rdf:type','rdf:List',list), % this is now removed from graph
-	use_owl(X,'rdf:first',Element,first),
-	owl_datarange(Element,F),
-	use_owl(X,'rdf:rest',Y,rest),
-	!,owl_datarange_list(Y,R).
-
-%       owl_datatype_restriction_list(+Node, -List)
-%
-%       If +Node is defined as rdf:type rdf:List, then List returns
-%       a prolog list of datatype restrictions for this Node.
-
-owl_datatype_restriction_list('http://www.w3.org/1999/02/22-rdf-syntax-ns#nil',[]) :- !.
-
-owl_datatype_restriction_list(X,[facetRestriction(W2,L)|R]) :-
-	% use_owl(X,'rdf:type','rdf:List'), % this is now removed from graph
-	use_owl(X,'rdf:first',Element,first_datatype_restr),
-	use_owl(Element,W,L,datatype_restr),
-	(   concat_atom([_,W2],'#',W)
-	->  true
-	;   W2=W),
-	use_owl(X,'rdf:rest',Y,rest_datatype_restr),
-	!,owl_datatype_restriction_list(Y,R).
-
-
-% 3.1 Extracting Declarations and the IRIs of the Directly Imported Ontology Documents
-% This section specifies the result of step CP-2.2 of the canonical parsing process on an RDF graph G
-
-
-% 3.1.2 Parsing of the Ontology Header and Declarations
-
-%  Table 4.
-owl_parse_axiom(ontology(O),AnnMode,List) :-
-        test_use_owl(O,'rdf:type','owl:Ontology'),
-	\+ test_use_owl([owl(U,_W,O),owl(U,'rdf:type','owl:Ontology')]),
-	valid_axiom_annotation_mode(AnnMode,O,'rdf:type','owl:Ontology',List),
-        use_owl(O,'rdf:type','owl:Ontology',ontology),
-        nb_setval(current_ontology,O),
-	forall(use_owl(O,'owl:imports',IRI,ontology_import), assert_axiom(ontologyImport(O,IRI))),
-	forall(use_owl(O,'owl:versionInfo',IRI2,ontology_version_info), assert_axiom(ontologyVersionInfo(O,IRI2))),!. % Do Once
-
-
-% See table 5.
-% triple_remove(Pattern:list,Remove:list)
-% if Pattern is present, remove triples in Remove
-triple_remove([owl(X,'rdf:type','owl:Ontology')],[owl(X,'rdf:type','owl:Ontology')]).
-triple_remove([owl(X,'rdf:type','owl:Class'),owl(X,'rdf:type','rdfs:Class')],[owl(X,'rdf:type','rdfs:Class')]).
-triple_remove([owl(X,'rdf:type','rdfs:Datatype'),owl(X,'rdf:type','rdfs:Class')],[owl(X,'rdf:type','rdfs:Class')]).
-triple_remove([owl(X,'rdf:type','owl:DataRange'),owl(X,'rdf:type','rdfs:Class')],[owl(X,'rdf:type','rdfs:Class')]).
-triple_remove([owl(X,'rdf:type','owl:Restriction'),owl(X,'rdf:type','rdfs:Class')],[owl(X,'rdf:type','rdfs:Class')]).
-triple_remove([owl(X,'rdf:type','owl:Restriction'),owl(X,'rdf:type','owl:Class')],[owl(X,'rdf:type','owl:Class')]).
-triple_remove([owl(X,'rdf:type','owl:ObjectProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:FunctionalProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:InverseFunctionalProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:TransitiveProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:DatatypeProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:AnnotationProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','owl:OntologyProperty'),owl(X,'rdf:type','rdf:Property')],[owl(X,'rdf:type','rdf:Property')]).
-triple_remove([owl(X,'rdf:type','rdf:List'),owl(X,'rdf:first',_Y),owl(X,'rdf:rest',_Z)],[owl(X,'rdf:type','rdf:List')]).
-/*
-   triple_remove([owl(X,'rdf:type','owl:Thing')],[owl(X,'rdf:type','owl:Thing')]).
-*/
-% See table 6.
-% http://www.w3.org/TR/2008/WD-owl2-mapping-to-rdf-20081202/
-triple_replace([owl(X,'rdf:type','owl:OntologyProperty')],[owl(X,'rdf:type','owl:AnnotationProperty')]).
-triple_replace([owl(X,'rdf:type','owl:InverseFunctionalProperty')],[owl(X,'rdf:type','owl:ObjectProperty'),owl(X,'rdf:type','owl:InverseFunctionalProperty')]).
-triple_replace([owl(X,'rdf:type','owl:TransitiveProperty')],[owl(X,'rdf:type','owl:ObjectProperty'),owl(X,'rdf:type','owl:TransitiveProperty')]).
-triple_replace([owl(X,'rdf:type','owl:SymmetricProperty')],[owl(X,'rdf:type','owl:ObjectProperty'),owl(X,'rdf:type','owl:SymmetricProperty')]).
-
-% NOTE: this is not specified in table 6. However, we treat rdfs:Classes as equivalent to owl:Classes
-triple_replace([owl(X,'rdf:type','rdfs:Class')],[owl(X,'rdf:type','owl:Class')]).
-
-% DECLARATIONS
-%
-% See table 7.
-% http://www.w3.org/TR/2008/WD-owl2-mapping-to-rdf-20081202/
-
-%% owl_parse_axiom(+AxiomSpec,+AnnMode:boolean,?AnnList:list) is det
-%
-% None
-%
-owl_parse_axiom(class(C),AnnMode,List) :-
-	test_use_owl(C,'rdf:type','owl:Class'),
-	valid_axiom_annotation_mode(AnnMode,C,'rdf:type','owl:Class',List),
-        (   use_owl(C,'rdf:type','owl:Class',named,class(C)) -> true ; use_owl(C,'rdf:type','rdfs:Class',named,class(C))),
-	\+ class(C).
-
-
-owl_parse_axiom(datatype(D), AnnMode, List) :-
-        test_use_owl(D,'rdf:type','rdf:Datatype'),
-        valid_axiom_annotation_mode(AnnMode,D,'rdf:type','rdf:Datatype',List),
-        use_owl(D,'rdf:type','rdf:Datatype',datatype(D)).
-
-
-owl_parse_axiom(objectProperty(D), AnnMode, List) :-
-        test_use_owl(D,'rdf:type','owl:ObjectProperty'),
-        valid_axiom_annotation_mode(AnnMode,D,'rdf:type','owl:ObjectProperty',List),
-        use_owl(D,'rdf:type','owl:ObjectProperty',objectProperty(D)),
-	\+ objectProperty(D).
-
-
-% note the difference in names between syntax and rdf
-owl_parse_axiom(dataProperty(D), AnnMode, List) :-
-        test_use_owl(D,'rdf:type','owl:DatatypeProperty'),
-        valid_axiom_annotation_mode(AnnMode,D,'rdf:type','rdf:DatatypeProperty',List),
-        use_owl(D,'rdf:type','owl:DatatypeProperty',dataProperty(D)),
-	\+ dataProperty(D).
-
-owl_parse_axiom(annotationProperty(D), AnnMode, List) :-
-        test_use_owl(D,'rdf:type','owl:AnnotationProperty'),
-        valid_axiom_annotation_mode(AnnMode,D,'rdf:type','rdf:AnnotationProperty',List),
-        use_owl(D,'rdf:type','owl:AnnotationProperty',annotationProperty(D)),
-	\+ annotationProperty(D).
-
-
-% TODO: check this. do we need to assert individual axioms if all we have is an rdf:type?
-owl_parse_axiom(namedIndividual(D), AnnMode, List) :-
-        test_use_owl(D,'rdf:type','owl:NamedIndividual'),
-        valid_axiom_annotation_mode(AnnMode,D,'rdf:type','rdf:NamedIndividual',List),
-        use_owl(D,'rdf:type','owl:NamedIndividual',namedIndividual(D)).
-
-
-% Table 8. Identifying Anonymous Individuals in Reification
-% TODO
-
-
-% 3.2 Populating an Ontology
-
-
-% 3.2.1 Analyzing Declarations
-
-% 3.2.2 Parsing of Annotations
-
-%
-%       ann(?X, -Extension List)
-%
-%       Implements function ANN(x) 3.2.2 Table 10
-%
-%     The annotations in G are parsed next. The function ANN assigns a
-%     set of annotations ANN(x) to each IRI or blank node x. This
-%     function is initialized by setting ANN(x) = â.. for each each IRI
-%     or blank node x. Next, the triple patterns from Table 10 are
-%     matched in G and, for each matched pattern, ANN(x) is extended
-%     with an annotation from the right column. Each time one of these
-%     triple patterns is matched, the matched triples are removed from
-%     G. This process is repeated until no further matches are
-%     possible
-
-ann(X,Y) :-
-	ann(X,X,Y).
-
-
-
-ann(X,X1, annotation(X1,Y,Z)) :-
-	annotationProperty(Y),
-        debug(owl_parser_detail,'annotation property: ~w',[Y]),
-        owl(X,Y,Z,not_used),
-        use_owl(X,Y,Z,annotationProperty(Y)),
-	u_assert(aNN(X1,Y,Z)),
-	ann2(X,Y,Z,X1).
-
-
-ann2(X,Y,Z,X1) :-
-	annotation_r_node(X,Y,Z,W),
-	ann(W,annotation(X1,Y,Z),Term),
-        u_assert(Term).
-
-ann2(X,Y,Z,X1) :-
-	axiom_r_node(X,Y,Z,W),
-	ann(W,annotation(X1,Y,Z),Term),
-        u_assert(Term).
-
-
-ann2(_,_,_,_).
-
-
-% 3.2.4 Parsing of Expressions
-
-is_bnode(C) :-
-	atom(C),
-	sub_atom(C,0,1,_,'_').
-
-
-	% Table 11. Parsing Object Property Expressions
-owl_property_expression(C,C) :-
-	\+ is_bnode(C), % better: IRI(C).
-	% VV added 10/3/2011
-	C\='http://www.w3.org/1999/02/22-rdf-syntax-ns#first',
-	C\='http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',
-        !.
-
-owl_property_expression(C,D) :-
-	blanknode(C,D,Use),
-	(   Use = used,
-	    retractall(blanknode(C,D,used)),
-	    assert(blanknode(C,D,shared))
-	;
-	    true).
-
-owl_property_expression(P,inverseOf(Q)) :-
-        use_owl(P,'owl:inverseOf',Q,inverseof(P,Q)),
-        owl_get_bnode(P,inverseOf(Q)).
-
-
-% Table 12. Parsing of Data Ranges
-
-owl_datarange(D,D) :-
-	\+ is_bnode(D),!.  % better: IRI(C).
-
-owl_datarange(C,D) :-
-	blanknode(C,D,Use),
-	(   Use = used,
-	    retractall(blanknode(C,D,used)),
-	    assert(blanknode(C,D,shared))
-	;
-	true).
-
-owl_datarange(D,intersectionOf(L)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',datarange(D)),
-	use_owl(D,'owl:intersectionOf',Y,datarange(D)),
-	%print(D-inter-Y),nl,
-        owl_datarange_list(Y,L),
-	owl_get_bnode(D,intersectionOf(L)).
-
-owl_datarange(D,unionOf(L)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',datarange(D)),
-	use_owl(D,'owl:unionOf',Y,datarange(D)),
-        owl_datarange_list(Y,L),
-	owl_get_bnode(D,unionOf(L)).
-
-
-owl_datarange(D,complementOf(DY)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',dataRange(D)),
-	use_owl(D,'owl:datatypeComplementOf',Y,datacomplement(D)),
-        owl_datarange(Y,DY),
-	owl_get_bnode(D,complementOf(DY)).
-
-% Table 14, case 2
- owl_datarange(D,complementOf('rdfs:Literal')) :-
-	use_owl(D,'rdf:type','rdfs:DataRange',dataRange(D)),
-	use_owl(D,'owl:oneOf',[],oneOf(D)),
-	owl_get_bnode(D,complementOf('rdfs:Literal')).
-
-owl_datarange(D,oneOf(L)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',dataType(D)),
-	use_owl(D,'owl:oneOf',L1,oneOf(D)),
-	owl_individual_list(L1,L),
-	owl_get_bnode(D,oneOf(L)).
-
-% Table 14, case 1
-owl_datarange(D,oneOf(L)) :-
-	use_owl(D,'rdf:type','rdfs:DataRange',datarange(D)),
-	use_owl(D,'owl:oneOf',L1,datarange(D)),
-	owl_individual_list(L1,L),
-	owl_get_bnode(D,oneOf(L)).
-
-
-owl_datarange(D,datatypeRestriction(DY,L)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',datarange(D)),
-	use_owl(D,'owl:onDatatype',Y,datarange(D)),
-	owl_datarange(Y,DY),
-	use_owl(D,'owl:withRestrictions',L1,datarange(D)),
-	owl_datatype_restriction_list(L1,L),
-	owl_get_bnode(D,datatypeRestriction(DY,L)).
-
-% Table 13. Parsing of Class Expressions
-
-% ----------------------------------------------------------------------
-%       owl_description(+Node,-Description).
-%
-%	It implements OWL AS production rules for Descriptions.
-%         During the construction of the Description any blank node
-%         is recorded for later structure sharing checks.
-
-owl_description(C,C) :-
-	\+ is_bnode(C),!. % better: IRI(C).
-
-
-owl_description(C,D) :-
-	blanknode(C,D,Use),
-	(   Use = used,
-	    retractall(blanknode(C,D,used)),
-	    assert(blanknode(C,D,shared))
-	;
-	    true),!.
-
-% TODO: this leaves behind classAssertions of type owlClass for the bnodes
-owl_description(D,intersectionOf(L)) :-
-	use_owl(D,'owl:intersectionOf',L1,intersectionOf(D)),
-	owl_description_list(L1,L),
-	\+L = [],
-	owl_get_bnode(D,intersectionOf(L)),!.
-
-owl_description(D,unionOf(L)) :-
-	use_owl(D,'owl:unionOf',L1,union(D)),
-	owl_description_list(L1,L),
-	owl_get_bnode(D,unionOf(L)),!.
-
-
-owl_description(D,complementOf(Descr)) :-
-	use_owl(D,'owl:complementOf',D1,complementOf(D)),
-	owl_description(D1,Descr),
-	owl_get_bnode(D,complementOf(Descr)),!.
-
-owl_description(D,oneOf(L)) :-
-	use_owl(D,'owl:oneOf',L1,oneOf(D)),
-	(   use_owl(D,'rdf:type','owl:Class',oneOf(D,L)) ; true),
-	owl_individual_list(L1,L),
-	owl_get_bnode(D,oneOf(L)),!.
-
-owl_description(D,datatypeRestriction(DY,L)) :-
-	use_owl(D,'rdf:type','rdfs:Datatype',datatypeRestr(D)),
-	use_owl(D,'owl:onDatatype',Y,dataType(D)),
-	owl_datarange(Y,DY),
-	use_owl(D,'owl:withRestrictions',L1,withRestrictions(D)),
-	owl_datatype_restriction_list(L1,L),
-	owl_get_bnode(D,datatypeRestriction(DY,L)).
-
-owl_description(D,Restriction) :-
-	owl_restriction(D, Restriction),
-	owl_get_bnode(D,Restriction),!.
-
-
-% Table 15 - OWL DL compatibility class expressions
-%
-owl_description(D,Result) :-
-	\+ is_bnode(D), % better: IRI(C).
-	use_owl(D,'rdf:type','owl:Class',description(D)),
-	use_owl(D,'owl:unionOf',L,unionOf(L)),
-	owl_description_list(L,DL),
-	(   DL = [], Result = 'owl:Nothing' ;
-	    DL = [D1], Result = D1),
-	owl_get_bnode(D,Result),!.
-
-owl_description(D,Result) :-
-	\+ is_bnode(D), % better: IRI(C).
-	use_owl(D,'rdf:type','owl:Class',dl_compatibility_descr(D)),
-	use_owl(D,'owl:intersectionOf',L,intersectionOf(D)),
-	owl_description_list(L,DL),
-	(   DL = [], Result = 'owl:Thing' ;
-	    DL = [D1], Result = D1),
-	owl_get_bnode(D,Result),!.
-
-owl_description(D,Result) :-
-	\+ is_bnode(D),!, % better: IRI(C).
-	use_owl(D,'rdf:type','owl:Class',dl_compatibility_descr(D)),
-	use_owl(D,'owl:oneOf',[],oneOf(D)),
-	Result = 'owl:Nothing',
-	owl_get_bnode(D,Result).
-
-% support older deprecated versions of OWL2 spec. See for example hydrology.owl
-onClass(E,D) :- use_owl(E,'http://www.w3.org/2006/12/owl2#onClass',D,onClass(E)).
-onClass(E,D) :- use_owl(E,'owl:onClass',D,onClass(E)).
-
-onDataRange(E,D) :- use_owl(E, 'owl:onDataRange',D,onDatarange(E)).
-
-
-%       owl_restriction(+Element,-Restriction).
-%
-%       If Element is defined as a owl:Restriction on property P then
-%       Restriction binds to a restriction(Property,Type) term,
-%	according to OWL Abstract syntax specification.
-
-owl_restriction(Element,Restriction) :-
-	use_owl(Element,'rdf:type','owl:Restriction',restriction(Element)),
-	(   use_owl(Element, 'owl:onProperty',PropertyID,onProperty(Element,PropertyID)) ;
-    	    use_owl(Element, 'owl:onProperties',PropertyID,onProperties(Element,PropertyID))
-	),
-	owl_restriction_type(Element,PropertyID, Restriction),
-        debug(owl_parser_detail,'Restriction: ~w',[Restriction]).
-
-
-
-owl_restriction_type(E, P, someValuesFrom(PX, DX)) :-
-	use_owl(E, 'owl:someValuesFrom',D,someValuesFrom(E,P)),
-	(   owl_description(D, DX) ; owl_datarange(D,DX)),
-        (   P = [_|_], owl_property_list(P,PX) ;  owl_property_expression(P, PX)).
-
-
-owl_restriction_type(E, P, allValuesFrom(PX,DX)) :-
-	use_owl(E, 'owl:allValuesFrom',D,allValuesFrom(E,P)),
-	(   owl_description(D, DX) ; owl_datarange(D,DX)),
-        (   P = [_|_], owl_property_list(P,PX) ;  owl_property_expression(P, PX)).
-
-
-% changed from thea value-->hasValue
-owl_restriction_type(E, P, hasValue(PX,Value)) :-
-	use_owl(E, 'owl:hasValue',Value,hasValue(E)),
-        owl_property_expression(P, PX).
-
-% VV:check if RDF parser returns a triple with O=true for
-owl_restriction_type(E, P, hasSelf(PX)) :-
-	use_owl(E, 'owl:hasSelf', true,hasSelf(E)),
-        owl_property_expression(P, PX).
-
-% Support of deprecated translations:
-% in the OWL2 RDF mapping, unqualified CRs use owl:{min,max}Cardinality
-% and QCQs use owl:{min,ax}QualifiedCardinality
-%
-% however, there appear to be some ontologies; e.g. Hydrology.owl.
-% that use an older mapping, where the same properties are used
-% for QCR and unqCR
-%
-% it is relatively easy to support this legacy ontologies; however
-% we must process these BEFORE unqualified cardinality restrictions.
-
-owl_restriction_type(E, P, exactCardinality(N,PX,DX)) :-
-	test_use_owl(E, 'owl:cardinality',Lit),
-        onClass(E,D),
-	owl_description(D, DX),!,
-	use_owl(E, 'owl:cardinality',Lit,cardinality(E)),
-        literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-owl_restriction_type(E, P, minCardinality(N,PX,DX)) :-
-	test_use_owl(E, 'owl:minCardinality',Lit),
-        (   onClass(E,D),owl_description(D, DX)
-        ;   onDataRange(E,D), owl_datarange(D,DX)),
-	!,
-        % we are sure this is an old-style unqualified CR - now consume triples
-	use_owl(E, 'owl:minCardinality',Lit,minCardinality(E)),
-        literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-owl_restriction_type(E, P, maxCardinality(N,PX,DX)) :-
-	test_use_owl(E, 'owl:maxCardinality',Lit),
-        (   onClass(E,D),owl_description(D, DX)
-        ;   onDataRange(E,D), owl_datarange(D,DX)),
-	!,
-        % we are sure this is an old-style unqualified CR - now consume triples
-	use_owl(E, 'owl:maxCardinality',Lit,maxCard(E)),
-        literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-% END OF Support of deprecated translations:
-
-% the following are all in the spec:
-
-% changed from Thea1->2: cardinality->exactCardinality
-owl_restriction_type(E, P,exactCardinality(N,PX)) :-
-	use_owl(E, 'owl:cardinality',Lit,cardinality(E)),
-        literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-owl_restriction_type(E, P,exactCardinality(N,PX,DX)) :-
-	use_owl(E, 'owl:qualifiedCardinality',Lit),literal_integer(Lit,N),
-	(   onClass(E,D),owl_description(D, DX) ;
-	    onDataRange(E,D), owl_datarange(D,DX)
-	),
-        owl_property_expression(P, PX).
-
-
-owl_restriction_type(E, P, minCardinality(N,PX)) :-
-	use_owl(E, 'owl:minCardinality',Lit,cardinality(E)),literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-owl_restriction_type(E, P, minCardinality(N,PX,DX)) :-
-	use_owl(E, 'owl:minQualifiedCardinality',Lit,cardinality(E)),literal_integer(Lit,N),
-	(   onClass(E,D),owl_description(D, DX);
-	    onDataRange(E,D), owl_datarange(D,DX)
-	),
-        owl_property_expression(P, PX).
-
-
-owl_restriction_type(E, P, maxCardinality(N,PX)) :-
-	use_owl(E, 'owl:maxCardinality',Lit,maxCardinality(E)),literal_integer(Lit,N),
-        owl_property_expression(P, PX).
-
-owl_restriction_type(E, P, maxCardinality(N,PX,DX)) :-
-	use_owl(E, 'owl:maxQualifiedCardinality',Lit,cardinality(E,Lit)),
-	literal_integer(Lit,N),
-	(   onClass(E,D),owl_description(D, DX);
-	    onDataRange(E,D), owl_datarange(D,DX)),
-        owl_property_expression(P, PX).
-
-
-% Table 14. Parsing of Data Ranges for Compatibility with OWL DL
-% Included into owl_datarange clauses above
-
-% Table 15. Parsing of Class Expressions for Compatibility with OWL DL
-% Included into owl_dexcription clauses above
-
-% Table 16. Parsing of Axioms without Annotations
-% Declarations handled previously
-% CLASS AXIOMS
-% valid_axiom_annotation_mode: add clauses for the disjoint etc ....
-
-collect_r_nodes :-
-	retractall(axiom_r_node(_,_,_,_)),
-	forall(( test_use_owl(Node,'rdf:type','owl:Axiom'),
-		 test_use_owl(Node,'owl:annotatedSource',S),
-		 test_use_owl(Node,'owl:annotatedProperty',P),
-		 test_use_owl(Node,'owl:annotatedTarget',O)),
-	       (assert(axiom_r_node(S,P,O,Node)),
-                debug(owl_parser_detail,'~w',[axiom_r_node(S,P,O,Node)]),
-		use_owl([owl(Node,'rdf:type','owl:Axiom'),
-			 owl(Node,'owl:annotatedSource',S),
-			 owl(Node,'owl:annotatedProperty',P),
-			 owl(Node,'owl:annotatedTarget',O)]))),
-
-	retractall(annotation_r_node(_,_,_,_)),
-	forall(( test_use_owl(W,'rdf:type','owl:Annotation'),
-		 test_use_owl(W,'owl:annotatedSource',S),
-		 test_use_owl(W,'owl:annotatedProperty',P),
-		 test_use_owl(W,'owl:annotatedTarget',O)),
-	       (assert(annotation_r_node(S,P,O,Node)),
-                debug(owl_parser_detail,'~w',[annotation_r_node(S,P,O,Node)]),
-		use_owl([owl(W,'rdf:type','owl:Annotation'),
-			 owl(W,'owl:annotatedSource',S),
-			 owl(W,'owl:annotatedProperty',P),
-			 owl(W,'owl:annotatedTarget',O)]))).
-
-%% valid_axiom_annotation_mode(+AnnMode,+S,+P,+O,?AnnotationNodes:list) is det
-% if AnnMode is true and annotation triples can be found then
-% unify AnnotationNodes with the Nodes that annotate the triple,
-% otherwise []
-
-valid_axiom_annotation_mode(_Mode,S,P,O,List) :-
-        expand_ns(P,PE),
-        findall(Node,axiom_r_node(S,PE,O,Node),List).
-
-
-owl_parse_axiom(subClassOf(DX,DY),AnnMode,List) :-
-	test_use_owl(X,'rdfs:subClassOf',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'rdfs:subClassOf',Y,List),
-	use_owl(X,'rdfs:subClassOf',Y,subclassOf(X,Y)),
-        owl_description(X,DX),
-	owl_description(Y,DY).
-
-% Process each equivalentClass pair separately in order to capture
-% annotations. Block the maximally connected subgraph.
-% TODO. Process the equivalent(L) axioms to generate maximally connected
-% equivalentClasses(L) axioms. (but without annotations?)
-
-owl_parse_axiom(equivalentClasses(DL),AnnMode,List) :-
-	test_use_owl(X,'owl:equivalentClass',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:equivalentClass',Y,List),
-	use_owl(X,'owl:equivalentClass',Y,equivalentClass(X,Y)),
-        % maximally_connected_subgraph_over('owl:equivalentClass',L),
-        maplist(owl_description,[X,Y],DL),
-        debug(owl_parser_detail,'equivalentClasses Descs: ~w',[DL]).
-
-
-owl_parse_axiom(equivalentClasses([C,intersectionOf(D)]),AnnMode,List) :-
-	class(C),
-	test_use_owl(C,'owl:intersectionOf',D1),
-	debug(owl_parser,'equivalent collection; intersection for ~w',[C]),
-	valid_axiom_annotation_mode(AnnMode,C,'owl:intersectionOf',D1,List),
-	owl_description(C,intersectionOf(D)).
-
-owl_parse_axiom(equivalentClasses([C,unionOf(D)]),AnnMode,List) :-
-	class(C),
-	test_use_owl(C,'owl:unionOf',D1),
-	debug(owl_parser,'equivalent collection; union for ~w',[C]),
-	valid_axiom_annotation_mode(AnnMode,C,'owl:unionOf',D1,List),
-	owl_description(C,unionOf(D)).
-
-owl_parse_axiom(equivalentClasses([C,oneOf(D)]),AnnMode,List) :-
-	class(C),
-	test_use_owl(C,'owl:oneOf',D1),
-	debug(owl_parser,'equivalent collection; one of for ~w',[C]),
-	valid_axiom_annotation_mode(AnnMode,C,'owl:oneOf',D1,List),
-	owl_description(C,oneOf(D)).
-
-
-owl_parse_axiom(equivalentClasses([C,D])) :-
-        % TODO: this could be made more efficient by enforcing order of building
-        (   test_use_owl(C,'rdf:type','owl:Class',named)
-        ;   test_use_owl(C,'rdf:type','rdfs:Class',named)
-        ;   class(C)),
-        owl_description(C,D),
-        C\=D.
-
-% TODO. Process the disjointClasses(L) axioms to generate
-% larger set of disjoint: ie if N classes are pairwise DisJoint
-% then we can assert a disjointClasses for all N
-
-owl_parse_axiom(disjointClasses([DX,DY]),AnnMode,List) :-
-	test_use_owl(X,'owl:disjointWith',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:disjointWith',Y,List),
-	use_owl(X,'owl:disjointWith',Y,disjointWith(X,Y)),
-        owl_description(X,DX),
-	owl_description(Y,DY).
-
-% One of the cases where annotations are those of _x and we do not seek
-% for further annotation axioms. Par. 3.2.5.
-% Whatever the AnnNode, _x is returned (will be ignored if mode false
-
-owl_parse_axiom(disjointClasses(L),_AnnMode,[X]) :-
-        % TODO: X may be referred to in an annotation axiom??
-	use_owl(X,'rdf:type','owl:AllDisjointClasses',allDisjointClasses(X)),
-        use_owl(X,'owl:members',L1,members(L1)),
-        owl_description_list(L1,L).
-
-
-owl_parse_axiom(disjointUnion(DX,DY),AnnMode,List) :-
-	test_use_owl(X,'owl:disjointUnionOf',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:disjointUnionOf',Y,List),
-	use_owl(X,'owl:disjointUnionOf',Y,disjointUnionOf(X,Y)),
-        owl_description(X,DX),
-        owl_description_list(Y,DY).
-
-
-% PROPERTY AXIOMS
-
-
-% introduces bnode
-owl_parse_axiom(subPropertyOf(propertyChain(PL),QX),AnnMode,List) :-
-	test_use_owl(Q,'owl:propertyChainAxiom',L1),
-	valid_axiom_annotation_mode(AnnMode,Q,'owl:propertyChainAxiom',L1,List),
-	use_owl(Q,'owl:propertyChainAxiom',L1,propertyChainAxiom(Q)),
-	owl_property_list(L1,PL),
-        owl_property_expression(Q,QX).
-
-owl_parse_axiom(subPropertyOf(PX,QX),AnnMode,List) :-
-	test_use_owl(P,'rdfs:subPropertyOf',Q),
-	valid_axiom_annotation_mode(AnnMode,P,'rdfs:subPropertyOf',Q,List),
-	use_owl(P,'rdfs:subPropertyOf',Q,subPropertyOf(P,Q)),
-        owl_property_expression(P,PX),
-        owl_property_expression(Q,QX).
-
-
-% Process each equivalentProperty pair separately in order to capture
-% annotations. Block the maximally connected subgraph.
-% TODO. Process the equivalent(L) axioms to generate maximally connected
-% equivalentProperties(L) axioms. (but without annotations?)
-
-owl_parse_axiom(equivalentProperties(OPEL),AnnMode,List) :-
-	test_use_owl(X,'owl:equivalentProperty',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:equivalentProperty',Y,List),
-	use_owl(X,'owl:equivalentProperty',Y,equivProperty(X,Y)),
-	% maximally_connected_subgraph_over('owl:equivalentProperty',L),
-	maplist(owl_property_expression,[X,Y],OPEL).
-
-
-% TODO. Process the disjointProperties(L) axioms to generate
-% larger set of disjoint: ie if N properties are pairwise DisJoint
-% then we can assert a disjointClasses for all N
-
-owl_parse_axiom(disjointProperties([DX,DY]),AnnMode,List) :-
-	test_use_owl(X,'owl:propertyDisjointWith',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:propertyDisjointWith',Y,List),
-	use_owl(X,'owl:propertyDisjointWith',Y,propertyDisjointWith(X,Y)),
-        owl_description(X,DX),
-	owl_description(Y,DY).
-
-% One more of the cases where annotations are those of _x and we do not
-% seek for further annotation axioms. Par. 3.2.5. Whatever the AnnNode,
-% _x is returned (will be ignored if mode false)
-
-owl_parse_axiom(disjointProperties(L),_AnnMode,[X]) :-
-        % TODO: X may be referred to in an annotation axiom??
-	use_owl(X,'rdf:type','owl:AllDisjointProperties',allDisjointProps(X,L1)),
-        use_owl(X,'owl:members',L1,members(L1)),
-        L1 = [_,_|_],           % length >= 2
-        owl_property_list(L1,L).
-
-
-owl_parse_axiom(propertyDomain(PX,CX),AnnMode,List) :-
-	test_use_owl(P,'rdfs:domain',C),
-	valid_axiom_annotation_mode(AnnMode,P,'rdfs:domain',C,List),
-        use_owl(P,'rdfs:domain',C,domain(P,C)),
-	(   annotationProperty(P),CX = C ;
-	    owl_property_expression(P,PX),
-	    owl_description(C,CX)
-	).
-
-% We need to distinguish here between object and data property
-% Currently we first test if the range is a class, this means OPE
-% otherwise if it is a datarange it means a DPE.
-% Ideally we should also check possible declarations of OPE or DPE.
-
-owl_parse_axiom(propertyRange(PX,CX),AnnMode,List) :-
-	test_use_owl(P,'rdfs:range',C),
-	valid_axiom_annotation_mode(AnnMode,P,'rdfs:range',C,List),
-        use_owl(P,'rdfs:range',C,range(P,C)),
-	(   annotationProperty(P) -> PX = P, CX = C ;
-	    owl_property_expression(P,PX),
-            (   owl_description(C,CX) -> true ; owl_datarange(C,CX))
-	).
-
-owl_parse_axiom(inverseProperties(PX,QX),AnnMode,List) :-
-	test_use_owl(P,'owl:inverseOf',Q),
-	valid_axiom_annotation_mode(AnnMode,P,'owl:inverseOf',Q,List),
-	use_owl(P,'owl:inverseOf',Q,inverseOf(P,Q)),
-        owl_property_expression(P,PX),
-        owl_property_expression(Q,QX).
-
-owl_parse_axiom(functionalProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:FunctionalProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:FunctionalProperty',List),
-        use_owl(P,'rdf:type','owl:FunctionalProperty',functionalProperty(P)).
-
-owl_parse_axiom(inverseFunctionalProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:InverseFunctionalProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:InverseFunctionalProperty',List),
-        use_owl(P,'rdf:type','owl:InverseFunctionalProperty',inverseFunctionalProperty(P)).
-
-owl_parse_axiom(reflexiveProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:ReflexiveProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:ReflexiveProperty',List),
-        use_owl(P,'rdf:type','owl:ReflexiveProperty',reflexiveProperty(P)).
-
-owl_parse_axiom(irreflexiveProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:IrreflexiveProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:IrreflexiveProperty',List),
-        use_owl(P,'rdf:type','owl:IrreflexiveProperty',irreflexiveProperty(P)).
-
-owl_parse_axiom(symmetricProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:SymmetricProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:SymmetricProperty',List),
-        use_owl(P,'rdf:type','owl:SymmetricProperty',symmetricProperty(P)).
-
-owl_parse_axiom(asymmetricProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:AsymmetricProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:AsymmetricProperty',List),
-        use_owl(P,'rdf:type','owl:AsymmetricProperty',assymetricProperty(P)).
-
-owl_parse_axiom(transitiveProperty(P),AnnMode,List) :-
-	test_use_owl(P,'rdf:type','owl:TransitiveProperty'),
-	valid_axiom_annotation_mode(AnnMode,P,'rdf:type','owl:TransitiveProperty',List),
-	use_owl(P,'rdf:type','owl:TransitiveProperty',transitiveProperty(P)).
-
-owl_parse_axiom(hasKey(CX,L),AnnMode,List) :-
-	test_use_owl(C,'owl:hasKey',L1),
-	valid_axiom_annotation_mode(AnnMode,C,'owl:hasKey',L1,List),
-	use_owl(C,'owl:hasKey',L1,hasKey(C)),
-	owl_description(C,CX),
-        L1 = [_,_|_],           % length >= 2
-        owl_property_list(L1,L).
-
-% INDIVIDUALS
-
-owl_parse_axiom(sameIndividual([X,Y]),AnnMode,List) :-
-	test_use_owl(X,'owl:sameAs',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:sameAs',Y,List),
-	use_owl(X,'owl:sameAs',Y,sameAs(X,Y)).
-
-owl_parse_axiom(differentIndividuals([X,Y]),AnnMode,List) :-
-	test_use_owl(X,'owl:differentFrom',Y),
-	valid_axiom_annotation_mode(AnnMode,X,'owl:differentFrom',Y,List),
-	use_owl(X,'owl:differentFrom',Y,differentFrom(X,Y)).
-
-owl_parse_axiom(differentIndividuals(L),_AnnMode,[X]) :-
-	use_owl(X,'rdf:type','owl:AllDifferent',allDifferent(L)),
-	use_owl(X,'owl:distinctMembers',L1,distinctMembers(L)),
-        owl_individual_list(L1,L).
-
-owl_parse_axiom(differentIndividuals(L),_AnnMode,[X]) :-
-	use_owl(X,'rdf:type','owl:AllDifferent',allDifferent(X)),
-	use_owl(X,'owl:members',L1,members(L)),
-        owl_individual_list(L1,L).
-
-% make sure this is done before fetching classAssertion/2;
-% -- the annotationAssertion matching clause should preceded the classAssertion/2 matching clause
-owl_parse_axiom(annotationAssertion('owl:deprecated', X, true),AnnMode,List) :-
-	test_use_owl(X, 'rdf:type', 'owl:DeprecatedClass'),
-	valid_axiom_annotation_mode(AnnMode,X,'rdf:type','owl:DeprecatedClass',List),
-	use_owl(X, 'rdf:type', 'owl:DeprecatedClass',deprecatedClass(X)).
-
-% make sure this is done before fetching propertyAssertion/3
-% this clause should precede it
-owl_parse_axiom(annotationAssertion('owl:deprecated', X, true),AnnMode,List) :-
-	test_use_owl(X, 'rdf:type', 'owl:DeprecatedProperty'),
-	valid_axiom_annotation_mode(AnnMode,X,'rdf:type','owl:DeprecatedProperty',List),
-	use_owl(X, 'rdf:type', 'owl:DeprecatedProperty',deprecatedProperty(X)).
-
-% Table 17. Parsing of Annotated Axioms
-
-dothislater(annotationAssertion/3).
-% TODO - only on unnannotated pass?
-%
-
-owl_parse_axiom(annotationAssertion(P,A,B),AnnMode,List) :-
-        annotationProperty(P),
-        test_use_owl(A,P,B),         % B can be literal or individual
-        valid_axiom_annotation_mode(AnnMode,A,P,B,List),
-        use_owl(A,P,B,annotationProperty(P)).
-
-
-dothislater(classAssertion/2).
-owl_parse_axiom(classAssertion(CX,X),AnnMode,List) :-
-	test_use_owl(X,'rdf:type',C),
-        C\='http://www.w3.org/2002/07/owl#DeprecatedClass',
-	% note: some ontologies may include a rdf:type with no
-	%  explicit class declaration. See testfiles/test_undeclared.owl
-	%class(C),
-	valid_axiom_annotation_mode(AnnMode,X,'rdf:type',C,List),
-	use_owl(X,'rdf:type',C,classAssertion(CX,X)),
-        % I added this to avoid class assertions for bNodes. Perhaps a better
-        % way is to simply consume the owl4/ triple at the time of translating
-        % the description? --CJM
-        C\='http://www.w3.org/2002/07/owl#Class',
-        %
-        C\='http://www.w3.org/1999/02/22-rdf-syntax-ns#Property',
-        owl_description(C,CX).
-
-dothislater(propertyAssertion/3).
-owl_parse_axiom(propertyAssertion(PX,A,BX),AnnMode,List) :-
-        test_use_owl(A,P,B), % B can be literal or individual
-        P\='http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
-	% note: some ontologies may include a triples with no
-	%  explicit property declaration. See testfiles/test_undeclared.owl
-	%property(P),
-	valid_axiom_annotation_mode(AnnMode,A,P,B,List),
-        \+ annotationProperty(P), % these triples should have been removed before, during ann parsing
-	owl_property_expression(P,PX), % can also be inverse
-	% next line added by VV 9/3/2011 for Jochem Liem to support ID-lists as PA objects
-	(   owl_individual_list(B,BX) -> true ; BX = B),
-        use_owl(A,P,B,propertyAssertion(PX,A,BX)).
-
-
-owl_parse_axiom(negativePropertyAssertion(PX,A,B),_,X) :-
-        use_owl(X,'rdf:type','owl:NegativePropertyAssertion',negPropertyAssertion(PX,A,B)),
-        use_owl(X,'owl:sourceIndividual',A,negPropertyAssertion(PX,A,B)),
-        use_owl(X,'owl:assertionProperty',P,negPropertyAssertion(PX,A,B)),
-        use_owl(X,'owl:targetValue',B,negPropertyAssertion(PX,A,B)),
-        owl_property_expression(P,PX).
-
-
-% process hooks; SWRL etc
-
-% Parsing annotationAssertions
-%
-
-parse_annotation_assertions :-
-	( nb_current(rind,RIND) -> true ; RIND = []),!,
-	forall((aNN(X,AP,AV),findall( aNN(annotation(X,AP,AV),AP1,AV1),
-				      aNN(annotation(X,AP,AV),AP1,AV1),ANN), \+member(X,RIND), \+name(X,[95, 95, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110|_])),
-	       (   assert_axiom(annotationAssertion(AP,X,AV)),
-		  %  VV 10/3/2010 keep annotation/3
-		  % retract(annotation(X,AP,AV)),
-		   forall(member(aNN(_,AP1,AV1),ANN),
-			    assert_axiom(annotation(annotationAssertion(AP,X,AV),AP1,AV1))
-			 )
-	       )
-	      ),
-	% forall(aNN(X,Y,Z),assert(annotation(X,Y,Z))), VV remove 25/1/11
-	% annotation/3 axioms created already during owl_parse_annotated_axioms/1
-	retractall(aNN(_,_,_)).
-
-% Table 18. Parsing of Axioms for Compatibility with OWL DL
-
-owl_parse_compatibility_DL(equivalentClasses([CEX,complementOf(CEY)])) :-
-	use_owl(X,'owl:complementOf',Y,eq_classes),
-	owl_description(X,CEX),
-	owl_description(Y,CEY).
-
-
-owl_parse_compatibility_DL(equivalentClasses([CEX,CEY])) :-
-	use_owl(X,'owl:unionOf',Y,eq_classes),
-	owl_description(X,CEX),
-	owl_description_list(Y,DL),
-	(   DL = [] -> CEY = 'owl:Nothing' ; (DL=[CEY]->true;CEY = unionOf(DL))).
-
-owl_parse_compatibility_DL(equivalentClasses([CEX,CEY])) :-
-	use_owl(X,'owl:intersectionOf',Y,eq_classes),
-	owl_description(X,CEX),
-	owl_description_list(Y,DL),
-	(   DL = [] -> CEY = 'owl:Thing' ; (DL=[CEY]->true;CEY = intersectionOf(DL))).
-
-owl_parse_compatibility_DL(equivalentClasses([CEX,CEY])) :-
-	use_owl(X,'owl:oneOf',Y,eq_classes),
-	owl_description(X,CEX),
-	owl_description_list(Y,DL),
-	(   DL = [] -> CEY = 'owl:Nothing' ; CEY = oneOf(DL)).
-
-% UTIL
-
-%% maximally_connected_subgraph_over(+P,?ConnectedSets) is semidet
-maximally_connected_subgraph_over(P,CSet):-
-        maximally_connected_subgraph_over(P,[],CSetL),
-        member(CSet,CSetL).
-
-%% maximally_connected_subgraph_over(+P,+Used,?ListOfConnectedSets) is det
-maximally_connected_subgraph_over(P,Used,[CSet|All]):-
-        test_use_owl(X,P,Y), % seed
-        \+ member(X,Used),
-        \+ member(Y,Used),
-        use_owl(X,P,Y,maximally_conected), % seed
-        !,
-        extend_set_over(P,[X,Y],CSet),
-        append(CSet,Used,Used2),
-        maximally_connected_subgraph_over(P,Used2,All).
-maximally_connected_subgraph_over(_,_,[]).
-
-
-% det
-extend_set_over(P,L,L2):-
-        member(X,L),
-        test_use_owl(X,P,Y),
-        \+ member(Y,L),
-        use_owl(X,P,Y,extend_set_over),
-        !,extend_set_over(P,[Y|L],L2).
-extend_set_over(P,L,L2):-
-        member(X,L),
-        test_use_owl(Y,P,X),
-        \+ member(Y,L),
-        use_owl(Y,P,X,extend_set_over),
-        !,extend_set_over(P,[Y|L],L2).
-extend_set_over(_,L,L):- !.
-
-literal_integer(literal(type,A),N) :- atom_number(A,N).
-literal_integer(literal(type(_,A)),N) :- atom_number(A,N).
-
-%% time_goal(+Goal,?Time)
-%  calls Goal and unifies Time with the cputime taken
-time_goal(Goal,Time):-
-        statistics(cputime,T1), Goal,
-        statistics(cputime,T2), Time is T2-T1.
-
-timed_forall(Cond,Action) :-
-        forall(Cond,
-               (   time_goal(Action,Time),
-                   debug(owl2_bench,'Goal: ~w Time:~w',[Action,Time]))).
-
-
-/** <module> Translates an RDF database to OWL2 axioms
-  ---+ Synopsis 1
-==
-:- use_module(bio(owl2_from_rdf)).
-%
-==
----+ Details
----++ Hooks
-* owl_parse_axiom_hook/3
----+ See Also
-The file owl2_from_rdf.plt has some examples
-*/
-:- thread_local ns4query/1.
-
-load_owl(String):-
-  pengine_self(Self),
-  pengine_property(Self,module(M)),
-  open_chars_stream(String,S),
-  process_rdf(stream(S), assert_list(M), [namespaces(NSList)]),
-  rdf_register_prefix('disponte','https://sites.google.com/a/unife.it/ml/disponte#',[keep(true)]),
-  assert(M:ns4query(NSList)),
-  close(S),
-  rdf_2_owl('ont','ont'),
-  owl_canonical_parse_3(['ont']),
-  parse_probabilistic_annotation_assertions.
-
-
-assert_list(_M,[], _):-!.
-assert_list(M,[H|T], Source) :-
-    H=..[_|Args],
-    H1=..[myrdf|Args],
-	assert(M:H1),
-        assert_list(M,T, Source).
-
-find_all_probabilistic_annotations(Ax,PV):-
-	annotation(Ax,'https://sites.google.com/a/unife.it/ml/disponte#probability',literal(type(_Type, PV))),
-	atomic(PV).
-
-find_all_probabilistic_annotations(Ax,PV):-
-	annotation(Ax,'https://sites.google.com/a/unife.it/ml/disponte#probability',literal(PV)),
-	atomic(PV).
-  
-
-parse_probabilistic_annotation_assertions :-
-  forall(find_all_probabilistic_annotations(Ax,PV),
-       (assert_axiom(annotationAssertion('https://sites.google.com/a/unife.it/ml/disponte#probability',Ax,literal(PV))))
-  ),
-  % forall(aNN(X,Y,Z),assert(annotation(X,Y,Z))), VV remove 25/1/11
-  % annotation/3 axioms created already during owl_parse_annotated_axioms/1
-  retractall(annotation(_,'https://sites.google.com/a/unife.it/ml/disponte#probability',_)).
-
-query_is([Q|_],0,Q):-!.
-query_is([_|T],N,Q):-
-  NN is N - 1,
-  query_is(T,NN,Q).
-
-set_new_query([_|T],0,NQ,[NQ|T]):-!.
-set_new_query([Q|T],N,NQ,[Q|NT]):-
-  NN is N - 1,
-  set_new_query(T,NN,NQ,NT).
-
-query_expand(CQ):-
-  CQ =.. [CQP | CQArgs],
-  member((CQP,PosQ),[(aggregate_all,1), (limit,1)]),!,
-  query_is(CQArgs,PosQ,Q),
-  Q =.. [P|Args],
-  pengine_self(Self),
-  pengine_property(Self,module(M)),
-  M:ns4query(NSList),!,
-  retract(M:ns4query(NSList)),
-  expand_all_ns(Args,NSList,NewArgs),!,
-  NQ =.. [P|NewArgs],
-  set_new_query(CQArgs,PosQ,NQ,CQNewArgs),
-  NCQ =.. [CQP|CQNewArgs],
-  call(NCQ).
-  
-query_expand(Q):-
-  Q =.. [P|Args],
-  pengine_self(Self),
-  pengine_property(Self,module(M)),
-  M:ns4query(NSList),!,
-  retract(M:ns4query(NSList)),
-  expand_all_ns(Args,NSList,NewArgs),!,
-  NQ =.. [P|NewArgs],
-  call(NQ).
-
-expand_all_ns([],_,[]).
-
-expand_all_ns([P|T],NSList,[NP|NewArgs]):-
-  compound(P),
-  P =.. [N | [Args]],!,
-  expand_all_ns(Args,NSList,NewPArgs),
-  NP =.. [N, [NewPArgs]],
-  expand_all_ns(T,NSList,NewArgs).
-
-expand_all_ns([P|T],NSList,[NP|NewArgs]):-
-  compound(P),
-  P =.. [N | Args],!,
-  expand_all_ns(Args,NSList,NewPArgs),
-  NP =.. [N| NewPArgs],
-  expand_all_ns(T,NSList,NewArgs).
-
-expand_all_ns([H|T],NSList,[H|NewArgs]):-
-  check_query_arg(H),!,
-  expand_all_ns(T,NSList,NewArgs).
-
-expand_all_ns([H|T],NSList,[NewArg|NewArgs]):-
-  expand_ns4query(H,NSList,NewArg),
-  expand_all_ns(T,NSList,NewArgs).
-
-check_query_arg(Arg) :-
-  atomic(Arg),!,
-  axiom(Ax),
-  Ax =.. [_|L],
-  flatten(L,L1),
-  member(Arg,L1),!.
-
-expand_ns4query(NS_URL, [], NS_URL).
-expand_ns4query(NS_URL, [Short_NSL=Long_NSL|_],Full_URL):- 
-	nonvar(NS_URL),
-	NS_URL \= literal(_),
-	uri_split(NS_URL,Short_NS,Term, ':'),
-	Short_NS = Short_NSL,
-	Long_NS = Long_NSL,!,
-	concat_atom([Long_NS,Term],Full_URL).
-
-expand_ns4query(NS_URL, [[]=Long_NSL|_],Full_URL):- 
-	nonvar(NS_URL),
-	NS_URL \= literal(_),
-	\+ sub_atom(NS_URL,_,_,_,':'),
-	Long_NS = Long_NSL,!,
-	concat_atom([Long_NS,NS_URL],Full_URL).
-
-expand_ns4query(NS_URL, [_|T],Full_URL):- 
-  expand_ns4query(NS_URL, T,Full_URL),!.
-expand_ns4query(URL,_, URL).
-
diff --git a/lib/trill_on_swish/trill/bddem.so b/lib/trill_on_swish/trill/bddem.so
deleted file mode 100755
index e9cbf3b..0000000
Binary files a/lib/trill_on_swish/trill/bddem.so and /dev/null differ
diff --git a/lib/trill_on_swish/trill/trill.pl b/lib/trill_on_swish/trill/trill.pl
deleted file mode 100644
index 2464a50..0000000
--- a/lib/trill_on_swish/trill/trill.pl
+++ /dev/null
@@ -1,2056 +0,0 @@
-
-:- module(trill,[sub_class/2, sub_class/3, prob_sub_class/3,
-                 instanceOf/2, instanceOf/3, prob_instanceOf/3,
-                 unsat/1, unsat/2, prob_unsat/2,
-                 inconsistent_theory/0, inconsistent_theory/1, prob_inconsistent_theory/1,
-                 load_theory/1, check_query_args/1] ).
-
-%:- set_prolog_flag(unknow,fail).
-
-/*:- use_module(library('thea2/owl2_io')).
-:- use_module(library('thea2/owl2_model')).*/
-:- use_module(library(lists)).
-:- use_module(library(ugraphs)).
-:- use_module(library(rbtrees)).
-:- use_module(library(pengines)).
-
-:- use_module(library(dif)).
-
-%:- use_module(library(tries)).
-%:- load_foreign_files(['cplint-swi'],[],init_my_predicates).
-%:-use_foreign_library(bddem,install).
-
-:- use_foreign_library(foreign(bddem),install).
-
-:- thread_local %get_var_n/5
-        rule_n/1,
-        na/2,
-        v/3.
-        
-%:-['trillProbComputation'].
-
-:- thread_local
-	ind/1,
-	exp_found/1.
-
-%:- yap_flag(unknown,fail).
-:- multifile
-	owl2_model:axiom/1,
- 	owl2_model:class/1,
- 	owl2_model:annotationProperty/1,
-  	owl2_model:namedIndividual/1,
-  	owl2_model:objectProperty/1,
-  	owl2_model:dataProperty/1,
- 	owl2_model:transitiveProperty/1,
-        owl2_model:classAssertion/2,
-        owl2_model:propertyAssertion/3,
-        owl2_model:subPropertyOf/2,
-        owl2_model:subClassOf/2,
-        owl2_model:equivalentClasses/1,
-        owl2_model:differentIndividuals/1,
-        owl2_model:sameIndividual/1,
-        owl2_model:intersectionOf/1,
-        owl2_model:unionOf/1,
-        owl2_model:propertyRange/2,
-        owl2_model:propertyDomain/2,
-        owl2_model:annotationAssertion/3,
-        owl2_model:exactCardinality/2,
-        owl2_model:exactCardinality/3,
-        owl2_model:maxCardinality/2,
-        owl2_model:maxCardinality/3,
-        owl2_model:minCardinality/2,
-        owl2_model:minCardinality/3.
-
-:- multifile init_test/2,ret_prob/3,end_test/1,one/2,zero/2,and/4,or/4,add_var/5,equality/4,remove/3.
-
-load_theory(Name):-
-  [Name].
-
-check_query_args([H|T]) :-
-  atomic(H),!,
-  get_trill_current_module(Name),
-  Name:axiom(A),
-  A =.. [_|L],
-  flatten(L,L1),
-  member(H,L1),!,
-  check_query_args(T).
-  
-check_query_args([H|T]) :-
-  \+ atomic(H),!,
-  H =.. [_|L],
-  flatten(L,L1),
-  check_query_args(L1),
-  check_query_args(T).
-
-check_query_args([]).
-
-/***********
-  Queries
-  - with and without explanations -
- ***********/
-sub_class(Class,SupClass,Expl):-
-  ( check_query_args([Class,SupClass]) ->
-	unsat(intersectionOf([Class,complementOf(SupClass)]),Expl)
-    ;
-    	Expl = ["IRIs not existent"],!
-  ).
-  %subClassOf(Class,SupClass).
-
-sub_class(Class,SupClass):-
-  check_query_args([Class,SupClass]),
-  unsat(intersectionOf([Class,complementOf(SupClass)])).
-
-instanceOf(Class,Ind,Expl):-
-  ( check_query_args([Class,Ind]) ->
-	retractall(exp_found(_)),
-  	retractall(ind(_)),
-  	assert(ind(1)),
-  	build_abox((ABox,Tabs)),
-  	\+ clash((ABox,Tabs),_),!,
-  	add(ABox,(classAssertion(complementOf(Class),Ind),[]),ABox0),
-  	%findall((ABox1,Tabs1),apply_rules_0((ABox0,Tabs),(ABox1,Tabs1)),L),
-  	findall((ABox1,Tabs1),apply_all_rules((ABox0,Tabs),(ABox1,Tabs1)),L),
-  	find_expls(L,Expl),
-  	Expl \= []
-    ;
-    	Expl = ["IRIs not existent"],!
-  ).
-
-instanceOf(_,_,['Inconsistent ABox']):-
-  write('Inconsistent ABox').
-
-instanceOf(Class,Ind):-
-  check_query_args([Class,Ind]),
-  retractall(ind(_)),
-  assert(ind(1)),
-  build_abox((ABox,Tabs)),
-  \+ clash((ABox,Tabs),_),!,
-  add(ABox,(classAssertion(complementOf(Class),Ind),[]),ABox0),
-  %findall((ABox1,Tabs1),apply_rules_0((ABox0,Tabs),(ABox1,Tabs1)),L),
-  apply_all_rules((ABox0,Tabs),(ABox1,Tabs1)),!,
-  clash((ABox1,Tabs1),_),!.
-
-%instanceOf(_,_):-
-%  write('Inconsistent ABox').
-
-unsat(Concept,Expl):-
-  retractall(exp_found(_)),
-  retractall(ind(_)),
-  assert(ind(2)),
-  build_abox((ABox,Tabs)),
-  \+ clash((ABox,Tabs),_),!,
-  add(ABox,(classAssertion(Concept,1),[]),ABox0),
-  %findall((ABox1,Tabs1),apply_rules_0((ABox0,Tabs),(ABox1,Tabs1)),L),
-  findall((ABox1,Tabs1),apply_all_rules((ABox0,Tabs),(ABox1,Tabs1)),L),
-  find_expls(L,Expl),
-  Expl \= [].
-
-unsat(_,['Inconsistent ABox']):-
-  write('Inconsistent ABox').
-
-unsat(Concept):-
-  retractall(ind(_)),
-  assert(ind(2)),
-  build_abox((ABox,Tabs)),
-  \+ clash((ABox,Tabs),_),!,
-  add(ABox,(classAssertion(Concept,1),[]),ABox0),
-  %findall((ABox1,Tabs1),apply_rules_0((ABox0,Tabs),(ABox1,Tabs1)),L),
-  apply_all_rules((ABox0,Tabs),(ABox1,Tabs1)),!,
-  clash((ABox1,Tabs1),_),!.
-
-%unsat(_):-
-%  write('Inconsistent ABox').
-
-inconsistent_theory(Expl):-
-  retractall(exp_found(_)),
-  retractall(ind(_)),
-  assert(ind(1)),
-  build_abox((ABox,Tabs)),
-  findall((ABox1,Tabs1),apply_all_rules((ABox,Tabs),(ABox1,Tabs1)),L),
-  find_expls(L,Expl),
-  Expl \= [].
-
-inconsistent_theory:-
-  retractall(ind(_)),
-  assert(ind(1)),
-  build_abox((ABox,Tabs)),
-  \+ clash((ABox,Tabs),_),!,
-  apply_all_rules((ABox,Tabs),(ABox1,Tabs1)),!,
-  clash((ABox1,Tabs1),_),!.
-
-%inconsistent_theory:-
-%  write('Inconsistent!').
-
-prob_instanceOf(Class,Ind,P):-
-  ( check_query_args([Class,Ind]) ->
-  	all_instanceOf(Class,Ind,Exps),
-%  (Exps \= [] ->
-%    build_formula(Exps,FormulaE,[],VarE),
-%    (FormulaE \= [] -> 
-%      var2numbers(VarE,0,NewVarE),
-%      write(NewVarE),nl,write(FormulaE),
-%      compute_prob(NewVarE,FormulaE,P,0)
-%    ;
-%      P = 1)
-%  ;
-%    P = 0).  
-%  writel(Exps),nl,
-  	compute_prob(Exps,P)
-  ;
-  	P = ["IRIs not existent"],!
-  ).
-
-prob_sub_class(Class,SupClass,P):-
-  ( check_query_args([Class,SupClass]) ->
-  	all_sub_class(Class,SupClass,Exps),
-%  (Exps \= [] ->
-%    build_formula(Exps,FormulaE,[],VarE),
-%    (FormulaE \= [] -> 
-%      var2numbers(VarE,0,NewVarE),
-%      compute_prob(NewVarE,FormulaE,P,0)
-%    ;
-%      P = 1)
-%  ;
-%    P = 0).
-  	compute_prob(Exps,P)
-  ;
-  	P = ["IRIs not existent"],!
-  ).
-  
-prob_unsat(Concept,P):-
-  all_unsat(Concept,Exps),
-  compute_prob(Exps,P).
-    
-prob_inconsistent_theory(P):-
-  all_inconsistent_theory(Exps),
-  compute_prob(Exps,P).
-
-find_expls([],[]).
-
-find_expls([ABox|_T],E):-
-  clash(ABox,E),
-  findall(Exp,exp_found(Exp),Expl),
-  not_already_found(Expl,E),
-  assert(exp_found(E)).
-
-find_expls([_ABox|T],Expl):-
-  \+ length(T,0),
-  find_expls(T,Expl).
-
-not_already_found([],_E):-!.
-
-not_already_found([H|_T],E):-
-  subset(H,E),!,
-  fail.
-  
-not_already_found([H|_T],E):-
-  subset(E,H),!,
-  retract(exp_found(H)).
-
-not_already_found([_H|T],E):-
-  not_already_found(T,E).
-
-
-all_sub_class(Class,SupClass,LE):-
-  all_unsat(intersectionOf([Class,complementOf(SupClass)]),LE).
-
-all_instanceOf(Class,Ind,LE):-
-  findall(Expl,instanceOf(Class,Ind,Expl),LE).
-
-all_unsat(Concept,LE):-
-  findall(Expl,unsat(Concept,Expl),LE).
-  
-
-all_inconsistent_theory(LE):-
-  findall(Expl,inconsistent_theory(Expl),LE).
-
-
-/*
-find_clash((ABox0,Tabs0),Expl2):-
-  apply_rules((ABox0,Tabs0),(ABox,Tabs)),
-  clash((ABox,Tabs),Expl).
-*/
-
-%-------------
-% clash managing
-% previous version, manages only one clash at time
-% need some tricks in some rules for managing the cases of more than one clash
-% TO IMPROVE!
-%------------
-clash((ABox,_),Expl):-
-  %write('clash 1'),nl,
-  find((classAssertion(C,Ind),Expl1),ABox),
-  find((classAssertion(complementOf(C),Ind),Expl2),ABox),
-  append(Expl1,Expl2,Expl).
-
-clash((ABox,_),Expl):-
-  %write('clash 2'),nl,
-  find((sameIndividual(LS),Expl1),ABox),
-  find((differentIndividuals(LD),Expl2),ABox),
-  member(X,LS),
-  member(Y,LS),
-  member(X,LD),
-  member(Y,LD),
-  dif(X,Y),
-  append(Expl1,Expl2,Expl).
-
-clash((ABox,_),Expl):-
-  %write('clash 3'),nl,
-  find((classAssertion(C,sameIndividual(L1)),Expl1),ABox),
-  find((classAssertion(complementOf(C),sameIndividual(L2)),Expl2),ABox),
-  member(X,L1),
-  member(X,L2),!,
-  append(Expl1,Expl2,Expl).
-
-clash((ABox,_),Expl):-
-  %write('clash 4'),nl,
-  find((classAssertion(C,Ind1),Expl1),ABox),
-  find((classAssertion(complementOf(C),sameIndividual(L2)),Expl2),ABox),
-  member(Ind1,L2),
-  append(Expl1,Expl2,Expl).
-
-clash((ABox,_),Expl):-
-  %write('clash 5'),nl,
-  find((classAssertion(C,sameIndividual(L1)),Expl1),ABox),
-  find((classAssertion(complementOf(C),Ind2),Expl2),ABox),
-  member(Ind2,L1),
-  append(Expl1,Expl2,Expl).
-
-clash((ABox,Tabs),Expl):-
-  %write('clash 6'),nl,
-  find((classAssertion(maxCardinality(N,S,C),Ind),Expl1),ABox),
-  s_neighbours(Ind,S,(ABox,Tabs),SN),
-  individual_class_C(SN,C,ABox,SNC),
-  length(SNC,LSS),
-  LSS @> N,
-  make_expl(Ind,S,SNC,Expl1,ABox,Expl2),
-  flatten(Expl2,Expl3),
-  list_to_set(Expl3,Expl).
-
-clash((ABox,Tabs),Expl):-
-  %write('clash 7'),nl,
-  find((classAssertion(maxCardinality(N,S),Ind),Expl1),ABox),
-  s_neighbours(Ind,S,(ABox,Tabs),SN),
-  length(SN,LSS),
-  LSS @> N,
-  make_expl(Ind,S,SN,Expl1,ABox,Expl2),
-  flatten(Expl2,Expl3),
-  list_to_set(Expl3,Expl).
-
-% --------------
-make_expl(_,_,[],Expl1,_,Expl1).
-
-make_expl(Ind,S,[H|T],Expl1,ABox,[Expl2|Expl]):-
-  find((propertyAssertion(S,Ind,H),Expl2),ABox),
-  make_expl(Ind,S,T,Expl1,ABox,Expl).
-
-
-% -------------
-% rules application
-% -------------
-apply_all_rules(ABox0,ABox):-
-  apply_det_rules([o_rule,and_rule,unfold_rule,add_exists_rule,forall_rule,forall_plus_rule,exists_rule,min_rule],ABox0,ABox1),
-  (ABox0=ABox1 -> 
-  ABox=ABox1;
-  apply_all_rules(ABox1,ABox)).
-  
-apply_det_rules([],ABox0,ABox):-
-  apply_nondet_rules([or_rule,max_rule],ABox0,ABox).
-  
-apply_det_rules([H|_],ABox0,ABox):-
-  %C=..[H,ABox,ABox1],
-  call(H,ABox0,ABox),!.
-
-apply_det_rules([_|T],ABox0,ABox):-
-  apply_det_rules(T,ABox0,ABox).
-
-
-apply_nondet_rules([],ABox,ABox).
-
-apply_nondet_rules([H|_],ABox0,ABox):-
-  %C=..[H,ABox,L],
-  call(H,ABox0,L),!,
-  member(ABox,L),
-  dif(ABox0,ABox).
-
-apply_nondet_rules([_|T],ABox0,ABox):-
-  apply_nondet_rules(T,ABox0,ABox).
-  
-
-
-/*
-  add_exists_rule
-  ========================
-*/
-add_exists_rule((ABox,Tabs),([(classAssertion(someValuesFrom(R,C),Ind1),Expl)|ABox],Tabs)):-
-  find((propertyAssertion(R,Ind1,Ind2),Expl1),ABox),
-  find((classAssertion(C,Ind2),Expl2),ABox),
-  existsInKB(R,C),
-  append(Expl1,Expl2,ExplT),
-  list_to_set(ExplT,Expl),
-  absent(classAssertion(someValuesFrom(R,C),Ind1),Expl,(ABox,Tabs)).
-  
-existsInKB(R,C):-
-  get_trill_current_module(Name),
-  Name:subClassOf(A,B),
-  member(someValuesFrom(R,C),[A,B]).
-  
-existsInKB(R,C):-
-  get_trill_current_module(Name),
-  Name:equivalentClasses(L),
-  member(someValuesFrom(R,C),L).
-/* *************** */ 
-
-/*
-  and_rule
-  =================
-*/
-and_rule((ABox0,Tabs0),(ABox,Tabs0)):-
-  find((classAssertion(intersectionOf(LC),Ind),Expl),ABox0),
-  \+ indirectly_blocked(Ind,(ABox0,Tabs0)),
-  scan_and_list(LC,Ind,Expl,ABox0,Tabs0,ABox,0).
-  
-
-%----------------
-scan_and_list([],_Ind,_Expl,ABox,_Tabs,ABox,Mod):-
-  Mod\=0.
-
-scan_and_list([C|T],Ind,Expl,ABox0, Tabs0,[(classAssertion(C,Ind),Expl)|ABox],_Mod):-
-  absent(classAssertion(C,Ind),Expl,(ABox0,Tabs0)),!,
-  scan_and_list(T,Ind,Expl,ABox0, Tabs0, ABox,1).
-
-scan_and_list([_C|T],Ind,Expl,ABox0,Tabs0,ABox,Mod):-
-  scan_and_list(T,Ind,Expl,ABox0, Tabs0, ABox,Mod).
-/* ************* */
-
-/*
-  or_rule
-  ===============
-*/
-or_rule((ABox0,Tabs0),L):-
-  find((classAssertion(unionOf(LC),Ind),Expl),ABox0),
-  \+ indirectly_blocked(Ind,(ABox0,Tabs0)),
-  length(LC,NClasses),
-  findall((ABox1,Tabs0),scan_or_list(LC,NClasses,Ind,Expl,ABox0,Tabs0, ABox1),L),
-  L\=[],!.
-
-%---------------
-scan_or_list([C],1,Ind,Expl,ABox, Tabs, [(classAssertion(C,Ind),Expl)|ABox]):-
-  absent(classAssertion(C,Ind),Expl,(ABox,Tabs)),!.
-
-scan_or_list([C|_T],_NClasses,Ind,Expl,ABox, Tabs, [(classAssertion(C,Ind),Expl)|ABox]):-
-  absent(classAssertion(C,Ind),Expl,(ABox,Tabs)).
-
-scan_or_list([_C|T],NClasses,Ind,Expl,ABox0,Tabs, ABox):-
-  NC is NClasses - 1,
-  scan_or_list(T,NC,Ind,Expl,ABox0, Tabs,ABox).
-/* ***************+ */
-
-/*
-  exists_rule
-  ==================
-*/
-exists_rule((ABox0,Tabs0),([(propertyAssertion(R,Ind1,Ind2),Expl),
-    (classAssertion(C,Ind2),Expl)|ABox0],Tabs)):-
-  find((classAssertion(someValuesFrom(R,C),Ind1),Expl),ABox0),
-  \+ blocked(Ind1,(ABox0,Tabs0)),
-  \+ connected_individual(R,C,Ind1,ABox0),
-  new_ind(Ind2),
-  add_edge(R,Ind1,Ind2,Tabs0,Tabs).
-  
-
-%---------------
-connected_individual(R,C,Ind1,ABox):-
-  find((propertyAssertion(R,Ind1,Ind2),_Expl1),ABox),
-  find((classAssertion(C,Ind2),_Expl2),ABox).
-  
-/* ************ */
-
-/*
-  forall_rule
-  ===================
-*/
-forall_rule((ABox,Tabs),([(classAssertion(C,Ind2),Expl)|ABox],Tabs)):-
-  find((classAssertion(allValuesFrom(R,C),Ind1),Expl1),ABox),
-  \+ indirectly_blocked(Ind1,(ABox,Tabs)),
-  find((propertyAssertion(R,Ind1,Ind2),Expl2),ABox),
-  append(Expl1,Expl2,ExplT),
-  list_to_set(ExplT,Expl), %list_to_set(ExplT,ExplT1),
-  %check_chain(R,Ind1,Ind2,ExplT1,ExplT1,Expl),
-  absent(classAssertion(C,Ind2),Expl,(ABox,Tabs)).
-  
-%------------------
-check_chain(_,_,_,[],Ne,Ne):-
-  !.
-
-check_chain(R,Ind1,Ind2,[subPropertyOf(R,S,Ind3,Ind1)|T],Ne,Ne4):-
-  is_transitive(R,S,Ne),
-  copy_s(subPropertyOf(R,S,Ind3,Ind1),subPropertyOf(R,S,Ind3,Ind2),Ne,Ne2),
-  check_chain(R,Ind1,Ind2,T,Ne2,Ne3),!,
-  check_chain(S,Ind3,Ind2,Ne3,Ne3,Ne4).
-
-check_chain(R,Ind1,Ind2,[transitive(R,[Ind3,Ind1])|T],Ne,Ne3):-
-  copy_s(transitive(R,[Ind3,Ind1]),transitive(R,[Ind3,Ind1,Ind2]),Ne,Ne2),
-  check_chain(R,Ind1,Ind2,T,Ne2,Ne3),!.
-
-check_chain(R,Ind1,Ind2,[transitive(R,[Ind3,Ind4,Ind1])|T],Ne,Ne3):-
-  copy_s(transitive(R,[Ind3,Ind4,Ind1]),transitive(R,[Ind3,Ind4,Ind2]),Ne,Ne2),
-  check_chain(R,Ind1,Ind2,T,Ne2,Ne3),!.
-
-check_chain(R,Ind1,Ind2,[_H|T],Ne,Ne1):-
-  check_chain(R,Ind1,Ind2,T,Ne,Ne1),!.
-
-% ------------------
-is_transitive(R,_S,Ne):-
-  %member(transitive(R,_),Ne),!.
-  member(transitive(R),Ne),!.
-
-is_transitive(_R,S,Ne):-
-  %member(transitive(S,_),Ne),!.
-  member(transitive(S),Ne),!.
-% ------------------
-copy_s(_,_,[],[]).
-
-copy_s(AxO,AxN,[AxO|T],[AxN|T1]):-
-  copy_s(AxO,AxN,T,T1).
-
-copy_s(AxO,AxN,[H|T],[H|T1]):-
-  copy_s(AxO,AxN,T,T1).
-/* ************** */
-
-/*
-  forall_plus_rule
-  =================
-*/
-forall_plus_rule((ABox,Tabs),([(classAssertion(allValuesFrom(R,C),Ind2),Expl)| ABox],Tabs)):-
-  find((classAssertion(allValuesFrom(S,C),Ind1),Expl1),ABox),
-  \+ indirectly_blocked(Ind1,(ABox,Tabs)),
-  find((propertyAssertion(R,Ind1,Ind2),Expl2),ABox),
-  find_sub_sup_trans_role(R,S,Ind1,Ind2,Expl3),
-  append(Expl1,Expl2,ExplT),
-  append(ExplT,Expl3,ExplT1),
-  list_to_set(ExplT1,Expl),
-  absent(classAssertion(allValuesFrom(R,C),Ind2),Expl,(ABox,Tabs)).
-  
-% --------------
-find_sub_sup_trans_role(R,S,_Ind1,_Ind2,[subPropertyOf(R,S),transitive(R)]):-
-  get_trill_current_module(Name),
-  Name:subPropertyOf(R,S),
-  Name:transitiveProperty(R).
-
-find_sub_sup_trans_role(R,S,_Ind1,_Ind2,[subPropertyOf(R,S)]):-
-  get_trill_current_module(Name),
-  Name:subPropertyOf(R,S),
-  \+ Name:transitiveProperty(R).
-/* ************ */
-
-/*
-  unfold_rule
-  ===========
-*/
-unfold_rule((ABox0,Tabs),([(classAssertion(D,Ind),[Ax|Expl])|ABox],Tabs)):-
-  find((classAssertion(C,Ind),Expl),ABox0),
-  find_sub_sup_class(C,D,Ax),
-  absent(classAssertion(D,Ind),[Ax|Expl],(ABox0,Tabs)),
-  add_nominal(D,Ind,ABox0,ABox).
-
-/* -- unfold_rule
-      takes a class C1 in which Ind belongs, find a not atomic class C
-      that contains C1 (C is seen as list of classes), controls if
-      the individual Ind belongs to all those classes, if yes find a class D (if exists)
-      that is the superclass or an equivalent class of C and adds D to label af Ind
-      - for managing tableau with more than one clash -
-   --
-*/
-unfold_rule((ABox0,Tabs),([(classAssertion(D,Ind),[Ax|Expl1])|ABox],Tabs)):-
-  find((classAssertion(C1,Ind),_Expl),ABox0),
-  find_not_atomic(C1,C,L),
-  find_all(Ind,L,ABox0,Expl1),
-  find_sub_sup_class(C,D,Ax),
-  absent(classAssertion(D,Ind),[Ax|Expl1],(ABox0,Tabs)),
-  add_nominal(D,Ind,ABox0,ABox).
-
-/* -- unfold_rule
- *    control propertyRange e propertyDomain
- * --
- */
-unfold_rule((ABox0,Tabs),([(classAssertion(D,Ind),Expl)|ABox],Tabs)):-
-  find_class_prop_range_domain(Ind,D,Expl,(ABox0,Tabs)),
-  absent(classAssertion(D,Ind),Expl,(ABox0,Tabs)),
-  add_nominal(D,Ind,ABox0,ABox).
- 
-/*
- * -- unfold_rule
- *    manage the negation
- * --
- */
-unfold_rule((ABox0,Tabs),([(classAssertion(D,Ind),[complementOf(C)|Expl])|ABox],Tabs)):-
-  find((classAssertion(complementOf(C),Ind),Expl),ABox0),
-  find_neg_class(C,D),
-  absent(classAssertion(D,Ind),[complementOf(C)|Expl],(ABox0,Tabs)),
-  add_nominal(D,Ind,ABox0,ABox).
-  
-% ----------------
-% add_nominal
-
-add_nominal(D,Ind,ABox0,ABox):-
-  ((D = oneOf(_),
-    \+ member(nominal(Ind),ABox0))
-    *->
-   (
-      ABox1 = [nominal(Ind)|ABox0],
-      (member((classAssertion('Thing',Ind),_E),ABox1)
-      ->
-      ABox = ABox1
-      ;
-      ABox = [(classAssertion('Thing',Ind),[])|ABox1]
-      )
-    )
-    ;
-   ABox = ABox0
-  ).
-    
-% ----------------
-% unionOf, intersectionOf, subClassOf, negation, allValuesFrom, someValuesFrom, exactCardinality(min and max), maxCardinality, minCardinality
-
-find_neg_class(unionOf(L),intersectionOf(NL)):-
-  neg_list(L,NL).
-
-find_neg_class(intersectionOf(L),unionOf(NL)):-
-  neg_list(L,NL).
-
-find_neg_class(subClassOf(C,D),intersectionOf(C,ND)):-
-  neg_class(D,ND).
-
-find_neg_class(complementOf(C),C).
-
-find_neg_class(allValuesFrom(R,C),someValuesFrom(R,NC)):-
-  neg_class(C,NC).
-
-find_neg_class(someValuesFrom(R,C),allValuesFrom(R,NC)):-
-  neg_class(C,NC).
-
-find_neg_class(exactCardinality(N,R,C),unionOf([maxCardinality(NMax,R,C),minCardinality(NMin,R,C)])):-
-  NMax is N - 1,
-  NMin is N + 1.
-
-find_neg_class(minCardinality(N,R,C),maxCardinality(NMax,R,C)):-
-  NMax is N - 1.
-
-find_neg_class(maxCardinality(N,R,C),minCardinality(NMin,R,C)):-
-  NMin is N + 1.
-
-% ---------------
-
-neg_class(complementOf(C),C):- !.
-
-neg_class(C,complementOf(C)).
-
-% ---------------
-
-neg_list([],[]).
-
-neg_list([H|T],[complementOf(H)|T1]):-
-  neg_list(T,T1).
-
-neg_list([complementOf(H)|T],[H|T1]):-
-  neg_list(T,T1).
-
-% ----------------
-
-find_class_prop_range_domain(Ind,D,[propertyRange(R,D)|ExplPA],(ABox,_Tabs)):-
-  find((propertyAssertion(R,_,IndL),ExplPA),ABox),
-  indAsList(IndL,L),
-  member(Ind,L),
-  get_trill_current_module(Name),
-  Name:propertyRange(R,D).
-
-find_class_prop_range_domain(Ind,D,[propertyDomain(R,D)|ExplPA],(ABox,_Tabs)):-
-  find((propertyAssertion(R,IndL,_),ExplPA),ABox),
-  indAsList(IndL,L),
-  member(Ind,L),
-  get_trill_current_module(Name),
-  Name:propertyDomain(R,D).
-	
-
-%-----------------
-find_sub_sup_class(C,D,subClassOf(C,D)):-
-  get_trill_current_module(Name),
-  Name:subClassOf(C,D).
-
-find_sub_sup_class(C,D,equivalentClasses(L)):-
-  get_trill_current_module(Name),
-  Name:equivalentClasses(L),
-  member(C,L),
-  member(D,L),
-  dif(C,D).
-  
-/*******************
- managing the concept (C subclassOf Thing)
- this implementation doesn't work well in a little set of cases
- TO FIX!
- *******************
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  subClassOf(A,B),
-  member(C,[A,B]),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  classAssertion(C,_),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(C,L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  unionOf(L),
-  member(C,L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(someValuesFrom(_,C),L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(allValuesFrom(_,C),L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(minCardinality(_,_,C),L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(maxCardinality(_,_,C),L),!.
-
-find_sub_sup_class(C,'Thing',subClassOf(C,'Thing')):-
-  equivalentClasses(L),
-  member(exactCardinality(_,_,C),L),!.
-
-*/
-
-%--------------------
-
-find_not_atomic(C,intersectionOf(L1),L1):-
-  get_trill_current_module(Name),
-  Name:subClassOf(A,B),
-  member(intersectionOf(L1),[A,B]),
-  member(C,L1).
-
-find_not_atomic(C,unionOf(L1),L1):-
-  get_trill_current_module(Name),
-  Name:subClassOf(A,B),
-  member(unionOf(L1),[A,B]),
-  member(C,L1).
-
-find_not_atomic(C,intersectionOf(L),L):-
-  get_trill_current_module(Name),
-  Name:intersectionOf(L),
-  member(C,L).
-
-find_not_atomic(C,unionOf(L),L):-
-  get_trill_current_module(Name),
-  Name:unionOf(L),
-  member(C,L).
-
-find_not_atomic(C,intersectionOf(L1),L1):-
-  get_trill_current_module(Name),
-  Name:equivalentClasses(L),
-  member(intersectionOf(L1),L),
-  member(C,L1).
-
-find_not_atomic(C,unionOf(L1),L1):-
-  get_trill_current_module(Name),
-  Name:equivalentClasses(L),
-  member(unionOf(L1),L),
-  member(C,L1).
-
-% -----------------------
-find_all(_,[],_,[]).
-  
-find_all(Ind,[H|T],ABox,ExplT):-
-  find((classAssertion(H,Ind),Expl1),ABox),
-  find_all(Ind,T,ABox,Expl),
-  append(Expl,Expl1,Expl2),
-  list_to_set(Expl2,ExplT).
-
-
-/* ************* */
-
-/*
-  ce_rule
-  =============
-*/
-ce_rule((ABox0,(T,RBN,RBR)),(ABox,(T,RBN,RBR))):-
-  find_not_sub_sup_class(Ax,UnAx),
-  vertices(T,Inds),
-  apply_ce_to(Inds,Ax,UnAx,ABox0,ABox,(T,RBN,RBR),C),
-  C @> 0.
-  
-
-% ------------------
-find_not_sub_sup_class(subClassOf(C,D),unionOf(complementOf(C),D)):-
-  get_trill_current_module(Name),
-  Name:subClassOf(C,D),
-  \+ atomic(C).
-
-
-find_not_sub_sup_class(equivalentClasses(L),unionOf(L1)):-
-  get_trill_current_module(Name),
-  Name:equivalentClasses(L),
-  member(C,L),
-  \+ atomic(C),
-  copy_neg_c(C,L,L1).
-
-%-------------------------
-copy_neg_c(_,[],[]).
-
-copy_neg_c(C,[C|T],[complementOf(C)|T1]):-
-  !,
-  copy_neg_c(C,T,T1).
-
-copy_neg_c(C,[H|T],[H|T1]):-
-  copy_neg_c(C,T,T1).
-
-%---------------------
-apply_ce_to([],_,_,ABox,ABox,_,0).
-
-apply_ce_to([Ind|T],Ax,UnAx,ABox0,[(classAssertion(UnAx,Ind),[Ax])|ABox],Tabs,C):-
-  \+ indirectly_blocked(Ind,(ABox0,Tabs)),
-  absent(classAssertion(UnAx,Ind),[Ax],(ABox0,Tabs)),!,
-  apply_ce_to(T,Ax,UnAx,ABox0,ABox,Tabs,C0),
-  C is C0 + 1.
-  
-apply_ce_to([_Ind|T],Ax,UnAx,ABox0,ABox,Tabs,C):-
-  apply_ce_to(T,Ax,UnAx,ABox0,ABox,Tabs,C).
-
-/* **************** */
-
-/*
-  min_rule
-  =============
-*/
-min_rule((ABox,Tabs),([(differentIndividuals(NI),Expl)|ABox1],Tabs1)):-
-  find((classAssertion(minCardinality(N,S),Ind1),Expl),ABox),
-  \+ blocked(Ind1,(ABox,Tabs)),
-  s_neighbours(Ind1,S,(ABox,Tabs),SN),
-  safe_s_neigh(SN,S,(ABox,Tabs),SS),
-  length(SS,LSS),
-  LSS @< N,
-  NoI is N-LSS,
-  min_rule_neigh(NoI,S,Ind1,Expl,NI,ABox,Tabs,ABox1,Tabs1).
-  
-
-min_rule((ABox,Tabs),([(differentIndividuals(NI),Expl)|ABox1],Tabs1)):-
-  find((classAssertion(minCardinality(N,S,C),Ind1),Expl),ABox),
-  \+ blocked(Ind1,(ABox,Tabs)),
-  s_neighbours(Ind1,S,(ABox,Tabs),SN),
-  safe_s_neigh(SN,S,(ABox,Tabs),SS),
-  length(SS,LSS),
-  LSS @< N,
-  NoI is N-LSS,
-  min_rule_neigh_C(NoI,S,C,Ind1,Expl,NI,ABox,Tabs,ABox1,Tabs1).
-
-% ----------------------
-min_rule_neigh(0,_,_,_,[],ABox,Tabs,ABox,Tabs).
-  
-min_rule_neigh(N,S,Ind1,Expl,[Ind2|NI],ABox,Tabs,[(propertyAssertion(S,Ind1,Ind2),Expl)|ABox2],Tabs2):-
-  N > 0,
-  NoI is N-1,
-  new_ind(Ind2),
-  add_edge(S,Ind1,Ind2,Tabs,Tabs1),
-  check_block(Ind2,([(propertyAssertion(S,Ind1,Ind2),Expl)|ABox],Tabs)),
-  min_rule_neigh(NoI,S,Ind1,Expl,NI,ABox,Tabs1,ABox2,Tabs2).
-  
-%----------------------
-min_rule_neigh_C(0,_,_,_,_,[],ABox,Tabs,ABox,Tabs).
-  
-min_rule_neigh_C(N,S,C,Ind1,Expl,[Ind2|NI],ABox,Tabs,[(propertyAssertion(S,Ind1,Ind2),Expl),
-                                          (classAssertion(C,Ind2),[propertyAssertion(S,Ind1,Ind2)|Expl])|ABox2],Tabs2):-
-  N > 0,
-  NoI is N-1,
-  new_ind(Ind2),
-  add_edge(S,Ind1,Ind2,Tabs,Tabs1),
-  check_block(Ind2,([(propertyAssertion(S,Ind1,Ind2),Expl)|ABox],Tabs)),
-  min_rule_neigh_C(NoI,S,C,Ind1,Expl,NI,ABox,Tabs1,ABox2,Tabs2).
-  
-%---------------------
-safe_s_neigh([],_,_,[]).
-
-safe_s_neigh([H|T],S,Tabs,[H|ST]):-
-  safe(H,S,Tabs),
-  safe_s_neigh(T,S,Tabs,ST).
-/* **************** */
-
-/*
-  max_rule
-  ================
-*/
-max_rule((ABox0,Tabs0),L):-
-  find((classAssertion(maxCardinality(N,S,C),Ind),Expl),ABox0),
-  \+ indirectly_blocked(Ind,(ABox0,Tabs0)),
-  s_neighbours(Ind,S,(ABox0,Tabs0),SN),
-  individual_class_C(SN,C,ABox0,SNC),
-  length(SNC,LSS),
-  LSS @> N,
-  findall((ABox1,Tabs1),scan_max_list(S,SNC,Ind,Expl,ABox0,Tabs0, ABox1,Tabs1),L),
-  L\=[],
-  !.
-
-max_rule((ABox0,Tabs0),L):-
-  find((classAssertion(maxCardinality(N,S),Ind),Expl),ABox0),
-  \+ indirectly_blocked(Ind,(ABox0,Tabs0)),
-  s_neighbours(Ind,S,(ABox0,Tabs0),SN),
-  length(SN,LSS),
-  LSS @> N,
-  findall((ABox1,Tabs1),scan_max_list(S,SN,Ind,Expl,ABox0,Tabs0, ABox1,Tabs1),L),
-  L\=[],
-  !.
-%---------------------
-
-scan_max_list(S,SN,Ind,Expl,ABox0,Tabs0,ABox,Tabs):-
-  member(YI,SN),
-  member(YJ,SN),
-  check_individuals_not_equal(YI,YJ,ABox0),
-  find((propertyAssertion(S,Ind,YI),ExplYI),ABox0),
-  find((propertyAssertion(S,Ind,YJ),ExplYJ),ABox0),
-  append(ExplYI,ExplYJ,Expl0),
-  append(Expl,Expl0,ExplT),
-  merge_all([(sameIndividual([YI,YJ]),ExplT)],ABox0,Tabs0,ABox,Tabs).
-
-%--------------------
-check_individuals_not_equal(X,Y,ABox):-
-  dif(X,Y),
-  \+ same_ind([X],Y,ABox).
-%--------------------
-individual_class_C([],_,_,[]).
-
-individual_class_C([H|T],C,ABox,[H|T1]):-
-  find((classAssertion(C,H),_),ABox),
-  individual_class_C(T,C,ABox,T1).
-
-individual_class_C([H|T],C,ABox,T1):-
-  \+ find((classAssertion(C,H),_),ABox),
-  individual_class_C(T,C,ABox,T1).
-/* *************** */
-
-/*
- o_rule
- ============
-*/
-
-o_rule((ABox0,Tabs0),([(sameIndividual(LI),ExplC)|ABox],Tabs)):-
-  find((classAssertion(oneOf([C]),X),ExplX),ABox0),
-  find((classAssertion(oneOf([D]),Y),ExplY),ABox0),
-  containsCommon(C,D),
-  dif(X,Y),
-  notDifferentIndividuals(X,Y,ABox0),
-  nominal(C,(ABox0,Tabs0)),
-  indAsList(X,LX),
-  indAsList(Y,LY),
-  append(ExplX,ExplY,ExplC),
-  merge(X,Y,(ABox0,Tabs0),(ABox,Tabs)),
-  flatten([LX,LY],LI0),
-  list_to_set(LI0,LI),
-  absent(sameIndividual(LI),ExplC,(ABox0,Tabs0)).
-  
-containsCommon(L1,L2):-
-  member(X,L1),
-  member(X,L2),!.
-% -------------------
-
-indAsList(sameIndividual(L),L):- 
-  retract_sameIndividual(L),!.
-
-indAsList(X,[X]):-
-  atomic(X).
-
-% -------------------
-notDifferentIndividuals(X,Y,ABox):-
-  \+ inAssertDifferentIndividuals(X,Y),
-  \+ inABoxDifferentIndividuals(X,Y,ABox).
-
-% --------------
-
-inAssertDifferentIndividuals(differentIndividuals(X),differentIndividuals(Y)):-
-  !,
-  get_trill_current_module(Name),
-  Name:differentIndividuals(LI),
-  member(X0,X),
-  member(X0,LI),
-  member(Y0,Y),
-  member(Y0,LI).
-
-inAssertDifferentIndividuals(X,sameIndividual(Y)):-
-  !,
-  get_trill_current_module(Name),
-  Name:differentIndividuals(LI),
-  member(X,LI),
-  member(Y0,Y),
-  member(Y0,LI).
-
-inAssertDifferentIndividuals(sameIndividual(X),Y):-
-  !,
-  get_trill_current_module(Name),
-  Name:differentIndividuals(LI),
-  member(X0,X),
-  member(X0,LI),
-  member(Y,LI).
-
-inAssertDifferentIndividuals(X,Y):-
-  get_trill_current_module(Name),
-  Name:differentIndividuals(LI),
-  member(X,LI),
-  member(Y,LI).
-
-% ------------------
-
-inABoxDifferentIndividuals(sameIndividual(X),sameIndividual(Y),ABox):-
-  !,
-  find((differentIndividuals(LI),_),ABox),
-  member(X0,X),
-  member(X0,LI),
-  member(Y0,Y),
-  member(Y0,LI).
-
-inABoxDifferentIndividuals(X,sameIndividual(Y),ABox):-
-  !,
-  find((differentIndividuals(LI),_),ABox),
-  member(X,LI),
-  member(Y0,Y),
-  member(Y0,LI).
-
-inABoxDifferentIndividuals(sameIndividual(X),Y,ABox):-
-  !,
-  find((differentIndividuals(LI),_),ABox),
-  member(X0,X),
-  member(X0,LI),
-  member(Y,LI).
-
-inABoxDifferentIndividuals(X,Y,ABox):-
-  find((differentIndividuals(LI),_),ABox),
-  member(X,LI),
-  member(Y,LI).
-				        
-% --------------------
-
-listIntersection([],_,[]).
-
-listIntersection([HX|TX],LCY,TI):-
-  \+ member(HX,LCY),
-  listIntersection(TX,LCY,TI).
-
-listIntersection([HX|TX],LCY,[HX|TI]):-
-  member(HX,LCY),
-  listIntersection(TX,LCY,TI).
-
-% ---------------
-
-findExplForClassOf(LC,LI,ABox0,Expl):-
-  member(C,LC),
-  member(I,LI),
-  member((classAssertion(C,I),Expl),ABox0).
-
-/* ************ */
-
-
-/*  absent
-  =========
-*/
-absent(classAssertion(C,Ind),Expl,(ABox,_Tabs)):-
-  \+ absent1(classAssertion(C,Ind),Expl,ABox),!.
-
-absent(sameIndividual(L),Expl,(ABox,_Tabs)):-
-  \+ absent1(sameIndividual(L),Expl,ABox),!.
-
-
-%------------------
-absent1(Ax,Expl,ABox):-
-  find((Ax,Expl0),ABox),
-  subset(Expl0,Expl),!.
-
-absent1(sameIndividual(L),Expl,ABox):-
-  find((sameIndividual(LF),Expl0),ABox),
-  permutation(L,LF),
-  subset(Expl0,Expl),!.
-
-/* **************** */
-
-/*
- * nominal/2, blockable/2, blocked/2, indirectly_blocked/2 and safe/3
- *
- */
-
-nominal(Inds,(ABox,_)):-
-  find((nominal(Ind)),ABox),
-  member(Ind,Inds).
-
-% ----------------
-
-blockable(Ind,(ABox,_)):-
-  ( find((nominal(Ind)),ABox)
-    ->
-    false
-    ;
-    true ).
-
-% ---------------
-
-blocked(Ind,(ABox,T)):-
-  check_block(Ind,(ABox,T)).
-
-/*
-
-  control for block an individual
-  
-*/
-
-check_block(Ind,(ABox,(T,RBN,RBR))):-
-  blockable(Ind,(ABox,(T,RBN,RBR))),
-  transpose_ugraph(T,T1),
-  ancestor(Ind,T,A),
-  neighbours(Ind,T1,N),
-  check_block1(Ind,A,N,(ABox,(T1,RBN,RBR))),!.
-  
-check_block(Ind,(ABox,(T,RBN,RBR))):-
-  blockable(Ind,(ABox,(T,RBN,RBR))),
-  transpose_ugraph(T,T1),
-  neighbours(Ind,T1,N),
-  check_block2(N,(ABox,(T,RBN,RBR))),!.
-  
-
-check_block1(Indx,A,N,(ABox,(T,RBN,RBR))):-
-  member(Indx0,N),
-  member(Indy,A),
-  member(Indy0,A),
-  neighbours(Indy,T,N2),
-  member(Indy0,N2),
-  rb_lookup((Indx0,Indx),V,RBN),
-  rb_lookup((Indy0,Indy),V2,RBN),
-  member(R,V),
-  member(R,V2),
-  same_label(Indx,Indy0,ABox),
-  same_label(Indx0,Indy,ABox),
-  all_node_blockable(Indx0,Indy0,(ABox,(T,RBN,RBR))),!.
-
-check_block2([],_).
-
-check_block2([H|Tail],(ABox,(T,RBN,RBR))):-
-  blocked(H,(ABox,(T,RBN,RBR))),
-  check_block2(Tail,(ABox,(T,RBN,RBR))).
-
-%---------------
-indirectly_blocked(Ind,(ABox,(T,RBN,RBR))):-
-  transpose_ugraph(T,T1),
-  neighbours(Ind,T1,N),
-  member(A,N),
-  blocked(A,(ABox,(T,RBN,RBR))),!.
-  
-%---------------------
-/*
-  An R-neighbour y of a node x is safe if
-  (i)  x is blockable or
-  (ii) x is a nominal node and y is not blocked.
-*/
-
-safe(Ind,R,(ABox,(T,RBN,RBR))):-
-  rb_lookup(R,V,RBR),
-  member((X,Ind),V),
-  blockable(X,(ABox,(T,RBN,RBR))),!.
-  
-safe(Ind,R,(ABox,(T,RBN,RBR))):-
-  rb_lookup(R,V,RBR),
-  member((X,Ind),V),
-  nominal(X,(ABox,(T,RBN,RBR))),!,
-  \+ blocked(Ind,(ABox,(T,RBN,RBR))).
-
-/* ***** */
-
-/*
- subset
- check if L is subset of L1
- =================
-
-subset([],_).
-
-subset([H|T],L):-
-  member(H,L),
-  subset(T,L).
-*/
-
-/*
- writel
- write a list one element at each line
- ==========
-*/
-writel([]):-!.
-
-writel([T|C]):-
-  write(T),nl,
-  writel(C).
-
-/*
- writeABox
- ==========
-*/
-writeABox((ABox,_)):-
-  writel(ABox).
-
-
-/*
-  build_abox
-  ===============
-*/        
-
-/*build_abox(ABox):-
-  findall((classAssertion(Class,Individual),[classAssertion(Class,Individual)]),classAssertion(Class,Individual),LCA),
-  findall((propertyAssertion(Property,Subject, Object),[propertyAssertion(Property,Subject, Object)]),propertyAssertion(Property,Subject, Object),LPA),
-  findall((propertyAssertion(Property,Subject,Object),[subPropertyOf(SubProperty,Property,Subject,Object),propertyAssertion(SubProperty,Subject,Object)]),subPropertyOf(SubProperty,Property),LSPA),
-  new_abox(ABox0),
-  add_all(LCA,ABox0,ABox1),
-  add_all(LPA,ABox1,ABox2),
-  add_all(LSPA,ABox2,ABox).
-*/
-
-build_abox((ABox,Tabs)):-
-  get_trill_current_module(Name),
-  findall((classAssertion(Class,Individual),[classAssertion(Class,Individual)]),Name:classAssertion(Class,Individual),LCA),
-  findall((propertyAssertion(Property,Subject, Object),[propertyAssertion(Property,Subject, Object)]),Name:propertyAssertion(Property,Subject, Object),LPA),
-  findall((propertyAssertion(Property,Subject,Object),[subPropertyOf(SubProperty,Property),propertyAssertion(SubProperty,Subject,Object)]),subProp(Name,SubProperty,Property,Subject,Object),LSPA),
-  findall(nominal(NominalIndividual),Name:classAssertion(oneOf(_),NominalIndividual),LNA),
-  new_abox(ABox0),
-  new_tabs(Tabs0),
-  create_tabs(LCA,Tabs0,Tabs1),
-  add_all(LCA,ABox0,ABox1),
-  add_all(LPA,ABox1,ABox2),
-  add_all(LSPA,ABox2,ABox3),
-  add_all(LNA,ABox3,ABox4),
-  findall((differentIndividuals(Ld),[differentIndividuals(Ld)]),Name:differentIndividuals(Ld),LDIA),
-  add_all(LDIA,ABox4,ABox5),
-  create_tabs(LDIA,Tabs1,Tabs2),
-  create_tabs(LPA,Tabs2,Tabs3),
-  create_tabs(LSPA,Tabs3,Tabs4),
-  findall((sameIndividual(L),[sameIndividual(L)]),Name:sameIndividual(L),LSIA),
-  merge_all(LSIA,ABox5,Tabs4,ABox6,Tabs),
-  add_nominal_list(ABox6,Tabs,ABox),
-  !.
-
-%---------------
-subProp(Name,SubProperty,Property,Subject,Object):-
-  Name:subPropertyOf(SubProperty,Property),Name:propertyAssertion(SubProperty,Subject,Object).
-
-%--------------
-
-add_nominal_list(ABox0,(T,_,_),ABox):-
-  vertices(T,NomListIn),
-  prepare_nom_list(NomListIn,NomListOut),
-  add_all(NomListOut,ABox0,ABox).
-  
-%--------------
-
-prepare_nom_list([],[]).
-
-prepare_nom_list([H|T],[(nominal(H)),(classAssertion('Thing',H),[])|T1]):-
-  prepare_nom_list(T,T1).
-%--------------
-
-/*
-  add_all(L1,L2,LO).
-  add in L2 all item of L1
-*/
-add_all([],A,A).
-
-add_all([H|T],A0,A):-
-  add(A0,H,A1),
-  add_all(T,A1,A).
-
-/* ************** */
-
-/*
-  initialize the tableau
-  tableau is composed of:
-  	a directed graph T => tableau without label
-  	a red black tree RBN => each node is a couple of ind that contains the label for the edge
-  	a red black tree RBR => each node a property that contains the couples of ind
-*/
-new_tabs(([],ItR,RtI)):-
-  rb_new(ItR),
-  rb_new(RtI).
-
-create_tabs([],G,G).
-
-create_tabs([(propertyAssertion(P,S,O),_Expl)|T],Tabl0,Tabl):-
-  add_edge(P,S,O,Tabl0,Tabl1),
-  create_tabs(T,Tabl1,Tabl).
-  
-create_tabs([(differentIndividuals(Ld),_Expl)|T],(T0,RBN,RBR),(T,RBN,RBR)):-
-  add_vertices(T0,Ld,T).
-
-create_tabs([(classAssertion(_,I),_Expl)|Tail],(T0,RBN,RBR),(T,RBN,RBR)):-
-  add_vertices(T0,[I],T1),
-  create_tabs(Tail,(T1,RBN,RBR),(T,RBN,RBR)).
-
-/*
-  add edge to tableau
-  
-*/
-
-add_edge(P,S,O,(T0,ItR0,RtI0),(T1,ItR1,RtI1)):-
-  add_node_to_tree(P,S,O,ItR0,ItR1),
-  add_role_to_tree(P,S,O,RtI0,RtI1),
-  add_edge_to_tabl(P,S,O,T0,T1).
-  
-add_node_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup((S,O),V,RB0),
-  \+ member(P,V),
-  rb_update(RB0,(S,O),[P|V],RB1).
-
-add_node_to_tree(P,S,O,RB0,RB0):-
-  rb_lookup((S,O),V,RB0),
-  member(P,V).
-
-add_node_to_tree(P,S,O,RB0,RB1):-
-  \+ rb_lookup([S,O],_,RB0),
-  rb_insert(RB0,(S,O),[P],RB1).
-
-add_role_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup(P,V,RB0),
-  \+ member((S,O),V),
-  rb_update(RB0,P,[(S,O)|V],RB1).
-
-add_role_to_tree(P,S,O,RB0,RB0):-
-  rb_lookup(P,V,RB0),
-  member((S,O),V).
-
-add_role_to_tree(P,S,O,RB0,RB1):-
-  \+ rb_lookup(P,_,RB0),
-  rb_insert(RB0,P,[(S,O)],RB1).
-
-add_edge_to_tabl(_R,Ind1,Ind2,T0,T0):-
-  graph_edge(Ind1,Ind2,T0),!.
-
-add_edge_to_tabl(_R,Ind1,Ind2,T0,T1):-
-  add_edges(T0,[Ind1-Ind2],T1).
-
-/*
-  check for an edge
-*/
-graph_edge(Ind1,Ind2,T0):-
-  edges(T0, Edges),
-  member(Ind1-Ind2, Edges),!.
-
-%graph_edge(_,_,_).
-
-/* 
-  remove edge from tableau
-*/
-
-remove_node_to_tree(P,S,O,RB,RB):-
-  rb_lookup((S,O),V,RB),
-  \+ member(P,V).
-
-remove_node_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup((S,O),V,RB0),
-  member(P,V),
-  remove(V,P,V1),
-  dif(V1,[]),
-  rb_update(RB0,(S,O),V1,RB1).
-
-remove_node_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup((S,O),V,RB0),
-  member(P,V),
-  remove(V,P,V1),
-  V1==[],
-  rb_delete(RB0,(S,O),RB1).
-
-remove_all_node_to_tree(_P,S,O,RB0,RB1):-
-  rb_lookup((S,O),_,RB0),
-  rb_delete(RB0,(S,O),RB1).
-
-remove_all_node_to_tree(_P,S,O,RB0,_RB1):-
-  \+ rb_lookup((S,O),_,RB0).
-
-remove_role_to_tree(P,S,O,RB,RB):-
-  rb_lookup(P,V,RB),
-  \+ member((S,O),V).
-
-remove_role_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup(P,V,RB0),
-  member((S,O),V),
-  delete(V,(S,O),V1),
-  dif(V1,[]),
-  rb_update(RB0,P,V1,RB1).
-
-remove_role_to_tree(P,S,O,RB0,RB1):-
-  rb_lookup(P,V,RB0),
-  member((S,O),V),
-  delete(V,(S,O),V1),
-  V1==[],
-  rb_delete(RB0,P,RB1).
-
-remove_edge_to_table(_P,S,O,T,T):-
-  \+ graph_edge(S,O,T).
-
-remove_edge_to_table(_P,S,O,T0,T1):-
-  graph_edge(S,O,T0),
-  del_edges(T0,[S-O],T1).
-
-remove_node_to_table(S,T0,T1):-
-  del_vertices(T0,[S],T1).
-
-/*
- * merge node in tableau
- */
-
-merge_tabs(X,Y,(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  (neighbours(X,T0,LSX0)->assign(LSX0,LSX);assign([],LSX)),
-  (neighbours(Y,T0,LSY0)->assign(LSY0,LSY);assign([],LSY)),
-  transpose_ugraph(T0,TT),
-  (neighbours(X,TT,LPX0)->assign(LPX0,LPX);assign([],LPX)),
-  (neighbours(Y,TT,LPY0)->assign(LPY0,LPY);assign([],LPY)),
-  flatten([X,Y],L0),
-  list_to_set(L0,L),
-  set_predecessor(L,X,LPX,(T0,RBN0,RBR0),(T1,RBN1,RBR1)),!,
-  set_successor(L,X,LSX,(T1,RBN1,RBR1),(T2,RBN2,RBR2)),!,
-  set_predecessor(L,Y,LPY,(T2,RBN2,RBR2),(T3,RBN3,RBR3)),!,
-  set_successor(L,Y,LSY,(T3,RBN3,RBR3),(T4,RBN4,RBR4)),!,
-  remove_nodes(X,Y,(T4,RBN4,RBR4),(T,RBN,RBR)).
-
-remove_nodes(X,Y,Tabs0,Tabs):-
-  remove_node(X,Tabs0,Tabs1),
-  remove_node(Y,Tabs1,Tabs).
-
-remove_node(X,(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  (neighbours(X,T0,LS0)->assign(LS0,LS);assign([],LS)),
-  transpose_ugraph(T0,TT),
-  (neighbours(X,TT,LP0)->assign(LP0,LP);assign([],LP)),
-  remove_node1(X,LS,RBN0,RBR0,RBN1,RBR1),
-  remove_node2(X,LP,RBN1,RBR1,RBN,RBR),
-  (vertices(T0,VS),member(X,VS)->del_vertices(T0,[X],T);assign(T0,T)).
-
-remove_node1(_,[],RBN,RBR,RBN,RBR).
-
-remove_node1(X,[H|T],RBN0,RBR0,RBN,RBR):-
-  rb_lookup((X,H),V,RBN0),
-  remove_edges(V,X,H,RBR0,RBR1),
-  remove_all_node_to_tree(_,X,H,RBN0,RBN1),
-  remove_node1(X,T,RBN1,RBR1,RBN,RBR).
-
-remove_node2(_,[],RBN,RBR,RBN,RBR).
-
-remove_node2(X,[H|T],RBN0,RBR0,RBN,RBR):-
-  rb_lookup((H,X),V,RBN0),
-  remove_edges(V,H,X,RBR0,RBR1),
-  remove_all_node_to_tree(_,H,X,RBN0,RBN1),
-  remove_node1(X,T,RBN1,RBR1,RBN,RBR).
-
-remove_edges([],_,_,RBR,RBR).
-
-remove_edges([H|T],S,O,RBR0,RBR):-
-  remove_role_to_tree(H,S,O,RBR0,RBR1),
-  remove_edges(T,S,O,RBR1,RBR).
-	
-
-set_predecessor(_NN,_,[],Tabs,Tabs).
-
-set_predecessor(NN,X,[H|L],(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  rb_lookup((H,X),LR,RBN0),
-  set_predecessor1(NN,H,LR,(T0,RBN0,RBR0),(T1,RBN1,RBR1)),
-  set_predecessor(NN,X,L,(T1,RBN1,RBR1),(T,RBN,RBR)).
-
-set_predecessor1(_NN,_H,[],Tabs,Tabs).
-
-set_predecessor1(NN,H,[R|L],(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  add_edge(R,H,NN,(T0,RBN0,RBR0),(T1,RBN1,RBR1)),
-  set_predecessor1(NN,H,L,(T1,RBN1,RBR1),(T,RBN,RBR)).
-
-set_successor(_NN,_X,[],Tabs,Tabs).
-
-set_successor(NN,X,[H|L],(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  rb_lookup((X,H),LR,RBN0),
-  set_successor1(NN,H,LR,(T0,RBN0,RBR0),(T1,RBN1,RBR1)),
-  set_successor(NN,X,L,(T1,RBN1,RBR1),(T,RBN,RBR)).
-
-set_successor1(_NN,_H,[],Tabs,Tabs).
-
-set_successor1(NN,H,[R|L],(T0,RBN0,RBR0),(T,RBN,RBR)):-
-  add_edge(R,NN,H,(T0,RBN0,RBR0),(T1,RBN1,RBR1)),
-  set_successor1(NN,H,L,(T1,RBN1,RBR1),(T,RBN,RBR)).
-	  
-
-/* merge node in (ABox,Tabs) */
-
-merge_all([],ABox,Tabs,ABox,Tabs).
-
-merge_all([(sameIndividual(H),Expl)|T],ABox0,Tabs0,ABox,Tabs):-
-  find_same(H,ABox0,L,ExplL),
-  dif(L,[]),!,
-  merge_all1(H,L,ABox0,Tabs0,ABox1,Tabs1),
-  flatten([H,L],L0),
-  list_to_set(L0,L1),
-  append(Expl,ExplL,ExplT),
-  add(ABox1,(sameIndividual(L1),ExplT),ABox2),
-  delete(ABox2,(sameIndividual(L),ExplL),ABox3),
-  retract_sameIndividual(L),
-  merge_all(T,ABox3,Tabs1,ABox,Tabs).
-  
-merge_all([(sameIndividual(H),Expl)|T],ABox0,Tabs0,ABox,Tabs):-
-  find_same(H,ABox0,L,_),
-  L==[],!,
-  merge_all2(H,ABox0,Tabs0,ABox1,Tabs1),
-  add(ABox1,(sameIndividual(H),Expl),ABox2),
-  merge_all(T,ABox2,Tabs1,ABox,Tabs).
-  
-merge_all1([],_,ABox,Tabs,ABox,Tabs).
-
-merge_all1([H|T],L,ABox0,Tabs0,ABox,Tabs):-
-  \+ member(H,L),
-  merge(H,L,(ABox0,Tabs0),(ABox1,Tabs1)),
-  merge_all1(T,[H|L],ABox1,Tabs1,ABox,Tabs).
-
-merge_all1([H|T],L,ABox0,Tabs0,ABox,Tabs):-
-  member(H,L),
-  merge_all1(T,L,ABox0,Tabs0,ABox,Tabs).
-
-
-
-merge_all2([X,Y|T],ABox0,Tabs0,ABox,Tabs):-
-  merge(X,Y,(ABox0,Tabs0),(ABox1,Tabs1)),
-  merge_all1(T,[X,Y],ABox1,Tabs1,ABox,Tabs).
-
-find_same(H,ABox,L,Expl):-
-  find((sameIndividual(L),Expl),ABox),
-  member(X,L),
-  member(X,H),!.
-
-find_same(_H,_ABox,[],[]).
-
-/*
- * merge
- */
-merge(sameIndividual(L),Y,(ABox0,Tabs0),(ABox,Tabs)):-
-  !,
-  merge_tabs(L,Y,Tabs0,Tabs),
-  merge_abox(L,Y,[],ABox0,ABox).
-
-merge(X,sameIndividual(L),(ABox0,Tabs0),(ABox,Tabs)):-
-  !,
-  merge_tabs(X,L,Tabs0,Tabs),
-  merge_abox(X,L,[],ABox0,ABox).
-
-merge(X,Y,(ABox0,Tabs0),(ABox,Tabs)):-
-  !,
-  merge_tabs(X,Y,Tabs0,Tabs),
-  merge_abox(X,Y,[],ABox0,ABox).
-
-/* abox as a list */
-
-new_abox([]).
-
- 
-/* add El to ABox */
-add(ABox,El,[El|ABox]).
-
-assign(L,L).
-/*
-  find & control (not find)
-*/
-find(El,ABox):-
-  member(El,ABox).
-
-control(El,ABox):-
-  \+ find(El,ABox).
-
-/*
-  merge node in ABox
-*/
-
-merge_abox(_X,_Y,_,[],[]).
-
-merge_abox(X,Y,Expl0,[(classAssertion(C,Ind),ExplT)|T],[(classAssertion(C,sameIndividual(L)),[sameIndividual(L)|Expl])|ABox]):-
-  flatten([X,Y],L0),
-  list_to_set(L0,L),
-  member(Ind,L),!,
-  append(Expl0,ExplT,Expl),
-  merge_abox(X,Y,Expl0,T,ABox).
-
-merge_abox(X,Y,Expl0,[(propertyAssertion(P,Ind1,Ind2),ExplT)|T],[(propertyAssertion(P,sameIndividual(L),Ind2),[sameIndividual(L)|Expl])|ABox]):-
-  flatten([X,Y],L0),
-  list_to_set(L0,L),
-  member(Ind1,L),!,
-  append(Expl0,ExplT,Expl),
-  merge_abox(X,Y,Expl0,T,ABox).
-
-merge_abox(X,Y,Expl0,[(propertyAssertion(P,Ind1,Ind2),ExplT)|T],[(propertyAssertion(P,Ind1,sameIndividual(L)),[sameIndividual(L)|Expl])|ABox]):-
-  flatten([X,Y],L0),
-  list_to_set(L0,L),
-  member(Ind2,L),!,
-  append(Expl0,ExplT,Expl),
-  merge_abox(X,Y,Expl0,T,ABox).
-
-merge_abox(X,Y,Expl0,[H|T],[H|ABox]):-
-  merge_abox(X,Y,Expl0,T,ABox).
-
-/* end of abox a s list */
-
-/* abox as a red-black tree */
-/*new_abox(T):-
-  rb_new(T).
-
-add(A,(Ass,Ex),A1):-
-  rb_insert(A,(Ass,Ex),[],A1).
-
-find((Ass,Ex),A):-
-  rb_lookup((Ass,Ex),_,A).
-*/
-/* end of abox as a rb tree */
-
-/*
-  creation of a new individual
-  
-*/
-new_ind(I):-
-  retract(ind(I)),
-  I1 is I+1,
-  assert(ind(I1)).
-
-
-
-/*
-  same label for two individuals
-  
-*/
-
-same_label(X,Y,ABox):-
-  \+ different_label(X,Y,ABox),
-  !.
-
-/*
-
- different label in two individuals
- 
-*/
-
-different_label(X,Y,ABox):-
-  find((classAssertion(C,X),_),ABox),
-  \+ find((classAssertion(C,Y),_),ABox).
-
-different_label(X,Y,ABox):-
-  find((classAssertion(C,Y),_),ABox),
-  \+ find((classAssertion(C,X),_),ABox).
-  
-
-/*
-  all nodes in path from X to Y are blockable?
-  
-*/
-
-all_node_blockable(X,Y,(ABox,(T,RBN,RBR))):-
-  graph_min_path(X,Y,T,P),
-  all_node_blockable1(P,(ABox,(T,RBN,RBR))).
-
-all_node_blockable1([],_).
-
-all_node_blockable1([H|Tail],(ABox,(T,RBN,RBR))):-
-  blockable(H,(ABox,(T,RBN,RBR))),
-  all_node_blockable1(Tail,(ABox,(T,RBN,RBR))).
-  
-/*
-  find a path in the graph
-*/
-graph_min_path(X,Y,T,P):-
-  findall(Path, graph_min_path1(X,Y,T,Path), Ps),
-  min_length(Ps,P).
-
-graph_min_path1(X,Y,T,[X,Y]):-
-  member(X-L,T),
-  member(Y,L).
-  
-graph_min_path1(X,Y,T,[X|P]):-
-  member(X-L,T),
-  member(Z,L),
-  graph_min_path1(Z,Y,T,P).
-  
-min_length([H],H).
-
-min_length([H|T],MP):-
-  min_length(T,P),
-  length(H,N),
-  length(P,NP), 
-  (N<NP ->
-     MP= H
-   ;
-     MP= P).
-/*
- find all ancestor of a node
- 
-*/
-ancestor(Ind,T,AN):-
-  transpose_ugraph(T,T1),
-  ancestor1([Ind],T1,[],AN).
-
-ancestor1([],_,A,A).
-
-ancestor1([Ind|Tail],T,A,AN):-
-  neighbours(Ind,T,AT),
-  add_all_n(AT,Tail,Tail1),
-  add_all_n(A,AT,A1),
-  ancestor1(Tail1,T,A1,AN).
-
-%-----------------
-/*
-
- add_all_n(L1,L2,LO)
- add in L2 all item of L1 without duplicates
- 
-*/
- 
-add_all_n([],A,A).
-
-add_all_n([H|T],A,AN):-
-  \+ member(H,A),
-  add_all_n(T,[H|A],AN).
-
-add_all_n([H|T],A,AN):-
-  member(H,A),
-  add_all_n(T,A,AN).
-/* *************** */
-
-/*
- retract_sameIndividual(L)
- ==========
-*/
-retract_sameIndividual(L):-
-  get_trill_current_module(N),
-  retract(N:sameIndividual(L)).
-
-retract_sameIndividual(L):-
-  get_trill_current_module(N),
-  \+ retract(N:sameIndividual(L)).
-/* ****** */
-
-/*
-  find all S neighbours (S is a role)
-*/
-s_neighbours(Ind1,S,(ABox,(_,_,RBR)),SN):-
-  rb_lookup(S,VN,RBR),
-  s_neighbours1(Ind1,VN,SN1),
-  s_neighbours2(SN1,SN1,SN,ABox).
-
-s_neighbours(_Ind1,S,(_,_,RBR),[]):-
-  \+ rb_lookup(S,_VN,RBR).
-
-s_neighbours1(_,[],[]).
-
-s_neighbours1(Ind1,[(Ind1,Y)|T],[Y|T1]):-
-  s_neighbours1(Ind1,T,T1).
-
-s_neighbours1(Ind1,[(X,_Y)|T],T1):-
-  dif(X,Ind1),
-  s_neighbours1(Ind1,T,T1).
-  
-s_neighbours2(_,[],[],_).
-
-s_neighbours2(SN,[H|T],[H|T1],ABox):-
-  s_neighbours2(SN,T,T1,ABox),
-  \+ same_ind(T1,H,ABox).
-
-s_neighbours2(SN,[H|T],T1,ABox):-
-  s_neighbours2(SN,T,T1,ABox),
-  same_ind(T1,H,ABox).
-
-%-----------------
-same_ind(SN,H,_ABox):-
-  get_trill_current_module(Name),
-  Name:sameIndividual(SI),
-  member(H,SI),
-  member(H2,SI),
-  member(H2,SN),
-  dif(H,H2).
-
-same_ind(SN,H,ABox):-
-  find((sameIndividual(SI),_),ABox),
-  member(H,SI),
-  member(H2,SI),
-  member(H2,SN),
-  dif(H,H2).
-
-/* ************* */
-
-/*
- s_predecessors
- ==============
- find all S-predecessor of Ind
-*/
-
-s_predecessors(Ind1,S,(ABox,(_,_,RBR)),SN):-
-  rb_lookup(S,VN,RBR),
-  s_predecessors1(Ind1,VN,SN1),
-  s_predecessors2(SN1,SN1,SN,ABox).
-
-s_predecessors(_Ind1,S,(_ABox,(_,_,RBR)),[]):-
-  \+ rb_lookup(S,_VN,RBR).
-
-s_predecessors1(_,[],[]).
-
-s_predecessors1(Ind1,[(Y,Ind1)|T],[Y|T1]):-
-  s_predecessors1(Ind1,T,T1).
-
-s_predecessors1(Ind1,[(_X,Y)|T],T1):-
-  dif(Y,Ind1),
-  s_predecessors1(Ind1,T,T1).
-
-s_predecessors2(_,[],[],_).
-
-s_predecessors2(SN,[H|T],[H|T1],ABox):-
-  s_predecessors2(SN,T,T1,ABox),
-  \+ same_ind(T1,H,ABox).
-
-s_predecessors2(SN,[H|T],T1,ABox):-
-  s_predecessors2(SN,T,T1,ABox),
-  same_ind(T1,H,ABox).
-
-/* ********** */
-
-/* *************
-   Probability computation
-   
-   ************* */
-
-/*
-build_formula([],[],Var,Var).
-
-build_formula([D|TD],TF,VarIn,VarOut):-
-        build_term(D,[],[],VarIn,Var1),!,
-        build_formula(TD,TF,Var1,VarOut).
-
-build_formula([D|TD],[F|TF],VarIn,VarOut):-
-        build_term(D,[],F,VarIn,Var1),
-        build_formula(TD,TF,Var1,VarOut).
-
-build_term([],F,F,Var,Var).
-
-build_term([(Ax,S)|TC],F0,F,VarIn,VarOut):-!,
-  (p_x(Ax,_)->
-    (nth0_eq(0,NVar,VarIn,(Ax,S))->
-      Var1=VarIn
-    ;
-      append(VarIn,[(Ax,S)],Var1),
-      length(VarIn,NVar)
-    ),
-    build_term(TC,[[NVar,0]|F0],F,Var1,VarOut)
-  ;
-    (p(Ax,_)->
-      (nth0_eq(0,NVar,VarIn,(Ax,[]))->
-        Var1=VarIn
-      ;
-        append(VarIn,[(Ax,[])],Var1),
-        length(VarIn,NVar) 
-      ),
-      build_term(TC,[[NVar,0]|F0],F,Var1,VarOut)
-    ;
-      build_term(TC,F0,F,VarIn,VarOut)
-    )
-  ).
-
-build_term([Ax|TC],F0,F,VarIn,VarOut):-!,
-  (p(Ax,_)->
-    (nth0_eq(0,NVar,VarIn,(Ax,[]))->
-      Var1=VarIn
-    ;
-      append(VarIn,[(Ax,[])],Var1),
-      length(VarIn,NVar) 
-    ),
-    build_term(TC,[[NVar,0]|F0],F,Var1,VarOut)
-  ;
-    build_term(TC,F0,F,VarIn,VarOut)
-  ).
-*/
-
-/* nth0_eq(PosIn,PosOut,List,El) takes as input a List,
-an element El and an initial position PosIn and returns in PosOut
-the position in the List that contains an element exactly equal to El
-*/
-
-/*
-nth0_eq(N,N,[H|_T],El):-
-        H==El,!.
-
-nth0_eq(NIn,NOut,[_H|T],El):-
-        N1 is NIn+1,
-        nth0_eq(N1,NOut,T,El).
-
-*/
-/* var2numbers converts a list of couples (Rule,Substitution) into a list
-of triples (N,NumberOfHeadsAtoms,ListOfProbabilities), where N is an integer
-starting from 0 */
-/*
-var2numbers([],_N,[]).
-
-var2numbers([(R,_S)|T],N,[[N,2,[Prob,Prob1,0.3,0.7]]|TNV]):-
-        (p(R,_);p_x(R,_)),
-        compute_prob_ax(R,Prob),!,
-        Prob1 is 1-Prob,
-        N1 is N+1,
-        var2numbers(T,N1,TNV).
-
-     
-compute_prob_ax(R,Prob):-
-  findall(P, p(R,P),Probs),
-  compute_prob_ax1(Probs,Prob).
-  
-compute_prob_ax1([Prob],Prob):-!.
-
-compute_prob_ax1([Prob1,Prob2],Prob):-!,
-  Prob is Prob1+Prob2-(Prob1*Prob2).
-  
-compute_prob_ax1([Prob1 | T],Prob):-
-  compute_prob_ax1(T,Prob0),
-  Prob is Prob1 + Prob0 - (Prob1*Prob0).
-
-*/  
-  
-  
-/**************/
-get_trill_current_module('translate_rdf'):-
-  pengine_self(_Name),!.
-get_trill_current_module('owl2_model'):- !.
-/**************/
-
-/****************
-	TRILLPROBCOMPUTATION
-****************/
-
-compute_prob(Expl,Prob):-
-  retractall(v(_,_,_)),
-  retractall(na(_,_)),
-  retractall(rule_n(_)),
-  assert(rule_n(0)),
-  get_trill_current_module(Name),
-  findall(1,Name:annotationAssertion('https://sites.google.com/a/unife.it/ml/disponte#probability',_,_),NAnnAss),length(NAnnAss,NV),
-  init_test(NV,Env),
-  build_bdd(Env,Expl,BDD),
-  ret_prob(Env,BDD,Prob),
-  end_test(Env), !.
-  
-  
-
-
-build_bdd(Env,[X],BDD):- !,
-  bdd_and(Env,X,BDD).
-  
-build_bdd(Env, [H|T],BDD):-
-  build_bdd(Env,T,BDDT),
-  bdd_and(Env,H,BDDH),
-  or(Env,BDDH,BDDT,BDD).
-  
-build_bdd(Env,[],BDD):- !,
-  zero(Env,BDD).
-  
-  
-bdd_and(Env,[X],BDDX):-
-  get_prob_ax(X,AxN,Prob),!,
-  ProbN is 1-Prob,
-  get_var_n(Env,AxN,[],[Prob,ProbN],VX),
-  equality(Env,VX,0,BDDX),!.
-bdd_and(Env,[_X],BDDX):- !,
-  one(Env,BDDX).
-  
-bdd_and(Env,[H|T],BDDAnd):-
-  get_prob_ax(H,AxN,Prob),!,
-  ProbN is 1-Prob,
-  get_var_n(Env,AxN,[],[Prob,ProbN],VH),
-  equality(Env,VH,0,BDDH),
-  bdd_and(Env,T,BDDT),
-  and(Env,BDDH,BDDT,BDDAnd).
-  
-bdd_and(Env,[_H|T],BDDAnd):- !,
-  one(Env,BDDH),
-  bdd_and(Env,T,BDDT),
-  and(Env,BDDH,BDDT,BDDAnd).
-
-
-
-  
-get_var_n(Env,R,S,Probs,V):-
-  ( 
-    v(R,S,V) -> 
-      true
-    ; 
-      length(Probs,L),
-      add_var(Env,L,Probs,R,V),
-      assert(v(R,S,V))
-  ).
-
-
-get_prob_ax((Ax,_Ind),N,Prob):- !,
-  compute_prob_ax(Ax,Prob),
-  ( na(Ax,N) -> 
-      true
-    ;
-      rule_n(N),
-      assert(na(Ax,N)),
-      retract(rule_n(N)),
-      N1 is N + 1,
-      assert(rule_n(N1))
-  ).
-get_prob_ax(Ax,N,Prob):- !,
-  compute_prob_ax(Ax,Prob),  
-  ( na(Ax,N) -> 
-      true 
-    ; 
-      rule_n(N),
-      assert(na(Ax,N)),
-      retract(rule_n(N)),
-      N1 is N + 1,
-      assert(rule_n(N1))
-  ).
-  
-compute_prob_ax(Ax,Prob):-
-  get_trill_current_module(Name),
-  findall(ProbA, (Name:annotationAssertion('https://sites.google.com/a/unife.it/ml/disponte#probability',Ax,literal(ProbAT)),atom_number(ProbAT,ProbA)),Probs),
-  compute_prob_ax1(Probs,Prob).
-  
-compute_prob_ax1([Prob],Prob):-!.
-
-compute_prob_ax1([Prob1,Prob2],Prob):-!,
-  Prob is Prob1+Prob2-(Prob1*Prob2).
-  
-compute_prob_ax1([Prob1 | T],Prob):-
-  compute_prob_ax1(T,Prob0),
-  Prob is Prob1 + Prob0 - (Prob1*Prob0).  
-/************************/
-
-
-
-
-:- multifile sandbox:safe_primitive/1.
-		
-
-sandbox:safe_primitive(trill:init_test(_,_)).
-sandbox:safe_primitive(trill:ret_prob(_,_,_)).
-sandbox:safe_primitive(trill:end_test(_)).
-sandbox:safe_primitive(trill:one(_,_)).
-sandbox:safe_primitive(trill:zero(_,_)).
-sandbox:safe_primitive(trill:and(_,_,_,_)).
-sandbox:safe_primitive(trill:or(_,_,_,_)).
-%sandbox:safe_primitive(trill:bdd_not(_,_,_)).
-sandbox:safe_primitive(trill:get_var_n(_,_,_,_,_)).
-sandbox:safe_primitive(trill:add_var(_,_,_,_,_)).
-sandbox:safe_primitive(trill:equality(_,_,_,_)).
-
-
-sandbox:safe_primitive(trill:sub_class(_,_)).
-sandbox:safe_primitive(trill:sub_class(_,_,_)).
-sandbox:safe_primitive(trill:prob_sub_class(_,_,_)).
-sandbox:safe_primitive(trill:instanceOf(_,_)).
-sandbox:safe_primitive(trill:instanceOf(_,_,_)).
-sandbox:safe_primitive(trill:prob_instanceOf(_,_,_)).
-sandbox:safe_primitive(trill:unsat(_)).
-sandbox:safe_primitive(trill:unsat(_,_)).
-sandbox:safe_primitive(trill:prob_unsat(_,_)).
-sandbox:safe_primitive(trill:inconsistent_theory).
-sandbox:safe_primitive(trill:inconsistent_theory(_)).
-sandbox:safe_primitive(trill:prob_inconsistent_theory(_)).
-sandbox:safe_primitive(trill:load_theory(_)).
-sandbox:safe_primitive(trill:check_query_args(_)).
-
diff --git a/src b/src
index 09a0198..fde97c2 160000
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 09a01980f6b00a1b91ef4eaaf0ab4cc9db5f73b2
+Subproject commit fde97c24562b580fc3925b3c0b0089cc0da204b7
diff --git a/web/bower_components/codemirror/theme/neo.css b/web/bower_components/codemirror/theme/neo.css
deleted file mode 100644
index cecaaf2..0000000
--- a/web/bower_components/codemirror/theme/neo.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/* neo theme for codemirror */
-
-/* Color scheme */
-
-.cm-s-neo.CodeMirror {
-  background-color:#ffffff;
-  color:#2e383c;
-  line-height:1.4375;
-}
-.cm-s-neo .cm-comment {color:#75787b}
-.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3}
-.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a}
-.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328}
-.cm-s-neo .cm-string {color:#b35e14}
-.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65}
-
-
-/* Editor styling */
-
-.cm-s-neo pre {
-  padding:0;
-}
-
-.cm-s-neo .CodeMirror-gutters {
-  border:none;
-  border-right:10px solid transparent;
-  background-color:transparent;
-}
-
-.cm-s-neo .CodeMirror-linenumber {
-  padding:0;
-  color:#e0e2e5;
-}
-
-.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; }
-.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; }
-
-.cm-s-neo div.CodeMirror-cursor {
-  width: auto;
-  border: 0;
-  background: rgba(155,157,162,0.37);
-  z-index: 1;
-}
diff --git a/web/css/print.css b/web/css/print.css
index ceacd13..da74e7f 100644
--- a/web/css/print.css
+++ b/web/css/print.css
@@ -1,325 +1,74 @@
-/* BASICS */
-
-.CodeMirror {
-  /* Set height, width, borders, and global font properties here */
-  font-family: monospace;
-  height: 300px;
-  color: black;
-}
-
-/* PADDING */
-
-.CodeMirror-lines {
-  padding: 4px 0; /* Vertical padding around content */
-}
-.CodeMirror pre {
-  padding: 0 4px; /* Horizontal padding of content */
-}
-
-.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
-  background-color: white; /* The little square between H and V scrollbars */
-}
-
-/* GUTTER */
-
-.CodeMirror-gutters {
-  border-right: 1px solid #ddd;
-  background-color: #f7f7f7;
-  white-space: nowrap;
-}
-.CodeMirror-linenumbers {}
-.CodeMirror-linenumber {
-  padding: 0 3px 0 5px;
-  min-width: 20px;
-  text-align: right;
-  color: #999;
-  white-space: nowrap;
-}
-
-.CodeMirror-guttermarker { color: black; }
-.CodeMirror-guttermarker-subtle { color: #999; }
-
-/* CURSOR */
-
-.CodeMirror div.CodeMirror-cursor {
-  border-left: 1px solid black;
-}
-/* Shown when moving in bi-directional text */
-.CodeMirror div.CodeMirror-secondarycursor {
-  border-left: 1px solid silver;
-}
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
-  width: auto;
-  border: 0;
-  background: #7e7;
-}
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
-  z-index: 1;
-}
-
-.cm-animate-fat-cursor {
-  width: auto;
-  border: 0;
-  -webkit-animation: blink 1.06s steps(1) infinite;
-  -moz-animation: blink 1.06s steps(1) infinite;
-  animation: blink 1.06s steps(1) infinite;
-}
-@-moz-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@-webkit-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-
-/* Can style cursor different in overwrite (non-insert) mode */
-div.CodeMirror-overwrite div.CodeMirror-cursor {}
-
-.cm-tab { display: inline-block; text-decoration: inherit; }
-
-.CodeMirror-ruler {
-  border-left: 1px solid #ccc;
-  position: absolute;
-}
-
-/* DEFAULT THEME */
-
-.cm-s-default .cm-keyword {color: #708;}
-.cm-s-default .cm-atom {color: #219;}
-.cm-s-default .cm-number {color: #164;}
-.cm-s-default .cm-def {color: #00f;}
-.cm-s-default .cm-variable,
-.cm-s-default .cm-punctuation,
-.cm-s-default .cm-property,
-.cm-s-default .cm-operator {}
-.cm-s-default .cm-variable-2 {color: #05a;}
-.cm-s-default .cm-variable-3 {color: #085;}
-.cm-s-default .cm-comment {color: #a50;}
-.cm-s-default .cm-string {color: #a11;}
-.cm-s-default .cm-string-2 {color: #f50;}
-.cm-s-default .cm-meta {color: #555;}
-.cm-s-default .cm-qualifier {color: #555;}
-.cm-s-default .cm-builtin {color: #30a;}
-.cm-s-default .cm-bracket {color: #997;}
-.cm-s-default .cm-tag {color: #170;}
-.cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
-.cm-s-default .cm-hr {color: #999;}
-.cm-s-default .cm-link {color: #00c;}
-
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-.cm-strikethrough {text-decoration: line-through;}
-
-.cm-s-default .cm-error {color: #f00;}
-.cm-invalidchar {color: #f00;}
-
-.CodeMirror-composing { border-bottom: 2px solid; }
-
-/* Default styles for common addons */
-
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
-.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
-.CodeMirror-activeline-background {background: #e8f2ff;}
-
-/* STOP */
-
-/* The rest of this file contains styles related to the mechanics of
-   the editor. You probably shouldn't touch them. */
-
-.CodeMirror {
-  position: relative;
-  overflow: hidden;
-  background: white;
-}
-
-.CodeMirror-scroll {
-  overflow: scroll !important; /* Things will break if this is overridden */
-  /* 30px is the magic margin used to hide the element's real scrollbars */
-  /* See overflow: hidden in .CodeMirror */
-  margin-bottom: -30px; margin-right: -30px;
-  padding-bottom: 30px;
-  height: 100%;
-  outline: none; /* Prevent dragging from highlighting the element */
-  position: relative;
-}
-.CodeMirror-sizer {
-  position: relative;
-  border-right: 30px solid transparent;
-}
-
-/* The fake, visible scrollbars. Used to force redraw during scrolling
-   before actuall scrolling happens, thus preventing shaking and
-   flickering artifacts. */
-.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
-  position: absolute;
-  z-index: 6;
-  display: none;
-}
-.CodeMirror-vscrollbar {
-  right: 0; top: 0;
-  overflow-x: hidden;
-  overflow-y: scroll;
-}
-.CodeMirror-hscrollbar {
-  bottom: 0; left: 0;
-  overflow-y: hidden;
-  overflow-x: scroll;
-}
-.CodeMirror-scrollbar-filler {
-  right: 0; bottom: 0;
-}
-.CodeMirror-gutter-filler {
-  left: 0; bottom: 0;
-}
-
-.CodeMirror-gutters {
-  position: absolute; left: 0; top: 0;
-  z-index: 3;
-}
-.CodeMirror-gutter {
-  white-space: normal;
-  height: 100%;
-  display: inline-block;
-  margin-bottom: -30px;
-  /* Hack to make IE7 behave */
-  *zoom:1;
-  *display:inline;
-}
-.CodeMirror-gutter-wrapper {
-  position: absolute;
-  z-index: 4;
-  height: 100%;
-}
-.CodeMirror-gutter-elt {
-  position: absolute;
-  cursor: default;
-  z-index: 4;
-}
-.CodeMirror-gutter-wrapper {
-  -webkit-user-select: none;
-  -moz-user-select: none;
-  user-select: none;
-}
-
-.CodeMirror-lines {
-  cursor: text;
-  min-height: 1px; /* prevents collapsing before first draw */
-}
-.CodeMirror pre {
-  /* Reset some styles that the rest of the page might have set */
-  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
-  border-width: 0;
-  background: transparent;
-  font-family: inherit;
-  font-size: inherit;
-  margin: 0;
-  white-space: pre;
-  word-wrap: normal;
-  line-height: inherit;
-  color: inherit;
-  z-index: 2;
-  position: relative;
-  overflow: visible;
-  -webkit-tap-highlight-color: transparent;
-}
-.CodeMirror-wrap pre {
-  word-wrap: break-word;
-  white-space: pre-wrap;
-  word-break: normal;
-}
-
-.CodeMirror-linebackground {
-  position: absolute;
-  left: 0; right: 0; top: 0; bottom: 0;
-  z-index: 0;
-}
-
-.CodeMirror-linewidget {
-  position: relative;
-  z-index: 2;
-  overflow: auto;
-}
-
-.CodeMirror-widget {}
-
-.CodeMirror-code {
-  outline: none;
-}
-
-/* Force content-box sizing for the elements where we expect it */
-.CodeMirror-scroll,
-.CodeMirror-sizer,
-.CodeMirror-gutter,
-.CodeMirror-gutters,
-.CodeMirror-linenumber {
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-
-.CodeMirror-measure {
-  position: absolute;
-  width: 100%;
-  height: 0;
-  overflow: hidden;
-  visibility: hidden;
-}
-.CodeMirror-measure pre { position: static; }
-
-.CodeMirror div.CodeMirror-cursor {
-  position: absolute;
-  border-right: none;
-  width: 0;
-}
-
-div.CodeMirror-cursors {
-  visibility: hidden;
-  position: relative;
-  z-index: 3;
-}
-.CodeMirror-focused div.CodeMirror-cursors {
-  visibility: visible;
-}
-
-.CodeMirror-selected { background: #d9d9d9; }
-.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
-.CodeMirror-crosshair { cursor: crosshair; }
-.CodeMirror ::selection { background: #d7d4f0; }
-.CodeMirror ::-moz-selection { background: #d7d4f0; }
-
-.cm-searching {
-  background: #ffa;
-  background: rgba(255, 255, 0, .4);
-}
-
-/* IE7 hack to prevent it from returning funny offsetTops on the spans */
-.CodeMirror span { *vertical-align: text-bottom; }
-
-/* Used to force a border model for a node */
-.cm-force-border { padding-right: .1px; }
-
-@media print {
-  /* Hide the cursor when printing */
-  .CodeMirror div.CodeMirror-cursors {
-    visibility: hidden;
-  }
-}
-
-/* See issue #2901 */
-.cm-tab-wrap-hack:after { content: ''; }
-
-/* Help users use markselection to safely style text background */
-span.CodeMirror-selectedtext { background: none; }
+.cm-s-prolog span.cm-number	       {color: #000;}
+.cm-s-prolog span.cm-neg-number	       {color: #000;}
+.cm-s-prolog span.cm-atom	       {color: #762;}
+.cm-s-prolog span.cm-qatom	       {color: #008;}
+.cm-s-prolog span.cm-string	       {color: #008; font-style: italic;}
+.cm-s-prolog span.cm-string_terminal   {color: #008; font-style: italic;}
+.cm-s-prolog span.cm-bqstring	       {color: #040; font-style: italic;}
+.cm-s-prolog span.cm-codes	       {color: #040; font-style: italic;}
+.cm-s-prolog span.cm-chars	       {color: #040; font-style: italic;}
+.cm-s-prolog span.cm-functor	       {color: #000; font-style: italic;}
+.cm-s-prolog span.cm-tag	       {color: #000; font-weight: bold;}
+.cm-s-prolog span.cm-key	       {color: #000; font-weight: bold;}
+.cm-s-prolog span.cm-ext_quant	       {color: #000; font-weight: bold;}
+.cm-s-prolog span.cm-qq_content        {color: #900;}
+.cm-s-prolog span.cm-qq_open,
+.cm-s-prolog span.cm-qq_sep,
+.cm-s-prolog span.cm-qq_close          {color: blue; font-weight: bold;}
+.cm-s-prolog span.cm-qq_type           {font-weight: bold;}
+.cm-s-prolog span.cm-comment	       {color: #060; font-style: italic; line-height: 1em;}
+.cm-s-prolog span.cm-comment_string    {color: #060; font-style: italic; line-height: 1em;}
+.cm-s-prolog span.cm-var	       {color: #800;} /* Normal variable */
+.cm-s-prolog span.cm-var-2	       {color: #888;} /* _Var */
+.cm-s-prolog span.cm-anon	       {color: #800;} /* _ */
+.cm-s-prolog span.cm-singleton	       {color: #800; font-weight: bold;} /* Singleton */
+.cm-s-prolog span.cm-identifier	       {font-weight: bold;}
+.cm-s-prolog span.cm-module	       {color: #549;}
+.cm-s-prolog span.cm-head_exported     {color: blue; font-weight: bold;}
+.cm-s-prolog span.cm-head_unreferenced {color: red; font-weight: bold;}
+.cm-s-prolog span.cm-head_built_in     {background: orange; font-weight: bold;}
+.cm-s-prolog span.cm-head_iso          {background: orange; font-weight: bold;}
+.cm-s-prolog span.cm-head_hook         {color: blue; text-decoration: underline;}
+.cm-s-prolog span.cm-head_extern       {color: blue; font-weight: bold;}
+.cm-s-prolog span.cm-head_public       {color: #016300; font-weight: bold;}
+.cm-s-prolog span.cm-head_constraint   {color: #008b8b; font-weight: bold;}
+.cm-s-prolog span.cm-head	       {font-weight: bold;}
+.cm-s-prolog span.cm-goal_built_in     {color: blue;}
+.cm-s-prolog span.cm-goal_imported     {color: blue;}
+.cm-s-prolog span.cm-goal_autoload     {color: #008;}
+.cm-s-prolog span.cm-goal_undefined    {color: red;}
+.cm-s-prolog span.cm-goal_dynamic      {color: #f0f;} /*magenta*/
+.cm-s-prolog span.cm-goal_thread_local {color: #f0f; text-decoration: underline;}
+.cm-s-prolog span.cm-goal_constraint   {color: #008b8b;} /*dark-cyan*/
+.cm-s-prolog span.cm-goal_recursion    {text-decoration: underline;}
+.cm-s-prolog span.cm-meta	       {color: blue;}
+.cm-s-prolog span.cm-op_type	       {color: blue;}
+.cm-s-prolog span.cm-file_no_depends   {color: blue; text-decoration: underline; background: #fcd}
+.cm-s-prolog span.cm-file	       {color: blue; text-decoration: underline;}
+.cm-s-prolog span.cm-nofile	       {color: red;}
+.cm-s-prolog span.cm-option_name       {color: #3434ba;}
+.cm-s-prolog span.cm-no_option_name    {color: red;}
+.cm-s-prolog span.cm-flag_name         {color: blue;}
+.cm-s-prolog span.cm-no_flag_name      {color: red;}
+.cm-s-prolog span.cm-error             {border-bottom: 1px dashed #f00; }
+.cm-s-prolog span.cm-link	       {color: #762;}
+.cm-s-prolog span.cm-expanded	       {color: blue; text-decoration: underline;}
+/* xpce */
+.cm-s-prolog span.cm-xpce_method         {font-weight: bold;}
+.cm-s-prolog span.cm-xpce_class_built_in {color: blue;}
+.cm-s-prolog span.cm-xpce_class_lib      {color: blue; font-style: italic;}
+.cm-s-prolog span.cm-xpce_class_user     {color: #000; font-style: italic;}
+.cm-s-prolog span.cm-xpce_class_undef    {color: #000; font-style: italic;}
+/* debug synchronization */
+.cm-s-prolog span.cm-outofsync         {border: 1px dotted red;}
+
+/* library(http/html_write) */
+.cm-s-prolog span.cm-html		       {color: #909; font-weight: bold;}
+.cm-s-prolog span.cm-entity		       {color: #909;}
+.cm-s-prolog span.cm-html_attribute	       {color: #909;}
+.cm-s-prolog span.cm-sgml_attr_function	       {color: blue;}
+.cm-s-prolog span.cm-http_location_for_id      {font-weight: bold;}
+.cm-s-prolog span.cm-http_no_location_for_id   {color: red; font-weight: bold;}
+
+/* Other elements */
+.cm-jumped {background: yellow;}
diff --git a/web/css/trill_on_swish-min.css b/web/css/trill_on_swish-min.css
deleted file mode 100644
index 08183d1..0000000
--- a/web/css/trill_on_swish-min.css
+++ /dev/null
@@ -1,14 +0,0 @@
-ul.dropdown-menu li.checkbox input{margin-left:3px}ul.dropdown-menu li.checkbox span{margin-left:20px}.dropdown-menu>li{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:pointer}.dropdown-menu .sub-menu{left:100%;position:absolute;top:0;display:none;margin-top:-1px;border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:#fff;box-shadow:none}.left-caret:after,.right-caret:after{content:"";border-bottom:5px solid transparent;border-top:5px solid transparent;display:inline-block;height:0;vertical-align:middle;width:0;margin-left:5px}.right-caret:after{border-left:5px solid #ffaf46}.left-caret:after{border-right:5px solid #ffaf46}.dropdown-icon{margin-left:-12px;margin-right:5px;padding:0;background-repeat:no-repeat;background-size:100%;background-position:50% 50%;display:inline-block;vertical-align:middle;height:18px;width:18px}body,html{width:100%;height:100%;padding:0;margin:0;overflow:hidden}nav.navbar{margin-bottom:5px}#content{width:100%;height:calc(100% - 98px);padding:0;background-color:#fff}.pane-container,.pane-wrapper{width:100%;height:100%;background-color:white:green}.splittable{background-color:#fff;width:100%;height:100%;padding:5px}div.tabbed{height:100%}div.tab-content{height:calc(100% - 40px)}div.tab-pane{position:relative;height:100%}span.glyphicon.xclose:hover{opacity:.8}span.glyphicon.xclose{margin-left:5px;opacity:.2}a.tab-new.compact>span{padding:6px 0}.nav>li>a.compact{padding:0 5px}.tabbed-select:{width:100%}.tabbed-create{margin:2em 0 1em;text-align:center}.tabbed-create label{margin-left:1em;margin-right:1em}.tab-icon{padding:0;background-repeat:no-repeat;background-size:70%;background-position:50% 40%;display:inline-block;vertical-align:middle;height:30px;width:30px}form.search-sources{margin:3em auto 1em;width:80%}.CodeMirror{font-family:monospace;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::selection{background:#d7d4f0}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.cm-s-prolog span.cm-neg-number,.cm-s-prolog span.cm-number{color:#000}.cm-s-prolog span.cm-atom{color:#762}.cm-s-prolog span.cm-qatom{color:#008}.cm-s-prolog span.cm-string{color:#008;font-style:italic}.cm-s-prolog span.cm-bqstring,.cm-s-prolog span.cm-chars,.cm-s-prolog span.cm-codes{color:#040;font-style:italic}.cm-s-prolog span.cm-functor{color:#000;font-style:italic}.cm-s-prolog span.cm-key,.cm-s-prolog span.cm-tag{color:#000;font-weight:700}.cm-s-prolog span.cm-qq_content{color:#900}.cm-s-prolog span.cm-qq_close,.cm-s-prolog span.cm-qq_open,.cm-s-prolog span.cm-qq_sep{color:#00f;font-weight:700}.cm-s-prolog span.cm-qq_type{font-weight:700}.cm-s-prolog span.cm-comment,.cm-s-prolog span.cm-comment_string{color:#060;font-style:italic;line-height:1em}.cm-s-prolog span.cm-var{color:#800}.cm-s-prolog span.cm-var-2{color:#888}.cm-s-prolog span.cm-anon{color:#800}.cm-s-prolog span.cm-singleton{color:#800;font-weight:700}.cm-s-prolog span.cm-identifier{font-weight:700}.cm-s-prolog span.cm-module{color:#549}.cm-s-prolog span.cm-head_exported{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_unreferenced{color:red;font-weight:700}.cm-s-prolog span.cm-head_built_in,.cm-s-prolog span.cm-head_iso{background:orange;font-weight:700}.cm-s-prolog span.cm-head_hook{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-head_extern{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_public{color:#016300;font-weight:700}.cm-s-prolog span.cm-head{font-weight:700}.cm-s-prolog span.cm-goal_built_in,.cm-s-prolog span.cm-goal_imported{color:#00f}.cm-s-prolog span.cm-goal_autoload{color:#008}.cm-s-prolog span.cm-goal_undefined{color:red}.cm-s-prolog span.cm-goal_dynamic{color:#f0f}.cm-s-prolog span.cm-goal_thread_local{color:#f0f;text-decoration:underline}.cm-s-prolog span.cm-goal_recursion{text-decoration:underline}.cm-s-prolog span.cm-meta,.cm-s-prolog span.cm-op_type{color:#00f}.cm-s-prolog span.cm-file_no_depends{color:#00f;text-decoration:underline;background:#fcd}.cm-s-prolog span.cm-file{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-nofile{color:red}.cm-s-prolog span.cm-option_name{color:#3434ba}.cm-s-prolog span.cm-no_option_name{color:red}.cm-s-prolog span.cm-flag_name{color:#00f}.cm-s-prolog span.cm-no_flag_name{color:red}.cm-s-prolog span.cm-error{border-bottom:1px dashed red}.cm-s-prolog span.cm-link{color:#762}.cm-s-prolog span.cm-expanded{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-xpce_method{font-weight:700}.cm-s-prolog span.cm-xpce_class_built_in{color:#00f}.cm-s-prolog span.cm-xpce_class_lib{color:#00f;font-style:italic}.cm-s-prolog span.cm-xpce_class_undef,.cm-s-prolog span.cm-xpce_class_user{color:#000;font-style:italic}.cm-s-prolog span.cm-outofsync{border:1px dotted red}.cm-s-prolog span.cm-html{color:#909;font-weight:700}.cm-s-prolog span.cm-entity,.cm-s-prolog span.cm-html_attribute{color:#909}.cm-s-prolog span.cm-sgml_attr_function{color:#00f}.cm-s-prolog span.cm-http_location_for_id{font-weight:700}.cm-s-prolog span.cm-http_no_location_for_id{color:red;font-weight:700}.cm-jumped{background:#ff0}.CodeMirror-hover-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-hover-tooltip .pred-name{color:#00f;font-family:monospace;margin-right:5px}.CodeMirror-hover-tooltip .pred-tag{font-weight:700;margin-right:5px}.CodeMirror-hover-tooltip .pred-summary{font-style:italic}.CodeMirror-templates-variable{outline:#4664A5 solid 1px}.CodeMirror-templates-variable-selected{background-color:#B4D7FF}.CodeMirror-hint-template{background:url(data:image/gif;base64,R0lGODlhEAAQANUAAH5weoJ1g4h8kY+EoZaMsZyTv6CYyGd9qWqArG+Fr3aLs3yRuIKXvYmdwY2hxIaUroiVrIyXqoidwZGlx4+aqJScpfr9//f8//b8//n9/9Xz/+v5/5ifovH7/+n5/+36//D7//T8/+r6/+v6//P8//f9//b9//r+//n+/56inqKlm6iol62rlP7xevzndvjQasiYQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADEALAAAAAAQABAAAAaEwJhwSCwOYcikEkmEtZ7QKKzpMhgKhIEgAHBNj6+wePwVsjTotJpFXGk88Hh8RVRpJo4GY6FIIDwqRCkaIxuFIoUjIylEHHd5e30IHxxEFRogIB2ZmpoVRBR3EgsJByGnJBREERolFyWwJhgmJRFEEBonFigoFhYZvRBED8TFxsRGyUVBADs=) left center no-repeat;padding-left:18px;margin:3px 0}.CodeMirror-hints-contextInfo{position:absolute;z-index:10;border:3px double #d4d0c8;max-height:200px;max-width:400px;min-width:400px;overflow:auto;background:#FFFFE1;font-family:Tahoma;font-size:12px;padding:5px}.CodeMirror-hints{overflow-x:visible}.CodeMirror-hint{position:relative;max-width:none;overflow:visible}.CodeMirror-hint-description{display:none}.CodeMirror-hint-description.active{display:block;position:absolute;z-index:20;left:10px;top:0}.CodeMirror,.prolog-editor{height:100%}.CodeMirror pre.CodeMirror-placeholder{color:#999}.CodeMirror .source-msg.error{color:red;border-left:2px solid red}.CodeMirror .source-msg{border-left:2px solid #000;padding:0 5px;background-color:#ddd;cursor:hand;cursor:pointer}.CodeMirror .source-msg>span{color:#888;font-weight:700;border:1px solid #bbb}.CodeMirror .source-msg:hover>span{color:red}.CodeMirror-hover{outline:grey solid 1px}.CodeMirror-search-match{background-color:#ff0}.CodeMirror-search-alt-match{background-color:#bee}.CodeMirror .trace.call,.CodeMirror .trace.exit{background-color:#0f0}.CodeMirror .trace.fail{background-color:red}.CodeMirror .trace.redo{background-color:#ff0}.CodeMirror .trace.exception{background-color:#f0f}.Prolog-breakpoints{width:1em}.breakpoint-marker{color:#822;padding-left:4px;font-size:120%;position:relative;top:-.2em}div.prolog-query{height:100%;padding:5px;background-color:#eee}table.prolog-query{width:100%;height:100%}table.prolog-query .buttons-right{text-align:right}table.prolog-query textarea.query{width:100%;height:100%;box-sizing:border-box}table.prolog-query .prolog-prompt{vertical-align:top;font-weight:700}span.run-chk-table{margin-right:5px;color:#777}span.run-chk-table input{position:relative;top:2px}div.prolog-runners{width:100%;height:100%;background-image:url(../icons/red_bird_op.svg);background-size:80%;background-repeat:no-repeat;background-position:35% 50%;overflow:auto;padding:0 5px}div.prolog-runner{position:relative;margin:2px 0;border:1px solid #ccc;border-radius:5px}div.prolog-runner.tabled{border:0}div.prolog-runner>a.close{position:absolute;top:-4px;right:-10px;z-index:10}div.prolog-runner:focus{outline:0}div.prolog-runner.iconic>div.runner-results{display:none}div.runner-title{padding:0 5px 2px;border-width:2px;border-radius:5px;box-sizing:border-box}div.prolog-runner:focus div.runner-title{border:2px solid #000}div.runner-results{padding:2px 0;background-color:#fff;border-radius:5px}span.answer-no{float:right;color:#060;font-size:80%;margin-right:2px;font-style:italic}div.answer{padding-left:5px;border-radius:5px}div.answer.even{background-color:#eee}div.answer.odd{background-color:#fff}div.response{font-style:italic;color:#00f;font-size:90%;margin-left:10%;background-color:#eee;border:1px solid #ccc;border-radius:5px;padding:0 5px}span.prolog-true{font-weight:700}span.prolog-false{font-weight:700;color:red}div.cputime{text-align:right}div.cputime span{background-color:#ccc;border-radius:5px;border:1px solid #888;padding:0 5px;font-size:80%;font-style:italic;color:#060}span.runner-state{position:relative;top:2px;width:1.5em;height:1.5em;margin-right:5px;background-size:100%;background-repeat:no-repeat;display:inline-block}div.runners-menu{position:absolute;top:3px;right:5px;z-index:2000}div.runners-menu button.dropdown-toggle{background:none;border:0;cursor:pointer;padding:0;color:#000;float:right;font-size:16px;font-weight:700;line-height:1;opacity:.2}div.runner-title button.dropdown-toggle{background:none;border:0;cursor:pointer;padding:0}div.runner-title>button{background:none;border:0;cursor:pointer;padding:0;color:#000;float:right;font-size:21px;font-weight:700;line-height:1;opacity:.2;text-shadow:0 1px 0 #fff;margin-left:5px}div.runner-title>button:hover,div.runners-menu button.dropdown-toggle:hover{opacity:.8}span.runner-state.idle,span.runner-state.wait-input,span.runner-state.wait-next{background-image:url(../icons/logo.png)}span.runner-state.wait-debug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMfEyg27OEfWQAAAYdJREFUWMPtVsFtwzAMJINMwlHyt0foCIW6gUYQMkJGsP8dRauwH9GQacqiDffThoARR6LE4/EoGeBt/93w6AIG4J3N8FcA7AXVm/BBMDdP8JkIsASqHx20BtMD7bKJiBnAfErc5nzld31wDQKuBuEN3mOjHj+j9GZmVuaWv4xNRHwo+7Kgmxk4dCH/WyDuemDI2cMQIGx5ZaOv+Uz9RQNepfdYqPbzB2/9ekGwAaJ7ElpOuiTooFb7zEQw5Gyejs2TcMgZhpxhJjLRYkcjXv8mgJloQS4gpgoMO4RqsMjNEoSYGADg8XquFgqIs1et0Rm4y8BYqK9rJ+8nrm7//VwY4BDT8oh66w7wdINuY1i36FYDQr+2r5gWRoQBLcxaM71vhGbHtACkGCDEtBp7vJ4rbVhlGvc1g5ujOMWARjlMG3NeQI0xQPj4hG9dzgLeKLMkxRLzbmlBJjUQi5FqDmv/lp9O+LY3mWJAzY7F2JG5PXbBWwaZ9/hc+g3f2lCPW36Xg3nbn7EfAs3X9neMq50AAAAASUVORK5CYII=)}span.runner-state.running{background-image:url(../icons/running.gif)}span.runner-state.false,span.runner-state.stopped,span.runner-state.true{background-image:url(../icons/dead.png)}span.runner-state.aborted,span.runner-state.error{background-image:url(../icons/error.png)}div.controller.running>div.running,div.controller.wait-input>div.wait-input,div.controller.wait-next>div.wait-next{display:block}div.controller>div{display:none}div.wait-input button{float:right;box-sizing:border-box}div.wait-input span{display:block;overflow:hidden}div.wait-input input{width:100%;box-sizing:border-box}pre.prolog-message{white-space:pre-wrap;padding:2px;margin:0}pre.msg-information,pre.msg-informational{color:#060;font-style:italic}pre.msg-warning{color:red}pre.msg-error{color:red;font-weight:700}table.prolog-answers{width:100%}table.prolog-answers td{padding:0 5px;border:1px solid #888}table.prolog-answers th{padding:0 5px;border:1px solid #888;text-align:center}table.prolog-answers tr:nth-child(odd){background-color:#eee}table.prolog-answers tr:nth-child(even){background-color:#fff}table.prolog-answers tr.projection{border-bottom:2px solid #333}tr.projection th.pl-pvar{color:#800;font-weight:700}tr.projection th.residuals{color:#888;font-weight:400;font-style:italic}.answer-nth{width:2ex;text-align:right}th.answer-nth{color:#888;font-weight:400;font-style:italic}td.answer-nth{color:#060;font-size:80%;font-style:italic;background-color:#eee;vertical-align:top}div.trace-buttons button>span{display:none}div.trace-buttons button{display:inline-block;width:24px;height:24px;background-size:90%;background-position:50% 50%;background-repeat:no-repeat;margin-left:5px}button.nodebug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDQAOjeB7qwAABLlJREFUaN7tWltMHGUU/v7ZYSmXBbpbEDXYGi6VCmpo+2BMDETJQpvyYBVvNGmIIabaGH1Aa3wg6UubGH1Qa9Rq2jRdEqlPmBhSG0LUxhZptlDKStGEWIHtUsp1F3b3P8cHdpYBamEH9kLSk5xkM5OZnG/O951z/pMF7lt8TUT6wNFzI+8w0KAAZz56MffYRgTgBZACAEKIE8GenMNNTYLiBUAx8EyK9oOZD6Fk+EzDV5y0kQBABwAcxGvZluG2xm89lg0FgJkhiUHEYJIVSpLvwpHTN20bAoAW/BaLAkkEIoaUvNsvA22Hv7uRndAAmAEKffmcTBUP2ZJCmSBIyTuFX7l06IuBgoQFQETzAcv5LFjTTdiabQYxQtfoUWb5S8NnfaUJCUDjvUYdIkZWugn5DyaDodEJuRRER/2nfU8nYAYYUoYCJYTdkqqiKC9Nn6XNMkDn6473VCYWAMnhL7/U0zeZsGNbGhQFWpbSSHLry0edLyQQhWgZhfSemmxCaX4GVJMGgpOJ+Pv9TVfqE4dCmoj57p5sVvBkYRbMZhNIEiSxSUo+ue/DzncTAkAoqP+lEhHDnCRQtj0TaSkmTTeCiD+xN146lhAUWo2rJoGyYisy0tVw5ljS+8+9d/HzpiZW4ibicOMKBXUvFwIoK7bClmXW95C32sd+O13e1K7GqQ8QpORVZ0IAKCu24QFrSrgAyCDV+UeUH8oPtm+Kj4iX9IGVnBh4qtiKvNy0cBYlUc20iX96pv5XSwwBkI5GkTkzUFpkRf4jGQt0Ii6flr4LO19t3xLTUYIiEPNiEIzHCzajpNCqzU4g4t0+Eegoeqn14RiJmMJUMuoFWzPxxHbb/GguGcy0Q1WTfi55pS0vNp1YsqEM6L1wWyZ2leSED+YMPEaCv4kkHtW4iOeBrNWIF7+DBYuoA1ioImsD4Pr7Drpdo9AwCMClkPJGVAHIJQI2dCQFw3l9FAODE/rLF83JyXudpyrGo5sB3RwkDWyDmIA/em/hn6Ep/XKqTVXFfuepiplI36caLaNS0jL+rubZzm43Rm7p4xQtIjhR191c6zeSTYMijpxCQUm47HRj9I5Pf/lkX3DiTbTUSqM6iomI/QHC5asjmJic01ebj12OqkZArKkSGKDQ4g68ks35JTqvujE149dvZD9wOaqPr8c4bUDEq+8D3tkgunrc8PqC4cchxNt9DvuX63WgMVxGpbw3hWa8AVzp9WBuLhx8gBkHXc12x3qeyAxoYGUKTU374ewbRSCgaVP4WEGt66z9x/U+ExurQlI7kS2/Pz45i2t/3oZcuDnJkDWus3s6orGVMN4H7pKB2+Oz6P9rTB+8h4Wodjn2dEVrL2RQxMv7gGfMi4HBcZBkbbK8SRCV/Q67K5qbOcMa0IvY7ZnB4NBkOHgAN4SQlf2OvYPR3o0appAGZMg9gyH3lD4bThPUqmuOKncsttMGRTwf/L/uGQwvDr4rEKTqvpbnPYiRKWsR8YgueAG0pU4Hnh1o2ROz4A2eiWnRYmthopys6Wrd50WMzdhuNCRiABACjlSL7fXeFmPjcDwo5CPS6rw4cb3o9wNdX+8KIE5mZBo9AsYBhjjnarbH/a8G9y3e9h/uU+EcypgobwAAAABJRU5ErkJggg==)}button.continue{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDMd/Pc1cgAABW9JREFUaN7tWV1sFFUU/s7sdLZl2+2P2NJfWloDEQIaYhPEhESJBiSBRMODPy+mkYjRBx/EFNE+SFIxGiHhzajAA0GUJ30w+CAqQlECRIEEiKVLW1pK45b+7e7M3M+H6ZRZdpew7SysSU8ymUzunXvvN+ec73z3DjBnczZn/2sTABg/8Fx1QNOLACAWd5viGV6JQTP1WyWv/zwsAj5wAKP7nt8pgnaAIAmAAAlCTd2dZ6ddwdOPIIcJDoM8RbGP2RI4Vtl24sp9BTC2f30EQH2Wi/e0qzv64aTA/rxiIPyddPxs5R7AvnV9BGoAAkbICaqUxSffYcWhrBigrDT9lNuvRyht87ee+SnHIbSuD2ANSBgrXnZA3KPRToDxUdgjEdi3IrCGL0FZca+HFBQ/ebjA2CFbTpu5AKAnhY1SgLLvHb0EIIVl0ArLUFC1HGyKwRw4g3hvF5Q5BpAaRW27YU0u5jd4UTbD9huA5o15wAY480sCBTBqW1G8cguMymW3xyU3DQ4u2c8OaL4DSEpYZftyiRZAUct6FNav9ubOS9crWt7OkQemwogKpO3bFaxfjYKq5dMsJsBHvXta6nzNAS+LJK78CIikoUo67KQVQHQD0Iughaqgh2sgRvFdJyhqWgt7tA/W2ABAhgJQ7wLwzRMS/fLpXgFr753nvVQJ6KUNMGpbEQhVZpzEGunB6N8H3XGi1UUVlX6xkiaCozNbvNNuRrsxfv4QYn1dGZNbD9dBKyp3xynrnxha41sIhUMPtUXHh3aLZQfEI5EEFkyZ5ksIqQlYbhPlAi4h+STAtSA1QiF+7XcIgOCCx9NOVFC6CPbETaeikxsB+FLgdNl82AZwdiYv39i7tIXAXpDPAsTktePQSxugFZalTlRWD/afdDwJLvOPhWZhlW+ev1KpF24geYx0QirW/2daatX0kDdMF+QFAACQLadNEO+5VGlGuwFaqUVOL/TmWHXeAACAqrcudpEcAAiaE1CTI6ke0AJetVuaVwCcjY3qdtlLmaMZGMkrW3wTcz4VFKpRBUeKKzsOMlW3JcmWfAOgRAjl1BNRVnpVm7TPyDMA7uIdnldOyKR44HZRzD8ASdtOldEDt6k0zwB45YiratODdORInnpgKjxsO60H7hSCeZYDBMSN8fQ5kCQEHxSA7q8aC40R+VSgWknKlLaBIh6RaZ630iexR+1e7QwfBW0ocAoPJ6CsnYveN0/lFEAwqr0AUVvvPGoRb5FSzHA4kCTV16ZIdZE6ACtzWolt4V+kSmQ6yUPAgFZYknaLaZTU3mWfQYA4N6Oz0Wytd3fDM7DVtwDL3MUHSxtghBciUDAPEjAyJro1+S+seBSj/X+AKuE5NMOBuJVoW9qBRM4BAEBkV32zptk/UNRiNyyC4QaEKpcBktmx5sQQopFfQDvuLl4B8k7z9vjuGZ9Oz9SufVZXAds8QuEaNxz0ovkoqV4J0VLTK3Yr4nx5Wu7iJyB4tbk9cWRWx+uzsct7WoJGPPqFAK+4PK8ZxQjXtCLgnNgDAMaHL2J86IK3mA1qgo1N7WbXrP8PzL4KQyK75n8IsT9wqVULBFFS/QQCwWKMDZ5DbKTHm7AXAkrb0Lgj1u3LDw6/rLuz/A0RtQekThCiadCNMBITN70a6Lhlxjct7sBNX2R80pORZY1PSMoHuNoZXkfwEKhKUnmeB7VE4rWmDsS87zz12IWs5v3t7KOSMwAA8E9naAXI70HWTQs8cGdze2JHut9SjXXXs5r3am91bgEAQOTjeTW2UocV2UKqbS3bza8zjjOLeZMWsLA6ktVAPdcb/MkhvwD46YH7BSCp2qxq/DWrcU5c8oe9Vi3Mct7LmLM588v+A+5od3b4azuuAAAAAElFTkSuQmCC)}button.skip{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDc5pJgUpwAABxRJREFUaN7tWWtsHFcV/u7MeNeveG0H2/WTxE4opVQqfamNWsEPVEoiixIwoFaVeKhQgRTSVlSQFLF/SoRQhBASUvkB6kMNWKWKVIkiNUUJCBJC+kpUoVhO7Tp27KS2d73P2dmZ8/FjPbuz3hnHXm9aKvlKI69n7s75zv3O+c65d4HNsTk2x0d6qGq+xNG7GuLpSJeirZU/MX3na/lsYst3X19QCvxQHIj/fs+gptvfUMRegoMg2wCCIEACIEhZ/lv4H1z5nARkgeQClJxW5AnHUSc6f/DG+DVzIPnsnhtAeQrglysArQ88ACk9L5/7bxK/6ni/7c8qetyuiQMcHdHTuewhivMoQKMCkKZDGQ2AKgHxB19wFbYJyWcBOoFzSZmCyHe69v332IYcuDI60txopl8gOVw0oggtsg361h1QkV4ovb4quulYYC4BO/4enKX3kF8YA20ThLiLIxD5ZWe4+afqe6/n1+0AR0dCaTNzjJR7XPCqpRdG3x1QDe01VxDaJqzZMzCnT4JWysvM0a7rxr6qvgZnzQ6QUJnn9vxJKCNunOp9t0PvuPGaSyHtHDLjf4F1+e1iWJF8oTs2/pCKQlb7ru5++NHQ7m+SPOCuvN7zGegdnypQe40vpTSEtl4PgMgvTRbugTclGyPxw6/ET12VAT493Jiqt8cA9oKEatsGY2DXh1KY0mMvw5p7082LtGj5T/btm5kOmm8AQLLe3q+WwbOuHkbvrcuKEUC5lYEkp+Gkr4BWBnRygJ0vSOWy9njVhlBQdWEoownGlh7obUPQ6vyFoHHoC3BSM7CTsyDYpBz9CQD7AhkgoVLPfnESlAGCMHpuhdY+6A9cLOSnz8BZHAfprFXnS1K5rDZKDyHcdxfC3bf42rGXJrF07nn3/fHZxs7O2wJUScs8c+8tLnjoIWitA4XVX3nZWVhjr8BZGNsQeIAQ20R28m8wp/7ha8to6Yde3+a+q7U7M/vZwBAS4H7XiNbcBVDg17Hkp09DsjFvQTsulFeVkvMCNQ9HUuWpZRc/CRiGSCc03ETh1wHeCBLZmVMwWrfBaOqqsBdq24FMZr7gsOBLAI755wDV7UChFVDNHYXVrYj5FOzYhAueUHiw/eFTR6rI0aOMfu7Q5fbZlwgOQ4jc3BvQB++tBBYZAGZOFhZL8dNBL9SoZMjtbZTRBIhTcTmxSU8o8Gj7wyePVKsyKnrcVoIn3XCyYhd8bWp1TaUQFLku0AGQLS44peu+MemYi8X4VcKXNiqVXfvPnwUYIwTMZ0ErWWFTGQ3LiyYg2B3MABguS0if1YCZLD5XdN6pSfWFvOuusJhLlQxougseICPBdcDbEtMBqHzkM19UG8CI1aZ/YMJlXhwTul/ueTrgVQpZqZ8HHdDXAacolbaWz9WIAauAi6DYvuJRLtUBDpRtRsQJ2CJ4db5mm0EW3+uGjh8Ha2OARQZ8Q8hlCKx2G736orjJW2GXHruBDJSqZiADXipVjRwQj11KIANXDSFvyWcAA2uhshoGwOUKxIAcWFMI0ZPtAQyUkryGDhTtSiADLDs0CAohT5OFVRhwWVLI1CoDSjovEtC+exTy6nXAXQ1/OWOVDExEt9WHWp3DEN5BBQVxVU920psDvklcYv7dQ42vFvwQd8uZ0cinDG9L7J9IKLbChKxbg8IR+ysi+D5AQOhtD8qZD0ri0uJ93psTBRyqX/P286TjexXiVapiwFE4B9AqAVkBXgtBC0d87YZa+nwOyEoYqPC2UaHHAn8q3TnrTIH+/dNnpw/37ib4IiitLqBw5OMIt26HXtcApRm+DET67oa9NQbbjCFx6TRAy/v4edliPaKVFQu/nVjF7mv9o+/xmdfoOLcJeN59lxmfQC52AUppq9gVUCwkZ/8DiuXRX7V/6KD10M59yGllxcKvE/X0QRupAwNPXLmgaeYugCfcd5lLE0hc/Bdo53ztmvEJxCZegzjF9isDhZGhg7lf+7YS2blzvnvYsmq9gdH/WGLxUrRnt91kPkdyL0lYmctYuvh3tPTcCc0IF+dmY+NIzL0FT0wvakr2bj9gnyjfD5DWahvwlRv0XF15IK539EQvZfrTiyMkD7s6nzdjiE0dh23GQbGRvPwWEnNvesGPK1G7VoIHAHXltzcfUODPCIauAl5APtP9w/Fve85SG9DQtmZlVcO/K5OAiUPNjyiF35A0CEJpOupCEeQy73vCVf3Tzufuvz6K+Zr9QrOiy1vzSLz8QEfL8JH5ciea7iNkFMQWH6n8o5a3vrU9GvDTDwDtAz03TKYqbm3/SfqvEO1ugBe94En8fPCA9cBq4ItHi9WOe24440zNd+vr8MD37uDB9NmpXzTembedUSjuBPDjHQfzf8CT1/5gfF3H0ImnP/GxWiP4QEMo5RNCHykHHC0l2Byb4/9r/A9GxF3/Bu0ZYwAAAABJRU5ErkJggg==)}button.up{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDYM6zDhxQAABQZJREFUaN7tWW1oVWUc/z3n3JdtXudUzBfyZcuRaUVSmbVerDQLC0FIkCAR+1YIUhLNivslqm9ClrhR2ZQopPrSlyAQMZGQymXZjERN0d07d9e2u3nOPef5//pwPHdznqsbe+buwD8cuFye8zy/3///+7889wJlZp3Nj6RzTcv7O3c/2ExC3Wi9VW4EFGUrqStJeaVj133vTTgCpI6TAlID0G9lP1q8aYIRCMCTGhSBQJrbd9Y/P5EiUARPaoBiU8uX53bU3hspufEEm/14RcpOXK6xPUm4AAAHCviTIhWkhmUnob18SOQUtL98zhsXLo0Lgb4vVi7VmquE3lMk7yd1DSixwOMS5XlU3bUOfW3fQnwHpIZQDuve5Mra9Bkn3Dc21sDzn69+VqAbfS2PBSBZBHg98KSGshJILdmA7tZPQQpA3aCqej4j8ZJS4JgS6Nz3XHXCkxaBrOUQsCFAKAuIVUApACIABQoDa2KTZ8GqmIZU/QvoafsmIAVuOPtB9T9Az7tjJqHuvasXWoLvKXJn6F0oC/bUOljVc2CnZgGJFJQ1fP/1tO1H/9mDoGiQQtLfWNfo7DVOgC3PTMqL+pmUJaHX7RmLEJ+9FIhXjmJnQdcvTXCyv4eSc6nkaeNltFfUJyF4QCFe+zjitz8E2AlA9CgeYso9G6Hik640OSQVrTeN5kBfy6oHtJaXQ9nE5zXAnjIfoBjZ//L5Q9Bu1+AiesAoAdFqK+mD1LBr5sOeugAIvDVqczqO47+2/YO/2lfX6O4wRiDf/PRMTf/FsFTaMxYFob9evoiGOF3QTi5ITt8BKVBKITl9EVS8CgBQ6DmHXOsegAzegzroeu5mpUBjBHxLngAlTgpU1TSoZHWo1YhxwYd7/iiczK+QQt81/QAU2JUzMH3ZFminC52/7Qa1G75+Mum56xamUTDaBwhpCOu7Pem2krqn5yB/8jv4+YtgRDMDBRQNL38BLPQhd6wZUugNNd8hgjVz08iZ78SU5SEAq3JaSfn0n/5xKPgsoY8R0g3qbopsJkWRGrnje+Dl24s5LEqvrX/HPzV4P3MRoJ4ZRsCKV0Umr+7PopD7OwQvQv3a3LntTWo9iotPv5/aRGqb1HC7ilhFERvrt/tHhu5pMgJTQznAsiMJuJfaBo0TbJn3evuuUuP0EGuse7uwf8zuA0yviJF6MikggioS1Yz83otFzQv9r0rdB64el1XTHdsLH5Y620gEMnW5ZKw/roKZR4EkEAyLV1eqy5eKEdDC1pL1YODDD/967qs35Uo5eCQG9bWP+BDfDdfJgm0dmWj06vCVD630CuufTMO/3rkxowREACWRFYjiIezSgPSH8/xQSyXcNflCxTLXd44uSSN/o3PNEMgArLxyCYGKHh+0N7jOe6W2mrUNfYBzYLhHG40AKIFbo5oYpdikaGi4M11GEY7QjJIQdRE8DQ145nOAOqgLUQCHjgzlSUCC4hdJwDx4gwQyIJMDEYiag8Q8+DGMgERKaCzMIIGB5IzyNMufgB7oAyUkVPYEgkRFySpU1gTCJgWlSuQAyzwCxQ47YSUkxW6b+etr3CwzMk73JjM+qTn8SsNCWRGo3wIX9HcCGA6DApTaYYrAVT/uPnr3iRFl2k9/LFamBDhC2CoyB85nazAe1rD4+IjWHz5RIonPZGePCwGKb0ZCownleEmo7P5mHVUfeLj20IhePnIat+yWTXT7H9J2ChlDGcHsAAAAAElFTkSuQmCC)}button.retry{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDgagWd5GgAAB1NJREFUaN7tmVtsHGcVx3/nm9n1+hLHzj2NY9eNMWqFBK1DUAJSIhRAQqqoCjU0IkUgQXkBBVUUpebBCBR4qaJGQmpA3ITKLShUsgJ9KWoVKanS0kJL1KYkcZr6Ejtq1vb6speZ7/AwsxfbMxvb2QQq5ZPGs96dnXP+5/zP/5z5Fm6v2+v2el8vuRk3VUUyP+tZaxP1zdFXpOZfL65taZwck97Tc7ccwPhP7+tyHN2tIrtRs0NE1oJZKyICAiJIeAZBSmfDvM+D12lBLqpw3PruH1q+duLiTQGg/Xvcq+vTnxfhO4h8rNKx8mtTfm95ICqv/Qti+lY9cuLNmgEYO3L3Xoz5hYhpj3MMcTCJenBToWNUASGggnpziPWjQHhinMONdfUHpfeYv2IAerQnMZ6b/iHGfBfEBEYM4qZIrO3GWd2B29KB1DUjTnJlteNn0clh/PfOYycvIToP8MBsqnHfht5j08sGoH/CGbvS/WdEHihGTZJNpNp2kty8HXFTtReCuWt4Q2fQqeEKEOZkY6phr/Qeyy8ZgPZjRlu7fisi+4ppTW78MA1dn0Xcupsuk/7Vs/hDL5fqy4g51rD/xBdF0CUBGDly5wFR53CRm/Udu6nv2HNLtd4f/zf+yGuVdPpq0yN//fV1AQwd2dJmbOItRBoFQ3LTvTR23/8/aVje5VNo+lIRxHBT1u2WRwdm3aoa6zuPq2ijKDirNtCw7TOgfuS1tpDFT1/Ay4yg3gxayBFkeYHEAmDATSBOHZJswGncgFnVhiQbYn1xtvRQmL6CFLIgbMmkvAPAoVgArxztSTA7vh8FFWi485OBcbsYQG70VXJDp1E/T1GdYiU2ok948hYiDs6aLhJt2xGTjNB7wV1/D97IPxAFEXlUlR+bOACbZ0d3q2oLKE6qFbd5axD9BUf28knmLv0d62UBBVUUG56D/0HR8Fx+bcvvqaLq47/3Nvm3/wbeXKQt09IOTjK8r22f/c2n74vNgLV8TkRRhWRrV2TkvZkx5oZfQgKmoMpZMfwRq2+okXEDucBBgESApQjCdZoM/jqr5oNGzKdQ9qiAnUtTGDpDYuvOSL9M00bsxGVUwMID8TUg+qGQwrir29EI7ueuvArWoiKIysDGa5selP4XvBXU6KFrP9/5MKrPqCBeehBnwz1IsmmxW03rYeKdMCjmo7EUwtpNRQqYRGOQgQVHPn2hRAGxfH+FzgOw5uunf6/os0Xq+elLkTbFbQwohKJit8UCUHQzalEUcesX8VHzGbQwF/AdTW88cO71G57trR4vBsTPXousA3GcyvpqdqsM9atVQNRijLOoBmx2MgCnoGIv1kLrRf2zVp1AuLKZyLorFz6oUFelD5QuitR+62eDSAiIMlWbduWmwUfVoLYQ3XPUR9UGo7iCG58ADSKhRBawWq8CpOZr0m1NIScqiFjU+pF2A1BaAlE1A6phH4pIJdYvg8RoDefQwC72unZVbXUA4fNtbCrLIG0tB+nQrl2C3aVQKGZ8QINuiwA19L9MXY3NQNGuVquBSpSRNaBeSYWCP7WmkMbWQNlu1QwERRKMLXEZsKiY4NGvhnsyhPyuloFA/eR6GSjKlR85LAWRsFgxNfJ+FiURJlSr1kCgfhb34o8SO6xIn4g0BNO6CXhdGQmNr4Gw2e0aenLzKyBgDKIoRs7kJ5zHOvsvZZebgeCeGmu3UuJdkKcF7g3ac6goKsUGFRbp9SJBM2p7EIOEwx2W7XWrvVPAM8urAIuoCUaUOAphUTWIgFHhX/NpUzGjoySb21D1Fx2mbjWY5Lxri7NTqL15X3hjJTUQPE8QaTc4ys8Trl2V/6bJJF3gyyUdlgTNd+zATbXi1rdGRsIYl9a79uIX5shNDJKbfKdIJ1TMhKh8YeuBodeXWQKQCLMaV8QL+o/5wLfJbevL7wc5UFR0tXkyoy+jNh9y3Y+eDMWQS18gOzFYyoRFz6nvb297bPj5lfaB4r3i7FY+2ZXkY1tf7imEh8I4YP0c6cHnA+ci5nL1cky9e4rs5GAl9V40Jrur/fHxCzfWBwKKRNktjhJFEIsEfPCQu9uqOQ6sCclC86aPUN/aVa4jL8fUyEt4uanSQ7qIHHdnUvvv6B+ZXanrVw/fvdl3/JHFe62xGwWTiwS88wnvRbGyCzgfusvUldfIjP0TtR5edoL05RcoZNMBT4OIPbl15tpDN+I8QC6h+ciNgPiNgnxsCz3Xzzo3Ufcs6MeLGxt1Desp5CdR6yNBBDxVvtV5cPrpeSQY+EbDkr2eS6v0Hiv9sDH6VNcvEfmKhBvIVTKRV+QHVWeAwX5SNpH8FfCl0u5M6WZkBNPbeXDmucrvTA08vK75/t9dXeaz2IpnkaozQGc/2bueyO9T5dCCPvEu1nxiofMAZKZv6Zaju4TYKOT7LhxKnAd+gsp/XMf0tn9vZiT6Gxk61g8v2YH2daP+yTf/j341nDravS4U8WUcK1+m1gCmbzGFag7AN9OW2+v2ev+s/wKIypfbke4fXgAAAABJRU5ErkJggg==)}button.abort{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDTcgwTHWUAAABeFJREFUaN7tWU1sVFUU/s69b+Z1eJ15pbUF6gCagIFEWFgXXRhRSNCVisRuXECFDRsSY4IhcdHERGITQgKJuoBUVyaQKK40xhYlXbCgmyaKEgP0Jy0ghb5pp/P33j0u3kz72s5M3512xEXPcnLn3u875zv3nnMesG7r9nTs8nuQ/4e9qJY/OX0HXgewy+7u/3K14PlsZ2y2pfEIg/9KHO2/VncCTt+BV5nVBYCaobjXdjIX6aMbmVrBO3bsOASdEkRJBvbZ3f3X60agBJ5I7AUAZh6vlUQQPBElSz8DeE2HhAi7MHVp/6EgeAAgoiQEnXLs2HE+2xlbJXgAIGZ1IXVp/6E1JZC6tP+QIu4pgadYC8hqq4lEOfBktYFiLcX9xF5F3BOWBOnKhho3w2jvAEkT7uggPGcMZJih5FQOvLC3w2jvAHs5uBND4Nn70JGT0JFNCbxMJCGsVhjbXoFseSFUJKqBF1YrZCLpO6Zxs5acSNfzMpFctE6l/4E7MQTljKBSYq8EPmhealwrEhRK8xXAhyEBAGHBVyLBrIYFU0/i2MD3KxKY7tv3Jlh8HkxYY2tnRfDVSJCrzjEBkOLDsOAXkRi7Ac5MzZMAqY+bun/7KbjOWI5EbARR80KWSJA0V77OrFYY7R1wAXhTt0GGmUREnhXki4A1wAPwzxTBCoOaJUWeWzGJm45d+5aIPpvn44zBHR0EWAHCqE4ivgXRHQch7a2AmwMVwSs3B2G1hQZfiianHy5Ikri3ccPsN0vXli2izry/6fdswXgAxh6SRoILaai5KZAZB0WtKpe8AmQEsmUnOD0JlXkMVh6kvRXRXW+DGpr8NZpSBHGvbWUuUtfy67niLcSXO2NOOnYcHD75fKkwQACnH8GdGPJ1qun5sOBXfMi0SATAU3FblXV8aTXYdQEf6iXWIUFF0TPrVaW1gg9VC1HXjYxtZS6CuJeZx/3EHvHlEUjsmsALY1XgtcrpspFIbINs74BobJ2XzX/lee1yelkkmOFNj8CdHAKnHz0V8FoEgiSI1TlmngYB7Iz6QIoJGwp81lkMXqlpQJ3TBa9NoERCSGNOSNEkiMBuDpxzIMx4+EPNODjnAJ7/2JEQTUQyowteu6XUqSrDSKgwcRPKGQEBYEZN7alWBGZbGo8IQ5wXREkulgfRHQch4lv0vEaATGyBueMNSGsT2M2DiJIkxflUs3V0zSOwlp4vvXrM/tUbpp9YFYF6gtdpimqWUM2yEYb/0BUfO6ISaFoEPljFCqsN7Oa05ET18nzJqwvF3DPLPK/T2VWKhKiX593RQXhTt6Ee34Y3NggwVwVfaySoXp4PeBEgQCa2w3j25drL6gqRkEunxMkXdx6GoJ7g0CmS7KzxYDUNIEtEDZxLgQtzoAa7elMEgKIWqMGGykwBhTSIKAHCnlyDMfaSee/WlT/AZSXUdQWekOK+KI37mIFcyj9QRkPLhkp3vZCnifhTZoyj2CuHak9l1D8zlypKz587kRD3u67Aq9pSnrl6997pt54fZvBuIrEJyoVKPwRFYhBmorznZx+gMDIINTMBEgaYeZzBnySsuT4z6t7MFYyMTnvqOSMojA6Cs9MAUXGsghP2BwM/ag22APwKgOAVQGYc0d3vgja0AF5+wfNeHvk/f4DnjEEYZqkjOxE/+stXS/Y7AeALAGA3N98nQ0YB5c57nuemkL/1HTg3AzIiYK4+2Kp4C9nd/ddJ8WFmNQwZAbtZ5O8OwHtyZ8HzM5PI//2zHyHDhGIeV6xOlpseJKz01wx1kpnHyTCh0g/9/85MLnj+yR3k7w6A3SwgI1BKDZPiw9Xmoyu+xJWmdCRN7Xq+Wnu6dLhbbRqnXQuVG69DyGVzmzD1fDkSZLUByls0hQsDXqucXpQTHJg+VNB8iP3mc6I0uiNBK2p+1Z+YSiSo+O9awJcjQQRt8Nr9QDCxqyVsWAsmdpiEXZOvlPMTbCU22vHM1VrawGU5MRN7B0I9WTp5rqut5YfudVu3p2j/AkT4owo7DZieAAAAAElFTkSuQmCC)}span.depth{display:inline-block;font-weight:700;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAUCAYAAABF5ffbAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wQBDjQRuYQ78AAAABJ0RVh0Q29tbWVudABEZXB0aCBtYXNrQcBmawAAABhJREFUGNNjYEAD7Wdr/zMxYAGjggMlCACJuAL3jmFt7AAAAABJRU5ErkJggg==)}span.port{font-weight:700;padding-right:.5ex;margin-right:.5ex;background-color:#ccf;display:inline-block;width:11ex;text-align:right;border-radius:5px}span.port.fail{color:red}span.port.redo{color:#ff0}span.port.exit{color:#0c0}span.port.exception{color:#f0f}div.prolog-exception{color:red;font-size:80%;margin-left:5em}div.render-multi{position:relative;vertical-align:top;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAQAAAA6heU+AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAEMQAABDEAbRyZ/IAAAAHdElNRQfeCg8LIivxaI+JAAABT0lEQVQoz33SsW5SYRgG4AchbSkcYrVpo6bGoXFydvMK3HsJLt6Ct+AFeBVunVx0cjFODvofqyDQFDVttef8cg6IA4SkFXjX70ned/gqk4kV+SUVnGs8rayC54KA/e7DvdpydiZIJXbEJyyFp4IjW27IFG+Xwp9SR266LhM/PT5dAn9IfbGtJROtP2ch/C711bZELmrYOFwIB1JtOxpyfzQl1n4vgANBx65NuaGmlsR69h88EXTcUpcpNLQkknJ3dAUeS327wlr+fpxe57Av6F1iLYmxOLgEe4K+2zZkitm2xFgumsOJrs/67liTGc4qm8YyUbw7gxNdwbE9NZlixhKlXBTl+1NYaU9SPfdU5Ubz0inL5aJya3h2oBa03XdNZqzZaR5uvq5/mFyUcVSUo0JRLerlxQFqwQPVN/FF+T4Jj0YL32ial8/eJfDK6vwDMhCTheu9OHEAAAAASUVORK5CYII=);background-size:15px;background-repeat:no-repeat}#render-select{position:absolute;background-color:#fff;padding:5px 20px;border:1px solid #000;border-radius:5px;box-shadow:5px 5px 5px #888;z-index:500;white-space:nowrap}.render-selecting{outline:#800 solid 1px}.render-multi-active{position:absolute;left:0;top:0;width:20px;height:20px}div.render-error{display:inline-block}div.render-error span.error{color:red}pre.console{padding:0 9px;border:0;margin:0}.render-table{border:2px solid #333}.render-table td{padding:0 5px;border:1px solid #888}.render-table th{padding:0 5px;border:1px solid #888;text-align:center}.render-table tr:nth-child(odd){background-color:#eee}.render-table tr:nth-child(even){background-color:#fff}.render-table tr.hrow{border-bottom:2px solid #333}.render-code-list{color:#040;font-style:italic}.render-ellipsis{colour:#00f;padding:0 5px}.render-svg-tree{padding:5px;display:inline-block}.render-svg-tree svg text{padding:.5em .2em}.render-svg-tree svg g.collapsed g text{padding:0 .5ex}.render-svg-tree svg polyline{fill:none}.render-svg-tree g.noleaf text{font-weight:700;fill:#00f}.render-svg-tree g.leaf text{font-weight:400;fill:#000}.render-C3{display:inline-block}.answer svg{vertical-align:top}.render-graphviz{display:inline-block}.fold{display:none}.pl-ellipsis,.pl-functor:hover,.pl-infix:hover{color:#00f;text-decoration:underline}.pl-ovar{color:#800;font-weight:700}.pl-anon{color:#800}.pl-avar{color:#888}.pl-var{color:#800}.pl-atom{color:#762}.pl-functor{color:#000;font-style:italic}.pl-comment{color:#060;font-style:italic}span.diff-tags{margin-left:2em}.diff-tag{border:1px solid #ddd;padding:0 4px;margin-left:2px;border-radius:5px;background-color:#e1edff}.diff-tag.added{color:green}.diff-tag.deleted{text-decoration:line-through;color:red}pre.udiff .udiff-del{color:red}pre.udiff .udiff-add{color:green}/*! jQuery UI - v1.11.4 - 2015-03-11
-* http://jqueryui.com
-* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons,.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:active,.ui-button:hover,.ui-button:link,.ui-button:visited{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-icons-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-icons-only .ui-button-icon-primary,.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary{left:.5em}.ui-button-icons-only .ui-button-icon-secondary,.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner,input.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-next-hover,.ui-datepicker .ui-datepicker-prev-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-next span,.ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0 0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-state-active,.ui-menu .ui-state-focus{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:700;line-height:1.5;padding:2px .4em;margin:.5em 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:.4em 2.1em .4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:0 0;color:inherit;padding:0;margin:.2em 22px .2em .4em;vertical-align:middle}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0 0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABkAQAAAADcH0/XAAAAAmJLR0QAAd2KE6QAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAASSURBVCjPY/gPAgyj5ChJVRIAypHyHLPbLnsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDMtMTFUMDg6NDk6NDUtMDc6MDAwWwWoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwQQa9FAAAAABJRU5ErkJggg==) 50% 50% repeat-x #fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkEAAAAAAy19n/AAAAAmJLR0T//xSrMc0AAAAJcEhZcwAAAEgAAABIAEbJaz4AAABaSURBVBjTY3h8jYFOaAPDo/cMj/QYHuYyPGhjuF/BcC+L4W4swx0NhltfGG7uZ7jRzXA9nOGaEsOV4wyXdzJcamW4WM5wYQLD+SaGcwcZzt5iOOvAcObMACIAsZae6pVZewYAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDMtMTFUMDg6NDk6NDUtMDc6MDAwWwWoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwQQa9FAAAAABJRU5ErkJggg==) 50% 50% repeat-x #ccc;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAAAmJLR0T//xSrMc0AAAAJcEhZcwAAAEgAAABIAEbJaz4AAABISURBVDjLY3iXxzCKRhHV0bNnDM+NGJ7fYXgxk+FlJsOrOIbXIQxvYhjepjK8i2Z4H8DwwZjhIzPDx7UMn+QYPhmOolFEDAIAjUD2JAAuNW8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDMtMTFUMDg6NDk6NDUtMDc6MDAwWwWoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwQQa9FAAAAABJRU5ErkJggg==) 50% 50% repeat-x #e6e6e6;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{border:1px solid #999;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAAAmJLR0T//xSrMc0AAAAJcEhZcwAAAEgAAABIAEbJaz4AAABISURBVDjLY3j6n2EUjSKqo1u3GG57MdxxY7gby3BvIsP9PwwPMxgefWB4Us7w9DHDcz+GF/MYXl5ieHWW4XUpw+uJo2gUEYMAvlejJVIWsXwAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDMtMTFUMDg6NDk6NDUtMDc6MDAwWwWoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwQQa9FAAAAABJRU5ErkJggg==) 50% 50% repeat-x #dadada;font-weight:400;color:#212121}.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQAQAAAABHIzd2AAAAAmJLR0QAAd2KE6QAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAARSURBVCjPY2hgGIWjcBTigACVaMgB0zSxaQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wMy0xMVQwODo0OTo0NS0wNzowMDBbBagAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDMtMTFUMDg6NDk6NDUtMDc6MDBBBr0UAAAAAElFTkSuQmCC) 50% 50% repeat-x #fff;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAjUlEQVRIx+3PIQoCQRSA4X+eYhBsg4iwowZBGDF7COtWq1kwad37eAPBg3iFFXaL4xvB4hVEw0tf+NNPvummOQsAGIZhGN8G1ZTqmtx99u5e8ARKYciMrTBi7nZCQeQkFCzdUZiwoiJfNDTx08gPPbRTcWMW7HlFvbZJ8ARXCgM8a0Ho0P+LacMwjB/yBjxhJFOI7HkuAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwMFsFqAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wMy0xMVQwODo0OTo0NS0wNzowMEEGvRQAAAAASUVORK5CYII=) 50% 50% repeat-x #fbf9ee;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAiklEQVRIx+3PsQ0BYRiH8ef/FhLnXCFWEI3WDkojWMAAltDQi0R9ExiADS5m+D7JHYnuPgWxgVC81a94qoe0eMzuEwMAx3Ec59vQtnUdAsmacZySsmYXK9LwNrqujR5bnY1cpcKHgqOS0debV6NUNHLtuRiZNjoZXVY6GB3mLA0oGPzFtOM4zg95AkctKGSanwlIAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwMFsFqAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wMy0xMVQwODo0OTo0NS0wNzowMEEGvRQAAAAASUVORK5CYII=) 50% 50% repeat-x #fef1ec;color:#cd0a0a}.ui-state-error a,.ui-state-error-text,.ui-widget-content .ui-state-error a,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error a,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon,.ui-widget-header .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QAIn/tYtYAAAAJcEhZcwAAAEgAAABIAEbJaz4AABonSURBVHja7Z17aGXHfcc/Z70br7y2e5W0MRIp3gep+6DsXUsmcXHxVds0awdiaUuaUihItpEaQu3EUChJwXZK6F+x3QTTrklW20ACbkKkNWmyTh+SsWkTR/JqcesmDX5BI1Ga9qruH3JYJ6d/nNfMOfM659yre6Uz30V77z2/ec9vfjNnfr/5TXAcjybjwKAL4DFYeAZoODwDyBgjZGzQhdhNeAYQMcYmsNkkFug1Awx+/IwRVo65CYyjY4Ek5cHXsYeQGcAsAMP0nwm28aOPH8a5j2nD2PJOOrFaDaLu34pZwJTyPpIRIgP0QgCO10ghiZuMw/KoExcCAraALQICQ8p16jh0CNJ9gKSKyTjQIYRC84iI0gkqxU9GmS5/W95hzbK7pmyr4x5CJgHMAtAVpjFonz6i3E1daE6l3tg0TUFiyvXkzJAhKL0TaB5FpjGYNWrVsWNPwTw2zWU3y8AsZZuc2VMozwBmhANvmjE2KzOYeQpKUh58HXuIXjPAXscYm/upe+04OOgCDBm29sfSzh1+J7Dh8AzQcHgGaDg8AzQcngEaDs8ADYdngIbD2wPk4w66/LuMMvYAbhYBNmXMmNEewJyDvXvq2APY1eFR2fcVk5SzB3DTgJmbUN9B45rvrmnbut+W+mbuU5/6vrEGKNoDRNDvhiehTPo2Pd0W28UewFQ6c+72+GaEcdrJ576AbA+g+i5jy0kKqMPYx6eLPYBp/LmVTc8+odXaoExOewJVtIEmheuw2wOYmMsmf5Kae3WwAYNvnLr2AIMu/y7D2wM0HH4jqOHwDNBweAZoODwDNByeARoOzwANh2eAhsObhecRDnCXv/5eaenyH6wXvS+NMMgShNYSVFcF2WMOoObyFBCCUdfv4h8grEApi6p52MofdX1gTMXOHFVju9XAJVSJuAekALbqBw4V0McPHBrIpQqhQdnjUr7AQJM/y+WRUOwtYK6hmYFCS2ywDWKp/OIU4Fp9nbWOvZGCHgj40KiJtM2idUoQprEDJVXMXZVLMrz0ZQgNdHPaWe3Mw0AsZQBlF4Ghw+ixhXLhzmpj3K1zA4fUTR3kkm7VFjANQZe07W1QoJd5DcxEnEsoNc0sAu0cbE7DJmLdRLRtBNlyd1lEVoWdxe10qQRlJICb6Ky3yg0cpUy/yhgYBaxbuoFDmKowT9PmCVAZ96Am0OAw6BLs5fwrxPU7gQ2HZ4CGwzNAw+EZoOHwDNBweAZoODwDNBzy4dDEWergYPcH3k+4tICLRrRaPNvZaNdcSiFjgORglIu792oN0DtUS8tWcrcWMLmazbRxY6VjR3rK5J++DmOVWyDMlRJQHw41H+F00WiPKZ71jgV0abm5htCX360FdHmM5Y7XjpWKndXAJoHqHU0vHNCVj4a5uFO3HcHWHRB1s6Sxl0CXjt2Fu73kbg7p1RqDYtcGObrtYHnWOarziaGUsllhrFNYB8UwZRnAvQGCEnHdSmBuQpf87Wf79fnbYtsYwN4G5g60M4CZgTQMUO4tIGuAKiqLQEhDnXoofZryr4Ks3FXXEKbcx2NqMoOrPQiY8k9iqtcAtpQz3w2m8835Upa0BzA1gLyAMVXfXDhTFU1piFWzm32pusDOgKYabOUcSGyVTsENpu7dSq+9cSslZacAN3Oq0OoiwjwL1ont1rzqerjNwfVN2kzpVL/Uxr4GUML7BxAxZr0xad/BHwwR0bjbAvxWcOPhGaDh8AzQcHgGaDg8AzQcngF6jUGqsysgbw9gg0lf5VL1sZr67n6jfukCy2b3kNW9aA9ggklj7rJLmGjsxh0OmOpR93CV+Xh4YD3+au9gXXxT6gNCthMoFsvu7be42Sgejax2+7frRjOYNHa22IE2nPhUp+00HR4NnajuNd0VqNcAOqMDs74qmxqqGC1EI8duNqX3YRDiqusLSjxV5avK336yeSiRMYCsKCx/gXx0wXrSfeXjB2S6vGoHqLMwdV1QVMvXLUQdHx99QMYAoqKwCg/bbhKwK1vrzo6BIEHUEkL+VIXozShW5SBLj6GRE+IUkKlCVAI8EvCRuZcaW0Z7ABdtv909hBmZLYDapMLc9NkkpPcukoQMSlLFEFUNavoCtTpYt4wBF2WpbhHYC2Wrm9Vi1YWmyyISQwn24GUy3h5AxtCI5t2C3wmU0bDu9wzQeHgGaDg8AzQcngEaDs8ADcfwMUBrWDZJm4E8A7jpsk0qm9CJqgvRorsrr2KD9oMwNCjnLt5NFTNaozxdEiZpGcNVdVmfYR/dAF4HMgOYd6nNu93JqG7RVbJAmG6Uqs/uRaJ/NA3R1cRPvlVzqi5Kn/Iay32IjAFkd+9FZPpwncv0gCDu/m1lXmbRHon+bUYNZ2eT3NX5yxYF+VTc3Ec0DsnRsKzJzB6vbZqspPurz+PbTq6c1af/9U7VE2O2jL6ProCvg4QBkqY1mUyBeGmCGvWvRNHJDzn3fBnkixCKJdyU8g5o2BFQPbLDoWKT6R2M2G+9cL1WQkePWCAsrCMSRbDaK79cnl65lW8AyrwFZE2ss8mzXclkoo+m1C4QFORAIOSumojM9kSy+wiPFGXeAsxGVTYnZzbfHdsp1eU1MnB8lsBmsNZYuF8YYZsiegPzGqAOGnj23wXD5iDCd9IuY/h0AR67Cs8ADYdngIbDM0DDsZ8YYCLdaZjoS/oHORz/G7alcw1EDDAdN9wK05VT+pRF029DyFnJWqBsJ06wln5fU8aeqMUeB3mLm9hhh5t4S8kCE9bSH4+pusMYerotJnwo98+cQ9pL0cGQkAe4BLRYEgJnr2TT6fMZljVJZ+fqFjhrOFlUTD3CLC8KXQhznJcady0XfpL1EnS5hKrSHedl6fcJXpF+H+YmNhgBdmjzfd7UtoA6Dxdn0vqbP22XYkchspa31THdOk84+RIAq5pduCUFg6wyhQ4LmgKMpN92CrRFnkCPNSLHEhE2CVmTclhjUmKByRzdjpeF0kUlzMffYIQjwETMCLpywqSC4lqaOpfPmyGyeJpSwgAb8adohiEW+RLwfXaM27SH48+z2hCHDLHneJF5A31GckExI8kqgHWBBVSjP38+t9ghh3gj/X69sgxHuJ6AawylvNNAM0tAszo+UKRSjsGT7v9N/kF8nM1lXUsC32enEEYuQsQAo4bUdOMGbBIAnk9ZIGSG5xUhEhYodn+EVu6zWLobjCVt8yPuAL5JWxl/HVIWUpdgMpZUk4UJq99Iuv93GZFZwHU9q+r+YgOCWVBFY+dVJc0mARIWQNP9xLmjXeSdyH3mcZjX4283KqhHuEybDaDNZd5RWAPkNalVj5naBb0txO/z5cKzqPsXOAJ8HSCZwN1fA4vdn6/gNVzDNYxwjVZIXs3VXA2oRtiipfthjOeZYYbnNeacE2wxzTRbFdf5I/xi/G+kUL4x3kXIG7Rpc4CQdxlNSic1nX9U+NPhMDbYQnxJ8Sxi+rO8jb8BYIrViFD9jbZYxRFrnO8ZQtokwBhbEI/9LUXzT0h0FQv8fO4z30TRKGkTrYhkOfFONkB4L9igbbAoqiPgd2qGUNt0vBLXL1qfpd1vYgBxJVsUOsXu/zNelH4VYRaJ5jXApOI1rwwd4J25z3wTReuLg6wVXgGzRbL4JL9Msy3y4KvCXxFzLArfq4XQ45WUxYXuHyYHERPArwq/X9QspPqLEBTd38vUIwxG7X2cl+XuHyYG8BgI9pMuwKMCPAM0HJ4BGg7PAA2HZ4D9hU/z6XIRZAZoORzM1sPl5k03TCg16pOCLrv4lj9NKP2bztHnc3TVppOoLT/eBzrAn1vap0Oncrtdxyf4BNdZQs0yy2zyQ3wNbNFlElhT2OavcEe8A/UwSxxjSaGxfoJ1zgILTDAv0ct50Ex0+3L4Sb4bP41SuyW39RPpwxOcLcR31ce3gWjjp/f0JEwAzEr2DgAdVhilC4zSzb+v06ILLPAE85wF5fmJZ7kNeI5fN7TubLyZNMcqr4kMEHV/pE0rskDIeO48fdnbw6PzhB/lcT7K4zzAI5oGmmCdaZYKOj3x6KcqB5fr27/Ne7nEKf6JX9P4OGhzmZCAk4WdvowOGOivcIVDHFfSk+afAxZLtmBCXUjV7SJ9vqCEX1DurE6zxBzLdBODG1EdnGynrjFZyVGLaCug1hzeyiY/4N94nRc1OsEJ1phhWavSrYO/5z1cpM1FbuUftaGivfS2kS7vWcq4orAVSpCMvkUldVRqNZ3lhdra4kaHJwD3A6Px9NhiO1sDnJV209eYNJh16LDNNl26bGsPd/0zv8O3mOXrLBQMOiDp/iUm+rIN/Ft8ldN8g9N8WWm4cRNgOh+Z0AMCrtLSD3FYY/gyK3V8fi+/E3d/cnqyW2ot8Ek+I/3+DJ8shDnKUTrAIywyx/mol8Q1QAjxGkAlwO1TQEA2w4VK+nvZ5Da+w3v4Du8paK2T7lePfnEfXbWmiBzMdAWDlDz9K3yIJ/kwT/JhvsYZjQuJNqCawzP6VfzESFfHz+beCM/mbBA7rKS1iuonrwJaOalaXAOYbw/P2E+i5bWB+pHXZYZljsaiW28PqMNkYY6TGcDc/XJFbSYR28qnf8wR7uMG7uMa/pQzEm2cH8bfNuLPEz2lZ91/XlPm1XgKSGqW7+BtaYoodn8LgOeA24jFey7/aO5flaPlJYA4ivONbkYUohU3f3l7mKji+u5P3gISqN4CRlMXNcU6mBeJycz+L8bS1aEHhIbuV5VQ5UgrYgHVG8D7uMhHeAKY5y85zd9J1FkWeYAui/m4mQQQTRKrdOCCVIEFZRjblSym0b/GLQIL3FLQ/5/gZbpky88TCrr8Ow+b05g69Dlr98NU7jWwiG2BxfO4wu/xFQCeoMsVRYhHgLl8XFd18Mn49cej3+hAXkz3BLMARRb09gANh9cFNByeARoOzwANh2eAhqN5DBCpjTsKSidV5d7kkI5O17fHPBKLDHAybYCTldOr7h+gLlqEnIu/n9NaNTwU6yBWCizwG6xwhjO8m3fzPX6pEDNqnY/Hv8SbjiOc4gOE3MqthHyAU4X4ZvcVeWuGvD1DkW4LMV3IQ6YnFUlfA0+ywSp/ASzSStWexURcXEn2x+p9lkXaXOYkG4pNlSjnRe7mXLzfrt8PP8arFHcKj6Tf3+LHir3QRZ5iiTaX43TkvXq7OjzR73WVimTz3muo0A52cyGC1FBmTeHKN2RUiJGqszMJsMEqUyzzQVpsK07CDB6LwAazbKBSqCZ77Un3q1SuR+NPtSr6TX7MDjv8mLeU9KdYBkZTnf5q6RqcoJteiVGUA4kdlE6GbjMX61rV+tYwTmUCtFL4XYwzzjj/lTzIJEDIDMucYy7mdLM9iy57EWXkgO6GAhEnBbZUSahzgop1kbsL9Lw+LT9CssFwjJcLuT/KxwBYpQNKCSSeeNxRSgB9/iEjscXViDKFSAJ0IVbJvVa4XCeRABPAWaUz75A2B4CfAunRNlkbGHX/3UpPQWHuWzVlj675XXA5PRs3p5yg7oZ09Ku7X7R5yO+1P8lPU/3AyzxWiP9xLpCsHdS7+oeUO/CuOJJ+/gj4WUWIjwGwxAxLHFPIgJDsWGpxQE0A/w38lAP8HC/wcPRYlADbtOKmW6FTweQLYwg3gydTDjYJ8EX+IP2et4uTu1/VgSe5X/j1KV4z5K5isGiM/gSAK1oJoPMiFHJMeh7yWkECiPIj0u2VWwPcDPwnAD/MWjcTe21abPMU06zQUZhEZStetc9v8akqRJD7Z6aqctiIOy/7LiLp/khG3MazEjXp/ilGCZTj9zKfYy7+V+x+2GCRB4CHiVYaRWyzzf/xNq5SnuCftDjYuJZreZVruS7+3wzV2WDbGuBGDnADN3ADcHMSIpsCIv8X0UtSeyh1f3PxW8AlNhQNEHX/c9zNu7mNyCxCRNT9q4b0L7HIt4FfUHQ/wBdZ5RFWeYwuc6CQAhCJWRXWBTOW44XzxzPx4frs/5lciFYqI5LfeYhmMmqTGYVnhLLawEG+BprRopsK/me5Lac1j8zd7LZGaMsfLTG3OcZ2vJw8kHMJA/fwEq+zpW2lkCA9L5BfZh7mV1iLTfIm+decaem0woZSdtmXD1F06Kf0X+DVwSLewcPAg5pRPMsoizFbtfhffqbAYiJUDCB6M+yH3XMFeAZoOJqnC/CQ4Bmg4fAM0HDkGWBa6y/8Ts6nmqTzRpeoHnsI8iJwiWlgufAOCn/EZ3NP7uNzgy68R32IEuB0PPqnOZ0LdWfa/dkO3WeVUmCN0OAm8dVYgnSs5bKH2H2sCdr03fb12zeIDLAAjDJK8VjHGWVc1dMJMDhqPRp/rlhK1VEYbMBs3Piz2ni2EDZ6KFw1UeziSc33PY1sCjjNN8mOht3BRalhNLELT+w7gS3FwU0ZyTFJeeN2VvKSeV4RzxZilkVO8wy3c1GTgptDd1sN9xQyCRCN+la8x7ygCW+7eXfBEDdKv4v65Esn/VR1v2zgoT5fH5lpjMbuF1T00zzNmzzNaU0KwHDsz+0eEgboxPN/N9ZZTVechf89/tOhC2woFpmJ0Nd1vyuW2dZeagPP5D4zuNgyTgDrrLMOfbqWagBIpgBRDVJUiciir44gjM7wbueeZt2u7367K+YQmGOZaRZRC/DTPA3A+7moTWE97dx8CPEqqvX9sgqIJEAn/d0S1IzZ08eVcVVPO5Y1fkCgsGVJ7h8yjf45zXf56SLd1AtPkX6R93OY93PR4Gt7womyzySAbZH3Pr6loP527gx6lpJeMujVyXbhb3eyYAtho4essxCvAtY0Y7zqTSBDiogB1PfsiWLuHj6fo97LFxRxOqwY52+TPYEt7nBgXzKAC25nOjZLhMdYViykmoHGMoDHvoTXBjYcngEaDs8ADYdngIbDM0DD4Rkgj47Fm/8ecwBhg8gAoVILjxSiV1dCDApnLU6wO0ZbhY7VkmHPQZYAHVasTKBGxjwtbQodVmJNQ4eVAgvJ7DevoM9LKalYsOD/olCCeeYN9XPvfherpj2BvK/gCKs8rNyS1XsTDqV4Ifk9/ajxAqDDg3HjmVKY52yBHl2BoIsv18DswyAw0GwpJ9R9siOoXgN0WLHe5a2Ll3S0OEZD4alZwiQp6FBVQkWlKH6rm9Keh5oBVpkyXuWswypTTJFIgGyEBMJTs7onSUEHW/zdwb4Y+xGKDLBasZGTeC1WmCLIpbBKwBQrtAzpu+VctXyyDwI1dcoYV6SGFW5MGErIawDd3J+F0N8oMPwwz/IRsrVKeeqehNcG5tFhxdDFZuoehGeAhsPvBDYcngEaDs8ADYdngIbDM0DDkWcA09lbj32IjAFasavUG7lR42s/0rM9pKF67EkkDNCimzqHOUZX2cltpniMB+k6XCiRV5fM564rmN9luocGyUbQOeb4LPcT8hAPEyrdIUdosUTH6ky26Ko4/1t2lNhvuocGEQO06LLBKeBBnmGVS7Q1t1Mv8ileY4WO5gLTKJzKV/VI7E79EFc4VPCnHXI9b3C94HBdTX9D608/ou3EfyqP/R4KRM6iTwAXAGIv8hdoc6IwgtqcYpE5jjFDlzkeLZXT29Nv6tu/r43/1JfPw3Xx39tR6+OvBUZj+qjvfFfkJUAEtQRIQq4yxTnmtO6Q1RLgl6XfLxVEeH/pHhpEEmCbVTrMxoemZ2mzqrmRImCGJY7ylOGEvQoLvJT7vb6rdA8NkkVgdB/GBhe4izbqGwMya4ApUKhFxdG/Tyzm9j/Ea+Meil8El3loKC+M8OgDvD1Aw+F1AQ2HZ4CGwzNAw+EZoOHIGMB2H0Bd+u08mtIf5fZdp/e7foOmV0TyFmC7D6Au3eZmrt/0ftdv0PTKiBjgTv5WQfsA34i/1aXbHE32m97v+g2aXgPRFJB5/hePTZ1RfBORp9+bXi17b45+l5A+iqd3qZLX0IMK8c8o46vqZ6u/WP7y8delg2m6+Ca6WAp1r5RE3lWs2hm0zZVs5iD2HuAL0pPepe8S356+yh22a/wA9QGzsMTvUEilSP9DAP5K237J01O8QE8OqYkMIOvXiwWw0ZN5N5uP1Q2sayB7+oEyNdcOsKdvZoD67ROkz6vRb+YFoft7wgAH6ych4CfC/+URWiWCGeJx9CopBMJnlfihQ1ybmuwjBtrNXJK6vyfo9RQwC5yn+hRQX8Try1dMoZoIN6XvJkFsEkqX/81ckrq/BxIgWgTa7gNwo98DLLIYfxPp4gtZqHj6BYFqo2Oko6TL5Q8LTx+XKDZ61fZJ6hdWpr8gdb8615KIGOCCVIAEFxTfROTpn08b8PM5+teE9FE8/ZoqeQ09rBD/gjK+qn62+ovlLxs/77yqLB2QhL+6V0riqlGAV/gPPpij3MtX0+916T/gf7gjR7+PL+0avd/1GzS9BiIGgEusss1746eP8ScsSeHq0p/nu7xFO/7113xS6J7doPe7foOmV4Y3CGk4vDaw4fAM0HB4Bmg4PAM0HJ4BGg7PAA2HqAxyvzx9OOkeFSBrA0fSbzvK0HXpHkOH4hRQr+t2rCnUG7lB7RQ8JOQZwNaBO+wY6Yl7Bh1sHajz5Z0grKjr99AgzwAjYOzAEUaM9MhDhx4hZoMJ04UvYDeo8CiJ4hQwUiEVObY5hXrj18ZAHiUhLwJt839dusfQQWQAm2gddrpHBfiNoIbDM0DD4Rmg4fAM0HB4Bmg4PAM0HHuXAcb8hlAvIDNA/X22kAlCJvpe7jE2Ge97Lg2AzADj8d+gYRvdUfdvDbqY+wEyA2zGf4OFbXT77u8hXCVAyFjhrxzCwj81ou7Vs2HS/X4N0BPIyqBNAjY1d2sX/8ph0ilU0v3jRvqWXwP0CjIDmCTAeNo1yV85IbxWeFJkojEhfRWLyd3vJ4EeYJgkgO/+AcBVAtSH/QKHct0/pgnnUQquEmA3YJIuqu73a4AeoNcSoF9Wu4nQz3961IT3D9Bw7F1dgEdP8P+NTFhDa6AzzgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wMy0xMVQwODo0NzoxMS0wNzowMJI9H2wAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDMtMTFUMDc6NTk6MzUtMDc6MDCtPb74AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-state-default .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QAiEnuKCAAAAAJcEhZcwAAAEgAAABIAEbJaz4AABp0SURBVHja7Z17bGXFfcc/Z9kNaxboddIG2UrFPkTpQ9VesFGgouK6TZqFSMHeKk1VqZINaN0oKiRIlaqkUoAqav4J0ESoXZSst5ESKQ/FuyhNNunDRqA2ITbrFS0NjXhJja2qae8t/cMgSE7/OK+Zc+Z1zrnX99pnvtb1uff8ZubMzO83v5kzv5nfBJ/Go8nYN+wMeAwXXgAaDi8AMiYImRh2JnYSXgBETLAJbDZJBPotAMNvPxOElWNuApPoRCBJefhl7CNkATArwDD9M8HWfvTxw/jpE9owtmcnTKxWgoj9W7EImFLeQzpCFIB+KMDJGikkcZN2WB514kJAwBawRUBgSLlOGUcOmQDYFGBUQYElPV37cUEWd5KtSim4xHUphTnlOmUcOWQCYFaArjC1QXv3ET3dzEJTKvXapqkLElOup2dGDEHpmcAQDC0oRM/ArFLLt0DXFCLmBIb4+mcnjFXrkSxlUxl3Hcq/BdgUqL5qgvSvKuwpbBlbpvnZ5i5ITHnPsB/29zm96sztF7Zq5GGLSTa17E1SHn4Z+4h+C8BuRx3x2ZXwM4ENhxeAhsMLQMPhBaDh8ALQcHgBaDi8ADQcfj1APu6w87/DKLMewG1FgM0YM2FcD2B+gp09ddYD2M3hUd73lJCUWw/gZgEzV6GeQZOa765p29hvS30zd9WnvmdWAxTXA5iLt+UsAmqYGZSlbjK2mCrflf3q1G2mpk3N910NeT2AvXhuIqAOY2+fLusBTCLgljdd6rYOzkVD7TpkAhBIf3rYRUBXxS6tZitelmXGpjZ21bxFNPmqT73h5mCzxcy0HqAu7ClsxQs6qsQ3G4Ozku8pe6FfD9CvuLsUfiKo4fAC0HB4AWg4vAA0HF4AGg4vAA2HF4CGwy8LzyMc4lxA/b1TpfO/v170gVTCMHMQWnMQMalKHu0xh1ByuQsIwWjrd/EPEFaglEXVZ9jyH8ZTvaZU7MJRNbZbCVxClYi7TwpgK77Lvj59/MChglyKEBo2f7rkLzDQ5Gu5Z4Tp1jFbDZhLaBag0BIbbI1Yyr/YBbgWX7dax15JQR8UvIkB9l60Tg7CNHagpIpPVz0laV76PIQGujntrHTmZiDmMoCyg8DQofXYQrlIZ7U27sbcwCF1E4Nc0q1aA6Ym6JK2vQ4K9DKvgZmKcwmlpplVoF2CzWnYVKybira1INvTXQaRVWEXcTtdykEZDeCmOuuNcgNHLTOoPAZGBeuWbuAQpirM3bS5A1TG3a8JNDwMOwe7+fkV4vqZwIbDC0DD4QWg4fAC0HB4AWg4vAA0HF4AGg55c2jiLHV4sPsDHyRcasDFIlotnm1vtOtTSqG4OdTF3Xu1CugfqqVly7lbDZhczWbWuInSseXNefoyTFSugTCXS0C9OdS8h8/Foj2huNc/EdCl5eYaQp9/txrQPWMit712olTsrAQ2DVRva3phg668OVS8lq0AcyYD57g26NbVuPoGsK92CKzGIBV9M6YnOqaYG1sdmDWQKeUshHhVIZ/L0oNAfQXI/Zep+FXFIItrY4CuCuqIofz08rPuWSxdHbjqYB0mFd+sKCcAdSrAXv12Ca6+Hk/Od3UR0D99MqYm+kPNBNPzzRrIlnK2fd2+BV4YZ5RbD2CqAHkAYyq+OXOmIprSEItmX/alYoGLCnV1VD+4TfK27etm/woFDwplBMC95duPjDBlznZiiGPRSpfDRQBNJcg2l5uYUG8clKRs7oRNHWBuC/x+RRBz1blksmp88/78erHtKW1pTwtxL3ud2qn7lEpx/cYQEd5BhEfT4AWg4fAC0HB4AWg4vAA0HF4A+o1hmrMrIL8ewAaTvcql6BM17d2DRv3cBZbJ7hEru8pZtB4me5XLvrzk+NVJhw2metTdXGXeHh5Yt7/aGayLb0p9SMivBwiNFmlXi7kpfoBuwsVt367Jnmiv2tDI4GwqN1RQM2uImcFYSjdSIqAeA5gOkBev+SJOWOKbEFWwfdmU3odBiKutLyhxV/VctYDYdjaPJDIBkA2F5S3S0cHLtkULegRktrxqG6izMHVdUFR7rluIOj4+BoBMAERrWhUZtlnj7MbWuqoxEDSIWkPIV1WI/rRi1RNk7TEyekLsArKeWb0kaSIumn5Bgmk9gIux1e4ewozA2Avbqj7rhPTeRZKQQUmqGGKkXM6rrYGbhgK6HJagCmM2tspP0lNCXJSsyYVKHQ8jIgvLUkXKyLBfJwDlB0ku4fphbHVJofqaAhcRqJu7EYOfCZSxC1lYD14AGg4vAA2HF4CGwwtAw+EFoOEYPQFojcokaTOQFwA3W7bJZBM6UXUhWnR35FVs2H4QRgbl3MW7mWLGa+SnSyIkLWO4qi7rM+yhE8DrQBYA8yy1ebY7adUtukoRCNOJUvXevUj1j6chupr4ybdqTtXNO5gbiEwAZHfvRWT2cJ3L9IAgZn9P+Syzao9Uf49xw97Z5Onq58srCvKpuLmPaBwSW0BWZWaP1zZLVsL+6v14z8lco2K/mLd8/pPFbBl9Dx0BXweJACRVK/5XIaSuP29b763TH/LT83mQD0Io5nAzDZXkcg8dAV8HmTVQrDLdmrZsYZTLsQsquHizH6dHWBhHJIZgtVd+OT/9civfAJR5C7Ata7QfyWSij6fULhAU9EAgPF3VEZnXE8nuIzxSlHkLMC+qsjk5s/nu6KVUl9fIwPFeAnf3EQ2D+4ERti6iPzCPAeqggXv/XTBqDiI8k3YYo2cL8NhReAFoOLwANBxeABqOvSQAU+lMw9RA0t/Pwfhv1IbONRAJwGxccSvMVk7pIYul34aQ09JqgbJMnGIt/b6mjD1VSzz28xbXs8021/OWUgSmrLk/GlOPap6hp9tiwgdzf+YnpFwKPh1V/v1cBFosC4GzV7LZ9P4c5zRJZ/vqFjmtmUwWkQ8xz3MCC2GBs1LlruXCT7Negi7nUJW7o7wo/T7GS9Lvg1zPBmPANm1e4HVtDaifUWwWpgOiA2eKGCKreVsZ06nzRJIvArCqmYVbVgjIKjPosKjJwFj6bbtAW+Jx9FgjciwRYZOQNekJa0xLIjCdo9vxopC7KIf5+BuMcQiYigVBl0+YVlDc91UNavOsKOJpSokAbMRXcRmGmOWLwAtsG6dpD8bX09oQBwyxF3iOUwb6nCBUIXOSrgJYF0RA1frz+3OLDDnAa+n3q5V5OMTVBFxhyOUdBppZA5rN8YEilXICnrD/t/kH8XbWl3UtCbzAdiGMnIVIAMYNqenaDdg0ADyTikDIHM8oQiQiUGR/hFbuWszdNcactvkJtwPfpq2Mvw6pCKlzMB1rqulChzVoJOz/PcZkEXAdz6rYX6xAMCuqqO28rKTZNEAiAmjYT/x0tIO8Y7lrHgd5Nf52rYJ6iEu02QDaXOIdhTFA3pJa1QOAXdHbQvwBXy7ci9i/yCHgmwBJB+7+Glhkf76AV3AFVzDGFVoleTmXczmgamFLFvbDBM8wxxzPaJZzTrHFLLNsVRznj/HL8d9YIX8TvIuQ12jTZh8h7zIuKZ3WMP+w8NHhIDbYQnxJcS8S+tO8ja8CMMNqRKj+Rlss4pg1zg8NIW0aYIItiNv+lqL6pyS6SgR+MXfNV1HUStpEIyJZT7yTDRDeCzZoG1YU1VHw2zVDqNd0vBSXLxqfpew3CYA4ki0qnSL7/5znpF9FmFWieQwwrXjNK0MHeGfumq+iaHyxn7XCK2A2SBbv5IdptkEefF34FLHAkvC9Wgg9XkpFXGB/Mg8wCpgCfl34/ZxmIDVYhKBgfz9TjzAcs/dRXpTZP0oC4DEU7CVbgEcFeAFoOLwANBxeABoOLwB7C5/iU+UiyALQctiYrYfLyZtumFJa1KcFW3bxLX+WUPqbzdFP5eiqSSfRWn50AHSAv7DUT4dO5Xq7io/zca6yhJpnnvnkh/ga2KLLNLCmWJu/wu3xDNSDLHOEZYXF+nHWOQ0sMsUpiV7uzN/Eti+Hn+YH8d0otZtyUz+RPTzB6UJ8V3t8G4gmfvpPT8IEwLy03gGgwwrjdIFxuvn3dVp0gUUe5xSnQbl/4iluBZ7mNw21Ox9PJi2wyiuiAETsj6xpRREIY0ev+uqzzRVG+wk/wmN8hMe4n4c1FTTFOrMsF2x64tZP1RNsDA4J+B43c5Eb+Cd+Q+PjoM0lQgKOF2b6MjpgoL/EmxzgqJKeVP8CsFSyBhPqYmpuF+mnCkb4ReXM6izLLHCObrLgRjQHJ9Opa0xXctQirhVQWw5vYZMf8W+8ynMam+AUa8xxTmvSrYO/591coM0FbuEftaGiufS2kS7PWcp4U7FWKEHS+paU1HGp1nQrL9SrLa51uANwHzAed48tetkY4LQ0m77GtGFZhw49enTp0tNu7vpnfpfvMs83WSws6ICE/ctMDWQa+D18nRN8ixN8Wblw43rAtD8yoQcEXKalH+CgZuHLvMT4/Fx+J2Z/snuyW2os8Ak+I/3+DJ8ohDnMYTrAwyyxwNmIS+IYIIR4DKBS4PYuICDr4UIl/WY2uZXv826+z7sLVuuE/erWL86jq8YUkYOZrrAgJU//Gh/kK3yIr/AhvsFJjQuJNqDqwzP6ZfzUSFfHz/reCE/l1iB2WElLFZVPHgW0clq1OAYQu5CiCGfiZzg9HEPL6zLHOQ7Hqlu/HlCH6UIfJwuAmf1yQW1LInrKu3/CIe7lGu7lCv6MkxJtkh/H3zbi67G+0jP2n9XkeTXuApKS5Rnck7qIIvtbADwN3Eqs3nPPj/r+VTlaXgOIrThf6WZEIVpx9ZdfDxMVXM/+5C0ggeotYDx1UVMsg3mQmPTs/2LMXR16QGhgvyqHKkdakQio3gDeywU+zOPAKf6KE/ydRJ1nifvpspSPm2kAcUliFQYuSgVYVIaxHcliav1r3CSIwE0F+/8xXqRLNvw8pqDLv/OwOY2pQ1+wsh9mcq+BRfQEEc/jTX6frwHwOF3eVIR4GFjIx3U1Bx+PX388Bo0O5NV0XzAPUBRBvx6g4fC2gIbDC0DD4QWg4fAC0HA0TwAis3FHQemkptzrHdLR2fp2mUdiUQCOpxVwvHJ61f0D1EWLkDPx9zPaVQ0PxDaIlYII/BYrnOQk13EdP+RXCjGj2vlY/Es86TjCDbyfkFu4hZD3c0Mhvtl9RX41Q349Q5FuCzFbeIZMTwqSvgYeZ4NV/hJYopWaPYuJuLiSHMyq93mWaHOJ42woJlWiJy9xF2fi+Xb9fPgRXqY4U3go/f4WbyjmQpd4gmXaXIrTkefq7ebwxL7XVRqSzXOvocI62M2FCNKFMmsKV74h40KM1JydaYANVpnhHB+gRU+xE2b4WAI2mGcDlUE1mWtP2K8yuR6Or2pT9Ou8wTbbvMFbSvoTnAPGU5v+aukSHKObHolR1APJOiidDu2xENta1fbWME5lCrRa+F1MMskk/5XcyDRAyBznOMNCLOnm9Sy6x4soowd0JxSIOC6IpUpDnRFMrEvcVaDn7Wn5FpI1hiO8WHj6I3wUgFU6oNRA4o7HbaUG0D8/ZCxecTWmTCHSAF2ITXKvFA7XSTTAFHBa6cw7pM0+4GdAurVNtgZG7L9L6SkozH2rZuzRVb8LLqV74xaUHdRdkLZ+NfvFNQ/5ufav8LPUPvAijxbif4zzJGMH9az+AeUMvCsOpdefAD+vCPFRAJaZY5kjCh0Qkm1LLTaoKeC/gZ+xj1/gWR6MbosaoEcrrroVOhWWfGEM4bbgyfQEmwb4In+Yfs+vi5PZr2Lgce4Tfj3EK4anqwQsaqM/BeBNrQbQeREKOSLdD3mloAFE/RHZ9sqNAW4E/hOAH2e1m6m9Ni16PMEsK3QUS6KyEa/a57d4VxUiyP2ZqaonbMTMy76LSNgf6YhbeUqiJuyfYZxA2X4v8TkW4r8i+2GDJe4HHiQaaRTRo8f/8TYuU+7gn7Y42LiSK3mZK7kq/m+Gam+wbQxwLfu4hmu4BrgxCZF1AZH/i+glqT2Str+F+C3gIhuKCojY/zR3cR23Ei2LEBGxf9WQ/kWW+B7wSwr2A3yRVR5mlUfpsgAKLQCRmlVhXVjGcrSw/3gu3lyf/Z/LhWilOiL5nYe4TEa9ZEbhGaGsNXCYr4FmtOimiv8pbs1ZzaPlbva1RmjzHw0xexyhFw8n9+VcwsDdPM+rbGlrKSRI9wvkh5kH+TXW4iV50/xrbmnprGINpeyyLx+i6NBP6b/Am4NFvIMHgU9qWvE84yzFYtXif/m5goiJUAmA6M1wEOueK8ALQMPRPFuAhwQvAA2HF4CGIy8As1p/4XdwNrUknTW6RPXYRZAHgcvMAucK76Dwx3w2d+dePjfszHvUh6gBTsStf5YTuVB3pOzPZug+q9QCa4QGN4kvxxqkY82XPcTOY02wpu+0r9+BQRSARWCccYrbOk4q46ruToHBUevh+LpiyVVHsWAD5uPKn9fGs4Ww0UPhqIkii6c133c1si7gBN8m2xp2OxekitHELtyxzwS2FBs3ZSTbJOWJ23nJS+ZZRTxbiHmWOMGT3MYFTQpuDt1tJdxVyDRA1Opb8Rzzoia87eTdRUPcKP0u6p0vnfSqYr+8wEO9vz5apjEeu19Q0U/wHV7nO5zQpACMxvzcziERgE7c/3djm9VsxV743+OPDl1gQzHITJS+jv2uOEdPe6gNPJm7ZnBZyzgFrLPOOgzoWKohIBGApFfOWritn1ZjlcDKupnCYoaI7Su12Q+ztAwHX92Wu2ZwOVX8NJGxdQoquM8YUUQC0El/twQzY3b3MWVc1d2OZYwfECjWsiTnD5nYv6D5Lt9dopt64SnSL/A+DvI+Lhh8bU85UfaMBkhODdNQ4+t7+a6C+ju5PehZSvq2pDcn21u/3cmCLYSNHrLOYjwKWNOM9KueBDKiiARAfc7eulAFd/P5HPUevqCI02HFqMBN6wlscUcDe1IAXHAbs/GyRHiUc4qBVDPQWAHw2JPw1sCGwwtAw+EFoOHwAtBweAFoOLwA5NGxePPfZQ4gbBAFIFRa4ZFC9OtIiGHhtGUWv2O0gXQqWkhGGLIG6LBiFQI1MuFpaVPosBJbGjqsFERIFr9TCvopKSWVCBb8XxRycIpThvK5s99lVdOuQLELqCoESbweM6wUKqhDyAoz9Azpuz25upAmxiY1k0NCA/vz1GCv6AL1GKDDivUsb128FaLZfrGNhsJdM/OSFHSozvyih4Pq2K0doAJqAVhlxniUsw6rzDBDVEEzwpx5INw1m3uSFHSwxd8Z7CFrQFEAVitWchKvxQozhWUhqwTMsELLkL7bk6vmT/ZBoKbOGOOK1LDCiQkjCfm8gFUeNFat6USB0Yf5RI0InbSzKk/dlfDWwDw6rBhYbKbuQngBaDj8TGDD4QWg4fAC0HB4AWg4vAA0HHkBMO299diDyASgFbtKvZZrNb72IzvbAxqqx65EIgAtuumeuiN0lUxuM8OjfJKuw4ESeXPJqdxxBad2mO6hQTIRdIYFPst9hDzAg4RKd8gRWizTsTqTLboqzv+WHSUOmu6hQSQALbpscAPwSZ5klYu0NadTL/EQr7BCR3OAaRRO5at6LHanfoA3OVDwpx1yNa9xteBwXU1/TetPP6Jtxx+Vx34PBSJn0ceA8wCxF/nztDlWaEFtbmCJBY4wR5cFHin1pLen39Snf18Zf9SHz8NV8eftqO3xVwLjMX3cM98VeQ0QQa0BkpCrzHCGBa07ZLUG+FXp9/MFFT5YuocGkQbosUqH+XjT9DxtVjUnUgTMscxhnjDssFdhkedzv9d3lO6hQTIIjM7D2OA8d9JGfWJAthpgBhRmUbH177E9tHsXyYERl2jzALO0gXM8oBzjB9I1UNLFj8cugF8P0HB4W0DD4QWg4fAC0HB4AWg4MgGwnQdQl34bj6T0RxSuGgdNH3T5hk2viOQtwHYeQF26zc3coOmDLt+w6ZURCcAd/K2C9n6+FX+rS7c5mhw0fdDlGza9BqIuIPP8L26bOqn4JiJPvyedIronR79TSB/F3TtVyWvoQYX4J5XxVeWzlV/Mf/n469LGNF18E13MhZorJZF3FRsUfsl0VUZEB7F3A1+Q7vQvfZf49vTFEGXjB6g3mIUlfodCKkX6HwHw19r6S+7ewLP0Zb5VFADZvl7MgI2e9LtZf6yuYF0F2dMPlKm5MsCevlkA6tdPkN6vRr+RZwX290UA9tdPQsBPhf/lEVo1ghnidvQqKYi2jirxQ4e4NjPZhw20G7kosb8v6HcXMA+cpXoXUF/F6/NXTKGaCjel76ZBbBpK9/wbuSixvw8aIBoE2s4DcKPfDSyxFH8T6eILWai4+wWBaqNjpKOky/kPC3cfkyg2etX6ScoXVqY/K7Ff/dSSiATgvJSBBOcV30Tk6Z9PK/DzOfo3hPRR3P2GKnkNPawQ/7wyvqp8tvKL+S8bP++8qiwdkJS/mislcdl7AF7iP/hAjnIPX0+/16X/iP/h9hz9Xr60Y/RBl2/Y9BqIBAAuskqPm+O7j/KnLEvh6tKf4Qe8RTv+9Td8QmDPTtAHXb5h0yvDLwhpOLw1sOHwAtBweAFoOLwANBxeABoOLwANh2gMcj88fTTpHhUgWwPH0m/bytB16R4jh2IXUI9129YU6rVcv+2sz8gLgI2B22wb6Yl7Bh1sDLQd4x5WtPV7aJAXgDEwMnCMMSM98tChR4h5wYTpwBewL6jwKIliFzBWIRU5tjmFeu3XJkAeJSEPAm39f126x8hBFACbah11ukcF+ImghsMLQMPhBaDh8ALQcHgBaDi8ADQcu1cAJvyEUD8gC0D9ebaQKUKmBp7vCTaZHPhTGgBZACbjz7Bha90R+7eGnc29AFkANuPPcGFr3Z79fYSrBgiZKHzKISz8qRGxVy+GCfv9GKAvkI1BmwRsas7WrusLeNopVML+SSN9y48B+gVZAEwaYDJlTfIpp4TXCneKQjQhpK8SMZn9vhPoA0ZJA3j2DwGuGqA+7Ac4lGP/hCacRym4aoCdgEm7qNjvxwB9QL81wKBW7SZKP3/1qAlZALbiz+gh0Fw9amL32gI8+oL/B5TnaJVqDARvAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTAzLTExVDA4OjQ3OjExLTA3OjAwkj0fbAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wMy0xMVQwNzo1OTozNS0wNzowMK09vvgAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC)}.ui-state-active .ui-icon,.ui-state-focus .ui-icon,.ui-state-hover .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QARaw7li0AAAAJcEhZcwAAAEgAAABIAEbJaz4AABptSURBVHja7Z17bGVHfcc/Z7NL1tkkvYaWyBZV9iGaPlTt3diIpEqV67ZpNkEi9laUqlIlO4nsItQAkSpVUCmPCvUvkhQUtRvBeosEUkoU70YUFvqwUVALwc56lZZCUR5IxVZV2uumfxiUwOkf5zVzzrzOOff6Xt8z35X33nt+8/795jdz5jfzm+AOPJqMA4MugMdg4QWg4fACIGOCkIlBF2Iv4QVAxARbwFaTRKDXAjD4/jNBWDnmFjCJTgSSlAdfxx5CFgCzAgzTfybY+o8+fhjnPqENY8s7YWK1GkTs345FwJTyCOkIUQB6oQAna6SQxE36YXnUiQsBAdvANgGBIeU6dRw6BOk6QFLFpB/oEEKheURE6QSV4ie9TJe/Le+wZtldU7bVcR8h0wBmBegKUx+0Dx9R7iYWmlOp1zdNQ5CYcj09M2QISq8EmnuRqQ9mjVq179hTMPdNc9nNOjBL2aZn9hXKvwUEFvbpmyZI/1WFPYVtY880551pP1UdxJRHhv1VNMBoY4KtUWKvHQcHXYAhw/ZoTO3c4VcCGw4vAA2HF4CGwwtAw+EFoOHwAtBweAFoOPx+gHzcQZd/j1FmP4DbjgCbMWbCuB/AnIOdPXX2A9jN4VHZR0pIyu0HcLOAmZtQz6BJzXfXtG3st6W+lfvUpz4yuwGK+wEi6FfDk1Ame5uebovtsh/AVDpz7vb4ZoRx2snnSEDeD6D6LmPbSQuow9j7p8t+AFP/cyubXnxC626DMjntC2QCEEj/9LCLgK6JXdTzdrwty4wtbeyqZYto8qc+9RGyF/baHBwOvHEm2KqsnhtnDO69OXjwI2Mdg27jjMF+Iajx8ALQcHgBaDi8ADQcXgAaDi8ADYcXgIbDbwvPIxzgWkD9s1Oly3+wXvS+NMIgSxBaS1DdFGSPOYCay0NACEZbv4t/gLACpSyq5mErf8T6wJiKXTiqxnargUuoEnEPSAFs1Xc516ePHzg0kEsVQoO516V8gYEmf5bLI6HYW8BcQ7MAhZbYYOvEUvnFIcC1+rrdOvZGCnqg4EOjtd82itYpQZjGDpRUMXdVLkn30pchNNDNaWe1M3cDsZQBlJ0Ehg69xxbKRTqr9XE35gYOqZsY5JJu1RYwdUGXtO1tUKCXeQ3MVJxLKDXNrALtEmxOw6Zi3VS0rQfZcneZRFaFXcTtdKkEZTSAm+qsN8sNHLVMv8oYGBWsW7qBQ5iqMA/T5gFQGfegJtDgMOgS7Of8K8T1K4ENhxeAhsMLQMPhBaDh8ALQcHgBaDi8ADQc8uHQxFnq4GD3B95PuLSAi0W0Wjzb2WjXXEohE4Dk5J6Lu/dqDdA7VEvLVnK3FjC5ms2scROlY8uH8/R1mKjcAmGulID6cKj5DJ+LRXtC8ax3IqBLy801hL78bi2gy2Mid7x2olTsrAY2DVTvaHrhgK58NtDFnbrtCLbOmbLbThp7CXTp2F2420vu5pBebTEosjbI0W0HyzPmqM4nhlLKZoOxzmAdFMOUnQTqqyCPX8U+FKTxq2qCLK4q/y1FKfRlqJt7+VX3LJauDVx1sA6Tim9WlBOAOg1gb/6EbaZLZbJ0quVfVwT0uU/G1GQEVzPBlH+QWhMDDdWUcnZ83X4EXphnlNsPYGoAeQJjqr65cKYqmtIQq2bf9qVigV0ATTXYzjmQ2C6dghtM7N1Or71xKyXlBMC959uvjDAVznZjiGPVStfDRQBNNcgOlweWa2uqI0nZPAibBsDcEXh/X4CICeuNSSMHfzBEhHcQ4dE0eAFoOLwANBxeABoOLwANhxeAXmOQ5uwKyO8HsMFkr3Kp+kRNe3e/Ub90gWWxe8jqXtwPYILJYu5yLi+x2E06HDDVo+7hKvPx8MB6/NXOYF18U+oDQrYSKBbLZSm3aA7Nji9Wu/3b7dyuySJhTyGMb/8NLLF15l7T4dHQiepe0z2Beg6g23RgtldlQ0OVTQtRz7Fvm9L7MAhxtfUFJZ6q8lXlbz/ZPJTIBEA2FJa3SEcXL+v3A9gQkNnyqh2gzsLUdUFRLV+3EHV8fPQBmQCI1rQqMmyzxtmNrXVHx0DQIGoNIX+qQvSmF6tykLXH0OgJcQjITCEqBR4p+Gi7lxrbxv0ALsZWu3sIM7K9AOotFeamzwYhvXeRJGRQkiqGqLqhpi9QWwO3DBV0MZaqwmwz6WhstXnXcJvo6eLX8TBi3tVnv0zGfSDZM6gFoPwkySVcL4ytLilUd1HhIgJ1Szdk8CuBMvYhC+vBC0DD4QWg4fAC0HB4AWg4vAA0HMMnAK1hWSRtBvIC4GbLNplsQieqLkSL7p68ig3aD8LQoJy7eDdTzHiN8nRJhKRlDFfVZX2GEboBvA5kATCvUptXu5Ne3aKrFIEwXShVn92LVP94GqKriZ98q+ZU3XyCuYHIBEB2915EZg/XuUwPCGL27yjzMqv2SPXvMG44O5vkrs5f3lGQT8XNfUTjkNgCsiYze7y2WbIS9lcfx3eczDUq9otly5c/2cyW0UfoCvg6SAQgaVrTlikQL01Qo/6VKDr9IeeeL4N8EUKxhFtpqKSUjToCqkdmDRSbTO9gxH7rheu1Ejp6JAJhYR6RGILVXvnl8vTKrXwDUOYtIGti3Z4825VMJvp4Su0CQUEPBELuqoHIvJ9Idh/hkaLMW4B5U5XNyZnNd8dOSnV5jQwcnyVwdx/RMLhfGGEbInoD8xygDhp49t8Fw+YgwjNpjzF8tgCPPYUXgIbDC0DD4QWg4RglAZhKVxqm+pL+QQ7H/4Zt6lwDkQDMxg23ymzllB61WPptCDkr7RYoy8Qp1tPv68rYU7XE4yBvchO77HITbypFYMpa+uMx9bgmDz3dFhPel/tnziHlUnQ8PORBLgMtVoTA2SvZbPp8jguapLNzdUuc1Swmi8iHmOclgYWwwHmpcddz4afZKEGXS6gq3XFeln6f4BXp92FuYpMxYJc23+VH2hZQ52HzJi6HCZwpYois5W11TJfOE0m+DMCaZhVuRSEga8ygw5KmAGPpt90CbZmn0GOdyLFEhC1C1qUc1pmWRGA6R7fjZaF0UQnz8TcZ4wgwFQuCrpwwraC4n6vq1+FZUcTTlBIB2Iw/xW0YYpEvA99l17hMezj+PKsNccgQe4GXWDTQ5yQXFHOSrgLYEERA1fvz53OLDDnE6+n365VlOML1BFxjKOXdBppZA5rN8YEilXICnrD/N/kH8XE2lnUtCXyX3UIYuQiRAIwbUtP1G7BpAHghFYGQOV5QhEhEoMj+CK3cZ7F0NxhL2uaH3AV8mbYy/gakIqQuwXSsqaYLA1a/kbD/dxmTRcB1Pqtif7EBwayoor7zqpJm0wCJCKBhP3HuaCd5J3KfeRzm+/G3GxXUI1yhzSbQ5gpvK8wB8pbUqh4A7IreFuL3+XzhWcT+JY4AXwRIBnD318Ai+/MVvIZruIYxrtEqyau5mqsBVQ9btrAfJniBOeZ4QbOdc4ptZpllu+I8f4xfjP+NFco3wTsIeZ02bQ4Q8g7jltJpDfOPCn86HMYGW4jPKZ5FQn+Wt/A3AMywFhGqv9EWqzhmjfMdQ0ibBphgG+K+v61o/imJrhKBn8995pso6iVtohmRrCfeziYI7wWbtA07iuoo+N2aIdR7Ol6J6xfNz1L2mwRAnMkWlU6R/X/GS9KvIswq0TwHmFa85pWhA7w995lvomh+cZD1witgNkkWn+SnabZJHjwj/BWxwLLwvVoIPV5JRVxg/zBdGDEF/Krw+yXNRKq/CEHB/l6mHmEwZu/jvCyzf5gEwGMgGCVbgEcFeAFoOLwANBxeABoOLwCjhY/z8XIRZAFoORzM1sPl5k03TCkt6tOCLbv4lj9LKP2bzdEXc3TVopNoLT/eBzrAn1vap0Oncrtdx0f5KNdZQs0zz3zyQ3wNbNFlGlhX7M1f5a54BeoRVjjGisJi/RQbnAWWmGJRope78zex7cvhp/lW/DRK7V25pZ/IHp7gbCG+qz2+DUQLP72nJ2ECYF7a7wDQYZVxusA43fz7Oi26wBJPschZUJ6feJ7bgK/z64bWnY8XkxZY4zVRACL2R9a0ogiEsaNXffPZ1gqj84Qf5Ek+yJM8yGOaBppig1lWCjY98einKgeX69u/wS1c5hT/xK9pfBy0uUJIwMnCSl9GBwz0V3iDQxxX0pPmXwCWS7ZgQl1Kze0ifbFghF9SrqzOssICF+gmG25Ec3CynLrOdCVHLeJeAbXl8Fa2+B7/xvd5SWMTnGKdOS5oTbp18Pe8m0u0ucSt/KM2VLSW3jbS5TVLGW8o9golSHrfspI6LrWabueFerfFjQ5PAD4EjMfDY4udbA5wVlpNX2fasK1Dhx126NJlR3u465/5Hb7KPF9kqbChAxL2rzDVl2Xg3+IZTvMlTvN55caNmwDT+ciEHhBwlZZ+iMOajS/zEuPza/mdmP3J6cluqbnAx/iE9PsTfKwQ5ihH6QCPscwC5yMuiXOAEOI5gEqB24eAgGyEC5X0W9jiNr7Ju/km7y5YrRP2q3u/uI6umlNEDma6woaUPP0LvI+neT9P836e5YzGhUQbUI3hGf0qfmKkq+NnY2+E53N7EDusprWK6ifPAlo5rVqcA5gu9BHFT6LlrYH6ntdljgscjVW3fj+gDtOFMU4WADP75YratkTsKJ/+MUd4gBt4gGv4U85ItEl+EH/bjD9P9JSesf+8psxr8RCQ1CzP4B1piCiyvwXA14HbiNV7Lv9o7F+To+U1gNiL841uRhSiFTd/+f0wUcX17E/eAhKo3gLGUxc1xTqYJ4nJyP4vxtLVoQeEBvarSqhypBWJgOoN4A4u8QGeAhb5S07zdxJ1nmUepMtyPm6mAcQtiVUYuCRVYEkZxnYli6n3r/MuQQTeVbD/n+BlumTTzxMKuvw7D5vTmDr0BSv7YSb3GljEjiDiebzB7/EFAJ6iyxuKEI8BC/m4rubgk/Hrj0e/0YG8mu4J5gGKIuj3AzQc3hbQcHgBaDi8ADQcXgAajuYJQGQ27igondSUe5NDOjpb3z7zSCwKwMm0AU5WTq+6f4C6aBFyLv5+Trur4eHYBrFaEIHfYJUznOGdvJPv8EuFmFHrfCT+Jd50HOEU7yHkVm4l5D2cKsQ3u6/I72bI72co0m0hZgt5yPSkIulr4Ek2WeMvgGVaqdmzmIiLK8n+7HqfZ5k2VzjJpmJRJcp5mXs5F6+369fDj/EqxZXCI+n3N/mxYi10medYoc2VOB15rd5uDk/se12lIdm89hoqrIPdXIgg3SizrnDlGzIuxEjN2ZkG2GSNGS7wXlrsKE7CDB7LwCbzbKIyqCZr7Qn7VSbXo/Gn2hT9I37MLrv8mDeV9Oe4AIynNv210jU4QTe9EqOoB5J9UDodusNCbGtV21vDOJUp0GrhdzDJJJP8V/Ig0wAhc1zgHAuxpJv3s+iyF1FGD+huKBBxUhBLlYY6J5hYl7m3QM/b0/I9JOsMx3i5kPvjfBiANTqg1EDiicddpQbQ5x8yFu+4GlOmEGmALsQmudcKl+skGmAKOKt05h3S5gDwUyA92iZbAyP236v0FBTmvlUz9uia3wVX0rNxC8oB6l5Ie7+a/eKeh/xa+9P8NLUPvMwThfgf4SLJ3EG9qn9IuQLviiPp5w+Bn1WE+DAAK8yxwjGFDgjJjqUWO9QU8N/ATznAz/Eij0SPRQ2wQytuulU6FbZ8YQzhtuHJlINNA3yWP0i/5/fFyexXMfAkHxJ+PcprhtxVAhb10Z8A8IZWA+i8CIUck56HvFbQAKL+iGx75eYANwP/CcAPstbN1F6bFjs8xyyrdBRborIZr9rnt/hUFSLI/TNTVTlsxszLvotI2B/piNt4XqIm7J9hnEDZf6/wKRbif0X2wybLPAg8QjTTKGKHHf6Pt3CV8gT/tMXBxrVcy6tcy3Xx/2aozgbb5gA3coAbuIEbgJuTENkQEPm/iF6S2kNp+1uI3wIus6logIj9X+de3sltRNsiRETsXzOkf5llvgH8goL9AJ9ljcdY4wm6LIBCC0CkZlXYELaxHC+cP56LD9dn/8/lQrRSHZH8zkPcJqPeMqPwjFDWGjjI10AzWnRTxf88t+Ws5tF2N/teI7Tlj6aYOxxjJ55OHsi5hIH7+DbfZ1vbSiFBel4gP808zK+wHm/Jm+Zfc1tLZxV7KGWXffkQRYd+Sv8F3hws4m08Ajyk6cXzjLMci1WL/+VnCiImQiUAojfDfux7rgAvAA1H82wBHhK8ADQcXgAajrwAzGr9hd/N+dSSdN7oEtVjH0GeBK4wC1wovIPCH/HJ3JMH+NSgC+9RH6IGOB33/llO50LdnbI/W6H7pFILrBMa3CS+GmuQjrVc9hB7j3XBmr7Xvn77BlEAloBxxike6zijjKt6OgUGR61H489VS6k6ig0bMB83/rw2ni2EjR4KV00UWTyt+b6vkQ0Bp/ky2dGwu7gkNYwmduGJfSWwpTi4KSM5Jikv3M5LXjLPK+LZQsyzzGm+xu1c0qTg5tDdVsN9hUwDRL2+Fa8xL2nC227eXTLEjdLvoj750kk/VeyXN3ioz9dH2zTGY/cLKvppvsKP+AqnNSkAw7E+t3dIBKATj//d2GY1W3EU/vf4T4cusKmYZCZKX8d+V1xgR3upDXwt95nBZS/jFLDBBhvQp2upBoBkCBDNIEWTiKz66ijC6AzvTu5pxnY9++2umENggQvMsoxagZ/mKwDcySVtChspc/MhxKuoNkZlFhBpgE76uyWYGbOnTyrjqp52LHP8gECxlyW5f8jU+xc03+Wny3RTLzxF+iXu5DB3csnga3vKiTJiGsA2ybuDryqov507g56lpNcMenOyXfnbnSzYQtjoIRssxbOAdU0fr3oTyJAiEgD1PXuimruPT+eo9/MZRZwOq8bx27SfwBZ3ODCSAuCC25mNtyXCE1xQTKSagcYKgMdIwlsDGw4vAA2HF4CGwwtAw+EFoOHwApBHx+LNf585gLBBFIBQaYVHCtGrKyEGhbMWJ9gd416FjnUnw76DrAE6rFqFQI1MeFraFDqsxpaGDqsFEZLFb1FBX5RSUolgwf9FoQSLLBrq585+l11N+wJ5X8ER1nhEuSSr9yYcSvFC8mv6UeMFQIeH4sYzpbDI2QI9ugJBF1+ugdmHQWCg2VJOqCOyIqieA3RYtd7lrYuXMFrso6Hw1KxhkhR0qKqholIUv9VNad9DLQBrzBivctZhjRlmSDRA1kMC4anZ3JOkoIMt/t5gJPp+hKIArFVs5CRei1VmCHIprBEwwyotQ/puOVctn+yDQE2dMcYVqWGFGxOGEvIcQDf2ZyH0NwoMP8yjfIRsrlKeui/hrYF5dFg1sNhM3YfwAtBw+JXAhsMLQMPhBaDh8ALQcHgBaDjyAmA6e+sxgsgEoBW7Sr2RGzW+9iM728Maqse+RCIALbqpc5hjdJVMbjPDEzxE1+FCiby5ZDF3XcHiHtM9NEgWgs6xwCf5ECEP8wih0h1yhBYrdKzOZIuuivO/ZUeJ/aZ7aBAJQIsum5wCHuJrrHGZtuZ26mUe5TVW6WguMI3CqXxVj8Xu1A/xBocK/rRDrud1rhccrqvpr2v96Ue03fhP5bHfQ4HIWfQJ4CJA7EX+Im1OFHpQm1Mss8Ax5uiywOOlcnpr+k19+/e18Z/68nm4Lv57K2p7/LXAeEwf98x3RV4DRFBrgCTkGjOcY0HrDlmtAX5Z+v3tggrvL91Dg0gD7LBGh/n40PQ8bdY0N1IEzLHCUZ4znLBXYYlv535v7CndQ4NkEhjdh7HJRe6hjfrGgGw3wAwozKJi7x+RHXOjD/HauIfjF8ELPDyUF0Z49AF+P0DD4W0BDYcXgIbDC0DD4QWg4cgEwHYfQF367Tye0h/n9j2n97t+g6ZXRPIWYLsPoC7d5mau3/R+12/Q9MqIBOBu/lZBew9fir/VpdscTfab3u/6DZpeA9EQkHn+F49NnVF8E5Gn359eLXt/jn6PkD6Kp/eoktfQgwrxzyjjq+pnq79Y/vLxN6SDabr4JrpYCjVXSiLvKlbtDNrmSjZzEHsf8BnpSe/Sd4lvT1/lDts1foD6gFlY4ncopFKk/yEAf6Vtv+TpKV6kJ4fURAGQ7evFAtjoybibjcfqBtY1kD39QJmaKwPs6ZsFoH77BOnzavSbeVFgf08E4GD9JAT8RPi/PEKrRjBDPI5eJYVA+KwSP3SIazOTfcBAu5nLEvt7gl4PAfPAeaoPAfVVvL58xRSqqXBT+m4axKahdPnfzGWJ/T3QANEk0HYfgBv9PmCZ5fibSBdfyELF088IVBsdIx0lXS5/WHj6pESx0au2T1K/sDL9RYn96lxLIhKAi1IBElxUfBORp386bcBP5+jPCumjePqsKnkNPawQ/6Iyvqp+tvqL5S8bP++8qiwdkJS/mislcdUJgFf4D96bo9zPM+n3uvTv8T/claM/wOf2jN7v+g2aXgORAMBl1tjhlvjpE/wJK1K4uvQX+BZv0o5//TUfE9izF/R+12/Q9MrwG0IaDm8NbDi8ADQcXgAaDi8ADYcXgIbDC0DDIRqD3C9PH066RwXI1sCx9NuuMnRdusfQoTgE1GPdrjWFej03qJ2Ch4S8ANgYuMuukZ64Z9DBxkCdL+8EYUVbv4cGeQEYAyMDxxgz0iMPHXqEmDdMmC58AfuGCo+SKA4BYxVSkWObU6jXf20C5FES8iTQNv7XpXsMHUQBsKnWYad7VIBfCGo4vAA0HF4AGg4vAA2HF4CGwwtAw7F/BWDCLwj1ArIA1F9nC5kiZKrv5Z5gi8m+59IAyAIwGf8NGrbeHbF/e9DFHAXIArAV/w0Wtt7t2d9DuGqAkInCXzmEhX9qROzVi2HCfj8H6AlkY9AWAVuau7WLf+Uw7RQqYf+kkb7t5wC9giwAJg0wmbIm+SunhNcLT4pCNCGkrxIxmf1+EOgBhkkDePYPAK4aoD7sFziUY/+EJpxHKbhqgL2ASbuo2O/nAD1ArzVAv3btJko//+lRE7IAbMd/w4dA8+lRE/vXFuDRE/w/97JeqtfGCLwAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDMtMTFUMDg6NDc6MTEtMDc6MDCSPR9sAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTAzLTExVDA3OjU5OjM1LTA3OjAwrT2++AAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-state-highlight .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAABDlBMVEUug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8bvOpvAAAAWXRSTlMAGRAzBAhQv4KZLyJVcUBmYBoTMswNITwWQkhLIB5aIycxUyyFNIeAw2rIz8Y4RRy8uL58q7WljKqorR+yKf0BnlEk7woGAgOPomKUSqCvbd+cR2M/b3+RaPlAXvEAAAABYktHRACIBR1IAAAACXBIWXMAAABIAAAASABGyWs+AAAPZElEQVR42u1dC2PbthEGyUiq6ZiSXblLE6ex1mTO5iXZq+u6ro3abG26pOkSd13v//+RAXzhcIeHWMoUbeOTLesIEMB9PIB3ACgLERERMQIkkOy6CTvWH0bOQO/mJeDXP8EMqMzDEkIsEBRMAmh7jHSVmuAjAKwC8FRAzi8/DmoS1AI5AQltj5FOryAjgJ7OK2CZkwEZYO23q+BJ5wwKkttfui1z4s20VTAL5k2kF5hbiPcKcwvwNGB4C7CTwproI4CdDcxEPKUTExx+DNiAj0u9C9AuNPxdYOe46Y5QRERERERExIhx6Z7gjv2ghEVrQJ33hJ5BsxsBfsIq8M0HsAkhWfqglFgawAhgGWh2M1xMWAWUAE90qUofMhhi7be32JNsmVFJPKeLwBQglAQMNh3ALVjYbNaI1jaYD0jM0nw9atcWYEXiaXH/+QDeQ3Y6BoRx3e8CERERERERERG7Qz/HP+iaBsvvHXj0LAD4cip0yN27fXw7AGtQoDTwH+HqkWTgWczTwZVmr8DbAEuqv35bCT6CWDorjGnAqwOSCI7EhlFWHjkBXIkb1M/DZQgRwCeAwK9B+HRPFlPBOjeZszKz0wK9/FlzeE3I24GEzUII45bT/SYarqGLesE+btlDBP70QInkckDwggQqAGGt052667vAJZ8fvk1GRERERERE3FT035ba081ILLvR3UXa/NDgUlWg+m4N2KgCfzzP1lYtDUDpAi9ObeDVqczu4ASsy/u8kaxId/2W+JYq4CsbrBcV8SPw8iRvrWWze+IlILA3XFjNzMeAl7/EMt0TmH4wwtkmHG4OsLVzYkEsHLZE4+yRDbFBA+ypVoZJ6fR8iw24T2cEsBbw5pnptIuFCbA3wHkJN0pmAbObAOvaOl+hd14A1gVIFwl2AXsvT5w5GMPezQE8j8XAhFmAYCv0AQLIIEhS2bAUmsGh9VuukT/Z3goHgZsE7wEL4JnHPR+w6+djIiIiIiIiRo3LvYtzR4U8Kms5Y7uORbg46Ja9o/7Aj+Doz3oGZm2j9XKiMc0MTpGt7PgXvroD2G5x03es1iY9T4cHXH1LBmAKCyP69BIC9jL7EuB+vrtM8nw/gG0+w1yvZu31BQfNueA6fesENOGmi4DEEg7zpnviKZ5uW50Gkgr+zLBFChJLC1m4C9hEwduHLaXRCRHvnhUrAbRLbD2804Oamkxg0Zn5fL8lnQi2bo8JYfwECAkR3h/mjA6LTskTI4HoNbQJKDT/4J8/uoa47vpFRERERFxvpFf8RmZxO8C3XEW94V+i/5iWAqzLLKb3lQZXAyElhXpFIUa1GMK2LgsUryhVU0hRMGTGdylUFqDzC+sSOCNwLN0GePRCt9dL/Y3ozCAAKhKMeJaKWN8ExkWAZfmdE5QSmRKA/wpL7IaOJW0XG0sX2MACWH5zx0ZFkMMC6H6Fhu7R6M90ZGMAyWGdoUm1ldAxwLJBZjTmr9tkSPiPY8hH+VO7QmD5pDDgd2V2YIDT0e0i0XugD8kICeiLLvpHRERERNwsZMpPyDbPf2sicWuo1k1l42ZTX473Ap4b7FWukkvFjCZnfj5uiRwgF7dIAeiMfSnuC4dME8XtGuSERiU4KIopcvbKzwYhpVs057ufG3FRa7gw9G1bTGW2srVfpzetnuQwmUA+MRogWDBB99paherA3FZjG6QVRZFWIITMDAIQA6BMdKJr3DMIkEUfSrSuNDQW4FrvrorTBU5gcnT0PmAClsul/wkMgQkQAQL2DQJBqY4OSEISTEjVQJPwYwWXBcAU0B9VcT0GAGqg0eLj8vRjTcDRB/u/Mgi4c+cO2x7vlskBSoDS/0NMgGlSIPUHTlGKpv3gjoLTAg6V6jA91PMAWWn/LQGqfDTFVhWnC5Rd4O5d3AWWQl4C+d6ekJWvX0iA0v/2vQ/dBCTkgDySJIcJCmHg5OTEPQbAoWRA6o8JKH9aAspBEBFwX519/35z4KgaBI+IOugETgB7REMQAj7C8xPzxW35XrgIoBXCgxKowtPTU9AmyiwgO5xO5ZvuAqXsJuC0Qn0gyeGDPF9Bjp8RQl1IHvh1+cL6TigBE0IAGBYw1/p7CGiL+7gEMblJSwC1gOywRHOJmAxqjJ2C0SfzvL0L5E39udMCOAGhLoDTqzGwaDO3BGRmfW1xlR8A7wkHiAWEboNVe+bmHEymb93AFQ4MegtcPT9ACSgZKMT2kGWLEh18Pcah6bqEs0OvaaX9reofERERETFyPHzoT0/BO68NYNv6SJDpcPdReZt61Ih1sN3G2PNanrfnVq7J/sayEL8h7Sm89zUZbR2TQ/K2jfXPMs3ATHmRZ/kUBTuyyfO91pGzUpHp449qV7xhQJ6sQFaaTM8mV67gxnJ1PVoNCuXMpe29PVXczvE1fQzwmOivHKUTrb/yzdvoN7E7Yiich9/K1wFuUCavc4byG2uDNLYQvxPn4vc4vs2lkBuyMOXjyTGSVfsXC1cDoXb2a7kxOGRxsrGLVLuO1YxFG11xAkg4DOLJ/afP7t1H00aZtO8Mt8dLwB/gj/L1J6ygcv2JjIMPGRtPcur7tnLtzKf2+h42IhoHZnCwkBxUwl4zY7PnIqAeBZAFHMCf4aFukNQfTdmFLeAv4hPxVz2ldEos4JRYwCmxgIURe8geUA1SbXxL6vu0kj5tG1gG8zh2ADUGaP3CBDy5/9ED+bLrX3vqmIAUylmnRv4bfCZff0c7Jow+XsrvExmll/1X4oGDgCa6S40GEfsRGOYoD5OpODHiRUJARhgm+rc7IkwCkPz5J3dmd/7xRS0fNsXtbyYvzKsnWBeoZSw+fqxlZfvtfKeVAEGg9gilwj0pCWSS+1HdYH0XUFuMhKtLqO5OivPLgujPA/gU6y+efimHv/mXT1sCZP9PPeczRedsEDUnWdkkP/ED6LQ3kW3fAOOTF1R/ehsU1aYunVyuCNwu2vOBlWAgF1cQRYcA3/CBIiIiIiJ2gCmemFauHJyyPM/1x0veWlguRXjvftCnBSms5fsa35rPALmaH8JXX339NXyBmnOg9C8hP6zuwZMncG/VpJP9Fs10QzPf0Mr0QBu8Ub8ph9l0+sJgwP/lYiEsZFk5ijZBMrCm3viJ9rz+qfAv7Yqup7KABQtu2nSyVEs+1MGrziNdx0wGO3pxsErQwZVyjNfwwrJb9hcSoFwtdIbSvfw1DUAT8M23z59/+41uz1RAscArO5QAY8sIlJNRaMNDKqqpilT72pmaj0EEPFNrdbjCtWLdRQANL7m6JL1a3dMWtS5lrX9q5ofS1vfb01/KpBlyV2FCNmSY55froCgDqMBTxnMCW8B8jver56uVCi81AVJ/gabAKOM0WLCLxMTb9jc2gPSvrmAzBnwG+xLwss1QFMb5cOwn4Eh+PFI/TbIysCmcIAsg0euzZ4fPVnDWFvhCtW62PQKoBXxXys2sXK2/VjBflzgxT9eEyUt6fHxsEFBf2erPicTn8odseFg7x4DVSnUAPAi+mE5nWxwEyRjwXT0G1Awo/QsjHF2p9p7o09cHcIYYUAUdoWGvmbxp9Pv44/qHGIhzDJhmq9UKVpgBehvc9l3gsZqY1e2hodt6PtcTVnIElD+pZgCMP83H/eYAvQ2WFlHCMQbAVAETYLuGfQggSMtr/7jxAyx7BM0RVlrLi1SNlM+b1H8/ScyvdRHlqFFLk0xN6WXNho3ufsDucfTq1RESFweKq/R5yxhtMNs5GREREdELU7w7+vX3aoj5/vWuGzUg3gC8aYUfmlH3h103azDcVererYXX1R1HvWsbWMISn/AfizMjtrfzbFnyv+xf0KZ4owKoxgTeagLetjmI22DzIwpNCVt6oAeoDEt1T196y79E3K0Uvosqp64Ha09KDxTaKAIbN5X8bvLOXJ1l1Q1JgBwBVAj9xqjcbMMcL4xV+uvlxcLU37Z1d5EusH7v5Ns7I8NyhwQUzfUu3AQUpMsDnKc4DetvIyA1TKbcaD4xwmmDgAyWy+Vwnq5W2E0APwfpL3U3BsXeFjDsIFgaQPXQTKnDK03AK5Sp8BeA03uPAcNGa3TQe6rFpzgTOYkwYPDT+y4gxIBD4FIrXLXgohEvsI50DMBSsf3d5zsN1n9U07Lw8sddtmFMsxURERERERGXjAJ84mUDZsSR2egJiT7Y26P6g0e8fAKAUGAQUKalOEMxS9WbkUGFzI08rzK5w9uC+M4FS4ZyhWxAAkwKTAKqtLbN5eWR6tEMBgE4nRNAg0U+GWBuxh2EALwZmBJQTn/UjSz/zHCb6wyYgJlFp7DGhrjN/x+wEQEDWsBGBAxsAcOOARQ7HwMGvgvw+Y4d3wVGgN36ARERERERNxv+58iuO9L/Cvjpc7R3U3opZzfoe3LVc6TwU4GeZ8iLl5YHKBrfhH7/QVd5dFjD/yQBAu1OVqzMGAP0yVK9X7+bPDakcC7ET4U4x09br09kRGs+X6sVmRxP5E+7fRuOzf3sSgZTnqjXZKTubVbvmz/TVyhfgNptf+AgoPxqtOSw+X49SCBJ1IFGPlQv/f17Kl0eSQ5HSkBpARLn+IqrcWFt7E5GBHxRoTXxjvLoMCvvgQu050UGo1M4mToIuHaDYA5wfnaOh/1qOkKHpLDl/3A5NuRv5PV5cyWfmo+IiIiI6A36fEBIppuouspd6+srh0CfDwjJdBtdV7lrfX3l4PWHFq83kelGyq5y1/r6ykHQ5wPe6gIa+UL5hhe1XG2lLdNftTJQWTjT3+r0t876BXjT1Y5Oki5o+wV+3sEH0BVAKzeFiHo1+OICrw6H8vN0ll8vkdvS8eqZ/S8Y7RE///yzMNtTPpG8KQHGB4useu8FaTBuEMsvmEL+/ISAYHtE8+uQV5X+2yNggb6DzkKA7W8XhYL1WyzEZwHq20ZW0IGAcBdQ377VxcRDXQRCBHq7lCD5qSwZWLX5g6DPB1gGtWYQ1IMYHaSAyu5B1TpI0vrpIGumN/y4ZNUHWjmIoW9jfW+jXeUwhnZk+jpSXeUwhnZl+7rSXeWIiIiIiIgID2rH4dLk0YP8/8CwfA0JAD8B5QsrKPwECPpPD8eN6isJwSMTgqB5c8nk39+NHdECbvwYcNPvAhERERERERHbRnJ1PIHgLkjIum90Tcj/BxozEhFo6wYE0Ot9lfTfhgVQfa+U/qYFlNvby5eDgHbtzdTX4FCdfW3HgKyBqT++4pX+V8cG+lpAlf/q6t/XAq68/n3vAg79r+0YEIDW/+rYQNACukDp3fxGRIwc/we0wIqagmy7GAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wMy0xMVQwODo0NzoxMS0wNzowMJI9H2wAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDMtMTFUMDc6NTk6MzUtMDc6MDCtPb74AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAABDlBMVEXNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgo0zXbrAAAAWXRSTlMAGRAzBAhQv4KZLyJVcUBmYBoTMswNITwWQkhLIB5aIycxUyyFNIeAw2rIz8Y4RRy8uL58q7WljKqorR+yKf0BnlEk7woGAgOPomKUSqCvbd+cR2M/b3+RaPlAXvEAAAABYktHRACIBR1IAAAACXBIWXMAAABIAAAASABGyWs+AAAPZElEQVR42u1dC2PbthEGyUiq6ZiSXblLE6ex1mTO5iXZq+u6ro3abG26pOkSd13v//+RAXzhcIeHWMoUbeOTLesIEMB9PIB3ACgLERERMQIkkOy6CTvWH0bOQO/mJeDXP8EMqMzDEkIsEBRMAmh7jHSVmuAjAKwC8FRAzi8/DmoS1AI5AQltj5FOryAjgJ7OK2CZkwEZYO23q+BJ5wwKkttfui1z4s20VTAL5k2kF5hbiPcKcwvwNGB4C7CTwproI4CdDcxEPKUTExx+DNiAj0u9C9AuNPxdYOe46Y5QRERERERExIhx6Z7gjv2ghEVrQJ33hJ5BsxsBfsIq8M0HsAkhWfqglFgawAhgGWh2M1xMWAWUAE90qUofMhhi7be32JNsmVFJPKeLwBQglAQMNh3ALVjYbNaI1jaYD0jM0nw9atcWYEXiaXH/+QDeQ3Y6BoRx3e8CERERERERERG7Qz/HP+iaBsvvHXj0LAD4cip0yN27fXw7AGtQoDTwH+HqkWTgWczTwZVmr8DbAEuqv35bCT6CWDorjGnAqwOSCI7EhlFWHjkBXIkb1M/DZQgRwCeAwK9B+HRPFlPBOjeZszKz0wK9/FlzeE3I24GEzUII45bT/SYarqGLesE+btlDBP70QInkckDwggQqAGGt052667vAJZ8fvk1GRERERERE3FT035ba081ILLvR3UXa/NDgUlWg+m4N2KgCfzzP1lYtDUDpAi9ObeDVqczu4ASsy/u8kaxId/2W+JYq4CsbrBcV8SPw8iRvrWWze+IlILA3XFjNzMeAl7/EMt0TmH4wwtkmHG4OsLVzYkEsHLZE4+yRDbFBA+ypVoZJ6fR8iw24T2cEsBbw5pnptIuFCbA3wHkJN0pmAbObAOvaOl+hd14A1gVIFwl2AXsvT5w5GMPezQE8j8XAhFmAYCv0AQLIIEhS2bAUmsGh9VuukT/Z3goHgZsE7wEL4JnHPR+w6+djIiIiIiIiRo3LvYtzR4U8Kms5Y7uORbg46Ja9o/7Aj+Doz3oGZm2j9XKiMc0MTpGt7PgXvroD2G5x03es1iY9T4cHXH1LBmAKCyP69BIC9jL7EuB+vrtM8nw/gG0+w1yvZu31BQfNueA6fesENOGmi4DEEg7zpnviKZ5uW50Gkgr+zLBFChJLC1m4C9hEwduHLaXRCRHvnhUrAbRLbD2804Oamkxg0Zn5fL8lnQi2bo8JYfwECAkR3h/mjA6LTskTI4HoNbQJKDT/4J8/uoa47vpFRERERFxvpFf8RmZxO8C3XEW94V+i/5iWAqzLLKb3lQZXAyElhXpFIUa1GMK2LgsUryhVU0hRMGTGdylUFqDzC+sSOCNwLN0GePRCt9dL/Y3ozCAAKhKMeJaKWN8ExkWAZfmdE5QSmRKA/wpL7IaOJW0XG0sX2MACWH5zx0ZFkMMC6H6Fhu7R6M90ZGMAyWGdoUm1ldAxwLJBZjTmr9tkSPiPY8hH+VO7QmD5pDDgd2V2YIDT0e0i0XugD8kICeiLLvpHRERERNwsZMpPyDbPf2sicWuo1k1l42ZTX473Ap4b7FWukkvFjCZnfj5uiRwgF7dIAeiMfSnuC4dME8XtGuSERiU4KIopcvbKzwYhpVs057ufG3FRa7gw9G1bTGW2srVfpzetnuQwmUA+MRogWDBB99paherA3FZjG6QVRZFWIITMDAIQA6BMdKJr3DMIkEUfSrSuNDQW4FrvrorTBU5gcnT0PmAClsul/wkMgQkQAQL2DQJBqY4OSEISTEjVQJPwYwWXBcAU0B9VcT0GAGqg0eLj8vRjTcDRB/u/Mgi4c+cO2x7vlskBSoDS/0NMgGlSIPUHTlGKpv3gjoLTAg6V6jA91PMAWWn/LQGqfDTFVhWnC5Rd4O5d3AWWQl4C+d6ekJWvX0iA0v/2vQ/dBCTkgDySJIcJCmHg5OTEPQbAoWRA6o8JKH9aAspBEBFwX519/35z4KgaBI+IOugETgB7REMQAj7C8xPzxW35XrgIoBXCgxKowtPTU9AmyiwgO5xO5ZvuAqXsJuC0Qn0gyeGDPF9Bjp8RQl1IHvh1+cL6TigBE0IAGBYw1/p7CGiL+7gEMblJSwC1gOywRHOJmAxqjJ2C0SfzvL0L5E39udMCOAGhLoDTqzGwaDO3BGRmfW1xlR8A7wkHiAWEboNVe+bmHEymb93AFQ4MegtcPT9ACSgZKMT2kGWLEh18Pcah6bqEs0OvaaX9reofERERETFyPHzoT0/BO68NYNv6SJDpcPdReZt61Ih1sN3G2PNanrfnVq7J/sayEL8h7Sm89zUZbR2TQ/K2jfXPMs3ATHmRZ/kUBTuyyfO91pGzUpHp449qV7xhQJ6sQFaaTM8mV67gxnJ1PVoNCuXMpe29PVXczvE1fQzwmOivHKUTrb/yzdvoN7E7Yiich9/K1wFuUCavc4byG2uDNLYQvxPn4vc4vs2lkBuyMOXjyTGSVfsXC1cDoXb2a7kxOGRxsrGLVLuO1YxFG11xAkg4DOLJ/afP7t1H00aZtO8Mt8dLwB/gj/L1J6ygcv2JjIMPGRtPcur7tnLtzKf2+h42IhoHZnCwkBxUwl4zY7PnIqAeBZAFHMCf4aFukNQfTdmFLeAv4hPxVz2ldEos4JRYwCmxgIURe8geUA1SbXxL6vu0kj5tG1gG8zh2ADUGaP3CBDy5/9ED+bLrX3vqmIAUylmnRv4bfCZff0c7Jow+XsrvExmll/1X4oGDgCa6S40GEfsRGOYoD5OpODHiRUJARhgm+rc7IkwCkPz5J3dmd/7xRS0fNsXtbyYvzKsnWBeoZSw+fqxlZfvtfKeVAEGg9gilwj0pCWSS+1HdYH0XUFuMhKtLqO5OivPLgujPA/gU6y+efimHv/mXT1sCZP9PPeczRedsEDUnWdkkP/ED6LQ3kW3fAOOTF1R/ehsU1aYunVyuCNwu2vOBlWAgF1cQRYcA3/CBIiIiIiJ2gCmemFauHJyyPM/1x0veWlguRXjvftCnBSms5fsa35rPALmaH8JXX339NXyBmnOg9C8hP6zuwZMncG/VpJP9Fs10QzPf0Mr0QBu8Ub8ph9l0+sJgwP/lYiEsZFk5ijZBMrCm3viJ9rz+qfAv7Yqup7KABQtu2nSyVEs+1MGrziNdx0wGO3pxsErQwZVyjNfwwrJb9hcSoFwtdIbSvfw1DUAT8M23z59/+41uz1RAscArO5QAY8sIlJNRaMNDKqqpilT72pmaj0EEPFNrdbjCtWLdRQANL7m6JL1a3dMWtS5lrX9q5ofS1vfb01/KpBlyV2FCNmSY55froCgDqMBTxnMCW8B8jver56uVCi81AVJ/gabAKOM0WLCLxMTb9jc2gPSvrmAzBnwG+xLwss1QFMb5cOwn4Eh+PFI/TbIysCmcIAsg0euzZ4fPVnDWFvhCtW62PQKoBXxXys2sXK2/VjBflzgxT9eEyUt6fHxsEFBf2erPicTn8odseFg7x4DVSnUAPAi+mE5nWxwEyRjwXT0G1Awo/QsjHF2p9p7o09cHcIYYUAUdoWGvmbxp9Pv44/qHGIhzDJhmq9UKVpgBehvc9l3gsZqY1e2hodt6PtcTVnIElD+pZgCMP83H/eYAvQ2WFlHCMQbAVAETYLuGfQggSMtr/7jxAyx7BM0RVlrLi1SNlM+b1H8/ScyvdRHlqFFLk0xN6WXNho3ufsDucfTq1RESFweKq/R5yxhtMNs5GREREdELU7w7+vX3aoj5/vWuGzUg3gC8aYUfmlH3h103azDcVererYXX1R1HvWsbWMISn/AfizMjtrfzbFnyv+xf0KZ4owKoxgTeagLetjmI22DzIwpNCVt6oAeoDEt1T196y79E3K0Uvosqp64Ha09KDxTaKAIbN5X8bvLOXJ1l1Q1JgBwBVAj9xqjcbMMcL4xV+uvlxcLU37Z1d5EusH7v5Ns7I8NyhwQUzfUu3AQUpMsDnKc4DetvIyA1TKbcaD4xwmmDgAyWy+Vwnq5W2E0APwfpL3U3BsXeFjDsIFgaQPXQTKnDK03AK5Sp8BeA03uPAcNGa3TQe6rFpzgTOYkwYPDT+y4gxIBD4FIrXLXgohEvsI50DMBSsf3d5zsN1n9U07Lw8sddtmFMsxURERERERGXjAJ84mUDZsSR2egJiT7Y26P6g0e8fAKAUGAQUKalOEMxS9WbkUGFzI08rzK5w9uC+M4FS4ZyhWxAAkwKTAKqtLbN5eWR6tEMBgE4nRNAg0U+GWBuxh2EALwZmBJQTn/UjSz/zHCb6wyYgJlFp7DGhrjN/x+wEQEDWsBGBAxsAcOOARQ7HwMGvgvw+Y4d3wVGgN36ARERERERNxv+58iuO9L/Cvjpc7R3U3opZzfoe3LVc6TwU4GeZ8iLl5YHKBrfhH7/QVd5dFjD/yQBAu1OVqzMGAP0yVK9X7+bPDakcC7ET4U4x09br09kRGs+X6sVmRxP5E+7fRuOzf3sSgZTnqjXZKTubVbvmz/TVyhfgNptf+AgoPxqtOSw+X49SCBJ1IFGPlQv/f17Kl0eSQ5HSkBpARLn+IqrcWFt7E5GBHxRoTXxjvLoMCvvgQu050UGo1M4mToIuHaDYA5wfnaOh/1qOkKHpLDl/3A5NuRv5PV5cyWfmo+IiIiI6A36fEBIppuouspd6+srh0CfDwjJdBtdV7lrfX3l4PWHFq83kelGyq5y1/r6ykHQ5wPe6gIa+UL5hhe1XG2lLdNftTJQWTjT3+r0t876BXjT1Y5Oki5o+wV+3sEH0BVAKzeFiHo1+OICrw6H8vN0ll8vkdvS8eqZ/S8Y7RE///yzMNtTPpG8KQHGB4useu8FaTBuEMsvmEL+/ISAYHtE8+uQV5X+2yNggb6DzkKA7W8XhYL1WyzEZwHq20ZW0IGAcBdQ377VxcRDXQRCBHq7lCD5qSwZWLX5g6DPB1gGtWYQ1IMYHaSAyu5B1TpI0vrpIGumN/y4ZNUHWjmIoW9jfW+jXeUwhnZk+jpSXeUwhnZl+7rSXeWIiIiIiIgID2rH4dLk0YP8/8CwfA0JAD8B5QsrKPwECPpPD8eN6isJwSMTgqB5c8nk39+NHdECbvwYcNPvAhERERERERHbRnJ1PIHgLkjIum90Tcj/BxozEhFo6wYE0Ot9lfTfhgVQfa+U/qYFlNvby5eDgHbtzdTX4FCdfW3HgKyBqT++4pX+V8cG+lpAlf/q6t/XAq68/n3vAg79r+0YEIDW/+rYQNACukDp3fxGRIwc/we0wIqagmy7GAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wMy0xMVQwODo0NzoxMS0wNzowMJI9H2wAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDMtMTFUMDc6NTk6MzUtMDc6MDCtPb74AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-first,.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-all,.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-widget-overlay{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABkAgAAAACbvzUHAAAAAmJLR0QAAzOEcogAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAAWSURBVDjLY1gFBwyjzFHmKHOUSS4TAApJmC9aV5jjAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwMFsFqAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wMy0xMVQwODo0OTo0NS0wNzowMEEGvRQAAAAASUVORK5CYII=) 50% 50% repeat-x #aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABkAgAAAACbvzUHAAAAAmJLR0QAAzOEcogAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAAWSURBVDjLY1gFBwyjzFHmKHOUSS4TAApJmC9aV5jjAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTAzLTExVDA4OjQ5OjQ1LTA3OjAwMFsFqAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wMy0xMVQwODo0OTo0NS0wNzowMEEGvRQAAAAASUVORK5CYII=) 50% 50% repeat-x #aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}/*!
- * StyleSheet for JQuery splitter Plugin
- * Copyright (C) 2010 Jakub Jankiewicz <http://jcubic.pl>
- *
- * Same license as plugin
- */.splitter_panel{position:relative}.splitter_panel .vsplitter{background-color:grey;cursor:col-resize}.splitter_panel .hsplitter{background-color:#5F5F5F;cursor:row-resize}.splitter_panel .hsplitter.splitter-invisible,.splitter_panel .vsplitter.splitter-invisible{background:0 0}.splitter_panel .bottom_panel,.splitter_panel .hsplitter,.splitter_panel .left_panel,.splitter_panel .right_panel,.splitter_panel .top_panel,.splitter_panel .vsplitter{position:absolute}.splitter_panel .left_panel,.splitter_panel .right_panel,.splitter_panel .vsplitter{height:100%}.splitter_panel .bottom_panel,.splitter_panel .hsplitter,.splitter_panel .top_panel{width:100%}.splitter_panel .left_panel,.splitter_panel .top_panel,.splitter_panel .vsplitter{top:0}.splitter_panel .bottom_panel,.splitter_panel .hsplitter,.splitter_panel .left_panel,.splitter_panel .top_panel{left:0}.splitter_panel .bottom_panel{bottom:0}.splitter_panel .right_panel{right:0}.splitterMask{position:absolute;left:0;top:0;right:0;bottom:0;z-index:1000}/*!
- * Bootstrap v3.3.5 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000;background:#ff0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot);src:url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff) format('woff'),url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\e227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\00a5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.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}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio label,fieldset[disabled] .radio-inline,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.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;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin:8px -15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-radius:4px 4px 0 0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:3;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 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:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.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}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;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-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.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;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;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{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";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,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.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:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:transparent;border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-print,.visible-print-block,.visible-print-inline,.visible-print-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}@media print{.visible-print-block{display:block!important}}@media print{.visible-print-inline{display:inline!important}}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}.tm-tag{color:#555;background-color:#f5f5f5;border:1px solid #bbb;box-shadow:0 1px 1px rgba(0,0,0,.075) inset;display:inline-block;border-radius:3px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;margin:0 5px 5px 0;padding:4px;text-decoration:none;transition:border .2s linear 0s,box-shadow .2s linear 0s;-moz-transition:border .2s linear 0s,box-shadow .2s linear 0s;-webkit-transition:border .2s linear 0s,box-shadow .2s linear 0s;vertical-align:middle}.tm-tag .tm-tag-remove{color:#000;font-weight:700;margin-left:4px;opacity:.2}.tm-tag .tm-tag-remove:hover{color:#000;text-decoration:none;opacity:.4}.tm-tag.tm-tag-warning{color:#945203;background-color:#f2c889;border-color:#f0a12f}.tm-tag.tm-tag-error{color:#84212e;background-color:#e69ca6;border-color:#d24a5d}.tm-tag.tm-tag-success{color:#638421;background-color:#cde69c;border-color:#a5d24a}.tm-tag.tm-tag-info{color:#4594b5;background-color:#c5eefa;border-color:#5dc8f7}.tm-tag.tm-tag-inverse{color:#ccc;background-color:#555;border-color:#333;box-shadow:0 1px 1px rgba(0,0,0,.2) inset}.tm-tag.tm-tag-inverse .tm-tag-remove{color:#fff}.tm-tag.tm-tag-large{font-size:16.25px;border-radius:4px;padding:11px 7px}.tm-tag.tm-tag-small{font-size:11.05px;border-radius:3px;padding:2px 4px}.tm-tag.tm-tag-mini{font-size:9.75px;border-radius:2px;padding:0 2px}.tm-tag.tm-tag-plain{color:#333;box-shadow:none;background:0 0;border:none}.tm-tag.tm-tag-disabled{color:#aaa;background-color:#e6e6e6;border-color:#ccc;box-shadow:none}.tm-tag.tm-tag-disabled .tm-tag-remove{display:none}input[type=text].tm-input{margin-bottom:5px;vertical-align:middle!important}.control-group.tm-group{margin-bottom:5px}.form-horizontal .control-group.tm-group{margin-bottom:15px}.c3 svg{font:10px sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:grey;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}span.twitter-typeahead .tt-dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:250px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}span.twitter-typeahead .tt-suggestion>p{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}span.twitter-typeahead .tt-suggestion>p:focus,span.twitter-typeahead .tt-suggestion>p:hover{text-decoration:none;outline:0;background-color:#e8e8e8}span.twitter-typeahead .tt-suggestion.tt-cursor{background-color:#f8f8f8}span.twitter-typeahead{width:100%}.input-group span.twitter-typeahead{display:block!important}.input-group span.twitter-typeahead .tt-dropdown-menu{top:32px!important}.input-group.input-group-lg span.twitter-typeahead .tt-dropdown-menu{top:44px!important}.input-group.input-group-sm span.twitter-typeahead .tt-dropdown-menu{top:28px!important}.tt-suggestion{max-width:30em;overflow:hidden}.tt-suggestion .tt-label{padding-left:1.5em}.tt-file-header,.tt-suggestion .tt-match.file{background-size:1em;background-repeat:no-repeat;background-position:5px 5px}.tt-match.predicate.built_in .tt-label{color:#00f}.tt-suggestion .tt-title{color:#555;white-space:nowrap;overflow:hidden;font-style:italic;font-size:80%}.tt-suggestion .tt-tags{max-width:100px;float:right;margin-right:2px}.tt-suggestion .tt-tag{max-width:30px;border:1px solid #ddd;padding:0 4px;margin-left:2px;border-radius:5px;background-color:#e1edff}.tt-suggestion .tt-line{white-space:nowrap}.tt-suggestion .tt-lineno{display:inline-block;width:40px;min-width:20px;font-family:monospace;color:#999;background-color:#eee;border-right:1px solid #ddd;padding:0 3px 0 5px;text-align:right}.tt-suggestion .tt-text{padding-left:5px;white-space:nowrap}div.tt-file-header{padding-left:5em;background-color:#ddd;color:#000}span.tt-path-file{font-weight:700}div.tt-match.source{overflow:hidden}table.diff{width:100%;border-collapse:collapse;border:1px solid #a9a9a9;white-space:pre-wrap}table.diff tbody{font-family:Courier,monospace}table.diff tbody th{font-family:verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif;background:#EED;font-size:11px;font-weight:400;border:1px solid #BBC;color:#886;padding:.3em .5em .1em 2em;text-align:right;vertical-align:top}table.diff thead{border-bottom:1px solid #BBC;background:#EFEFEF;font-family:Verdana}table.diff thead th.texttitle{text-align:left}table.diff tbody td{padding:0;vertical-align:top}table.diff .empty{background-color:#DDD}table.diff .replace{background-color:#FD8}table.diff .delete{background-color:#E99}table.diff .skip{background-color:#EFEFEF;border:1px solid #AAA;border-right:1px solid #BBC}table.diff .insert{background-color:#9E9}table.diff th.author{text-align:right;border-top:1px solid #BBC;background:#EFEFEF}.nb-content,.nb-toolbar{width:100%;padding-left:1em;padding-right:1em}.nb-toolbar{position:absolute;padding-top:5px;padding-bottom:5px;margin-bottom:1em;border-bottom:1px solid #ddd}.nb-view{position:absolute;top:40px;height:calc(100% - 40px);width:100%;overflow-y:auto}.nb-content{position:relative;width:100%}.nb-bottom{width:100%;height:30%}.dropdown.cell-type{display:inline}.nb-cell.markdown:not(.runnable){background-color:transparent;border:0}.nb-cell{box-sizing:border-box;background-color:#eee;border:1px solid #ccc;border-radius:5px}.nb-type-select{padding:1em 0}.nb-type-select>label{margin-left:1em;margin-right:1em;position:relative;top:.1em}.nb-type-more{padding-bottom:1em;padding-left:1em}.nb-type-more label{margin-right:1em;position:relative;top:.1em}.nb-type-more input{display:inline}.nb-cell.active,.nb-cell.active.query>.query{border:1px solid #888}.nb-cell .CodeMirror{border-radius:5px}.nb-cell-buttons{text-align:right;width:100%}.nb-cell.query{border:0;background:0 0}.nb-cell.query>.query{background-color:#eee;border:1px solid #ccc;border-radius:5px}.nb-cell .prolog-prompt{float:left;width:44px;padding-right:.3em;padding-top:.2em;font-weight:700;text-align:right}.nb-cell .editor.query{margin-left:44px}.nb-cell.program,.nb-cell.query{margin-bottom:1em}.nb-placeholder{opacity:.5}.nb-cell.markdown pre.code{width:90%;margin:auto auto 1em}.nb-cell.markdown dl.termlist{margin-left:5%}.nb-cell.markdown dl.termlist dd{margin-left:2em}.type-icon.pl{background-image:url(../icons/pl.png)}.type-icon.owl{background-image:url(../icons/owl.png)}.type-icon.swinb{background-image:url(../icons/swinb.png)}.type-icon.select{background-image:url(../icons/select.png)}div.feedback{position:absolute;bottom:3px;left:0;right:3px;padding:0 10px 3px;z-index:1000;border:1px solid #888;border-radius:5px;background-color:#cff;box-shadow:3px 3px 5px #888}a.pengine-logo{position:absolute;top:4px;left:4px;width:42px;height:42px;background-image:url(../icons/red_bird.svg);background-size:100%}.splitter_panel .hsplitter,.splitter_panel .vsplitter{z-index:100;border:2px outset #ccc}.splitter_panel .vsplitter{width:3px}.splitter_panel .hsplitter{height:3px}.splitter_panel .bottom_panel,.splitter_panel .hsplitter,.splitter_panel .left_panel,.splitter_panel .right_panel,.splitter_panel .top_panel,.splitter_panel .vsplitter{overflow:visible}body .modal-dialog{width:80%;max-width:800px;margin-left:auto;margin-right:auto}body .modal-dialog.modal-wide{width:90%;max-width:none}body .modal-dialog.swish-embedded-manual{width:90%;max-width:1000px}body .modal-dialog.swish-embedded-manual div.modal-body{padding:0}iframe.swish-embedded-manual{width:100%;border:0}
\ No newline at end of file
diff --git a/web/css/trill_on_swish-min.css.gz b/web/css/trill_on_swish-min.css.gz
deleted file mode 100644
index 59f4b40..0000000
Binary files a/web/css/trill_on_swish-min.css.gz and /dev/null differ
diff --git a/web/help/about.html b/web/help/about.html
index be6a500..de60117 100644
--- a/web/help/about.html
+++ b/web/help/about.html
@@ -3,7 +3,6 @@
 <html>
   <head>
   <title>About TRILL on SWISH</title>
-  <link rel="stylesheet" href="/css/swish.css">
   <style>
   div.github {
     padding-top: 2ex;
@@ -37,6 +36,7 @@
 <p>
 <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> is a web application for trying <span itemprop="applicationCategory">probabilistic semantic web reasoning</span> with a web browser on <span itemprop="operatingSystem">any operating system</span>. It was written by Riccardo Zese and Fabrizio Riguzzi.
 </p>
+<p>Please use this <a href="https://groups.google.com/forum/#!forum/trill-system" target="_blank">forum</a> for questions or send an email to <a href="mailto:trill-system@googlegroups.com">trill-system@googlegroups.com</a>.</p>
 <p><span style="color:darkblue">SWI</span><span
 style="color:maroon">SH</span> was originally written by Torbj&ouml;rn Lager
 as a homage to SWI-Prolog. Jan Wielemaker designed and implemented the
@@ -58,7 +58,7 @@ plugin</a> adds Prolog based exploration of RDF data to ClioPatria.
 
 <p>
 The <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> source is available from <a itemprop="codeRepository" href="https://github.com/friguzzi/trill-on-swish.git">Github</a>. 
-It requires SWI-Prolog 7 installed from the latest <a href="http://github.com/SWI-Prolog/swipl-devel.git">GIT</a>.
+It requires the latest SWI-Prolog installed from <a href="http://github.com/SWI-Prolog/swipl-devel.git">GIT</a>.
 </p>
 <div class="github">
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=friguzzi&amp;repo=trill-on-swish&amp;type=watch&amp;count=true" width="100" height="20" title="Star on GitHub"></iframe>
@@ -75,6 +75,8 @@ style="color:maroon">SH</span> source is available from <a itemprop="codeReposit
 </div>
 
 <p>
+<span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> is 
+available also as a cpack for Cliopatria.
 ClioPatria is available <a href="http://cliopatria.swi-prolog.org/home">here</a> and from <a itemprop="codeRepository"
 href="https://github.com/ClioPatria/ClioPatria.git">Github</a>. 
 <p>
@@ -82,6 +84,65 @@ href="https://github.com/ClioPatria/ClioPatria.git">Github</a>.
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=ClioPatria&amp;repo=ClioPatria&amp;type=watch&amp;count=true" width="100" height="20" title="Star on GitHub"></iframe>
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=ClioPatria&amp;repo=ClioPatria&amp;type=fork&amp;count=true" width="102" height="20" title="Fork on GitHub"></iframe>
 </div>
+<p><span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span> is described in
+<ul>
+<li>
+Jan Wielemaker, Torbj&ouml;rn Lager, and Fabrizio Riguzzi.
+ SWISH: SWI-Prolog for sharing.
+ In Stefan Ellmauthaler and Claudia Schulz, editors, <em>
+  International Workshop on User-Oriented Logic Programming (IULP 2015)</em>,
+  &copy; by the authors, 2015.<br/>
+[&nbsp;<a href="http://ds.ing.unife.it/~friguzzi/latest_bib.html#WieTorRig15-IULP-IW">bib</a>&nbsp;| 
+<a href="http://arxiv.org/abs/1511.00915">http</a>&nbsp;]
+</li>
+</ul>
+
+
+<p>The algorithm for probabilistic inference (TRILL) is described in:</p>
+<ul>
+<li>
+Riccardo Zese, Elena Bellodi, Evelina Lamma, Fabrizio Riguzzi, and Fabiano
+  Aguiari.
+ Semantics and inference for probabilistic description logics.
+ In Fernando Bobillo, Rommel&nbsp;N. Carvalho, Paulo&nbsp;C.G. Costa, Claudia
+  d'Amato, Nicola Fanizzi, Kathryn&nbsp;B. Laskey, Kenneth&nbsp;J. Laskey, Thomas
+  Lukasiewicz, Matthias Nickles, and Michael Pool, editors, <em>Uncertainty
+  Reasoning for the Semantic Web III</em>, volume 8816 of <em>Lecture Notes in
+  Computer Science</em>, pages 79-99. Springer International Publishing,
+  &copy; Springer International Publishing, 2014.
+ The original publication is available at
+  <a href="http://www.springerlink.com">http://www.springerlink.com</a>.<br/>
+[&nbsp;<a href="http://ds.ing.unife.it/~friguzzi/latest_bib.html#RigBel14-URSWb-BC">bib</a>&nbsp;| 
+<a href="http://dx.doi.org/10.1007/978-3-319-13413-0_5">DOI</a>&nbsp;| 
+<a href="http://ds.ing.unife.it/~friguzzi/Papers/RigBel14-URSWb-BC.pdf">.pdf</a>&nbsp;]
+</li>
+<li>
+
+
+Riccardo Zese, Elena Bellodi, Fabrizio Riguzzi, and Evelina Lamma.
+ Tableau reasoners for probabilistic ontologies exploiting logic
+  programming techniques.
+ In Elena Bellodi and Alessio Bonfietti, editors, <em>Proceedings of
+  the Doctoral Consortium (DC) co-located with the 14th Conference of the
+  Italian Association for Artificial Intelligence (AI*IA 2015)</em>, volume 1485 of
+  <em>CEUR Workshop Proceedings</em>, pages 1-6, Aachen, Germany, 2015.
+  &copy; by the authors, Sun SITE Central Europe.<br/>
+[&nbsp;<a href="http://ds.ing.unife.it/~friguzzi/latest_bib.html#ZesBel15-AIIADC-IW">bib</a>&nbsp;| 
+<a href="http://ceur-ws.org/Vol-1485/paper1.pdf">.pdf</a>&nbsp;]
+</li>
+<li>
+Riccardo Zese, Elena Bellodi, Evelina Lamma, and Fabrizio Riguzzi.
+ Logic programming techniques for reasoning with probabilistic
+  ontologies.
+ In Odile Papini, Salem Benferhat, Laurent Garcia, and Marie-Laure
+  Mugnier, editors, <em>International Workshop on Ontologies and Logic
+  Programming for Query Answering</em>, &copy; by the authors, 2015.<br/>
+[&nbsp;<a href="http://ds.ing.unife.it/~friguzzi/latest_bib.html#ZesBel15-OntoLP-IW">bib</a>&nbsp;| 
+<a href="http://ds.ing.unife.it/~friguzzi/Papers/ZesBel-OntoLP15.pdf">.pdf</a>&nbsp;| 
+<a href="http://ontolp.lsis.org/files/pdf/proc-ontolp.pdf#page=13">http</a>&nbsp;]
+</li>
+</ul>
 
 </body>
 </html>
diff --git a/web/help/background.html b/web/help/background.html
index 1e90e3f..68ac6ba 100644
--- a/web/help/background.html
+++ b/web/help/background.html
@@ -7,11 +7,11 @@
 <body>
 <h2>Table of Contents</h2>
   <ul>
-    <li>Motivation</li>
-    <li>Supported browsers</li>
-    <li>Adding SWISH or TRILL on SWISH to your application</li>
-    <li>Technology</li>
-    <li>Source code</li>
+    <li><a href="#motivation">Motivation</a></li>
+    <li><a href="#browsers">Supported browsers</a></li>
+    <li><a href="#swishapp">Adding TRILL on SWISH to your application</a></li>
+    <li><a href="#technology">Technology</a></li>
+    <li><a href="#source_code">Source code</a></li>
   </ul>
 
 <h2 id="motivation">Motivation</h2>
@@ -61,9 +61,9 @@ provided the user is logged in with <em>administrative</em> rights.
 style="color:maroon">SH</span> works fine recent versions of in Safari,
 Firefox, Chrome and Internet Explorer (tested IE 11).
 
-<h2 id="swishapp">Adding SWISH or TRILL on SWISH to your application</h2>
+<h2 id="swishapp">Adding TRILL on SWISH to your application</h2>
 <p>
-<span style="color:darkblue">SWI</span><span
+<span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
 style="color:maroon">SH</span> can be added easily to any SWI-Prolog web
 application. For example, it is available as an extension pack for <a
 target="_blank" href="http://cliopatria.swi-prolog.org/">ClioPatria</a>,
@@ -71,8 +71,6 @@ the SWI-Prolog RDF framework. It can be added to ClioPatria using the
 command below, providing an alternative for SPARQL for exploring the
 database (requires SWI-Prolog 7.1.32 or later).
 
-<pre style="font-size:80%">
-?- cpack_install(swish).</pre>
 <pre style="font-size:80%">
 ?- cpack_install(trill_on_swish).</pre>
 <h2 id="technology">Technology</h2>
@@ -104,7 +102,10 @@ available</a>
 <p>
 The source code for <span style="color:darkblue">SWI</span><span
 style="color:maroon">SH</span> is available on <a target="_blank"
-href="https://github.com/SWI-Prolog/swish">GitHub</a>.
+href="https://github.com/SWI-Prolog/swish">GitHub</a>.<br/>
+The source code for <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span> is available on <a target="_blank"
+href="https://github.com/friguzzi/trill_on_swish">GitHub</a>.
 </body>
 </html>
 
diff --git a/web/help/beware.html b/web/help/beware.html
index 3aaa63d..32ea7a3 100644
--- a/web/help/beware.html
+++ b/web/help/beware.html
@@ -33,11 +33,7 @@ TRILL on SWISH is designed for developing and experimenting with the system, als
 It is based on SWISH, a limited subset of SWI-Prolog!
 </div>
 
-
 <p>
-SWI-Prolog provides rich libraries for web programming, RDF handling,
-database access, networking, etc. We can not expose the full system in
-the web version for various reasons, security being the most important.
 If you want to <strong>work on a real application</strong>, <a target="_blank"
 href="http://www.swi-prolog.org/Download.html">download</a> your own
 copy of SWI-Prolog.
@@ -51,9 +47,8 @@ Here are some examples.
 <ul>
   <li>No installation required.  Only needs a recent browser.
   <li>You can play with some examples to get a basic feeling
-      what Prolog programming looks like.
-  <li>You can do exercises from e.g. <a href="http://www.learnprolognow.org/">
-      Learn Prolog Now!</a>
+      what using TRILL looks like.
+  <li>You can do exercises and execute several tests</a>
   <li>You can <strong>save your code</strong> and <strong>share</strong>
       both the code and example queries with anyone on the web.
   <li>You can <strong>collaborate</strong> using
@@ -65,9 +60,10 @@ Here are some examples.
 <h2>The future of the online version</h2>
 
 <p>
-The current online version is an early <em>prototype</em>. We have
-several plans with it. If you are not impressed, please visit this page
-again in a couple of months. These are the main plans:
+The current online version is based on SWISH, 
+<span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> 
+will be maintained up to date with it. 
+These are the main plans for SWISH:
 
 <ul>
   <li>Better shared source management.  Show dependencies, better
@@ -78,8 +74,14 @@ again in a couple of months. These are the main plans:
       href="http://lpn.swi-prolog.org">Learn Prolog Now!</a>
 </ul>
 
+<p>
+<span style="color:red"> WARNING: if you are using Cliopatria, at the moment you cannot have installed both <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span>
+and <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span>. We are working to allow you to install both on the same installation of Cliopatria. If you need both the application you
+can use the standalone versions. However, with <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> you can execute Prolog queries as in standard <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span>.</span>
+</p>
 <p>
 Please be patient or contribute to <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> at <a href="https://github.com/friguzzi/trill-on-swish.git">GitHub</a>
+</p>
 
 <div class="github">
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=friguzzi&amp;repo=trill-on-swish&amp;type=watch&amp;count=true" width="100" height="20" title="Star on GitHub"></iframe>
diff --git a/web/help/caveats.html b/web/help/caveats.html
index 4a17d4f..04283a2 100644
--- a/web/help/caveats.html
+++ b/web/help/caveats.html
@@ -5,6 +5,11 @@
   <title>Caveats of the web version of TRILL and SWI-Prolog</title>
   </head>
   <body>
+<!--h2>Table of Contents</h2>
+                <ul>
+                    <li>Sandboxing</li>
+                    <li>Input and output/li>
+		</ul-->
 
 <h2 id="sandboxing">Sandboxing</h2>
 <p>
@@ -17,7 +22,8 @@ occasions:
 
   <ul>
     <li>If insufficient information is available to decide what
-        will be called. Such errors are raised as <em>instantiation errors</em>.
+        will be called.  E.g., <code>?- read(X), call(X).</code>
+	Such errors are raised as <em>instantiation errors</em>.
     <li>If a predicate is found that is not whitelisted.  Such
         errors are raised as <em>permission errors</em>
     <li>If a called predicate is not defined.  Such errors are
diff --git a/web/help/help.html b/web/help/help.html
index 943caf8..4e0bdb0 100644
--- a/web/help/help.html
+++ b/web/help/help.html
@@ -3,30 +3,38 @@
 <html>
   <head>
   <title>TRILL on SWISH</title>
-  <link rel="stylesheet" href="/css/swish.css">
-  <style>
-  body {
+  </head>
+<body>
+<style>
+body {
  	overflow: scroll;
 	margin: 10px;
   }
-  </style>
-  </head>
-<body>
+  p.note { margin-left: 5%; position: relative }
+p.note span.glyphicon-hand-right {
+float: left; font-size: 150%; color: orange; padding-right: 0.2em;
+}
+</style>
+
 <h4>Table of Contents</h4>
   <ul>
-    <li>Basic operation</li>
-    <li>Embedding examples in the program text</li>
-    <li>Save or share your program</li>
-    <li>Preload TRILL on SWISH with data</li>
-    <li>Download query results as CVS</li>
-    <li>RDF/XML syntax and tools</li>
-    <li>TRILL manual</li>
+    <li><a href="#help-basics">Basic operation</a></li>
+    <li><a href="#help-examples">Embedding examples in the program text</a></li>
+    <li><a href="#help-share">Save or share your program</a></li>
+    <li><a href="#help-preload">Preload TRILL on SWISH with data</a></li>
+    <li><a href="#help-csv">Download query results as CVS</a></li>
+    <li><a href="#help-trill">TRILL manual</a></li>
+    <li><a href="#help-write-kb">Writing knowledge bases</a></li>
+    <ul>
+    	<li><a href="#help-trill-syntax">TRILL syntax</a></li>
+    	<li><a href="#help-rdf-syntax">RDF/XML syntax and tools</a></li>
+    </ul>
   </ul>
 
 <h2 id="help-basics">Basic operation</h2>
 <p>
 TRILL is about running a <i>query</i> against a <i>knowledge base</i>. 
-It can handle <i>SHOQ</i> knowledge bases writtend in RDF/XML format.
+It can handle <i>SHOQ</i> knowledge bases writtend in RDF/XML format or using a OWL Functional Syntax like format.
 </p>
 <p>
 TRILL is a tableau reasoner written in Prolog, the queries available are listed in TRILL manual section.
@@ -36,7 +44,8 @@ into the left editor.
 <p>
 A query can be executed by hitting <code>RETURN</code> if the query
 is complete and the caret is behind the '.' that terminates the query
-or by using the <b>Run!</b> button.  At this moment, the following happens:
+or by using the <a class="btn btn-xs btn-primary">Run!</a> button. 
+At this moment, the following happens:
 
 <ol>
   <li>The interface creates a <em>runner</em> in the top-right window
@@ -56,10 +65,16 @@ or by using the <b>Run!</b> button.  At this moment, the following happens:
 </ol>
 
 <p>
-Note that <b>you do not have to save your program to execute it</b>.  If
-your are not satisfied with the answer to a query, you can simply
-edit the program and use the <b>Run!</b> again.  The new query is
-executed in a completely new environment.
+Note that <b>you do not have to save your program to execute it</b>. If
+your are not satisfied with the answer to a query, you can simply edit
+the program and use <a class="btn btn-xs btn-primary">Run!</a> again.
+The new query is executed in a completely new environment. In
+particular, data that you asserted in a previous query is not available
+in the next.
+
+<p class="note">
+<span class="glyphicon glyphicon-hand-right"></span> Use
+<strong>Ctrl-Enter</strong> to insert a newline in a complete query
 
 <h2 id="help-examples">Embedding examples in the program text</h2>
 <p>
@@ -67,15 +82,26 @@ If you include example goals inside comments as shown below,
 they will be used to populate the example menu and make the
 first goal show in the Goal input field.
 </p>
+<pre style="font-size:80%">
+/** &lt;examples&gt;
+
+?- instanceOf("http://my.ontology.org/ontologies/foo#myClass","http://my.ontology.org/ontologies/foo#myIndividual",ListExpl).
+
+*/</pre>
 <p>
-<b>NOTE:</b> if a complex string containing special characters (s.a. &#35;), surround it with escaped single quote (\'). See TRILL manual section for a list of possible queries.
+The examples blocks can be defined also in RDF/XML part surrounded by XML standard comment.
 </p>
 <pre style="font-size:80%">
+&lt;!--
 /** &lt;examples&gt;
 
-?- instanceOf(\'http://my.ontology.org/ontologies/foo#myClass\',\'http://my.ontology.org/ontologies/foo#myIndividual\',ListExpl).
+?- instanceOf("http://my.ontology.org/ontologies/foo#myClass","http://my.ontology.org/ontologies/foo#myIndividual",ListExpl).
 
-*/</pre>
+*/
+--&gt;</pre>
+<p class="note">
+<span class="glyphicon glyphicon-hand-right"></span> If a complex string containing special characters (s.a. &#35;), surround it with single or double quote, also escaped if needed (\'). See TRILL manual section for a list of possible queries.
+</p>
 
 
 <h2 id="help-share">Save or share your program</h2>
@@ -133,34 +159,359 @@ http://my.url/trill_on_swish/?code=https://github.com/friguzzi/trill-on-swish/ra
 <p>
 After running a query, the <strong>complete</strong> result set for the
 query can be downloaded as a CSV (Comma Separated Values) document by
-clicking the double down arrow at the <em>runner</em> window. This
-causes a dialogue to appear that allows for specifying the columns,
-optionally the detailed result format (if the server provides multiple
-result formats), whether only <em>distinct</em> results should be
-returned and the maximum number of results to return. The latter is by
-default set to 10&nbsp;000 to avoid sending huge documents by accident.
-The field can be cleared to return all results.
-
-<h2 id="help-rdf-xml">RDF/XML syntax and tools</h2>
- <p>RDF/XML knowledge bases consist of a set of possibly annotated axioms.
+clicking the <span class="glyphicon glyphicon-download"></span> button
+at the top-right of a <em>runner</em> window or using the
+<strong>Download answers as CSV</strong> option from the <span
+class="glyphicon glyphicon-menu-hamburger"></span> button on
+<em>notebook query cells</em>. This causes a dialogue to appear that
+allows for specifying the columns, optionally the detailed result format
+(if the server provides multiple result formats), whether only
+<em>distinct</em> results should be returned and the maximum number of
+results to return. The latter is by default set to 10&nbsp;000 to avoid
+sending huge documents by accident. The field can be cleared to return
+all results.
+
+<!--h3>Download query results through an API</h3>
+<p>
+The CSV results can also be downloaded programmatically by directly
+approaching the Pengine API. Example client code is <a
+href="https://github.com/SWI-Prolog/swish/tree/master/client"
+target="_blank">available</a>.  For example, the `swish-ask.sh` client
+can be used with `bash` to download the results for a query.  The call
+below downloads a CSV file for the <em>sin</em> function.
+
+<pre style="font-size:80%">
+$ bash swish.ask.sh --server=http://swish.swi-prolog.org \
+		    X,Y \
+		    "between(0,90,X),Y is sin(X*pi/180)"
+</pre>
+
+<p>
+The script can ask queries against stored Prolog scripts by specifying
+the script on the commandline.  For example:
+
+<pre style="font-size:80%">
+$ bash swish.ask.sh --server=http://swish.swi-prolog.org \
+		    sin_table.pl X,Y "sin_table(X,Y)"
+</pre>
+
+<p>
+Prolog can exploit the Pengine API directly.  For example, the above can
+be called as:
+
+<pre style="font-size:80%">
+?- [library(pengines)].
+?- pengine_rpc('http://swish.swi-prolog.org',
+	       sin_table(X,Y),
+	       [ src_text(':- include(sin_table).'),
+		 application(swish)
+	       ]).
+X = 0,
+Y = 0.0 ;
+X = 1,
+Y = 0.01745240643728351 ;
+X = 2
+...
+</pre>
+
+
+<h2 id="help-preload">Preload SWISH with data</h2>
+<p>
+You can make <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span>
+start with a loaded program using the URL <code>http://swish.swi-prolog.org/</code> and
+providing the parameters below.  The URL accepts both `GET` and `POST` requests.
+
+  <dl class="dl-horizontal">
+  <dt>code<dd>
+  Either the concrete code or a URL from which the code will be downloaded.
+  </dd>
+  <dt>background<dd>
+  As <code>code</code>, but this part of the code will not be visible in
+  the editor.
+  </dd>
+  <dt>examples<dd>
+  As the above described examples comment block.
+  </dd>
+  <dt>q<dd>
+  The initial query to load into the query window.  Note that the following
+  characters need to be escaped: '#', '&' and the space.
+  </dd>
+  </dl>
+
+<p>The URL below opens <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> on a file from GitHub with a default query.
+
+<pre>
+http://swish.swi-prolog.org/?code=https://github.com/SWI-Prolog/swipl-devel/raw/master/demo/likes.pl&amp;q=likes(sam,Food).</pre>
+<a target="_blank" href="http://swish.swi-prolog.org/?code=https://github.com/SWI-Prolog/swipl-devel/raw/master/demo/likes.pl&amp;q=likes(sam,Food).">Try it!</a> (launches a new tab)
+-->
+
+
+<h2 id="help-trill">TRILL manual</h2>
+<p>
+TRILL ("Tableau Reasoner for descrIption Logics in Prolog") implements a tableau algorithm in
+Prolog to compute the set of all the explanations of a query. After generating the explanations, TRILL can computes the probability of the query. The management of the tableau rules' non-determinism is delegated to the Prolog language.
+</p>
+<p>
+TRILL can compute the probability of queries using the commands shown below:
+<dl>
+  <dt><b>prob_instanceOf(Class,Individual,Prob)</b><dd>
+  Concept membership queries.
+  </dd>
+  <dt><b>prob_sub_class(Class1,Class2,Prob)</b>
+  <dd>
+  Subsumption queries.
+  </dd>
+  <dt><b>prob_unsat(ClassExpression,Prob)</b><dd>
+  Unsatifiability of a concept.
+  </dd>
+  <dt><b>prob_inconsistent_theory(Prob)</b><dd>
+  Inconsistency of the knowledge base.
+  </dd>
+  </dl>
+TRILL can test entailment or find an explanation <code>Expl</code> using the queries below:
+<dl>
+  <dt><b>instanceOf(Class,Individual),
+instanceOf(Class,Individual,Expl)</b><dd>
+  Concept membership queries.
+  </dd>
+  <dt><b>sub_class(Class1,Class2),
+sub_class(Class1,Class2,Expl)</b>
+  <dd>
+  Subsumption queries.
+  </dd>
+  <dt><b>unsat(ClassExpression),
+unsat(ClassExpression,Expl)</b><dd>
+  Unsatifiability of a concept.
+  </dd>
+  <dt><b>inconsistent_theory,
+inconsistent_theory(Expl)</b><dd>
+  Inconsistency of the knowledge base.
+  </dd>
+  </dl>
+</p>
+<h2 id="help-write-kb">Writing knowledge bases</h3>
+<p>A knowledge base consists of a set of possibly annotated axioms.
  An axiom is a proposition that models an information of the domain. There are several different axioms:
  <dl>
-  <dt>concept membership axioms<dd>
+  <dt>Concept membership axioms<dd>
   An individual belongs to a certain class.
   </dd>
-  <dt>role membership axioms<dd>
+  <dt>Role membership axioms<dd>
   Two individuals are connected through a certain role.
   </dd>
-  <dt>transitivity axioms<dd>
+  <dt>Transitivity axioms<dd>
   The role is transitive.
   </dd>
-  <dt>role inclusion axioms<dd>
+  <dt>Role inclusion axioms<dd>
   Hierarchy between roles.
   </dd>
-  <dt>concept inclusion axioms<dd>
+  <dt>Concept inclusion axioms<dd>
   Hierarchy between concepts.
   </dd>
  </dl>
+ </p>
+ <p>
+Regarding the definition of knowledge bases, TRILL allows the use of two different syntaxes used together or individually:
+<ul>
+  <li>RDF/XML</li>
+  <li>TRILL syntax</li>
+</ul>
+RDF/XML syntax can be used by exploiting the predicate <code>owl_rdf/1</code>. For example:
+<pre style="font-size:80%">
+owl_rdf('
+&lt;?xml version="1.0"?&gt;
+
+&lt;!DOCTYPE rdf:RDF [
+    &lt;!ENTITY owl "http://www.w3.org/2002/07/owl#" &gt;
+    &lt;!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" &gt;
+    &lt;!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" &gt;
+    &lt;!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" &gt;
+]&gt;
+
+&lt;rdf:RDF xmlns="http://here.the.IRI.of.your.ontology#"
+     xml:base="http://here.the.IRI.of.your.ontology"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"&gt;
+    &lt;owl:Ontology rdf:about="http://here.the.IRI.of.your.ontology"/&gt;
+
+    &lt;!-- 
+    Axioms
+    --&gt;
+
+&lt;/rdf:RDF&gt;
+').
+</pre>
+For a brief introduction on RDF/XML syntax see <i>RDF/XML syntax and tools</i> section below.
+</p>
+<p>
+Note that each single <code>owl_rdf/1</code> must be self contained and well formatted, it must start and end with <code>rdf:RDF</code> tag and contain all necessary declarations (namespaces, entities, ...).
+</p>
+<p>
+An example of the combination of both syntaxes is shown below. It models that <i>john</i> is an <i>employee</i> and that employees are <i>workers</i>, which are in turn people (modeled by the concept <i>person</i>).
+<pre style="font-size:80%">
+owl_rdf('&lt;?xml version="1.0"?&gt;
+&lt;rdf:RDF xmlns="http://example.foo#"
+     xml:base="http://example.foo"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"&gt;
+    &lt;owl:Ontology rdf:about="http://example.foo"/&gt;
+
+    &lt;!-- Classes --&gt;
+    &lt;owl:Class rdf:about="http://example.foo#worker"&gt;
+        &lt;rdfs:subClassOf rdf:resource="http://example.foo#person"/&gt;
+    &lt;/owl:Class&gt;
+
+&lt;/rdf:RDF&gt;').
+
+subClassOf('employee','worker').
+
+owl_rdf('&lt;?xml version="1.0"?&gt;
+&lt;rdf:RDF xmlns="http://example.foo#"
+     xml:base="http://example.foo"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"&gt;
+    &lt;owl:Ontology rdf:about="http://example.foo"/&gt;
+    
+    &lt;!-- Individuals --&gt;
+    &lt;owl:NamedIndividual rdf:about="http://example.foo#john"&gt;
+        &lt;rdf:type rdf:resource="http://example.foo#employee"/&gt;
+    &lt;/owl:NamedIndividual&gt;
+&lt;/rdf:RDF&gt;').
+</pre>
+</p>
+
+<h3 id="help-trill-syntax">TRILL Syntax</h3>
+<p>
+<b>Declarations</b>
+</p>
+<p>
+TRILL syntax allows, as in standard OWL, the declaration of classes, properties, etc.
+<pre style="font-size:80%">
+class("classIRI").
+datatype("datatypeIRI").
+objectProperty("objectPropertyIRI").
+dataProperty("dataPropertyIRI").
+annotationProperty("annotationPropertyIRI").
+namedIndividual("individualIRI").
+</pre>
+However, TRILL properly works also in their absence.
+<p>
+</p>
+TRILL syntax allows also the declaration of aliases for namespaces by using the <code>kb_prefix/2</code> predicate.
+<pre style="font-size:80%">
+kb_prefix("foo","http://example.foo#").
+</pre>
+After this declaration, the prefix <code>foo</code> is available, thus, instead of <code>http://example.foo#john</code>, one can write <code>foo:john</code>.
+It is possible to define also an empty prefix as
+<pre style="font-size:80%">
+kb_prefix("","http://example.foo#").
+</pre>
+or as
+<pre style="font-size:80%">
+kb_prefix([],"http://example.foo#").
+</pre>
+In this way <code>http://example.foo#john</code> can be written only as <code>john</code>.<br/>
+</p>
+<p class="note">
+<span class="glyphicon glyphicon-hand-right"></span> Only one prefix per alias is allowed. Aliases defined in OWL/RDF part have the precedence, in case more than one prefix was assigned to the same alias, TRILL keeps only the first assignment.
+</p>
+<p>
+<b>Axioms</b>
+</p>
+<p>
+Axioms are modeled using the following predicates
+<pre style="font-size:80%">
+subClassOf("subClass","superClass").
+equivalentClasses([list,of,classes]).
+disjointClasses([list,of,classes]).
+disjointUnion([list,of,classes]).
+
+subPropertyOf("subProperty","superProperty").
+equivalentProperties([list,of,properties]).
+propertyDomain("propertyIRI","domainIRI").
+propertyRange("propertyIRI","rangeIRI").
+transitiveProperty("propertyIRI").
+
+sameIndividual([list,of,individuals]).
+differentIndividuals([list,of,individuals]).
+
+classAssertion("classIRI","individualIRI").
+propertyAssertion("propertyIRI","subjectIRI","objectIRI").
+annotationAssertion("annotationIRI",axiom,literal('value')).
+</pre>
+For example, for asserting that <i>employee</i> is subclass of <i>worker</i> one can use
+<pre style="font-size:80%">
+subClassOf(employee,worker).
+</pre>
+while the assertion <i>worker</i> is equal to <i>workingman</i> can be defined as
+<pre style="font-size:80%">
+equivalentClasses([worker,workingman]).
+</pre>
+</p>
+<p>
+Annotation assertions can be defined, for example, as
+<pre style="font-size:80%">
+annotationAssertion(foo:myAnnotation,subClassOf(employee,worker),'myValue').
+</pre>
+</p>
+<p>
+In particular, an axiom can be annotated with a probability which defines the degree of belief in the truth of the axiom. See [1] for details.
+</p>
+<p>
+Below, an example of an probabilistic axiom, following the TRILL syntax.
+ <pre style="font-size:80%">
+annotationAssertion('disponte:probability',subClassOf(employee,worker),literal('0.6')).
+</pre>
+<p>
+<b>Concepts descriptions</b>
+<p>
+Complex concepts can be defined using different operators.
+</p>
+Existential and universal quantifiers
+<pre style="font-size:80%">
+someValuesFrom("propertyIRI","classIRI").
+allValuesFrom("propertyIRI","classIRI").
+</pre>
+Union and intersection of concepts
+<pre style="font-size:80%">
+unionOf([list,of,classes]).
+intersectionOf([list,of,classes]).
+</pre>
+Cardinality descriptions
+<pre style="font-size:80%">
+exactCardinality(cardinality,"propertyIRI").
+exactCardinality(cardinality,"propertyIRI","classIRI").
+maxCardinality(cardinality,"propertyIRI").
+maxCardinality(cardinality,"propertyIRI","classIRI").
+minCardinality(cardinality,"propertyIRI").
+minCardinality(cardinality,"propertyIRI","classIRI").
+</pre>
+Complement of a concept
+<pre style="font-size:80%">
+complementOf("classIRI").
+</pre>
+Nominal concept
+<pre style="font-size:80%">
+oneOf([list,of,classes]).
+</pre>
+For example, the class <i>workingman</i> is the intersection of <i>worker</i> with the union of <i>man</i> and <i>woman</i>. It can be defined as:
+<pre style="font-size:80%">
+equivalentClasses([workingman,intersectionOf([worker,unionOf([man,woman])])]).
+</pre>
+
+<h3 id="help-rdf-syntax">RDF/XML syntax and tools</h3>
+ <p>As said before, TRILL is able to automatically translate RDF/XML knowledge bases when passed as a string using 
+the preticate <code>owl_rdf/1</code>.
+</p>
+ 
  
  <p>  Consider the following axioms 
 
@@ -192,10 +543,11 @@ A representations of the three axioms seen above is shown below.
 </p>
 
 <p>
-An axiom can be annotated with a probability which defines the degree of belief in the truth of the axiom. See [1] for details.
-</p>
-<p>
-Below, an example of an annotated axiom, following the RDF/XML syntax.
+Annotations are assertable using an extension of RDF/XML. For example the annotated axiom below, defined using the TRILL sintax
+ <pre style="font-size:80%">
+annotationAssertion('disponte:probability',subClassOf('Cat','Pet'),literal('0.6')).
+</pre>
+is modeled using RDF/XML syntax as
  <pre style="font-size:80%">
 &lt;owl:Class rdf:about="Cat"&gt;
  &lt;rdfs:subClassOf rdf:resource="Pet"/&gt;
@@ -207,7 +559,7 @@ Below, an example of an annotated axiom, following the RDF/XML syntax.
  &lt;owl:annotatedProperty rdf:resource="&amp;rdfs;subClassOf"/&gt;
 &lt;/owl:Axiom&gt;
 </pre>
-The annotation must be declared in the knowledge base as follow
+If you define the annotated axiom in the RDF/XML part, the annotation must be declared in the knowledge base as follow
   <pre style="font-size:80%">
 &lt;!DOCTYPE rdf:RDF [
  ...
@@ -233,52 +585,5 @@ The annotation must be declared in the knowledge base as follow
 <p>
 [1] Zese, R.: <i>Reasoning with Probabilistic Logics</i>. ArXiv e-prints <a href="http://arxiv.org/abs/1405.0915">1405.0915v3</a>. An extended abstract / full version of a paper accepted to be presented at the Doctoral Consortium of the 30th International Conference on Logic Programming (ICLP 2014), July 19-22, Vienna, Austria.
 </p>
-
-<h2 id="help-trill">TRILL manual</h2>
-<p>
-TRILL ("Tableau Reasoner for descrIption Logics in Prolog") implements a tableau algorithm in
-Prolog to compute the set of all the explanations of a query. After generating the explanations, TRILL can computes the probability of the query. The management of the tableau rules' non-determinism is delegated to the Prolog language.
-</p>
-<p>
-TRILL can compute the probability of queries using the commands shown below:
-<dl>
-  <dt><b>prob_instanceOf(Class,Individual,Prob)</b><dd>
-  Concept membership queries.
-  </dd>
-  <dt><b>prob_sub_class(Class1,Class2,Prob)</b>
-  <dd>
-  Subsumption queries.
-  </dd>
-  <dt><b>prob_unsat(ClassExpression,Prob)</b><dd>
-  Unsatifiability of a concept.
-  </dd>
-  <dt><b>prob_inconsistent_theory(Prob)</b><dd>
-  Inconsistency of the knowledge base.
-  </dd>
-  </dl>
-TRILL can test entailment or find an explanation <code>Expl</code> using the queries below:
-<dl>
-  <dt><b>instanceOf(Class,Individual),
-instanceOf(Class,Individual,Expl)</b><dd>
-  Concept membership queries.
-  </dd>
-  <dt><b>sub_class(Class1,Class2),
-sub_class(Class1,Class2,Expl)</b>
-  <dd>
-  Subsumption queries.
-  </dd>
-  <dt><b>unsat(ClassExpression),
-unsat(ClassExpression,Expl)</b><dd>
-  Unsatifiability of a concept.
-  </dd>
-  <dt><b>inconsistent_theory,
-inconsistent_theory(Expl)</b><dd>
-  Inconsistency of the knowledge base.
-  </dd>
-  </dl>
-</p>
-
-
-
 </body>
 </html>
diff --git a/web/help/notebook.html b/web/help/notebook.html
index 2efa0cc..1212d4a 100644
--- a/web/help/notebook.html
+++ b/web/help/notebook.html
@@ -2,10 +2,15 @@
 
 <html>
   <head>
+  <title>About TRILLonSWISH notebooks</title>
   </head>
 <body>
-<h2>About TRILLonSWISH notebooks</h2>
-
+<style>
+p.note { margin-left: 5%; margin-top: 1em; position: relative }
+p.note span.glyphicon-hand-right {
+float: left; font-size: 120%; color: orange; padding-right: 0.2em;
+}
+</style>
 <p>
 A notebook is a list of <i>cells</i>. Notebooks are different from a
 program with examples because they can <em>tell a story</em>, mixing
@@ -40,14 +45,24 @@ and moving cells.
 <li>
 To <b>link to another notebook</b>, create a markdown cell and use the
 markdown notation <code>[label](reference)</code>, e.g.,
-
-<pre style="font-size:80%">
-[All about lists](lists.swinb)
-</pre>
+<code>[All about lists](lists.swinb)</code>
 <li>
 To <b>link to file in the store</b>, create a markdown cell and use the
 markdown notation <code>[label](myfile.pl)</code>, e.g.,
+<code>[Basic predicates](basics.pl)</code>
 </ul>
 
+<h3>Notebook queries and programs</h3>
+
+A notebook <em>query</em> cell is executed against the program cell
+<strong>above it</strong> and all program cells marked as
+<em>background</em> using the <a class="btn btn-success btn-xs"><span
+style="color:#bef" class="glyphicon glyphicon-cloud"></span></a> button.
+
+<p class="note"><span class="glyphicon glyphicon-hand-right"></span>
+Longer fragments of code that are required throughout a notebook and
+possibly on multiple notebooks are defined in a <em>program</em> tab,
+saved and included using, e.g., <code>:- include(mybasics).</code> in a
+background program kept at the bottom of the notebook.
 </body>
 </html>
diff --git a/web/help/runner.html b/web/help/runner.html
index ae9697d..752053c 100644
--- a/web/help/runner.html
+++ b/web/help/runner.html
@@ -29,7 +29,7 @@ table.runner-states tr.group th {
 }
 </style>
 
-<!--h2>Keyboard shortcuts</h2>
+<h2>Keyboard shortcuts</h2>
 
   <table class="runner-states">
   <tr><th>";", &lt;space&gt;</th><td>Next</td>
@@ -37,7 +37,7 @@ table.runner-states tr.group th {
   <tr><th>"a", &lt;Esc&gt;</th><td>Stop or abort</td>
   <tr><th>&lt;Del&gt;</th><td>Close</td>
   <tr><th>&lt;F1&gt;</th><td>Help (this page)</td>
-  </table-->
+  </table>
 
 <h2>Running states</h2>
 
@@ -85,9 +85,10 @@ queries.
 
 <h2>Get results as CSV or through an API</h2>
 <p>
-Variable bindings can be downloaded as CSV using the double down arrow
-at the top-right of a runner or using an appropriate client library to
-access the web API. See the <b>Help/help ...</b> for details.
+Variable bindings can be downloaded as CSV using the <span
+class="glyphicon glyphicon-download"></span> button at the top-right of
+a runner or using an appropriate client library to access the web API.
+See the <b>Help/help ...</b> for details.
 
 </body>
 </html>
diff --git a/web/icons/favicon.ico b/web/icons/favicon.ico
deleted file mode 100644
index 2a974fd..0000000
Binary files a/web/icons/favicon.ico and /dev/null differ
diff --git a/web/js/require.js b/web/js/require.js
index 3628047..23ddb4e 100644
--- a/web/js/require.js
+++ b/web/js/require.js
@@ -1,7 +1,6 @@
 /** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 2.1.18 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/requirejs for details
+ * @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
  */
 //Not using strict: uneven strict support in browsers, #392, and causes
 //problems with requirejs.exec()/transpiler plugins that may not be strict.
@@ -12,7 +11,7 @@ var requirejs, require, define;
 (function (global) {
     var req, s, head, baseElement, dataMain, src,
         interactiveScript, currentlyAddingScript, mainScript, subPath,
-        version = '2.1.18',
+        version = '2.2.0',
         commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
         cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
         jsSuffixRegExp = /\.js$/,
@@ -20,8 +19,6 @@ var requirejs, require, define;
         op = Object.prototype,
         ostring = op.toString,
         hasOwn = op.hasOwnProperty,
-        ap = Array.prototype,
-        apsp = ap.splice,
         isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
         isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
         //PS3 indicates loaded and complete, but need to wait for complete
@@ -38,6 +35,11 @@ var requirejs, require, define;
         globalDefQueue = [],
         useInteractive = false;
 
+    //Could match something like ')//comment', do not lose the prefix to comment.
+    function commentReplace(match, multi, multiText, singlePrefix) {
+        return singlePrefix || '';
+    }
+
     function isFunction(it) {
         return ostring.call(it) === '[object Function]';
     }
@@ -554,11 +556,13 @@ var requirejs, require, define;
         function takeGlobalQueue() {
             //Push all the globalDefQueue items into the context's defQueue
             if (globalDefQueue.length) {
-                //Array splice in the values since the context code has a
-                //local var ref to defQueue, so cannot just reassign the one
-                //on context.
-                apsp.apply(defQueue,
-                           [defQueue.length, 0].concat(globalDefQueue));
+                each(globalDefQueue, function(queueItem) {
+                    var id = queueItem[0];
+                    if (typeof id === 'string') {
+                        context.defQueueMap[id] = true;
+                    }
+                    defQueue.push(queueItem);
+                });
                 globalDefQueue = [];
             }
         }
@@ -845,7 +849,10 @@ var requirejs, require, define;
                     factory = this.factory;
 
                 if (!this.inited) {
-                    this.fetch();
+                    // Only fetch if not already in the defQueue.
+                    if (!hasProp(context.defQueueMap, id)) {
+                        this.fetch();
+                    }
                 } else if (this.error) {
                     this.emit('error', this.error);
                 } else if (!this.defining) {
@@ -905,7 +912,11 @@ var requirejs, require, define;
                             defined[id] = exports;
 
                             if (req.onResourceLoad) {
-                                req.onResourceLoad(context, this.map, this.depMaps);
+                                var resLoadMaps = [];
+                                each(this.depMaps, function (depMap) {
+                                    resLoadMaps.push(depMap.normalizedMap || depMap);
+                                });
+                                req.onResourceLoad(context, this.map, resLoadMaps);
                             }
                         }
 
@@ -964,6 +975,7 @@ var requirejs, require, define;
                                                       this.map.parentMap);
                         on(normalizedMap,
                             'defined', bind(this, function (value) {
+                                this.map.normalizedMap = normalizedMap;
                                 this.init([], function () { return value; }, null, {
                                     enabled: true,
                                     ignore: true
@@ -1244,6 +1256,7 @@ var requirejs, require, define;
                     callGetModule(args);
                 }
             }
+            context.defQueueMap = {};
         }
 
         context = {
@@ -1253,6 +1266,7 @@ var requirejs, require, define;
             defined: defined,
             urlFetched: urlFetched,
             defQueue: defQueue,
+            defQueueMap: {},
             Module: Module,
             makeModuleMap: makeModuleMap,
             nextTick: req.nextTick,
@@ -1270,6 +1284,14 @@ var requirejs, require, define;
                     }
                 }
 
+                // Convert old style urlArgs string to a function.
+                if (typeof cfg.urlArgs === 'string') {
+                    var urlArgs = cfg.urlArgs;
+                    cfg.urlArgs = function(id, url) {
+                        return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;
+                    };
+                }
+
                 //Save off the paths since they require special processing,
                 //they are additive.
                 var shim = config.shim,
@@ -1502,6 +1524,7 @@ var requirejs, require, define;
                                 defQueue.splice(i, 1);
                             }
                         });
+                        delete context.defQueueMap[id];
 
                         if (mod) {
                             //Hold on to listeners in case the
@@ -1563,6 +1586,7 @@ var requirejs, require, define;
 
                     callGetModule(args);
                 }
+                context.defQueueMap = {};
 
                 //Do this after the cycle of callGetModule in case the result
                 //of those calls/init calls changes the registry.
@@ -1644,13 +1668,12 @@ var requirejs, require, define;
 
                     //Join the path parts together, then figure out if baseUrl is needed.
                     url = syms.join('/');
-                    url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+                    url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js'));
                     url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
                 }
 
-                return config.urlArgs ? url +
-                                        ((url.indexOf('?') === -1 ? '?' : '&') +
-                                         config.urlArgs) : url;
+                return config.urlArgs && !/^blob\:/.test(url) ?
+                       url + config.urlArgs(moduleName, url) : url;
             },
 
             //Delegates to req.load. Broken out as a separate function to
@@ -1698,7 +1721,21 @@ var requirejs, require, define;
             onScriptError: function (evt) {
                 var data = getScriptData(evt);
                 if (!hasPathFallback(data.id)) {
-                    return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
+                    var parents = [];
+                    eachProp(registry, function(value, key) {
+                        if (key.indexOf('_@r') !== 0) {
+                            each(value.depMaps, function(depMap) {
+                                if (depMap.id === data.id) {
+                                    parents.push(key);
+                                    return true;
+                                }
+                            });
+                        }
+                    });
+                    return onError(makeError('scripterror', 'Script error for "' + data.id +
+                                             (parents.length ?
+                                             '", needed by: ' + parents.join(', ') :
+                                             '"'), evt, [data.id]));
                 }
             }
         };
@@ -1872,11 +1909,11 @@ var requirejs, require, define;
             if (node.attachEvent &&
                     //Check if node.attachEvent is artificially added by custom script or
                     //natively supported by browser
-                    //read https://github.com/jrburke/requirejs/issues/187
+                    //read https://github.com/requirejs/requirejs/issues/187
                     //if we can NOT find [native code] then it must NOT natively supported.
                     //in IE8, node.attachEvent does not have toString()
                     //Note the test for "[native code" with no closing brace, see:
-                    //https://github.com/jrburke/requirejs/issues/273
+                    //https://github.com/requirejs/requirejs/issues/273
                     !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
                     !isOpera) {
                 //Probably IE. IE (at least 6-8) do not fire
@@ -1904,6 +1941,12 @@ var requirejs, require, define;
             }
             node.src = url;
 
+            //Calling onNodeCreated after all properties on the node have been
+            //set, but before it is placed in the DOM.
+            if (config.onNodeCreated) {
+                config.onNodeCreated(node, config, moduleName, url);
+            }
+
             //For some cache cases in IE 6-8, the script executes before the end
             //of the appendChild execution, so to tie an anonymous define
             //call to the module name (which is stored on the node), hold on
@@ -1922,9 +1965,14 @@ var requirejs, require, define;
                 //In a web worker, use importScripts. This is not a very
                 //efficient use of importScripts, importScripts will block until
                 //its script is downloaded and evaluated. However, if web workers
-                //are in play, the expectation that a build has been done so that
-                //only one script needs to be loaded anyway. This may need to be
-                //reevaluated if other use cases become common.
+                //are in play, the expectation is that a build has been done so
+                //that only one script needs to be loaded anyway. This may need
+                //to be reevaluated if other use cases become common.
+
+                // Post a task to the event loop to work around a bug in WebKit
+                // where the worker gets garbage-collected after calling
+                // importScripts(): https://webkit.org/b/153317
+                setTimeout(function() {}, 0);
                 importScripts(url);
 
                 //Account for anonymous modules
@@ -1970,8 +2018,10 @@ var requirejs, require, define;
                 //Preserve dataMain in case it is a path (i.e. contains '?')
                 mainScript = dataMain;
 
-                //Set final baseUrl if there is not already an explicit one.
-                if (!cfg.baseUrl) {
+                //Set final baseUrl if there is not already an explicit one,
+                //but only do so if the data-main value is not a loader plugin
+                //module ID.
+                if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
                     //Pull off the directory of data-main for use as the
                     //baseUrl.
                     src = mainScript.split('/');
@@ -2032,7 +2082,7 @@ var requirejs, require, define;
             if (callback.length) {
                 callback
                     .toString()
-                    .replace(commentRegExp, '')
+                    .replace(commentRegExp, commentReplace)
                     .replace(cjsRequireRegExp, function (match, dep) {
                         deps.push(dep);
                     });
@@ -2064,7 +2114,12 @@ var requirejs, require, define;
         //where the module name is not known until the script onload event
         //occurs. If no context, use the global queue, and get it processed
         //in the onscript load callback.
-        (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
+        if (context) {
+            context.defQueue.push([name, deps, callback]);
+            context.defQueueMap[name] = true;
+        } else {
+            globalDefQueue.push([name, deps, callback]);
+        }
     };
 
     define.amd = {
diff --git a/web/js/trill_on_swish-min.js b/web/js/trill_on_swish-min.js
deleted file mode 100644
index 356dc2c..0000000
--- a/web/js/trill_on_swish-min.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
-
-/*!
- * Bootstrap v3.3.5 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under the MIT license
- */
-
-/*! jQuery UI - v1.11.4 - 2015-03-11
-* http://jqueryui.com
-* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
-
-/*!
- * JQuery Spliter Plugin
- * Copyright (C) 2010-2013 Jakub Jankiewicz <http://jcubic.pl>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ===================================================
- * tagmanager.js v3.0.1
- * http://welldonethings.com/tags/manager
- * ===================================================
- * Copyright 2012 Max Favilli
- *
- * Licensed under the Mozilla Public License, Version 2.0 You may not use this work except in compliance with the License.
- *
- * http://www.mozilla.org/MPL/2.0/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-/*!
- * typeahead.js 0.10.5
- * https://github.com/twitter/typeahead.js
- * Copyright 2013-2014 Twitter, Inc. and other contributors; Licensed MIT
- */
-
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-/***
-This is part of jsdifflib v1.0. <http://snowtide.com/jsdifflib>
-
-Copyright (c) 2007, Snowtide Informatics Systems, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-	* Redistributions of source code must retain the above copyright notice, this
-		list of conditions and the following disclaimer.
-	* Redistributions in binary form must reproduce the above copyright notice,
-		this list of conditions and the following disclaimer in the documentation
-		and/or other materials provided with the distribution.
-	* Neither the name of the Snowtide Informatics Systems nor the names of its
-		contributors may be used to endorse or promote products derived from this
-		software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-***/
-
-/*
-This is part of jsdifflib v1.0. <http://github.com/cemerick/jsdifflib>
-
-Copyright 2007 - 2011 Chas Emerick <cemerick@snowtide.com>. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
-   1. Redistributions of source code must retain the above copyright notice, this list of
-      conditions and the following disclaimer.
-
-   2. Redistributions in binary form must reproduce the above copyright notice, this list
-      of conditions and the following disclaimer in the documentation and/or other materials
-      provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY Chas Emerick ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Chas Emerick OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of Chas Emerick.
-*/
-
-/*
- * js-sha1 v0.3.0
- * https://github.com/emn178/js-sha1
- *
- * Copyright 2014-2015, emn178@gmail.com
- *
- * Licensed under the MIT license:
- * http://www.opensource.org/licenses/MIT
- */
-
-!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(a,b){function s(e){var t="length"in e&&e.length,r=n.type(e);return"function"===r||n.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}function x(e,t,r){if(n.isFunction(t))return n.grep(e,function(e,n){return!!t.call(e,n,e)!==r});if(t.nodeType)return n.grep(e,function(e){return e===t!==r});if("string"==typeof t){if(w.test(t))return n.filter(t,e,r);t=n.filter(t,e)}return n.grep(e,function(e){return g.call(t,e)>=0!==r})}function D(e,t){while((e=e[t])&&1!==e.nodeType);return e}function G(e){var t=F[e]={};return n.each(e.match(E)||[],function(e,n){t[n]=!0}),t}function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}function P(e,t,r){var i;if(void 0===r&&1===e.nodeType)if(i="data-"+t.replace(O,"-$1").toLowerCase(),r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:N.test(r)?n.parseJSON(r):r}catch(s){}M.set(e,t,r)}else r=void 0;return r}function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(e){}}function ja(e,t){return n.nodeName(e,"table")&&n.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ka(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function la(e){var t=ga.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ma(e,t){for(var n=0,r=e.length;r>n;n++)L.set(e[n],"globalEval",!t||L.get(t[n],"globalEval"))}function na(e,t){var r,i,s,o,u,a,f,l;if(1===t.nodeType){if(L.hasData(e)&&(o=L.access(e),u=L.set(t,o),l=o.events)){delete u.handle,u.events={};for(s in l)for(r=0,i=l[s].length;i>r;r++)n.event.add(t,s,l[s][r])}M.hasData(e)&&(a=M.access(e),f=n.extend({},a),M.set(t,f))}}function oa(e,t){var r=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&n.nodeName(e,t)?n.merge([e],r):r}function pa(e,t){var n=t.nodeName.toLowerCase();"input"===n&&T.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function sa(e,t){var r,i=n(t.createElement(e)).appendTo(t.body),s=a.getDefaultComputedStyle&&(r=a.getDefaultComputedStyle(i[0]))?r.display:n.css(i[0],"display");return i.detach(),s}function ta(e){var t=l,r=ra[e];return r||(r=sa(e,t),"none"!==r&&r||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=qa[0].contentDocument,t.write(),t.close(),r=sa(e,t),qa.detach()),ra[e]=r),r}function xa(e,t,r){var i,s,o,u,a=e.style;return r=r||wa(e),r&&(u=r.getPropertyValue(t)||r[t]),r&&(""!==u||n.contains(e.ownerDocument,e)||(u=n.style(e,t)),va.test(u)&&ua.test(t)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=u,u=r.width,a.width=i,a.minWidth=s,a.maxWidth=o)),void 0!==u?u+"":u}function ya(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function Fa(e,t){if(t in e)return t;var n=t[0].toUpperCase()+t.slice(1),r=t,i=Ea.length;while(i--)if(t=Ea[i]+n,t in e)return t;return r}function Ga(e,t,n){var r=Aa.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ha(e,t,r,i,s){for(var o=r===(i?"border":"content")?4:"width"===t?1:0,u=0;4>o;o+=2)"margin"===r&&(u+=n.css(e,r+R[o],!0,s)),i?("content"===r&&(u-=n.css(e,"padding"+R[o],!0,s)),"margin"!==r&&(u-=n.css(e,"border"+R[o]+"Width",!0,s))):(u+=n.css(e,"padding"+R[o],!0,s),"padding"!==r&&(u+=n.css(e,"border"+R[o]+"Width",!0,s)));return u}function Ia(e,t,r){var i=!0,s="width"===t?e.offsetWidth:e.offsetHeight,o=wa(e),u="border-box"===n.css(e,"boxSizing",!1,o);if(0>=s||null==s){if(s=xa(e,t,o),(0>s||null==s)&&(s=e.style[t]),va.test(s))return s;i=u&&(k.boxSizingReliable()||s===e.style[t]),s=parseFloat(s)||0}return s+Ha(e,t,r||(u?"border":"content"),i,o)+"px"}function Ja(e,t){for(var r,i,s,o=[],u=0,a=e.length;a>u;u++)i=e[u],i.style&&(o[u]=L.get(i,"olddisplay"),r=i.style.display,t?(o[u]||"none"!==r||(i.style.display=""),""===i.style.display&&S(i)&&(o[u]=L.access(i,"olddisplay",ta(i.nodeName)))):(s=S(i),"none"===r&&s||L.set(i,"olddisplay",s?r:n.css(i,"display"))));for(u=0;a>u;u++)i=e[u],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[u]||"":"none"));return e}function Ka(e,t,n,r,i){return new Ka.prototype.init(e,t,n,r,i)}function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(e,t){var n,r=0,i={height:e};for(t=t?1:0;4>r;r+=2-t)n=R[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function Ua(e,t,n){for(var r,i=(Ra[t]||[]).concat(Ra["*"]),s=0,o=i.length;o>s;s++)if(r=i[s].call(n,t,e))return r}function Va(e,t,r){var i,s,o,u,a,f,l,c,h=this,p={},d=e.style,v=e.nodeType&&S(e),m=L.get(e,"fxshow");r.queue||(a=n._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,f=a.empty.fire,a.empty.fire=function(){a.unqueued||f()}),a.unqueued++,h.always(function(){h.always(function(){a.unqueued--,n.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(r.overflow=[d.overflow,d.overflowX,d.overflowY],l=n.css(e,"display"),c="none"===l?L.get(e,"olddisplay")||ta(e.nodeName):l,"inline"===c&&"none"===n.css(e,"float")&&(d.display="inline-block")),r.overflow&&(d.overflow="hidden",h.always(function(){d.overflow=r.overflow[0],d.overflowX=r.overflow[1],d.overflowY=r.overflow[2]}));for(i in t)if(s=t[i],Na.exec(s)){if(delete t[i],o=o||"toggle"===s,s===(v?"hide":"show")){if("show"!==s||!m||void 0===m[i])continue;v=!0}p[i]=m&&m[i]||n.style(e,i)}else l=void 0;if(n.isEmptyObject(p))"inline"===("none"===l?ta(e.nodeName):l)&&(d.display=l);else{m?"hidden"in m&&(v=m.hidden):m=L.access(e,"fxshow",{}),o&&(m.hidden=!v),v?n(e).show():h.done(function(){n(e).hide()}),h.done(function(){var t;L.remove(e,"fxshow");for(t in p)n.style(e,t,p[t])});for(i in p)u=Ua(v?m[i]:0,i,h),i in m||(m[i]=u.start,v&&(u.end=u.start,u.start="width"===i||"height"===i?1:0))}}function Wa(e,t){var r,i,s,o,u;for(r in e)if(i=n.camelCase(r),s=t[i],o=e[r],n.isArray(o)&&(s=o[1],o=e[r]=o[0]),r!==i&&(e[i]=o,delete e[r]),u=n.cssHooks[i],u&&"expand"in u){o=u.expand(o),delete e[i];for(r in o)r in e||(e[r]=o[r],t[r]=s)}else t[i]=s}function Xa(e,t,r){var i,s,o=0,u=Qa.length,a=n.Deferred().always(function(){delete f.elem}),f=function(){if(s)return!1;for(var t=La||Sa(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,i=1-r,o=0,u=l.tweens.length;u>o;o++)l.tweens[o].run(i);return a.notifyWith(e,[l,i,n]),1>i&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:n.extend({},t),opts:n.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:La||Sa(),duration:r.duration,tweens:[],createTween:function(t,r){var i=n.Tween(e,l.opts,t,r,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,r=t?l.tweens.length:0;if(s)return this;for(s=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(Wa(c,l.opts.specialEasing);u>o;o++)if(i=Qa[o].call(l,e,c,l.opts))return i;return n.map(c,Ua,l),n.isFunction(l.opts.start)&&l.opts.start.call(e,l),n.fx.timer(n.extend(f,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function qb(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var i,s=0,o=t.toLowerCase().match(E)||[];if(n.isFunction(r))while(i=o[s++])"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(r)):(e[i]=e[i]||[]).push(r)}}function rb(e,t,r,i){function u(l){var h;return s[l]=!0,n.each(e[l]||[],function(e,n){var a=n(t,r,i);return"string"!=typeof a||o||s[a]?o?!(h=a):void 0:(t.dataTypes.unshift(a),u(a),!1)}),h}var s={},o=e===mb;return u(t.dataTypes[0])||!s["*"]&&u("*")}function sb(e,t){var r,i,s=n.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((s[r]?e:i||(i={}))[r]=t[r]);return i&&n.extend(!0,e,i),e}function tb(e,t,n){var r,i,s,o,u=e.contents,a=e.dataTypes;while("*"===a[0])a.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){a.unshift(i);break}if(a[0]in n)s=a[0];else{for(i in n){if(!a[0]||e.converters[i+" "+a[0]]){s=i;break}o||(o=i)}s=s||o}return s?(s!==a[0]&&a.unshift(s),n[s]):void 0}function ub(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift())if("*"===s)s=a;else if("*"!==a&&a!==s){if(o=f[a+" "+s]||f["* "+s],!o)for(i in f)if(u=i.split(" "),u[1]===s&&(o=f[a+" "+u[0]]||f["* "+u[0]])){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}return{state:"success",data:t}}function Ab(e,t,r,i){var s;if(n.isArray(t))n.each(t,function(t,n){r||wb.test(e)?i(e,n):Ab(e+"["+("object"==typeof n?t:"")+"]",n,r,i)});else if(r||"object"!==n.type(t))i(e,t);else for(s in t)Ab(e+"["+s+"]",t[s],r,i)}function Jb(e){return n.isWindow(e)?e:9===e.nodeType&&e.defaultView}var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(e,t){return new n.fn.init(e,t)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(e,t){return t.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:d.call(this)},pushStack:function(e){var t=n.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return n.each(this,e,t)},map:function(e){return this.pushStack(n.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var e,t,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;for("boolean"==typeof u&&(l=u,u=arguments[a]||{},a++),"object"==typeof u||n.isFunction(u)||(u={}),a===f&&(u=this,a--);f>a;a++)if(null!=(e=arguments[a]))for(t in e)r=u[t],i=e[t],u!==i&&(l&&i&&(n.isPlainObject(i)||(s=n.isArray(i)))?(s?(s=!1,o=r&&n.isArray(r)?r:[]):o=r&&n.isPlainObject(r)?r:{},u[t]=n.extend(l,o,i)):void 0!==i&&(u[t]=i));return u},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===n.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0},isPlainObject:function(e){return"object"!==n.type(e)||e.nodeType||n.isWindow(e)?!1:e.constructor&&!j.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?h[i.call(e)]||"object":typeof e},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(e){return e.replace(p,"ms-").replace(q,r)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,u=s(e);if(n){if(u){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(u){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(o,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(s(Object(e))?n.merge(r,"string"==typeof e?[e]:e):f.call(r,e)),r},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],s=0,o=e.length,u=!n;o>s;s++)r=!t(e[s],s),r!==u&&i.push(e[s]);return i},map:function(t,n,r){var i,o=0,u=t.length,a=s(t),f=[];if(a)for(;u>o;o++)i=n(t[o],o,r),null!=i&&f.push(i);else for(o in t)i=n(t[o],o,r),null!=i&&f.push(i);return e.apply([],f)},guid:1,proxy:function(e,t){var r,i,s;return"string"==typeof t&&(r=e[t],t=e,e=r),n.isFunction(e)?(i=d.call(arguments,2),s=function(){return e.apply(t||this,i.concat(d.call(arguments)))},s.guid=e.guid=e.guid||n.guid++,s):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){h["[object "+t+"]"]=t.toLowerCase()});var t=function(e){function ot(e,t,r,i){var s,u,f,l,c,d,g,y,S,x;if((t?t.ownerDocument||t:E)!==p&&h(t),t=t||p,r=r||[],l=t.nodeType,"string"!=typeof e||!e||1!==l&&9!==l&&11!==l)return r;if(!i&&v){if(11!==l&&(s=Z.exec(e)))if(f=s[1]){if(9===l){if(u=t.getElementById(f),!u||!u.parentNode)return r;if(u.id===f)return r.push(u),r}else if(t.ownerDocument&&(u=t.ownerDocument.getElementById(f))&&b(t,u)&&u.id===f)return r.push(u),r}else{if(s[2])return D.apply(r,t.getElementsByTagName(e)),r;if((f=s[3])&&n.getElementsByClassName)return D.apply(r,t.getElementsByClassName(f)),r}if(n.qsa&&(!m||!m.test(e))){if(y=g=w,S=t,x=1!==l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){d=o(e),(g=t.getAttribute("id"))?y=g.replace(tt,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",c=d.length;while(c--)d[c]=y+gt(d[c]);S=et.test(e)&&vt(t.parentNode)||t,x=d.join(",")}if(x)try{return D.apply(r,S.querySelectorAll(x)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return a(e.replace(z,"$1"),t,r,i)}function ut(){function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function at(e){return e[w]=!0,e}function ft(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),i=e.length;while(i--)r.attrHandle[n[i]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||L)-(~e.sourceIndex||L);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function mt(){}function gt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,i=n&&"parentNode"===r,s=x++;return t.first?function(t,n,s){while(t=t[r])if(1===t.nodeType||i)return e(t,n,s)}:function(t,n,o){var u,a,f=[S,s];if(o){while(t=t[r])if((1===t.nodeType||i)&&e(t,n,o))return!0}else while(t=t[r])if(1===t.nodeType||i){if(a=t[w]||(t[w]={}),(u=a[r])&&u[0]===S&&u[1]===s)return f[2]=u[2];if(a[r]=f,f[2]=e(t,n,o))return!0}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n){for(var r=0,i=t.length;i>r;r++)ot(e,t[r],n);return n}function Et(e,t,n,r,i){for(var s,o=[],u=0,a=e.length,f=null!=t;a>u;u++)(s=e[u])&&(!n||n(s,r,i))&&(o.push(s),f&&t.push(u));return o}function St(e,t,n,r,i,s){return r&&!r[w]&&(r=St(r)),i&&!i[w]&&(i=St(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||wt(t||"*",u.nodeType?[u]:u,[]),m=!e||!s&&t?v:Et(v,h,e,u,a),g=n?i||(s?e:d||r)?[]:o:m;if(n&&n(m,g,u,a),r){f=Et(g,p),r(f,[],u,a),l=f.length;while(l--)(c=f[l])&&(g[p[l]]=!(m[p[l]]=c))}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?H(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=Et(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):D.apply(o,g)})}function xt(e){for(var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return H(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];s>a;a++)if(n=r.relative[e[a].type])h=[yt(bt(h),n)];else{if(n=r.filter[e[a].type].apply(null,e[a].matches),n[w]){for(i=++a;s>i;i++)if(r.relative[e[i].type])break;return St(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(z,"$1"),n,i>a&&xt(e.slice(a,i)),s>i&&xt(e=e.slice(i)),s>i&&gt(e))}h.push(n)}return bt(h)}function Tt(e,t){var n=t.length>0,i=e.length>0,s=function(s,o,u,a,l){var c,h,d,v=0,m="0",g=s&&[],y=[],b=f,w=s||i&&r.find.TAG("*",l),E=S+=null==b?1:Math.random()||.1,x=w.length;for(l&&(f=o!==p&&o);m!==x&&null!=(c=w[m]);m++){if(i&&c){h=0;while(d=e[h++])if(d(c,o,u)){a.push(c);break}l&&(S=E)}n&&((c=!d&&c)&&v--,s&&g.push(c))}if(v+=m,n&&m!==v){h=0;while(d=t[h++])d(g,y,o,u);if(s){if(v>0)while(m--)g[m]||y[m]||(y[m]=M.call(a));y=Et(y)}D.apply(a,y),l&&!s&&y.length>0&&v+t.length>1&&ot.uniqueSort(a)}return l&&(S=E,f=b),g};return n?at(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=function(e,t){return e===t&&(c=!0),0},L=1<<31,A={}.hasOwnProperty,O=[],M=O.pop,_=O.push,D=O.push,P=O.slice,H=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",j="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",I=F.replace("w","w#"),q="\\["+j+"*("+F+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+j+"*\\]",R=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",U=new RegExp(j+"+","g"),z=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g"),W=new RegExp("^"+j+"*,"+j+"*"),X=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),V=new RegExp("="+j+"*([^\\]'\"]*?)"+j+"*\\]","g"),$=new RegExp(R),J=new RegExp("^"+I+"$"),K={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/[+~]/,tt=/'|\\/g,nt=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},it=function(){h()};try{D.apply(O=P.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(st){D={apply:O.length?function(e,t){_.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=ot.support={},s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},h=ot.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;return o!==p&&9===o.nodeType&&o.documentElement?(p=o,d=o.documentElement,i=o.defaultView,i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",it,!1):i.attachEvent&&i.attachEvent("onunload",it)),v=!s(o),n.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ft(function(e){return e.appendChild(o.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(o.getElementsByClassName),n.getById=ft(function(e){return d.appendChild(e).id=w,!o.getElementsByName||!o.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&v){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if("*"===e){while(n=s[i++])1===n.nodeType&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){return v?t.getElementsByClassName(e):void 0},g=[],m=[],(n.qsa=Y.test(o.querySelectorAll))&&(ft(function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+j+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ft(function(e){var t=o.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+j+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Y.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ft(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",R)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(d.compareDocumentPosition),b=t||Y.test(d.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&1===r.nodeType&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===o||e.ownerDocument===E&&b(E,e)?-1:t===o||t.ownerDocument===E&&b(E,t)?1:l?H(l,e)-H(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,u=[e],a=[t];if(!i||!s)return e===o?-1:t===o?1:i?-1:s?1:l?H(l,e)-H(l,t):0;if(i===s)return ct(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)a.unshift(n);while(u[r]===a[r])r++;return r?ct(u[r],a[r]):u[r]===E?-1:a[r]===E?1:0},o):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(V,"='$1']"),!(!n.matchesSelector||!v||g&&g.test(t)||m&&m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):void 0;return void 0!==s?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,s=0;if(c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k),c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=ot.getText=function(e){var t,n="",r=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===s||4===s)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},r=ot.selectors={cacheLength:50,createPseudo:at,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[3]||e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;d=v="only"===e&&!d&&"nextSibling"}return!0}if(d=[o?m.firstChild:m.lastChild],o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(1===c.nodeType&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++h&&(y&&((c[w]||(c[w]={}))[e]=[S,h]),c===t))break;return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=H(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:at(function(e){var t=[],n=[],r=u(e.replace(z,"$1"));return r[w]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)(s=o[u])&&(e[u]=!(t[u]=s))}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return e=e.replace(nt,rt),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:at(function(e){return J.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[0>n?n+t:n]}),even:dt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:dt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ht(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pt(t);return mt.prototype=r.filters=r.pseudos,r.setFilters=new mt,o=ot.tokenize=function(e,t){var n,i,s,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=r.preFilter;while(u){(!n||(i=W.exec(u)))&&(i&&(u=u.slice(i[0].length)||u),a.push(s=[])),n=!1,(i=X.exec(u))&&(n=i.shift(),s.push({value:n,type:i[0].replace(z," ")}),u=u.slice(n.length));for(o in r.filter)!(i=K[o].exec(u))||f[o]&&!(i=f[o](i))||(n=i.shift(),s.push({value:n,type:o,matches:i}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)},u=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=o(e)),n=t.length;while(n--)s=xt(t[n]),s[w]?r.push(s):i.push(s);s=C(e,Tt(i,r)),s.selector=e}return s},a=ot.select=function(e,t,i,s){var a,f,l,c,h,p="function"==typeof e&&e,d=!s&&o(e=p.selector||e);if(i=i||[],1===d.length){if(f=d[0]=d[0].slice(0),f.length>2&&"ID"===(l=f[0]).type&&n.getById&&9===t.nodeType&&v&&r.relative[f[1].type]){if(t=(r.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=K.needsContext.test(e)?0:f.length;while(a--){if(l=f[a],r.relative[c=l.type])break;if((h=r.find[c])&&(s=h(l.matches[0].replace(nt,rt),et.test(f[0].type)&&vt(t.parentNode)||t))){if(f.splice(a,1),e=s.length&&gt(f),!e)return D.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,et.test(e)&&vt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=ft(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ft(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),ft(function(e){return null==e.getAttribute("disabled")})||lt(B,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ot}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;n.filter=function(e,t,r){var i=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?n.find.matchesSelector(i,e)?[i]:[]:n.find.matches(e,n.grep(t,function(e){return 1===e.nodeType}))},n.fn.extend({find:function(e){var t,r=this.length,i=[],s=this;if("string"!=typeof e)return this.pushStack(n(e).filter(function(){for(t=0;r>t;t++)if(n.contains(s[t],this))return!0}));for(t=0;r>t;t++)n.find(e,s[t],i);return i=this.pushStack(r>1?n.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(x(this,e||[],!1))},not:function(e){return this.pushStack(x(this,e||[],!0))},is:function(e){return!!x(this,"string"==typeof e&&u.test(e)?n(e):e||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(e,t){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:z.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||y).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof n?t[0]:t,n.merge(this,n.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:l,!0)),v.test(r[1])&&n.isPlainObject(t))for(r in t)n.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=l.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=l,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):n.isFunction(e)?"undefined"!=typeof y.ready?y.ready(e):e(n):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),n.makeArray(e,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(e,t,r){var i=[],s=void 0!==r;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(s&&n(e).is(r))break;i.push(e)}return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),n.fn.extend({has:function(e){var t=n(e,this),r=t.length;return this.filter(function(){for(var e=0;r>e;e++)if(n.contains(this,t[e]))return!0})},closest:function(e,t){for(var r,i=0,s=this.length,o=[],a=u.test(e)||"string"!=typeof e?n(e,t||this.context):0;s>i;i++)for(r=this[i];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(a?a.index(r)>-1:1===r.nodeType&&n.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?n.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(n(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(n.unique(n.merge(this.get(),n(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),n.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return n.dir(e,"parentNode")},parentsUntil:function(e,t,r){return n.dir(e,"parentNode",r)},next:function(e){return D(e,"nextSibling")},prev:function(e){return D(e,"previousSibling")},nextAll:function(e){return n.dir(e,"nextSibling")},prevAll:function(e){return n.dir(e,"previousSibling")},nextUntil:function(e,t,r){return n.dir(e,"nextSibling",r)},prevUntil:function(e,t,r){return n.dir(e,"previousSibling",r)},siblings:function(e){return n.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return n.sibling(e.firstChild)},contents:function(e){return e.contentDocument||n.merge([],e.childNodes)}},function(e,t){n.fn[e]=function(r,i){var s=n.map(this,t,r);return"Until"!==e.slice(-5)&&(i=r),i&&"string"==typeof i&&(s=n.filter(i,s)),this.length>1&&(C[e]||n.unique(s),B.test(e)&&s.reverse()),this.pushStack(s)}});var E=/\S+/g,F={};n.Callbacks=function(e){e="string"==typeof e?F[e]||G(e):n.extend({},e);var t,r,i,s,o,u,a=[],f=!e.once&&[],l=function(n){for(t=e.memory&&n,r=!0,u=s||0,s=0,o=a.length,i=!0;a&&o>u;u++)if(a[u].apply(n[0],n[1])===!1&&e.stopOnFalse){t=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var r=a.length;!function u(t){n.each(t,function(t,r){var i=n.type(r);"function"===i?e.unique&&c.has(r)||a.push(r):r&&r.length&&"string"!==i&&u(r)})}(arguments),i?o=a.length:t&&(s=r,l(t))}return this},remove:function(){return a&&n.each(arguments,function(e,t){var r;while((r=n.inArray(t,a,r))>-1)a.splice(r,1),i&&(o>=r&&o--,u>=r&&u--)}),this},has:function(e){return e?n.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],o=0,this},disable:function(){return a=f=t=void 0,this},disabled:function(){return!a},lock:function(){return f=void 0,t||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return!a||r&&!f||(t=t||[],t=[e,t.slice?t.slice():t],i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},n.extend({Deferred:function(e){var t=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],r="pending",i={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return n.Deferred(function(r){n.each(t,function(t,o){var u=n.isFunction(e[t])&&e[t];s[o[1]](function(){var e=u&&u.apply(this,arguments);e&&n.isFunction(e.promise)?e.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[o[0]+"With"](this===i?r.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?n.extend(e,i):i}},s={};return i.pipe=i.then,n.each(t,function(e,n){var o=n[2],u=n[3];i[n[1]]=o.add,u&&o.add(function(){r=u},t[1^e][2].disable,t[2][2].lock),s[n[0]]=function(){return s[n[0]+"With"](this===s?i:this,arguments),this},s[n[0]+"With"]=o.fireWith}),i.promise(s),e&&e.call(s,s),s},when:function(e){var t=0,r=d.call(arguments),i=r.length,s=1!==i||e&&n.isFunction(e.promise)?i:0,o=1===s?e:n.Deferred(),u=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--s||o.resolveWith(t,n)}},a,f,l;if(i>1)for(a=new Array(i),f=new Array(i),l=new Array(i);i>t;t++)r[t]&&n.isFunction(r[t].promise)?r[t].promise().done(u(t,l,r)).fail(o.reject).progress(u(t,f,a)):--s;return s||o.resolveWith(l,r),o.promise()}});var H;n.fn.ready=function(e){return n.ready.promise().done(e),this},n.extend({isReady:!1,readyWait:1,holdReady:function(e){e?n.readyWait++:n.ready(!0)},ready:function(e){(e===!0?--n.readyWait:n.isReady)||(n.isReady=!0,e!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}}),n.ready.promise=function(e){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(e)},n.ready.promise();var J=n.access=function(e,t,r,i,s,o,u){var a=0,f=e.length,l=null==r;if("object"===n.type(r)){s=!0;for(a in r)n.access(e,t,a,r[a],!0,o,u)}else if(void 0!==i&&(s=!0,n.isFunction(i)||(u=!0),l&&(u?(t.call(e,i),t=null):(l=t,t=function(e,t,r){return l.call(n(e),r)})),t))for(;f>a;a++)t(e[a],r,u?i:i.call(e[a],a,t(e[a],r)));return s?e:l?t.call(e):f?t(e[0],r):o};n.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(e){if(!K.accepts(e))return 0;var t={},r=e[this.expando];if(!r){r=K.uid++;try{t[this.expando]={value:r},Object.defineProperties(e,t)}catch(i){t[this.expando]=r,n.extend(e,t)}}return this.cache[r]||(this.cache[r]={}),r},set:function(e,t,r){var i,s=this.key(e),o=this.cache[s];if("string"==typeof t)o[t]=r;else if(n.isEmptyObject(o))n.extend(this.cache[s],t);else for(i in t)o[i]=t[i];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,r){var i;return void 0===t||t&&"string"==typeof t&&void 0===r?(i=this.get(e,t),void 0!==i?i:this.get(e,n.camelCase(t))):(this.set(e,t,r),void 0!==r?r:t)},remove:function(e,t){var r,i,s,o=this.key(e),u=this.cache[o];if(void 0===t)this.cache[o]={};else{n.isArray(t)?i=t.concat(t.map(n.camelCase)):(s=n.camelCase(t),t in u?i=[t,s]:(i=s,i=i in u?[i]:i.match(E)||[])),r=i.length;while(r--)delete u[i[r]]}},hasData:function(e){return!n.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;n.extend({hasData:function(e){return M.hasData(e)||L.hasData(e)},data:function(e,t,n){return M.access(e,t,n)},removeData:function(e,t){M.remove(e,t)},_data:function(e,t,n){return L.access(e,t,n)},_removeData:function(e,t){L.remove(e,t)}}),n.fn.extend({data:function(e,t){var r,i,s,o=this[0],u=o&&o.attributes;if(void 0===e){if(this.length&&(s=M.get(o),1===o.nodeType&&!L.get(o,"hasDataAttrs"))){r=u.length;while(r--)u[r]&&(i=u[r].name,0===i.indexOf("data-")&&(i=n.camelCase(i.slice(5)),P(o,i,s[i])));L.set(o,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){M.set(this,e)}):J(this,function(t){var r,i=n.camelCase(e);if(o&&void 0===t){if(r=M.get(o,e),void 0!==r)return r;if(r=M.get(o,i),void 0!==r)return r;if(r=P(o,i,void 0),void 0!==r)return r}else this.each(function(){var n=M.get(this,i);M.set(this,i,t),-1!==e.indexOf("-")&&void 0!==n&&M.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){M.remove(this,e)})}}),n.extend({queue:function(e,t,r){var i;return e?(t=(t||"fx")+"queue",i=L.get(e,t),r&&(!i||n.isArray(r)?i=L.access(e,t,n.makeArray(r)):i.push(r)),i||[]):void 0},dequeue:function(e,t){t=t||"fx";var r=n.queue(e,t),i=r.length,s=r.shift(),o=n._queueHooks(e,t),u=function(){n.dequeue(e,t)};"inprogress"===s&&(s=r.shift(),i--),s&&("fx"===t&&r.unshift("inprogress"),delete o.stop,s.call(e,u,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return L.get(e,r)||L.access(e,r,{empty:n.Callbacks("once memory").add(function(){L.remove(e,[t+"queue",r])})})}}),n.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?n.queue(this[0],e):void 0===t?this:this.each(function(){var r=n.queue(this,e,t);n._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&n.dequeue(this,e)})},dequeue:function(e){return this.each(function(){n.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,i=1,s=n.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(u--)r=L.get(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(e,t){return e=t||e,"none"===n.css(e,"display")||!n.contains(e.ownerDocument,e)},T=/^(?:checkbox|radio)$/i;!function(){var e=l.createDocumentFragment(),t=e.appendChild(l.createElement("div")),n=l.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),k.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;n.event={global:{},add:function(e,t,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g=L.get(e);if(g){r.handler&&(o=r,r=o.handler,s=o.selector),r.guid||(r.guid=n.guid++),(f=g.events)||(f=g.events={}),(u=g.handle)||(u=g.handle=function(t){return typeof n!==U&&n.event.triggered!==t.type?n.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(E)||[""],l=t.length;while(l--)a=Y.exec(t[l])||[],d=m=a[1],v=(a[2]||"").split(".").sort(),d&&(h=n.event.special[d]||{},d=(s?h.delegateType:h.bindType)||d,h=n.event.special[d]||{},c=n.extend({type:d,origType:m,data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&n.expr.match.needsContext.test(s),namespace:v.join(".")},o),(p=f[d])||(p=f[d]=[],p.delegateCount=0,h.setup&&h.setup.call(e,i,v,u)!==!1||e.addEventListener&&e.addEventListener(d,u,!1)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),s?p.splice(p.delegateCount++,0,c):p.push(c),n.event.global[d]=!0)}},remove:function(e,t,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g=L.hasData(e)&&L.get(e);if(g&&(f=g.events)){t=(t||"").match(E)||[""],l=t.length;while(l--)if(a=Y.exec(t[l])||[],d=m=a[1],v=(a[2]||"").split(".").sort(),d){h=n.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,p=f[d]||[],a=a[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=p.length;while(o--)c=p[o],!s&&m!==c.origType||r&&r.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,h.remove&&h.remove.call(e,c));u&&!p.length&&(h.teardown&&h.teardown.call(e,v,g.handle)!==!1||n.removeEvent(e,d,g.handle),delete f[d])}else for(d in f)n.event.remove(e,d+t[l],r,i,!0);n.isEmptyObject(f)&&(delete g.handle,L.remove(e,"events"))}},trigger:function(e,t,r,i){var s,o,u,f,c,h,p,d=[r||l],v=j.call(e,"type")?e.type:e,m=j.call(e,"namespace")?e.namespace.split("."):[];if(o=u=r=r||l,3!==r.nodeType&&8!==r.nodeType&&!X.test(v+n.event.triggered)&&(v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),c=v.indexOf(":")<0&&"on"+v,e=e[n.expando]?e:new n.Event(v,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=m.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:n.makeArray(t,[e]),p=n.event.special[v]||{},i||!p.trigger||p.trigger.apply(r,t)!==!1)){if(!i&&!p.noBubble&&!n.isWindow(r)){for(f=p.delegateType||v,X.test(f+v)||(o=o.parentNode);o;o=o.parentNode)d.push(o),u=o;u===(r.ownerDocument||l)&&d.push(u.defaultView||u.parentWindow||a)}s=0;while((o=d[s++])&&!e.isPropagationStopped())e.type=s>1?f:p.bindType||v,h=(L.get(o,"events")||{})[e.type]&&L.get(o,"handle"),h&&h.apply(o,t),h=c&&o[c],h&&h.apply&&n.acceptData(o)&&(e.result=h.apply(o,t),e.result===!1&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||p._default&&p._default.apply(d.pop(),t)!==!1||!n.acceptData(r)||c&&n.isFunction(r[v])&&!n.isWindow(r)&&(u=r[c],u&&(r[c]=null),n.event.triggered=v,r[v](),n.event.triggered=void 0,u&&(r[c]=u)),e.result}},dispatch:function(e){e=n.event.fix(e);var t,r,i,s,o,u=[],a=d.call(arguments),f=(L.get(this,"events")||{})[e.type]||[],l=n.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){u=n.event.handlers.call(this,e,f),t=0;while((s=u[t++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,r=0;while((o=s.handlers[r++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,i=((n.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a),void 0!==i&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var r,i,s,o,u=[],a=t.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||"click"!==e.type))for(;f!==this;f=f.parentNode||this)if(f.disabled!==!0||"click"!==e.type){for(i=[],r=0;a>r;r++)o=t[r],s=o.selector+" ",void 0===i[s]&&(i[s]=o.needsContext?n(s,this).index(f)>=0:n.find(s,this,null,[f]).length),i[s]&&i.push(o);i.length&&u.push({elem:f,handlers:i})}return a<t.length&&u.push({elem:this,handlers:t.slice(a)}),u},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||l,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===s||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[n.expando])return e;var t,r,i,s=e.type,o=e,u=this.fixHooks[s];u||(this.fixHooks[s]=u=W.test(s)?this.mouseHooks:V.test(s)?this.keyHooks:{}),i=u.props?this.props.concat(u.props):this.props,e=new n.Event(o),t=i.length;while(t--)r=i[t],e[r]=o[r];return e.target||(e.target=l),3===e.target.nodeType&&(e.target=e.target.parentNode),u.filter?u.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return n.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,r,i){var s=n.extend(new n.Event,r,{type:e,isSimulated:!0,originalEvent:{}});i?n.event.trigger(s,null,t):n.event.dispatch.call(t,s),s.isDefaultPrevented()&&r.preventDefault()}},n.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},n.Event=function(e,t){return this instanceof n.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?Z:$):this.type=e,t&&n.extend(this,t),this.timeStamp=e&&e.timeStamp||n.now(),void (this[n.expando]=!0)):new n.Event(e,t)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Z,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Z,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Z,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){n.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,i=this,s=e.relatedTarget,o=e.handleObj;return(!s||s!==i&&!n.contains(i,s))&&(e.type=o.origType,r=o.handler.apply(this,arguments),e.type=t),r}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(e,t){var r=function(e){n.event.simulate(t,e.target,n.event.fix(e),!0)};n.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=L.access(n,t);i||n.addEventListener(e,r,!0),L.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=L.access(n,t)-1;i?L.access(n,t,i):(n.removeEventListener(e,r,!0),L.remove(n,t))}}}),n.fn.extend({on:function(e,t,r,i,s){var o,u;if("object"==typeof e){"string"!=typeof t&&(r=r||t,t=void 0);for(u in e)this.on(u,t,r,e[u],s);return this}if(null==r&&null==i?(i=t,r=t=void 0):null==i&&("string"==typeof t?(i=r,r=void 0):(i=r,r=t,t=void 0)),i===!1)i=$;else if(!i)return this;return 1===s&&(o=i,i=function(e){return n().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=n.guid++)),this.each(function(){n.event.add(this,e,i,r,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,n(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(s in e)this.off(s,t,e[s]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=$),this.each(function(){n.event.remove(this,e,r,t)})},trigger:function(e,t){return this.each(function(){n.event.trigger(e,t,this)})},triggerHandler:function(e,t){var r=this[0];return r?n.event.trigger(e,t,r,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td,n.extend({clone:function(e,t,r){var i,s,o,u,a=e.cloneNode(!0),f=n.contains(e.ownerDocument,e);if(!(k.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||n.isXMLDoc(e)))for(u=oa(a),o=oa(e),i=0,s=o.length;s>i;i++)pa(o[i],u[i]);if(t)if(r)for(o=o||oa(e),u=u||oa(a),i=0,s=o.length;s>i;i++)na(o[i],u[i]);else na(e,a);return u=oa(a,"script"),u.length>0&&ma(u,!f&&oa(e,"script")),a},buildFragment:function(e,t,r,i){for(var s,o,u,a,f,l,c=t.createDocumentFragment(),h=[],p=0,d=e.length;d>p;p++)if(s=e[p],s||0===s)if("object"===n.type(s))n.merge(h,s.nodeType?[s]:s);else if(ca.test(s)){o=o||c.appendChild(t.createElement("div")),u=(ba.exec(s)||["",""])[1].toLowerCase(),a=ia[u]||ia._default,o.innerHTML=a[1]+s.replace(aa,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.lastChild;n.merge(h,o.childNodes),o=c.firstChild,o.textContent=""}else h.push(t.createTextNode(s));c.textContent="",p=0;while(s=h[p++])if((!i||-1===n.inArray(s,i))&&(f=n.contains(s.ownerDocument,s),o=oa(c.appendChild(s),"script"),f&&ma(o),r)){l=0;while(s=o[l++])fa.test(s.type||"")&&r.push(s)}return c},cleanData:function(e){for(var t,r,i,s,o=n.event.special,u=0;void 0!==(r=e[u]);u++){if(n.acceptData(r)&&(s=r[L.expando],s&&(t=L.cache[s]))){if(t.events)for(i in t.events)o[i]?n.event.remove(r,i):n.removeEvent(r,i,t.handle);L.cache[s]&&delete L.cache[s]}delete M.cache[r[M.expando]]}}}),n.fn.extend({text:function(e){return J(this,function(e){return void 0===e?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ja(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ja(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var r,i=e?n.filter(e,this):this,s=0;null!=(r=i[s]);s++)t||1!==r.nodeType||n.cleanData(oa(r)),r.parentNode&&(t&&n.contains(r.ownerDocument,r)&&ma(oa(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(n.cleanData(oa(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return n.clone(this,e,t)})},html:function(e){return J(this,function(e){var t=this[0]||{},r=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!da.test(e)&&!ia[(ba.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(aa,"<$1></$2>");try{for(;i>r;r++)t=this[r]||{},1===t.nodeType&&(n.cleanData(oa(t,!1)),t.innerHTML=e);t=0}catch(s){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,n.cleanData(oa(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(t,r){t=e.apply([],t);var i,s,o,u,a,f,l=0,c=this.length,h=this,p=c-1,d=t[0],v=n.isFunction(d);if(v||c>1&&"string"==typeof d&&!k.checkClone&&ea.test(d))return this.each(function(e){var n=h.eq(e);v&&(t[0]=d.call(this,e,n.html())),n.domManip(t,r)});if(c&&(i=n.buildFragment(t,this[0].ownerDocument,!1,this),s=i.firstChild,1===i.childNodes.length&&(i=s),s)){for(o=n.map(oa(i,"script"),ka),u=o.length;c>l;l++)a=i,l!==p&&(a=n.clone(a,!0,!0),u&&n.merge(o,oa(a,"script"))),r.call(this[l],a,l);if(u)for(f=o[o.length-1].ownerDocument,n.map(o,la),l=0;u>l;l++)a=o[l],fa.test(a.type||"")&&!L.access(a,"globalEval")&&n.contains(f,a)&&(a.src?n._evalUrl&&n._evalUrl(a.src):n.globalEval(a.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){n.fn[e]=function(e){for(var r,i=[],s=n(e),o=s.length-1,u=0;o>=u;u++)r=u===o?this:this.clone(!0),n(s[u])[t](r),f.apply(i,r.get());return this.pushStack(i)}});var qa,ra={},ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):a.getComputedStyle(e,null)};!function(){var e,t,r=l.documentElement,i=l.createElement("div"),s=l.createElement("div");if(s.style){s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===s.style.backgroundClip,i.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",i.appendChild(s);function o(){s.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",s.innerHTML="",r.appendChild(i);var n=a.getComputedStyle(s,null);e="1%"!==n.top,t="4px"===n.width,r.removeChild(i)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return o(),e},boxSizingReliable:function(){return null==t&&o(),t},reliableMarginRight:function(){var e,t=s.appendChild(l.createElement("div"));return t.style.cssText=s.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",s.style.width="1px",r.appendChild(i),e=!parseFloat(a.getComputedStyle(t,null).marginRight),r.removeChild(i),s.removeChild(t),e}})}}(),n.swap=function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];n.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=xa(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,o,u,a=n.camelCase(t),f=e.style;return t=n.cssProps[a]||(n.cssProps[a]=Fa(f,a)),u=n.cssHooks[t]||n.cssHooks[a],void 0===r?u&&"get"in u&&void 0!==(s=u.get(e,!1,i))?s:f[t]:(o=typeof r,"string"===o&&(s=Ba.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(n.css(e,t)),o="number"),null!=r&&r===r&&("number"!==o||n.cssNumber[a]||(r+="px"),k.clearCloneStyle||""!==r||0!==t.indexOf("background")||(f[t]="inherit"),u&&"set"in u&&void 0===(r=u.set(e,r,i))||(f[t]=r)),void 0)}},css:function(e,t,r,i){var s,o,u,a=n.camelCase(t);return t=n.cssProps[a]||(n.cssProps[a]=Fa(e.style,a)),u=n.cssHooks[t]||n.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,r)),void 0===s&&(s=xa(e,t,i)),"normal"===s&&t in Da&&(s=Da[t]),""===r||r?(o=parseFloat(s),r===!0||n.isNumeric(o)?o||0:s):s}}),n.each(["height","width"],function(e,t){n.cssHooks[t]={get:function(e,r,i){return r?za.test(n.css(e,"display"))&&0===e.offsetWidth?n.swap(e,Ca,function(){return Ia(e,t,i)}):Ia(e,t,i):void 0},set:function(e,r,i){var s=i&&wa(e);return Ga(e,r,i?Ha(e,t,i,"border-box"===n.css(e,"boxSizing",!1,s),s):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(e,t){return t?n.swap(e,{display:"inline-block"},xa,[e,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(e,t){n.cssHooks[e+t]={expand:function(n){for(var r=0,i={},s="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+R[r]+t]=s[r]||s[r-2]||s[0];return i}},ua.test(e)||(n.cssHooks[e+t].set=Ga)}),n.fn.extend({css:function(e,t){return J(this,function(e,t,r){var i,s,o={},u=0;if(n.isArray(t)){for(i=wa(e),s=t.length;s>u;u++)o[t[u]]=n.css(e,t[u],!1,i);return o}return void 0!==r?n.style(e,t,r):n.css(e,t)},e,t,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}}),n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(e,t,r,i,s,o){this.elem=e,this.prop=r,this.easing=s||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(n.cssNumber[r]?"":"px")},cur:function(){var e=Ka.propHooks[this.prop];return e&&e.get?e.get(this):Ka.propHooks._default.get(this)},run:function(e){var t,r=Ka.propHooks[this.prop];return this.options.duration?this.pos=t=n.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=n.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){n.fx.step[e.prop]?n.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[n.cssProps[e.prop]]||n.cssHooks[e.prop])?n.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},n.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(e,t){var r=this.createTween(e,t),i=r.cur(),s=Oa.exec(t),o=s&&s[3]||(n.cssNumber[e]?"":"px"),u=(n.cssNumber[e]||"px"!==o&&+i)&&Oa.exec(n.css(r.elem,e)),a=1,f=20;if(u&&u[3]!==o){o=o||u[3],s=s||[],u=+i||1;do a=a||".5",u/=a,n.style(r.elem,e,u+o);while(a!==(a=r.cur()/i)&&1!==a&&--f)}return s&&(u=r.start=+u||+i||0,r.unit=o,r.end=s[1]?u+(s[1]+1)*s[2]:+s[2]),r}]};n.Animation=n.extend(Xa,{tweener:function(e,t){n.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var r,i=0,s=e.length;s>i;i++)r=e[i],Ra[r]=Ra[r]||[],Ra[r].unshift(t)},prefilter:function(e,t){t?Qa.unshift(e):Qa.push(e)}}),n.speed=function(e,t,r){var i=e&&"object"==typeof e?n.extend({},e):{complete:r||!r&&t||n.isFunction(e)&&e,duration:e,easing:r&&t||t&&!n.isFunction(t)&&t};return i.duration=n.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in n.fx.speeds?n.fx.speeds[i.duration]:n.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){n.isFunction(i.old)&&i.old.call(this),i.queue&&n.dequeue(this,i.queue)},i},n.fn.extend({fadeTo:function(e,t,n,r){return this.filter(S).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,r,i){var s=n.isEmptyObject(e),o=n.speed(t,r,i),u=function(){var t=Xa(this,n.extend({},e),o);(s||L.get(this,"finish"))&&t.stop(!0)};return u.finish=u,s||o.queue===!1?this.each(u):this.queue(o.queue,u)},stop:function(e,t,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,s=null!=e&&e+"queueHooks",o=n.timers,u=L.get(this);if(s)u[s]&&u[s].stop&&i(u[s]);else for(s in u)u[s]&&u[s].stop&&Pa.test(s)&&i(u[s]);for(s=o.length;s--;)o[s].elem!==this||null!=e&&o[s].queue!==e||(o[s].anim.stop(r),t=!1,o.splice(s,1));(t||!r)&&n.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,r=L.get(this),i=r[e+"queue"],s=r[e+"queueHooks"],o=n.timers,u=i?i.length:0;for(r.finish=!0,n.queue(this,e,[]),s&&s.stop&&s.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;u>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete r.finish})}}),n.each(["toggle","show","hide"],function(e,t){var r=n.fn[t];n.fn[t]=function(e,n,i){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(Ta(t,!0),e,n,i)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){n.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),n.timers=[],n.fx.tick=function(){var e,t=0,r=n.timers;for(La=n.now();t<r.length;t++)e=r[t],e()||r[t]!==e||r.splice(t--,1);r.length||n.fx.stop(),La=void 0},n.fx.timer=function(e){n.timers.push(e),e()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(e,t){return e=n.fx?n.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=l.createElement("input"),t=l.createElement("select"),n=t.appendChild(l.createElement("option"));e.type="checkbox",k.checkOn=""!==e.value,k.optSelected=n.selected,t.disabled=!0,k.optDisabled=!n.disabled,e=l.createElement("input"),e.value="t",e.type="radio",k.radioValue="t"===e.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(e,t){return J(this,n.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){n.removeAttr(this,e)})}}),n.extend({attr:function(e,t,r){var i,s,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===U?n.prop(e,t,r):(1===o&&n.isXMLDoc(e)||(t=t.toLowerCase(),i=n.attrHooks[t]||(n.expr.match.bool.test(t)?Za:Ya)),void 0===r?i&&"get"in i&&null!==(s=i.get(e,t))?s:(s=n.find.attr(e,t),null==s?void 0:s):null!==r?i&&"set"in i&&void 0!==(s=i.set(e,r,t))?s:(e.setAttribute(t,r+""),r):void n.removeAttr(e,t))},removeAttr:function(e,t){var r,i,s=0,o=t&&t.match(E);if(o&&1===e.nodeType)while(r=o[s++])i=n.propFix[r]||r,n.expr.match.bool.test(r)&&(e[i]=!1),e.removeAttribute(r)},attrHooks:{type:{set:function(e,t){if(!k.radioValue&&"radio"===t&&n.nodeName(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}}}),Za={set:function(e,t,r){return t===!1?n.removeAttr(e,r):e.setAttribute(r,r),r}},n.each(n.expr.match.bool.source.match(/\w+/g),function(e,t){var r=$a[t]||n.find.attr;$a[t]=function(e,t,n){var i,s;return n||(s=$a[t],$a[t]=i,i=null!=r(e,t,n)?t.toLowerCase():null,$a[t]=s),i}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(e,t){return J(this,n.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[n.propFix[e]||e]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,r){var i,s,o,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return o=1!==u||!n.isXMLDoc(e),o&&(t=n.propFix[t]||t,s=n.propHooks[t]),void 0!==r?s&&"set"in s&&void 0!==(i=s.set(e,r,t))?i:e[t]=r:s&&"get"in s&&null!==(i=s.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||_a.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(e){var t,r,i,s,o,u,a="string"==typeof e&&e,f=0,l=this.length;if(n.isFunction(e))return this.each(function(t){n(this).addClass(e.call(this,t,this.className))});if(a)for(t=(e||"").match(E)||[];l>f;f++)if(r=this[f],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(ab," "):" ")){o=0;while(s=t[o++])i.indexOf(" "+s+" ")<0&&(i+=s+" ");u=n.trim(i),r.className!==u&&(r.className=u)}return this},removeClass:function(e){var t,r,i,s,o,u,a=0===arguments.length||"string"==typeof e&&e,f=0,l=this.length;if(n.isFunction(e))return this.each(function(t){n(this).removeClass(e.call(this,t,this.className))});if(a)for(t=(e||"").match(E)||[];l>f;f++)if(r=this[f],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(ab," "):"")){o=0;while(s=t[o++])while(i.indexOf(" "+s+" ")>=0)i=i.replace(" "+s+" "," ");u=e?n.trim(i):"",r.className!==u&&(r.className=u)}return this},toggleClass:function(e,t){var r=typeof e;return"boolean"==typeof t&&"string"===r?t?this.addClass(e):this.removeClass(e):this.each(n.isFunction(e)?function(r){n(this).toggleClass(e.call(this,r,this.className,t),t)}:function(){if("string"===r){var t,i=0,s=n(this),o=e.match(E)||[];while(t=o[i++])s.hasClass(t)?s.removeClass(t):s.addClass(t)}else(r===U||"boolean"===r)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||e===!1?"":L.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(ab," ").indexOf(t)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(e){var t,r,i,s=this[0];if(arguments.length)return i=n.isFunction(e),this.each(function(r){var s;1===this.nodeType&&(s=i?e.call(this,r,n(this).val()):e,null==s?s="":"number"==typeof s?s+="":n.isArray(s)&&(s=n.map(s,function(e){return null==e?"":e+""})),t=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))});if(s)return t=n.valHooks[s.type]||n.valHooks[s.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(s,"value"))?r:(r=s.value,"string"==typeof r?r.replace(bb,""):null==r?"":r)}}),n.extend({valHooks:{option:{get:function(e){var t=n.find.attr(e,"value");return null!=t?t:n.trim(n.text(e))}},select:{get:function(e){for(var t,r,i=e.options,s=e.selectedIndex,o="select-one"===e.type||0>s,u=o?null:[],a=o?s+1:i.length,f=0>s?a:o?s:0;a>f;f++)if(r=i[f],!(!r.selected&&f!==s||(k.optDisabled?r.disabled:null!==r.getAttribute("disabled"))||r.parentNode.disabled&&n.nodeName(r.parentNode,"optgroup"))){if(t=n(r).val(),o)return t;u.push(t)}return u},set:function(e,t){var r,i,s=e.options,o=n.makeArray(t),u=s.length;while(u--)i=s[u],(i.selected=n.inArray(i.value,o)>=0)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(e,t){return n.isArray(t)?e.checked=n.inArray(n(e).val(),t)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){n.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),n.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var cb=n.now(),db=/\?/;n.parseJSON=function(e){return JSON.parse(e+"")},n.parseXML=function(e){var t,r;if(!e||"string"!=typeof e)return null;try{r=new DOMParser,t=r.parseFromString(e,"text/xml")}catch(i){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+e),t};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?sb(sb(e,n.ajaxSettings),t):sb(n.ajaxSettings,e)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(e,t){function T(e,t,o,a){var l,g,y,w,E,x=t;2!==b&&(b=2,u&&clearTimeout(u),r=void 0,s=a||"",S.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(w=tb(c,S,o)),w=ub(c,w,S,l),l?(c.ifModified&&(E=S.getResponseHeader("Last-Modified"),E&&(n.lastModified[i]=E),E=S.getResponseHeader("etag"),E&&(n.etag[i]=E)),204===e||"HEAD"===c.type?x="nocontent":304===e?x="notmodified":(x=w.state,g=w.data,y=w.error,l=!y)):(y=x,(e||!x)&&(x="error",0>e&&(e=0))),S.status=e,S.statusText=(t||x)+"",l?d.resolveWith(h,[g,x,S]):d.rejectWith(h,[S,x,y]),S.statusCode(m),m=void 0,f&&p.trigger(l?"ajaxSuccess":"ajaxError",[S,c,l?g:y]),v.fireWith(h,[S,x]),f&&(p.trigger("ajaxComplete",[S,c]),--n.active||n.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,s,o,u,a,f,l,c=n.ajaxSetup({},t),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?n(h):n.event,d=n.Deferred(),v=n.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,w="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!o){o={};while(t=gb.exec(s))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else S.always(e[S.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),T(0,t),this}};if(d.promise(S).complete=v.add,S.success=S.done,S.error=S.fail,c.url=((e||c.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=n.trim(c.dataType||"*").toLowerCase().match(E)||[""],null==c.crossDomain&&(a=kb.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===pb[1]&&a[2]===pb[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=n.param(c.data,c.traditional)),rb(lb,c,t,S),2===b)return S;f=n.event&&c.global,f&&0===n.active++&&n.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!ib.test(c.type),i=c.url,c.hasContent||(c.data&&(i=c.url+=(db.test(i)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=fb.test(i)?i.replace(fb,"$1_="+cb++):i+(db.test(i)?"&":"?")+"_="+cb++)),c.ifModified&&(n.lastModified[i]&&S.setRequestHeader("If-Modified-Since",n.lastModified[i]),n.etag[i]&&S.setRequestHeader("If-None-Match",n.etag[i])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&S.setRequestHeader("Content-Type",c.contentType),S.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+nb+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)S.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,S,c)!==!1&&2!==b){w="abort";for(l in{success:1,error:1,complete:1})S[l](c[l]);if(r=rb(mb,c,t,S)){S.readyState=1,f&&p.trigger("ajaxSend",[S,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){S.abort("timeout")},c.timeout));try{b=1,r.send(g,T)}catch(x){if(!(2>b))throw x;T(-1,x)}}else T(-1,"No Transport");return S}return S.abort()},getJSON:function(e,t,r){return n.get(e,t,r,"json")},getScript:function(e,t){return n.get(e,void 0,t,"script")}}),n.each(["get","post"],function(e,t){n[t]=function(e,r,i,s){return n.isFunction(r)&&(s=s||i,i=r,r=void 0),n.ajax({url:e,type:t,dataType:s,data:r,success:i})}}),n._evalUrl=function(e){return n.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(e){var t;return n.isFunction(e)?this.each(function(t){n(this).wrapAll(e.call(this,t))}):(this[0]&&(t=n(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return this.each(n.isFunction(e)?function(t){n(this).wrapInner(e.call(this,t))}:function(){var t=n(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},wrap:function(e){var t=n.isFunction(e);return this.each(function(r){n(this).wrapAll(t?e.call(this,r):e)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},n.expr.filters.visible=function(e){return!n.expr.filters.hidden(e)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;n.param=function(e,t){var r,i=[],s=function(e,t){t=n.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(e)||e.jquery&&!n.isPlainObject(e))n.each(e,function(){s(this.name,this.value)});else for(r in e)Ab(r,e[r],t,s);return i.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=n.prop(this,"elements");return e?n.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(e)&&(this.checked||!T.test(e))}).map(function(e,t){var r=n(this).val();return null==r?null:n.isArray(r)?n.map(r,function(e){return{name:t.name,value:e.replace(xb,"\r\n")}}):{name:t.name,value:r.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var e in Cb)Cb[e]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(e){var t;return k.cors||Eb&&!e.crossDomain?{send:function(n,r){var i,s=e.xhr(),o=++Bb;if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Cb[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status,s.statusText):r(Db[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:void 0,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=Cb[o]=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(u){if(t)throw u}},abort:function(){t&&t()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return n.globalEval(e),e}}}),n.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),n.ajaxTransport("script",function(e){if(e.crossDomain){var t,r;return{send:function(i,s){t=n("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",r=function(e){t.remove(),r=null,e&&s("error"===e.type?404:200,e.type)}),l.head.appendChild(t[0])},abort:function(){r&&r()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fb.pop()||n.expando+"_"+cb++;return this[e]=!0,e}}),n.ajaxPrefilter("json jsonp",function(e,t,r){var i,s,o,u=e.jsonp!==!1&&(Gb.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(e.data)&&"data");return u||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=n.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,u?e[u]=e[u].replace(Gb,"$1"+i):e.jsonp!==!1&&(e.url+=(db.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return o||n.error(i+" was not called"),o[0]},e.dataTypes[0]="json",s=a[i],a[i]=function(){o=arguments},r.always(function(){a[i]=s,e[i]&&(e.jsonpCallback=t.jsonpCallback,Fb.push(i)),o&&n.isFunction(s)&&s(o[0]),o=s=void 0}),"script"):void 0}),n.parseHTML=function(e,t,r){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(r=t,t=!1),t=t||l;var i=v.exec(e),s=!r&&[];return i?[t.createElement(i[1])]:(i=n.buildFragment([e],t,s),s&&s.length&&n(s).remove(),n.merge([],i.childNodes))};var Hb=n.fn.load;n.fn.load=function(e,t,r){if("string"!=typeof e&&Hb)return Hb.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=n.trim(e.slice(a)),e=e.slice(0,a)),n.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),u.length>0&&n.ajax({url:e,type:s,dataType:"html",data:t}).done(function(e){o=arguments,u.html(i?n("<div>").append(n.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,o||[e.responseText,t,e])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){n.fn[t]=function(e){return this.on(t,e)}}),n.expr.filters.animated=function(e){return n.grep(n.timers,function(t){return e===t.elem}).length};var Ib=a.document.documentElement;n.offset={setOffset:function(e,t,r){var i,s,o,u,a,f,l,c=n.css(e,"position"),h=n(e),p={};"static"===c&&(e.style.position="relative"),a=h.offset(),o=n.css(e,"top"),f=n.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+f).indexOf("auto")>-1,l?(i=h.position(),u=i.top,s=i.left):(u=parseFloat(o)||0,s=parseFloat(f)||0),n.isFunction(t)&&(t=t.call(e,r,a)),null!=t.top&&(p.top=t.top-a.top+u),null!=t.left&&(p.left=t.left-a.left+s),"using"in t?t.using.call(e,p):h.css(p)}},n.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){n.offset.setOffset(this,e,t)});var t,r,i=this[0],s={top:0,left:0},o=i&&i.ownerDocument;if(o)return t=o.documentElement,n.contains(t,i)?(typeof i.getBoundingClientRect!==U&&(s=i.getBoundingClientRect()),r=Jb(o),{top:s.top+r.pageYOffset-t.clientTop,left:s.left+r.pageXOffset-t.clientLeft}):s},position:function(){if(this[0]){var e,t,r=this[0],i={top:0,left:0};return"fixed"===n.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),n.nodeName(e[0],"html")||(i=e.offset()),i.top+=n.css(e[0],"borderTopWidth",!0),i.left+=n.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-n.css(r,"marginTop",!0),left:t.left-i.left-n.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||Ib;while(e&&!n.nodeName(e,"html")&&"static"===n.css(e,"position"))e=e.offsetParent;return e||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;n.fn[e]=function(n){return J(this,function(e,n,i){var s=Jb(e);return void 0===i?s?s[t]:e[n]:void (s?s.scrollTo(r?a.pageXOffset:i,r?i:a.pageYOffset):e[n]=i)},e,n,arguments.length,null)}}),n.each(["top","left"],function(e,t){n.cssHooks[t]=ya(k.pixelPosition,function(e,r){return r?(r=xa(e,t),va.test(r)?n(e).position()[t]+"px":r):void 0})}),n.each({Height:"height",Width:"width"},function(e,t){n.each({padding:"inner"+e,content:t,"":"outer"+e},function(r,i){n.fn[i]=function(i,s){var o=arguments.length&&(r||"boolean"!=typeof i),u=r||(i===!0||s===!0?"margin":"border");return J(this,function(t,r,i){var s;return n.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===i?n.css(t,r,u):n.style(t,r,i,u)},t,o?i:void 0,o,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(e){return a.$===n&&(a.$=Lb),e&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n}),define("config",["jquery"],function(e){function r(){if(typeof Storage!="undefined"&&window.trill_on_swish.config_hash){var e;if(e=localStorage.getItem(t)){value=JSON.parse(e);if(value.hash==window.trill_on_swish.config_hash)return value.config}}}function i(e){typeof Storage!="undefined"&&window.trill_on_swish.config_hash&&localStorage.setItem(t,JSON.stringify({hash:window.trill_on_swish.config_hash,config:e}))}var t="SWISHCONFIG",n;return n||(n=r())||e.ajax("trill_on_swish_config.json",{dataType:"json",async:!1,success:function(e){n=e,i(n)},error:function(){alert("Failed to fetch configuration from server")}}),n}),define("preferences",["jquery"],function(e){function i(){var e=localStorage.getItem("notagain")||"[]",t;try{data=JSON.parse(e),typeof data!="object"&&(data=[])}catch(n){data=[]}return data}var t=typeof Storage!="undefined",n={},r={persistent:function(){return t},setNotAgain:function(e){if(t){var n=i();n.indexOf(e)<0&&(n.push(e),localStorage.setItem("notagain",JSON.stringify(n)))}},notagain:function(e){if(t){var n=i();return n.indexOf(e)>=0}return!1},broadcast:function(t,n){e(".trill_on_swish-event-receiver").trigger("preference",{name:t,value:n})},setVal:function(e,n){t&&localStorage.setItem(e,JSON.stringify(n)),this.broadcast(e,n)},setDefault:function(e,t){n[e]=t},getVal:function(e){if(t){var r;if(r=localStorage.getItem(e))return value=JSON.parse(r),value}return n[e]}};return r}),define("history",["jquery","preferences"],function(e,t){var n={push:function(e){var t=window.location.pathname;if(t!=e.url){var n={location:e.url};e.meta&&(n.meta=e.meta),window.history.pushState(n,"",e.url),document.title="SWISH -- "+(e.file?e.file:"SWI-Prolog for SHaring")}},pop:function(t){t.state&&(t.state.meta&&t.state.meta.name?e(".trill_on_swish").trill_on_swish("playFile",t.state.meta.name):t.state.location&&(window.location=t.state.location))},recentMaxLength:10,addRecent:function(e){function i(e,t){return e.type==t.type&&e.id==t.id}var r=t.getVal("recentDocuments")||[];for(var s=0;s<r.length;s++)if(i(e,r[s])){r.splice(s,1);break}while(r.length+1>n.recentMaxLength)r.pop();r.splice(0,0,e),t.setVal("recentDocuments",r)},openRecent:function(e,t){return n.openRecent[t.type](e,t)},updateRecentUL:function(){var n=e(this),r=t.getVal("recentDocuments")||[];n.html("");for(var i=0;i<r.length;i++){var s=r[i],o=e.el.a(s.label||s.id);e(o).data("document",s),n.append(e.el.li(o))}}};return n.openRecent.gitty=function(t,n){e(t.target).parents(".trill_on_swish").trill_on_swish("playFile",n.id)},window.onpopstate=n.pop,n}),function(e){function n(){var e=document.createElement(arguments[0]);for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r===null||r===undefined)continue;if(r.nodeType===1)e.appendChild(r);else if(!(r===""||r&&r.charCodeAt&&r.substr)&&!(r===0||r&&r.toExponential&&r.toFixed)){if(n===1&&typeof r=="object"){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];if(s!==null&&s!==undefined){i=i.toLowerCase(),i=t[i]||i;var o=i.charAt(0)==="o"&&i.charAt(1)==="n";o?(r.href===undefined&&i==="onclick"&&e.setAttribute("href","#"),e[i]=s):i==="style"&&e.style.setAttribute?e.style.setAttribute("cssText",s):i==="className"||i==="htmlFor"?e[i]=s:e.setAttribute(i,s)}}}else if(Object.prototype.toString.call(r)==="[object Array]")for(var u=0;u<r.length;u++){var a=r[u];a.nodeType===1&&e.appendChild(a)}}else e.appendChild(document.createTextNode(r))}return e.appendTo=function(e){return e.nodeType===1&&this.nodeType===1&&e.appendChild(this),this},e}var t={acceptcharset:"acceptCharset",accesskey:"accessKey",allowtransparency:"allowTransparency",bgcolor:"bgColor",cellpadding:"cellPadding",cellspacing:"cellSpacing","class":"className",classname:"className",colspan:"colSpan",csstext:"style",defaultchecked:"defaultChecked",defaultselected:"defaultSelected",defaultvalue:"defaultValue","for":"htmlFor",frameborder:"frameBorder",hspace:"hSpace",htmlfor:"htmlFor",longdesc:"longDesc",maxlength:"maxLength",marginwidth:"marginWidth",marginheight:"marginHeight",noresize:"noResize",noshade:"noShade",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",vspace:"vSpace"};n.registerElement=function(e,t){n[e]||(n[e]=function(){var r=n("div",{"class":e});return t.apply(r,Array.prototype.slice.call(arguments)),r})};var r=["acronym","applet","basefont","big","center","dir","font","frame","frameset","noframes","strike","tt","u","xmp"],i=["a","abbr","address","area","article","aside","audio","b","base","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","ul","var","video","wbr"].concat(r),s=function(e){return function(){return n.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}};for(var o=0;o<i.length;o++)n[i[o]]=s(i[o]);if(typeof module!="undefined"&&module.exports)module.exports=n;else{var u=e.$||{};u.el=n,e.$=u}}(this),define("laconic",["jquery"],function(){});if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(e){var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){return e(t.target).is(this)?t.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(e){function t(t){return this.each(function(){var n=e(this),i=n.data("bs.alert");i||n.data("bs.alert",i=new r(this)),"string"==typeof t&&i[t].call(n)})}var n='[data-dismiss="alert"]',r=function(t){e(t).on("click",n,this.close)};r.VERSION="3.3.5",r.TRANSITION_DURATION=150,r.prototype.close=function(t){function n(){o.detach().trigger("closed.bs.alert").remove()}var i=e(this),s=i.attr("data-target");s||(s=i.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var o=e(s);t&&t.preventDefault(),o.length||(o=i.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(r.TRANSITION_DURATION):n())};var i=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=r,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",n,r.prototype.close)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.button"),s="object"==typeof t&&t;i||r.data("bs.button",i=new n(this,s)),"toggle"==t?i.toggle():t&&i.setState(t)})}var n=function(t,r){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.3.5",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",s=r.data();t+="Text",null==s.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy(function(){r[i](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=e(n.target);r.hasClass("btn")||(r=r.closest(".btn")),t.call(r,"toggle"),e(n.target).is('input[type="radio"]')||e(n.target).is('input[type="checkbox"]')||n.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.carousel"),s=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t),o="string"==typeof t?t:s.slide;i||r.data("bs.carousel",i=new n(this,s)),"number"==typeof t?i.to(t):o?i[o]():s.interval&&i.pause().cycle()})}var n=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};n.VERSION="3.3.5",n.TRANSITION_DURATION=600,n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},n.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},n.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),r="prev"==e&&0===n||"next"==e&&n==this.$items.length-1;if(r&&!this.options.wrap)return t;var i="prev"==e?-1:1,s=(n+i)%this.$items.length;return this.$items.eq(s)},n.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},n.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},n.prototype.next=function(){return this.sliding?void 0:this.slide("next")},n.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},n.prototype.slide=function(t,r){var i=this.$element.find(".item.active"),s=r||this.getItemForDirection(t,i),o=this.interval,u="next"==t?"left":"right",f=this;if(s.hasClass("active"))return this.sliding=!1;var l=s[0],h=e.Event("slide.bs.carousel",{relatedTarget:l,direction:u});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,o&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=e(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var d=e.Event("slid.bs.carousel",{relatedTarget:l,direction:u});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(t),s[0].offsetWidth,i.addClass(u),s.addClass(u),i.one("bsTransitionEnd",function(){s.removeClass([t,u].join(" ")).addClass("active"),i.removeClass(["active",u].join(" ")),f.sliding=!1,setTimeout(function(){f.$element.trigger(d)},0)}).emulateTransitionEnd(n.TRANSITION_DURATION)):(i.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(d)),o&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=n,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(n){var r,i=e(this),s=e(i.attr("data-target")||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var o=e.extend({},s.data(),i.data()),u=i.attr("data-slide-to");u&&(o.interval=!1),t.call(s,o),u&&s.data("bs.carousel").to(u),n.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var n=e(this);t.call(n,n.data())})})}(jQuery),+function(e){function t(t){var n,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(r)}function n(t){return this.each(function(){var n=e(this),i=n.data("bs.collapse"),s=e.extend({},r.DEFAULTS,n.data(),"object"==typeof t&&t);!i&&s.toggle&&/show|hide/.test(t)&&(s.toggle=!1),i||n.data("bs.collapse",i=new r(this,s)),"string"==typeof t&&i[t]()})}var r=function(t,n){this.$element=e(t),this.options=e.extend({},r.DEFAULTS,n),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};r.VERSION="3.3.5",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(t=i.data("bs.collapse"),t&&t.transitioning))){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){i&&i.length&&(n.call(i,"hide"),t||i.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var u=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return u.call(this);var f=e.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",e.proxy(u,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][f])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return e.support.transition?void this.$element[n](0).one("bsTransitionEnd",e.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION):i.call(this)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(n,r){var i=e(r);this.addAriaAndCollapsedClass(t(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var i=e.fn.collapse;e.fn.collapse=n,e.fn.collapse.Constructor=r,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(r){var i=e(this);i.attr("data-target")||r.preventDefault();var s=t(i),o=s.data("bs.collapse"),u=o?"toggle":i.data();n.call(s,u)})}(jQuery),+function(e){function t(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}function n(n){n&&3===n.which||(e(i).remove(),e(s).each(function(){var r=e(this),i=t(r),s={relatedTarget:this};i.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(i[0],n.target)||(i.trigger(n=e.Event("hide.bs.dropdown",s)),n.isDefaultPrevented()||(r.attr("aria-expanded","false"),i.removeClass("open").trigger("hidden.bs.dropdown",s))))}))}function r(t){return this.each(function(){var n=e(this),r=n.data("bs.dropdown");r||n.data("bs.dropdown",r=new o(this)),"string"==typeof t&&r[t].call(n)})}var i=".dropdown-backdrop",s='[data-toggle="dropdown"]',o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.5",o.prototype.toggle=function(r){var i=e(this);if(!i.is(".disabled, :disabled")){var s=t(i),o=s.hasClass("open");if(n(),!o){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",n);var u={relatedTarget:this};if(s.trigger(r=e.Event("show.bs.dropdown",u)),r.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",u)}return!1}},o.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var r=e(this);if(n.preventDefault(),n.stopPropagation(),!r.is(".disabled, :disabled")){var i=t(r),o=i.hasClass("open");if(!o&&27!=n.which||o&&27==n.which)return 27==n.which&&i.find(s).trigger("focus"),r.trigger("click");var u=" li:not(.disabled):visible a",l=i.find(".dropdown-menu"+u);if(l.length){var c=l.index(n.target);38==n.which&&c>0&&c--,40==n.which&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var u=e.fn.dropdown;e.fn.dropdown=r,e.fn.dropdown.Constructor=o,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=u,this},e(document).on("click.bs.dropdown.data-api",n).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",s,o.prototype.toggle).on("keydown.bs.dropdown.data-api",s,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),+function(e){function t(t,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t);s||i.data("bs.modal",s=new n(this,o)),"string"==typeof t?s[t](r):o.show&&s.show(r)})}var n=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};n.VERSION="3.3.5",n.TRANSITION_DURATION=300,n.BACKDROP_TRANSITION_DURATION=150,n.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},n.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},n.prototype.show=function(t){var r=this,i=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var i=e.support.transition&&r.$element.hasClass("fade");r.$element.parent().length||r.$element.appendTo(r.$body),r.$element.show().scrollTop(0),r.adjustDialog(),i&&r.$element[0].offsetWidth,r.$element.addClass("in"),r.enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t});i?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(n.TRANSITION_DURATION):r.$element.trigger("focus").trigger(s)}))},n.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(n.TRANSITION_DURATION):this.hideModal())},n.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},n.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},n.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},n.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},n.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},n.prototype.backdrop=function(t){var r=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){return this.ignoreBackdropClick?void (this.ignoreBackdropClick=!1):void (e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;s?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var o=function(){r.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):o()}else t&&t()},n.prototype.handleUpdate=function(){this.adjustDialog()},n.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},n.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},n.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},n.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},n.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},n.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var r=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=n,e.fn.modal.noConflict=function(){return e.fn.modal=r,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var r=e(this),i=r.attr("href"),s=e(r.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=s.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},s.data(),r.data());r.is("a")&&n.preventDefault(),s.one("show.bs.modal",function(e){e.isDefaultPrevented()||s.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})}),t.call(s,o,this)})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s="object"==typeof t&&t;(i||!/destroy|hide/.test(t))&&(i||r.data("bs.tooltip",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};n.VERSION="3.3.5",n.TRANSITION_DURATION=150,n.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},n.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),s=i.length;s--;){var o=i[s];if("click"==o)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=o){var u="hover"==o?"mouseenter":"focusin",f="hover"==o?"mouseleave":"focusout";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},n.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},n.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState?void (n.hoverState="in"):(clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void (n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show())},n.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},n.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),n.isInStateTrue()?void 0:(clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void (n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide())},n.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var r=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!r)return;var i=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var u="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,l=f.test(u);l&&(u=u.replace(f,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(u).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),p=s[0].offsetWidth,d=s[0].offsetHeight;if(l){var v=u,m=this.getPosition(this.$viewport);u="bottom"==u&&h.bottom+d>m.bottom?"top":"top"==u&&h.top-d<m.top?"bottom":"right"==u&&h.right+p>m.width?"left":"left"==u&&h.left-p<m.left?"right":u,s.removeClass(v).addClass(u)}var g=this.getCalculatedOffset(u,h,p,d);this.applyPlacement(g,u);var y=function(){var e=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==e&&i.leave(i)};e.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",y).emulateTransitionEnd(n.TRANSITION_DURATION):y()}},n.prototype.applyPlacement=function(t,n){var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),t.top+=o,t.left+=u,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var f=r[0].offsetWidth,l=r[0].offsetHeight;"top"==n&&l!=s&&(t.top=t.top+s-l);var c=this.getViewportAdjustedDelta(n,t,f,l);c.left?t.left+=c.left:t.top+=c.top;var h=/top|bottom/.test(n),p=h?2*c.left-i+f:2*c.top-s+l,d=h?"offsetWidth":"offsetHeight";r.offset(t),this.replaceArrow(p,r[0][d],h)},n.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},n.prototype.hide=function(t){function r(){"in"!=i.hoverState&&s.detach(),i.$element.removeAttr("aria-describedby").trigger("hidden.bs."+i.type),t&&t()}var i=this,s=e(this.$tip),o=e.Event("hide.bs."+this.type);return this.$element.trigger(o),o.isDefaultPrevented()?void 0:(s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r(),this.hoverState=null,this)},n.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},n.prototype.hasContent=function(){return this.getTitle()},n.prototype.getPosition=function(t){t=t||this.$element;var n=t[0],r="BODY"==n.tagName,i=n.getBoundingClientRect();null==i.width&&(i=e.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var s=r?{top:0,left:0}:t.offset(),o={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},u=r?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},i,o,u,s)},n.prototype.getCalculatedOffset=function(e,t,n,r){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-r,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},n.prototype.getViewportAdjustedDelta=function(e,t,n,r){var i={top:0,left:0};if(!this.$viewport)return i;var s=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var u=t.top-s-o.scroll,a=t.top+s-o.scroll+r;u<o.top?i.top=o.top-u:a>o.top+o.height&&(i.top=o.top+o.height-a)}else{var f=t.left-s,l=t.left+s+n;f<o.left?i.left=o.left-f:l>o.right&&(i.left=o.left+o.width-l)}return i},n.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},n.prototype.getUID=function(e){do e+=~~(1e6*Math.random());while(document.getElementById(e));return e},n.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},n.prototype.enable=function(){this.enabled=!0},n.prototype.disable=function(){this.enabled=!1},n.prototype.toggleEnabled=function(){this.enabled=!this.enabled},n.prototype.toggle=function(t){var n=this;t&&(n=e(t.currentTarget).data("bs."+this.type),n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},n.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null})};var r=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=r,this}}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s="object"==typeof t&&t;(i||!/destroy|hide/.test(t))&&(i||r.data("bs.popover",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.3.5",n.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),n.prototype.constructor=n,n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var r=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=n,e.fn.popover.noConflict=function(){return e.fn.popover=r,this}}(jQuery),+function(e){function t(n,r){this.$body=e(document.body),this.$scrollElement=e(e(n).is(document.body)?window:n),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var r=e(this),i=r.data("bs.scrollspy"),s="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,s)),"string"==typeof n&&i[n]()})}t.VERSION="3.3.5",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),i=t.data("target")||t.attr("href"),s=/^#./.test(i)&&e(i);return s&&s.length&&s.is(":visible")&&[[s[n]().top+r,i]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),r=this.options.offset+n-this.$scrollElement.height(),i=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=r)return o!=(e=s[s.length-1])&&this.activate(e);if(o&&t<i[0])return this.activeTarget=null,this.clear();for(e=i.length;e--;)o!=s[e]&&t>=i[e]&&(void 0===i[e+1]||t<i[e+1])&&this.activate(s[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=r,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new n(this)),"string"==typeof t&&i[t]()})}var n=function(t){this.element=e(t)};n.VERSION="3.3.5",n.TRANSITION_DURATION=150,n.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.data("target");if(r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var i=n.find(".active:last a"),s=e.Event("hide.bs.tab",{relatedTarget:t[0]}),o=e.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(s),t.trigger(o),!o.isDefaultPrevented()&&!s.isDefaultPrevented()){var u=e(r);this.activate(t.closest("li"),n),this.activate(u,u.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},n.prototype.activate=function(t,r,i){function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),u?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}var o=r.find("> .active"),u=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);o.length&&u?o.one("bsTransitionEnd",s).emulateTransitionEnd(n.TRANSITION_DURATION):s(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.affix"),s="object"==typeof t&&t;i||r.data("bs.affix",i=new n(this,s)),"string"==typeof t&&i[t]()})}var n=function(t,r){this.options=e.extend({},n.DEFAULTS,r),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};n.VERSION="3.3.5",n.RESET="affix affix-top affix-bottom",n.DEFAULTS={offset:0,target:window},n.prototype.getState=function(e,t,n,r){var i=this.$target.scrollTop(),s=this.$element.offset(),o=this.$target.height();if(null!=n&&"top"==this.affixed)return n>i?"top":!1;if("bottom"==this.affixed)return null!=n?i+this.unpin<=s.top?!1:"bottom":e-r>=i+o?!1:"bottom";var u=null==this.affixed,a=u?i:s.top,f=u?o:t;return null!=n&&n>=i?"top":null!=r&&a+f>=e-r?"bottom":!1},n.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(n.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},n.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},n.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),r=this.options.offset,i=r.top,s=r.bottom,o=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(s=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof s&&(s=r.bottom(this.$element));var u=this.getState(o,t,i,s);if(this.affixed!=u){null!=this.unpin&&this.$element.css("top","");var f="affix"+(u?"-"+u:""),l=e.Event(f+".bs.affix");if(this.$element.trigger(l),l.isDefaultPrevented())return;this.affixed=u,this.unpin="bottom"==u?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(f).trigger(f.replace("affix","affixed")+".bs.affix")}"bottom"==u&&this.$element.offset({top:o-t-s})}};var r=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=n,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var n=e(this),r=n.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),t.call(n,r)})})}(jQuery),define("bootstrap",["jquery"],function(){}),define("modal",["config","preferences","jquery","laconic","bootstrap"],function(e,t){return function(n){function s(){var e=n.el.button({type:"button","class":"close","data-dismiss":"modal"});return n(e).html("&times;").on("click",function(e){var r=n(this).parents(".modal"),i=r.find("[data-notagain]");e.preventDefault();if(i&&i.prop("checked")){var s=i.attr("data-notagain");t.setNotAgain(s)}r.modal({show:!1})}),e}function o(e){return e.notagain&&t.persistent()?n.el.label(n.el.input({type:"checkbox","data-notagain":e.notagain,name:"dismiss"})," Don't show again!"):""}function u(){var e=n(this).find(".tm-input");e.each(function(){var e=n(this),t=e.data("prefilled"),r={};t&&(r.prefilled=t),e.tagsManager(r)})}var r="swishModal",i={_init:function(e){return this.each(function(){var e=n(this);e.addClass("trill_on_swish-event-receiver"),e.on("help",function(t,n){e.swishModal("showHelp",n)}),e.on("pldoc",function(t,n){e.swishModal("showPlDoc",n)}),e.on("form",function(t,n){e.swishModal("showForm",n)}),e.on("dialog",function(t,n){e.swishModal("show",n)}),e.on("error",function(t,n){e.swishModal("show",n)}),e.on("ajaxError",function(t,n){e.swishModal("showAjaxError",n)}),e.on("feedback",function(t,n){e.swishModal("feedback",n)})})},showHelp:function(r){var i=this;if(r.notagain&&t.notagain(r.notagain))return;n.ajax({url:e.http.locations.help+"/"+r.file,dataType:"html",success:function(e){var t=n("<div>");t.html(e),i.swishModal("show",n.extend({title:t.find("title").text(),body:t},r))}})},showForm:function(t){var r=this;n.ajax({url:e.http.locations.form+"/"+t.file,dataType:"html",success:function(e){var i=n("<div>");i.html(e),r.swishModal("show",n.extend({title:i.find("legend").text(),body:i},t))}})},showPlDoc:function(t){function n(t){var n="("+t.name+")/"+t.arity;return t.module&&(n=t.module+":"+n),e.http.locations.pldoc_doc_for+"?header=false&object="+encodeURIComponent(n)}function r(e,t){return e.parents("div.modal-dialog").addClass("swish-embedded-manual"),"<iframe class='swish-embedded-manual' onload='javascript:resizeIframe(this);' src='"+t+"'>"+"</iframe>"}var i={title:"SWI-Prolog manual",body:function(){return r(this,n(t))}};return this.swishModal("show",i)},show:function(e){var r=n.el.div({"class":"modal-body"}),i=n.el.h2(),a=n.el.div({"class":"modal-content"},n.el.div({"class":"modal-header"},o(e),s(),i),r),f=n.el.div({"class":"modal fade",id:"ajaxModal",tabindex:-1,role:"dialog"},n.el.div({"class":"modal-dialog"},a));e.notagain&&t.persistent()&&n(a).append(n.el.div({"class":"modal-footer"},o(e))),r=n(r);if(typeof e.body=="function"){var l=e.body.call(r);l&&r.append(l)}else r.html(e.body);return n(i).html(e.title),n(f).modal({show:!0}).on("shown.bs.modal",u).on("hidden.bs.modal",function(){n(this).remove()}),this},showAjaxError:function(e){var t=n.el.div();n(t).html(e.responseText);var r=n(t).find("h1"),i=r.text()||"Server error";r.remove();var s={title:i,body:t};this.swishModal("show",s)},feedback:function(e){var t=n.el.div({"class":"feedback"});return n(t).html(e.html),n(e.owner||"body").append(t),setTimeout(function(){n(t).hide(400,function(){n(t).remove()})},e.duration||1500),this}};window.resizeIframe=function(e){e.style.height=0,e.style.height=e.contentWindow.document.body.scrollHeight+20+"px"},n.fn.swishModal=function(e){if(i[e])return i[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return i._init.apply(this,arguments);n.error("Method "+e+" does not exist on jQuery."+r)}}(jQuery),{ajaxError:function(e){$(".trill_on_swish-event-receiver").trigger("ajaxError",e)},feedback:function(e){$(".trill_on_swish-event-receiver").trigger("feedback",e)}}}),function(e){"function"==typeof define&&define.amd?define("jquery-ui",["jquery"],e):e(jQuery)}(function(e){function t(t,r){var i,s,o,u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,s=i.name,t.href&&s&&"map"===i.nodeName.toLowerCase()?(o=e("img[usemap='#"+s+"']")[0],!!o&&n(o)):!1):(/^(input|select|textarea|button|object)$/.test(u)?!t.disabled:"a"===u?t.href||r:r)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function r(e){for(var t,n;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(n=parseInt(e.css("zIndex"),10),!isNaN(n)&&0!==n))return n;e=e.parent()}return 0}function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=s(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(t){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(n,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(n,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function u(t,n){e.extend(t,n);for(var r in n)null==n[r]&&(t[r]=n[r]);return t}function a(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var n=this.css("position"),r="absolute"===n,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&"static"===t.css("position")?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&s.length?s:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var r=e.attr(n,"tabindex"),i=isNaN(r);return(i||r>=0)&&t(n,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function r(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return void 0===t?o["inner"+n].call(this):this.each(function(){e(this).css(s,r(this,t)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?o["outer"+n].call(this,t):this.each(function(){e(this).css(s,r(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(n,r){return"number"==typeof n?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var n,r,i=e(this[0]);i.length&&i[0]!==document;){if(n=i.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(r=parseInt(i.css("zIndex"),10),!isNaN(r)&&0!==r))return r;i=i.parent()}return 0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(s&&(r||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(i=0;s.length>i;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}};var f=0,l=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;null!=(i=n[s]);s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];return t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){return e.isFunction(r)?(a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t,n=this._super,s=this._superApply;return this._super=e,this._superApply=i,t=r.apply(this,arguments),this._super=n,this._superApply=s,t}}(),void 0):(a[t]=r,void 0)}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var n,r,i=l.call(arguments,1),s=0,o=i.length;o>s;s++)for(n in i[s])r=i[s][n],i[s].hasOwnProperty(n)&&void 0!==r&&(t[n]=e.isPlainObject(r)?e.isPlainObject(t[n])?e.widget.extend({},t[n],r):e.widget.extend({},r):r);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(i){var s="string"==typeof i,o=l.call(arguments,1),u=this;return s?this.each(function(){var n,s=e.data(this,r);return"instance"===i?(u=s,!1):s?e.isFunction(s[i])&&"_"!==i.charAt(0)?(n=s[i].apply(s,o),n!==s&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+i+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+i+"'")}):(o.length&&(i=e.widget.extend.apply(null,[i].concat(o))),this.each(function(){var t=e.data(this,r);t?(t.option(i||{}),t._init&&t._init()):e.data(this,r,new n(i,this))})),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=f++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r,i,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},r=t.split("."),t=r.shift(),r.length){for(i=o[t]=e.widget.extend({},this.options[t]),s=0;r.length-1>s;s++)i[r[s]]=i[r[s]]||{},i=i[r[s]];if(t=r.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,n,r){var i,s=this;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){return t||s.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?s[o]:o).apply(s,arguments):void 0}"string"!=typeof o&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(n).undelegate(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];if(r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){"string"==typeof i&&(i={effect:i});var o,u=i?i===!0||"number"==typeof i?n:i.effect||n:t;i=i||{},"number"==typeof i&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.widget;var c=!1;e(document).mouseup(function(){c=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){return!0===e.data(n.target,t.widgetName+".preventClickEvent")?(e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!c){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,r=1===t.which,i="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return r&&!i&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),c=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),c=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,n){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}function r(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var i,s,o=Math.max,u=Math.abs,a=Math.round,f=/left|center|right/,l=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,p=/%$/,d=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==i)return i;var t,n,r=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=r.children()[0];return e("body").append(r),t=s.offsetWidth,r.css("overflow","scroll"),n=s.offsetWidth,t===n&&(n=r[0].clientWidth),r.remove(),i=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth,s="scroll"===r||"auto"===r&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]),i=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:r,isDocument:i,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r||i?n.width():n.outerWidth(),height:r||i?n.height():n.outerHeight()}}},e.fn.position=function(i){if(!i||!i.of)return d.apply(this,arguments);i=e.extend({},i);var p,v,m,g,y,b,w=e(i.of),E=e.position.getWithinInfo(i.within),S=e.position.getScrollInfo(E),x=(i.collision||"flip").split(" "),T={};return b=r(w),w[0].preventDefault&&(i.at="left top"),v=b.width,m=b.height,g=b.offset,y=e.extend({},g),e.each(["my","at"],function(){var e,t,n=(i[this]||"").split(" ");1===n.length&&(n=f.test(n[0])?n.concat(["center"]):l.test(n[0])?["center"].concat(n):["center","center"]),n[0]=f.test(n[0])?n[0]:"center",n[1]=l.test(n[1])?n[1]:"center",e=c.exec(n[0]),t=c.exec(n[1]),T[this]=[e?e[0]:0,t?t[0]:0],i[this]=[h.exec(n[0])[0],h.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===i.at[0]?y.left+=v:"center"===i.at[0]&&(y.left+=v/2),"bottom"===i.at[1]?y.top+=m:"center"===i.at[1]&&(y.top+=m/2),p=t(T.at,v,m),y.left+=p[0],y.top+=p[1],this.each(function(){var r,f,l=e(this),c=l.outerWidth(),h=l.outerHeight(),d=n(this,"marginLeft"),b=n(this,"marginTop"),N=c+d+n(this,"marginRight")+S.width,C=h+b+n(this,"marginBottom")+S.height,L=e.extend({},y),A=t(T.my,l.outerWidth(),l.outerHeight());"right"===i.my[0]?L.left-=c:"center"===i.my[0]&&(L.left-=c/2),"bottom"===i.my[1]?L.top-=h:"center"===i.my[1]&&(L.top-=h/2),L.left+=A[0],L.top+=A[1],s||(L.left=a(L.left),L.top=a(L.top)),r={marginLeft:d,marginTop:b},e.each(["left","top"],function(t,n){e.ui.position[x[t]]&&e.ui.position[x[t]][n](L,{targetWidth:v,targetHeight:m,elemWidth:c,elemHeight:h,collisionPosition:r,collisionWidth:N,collisionHeight:C,offset:[p[0]+A[0],p[1]+A[1]],my:i.my,at:i.at,within:E,elem:l})}),i.using&&(f=function(e){var t=g.left-L.left,n=t+v-c,r=g.top-L.top,s=r+m-h,a={target:{element:w,left:g.left,top:g.top,width:v,height:m},element:{element:l,left:L.left,top:L.top,width:c,height:h},horizontal:0>n?"left":t>0?"right":"center",vertical:0>s?"top":r>0?"bottom":"middle"};c>v&&v>u(t+n)&&(a.horizontal="center"),h>m&&m>u(r+s)&&(a.vertical="middle"),a.important=o(u(t),u(n))>o(u(r),u(s))?"horizontal":"vertical",i.using.call(this,e,a)}),l.offset(e.extend(L,{using:f}))})},e.ui.position={fit:{left:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollLeft:r.offset.left,s=r.width,u=e.left-t.collisionPosition.marginLeft,a=i-u,f=u+t.collisionWidth-s-i;t.collisionWidth>s?a>0&&0>=f?(n=e.left+a+t.collisionWidth-s-i,e.left+=a-n):e.left=f>0&&0>=a?i:a>f?i+s-t.collisionWidth:i:a>0?e.left+=a:f>0?e.left-=f:e.left=o(e.left-u,e.left)},top:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollTop:r.offset.top,s=t.within.height,u=e.top-t.collisionPosition.marginTop,a=i-u,f=u+t.collisionHeight-s-i;t.collisionHeight>s?a>0&&0>=f?(n=e.top+a+t.collisionHeight-s-i,e.top+=a-n):e.top=f>0&&0>=a?i:a>f?i+s-t.collisionHeight:i:a>0?e.top+=a:f>0?e.top-=f:e.top=o(e.top-u,e.top)}},flip:{left:function(e,t){var n,r,i=t.within,s=i.offset.left+i.scrollLeft,o=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,f=e.left-t.collisionPosition.marginLeft,l=f-a,c=f+t.collisionWidth-o-a,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,d=-2*t.offset[0];0>l?(n=e.left+h+p+d+t.collisionWidth-o-s,(0>n||u(l)>n)&&(e.left+=h+p+d)):c>0&&(r=e.left-t.collisionPosition.marginLeft+h+p+d-a,(r>0||c>u(r))&&(e.left+=h+p+d))},top:function(e,t){var n,r,i=t.within,s=i.offset.top+i.scrollTop,o=i.height,a=i.isWindow?i.scrollTop:i.offset.top,f=e.top-t.collisionPosition.marginTop,l=f-a,c=f+t.collisionHeight-o-a,h="top"===t.my[1],p=h?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,d="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,v=-2*t.offset[1];0>l?(r=e.top+p+d+v+t.collisionHeight-o-s,(0>r||u(l)>r)&&(e.top+=p+d+v)):c>0&&(n=e.top-t.collisionPosition.marginTop+p+d+v-a,(n>0||c>u(n))&&(e.top+=p+d+v))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,o,u=document.getElementsByTagName("body")[0],a=document.createElement("div");t=document.createElement(u?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},u&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in r)t.style[o]=r[o];t.appendChild(a),n=u||document.documentElement,n.insertBefore(t,n.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",i=e(a).offset().left,s=i>10&&11>i,t.innerHTML="",n.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,n=this.options,r=n.heightStyle,i=this.element.parent();this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),n=t.uniqueId().attr("id"),r=t.next(),i=r.uniqueId().attr("id");t.attr("aria-controls",i),r.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===r?(t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");"absolute"!==r&&"fixed"!==r&&(t-=n.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===r&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var n={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault(),s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1||(n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-hidden":"true"}),r.prev().attr({"aria-selected":"false","aria-expanded":"false"}),n.length&&r.length?r.prev().attr({tabIndex:-1,"aria-expanded":"false"}):n.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),n.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,n){var r,i,s,o=this,u=0,a=e.css("box-sizing"),f=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},c=f&&l.down||l,h=function(){o._toggleComplete(n)};return"number"==typeof c&&(s=c),"string"==typeof c&&(i=c),i=i||c.easing||l.easing,s=s||c.duration||l.duration,t.length?e.length?(r=e.show().outerHeight(),t.animate(this.hideProps,{duration:s,easing:i,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:s,easing:i,complete:h,step:function(e,n){n.now=Math.round(e),"height"!==n.prop?"content-box"===a&&(u+=n.now):"content"!==o.options.heightStyle&&(n.now=Math.round(r-t.outerHeight()-u),u=0)}}),void 0):t.animate(this.hideProps,s,i,h):e.animate(this.showProps,s,i,h)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var n=e(t.target);!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var n=e(t.currentTarget);n.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var n,r,i,s,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,n=this._filterMenuItems(i),n=s&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),n=this._filterMenuItems(i)),n.length?(this.focus(t,n),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,n,r=this,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),n=t.parent(),r=e("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(r),t.attr("aria-labelledby",n.attr("id"))}),t=s.add(this.element),n=t.find(this.options.items),n.not(".ui-menu-item").each(function(){var t=e(this);r._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),n.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var n,r;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),r=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&e&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.outerHeight(),0>i?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(r="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[t]()),this.focus(n,r)},nextPage:function(t){var n,r,i;return this.active?(this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),0>n.offset().top-r-i}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var n,r,i;return this.active?(this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)},_filterMenuItems:function(t){var n=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return r.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,n,r,i=this.element[0].nodeName.toLowerCase(),s="textarea"===i,o="input"===i;this.isMultiLine=s?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[s||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return t=!0,r=!0,n=!0,void 0;t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault(),void 0;if(!n){var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}}},input:function(e){return r?(r=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target===t.element[0]||r.target===n||e.contains(n,r.target)||t.close()})})},menufocus:function(t,n){var r,i;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(i=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),r=n.item.attr("aria-label")||i.value,r&&e.trim(r).length&&(this.liveRegion.children().hide(),e("<div>").text(r).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),n=this.menu.element.is(":visible"),r=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!n&&!r)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var n=this.menu.element.empty();this._renderMenu(n,t),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").text(n.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(n).appendTo(this.liveRegion))}}),e.ui.autocomplete;var h,p="ui-button ui-widget ui-state-default ui-corner-all",d="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",v=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},m=function(t){var n=t.name,r=t.form,i=e([]);return n&&(n=n.replace(/'/g,"\\'"),i=r?e(r).find("[name='"+n+"'][type=radio]"):e("[name='"+n+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,v),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,n=this.options,r="checkbox"===this.type||"radio"===this.type,i=r?"":"ui-state-active";null===n.label&&(n.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){n.disabled||this===h&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){n.disabled||e(this).removeClass(i)}).bind("click"+this.eventNamespace,function(e){n.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return n.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(n.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var r=t.element[0];m(r).not(r).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return n.disabled?!1:(e(this).addClass("ui-state-active"),h=this,t.document.one("mouseup",function(){h=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return n.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return n.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",n.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+d).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?m(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(d),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),n=this.element.find(this.options.items),r=n.filter(":ui-button");n.not(":ui-button").button(),r.button("refresh"),this.buttons=n.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var g;e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return u(this._defaults,e||{}),this},_attachDatepicker:function(t,n){var r,i,s;r=t.nodeName.toLowerCase(),i="div"===r||"span"===r,t.id||(this.uuid+=1,t.id="dp"+this.uuid),s=this._newInst(e(t),i),s.settings=e.extend({},n||{}),"input"===r?this._connectDatepicker(t,s):i&&this._inlineDatepicker(t,s)},_newInst:function(t,n){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?s(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,n){var r=e(t);n.append=e([]),n.trigger=e([]),r.hasClass(this.markerClassName)||(this._attachments(r,n),r.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(n),e.data(t,"datepicker",n),n.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,n){var r,i,s,o=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),o&&(n.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[u?"before":"after"](n.append)),t.unbind("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),r=this._get(n,"showOn"),("focus"===r||"both"===r)&&t.focus(this._showDatepicker),("button"===r||"both"===r)&&(i=this._get(n,"buttonText"),s=this._get(n,"buttonImage"),n.trigger=e(this._get(n,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:s,alt:i,title:i}):e("<button type='button'></button>").addClass(this._triggerClass).html(s?e("<img/>").attr({src:s,alt:i,title:i}):i)),t[u?"before":"after"](n.trigger),n.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,n,r,i,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(n=0,r=0,i=0;e.length>i;i++)e[i].length>n&&(n=e[i].length,r=i);return r},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(t,n){var r=e(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(n.dpDiv),e.data(t,"datepicker",n),this._setDate(n,this._getDefaultDate(n),!0),this._updateDatepicker(n),this._updateAlternate(n),n.settings.disabled&&this._disableDatepicker(t),n.dpDiv.css("display","block"))},_dialogDatepicker:function(t,n,r,i,s){var o,a,f,l,c,h=this._dialogInst;return h||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),h=this._dialogInst=this._newInst(this._dialogInput,!1),h.settings={},e.data(this._dialogInput[0],"datepicker",h)),u(h.settings,i||{}),n=n&&n.constructor===Date?this._formatDate(h,n):n,this._dialogInput.val(n),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(a=document.documentElement.clientWidth,f=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+l,f/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),h.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",h),this},_destroyDatepicker:function(t){var n,r=e(t),i=e.data(t,"datepicker");r.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===n?(i.append.remove(),i.trigger.remove(),r.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===n||"span"===n)&&r.removeClass(this.markerClassName).empty(),g===i&&(g=null))},_enableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(n){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,n,r){var i,s,o,a,f=this._getInst(t);return 2===arguments.length&&"string"==typeof n?"defaults"===n?e.extend({},e.datepicker._defaults):f?"all"===n?e.extend({},f.settings):this._get(f,n):null:(i=n||{},"string"==typeof n&&(i={},i[n]=r),f&&(this._curInst===f&&this._hideDatepicker(),s=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(f,"min"),a=this._getMinMaxDate(f,"max"),u(f.settings,i),null!==o&&void 0!==i.dateFormat&&void 0===i.minDate&&(f.settings.minDate=this._formatDate(f,o)),null!==a&&void 0!==i.dateFormat&&void 0===i.maxDate&&(f.settings.maxDate=this._formatDate(f,a)),"disabled"in i&&(i.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),f),this._autoSize(f),this._setDate(f,s),this._updateAlternate(f),this._updateDatepicker(f)),void 0)},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var n,r,i,s=e.datepicker._getInst(t.target),o=!0,u=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return i=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",s.dpDiv),i[0]&&e.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),n=e.datepicker._get(s,"onSelect"),n?(r=e.datepicker._formatDate(s),n.apply(s.input?s.input[0]:null,[r,s])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var n,r,i=e.datepicker._getInst(t.target);return e.datepicker._get(i,"constrainInput")?(n=e.datepicker._possibleChars(e.datepicker._get(i,"dateFormat")),r=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">r||!n||n.indexOf(r)>-1):void 0},_doKeyUp:function(t){var n,r=e.datepicker._getInst(t.target);if(r.input.val()!==r.lastVal)try{n=e.datepicker.parseDate(e.datepicker._get(r,"dateFormat"),r.input?r.input.val():null,e.datepicker._getFormatConfig(r)),n&&(e.datepicker._setDateFromField(r),e.datepicker._updateAlternate(r),e.datepicker._updateDatepicker(r))}catch(i){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var n,i,s,o,a,f,l;n=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==n&&(e.datepicker._curInst.dpDiv.stop(!0,!0),n&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),i=e.datepicker._get(n,"beforeShow"),s=i?i.apply(t,[t,n]):{},s!==!1&&(u(n.settings,s),n.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(n),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),a={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(n),a=e.datepicker._checkOffset(n,a,o),n.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),n.inline||(f=e.datepicker._get(n,"showAnim"),l=e.datepicker._get(n,"duration"),n.dpDiv.css("z-index",r(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[f]?n.dpDiv.show(f,e.datepicker._get(n,"showOptions"),l):n.dpDiv[f||"show"](f?l:null),e.datepicker._shouldFocusInput(n)&&n.input.focus(),e.datepicker._curInst=n))}},_updateDatepicker:function(t){this.maxRows=4,g=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var n,r=this._getNumberOfMonths(t),i=r[1],s=17,u=t.dpDiv.find("."+this._dayOverClass+" a");u.length>0&&o.apply(u.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&t.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),t.dpDiv[(1!==r[0]||1!==r[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(n=t.yearshtml,setTimeout(function(){n===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),n=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,n,r){var i=t.dpDiv.outerWidth(),s=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,u=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(r?0:e(document).scrollLeft()),f=document.documentElement.clientHeight+(r?0:e(document).scrollTop());return n.left-=this._get(t,"isRTL")?i-o:0,n.left-=r&&n.left===t.input.offset().left?e(document).scrollLeft():0,n.top-=r&&n.top===t.input.offset().top+u?e(document).scrollTop():0,n.left-=Math.min(n.left,n.left+i>a&&a>i?Math.abs(n.left+i-a):0),n.top-=Math.min(n.top,n.top+s>f&&f>s?Math.abs(s+u):0),n},_findPos:function(t){for(var n,r=this._getInst(t),i=this._get(r,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return n=e(t).offset(),[n.left,n.top]},_hideDatepicker:function(t){var n,r,i,s,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(n=this._get(o,"showAnim"),r=this._get(o,"duration"),i=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[n]||e.effects[n])?o.dpDiv.hide(n,e.datepicker._get(o,"showOptions"),r,i):o.dpDiv["slideDown"===n?"slideUp":"fadeIn"===n?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1,s=this._get(o,"onClose"),s&&s.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var n=e(t.target),r=e.datepicker._getInst(n[0]);(n[0].id!==e.datepicker._mainDivId&&0===n.parents("#"+e.datepicker._mainDivId).length&&!n.hasClass(e.datepicker.markerClassName)&&!n.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||n.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==r)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,n,r){var i=e(t),s=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(s,n+("M"===r?this._get(s,"showCurrentAtPos"):0),r),this._updateDatepicker(s))},_gotoToday:function(t){var n,r=e(t),i=this._getInst(r[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(n=new Date,i.selectedDay=n.getDate(),i.drawMonth=i.selectedMonth=n.getMonth(),i.drawYear=i.selectedYear=n.getFullYear()),this._notifyChange(i),this._adjustDate(r)},_selectMonthYear:function(t,n,r){var i=e(t),s=this._getInst(i[0]);s["selected"+("M"===r?"Month":"Year")]=s["draw"+("M"===r?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(i)},_selectDay:function(t,n,r,i){var s,o=e(t);e(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(s=this._getInst(o[0]),s.selectedDay=s.currentDay=e("a",i).html(),s.selectedMonth=s.currentMonth=n,s.selectedYear=s.currentYear=r,this._selectDate(t,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(t){var n=e(t);this._selectDate(n,"")},_selectDate:function(t,n){var r,i=e(t),s=this._getInst(i[0]);n=null!=n?n:this._formatDate(s),s.input&&s.input.val(n),this._updateAlternate(s),r=this._get(s,"onSelect"),r?r.apply(s.input?s.input[0]:null,[n,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],"object"!=typeof s.input[0]&&s.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var n,r,i,s=this._get(t,"altField");s&&(n=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),i=this.formatDate(n,r,this._getFormatConfig(t)),e(s).each(function(){e(this).val(i)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,n,r){if(null==t||null==n)throw"Invalid arguments";if(n="object"==typeof n?""+n:n+"",""===n)return null;var i,s,o,u,a=0,f=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof f?f:(new Date).getFullYear()%100+parseInt(f,10),c=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,h=(r?r.dayNames:null)||this._defaults.dayNames,p=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,d=(r?r.monthNames:null)||this._defaults.monthNames,v=-1,m=-1,g=-1,y=-1,b=!1,w=function(e){var n=t.length>i+1&&t.charAt(i+1)===e;return n&&i++,n},E=function(e){var t=w(e),r="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,i="y"===e?r:1,s=RegExp("^\\d{"+i+","+r+"}"),o=n.substring(a).match(s);if(!o)throw"Missing number at position "+a;return a+=o[0].length,parseInt(o[0],10)},S=function(t,r,i){var s=-1,o=e.map(w(t)?i:r,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var r=t[1];return n.substr(a,r.length).toLowerCase()===r.toLowerCase()?(s=t[0],a+=r.length,!1):void 0}),-1!==s)return s+1;throw"Unknown name at position "+a},x=function(){if(n.charAt(a)!==t.charAt(i))throw"Unexpected literal at position "+a;a++};for(i=0;t.length>i;i++)if(b)"'"!==t.charAt(i)||w("'")?x():b=!1;else switch(t.charAt(i)){case"d":g=E("d");break;case"D":S("D",c,h);break;case"o":y=E("o");break;case"m":m=E("m");break;case"M":m=S("M",p,d);break;case"y":v=E("y");break;case"@":u=new Date(E("@")),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"!":u=new Date((E("!")-this._ticksTo1970)/1e4),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"'":w("'")?x():b=!0;break;default:x()}if(n.length>a&&(o=n.substr(a),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===v?v=(new Date).getFullYear():100>v&&(v+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=v?0:-100)),y>-1)for(m=1,g=y;;){if(s=this._getDaysInMonth(v,m-1),s>=g)break;m++,g-=s}if(u=this._daylightSavingAdjust(new Date(v,m-1,g)),u.getFullYear()!==v||u.getMonth()+1!==m||u.getDate()!==g)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,n){if(!t)return"";var r,i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=function(t){var n=e.length>r+1&&e.charAt(r+1)===t;return n&&r++,n},f=function(e,t,n){var r=""+t;if(a(e))for(;n>r.length;)r="0"+r;return r},l=function(e,t,n,r){return a(e)?r[t]:n[t]},c="",h=!1;if(t)for(r=0;e.length>r;r++)if(h)"'"!==e.charAt(r)||a("'")?c+=e.charAt(r):h=!1;else switch(e.charAt(r)){case"d":c+=f("d",t.getDate(),2);break;case"D":c+=l("D",t.getDay(),i,s);break;case"o":c+=f("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":c+=f("m",t.getMonth()+1,2);break;case"M":c+=l("M",t.getMonth(),o,u);break;case"y":c+=a("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":a("'")?c+="'":h=!0;break;default:c+=e.charAt(r)}return c},_possibleChars:function(e){var t,n="",r=!1,i=function(n){var r=e.length>t+1&&e.charAt(t+1)===n;return r&&t++,r};for(t=0;e.length>t;t++)if(r)"'"!==e.charAt(t)||i("'")?n+=e.charAt(t):r=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":i("'")?n+="'":r=!0;break;default:n+=e.charAt(t)}return n},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i=this._getDefaultDate(e),s=i,o=this._getFormatConfig(e);try{s=this.parseDate(n,r,o)||i}catch(u){r=t?"":r}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=r?s.getDate():0,e.currentMonth=r?s.getMonth():0,e.currentYear=r?s.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,n,r){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},s=function(n){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),n,e.datepicker._getFormatConfig(t))}catch(r){}for(var i=(n.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),o=i.getMonth(),u=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,f=a.exec(n);f;){switch(f[2]||"d"){case"d":case"D":u+=parseInt(f[1],10);break;case"w":case"W":u+=7*parseInt(f[1],10);break;case"m":case"M":o+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o))}f=a.exec(n)}return new Date(s,o,u)},o=null==n||""===n?r:"string"==typeof n?s(n):"number"==typeof n?isNaN(n)?r:i(n):new Date(n.getTime());return o=o&&"Invalid Date"==""+o?r:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),i===e.selectedMonth&&s===e.selectedYear||n||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var n=this._get(t,"stepMonths"),r="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(r,-n,"M")},next:function(){e.datepicker._adjustDate(r,+n,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(r)},selectDay:function(){return e.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(r,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q=new Date,R=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth(),q.getDate())),U=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),X=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),$=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),K=1!==V[0]||1!==V[1],Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(e,"min"),Y=this._getMinMaxDate(e,"max"),Z=e.drawMonth-$,et=e.drawYear;if(0>Z&&(Z+=12,et--),Y)for(t=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth()-V[0]*V[1]+1,Y.getDate())),t=G&&G>t?G:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,n=this._get(e,"prevText"),n=X?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):n,r=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",i=this._get(e,"nextText"),i=X?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>",o=this._get(e,"currentText"),u=this._get(e,"gotoCurrent")&&e.currentDay?Q:R,o=X?this.formatDate(o,u,this._getFormatConfig(e)):o,a=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",f=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?a:"")+(this._isInRange(e,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":a)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,c=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),d=this._get(e,"monthNames"),v=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),w="",S=0;V[0]>S;S++){for(x="",this.maxRows=4,T=0;V[1]>T;T++){if(N=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),C=" ui-corner-all",k="",K){if(k+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:k+=" ui-datepicker-group-first",C=" ui-corner-"+(U?"right":"left");break;case V[1]-1:k+=" ui-datepicker-group-last",C=" ui-corner-"+(U?"left":"right");break;default:k+=" ui-datepicker-group-middle",C=""}k+="'>"}for(k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===S?U?s:r:"")+(/all|right/.test(C)&&0===S?U?r:s:"")+this._generateMonthYearHeader(e,Z,et,G,Y,S>0||T>0,d,v)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",L=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",E=0;7>E;E++)A=(E+l)%7,L+="<th scope='col'"+((E+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[A]+"'>"+p[A]+"</span></th>";for(k+=L+"</tr></thead><tbody>",O=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),M=(this._getFirstDayOfMonth(et,Z)-l+7)%7,_=Math.ceil((M+O)/7),D=K?this.maxRows>_?this.maxRows:_:_,this.maxRows=D,P=this._daylightSavingAdjust(new Date(et,Z,1-M)),H=0;D>H;H++){for(k+="<tr>",B=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(P)+"</td>":"",E=0;7>E;E++)j=m?m.apply(e.input?e.input[0]:null,[P]):[!0,""],F=P.getMonth()!==Z,I=F&&!y||!j[0]||G&&G>P||Y&&P>Y,B+="<td class='"+((E+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===N.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===P.getTime()&&b.getTime()===N.getTime()?" "+this._dayOverClass:"")+(I?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!g?"":" "+j[1]+(P.getTime()===Q.getTime()?" "+this._currentClass:"")+(P.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(F&&!g||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(I?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!g?"&#xa0;":I?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===R.getTime()?" ui-state-highlight":"")+(P.getTime()===Q.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);k+=B+"</tr>"}Z++,Z>11&&(Z=0,et++),k+="</tbody></table>"+(K?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=k}w+=x}return w+=f,e._keyEvent=!1,w},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",w="";if(s||!m)w+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(a=r&&r.getFullYear()===n,f=i&&i.getFullYear()===n,w+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;12>l;l++)(!a||l>=r.getMonth())&&(!f||i.getMonth()>=l)&&(w+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+u[l]+"</option>");w+="</select>"}if(y||(b+=w+(!s&&m&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",s||!g)b+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(c=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},d=p(c[0]),v=Math.max(d,p(c[1]||"")),d=r?Math.max(d,r.getFullYear()):d,v=i?Math.min(v,i.getFullYear()):v,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";v>=d;d++)e.yearshtml+="<option value='"+d+"'"+(d===n?" selected='selected'":"")+">"+d+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!s&&m&&g?"":"&#xa0;")+w),b+="</div>"},_adjustInstDate:function(e,t,n){var r=e.drawYear+("Y"===n?t:0),i=e.drawMonth+("M"===n?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+("D"===n?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===n||"Y"===n)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&n>t?n:t;return r&&i>r?r:i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(0>t?t:i[0]*i[1]),1));return 0>t&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,r,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,u=null,a=this._get(e,"yearRange");return a&&(n=a.split(":"),r=(new Date).getFullYear(),o=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!u||u>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(n)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=this.document[0];if(this.handleElement.is(t.target))try{n.activeElement&&"body"!==n.activeElement.nodeName.toLowerCase()&&e(n.activeElement).blur()}catch(r){}},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!r||"valid"===this.options.revert&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper),i=r?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),r&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];return this.relativeContainer=null,i.containment?"window"===i.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===i.containment?(this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):i.containment.constructor===Array?(this.containment=i.containment,void 0):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0],r&&(t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,r,i,s,o=this.options,u=this._isRootNode(this.scrollParent[0]),a=e.pageX,f=e.pageY;return u&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),"y"===o.axis&&(a=this.originalPageX),"x"===o.axis&&(f=this.originalPageY)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:u?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:u?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=e.extend({},n,{item:r.element});r.sortables=[],e(r.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(r.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,i))})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});r.cancelHelperRemoval=!1,e.each(r.sortables,function(){var e=this;e.isOver?(e.isOver=0,r.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(t,n,r){e.each(r.sortables,function(){var i=!1,s=this;s.positionAbs=r.positionAbs,s.helperProportions=r.helperProportions,s.offset.click=r.offset.click,s._intersectsWith(s.containerCache)&&(i=!0,e.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&e.contains(s.element[0],this.element[0])&&(i=!1),i})),i?(s.isOver||(s.isOver=1,r._parent=n.helper.parent(),s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return n.helper[0]},t.target=s.currentItem[0],s._mouseCapture(t,!0),s._mouseStart(t,!0,!0),s.offset.click.top=r.offset.click.top,s.offset.click.left=r.offset.click.left,s.offset.parent.left-=r.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=r.offset.parent.top-s.offset.parent.top,r._trigger("toSortable",t),r.dropped=s.element,e.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,s.fromOutside=r),s.currentItem&&(s._mouseDrag(t),n.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",t,s._uiHash(s)),s._mouseStop(t,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),n.helper.appendTo(r._parent),r._refreshOffsets(t),n.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,e.each(r.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity")),i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.scrollParentNotHidden[0],u=r.document[0];o!==u&&"HTML"!==o.tagName?(i.axis&&"x"===i.axis||(r.overflowOffset.top+o.offsetHeight-t.pageY<i.scrollSensitivity?o.scrollTop=s=o.scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(o.scrollTop=s=o.scrollTop-i.scrollSpeed)),i.axis&&"y"===i.axis||(r.overflowOffset.left+o.offsetWidth-t.pageX<i.scrollSensitivity?o.scrollLeft=s=o.scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(o.scrollLeft=s=o.scrollLeft-i.scrollSpeed))):(i.axis&&"x"===i.axis||(t.pageY-e(u).scrollTop()<i.scrollSensitivity?s=e(u).scrollTop(e(u).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(u).scrollTop())<i.scrollSensitivity&&(s=e(u).scrollTop(e(u).scrollTop()+i.scrollSpeed))),i.axis&&"y"===i.axis||(t.pageX-e(u).scrollLeft()<i.scrollSensitivity?s=e(u).scrollLeft(e(u).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(u).scrollLeft())<i.scrollSensitivity&&(s=e(u).scrollLeft(e(u).scrollLeft()+i.scrollSpeed)))),s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--)a=r.snapElements[h].left-r.margins.left,f=a+r.snapElements[h].width,l=r.snapElements[h].top-r.margins.top,c=l+r.snapElements[h].height,a-v>g||m>f+v||l-v>b||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)?(r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=!1):("inner"!==d.snapMode&&(i=v>=Math.abs(l-b),s=v>=Math.abs(c-y),o=v>=Math.abs(a-g),u=v>=Math.abs(f-m),i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left)),p=i||s||o||u,"outer"!==d.snapMode&&(i=v>=Math.abs(l-y),s=v>=Math.abs(c-b),o=v>=Math.abs(a-m),u=v>=Math.abs(f-g),i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left)),!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=i||s||o||u||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});o.length&&(i=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",i+t)}),this.css("zIndex",i+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex")),i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,n){if("hidden"===e(t).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},_create:function(){var t,n,r,i,s,o=this,u=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!u.aspectRatio,aspectRatio:u.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:u.helper||u.ghost||u.animate?u.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=u.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},n=0;t.length>n;n++)r=e.trim(t[n]),s="ui-resizable-"+r,i=e("<div class='ui-resizable-handle "+s+"'></div>"),i.css({zIndex:u.zIndex}),"se"===r&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[r]=".ui-resizable-"+r,this.element.append(i);this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles)this.handles[n].constructor===String?this.handles[n]=this.element.children(this.handles[n]).first().show():(this.handles[n].jquery||this.handles[n].nodeType)&&(this.handles[n]=e(this.handles[n]),this._on(this.handles[n],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),u.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){u.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){u.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles)r=e(this.handles[n])[0],(r===t.target||e.contains(r,t.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var n,r,i,s=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),r=this._num(this.helper.css("top")),s.containment&&(n+=e(s.containment).scrollLeft()||0,r+=e(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:r},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:n,top:r},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===i?this.axis+"-resize":i),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r,i=this.originalMousePosition,s=this.axis,o=t.pageX-i.left||0,u=t.pageY-i.top||0,a=this._change[s];return this._updatePrevProperties(),a?(n=a.apply(this,[t,o,u]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(n=this._updateRatio(n,t)),n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&this._hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null,a=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,r,i,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,i=s.maxWidth/this.aspectRatio,t>s.minWidth&&(s.minWidth=t),r>s.minHeight&&(s.minHeight=r),s.maxWidth>n&&(s.maxWidth=n),s.maxHeight>i&&(s.maxHeight=i)),this._vBoundaries=s},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,r=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===r&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===r&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,r=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,i=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,s=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,u=this.originalPosition.left+this.originalSize.width,a=this.position.top+this.size.height,f=/sw|nw|w/.test(n),l=/nw|ne|n/.test(n);return s&&(e.width=t.minWidth),o&&(e.height=t.minHeight),r&&(e.width=t.maxWidth),i&&(e.height=t.maxHeight),s&&f&&(e.left=u-t.minWidth),r&&f&&(e.left=u-t.maxWidth),o&&l&&(e.top=a-t.minHeight),i&&l&&(e.top=a-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,n=[],r=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],i=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)n[t]=parseInt(r[t],10)||0,n[t]+=parseInt(i[t],10)||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,n=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),"resize"!==t&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).resizable("instance"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&n._hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left)||null,l=parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,r,i,s,o,u,a=e(this).resizable("instance"),f=a.options,l=a.element,c=f.containment,h=c instanceof e?c.get(0):/parent/.test(c)?l.parent().get(0):c;h&&(a.containerElement=e(h),/document/.test(c)||c===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(h),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,r){n[e]=a._num(t.css("padding"+r))}),a.containerOffset=t.offset(),a.containerPosition=t.position(),a.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},r=a.containerOffset,i=a.containerSize.height,s=a.containerSize.width,o=a._hasScroll(h,"left")?h.scrollWidth:s,u=a._hasScroll(h)?h.scrollHeight:i,a.parentData={element:h,left:r.left,top:r.top,width:o,height:u}))},resize:function(t){var n,r,i,s,o=e(this).resizable("instance"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement,p=!0;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?a.top:0),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),n=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-a.left)),r=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-a.top)),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),n=t.options;e(n.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,n){var r=e(this).resizable("instance"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0};e(i.alsoResize).each(function(){var t=e(this),r=e(this).data("ui-resizable-alsoresize"),i={},s=t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(s,function(e,t){var n=(r[t]||0)+(u[t]||0);n&&n>=0&&(i[t]=n||null)}),t.css(i)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),n=t.options,r=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:r.height,width:r.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof n.ghost?n.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,n=e(this).resizable("instance"),r=n.options,i=n.size,s=n.originalSize,o=n.originalPosition,u=n.axis,a="number"==typeof r.grid?[r.grid,r.grid]:r.grid,f=a[0]||1,l=a[1]||1,c=Math.round((i.width-s.width)/f)*f,h=Math.round((i.height-s.height)/l)*l,p=s.width+c,d=s.height+h,v=r.maxWidth&&p>r.maxWidth,m=r.maxHeight&&d>r.maxHeight,g=r.minWidth&&r.minWidth>p,y=r.minHeight&&r.minHeight>d;r.grid=a,g&&(p+=f),y&&(d+=l),v&&(p-=f),m&&(d-=l),/^(se|s|e)$/.test(u)?(n.size.width=p,n.size.height=d):/^(ne)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.top=o.top-h):/^(sw)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.left=o.left-c):((0>=d-l||0>=p-f)&&(t=n._getPaddingPlusBorderDimensions(this)),d-l>0?(n.size.height=d,n.position.top=o.top-h):(d=l-t.height,n.size.height=d,n.position.top=o.top+s.height-d),p-f>0?(n.size.width=p,n.position.left=o.left-c):(p=f-t.width,n.size.width=p,n.position.left=o.left+s.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;0>n&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n,r=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{n=this.document[0].activeElement,n&&"body"!==n.nodeName.toLowerCase()&&e(n).blur()}catch(i){}this._hide(this.uiDialog,this.options.hide,function(){r._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,n){var r=!1,i=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),s=Math.max.apply(null,i);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),r=!0),r&&!n&&this._trigger("focus",t),r},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function n(){var t=this.document[0].activeElement,n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==r[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){i.focus()}),t.preventDefault()):(this._delay(function(){r.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(n)||e.isArray(n)&&!n.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,r.click=function(){i.apply(t.element[0],arguments)},s={icons:r.icons,text:r.showText},delete r.icons,delete r.showText,e("<button></button>",r).button(s).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var n=this,r=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,i){e(this).addClass("ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",r,t(i))},drag:function(e,r){n._trigger("drag",e,t(r))},stop:function(i,s){var o=s.offset.left-n.document.scrollLeft(),u=s.offset.top-n.document.scrollTop();r.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(u>=0?"+":"")+u,of:n.window},e(this).removeClass("ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",i,t(s))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var n=this,r=this.options,i=r.resizable,s=this.uiDialog.css("position"),o="string"==typeof i?i:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:r.maxWidth,maxHeight:r.maxHeight,minWidth:r.minWidth,minHeight:this._minHeight(),handles:o,start:function(r,i){e(this).addClass("ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",r,t(i))},resize:function(e,r){n._trigger("resize",e,t(r))},stop:function(i,s){var o=n.uiDialog.offset(),u=o.left-n.document.scrollLeft(),a=o.top-n.document.scrollTop();r.height=n.uiDialog.height(),r.width=n.uiDialog.width(),r.position={my:"left top",at:"left"+(u>=0?"+":"")+u+" "+"top"+(a>=0?"+":"")+a,of:n.window},e(this).removeClass("ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",i,t(s))}}).css("position",s)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),n=e.inArray(this,t);-1!==n&&t.splice(n,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var n=this,r=!1,i={};e.each(t,function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(r=!0),e in n.resizableRelatedOptions&&(i[e]=t)}),r&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",i)},_setOption:function(e,t){var n,r,i=this.uiDialog;"dialogClass"===e&&i.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(n=i.is(":data(ui-draggable)"),n&&!t&&i.draggable("destroy"),!n&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&"string"==typeof t&&i.resizable("option","handles",t),r||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n="number"==typeof r.maxHeight?Math.max(0,r.maxHeight-e):"none","auto"===r.height?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,n=this.options,r=n.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(r)?r:function(e){return e.is(r)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(n.scope),n.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){if("accept"===t)this.accept=e.isFunction(n)?n:function(e){return e.is(n)};else if("scope"===t){var r=e.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return r&&(r.currentItem||r.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var n=e(this).droppable("instance");return n.options.greedy&&!n.options.disabled&&n.options.scope===r.options.scope&&n.accept.call(n.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t)?(i=!0,!1):void 0}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,n){return e>=t&&t+n>e}return function(t,n,r,i){if(!n.offset)return!1;var s=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,u=s+t.helperProportions.width,a=o+t.helperProportions.height,f=n.offset.left,l=n.offset.top,c=f+n.proportions().width,h=l+n.proportions().height;switch(r){case"fit":return s>=f&&c>=u&&o>=l&&h>=a;case"intersect":return s+t.helperProportions.width/2>f&&c>u-t.helperProportions.width/2&&o+t.helperProportions.height/2>l&&h>a-t.helperProportions.height/2;case"pointer":return e(i.pageY,l,n.proportions().height)&&e(i.pageX,f,n.proportions().width);case"touch":return(o>=l&&h>=o||a>=l&&h>=a||l>o&&a>h)&&(s>=f&&c>=s||u>=f&&c>=u||f>s&&u>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;s.length>r;r++)if(!(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))){for(i=0;u.length>i;i++)if(u[i]===s[r].element[0]){s[r].proportions().height=0;continue e}s[r].visible="none"!==s[r].element.css("display"),s[r].visible&&("mousedown"===o&&s[r]._activate.call(s[r],n),s[r].offset=s[r].element.offset(),s[r].proportions({width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight}))}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,n)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,i,s,o=e.ui.intersect(t,this,this.options.tolerance,n),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;u&&(this.options.greedy&&(i=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===i}),s.length&&(r=e(s[0]).droppable("instance"),r.greedyChild="isover"===u)),r&&"isover"===u&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[u]=!0,this["isout"===u?"isover":"isout"]=!1,this["isover"===u?"_over":"_out"].call(this,n),r&&"isout"===u&&(r.isout=!1,r.isover=!0,r._over.call(r,n)))}})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function n(e,t,n){var r=c[t.type]||{};return null==e?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:e>r.max?r.max:e)}function r(n){var r=f(),i=r._rgba=[];return n=n.toLowerCase(),d(a,function(e,s){var o,u=s.re.exec(n),a=u&&s.parse(u),f=s.space||"rgba";return a?(o=r[f](a),r[l[f].cache]=o[l[f].cache],i=r._rgba=o._rgba,!1):t}),i.length?("0,0,0,0"===i.join()&&e.extend(i,s.transparent),r):s[n]}function i(e,t,n){return n=(n+1)%1,1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+6*(t-e)*(2/3-n):e}var s,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",u=/^([\-+])=\s*(\d+\.?\d*)/,a=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],f=e.Color=function(t,n,r,i){return new e.Color.fn.parse(t,n,r,i)},l={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=f.support={},p=e("<p>")[0],d=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=p.style.backgroundColor.indexOf("rgba")>-1,d(l,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),f.fn=e.extend(f.prototype,{parse:function(i,o,u,a){if(i===t)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=e(i).css(o),o=t);var c=this,h=e.type(i),p=this._rgba=[];return o!==t&&(i=[i,o,u,a],h="array"),"string"===h?this.parse(r(i)||s._default):"array"===h?(d(l.rgba.props,function(e,t){p[t.idx]=n(i[t.idx],t)}),this):"object"===h?(i instanceof f?d(l,function(e,t){i[t.cache]&&(c[t.cache]=i[t.cache].slice())}):d(l,function(t,r){var s=r.cache;d(r.props,function(e,t){if(!c[s]&&r.to){if("alpha"===e||null==i[e])return;c[s]=r.to(c._rgba)}c[s][t.idx]=n(i[e],t,!0)}),c[s]&&0>e.inArray(null,c[s].slice(0,3))&&(c[s][3]=1,r.from&&(c._rgba=r.from(c[s])))}),this):t},is:function(e){var n=f(e),r=!0,i=this;return d(l,function(e,s){var o,u=n[s.cache];return u&&(o=i[s.cache]||s.to&&s.to(i._rgba)||[],d(s.props,function(e,n){return null!=u[n.idx]?r=u[n.idx]===o[n.idx]:t})),r}),r},_space:function(){var e=[],t=this;return d(l,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var r=f(e),i=r._space(),s=l[i],o=0===this.alpha()?f("transparent"):this,u=o[s.cache]||s.to(o._rgba),a=u.slice();return r=r[s.cache],d(s.props,function(e,i){var s=i.idx,o=u[s],f=r[s],l=c[i.type]||{};null!==f&&(null===o?a[s]=f:(l.mod&&(f-o>l.mod/2?o+=l.mod:o-f>l.mod/2&&(o-=l.mod)),a[s]=n((f-o)*t+o,i)))}),this[i](a)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),r=n.pop(),i=f(t)._rgba;return f(e.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop();return t&&n.push(~~(255*r)),"#"+e.map(n,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,l.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=e[3],u=Math.max(r,i,s),a=Math.min(r,i,s),f=u-a,l=u+a,c=.5*l;return t=a===u?0:r===u?60*(i-s)/f+360:i===u?60*(s-r)/f+120:60*(r-i)/f+240,n=0===f?0:.5>=c?f/l:f/(2-l),[Math.round(t)%360,n,c,null==o?1:o]},l.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],s=e[3],o=.5>=r?r*(1+n):r+n-r*n,u=2*r-o;return[Math.round(255*i(u,o,t+1/3)),Math.round(255*i(u,o,t)),Math.round(255*i(u,o,t-1/3)),s]},d(l,function(r,i){var s=i.props,o=i.cache,a=i.to,l=i.from;f.fn[r]=function(r){if(a&&!this[o]&&(this[o]=a(this._rgba)),r===t)return this[o].slice();var i,u=e.type(r),c="array"===u||"object"===u?r:arguments,h=this[o].slice();return d(s,function(e,t){var r=c["object"===u?e:t.idx];null==r&&(r=h[t.idx]),h[t.idx]=n(r,t)}),l?(i=f(l(h)),i[o]=h,i):f(h)},d(s,function(t,n){f.fn[t]||(f.fn[t]=function(i){var s,o=e.type(i),a="alpha"===t?this._hsla?"hsla":"rgba":r,f=this[a](),l=f[n.idx];return"undefined"===o?l:("function"===o&&(i=i.call(this,l),o=e.type(i)),null==i&&n.empty?this:("string"===o&&(s=u.exec(i),s&&(i=l+parseFloat(s[2])*("+"===s[1]?1:-1))),f[n.idx]=i,this[a](f)))})})}),f.hook=function(t){var n=t.split(" ");d(n,function(t,n){e.cssHooks[n]={set:function(t,i){var s,o,u="";if("transparent"!==i&&("string"!==e.type(i)||(s=r(i)))){if(i=f(s||i),!h.rgba&&1!==i._rgba[3]){for(o="backgroundColor"===n?t.parentNode:t;(""===u||"transparent"===u)&&o&&o.style;)try{u=e.css(o,"backgroundColor"),o=o.parentNode}catch(a){}i=i.blend(u&&"transparent"!==u?u:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(a){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=f(t.elem,n),t.end=f(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},f.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return d(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},s=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var n,r,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,s={};if(i&&i.length&&i[0]&&i[i[0]])for(r=i.length;r--;)n=i[r],"string"==typeof i[n]&&(s[e.camelCase(n)]=i[n]);else for(n in i)"string"==typeof i[n]&&(s[n]=i[n]);return s}function n(t,n){var r,s,o={};for(r in n)s=n[r],t[r]!==s&&(i[r]||(e.fx.step[r]||!isNaN(parseFloat(s)))&&(o[r]=s));return o}var r=["add","remove","toggle"],i={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,n,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(i,s,o,u){var a=e.speed(s,o,u);return this.queue(function(){var s,o=e(this),u=o.attr("class")||"",f=a.children?o.find("*").addBack():o;f=f.map(function(){var n=e(this);return{el:n,start:t(this)}}),s=function(){e.each(r,function(e,t){i[t]&&o[t+"Class"](i[t])})},s(),f=f.map(function(){return this.end=t(this.el[0]),this.diff=n(this.start,this.end),this}),o.attr("class",u),f=f.map(function(){var t=this,n=e.Deferred(),r=e.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){s(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(n,r,i,s){return r?e.effects.animateClass.call(this,{add:n},r,i,s):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(n,r,i,s){return arguments.length>1?e.effects.animateClass.call(this,{remove:n},r,i,s):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(n,r,i,s,o){return"boolean"==typeof r||void 0===r?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},r,i,s)}}(e.fn.toggleClass),switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function t(t,n,r,i){return e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},null==n&&(n={}),e.isFunction(n)&&(i=n,r=null,n={}),("number"==typeof n||e.fx.speeds[n])&&(i=r,r=n,n={}),e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:"number"==typeof r?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function n(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var n=0;t.length>n;n++)null!==t[n]&&e.data(y+t[n],e[0].style[t[n]])},restore:function(e,t){var n,r;for(r=0;t.length>r;r++)null!==t[r]&&(n=e.data(y+t[r]),void 0===n&&(n=""),e.css(t[r],n))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),"static"===t.css("position")?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function n(t){function n(){e.isFunction(s)&&s.call(i[0]),e.isFunction(t)&&t()}var i=e(this),s=r.complete,u=r.mode;(i.is(":hidden")?"hide"===u:"show"===u)?(i[u](),n()):o.call(i[0],r,n)}var r=t.apply(this,arguments),i=r.mode,s=r.queue,o=e.effects.effect[r.effect];return e.fx.off||!o?i?this[i](r.duration,r.complete):this.each(function(){r.complete&&r.complete.call(this)}):s===!1?this.each(n):this.queue(s||"fx",n)},show:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(e.fn.show),hide:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(e.fn.hide),toggle:function(e){return function(r){if(n(r)||"boolean"==typeof r)return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(e.fn.toggle),cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,n=4;((t=Math.pow(2,--n))-1)/11>e;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?n(2*e)/2:1-n(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,n){var r,i,s,o=e(this),u=/up|down|vertical/,a=/up|left|vertical|horizontal/,f=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(o,t.mode||"hide"),c=t.direction||"up",h=u.test(c),p=h?"height":"width",d=h?"top":"left",v=a.test(c),m={},g="show"===l;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),f):e.effects.save(o,f),o.show(),r=e.effects.createWrapper(o).css({overflow:"hidden"}),i=r[p](),s=parseFloat(r.css(d))||0,m[p]=g?i:0,v||(o.css(h?"bottom":"right",0).css(h?"top":"left","auto").css({position:"absolute"}),m[d]=g?s:i+s),g&&(r.css(p,0),v||r.css(d,s+i)),r.animate(m,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===l&&o.hide(),e.effects.restore(o,f),e.effects.removeWrapper(o),n()}})},e.effects.effect.bounce=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","height","width"],a=e.effects.setMode(o,t.mode||"effect"),f="hide"===a,l="show"===a,c=t.direction||"up",h=t.distance,p=t.times||5,d=2*p+(l||f?1:0),v=t.duration/d,m=t.easing,g="up"===c||"down"===c?"top":"left",y="up"===c||"left"===c,b=o.queue(),w=b.length;for((l||f)&&u.push("opacity"),e.effects.save(o,u),o.show(),e.effects.createWrapper(o),h||(h=o["top"===g?"outerHeight":"outerWidth"]()/3),l&&(s={opacity:1},s[g]=0,o.css("opacity",0).css(g,y?2*-h:2*h).animate(s,v,m)),f&&(h/=Math.pow(2,p-1)),s={},s[g]=0,r=0;p>r;r++)i={},i[g]=(y?"-=":"+=")+h,o.animate(i,v,m).animate(s,v,m),h=f?2*h:h/2;f&&(i={opacity:0},i[g]=(y?"-=":"+=")+h,o.animate(i,v,m)),o.queue(function(){f&&o.hide(),e.effects.restore(o,u),e.effects.removeWrapper(o),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,d+1))),o.dequeue()},e.effects.effect.clip=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","height","width"],a=e.effects.setMode(o,t.mode||"hide"),f="show"===a,l=t.direction||"vertical",c="vertical"===l,h=c?"height":"width",p=c?"top":"left",d={};e.effects.save(o,u),o.show(),r=e.effects.createWrapper(o).css({overflow:"hidden"}),i="IMG"===o[0].tagName?r:o,s=i[h](),f&&(i.css(h,0),i.css(p,s/2)),d[h]=f?s:0,d[p]=f?0:s/2,i.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){f||o.hide(),e.effects.restore(o,u),e.effects.removeWrapper(o),n()}})},e.effects.effect.drop=function(t,n){var r,i=e(this),s=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(i,t.mode||"hide"),u="show"===o,a=t.direction||"left",f="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a?"pos":"neg",c={opacity:u?1:0};e.effects.save(i,s),i.show(),e.effects.createWrapper(i),r=t.distance||i["top"===f?"outerHeight":"outerWidth"](!0)/2,u&&i.css("opacity",0).css(f,"pos"===l?-r:r),c[f]=(u?"pos"===l?"+=":"-=":"pos"===l?"-=":"+=")+r,i.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&i.hide(),e.effects.restore(i,s),e.effects.removeWrapper(i),n()}})},e.effects.effect.explode=function(t,n){function r(){b.push(this),b.length===c*h&&i()}function i(){p.css({visibility:"visible"}),e(b).remove(),v||p.hide(),n()}var s,o,u,a,f,l,c=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=c,p=e(this),d=e.effects.setMode(p,t.mode||"hide"),v="show"===d,m=p.show().css("visibility","hidden").offset(),g=Math.ceil(p.outerWidth()/h),y=Math.ceil(p.outerHeight()/c),b=[];for(s=0;c>s;s++)for(a=m.top+s*y,l=s-(c-1)/2,o=0;h>o;o++)u=m.left+o*g,f=o-(h-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*g,top:-s*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:y,left:u+(v?f*g:0),top:a+(v?l*y:0),opacity:v?0:1}).animate({left:u+(v?0:f*g),top:a+(v?0:l*y),opacity:v?1:0},t.duration||500,t.easing,r)},e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})},e.effects.effect.fold=function(t,n){var r,i,s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a="show"===u,f="hide"===u,l=t.size||15,c=/([0-9]+)%/.exec(l),h=!!t.horizFirst,p=a!==h,d=p?["width","height"]:["height","width"],v=t.duration/2,m={},g={};e.effects.save(s,o),s.show(),r=e.effects.createWrapper(s).css({overflow:"hidden"}),i=p?[r.width(),r.height()]:[r.height(),r.width()],c&&(l=parseInt(c[1],10)/100*i[f?0:1]),a&&r.css(h?{height:0,width:l}:{height:l,width:0}),m[d[0]]=a?i[0]:l,g[d[1]]=a?i[1]:0,r.animate(m,v,t.easing).animate(g,v,t.easing,function(){f&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),n()})},e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};"hide"===s&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===s&&r.hide(),e.effects.restore(r,i),n()}})},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||"effect"!==p,v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||("show"===p?b:r),o.to=t.to||("hide"===p?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}},("box"===v||"both"===v)&&(s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to))),("content"===v||"both"===v)&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from),("content"===v||"both"===v)&&(c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),d||("static"===g?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return"auto"===n?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===s?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:"horizontal"!==u?o/100:1,x:"vertical"!==u?o/100:1};i.effect="size",i.queue=!1,i.complete=n,"effect"!==s&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||("show"===s?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&("show"===s&&(i.from.opacity=0,i.to.opacity=1),"hide"===s&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s="hide"===i,o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.pulsate=function(t,n){var r,i=e(this),s=e.effects.setMode(i,t.mode||"show"),o="show"===s,u="hide"===s,a=o||"hide"===s,f=2*(t.times||5)+(a?1:0),l=t.duration/f,c=0,h=i.queue(),p=h.length;for((o||!i.is(":visible"))&&(i.css("opacity",0).show(),c=1),r=1;f>r;r++)i.animate({opacity:c},l,t.easing),c=1-c;i.animate({opacity:c},l,t.easing),i.queue(function(){u&&i.hide(),n()}),p>1&&h.splice.apply(h,[1,0].concat(h.splice(p,f+1))),i.dequeue()},e.effects.effect.shake=function(t,n){var r,i=e(this),s=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(i,t.mode||"effect"),u=t.direction||"left",a=t.distance||20,f=t.times||3,l=2*f+1,c=Math.round(t.duration/l),h="up"===u||"down"===u?"top":"left",p="up"===u||"left"===u,d={},v={},m={},g=i.queue(),y=g.length;for(e.effects.save(i,s),i.show(),e.effects.createWrapper(i),d[h]=(p?"-=":"+=")+a,v[h]=(p?"+=":"-=")+2*a,m[h]=(p?"-=":"+=")+2*a,i.animate(d,c,t.easing),r=1;f>r;r++)i.animate(v,c,t.easing).animate(m,c,t.easing);i.animate(v,c,t.easing).animate(d,c/2,t.easing).queue(function(){"hide"===o&&i.hide(),e.effects.restore(i,s),e.effects.removeWrapper(i),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,l+1))),i.dequeue()},e.effects.effect.slide=function(t,n){var r,i=e(this),s=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(i,t.mode||"show"),u="show"===o,a=t.direction||"left",f="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a,c={};e.effects.save(i,s),i.show(),r=t.distance||i["top"===f?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(i).css({overflow:"hidden"}),u&&i.css(f,l?isNaN(r)?"-"+r:-r:r),c[f]=(u?l?"+=":"-=":l?"-=":"+=")+r,i.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&i.hide(),e.effects.restore(i,s),e.effects.removeWrapper(i),n()}})},e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s="fixed"===i.css("position"),o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(n.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,n=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(n.options.filter,n.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this,r=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,t.metaKey||t.ctrlKey||(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().addBack().each(function(){var r,i=e.data(this,"selectable-item");return i?(r=!t.metaKey&&!t.ctrlKey||!i.$element.hasClass("ui-selected"),i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",t,{selecting:i.element}):n._trigger("unselecting",t,{unselecting:i.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var n,r=this,i=this.options,s=this.opos[0],o=this.opos[1],u=t.pageX,a=t.pageY;return s>u&&(n=u,u=s,s=n),o>a&&(n=a,a=o,o=n),this.helper.css({left:s,top:o,width:u-s,height:a-o}),this.selectees.each(function(){var n=e.data(this,"selectable-item"),f=!1;n&&n.element!==r.element[0]&&("touch"===i.tolerance?f=!(n.left>u||s>n.right||n.top>a||o>n.bottom):"fit"===i.tolerance&&(f=n.left>s&&u>n.right&&n.top>o&&a>n.bottom),f?(n.selected&&(n.$element.removeClass("ui-selected"),n.selected=!1),n.unselecting&&(n.$element.removeClass("ui-unselecting"),n.unselecting=!1),n.selecting||(n.$element.addClass("ui-selecting"),n.selecting=!0,r._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.$element.addClass("ui-selected"),n.selected=!0):(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.startselected&&(n.$element.addClass("ui-unselecting"),n.unselecting=!0),r._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&(t.metaKey||t.ctrlKey||n.startselected||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,r._trigger("unselecting",t,{unselecting:n.element})))))}),!1}},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,n){e.preventDefault(),t._setSelection(),t._select(n.item.data("ui-selectmenu-item"),e)},focus:function(e,n){var r=n.item.data("ui-selectmenu-item");null!=t.focusIndex&&r.index!==t.focusIndex&&(t._trigger("focus",e,{item:r}),t.isOpen||t._select(r,e)),t.focusIndex=r.index,t.button.attr("aria-activedescendant",t.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,n){var r=this,i="";e.each(n,function(n,s){s.optgroup!==i&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(s.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:s.optgroup}).appendTo(t),i=s.optgroup),r._renderItemData(t,s)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,n){var r=e("<li>");return n.disabled&&r.addClass("ui-state-disabled"),this._setText(r,n.label),r.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var n,r,i=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex):(n=this.menuItems.eq(this.element[0].selectedIndex),i+=":not(.ui-state-disabled)"),r="first"===e||"last"===e?n["first"===e?"prevAll":"nextAll"](i).eq(-1):n[e+"All"](i).eq(0),r.length&&this.menuInstance.focus(t,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var n=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),n=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),n=!1}n&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==n&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var n=[];t.each(function(t,r){var i=e(r),s=i.parent("optgroup");n.push({element:i,index:t,value:i.val(),label:i.text(),optgroup:s.attr("label")||"",disabled:s.prop("disabled")||i.prop("disabled")})}),this.items=n},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,n,r=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(n=r.values&&r.values.length||1,i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;n>t;t++)o.push(s);this.handles=i.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,n="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),n="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(n+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));(i>n||i===n&&(t===l._lastChangedValue||l.values(t)===c.min))&&(i=n,s=e(this),o=t)}),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return"horizontal"===this.orientation?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),0>r&&(r=0),"vertical"===this.orientation&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&n>r||1===t&&r>n)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,n)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,n){var r,i,s;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(r=this.options.values,i=arguments[0],s=0;r.length>s;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;switch("range"===t&&this.options.range===!0&&("min"===n?(this.options.value=this._values(0),this.options.values=null):"max"===n&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(i=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!n),this._super(t,n),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===n?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),r=0;i>r;r+=1)this._change(null,r);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(n=this.options.values.slice(),r=0;n.length>r;r+=1)n[r]=this._trimAlignValue(n[r]);return n}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return 2*Math.abs(n)>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),n=this.options.step,r=Math.floor(+(e-t).toFixed(this._precision())/n)*n;e=r+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=100*((a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())),l["horizontal"===a.orientation?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&("horizontal"===a.orientation?(0===r&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(0===r&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?100*((r-i)/(s-i)):0,l["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),"max"===o&&"horizontal"===this.orientation&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),"max"===o&&"vertical"===this.orientation&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))},_handleEvents:{keydown:function(t){var n,r,i,s,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),n=this._start(t,o),n===!1))return}switch(s=this.options.step,r=i=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:i=this._valueMin();break;case e.ui.keyCode.END:i=this._valueMax();break;case e.ui.keyCode.PAGE_UP:i=this._trimAlignValue(r+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(r-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(r===this._valueMax())return;i=this._trimAlignValue(r+s);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(r===this._valueMin())return;i=this._trimAlignValue(r-s)}this._slide(t,o,i)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return e>=t&&t+n>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var r=null,i=!1,s=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,s.widgetName+"-item")===s?(r=e(this),!1):void 0}),e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target)),r?!this.options.handle||n||(e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)}),i)?(this.currentItem=r,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,n,r){var i,s,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(s=this.document.find("body"),this.storedCursor=s.css("cursor"),s.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?u=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(u=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?u=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(u=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(r=this.items[n],i=r.item[0],s=this._intersectsWithPointer(r),s&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===s?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],i):!0)){if(this.direction=1===s?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(t,r),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var r=this,i=this.placeholder.offset(),s=this.options.axis,o={};s&&"x"!==s||(o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),s&&"y"!==s||(o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c="x"===this.options.axis||r+f>u&&a>r+f,h="y"===this.options.axis||t+l>s&&o>t+l,p=c&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>s&&o>n-this.helperProportions.width/2&&r+this.helperProportions.height/2>u&&a>i-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),r=t&&n,i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return r?this.floating?s&&"right"===s||"down"===i?2:1:i&&("down"===i?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return this.floating&&i?"right"===i&&n||"left"===i&&!n:r&&("down"===r&&t||"up"===r&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function n(){u.push(this)}var r,i,s,o,u=[],a=[],f=this._connectWith();if(f&&t)for(r=f.length-1;r>=0;r--)for(s=e(f[r],this.document[0]),i=s.length-1;i>=0;i--)o=e.data(s[i],this.widgetFullName),o&&o!==this&&!o.options.disabled&&a.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(a.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=a.length-1;r>=0;r--)a[r][0].each(n);return e(u)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;t.length>n;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--)for(i=e(h[n],this.document[0]),r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]),this.containers.push(s));for(n=c.length-1;n>=0;n--)for(o=c[n][1],u=c[n][0],r=0,f=u.length;f>r;r++)a=e(u[r]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--)r=this.items[n],r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=i.outerWidth(),r.height=i.outerHeight()),s=i.offset(),r.left=s.left,r.top=s.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)s=this.containers[n].element.offset(),this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;r.placeholder&&r.placeholder.constructor!==String||(n=r.placeholder,r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),i=e("<"+r+">",t.document[0]).addClass(n||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===r?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(i)):"tr"===r?t._createTrPlaceholder(t.currentItem,i):"img"===r&&i.attr("src",t.currentItem.attr("src")),n||i.css("visibility","hidden"),i},update:function(e,i){(!n||r.forcePlaceholderSize)&&(i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var r=this;t.children().each(function(){e("<td>&#160;</td>",r.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)})},_contactContainers:function(t){var n,r,i,s,o,u,a,f,l,c,h=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(h&&e.contains(this.containers[n].element[0],h.element[0]))continue;h=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,l=h.floating||this._isFloating(this.currentItem),o=l?"left":"top",u=l?"width":"height",c=l?"clientX":"clientY",r=this.items.length-1;r>=0;r--)e.contains(this.containers[p].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(a=this.items[r].item.offset()[o],f=!1,t[c]-a>this.items[r][u]/2&&(f=!0),i>Math.abs(t[c]-a)&&(i=Math.abs(t[c]-a),s=this.items[r],this.direction=f?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||e("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=e(i.containment)[0],n=e(i.containment).offset(),r="hidden"!==e(t).css("overflow"),this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,n){n||(n=this.position);var r="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n,r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0],s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){function n(e,t,n){return function(r){n._trigger(e,r,t._uiHash(t))}}this.reverting=!1;var r,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&i.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||i.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(i.push(function(e){this._trigger("remove",e,this._uiHash())}),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),r=this.containers.length-1;r>=0;r--)t||i.push(n("deactivate",this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(n("out",this,this.containers[r])),this.containers[r].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(r=0;i.length>r;r++)i[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);void 0!==i&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function n(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r}))}var r;r=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:n})===!1||(this._value(n),this.counter++)},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=null!==r.min?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),null!==r.max&&e>r.max?r.max:null!==r.min&&r.min>e?r.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var n=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(n)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:a(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var n;""!==e&&(n=this._parse(e),null!==n&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:a(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:a(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:a(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:a(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(a(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var n,r;t=t.cloneNode(!1),n=t.href.replace(e,""),r=location.href.replace(e,"");try{n=decodeURIComponent(n)}catch(i){}try{r=decodeURIComponent(r)}catch(i){}return t.hash.length>1&&n===r}}(),_create:function(){var t=this,n=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(n.active):e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);return null===t&&(r&&this.tabs.each(function(n,i){return e(i).attr("aria-controls")===r?(t=n,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=n?!1:0)),!n&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(r),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||t.metaKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,n){function r(){return t>i&&(t=0),0>t&&(t=i),t}for(var i=this.tabs.length-1;-1!==e.inArray(r(),this.options.disabled);)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,n=this.tabs,r=this.anchors,i=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,s,o,u=e(r).uniqueId().attr("id"),a=e(r).closest("li"),f=a.attr("aria-controls");t._isLocal(r)?(i=r.hash,o=i.substring(1),s=t.element.find(t._sanitizeSelector(i))):(o=a.attr("aria-controls")||e({}).uniqueId()[0].id,i="#"+o,s=t.element.find(i),s.length||(s=t._createPanel(o),s.insertAfter(t.panels[n-1]||t.tablist)),s.attr("aria-live","polite")),s.length&&(t.panels=t.panels.add(s)),f&&a.data("ui-tabs-aria-controls",f),a.attr({"aria-controls":o,"aria-labelledby":u}),s.attr("aria-labelledby",u)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),n&&(this._off(n.not(this.tabs)),this._off(r.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n,r=0;n=this.tabs[r];r++)t===!0||-1!==e.inArray(r,t)?e(n).addClass("ui-state-disabled").attr("aria-disabled","true"):e(n).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();"fill"===t?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");"absolute"!==r&&"fixed"!==r&&(n-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1||(n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),f.length||a.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l))},_toggle:function(t,n){function r(){s.running=!1,s._trigger("activate",t,n)}function i(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&s.options.show?s._show(o,s.options.show,r):(o.show(),r())}var s=this,o=n.newPanel,u=n.oldPanel;this.running=!0,u.length&&this.options.hide?this._hide(u,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u.hide(),i()),u.attr("aria-hidden","true"),n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&u.length?n.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);r[0]!==this.active[0]&&(r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var n=this.options.disabled;n!==!1&&(void 0===t?n=!1:(t=this._getIndex(t),n=e.isArray(n)?e.map(n,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,n){return n!==t?n:null})),this._setupDisabled(n))},disable:function(t){var n=this.options.disabled;if(n!==!0){if(void 0===t)n=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,n))return;n=e.isArray(n)?e.merge([t],n).sort():[t]}this._setupDisabled(n)}},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),s=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),u={tab:i,panel:o},a=function(e,t){"abort"===t&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr};this._isLocal(s[0])||(this.xhr=e.ajax(this._ajaxSettings(s,n,u)),this.xhr&&"canceled"!==this.xhr.statusText&&(i.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,i){setTimeout(function(){o.html(e),r._trigger("load",n,u),a(i,t)},1)}).fail(function(e,t){setTimeout(function(){a(e,t)},1)})))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))},_removeDescribedBy:function(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);-1!==i&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,n){var r=this;return"disabled"===t?(this[n?"_disable":"_enable"](),this.options[t]=n,void 0):(this._super(t,n),"content"===t&&e.each(this.tooltips,function(e,t){r._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r.element[0],t.close(i,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);r.length&&!r.data("ui-tooltip-id")&&(r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&r.parents().each(function(){var t,r=e(this);r.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,n.close(t,!0)),r.attr("title")&&(r.uniqueId(),n.parents[this.id]={element:this,title:r.attr("title")},r.attr("title",""))}),this._registerCloseHandlers(t,r),this._updateContent(r,t))},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;return"string"==typeof r?this._open(t,e,r):(n=r.call(e[0],function(n){i._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=s),this._open(t,e,n))})}),n&&this._open(t,e,n),void 0)},_open:function(t,n,r){function i(e){f.of=e,o.is(":hidden")||o.position(f)}var s,o,u,a,f=e.extend({},this.options.position);if(r){if(s=this._find(n))return s.tooltip.find(".ui-tooltip-content").html(r),void 0;n.is("[title]")&&(t&&"mouseover"===t.type?n.attr("title",""):n.removeAttr("title")),s=this._tooltip(n),o=s.tooltip,this._addDescribedBy(n,o.attr("id")),o.find(".ui-tooltip-content").html(r),this.liveRegion.children().hide(),r.clone?(a=r.clone(),a.removeAttr("id").find("[id]").removeAttr("id")):a=r,e("<div>").html(a).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:i}),i(t)):o.position(e.extend({of:n},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){o.is(":visible")&&(i(f.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,n){var r={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var r=e.Event(t);r.currentTarget=n[0],this.close(r,!0)}}};n[0]!==this.element[0]&&(r.remove=function(){this._removeTooltip(this._find(n).tooltip)}),t&&"mouseover"!==t.type||(r.mouseleave="close"),t&&"focusin"!==t.type||(r.focusout="close"),this._on(!0,n,r)},close:function(t){var n,r=this,i=e(t?t.currentTarget:this.element),s=this._find(i);return s?(n=s.tooltip,s.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),s.hiding=!0,n.stop(!0),this._hide(n,this.options.hide,function(){r._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,n){e(n.element).attr("title",n.title),delete r.parents[t]}),s.closing=!0,this._trigger("close",t,{tooltip:n}),s.hiding||(s.closing=!1)),void 0):(i.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var n=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),r=n.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[r]={element:t,tooltip:n}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur"),s=r.element;i.target=i.currentTarget=s[0],t.close(i,!0),e("#"+n).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}),function(e,t){var n=0,r=null,i=[],s=null;e.fn.split=function(o){function y(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=e.match(/^([0-9\.]+)(px|%)$/);if(t){if(t[2]=="px")return+t[1];if(l.orientation=="vertical")return p*+t[1]/100;if(l.orientation=="horizontal")return d*+t[1]/100}}}var u=this.data("splitter");if(u)return u;var a,f,l=e.extend({limit:100,orientation:"horizontal",position:"50%",invisible:!1,onDragStart:e.noop,onDragEnd:e.noop,onDrag:e.noop},o||{});this.settings=l;var c,h=this.children();l.orientation=="vertical"?(a=h.first().addClass("left_panel"),f=a.next().addClass("right_panel"),c="vsplitter"):l.orientation=="horizontal"&&(a=h.first().addClass("top_panel"),f=a.next().addClass("bottom_panel"),c="hsplitter"),l.invisible&&(c+=" splitter-invisible");var p=this.width(),d=this.height(),v=n++;this.addClass("splitter_panel");var m=e("<div/>").addClass(c).bind("mouseenter touchstart",function(){r=v}).bind("mouseleave touchend",function(){r=null}).insertAfter(a),g,b=e.extend(this,{refresh:function(){var e=this.width(),t=this.height();if(p!=e||d!=t)p=this.width(),d=this.height(),b.position(g)},position:function(){return l.orientation=="vertical"?function(e,n){if(e===t)return g;g=y(e);var r=m.width(),i=r/2;if(l.invisible){var s=a.width(g).outerWidth();f.width(b.width()-s),m.css("left",s-i)}else{var s=a.width(g-i).outerWidth();f.width(b.width()-s-r),m.css("left",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:l.orientation=="horizontal"?function(e,n){if(e===t)return g;g=y(e);var r=m.height(),i=r/2;if(l.invisible){var s=a.height(g).outerHeight();f.height(b.height()-s),m.css("top",s-i)}else{var s=a.height(g-i).outerHeight();f.height(b.height()-s-r),m.css("top",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:e.noop}(),orientation:l.orientation,limit:l.limit,isActive:function(){return r===v},destroy:function(){b.removeClass("splitter_panel"),m.unbind("mouseenter"),m.unbind("mouseleave"),m.unbind("touchstart"),m.unbind("touchmove"),m.unbind("touchend"),m.unbind("touchleave"),m.unbind("touchcancel"),l.orientation=="vertical"?(a.removeClass("left_panel"),f.removeClass("right_panel")):l.orientation=="horizontal"&&(a.removeClass("top_panel"),f.removeClass("bottom_panel")),b.unbind("splitter.resize"),b.find(".splitter_panel").trigger("splitter.resize"),i[v]=null,m.remove();var t=!1;for(var r=i.length;r--;)if(i[r]!==null){t=!0;break}t||(e(document.documentElement).unbind(".splitter"),e(window).unbind("resize.splitter"),b.data("splitter",null),i=[],n=0)}});b.bind("splitter.resize",function(e){var t=b.position();b.orientation=="vertical"&&t>b.width()?t=b.width()-b.limit-1:b.orientation=="horizontal"&&t>b.height()&&(t=b.height()-b.limit-1),t<b.limit&&(t=b.limit+1),b.position(t,!0)});var w;return l.orientation=="vertical"?w>p-l.limit?w=p-l.limit:w=y(l.position):l.orientation=="horizontal"&&(w>d-l.limit?w=d-l.limit:w=y(l.position)),w<l.limit&&(w=l.limit),b.position(w,!0),i.length==0&&(e(window).bind("resize.splitter",function(){e.each(i,function(e,t){t.refresh()})}),e(document.documentElement).bind("mousedown.splitter touchstart.splitter",function(t){if(r!==null)return s=i[r],e('<div class="splitterMask"></div>').css("cursor",s.children().eq(1).css("cursor")).insertAfter(s),s.settings.onDragStart(t),!1}).bind("mouseup.splitter touchend.splitter touchleave.splitter touchcancel.splitter",function(t){s&&(e(".splitterMask").remove(),s.settings.onDragEnd(t),s=null)}).bind("mousemove.splitter touchmove.splitter",function(e){if(s!==null){var t=s.limit,n=s.offset();if(s.orientation=="vertical"){var r=e.pageX;e.originalEvent&&e.originalEvent.changedTouches&&(r=e.originalEvent.changedTouches[0].pageX);var i=r-n.left;i<=s.limit?i=s.limit+1:i>=s.width()-t&&(i=s.width()-t-1),i>s.limit&&i<s.width()-t&&(s.position(i,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}else if(s.orientation=="horizontal"){var o=e.pageY;e.originalEvent&&e.originalEvent.changedTouches&&(o=e.originalEvent.changedTouches[0].pageY);var u=o-n.top;u<=s.limit?u=s.limit+1:u>=s.height()-t&&(u=s.height()-t-1),u>s.limit&&u<s.height()-t&&(s.position(u,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}s.settings.onDrag(e)}})),i.push(b),b.data("splitter",b),b}}(jQuery),define("splitter",["jquery"],function(){}),define("pane",["jquery","splitter"],function(){function e(e,t,n){var r=e.wrap('<div class="pane-container"></div>').parent();n=="above"||n=="left"?r.prepend(t):r.append(t),e.wrap('<div class="pane-wrapper"></div>'),t.wrap('<div class="pane-wrapper"></div>'),n=="above"||n=="below"?dir="horizontal":dir="vertical",r.split({orientation:dir,limit:10})}function t(e){var t=e.parents(".pane-container").first();t.split().destroy(),e.parent().remove(),t.children().first().children().first().unwrap().unwrap()}(function(e){function r(t){var n=t.children();return{splitter:t.split(),first:e(n[0]).children()[0],second:e(n[2]).children()[0]}}var t="tile",n={_init:function(t){return this.each(function(){var t=e(this),n=t.hasClass("horizontal")?"vertical":"horizontal",r=t.attr("data-split"),i=t.children();r||(r="50%"),i.each(function(){e(this).wrap('<div class="pane-wrapper"></div>')}),t.addClass("pane-container"),t.split({orientation:n,position:r,limit:10,onDrag:function(e){i.trigger("pane.resize")},onDragEnd:function(){t.tile("resize_save")}}),t.tile("resize_save")})},resize_save:function(){return this.each(function(){var t=e(this),n=r(t),i,s;n.splitter.orientation=="horizontal"?(i=t.height(),s=e(n.first).height()):(i=t.width(),s=e(n.first).width());var o=Math.round(100*s/i)+"%";n.splitter.resizestart=o}),this.find(".reactive-size").trigger("reactive-resize"),this},resize:function(){return this.each(function(){var t=e(this),n=t.split();n.resizestart&&(n.position(n.resizestart),n.settings.onDrag(t))})}};e.fn.tile=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),function(e){var t={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},n={pushTag:function(t,n,i){var s=e(this),o=s.data("opts"),u,a,f,l,c=s.data("tlis"),h=s.data("tlid"),p,d,v,m,g,y,b,w;t=r.trimTag(t,o.delimiterChars);if(!t||t.length<=0)return;if(o.onlyTagList&&undefined!==o.tagList&&o.tagList){var E=o.tagList;e.each(E,function(e,t){E[e]=t.toLowerCase()});var S=e.inArray(t.toLowerCase(),E);if(-1===S)return}o.CapitalizeFirstLetter&&t.length>1&&(t=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());if(o.validator&&!o.validator(t)){s.trigger("tm:invalid",t);return}if(o.maxTags>0&&c.length>=o.maxTags)return;u=!1,a=jQuery.map(c,function(e){return e.toLowerCase()}),p=e.inArray(t.toLowerCase(),a),-1!==p&&(u=!0);if(u){s.trigger("tm:duplicated",t);if(o.blinkClass)for(var x=0;x<6;++x)e("#"+s.data("tm_rndid")+"_"+h[p]).queue(function(t){e(this).toggleClass(o.blinkClass),t()}).delay(100);else e("#"+s.data("tm_rndid")+"_"+h[p]).stop().animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100)}else o.externalTagId===!0?(i===undefined&&e.error("externalTagId is not passed for tag -"+t),l=i):(f=Math.max.apply(null,h),f=f===-Infinity?0:f,l=++f),n||s.trigger("tm:pushing",[t,l]),c.push(t),h.push(l),n||o.AjaxPush!==null&&o.AjaxPushAllTags==null&&e.inArray(t,o.prefilled)===-1&&e.post(o.AjaxPush,e.extend({tag:t},o.AjaxPushParameters)),d=s.data("tm_rndid")+"_"+l,v=s.data("tm_rndid")+"_Remover_"+l,m=e("<span/>").text(t).html(),g='<span class="'+r.tagClasses.call(s)+'" id="'+d+'">',g+="<span>"+m+"</span>",g+='<a href="#" class="tm-tag-remove" id="'+v+'" TagIdToRemove="'+l+'">',g+=o.tagCloseIcon+"</a></span> ",y=e(g),o.tagsContainer!==null?e(o.tagsContainer).append(y):h.length>1?(w=s.siblings("#"+s.data("tm_rndid")+"_"+h[h.length-2]),w.after(y)):s.before(y),y.find("#"+v).on("click",s,function(t){t.preventDefault();var n=parseInt(e(this).attr("TagIdToRemove"));r.spliceTag.call(s,n,t.data)}),r.refreshHiddenTagList.call(s),n||s.trigger("tm:pushed",[t,l]),r.showOrHide.call(s);s.val("")},popTag:function(){var t=e(this),n,i,s=t.data("tlis"),o=t.data("tlid");o.length>0&&(n=o.pop(),i=s[s.length-1],t.trigger("tm:popping",[i,n]),s.pop(),e("#"+t.data("tm_rndid")+"_"+n).remove(),r.refreshHiddenTagList.call(t),t.trigger("tm:popped",[i,n]))},empty:function(){var t=e(this),n=t.data("tlis"),i=t.data("tlid"),s;while(i.length>0)s=i.pop(),n.pop(),e("#"+t.data("tm_rndid")+"_"+s).remove(),r.refreshHiddenTagList.call(t);t.trigger("tm:emptied",null),r.showOrHide.call(t)},tags:function(){var e=this,t=e.data("tlis");return t}},r={showOrHide:function(){var e=this,t=e.data("opts"),n=e.data("tlis");t.maxTags>0&&n.length<t.maxTags&&(e.show(),e.trigger("tm:show")),t.maxTags>0&&n.length>=t.maxTags&&(e.hide(),e.trigger("tm:hide"))},tagClasses:function(){var t=e(this),n=t.data("opts"),r=n.tagBaseClass,i=n.inputBaseClass,s;return s=r,t.attr("class")&&e.each(t.attr("class").split(" "),function(e,t){t.indexOf(i+"-")!==-1&&(s+=" "+r+t.substring(i.length))}),s+=n.tagClass?" "+n.tagClass:"",s},trimTag:function(t,n){var r;t=e.trim(t),r=0;for(r;r<t.length;r++)if(e.inArray(t.charCodeAt(r),n)!==-1)break;return t.substring(0,r)},refreshHiddenTagList:function(){var t=e(this),n=t.data("tlis"),r=t.data("lhiddenTagList");r&&e(r).val(n.join(t.data("opts").baseDelimiter)).change(),t.trigger("tm:refresh",n.join(t.data("opts").baseDelimiter))},killEvent:function(e){e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation(),e.preventDefault()},keyInArray:function(t,n){return e.inArray(t.which,n)!==-1},applyDelimiter:function(t){var r=e(this);n.pushTag.call(r,e(this).val()),t.preventDefault()},prefill:function(t){var r=e(this),i=r.data("opts");e.each(t,function(e,t){i.externalTagId===!0?n.pushTag.call(r,t[i.prefillValueFieldName],!0,t[i.prefillIdFieldName]):n.pushTag.call(r,t,!0)})},pushAllTags:function(t,n){var r=e(this),i=r.data("opts"),s=r.data("tlis");i.AjaxPushAllTags&&(t.type!=="tm:pushed"||e.inArray(n,i.prefilled)===-1)&&e.post(i.AjaxPush,e.extend({tags:s.join(i.baseDelimiter)},i.AjaxPushParameters))},spliceTag:function(t){var n=this,i=n.data("tlis"),s=n.data("tlid"),o=e.inArray(t,s),u;-1!==o&&(u=i[o],n.trigger("tm:splicing",[u,t]),e("#"+n.data("tm_rndid")+"_"+t).remove(),i.splice(o,1),s.splice(o,1),r.refreshHiddenTagList.call(n),n.trigger("tm:spliced",[u,t])),r.showOrHide.call(n)},init:function(i){var s=e.extend({},t,i),o,u;return s.hiddenTagListName=s.hiddenTagListName===null?"hidden-"+this.attr("name"):s.hiddenTagListName,o=s.delimeters||s.delimiters,u=[9,13,17,18,19,37,38,39,40],s.delimiterChars=[],s.delimiterKeys=[],e.each(o,function(t,n){e.inArray(n,u)!==-1?s.delimiterKeys.push(n):s.delimiterChars.push(n)}),s.baseDelimiter=String.fromCharCode(s.delimiterChars[0]||44),s.tagBaseClass="tm-tag",s.inputBaseClass="tm-input",e.isFunction(s.validator)||(s.validator=null),this.each(function(){var t=e(this),i="",o="",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(t.data("tagManager"))return!1;t.data("tagManager",!0);for(var a=0;a<5;a++)o+=u.charAt(Math.floor(Math.random()*u.length));t.data("tm_rndid",o),t.data("opts",s).data("tlis",[]).data("tlid",[]),s.output===null?(i=e("<input/>",{type:"hidden",name:s.hiddenTagListName}),t.after(i),t.data("lhiddenTagList",i)):t.data("lhiddenTagList",e(s.output)),s.AjaxPushAllTags&&(t.on("tm:spliced",r.pushAllTags),t.on("tm:popped",r.pushAllTags),t.on("tm:pushed",r.pushAllTags)),t.on("focus keypress",function(t){e(this).popover&&e(this).popover("hide")}),s.isClearInputOnEsc&&t.on("keyup",function(t){t.which===27&&(e(this).val(""),r.killEvent(t))}),t.on("keypress",function(e){r.keyInArray(e,s.delimiterChars)&&r.applyDelimiter.call(t,e)}),t.on("keydown",function(e){e.which===13&&s.preventSubmitOnEnter&&r.killEvent(e),r.keyInArray(e,s.delimiterKeys)&&r.applyDelimiter.call(t,e)}),s.deleteTagsOnBackspace&&t.on("keydown",function(i){r.keyInArray(i,s.backspace)&&e(this).val().length<=0&&(n.popTag.call(t),r.killEvent(i))}),s.fillInputOnTagRemove&&t.on("tm:popped",function(t,n){e(this).val(n)}),t.change(function(e){/webkit/.test(navigator.userAgent.toLowerCase())||t.focus(),r.killEvent(e)});if(s.prefilled!==null)typeof s.prefilled=="object"?r.prefill.call(t,s.prefilled):typeof s.prefilled=="string"?r.prefill.call(t,s.prefilled.split(s.baseDelimiter)):typeof s.prefilled=="function"&&r.prefill.call(t,s.prefilled());else if(s.output!==null){if(e(s.output)&&e(s.output).val())var f=e(s.output);r.prefill.call(t,e(s.output).val().split(s.baseDelimiter))}}),this}};e.fn.tagsManager=function(t){var i=e(this);return 0 in this?n[t]?n[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="object"||!t?r.init.apply(this,arguments):(e.error("Method "+t+" does not exist."),!1):this}}(jQuery),define("tagmanager",["jquery"],function(){}),define("form",["jquery","config","laconic","tagmanager"],function(e,t){function r(t,n,r){return r=r||2,e.el.label({"class":"control-label col-xs-"+r+"","for":t},n)}function i(t,n){var r={name:t,type:"checkbox"};return n=n||{},n.checked&&(r.checked="checked"),n.title&&(r.title=n.title),e.el.input(r)}function s(t,n){var r={name:t,type:"text","class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),n.title&&(r.title=n.title),n.value&&(r.value=n.value),n.disabled&&(r.disabled=n.disabled),n.type&&(r.type=n.type),e.el.input(r)}function o(t,n,r){var i={name:t,type:"text","class":"tm-input tag-list"};n&&(i.placeholder=n);var s=e.el.input(i);return r&&e(s).data("prefilled",r),s}function u(t){return e.el.p({"class":"help-block"},"Make saved file public and give it a meaningful name")}function a(t,n){var r={name:t,"class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),e.el.textarea(r,n.value||"")}function f(t,n,r){function s(t){if(typeof t=="string")t==r.value?i.append(e.el.option({selected:"selected"},t)):i.append(e.el.option(t));else{var n={value:t.value};t.value==r.value&&(n.selected="selected"),i.append(e.el.option(n,t.label))}}var i=e(e.el.select({"class":"form-control",name:t}));r=r||{};for(var o=0;o<n.length;o++)s(n[o]);return i[0]}var n={serializeAsObject:function(t){var n=t.serializeArray(0),r={};for(var i=0;i<n.length;i++){var s=n[i].name,o=n[i].value,u=t.find('[name="'+s+'"]'),a=u.prop("type");o!=""&&(a=="hidden"&&s.indexOf("hidden-")==0?(s=s.slice("hidden-".length),r[s]==undefined?r[s]=o.split(","):r[s]=o.split(",").concat(r[s])):a=="text"&&u.hasClass("tag-list")?o!=""&&(r[s]!==undefined?r[s].push(o):r[s]=[o]):a=="number"?r[s]=parseInt(o):a=="checkbox"?r[s]=o=="on"?!0:!1:r[s]=o)}return t.find("[type=checkbox]").each(function(){var t=e(this),n=t.prop("name");r[n]===undefined&&(r[n]=!1)}),r},showDialog:function(t){e(".trill_on_swish-event-receiver").trigger("dialog",t)},formBroadcast:function(t,n){e(".trill_on_swish-event-receiver").trigger(t,n)},fields:{fileName:function(n,o,a,f){var l=t.trill_on_swish.community_examples?"Public | Example | name":"Public | name",c=e.el.div({"class":"form-group"},r("name",l),e.el.div({"class":"col-xs-10"},e.el.div({"class":"input-group"},e.el.span({"class":"input-group-addon",title:"If checked, other users can find this program"},i("public",{checked:o})),t.trill_on_swish.community_examples?e.el.span({"class":"input-group-addon",title:"If checked, add to examples menu"},i("example",{checked:a})):undefined,s("name",{placeholder:"Name (leave empty for generated random name)",title:"Public name of your program",value:n,disabled:f})),u("Make saved file public or give it a meaningful name")));return c},title:function(t){var n=e.el.div({"class":"form-group"},r("title","Title"),e.el.div({"class":"col-xs-10"},s("title",{placeholder:"Descriptive title",value:t})));return n},author:function(t){var n=e.el.div({"class":"form-group"},r("author","Author"),e.el.div({"class":"col-xs-10"},s("author",{placeholder:"Your name",value:t})));return n},date:function(t,n,i){i=i||r;var o=e.el.div({"class":"form-group"},r(i,n),e.el.div({"class":"col-xs-10"},s(i,{disabled:!0,value:(new Date(t*1e3)).toLocaleString()})));return o},description:function(t){var n=e.el.div({"class":"form-group"},r("description","Description"),e.el.div({"class":"col-xs-10"},a("description",{value:t})));return n},commit_message:function(t){var n=e.el.div({"class":"form-group"},r("commit_message","Changes"),e.el.div({"class":"col-xs-10"},a("commit_message",{value:t,placeholder:"Describe your changes here"})));return n},tags:function(t){var n=e.el.div({"class":"form-group"},r("tags","Tags"),e.el.div({"class":"col-xs-10"},o("tags","Tags help finding this code",t)));return n},projection:function(t){var n=e.el.div({"class":"form-group"},r("projection","Projection"),e.el.div({"class":"col-xs-10"},s("projection",{placeholder:"Columns",value:t})));return n},csvFormat:function(t,n){var i;return t=t||["prolog"],n=n||t[0],t.length==1?i=e.el.input({type:"hidden",name:"format",value:t[0]}):i=e.el.div({"class":"form-group"},r("format","Format"),e.el.div({"class":"col-xs-10"},f("format",t,{value:n}))),i},limit:function(t,n){var i=e.el.div({"class":"form-group"},r("name","Limit"),e.el.div({"class":"col-xs-10"},s("limit",{placeholder:"Maximum result count (blank for unlimited)",title:"Limit results",value:t})));return i},checkboxes:function(t){var n,i=e.el.div({"class":"form-group"},r("options","Options",3),n=e.el.div({"class":"col-xs-9"}));for(var s=0;s<t.length;s++){var o=t[s],u={type:"checkbox",name:o.name,autocomplete:"false"};o.value&&(u.checked="checked"),e(n).append(e.el.label({"class":"checkbox-inline"},e.el.input(u),o.label))}return i},chunk:function(t){var n=e.el.div({"class":"form-group"},r("count","Initial solutions",3),e.el.div({"class":"col-xs-9"},e.el.div({"class":"input-group"},s("chunk",{title:"Initial number of solutions",type:"number",value:t}))));return n},buttons:function(t){t=t||{};var r=t.label||"Save program",i=t.offset||2,s=e.el.button({name:"save","class":"btn btn-primary"},r);e(s).on("click",function(r){var i=e(r.target).parents("form")[0],s=n.serializeAsObject(e(i));return t.action(r,s),e(r.target).parents(".modal").modal("hide"),r.preventDefault(),!1});var o=e.el.div({"class":"form-group"},e.el.div({"class":"col-xs-offset-"+i+" col-xs-"+(12-i)},s,e.el.button({name:"cancel","class":"btn btn-danger","data-dismiss":"modal"},"Cancel")));return o},radio:function(t,n){var r=e.el.div({"class":"btn-group","data-toggle":"buttons"});for(var i=0;i<n.length;i++){var s="btn btn-primary btn-xs";n[i].active&&(s+=" active"),e(r).append(e.el.label({"class":s},e.el.input({type:"radio",name:t,autocomplete:"off",value:n[i].value}),n[i].label))}return r}},widgets:{glyphIconButton:function(t,n){var r={"class":"btn btn-info",type:"button"};return n.action&&(r["data-action"]=n.action),n.title&&(r.title=n.title),elem=e.el.button(r,e.el.span({"class":"glyphicon "+t})),elem}}};return n}),!function(e){var t=function(){return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return"undefined"==typeof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){function r(e,t){return n(t,e)}e.each(t,r)},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?void 0:!1}),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?!1:void 0}),!!r):r},mixin:e.extend,getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(t){function n(){return String(t)}return e.isFunction(t)?t:n},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r,i;return function(){var s,o,u=this,a=arguments;return s=function(){r=null,n||(i=e.apply(u,a))},o=n&&!r,clearTimeout(r),r=setTimeout(s,t),o&&(i=e.apply(u,a)),i}},throttle:function(e,t){var n,r,i,s,o,u;return o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)},function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,0>=f?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},noop:function(){}}}(),n="0.10.5",r=function(){function e(e){return e=t.toStr(e),e?e.split(/\s+/):[]}function n(e){return e=t.toStr(e),e?e.split(/\W+/):[]}function r(e){return function(){var n=[].slice.call(arguments,0);return function(r){var i=[];return t.each(n,function(n){i=i.concat(e(t.toStr(r[n])))}),i}}}return{nonword:n,whitespace:e,obj:{nonword:r(n),whitespace:r(e)}}}(),i=function(){function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function i(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(e,t){var n,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(n=this.hash[e])?(n.val=t,this.list.moveToFront(n)):(n=new i(e,t),this.list.add(n),this.hash[e]=n,this.size++)},get:function(e){var t=this.hash[e];return t?(this.list.moveToFront(t),t.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new r}}),t.mixin(r.prototype,{add:function(e){this.head&&(e.next=this.head,this.head.prev=e),this.head=e,this.tail=this.tail||e},remove:function(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),s=function(){function e(e){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function n(){return(new Date).getTime()}function r(e){return JSON.stringify(t.isUndefined(e)?null:e)}function i(e){return JSON.parse(e)}var s,o;try{s=window.localStorage,s.setItem("~~~","!"),s.removeItem("~~~")}catch(u){s=null}return o=s&&window.JSON?{_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},get:function(e){return this.isExpired(e)&&this.remove(e),i(s.getItem(this._prefix(e)))},set:function(e,i,o){return t.isNumber(o)?s.setItem(this._ttlKey(e),r(n()+o)):s.removeItem(this._ttlKey(e)),s.setItem(this._prefix(e),r(i))},remove:function(e){return s.removeItem(this._ttlKey(e)),s.removeItem(this._prefix(e)),this},clear:function(){var e,t,n=[],r=s.length;for(e=0;r>e;e++)(t=s.key(e)).match(this.keyMatcher)&&n.push(t.replace(this.keyMatcher,""));for(e=n.length;e--;)this.remove(n[e]);return this},isExpired:function(e){var r=i(s.getItem(this._ttlKey(e)));return t.isNumber(r)&&n()>r?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(e.prototype,o),e}(),o=function(){function n(t){t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?r(t.transport):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=t.cache===!1?new i(0):a}function r(n){return function(r,i){function s(e){t.defer(function(){u.resolve(e)})}function o(e){t.defer(function(){u.reject(e)})}var u=e.Deferred();return n(r,i,s,o),u}}var s=0,o={},u=6,a=new i(10);return n.setMaxPendingRequests=function(e){u=e},n.resetCache=function(){a.reset()},t.mixin(n.prototype,{_get:function(e,t,n){function r(t){n&&n(null,t),l._cache.set(e,t)}function i(){n&&n(!0)}function a(){s--,delete o[e],l.onDeckRequestArgs&&(l._get.apply(l,l.onDeckRequestArgs),l.onDeckRequestArgs=null)}var f,l=this;this.cancelled||e!==this.lastUrl||((f=o[e])?f.done(r).fail(i):u>s?(s++,o[e]=this._send(e,t).done(r).fail(i).always(a)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(e,n,r){var i;return t.isFunction(n)&&(r=n,n={}),this.cancelled=!1,this.lastUrl=e,(i=this._cache.get(e))?t.defer(function(){r&&r(null,i)}):this._get(e,n,r),!!i},cancel:function(){this.cancelled=!0}}),n}(),u=function(){function n(t){t=t||{},t.datumTokenizer&&t.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function r(e){return e=t.filter(e,function(e){return!!e}),e=t.map(e,function(e){return e.toLowerCase()})}function i(){return{ids:[],children:{}}}function s(e){for(var t={},n=[],r=0,i=e.length;i>r;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n}function o(e,t){function n(e,t){return e-t}var r=0,i=0,s=[];e=e.sort(n),t=t.sort(n);for(var o=e.length,u=t.length;o>r&&u>i;)e[r]<t[i]?r++:e[r]>t[i]?i++:(s.push(e[r]),r++,i++);return s}return t.mixin(n.prototype,{bootstrap:function(e){this.datums=e.datums,this.trie=e.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,function(e){var s,o;s=n.datums.push(e)-1,o=r(n.datumTokenizer(e)),t.each(o,function(e){var t,r,o;for(t=n.trie,r=e.split("");o=r.shift();)t=t.children[o]||(t.children[o]=i()),t.ids.push(s)})})},get:function(e){var n,i,u=this;return n=r(this.queryTokenizer(e)),t.each(n,function(e){var t,n,r,s;if(i&&0===i.length)return!1;for(t=u.trie,n=e.split("");t&&(r=n.shift());)t=t.children[r];return t&&0===n.length?(s=t.ids.slice(0),void (i=i?o(i,s):s)):(i=[],!1)}),i?t.map(s(i),function(e){return u.datums[e]}):[]},reset:function(){this.datums=[],this.trie=i()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){function r(e){return e.local||null}function i(r){var i,s;return s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(i=r.prefetch||null)&&(i=t.isString(i)?{url:i}:i,i=t.mixin(s,i),i.thumbprint=n+i.thumbprint,i.ajax.type=i.ajax.type||"GET",i.ajax.dataType=i.ajax.dataType||"json",!i.url&&e.error("prefetch requires url to be set")),i}function s(n){function r(e){return function(n){return t.debounce(n,e)}}function i(e){return function(n){return t.throttle(n,e)}}var s,o;return o={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(s=n.remote||null)&&(s=t.isString(s)?{url:s}:s,s=t.mixin(o,s),s.rateLimiter=/^throttle$/i.test(s.rateLimitBy)?i(s.rateLimitWait):r(s.rateLimitWait),s.ajax.type=s.ajax.type||"GET",s.ajax.dataType=s.ajax.dataType||"json",delete s.rateLimitBy,delete s.rateLimitWait,!s.url&&e.error("remote requires url to be set")),s}return{local:r,prefetch:i,remote:s}}();!function(n){function i(t){t&&(t.local||t.prefetch||t.remote)||e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=f(t.sorter),this.dupDetector=t.dupDetector||l,this.local=a.local(t),this.prefetch=a.prefetch(t),this.remote=a.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function f(e){function n(t){return t.sort(e)}function r(e){return e}return t.isFunction(e)?n:r}function l(){return!1}var c,h;return c=n.Bloodhound,h={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=i,i.noConflict=function(){return n.Bloodhound=c,i},i.tokenizers=r,t.mixin(i.prototype,{_loadPrefetch:function(t){function n(e){s.clear(),s.add(t.filter?t.filter(e):e),s._saveToStorage(s.index.serialize(),t.thumbprint,t.ttl)}var r,i,s=this;return(r=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(r),i=e.Deferred().resolve()):i=e.ajax(t.url,t.ajax).done(n),i},_getFromRemote:function(e,t){function n(e,n){t(e?[]:s.remote.filter?s.remote.filter(n):n)}var r,i,s=this;if(this.transport)return e=e||"",i=encodeURIComponent(e),r=this.remote.replace?this.remote.replace(this.remote.url,e):this.remote.url.replace(this.remote.wildcard,i),this.transport.get(r,this.remote.ajax,n)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(e,t,n){this.storage&&(this.storage.set(h.data,e,n),this.storage.set(h.protocol,location.protocol,n),this.storage.set(h.thumbprint,t,n))},_readFromStorage:function(e){var t,n={};return this.storage&&(n.data=this.storage.get(h.data),n.protocol=this.storage.get(h.protocol),n.thumbprint=this.storage.get(h.thumbprint)),t=n.thumbprint!==e||n.protocol!==location.protocol,n.data&&!t?n.data:null},_initialize:function(){function n(){i.add(t.isFunction(s)?s():s)}var r,i=this,s=this.local;return r=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),s&&r.done(n),this.transport=this.remote?new o(this.remote):null,this.initPromise=r.promise()},initialize:function(e){return!this.initPromise||e?this._initialize():this.initPromise},add:function(e){this.index.add(e)},get:function(e,n){function r(e){var r=s.slice(0);t.each(e,function(e){var n;return n=t.some(r,function(t){return i.dupDetector(e,t)}),!n&&r.push(e),r.length<i.limit}),n&&n(i.sorter(r))}var i=this,s=[],o=!1;s=this.index.get(e),s=this.sorter(s).slice(0,this.limit),s.length<this.limit?o=this._getFromRemote(e,r):this._cancelLastRemoteRequest(),o||(s.length>0||!this.transport)&&n&&n(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),i}(this);var f=function(){return{wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'}}(),l=function(){var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(e.input,{marginTop:"-1px"}),e}(),c=function(){function n(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}var r="typeahead:";return t.mixin(n.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(r+e,t)}}),n}(),h=function(){function e(e,t,n,r){var i;if(!n)return this;for(t=t.split(a),n=r?u(n,r):n,this._callbacks=this._callbacks||{};i=t.shift();)this._callbacks[i]=this._callbacks[i]||{sync:[],async:[]},this._callbacks[i][e].push(n);return this}function t(t,n,r){return e.call(this,"async",t,n,r)}function n(t,n,r){return e.call(this,"sync",t,n,r)}function r(e){var t;if(!this._callbacks)return this;for(e=e.split(a);t=e.shift();)delete this._callbacks[t];return this}function i(e){var t,n,r,i,o;if(!this._callbacks)return this;for(e=e.split(a),r=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)i=s(n.sync,this,[t].concat(r)),o=s(n.async,this,[t].concat(r)),i()&&f(o);return this}function s(e,t,n){function r(){for(var r,i=0,s=e.length;!r&&s>i;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function o(){var e;return e=window.setImmediate?function(e){setImmediate(function(){e()})}:function(e){setTimeout(function(){e()},0)}}function u(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var a=/\s+/,f=o();return{onSync:n,onAsync:t,off:r,trigger:i}}(),p=function(e){function n(e,n,r){for(var i,s=[],o=0,u=e.length;u>o;o++)s.push(t.escapeRegExChars(e[o]));return i=r?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",n?new RegExp(i):new RegExp(i,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(i){function s(t){var n,r,s;return(n=u.exec(t.data))&&(s=e.createElement(i.tagName),i.className&&(s.className=i.className),r=t.splitText(n.index),r.splitText(n[0].length),s.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(s,r)),!!n}function o(e,t){for(var n,r=3,i=0;i<e.childNodes.length;i++)n=e.childNodes[i],n.nodeType===r?i+=t(n)?1:0:o(n,t)}var u;i=t.mixin({},r,i),i.node&&i.pattern&&(i.pattern=t.isArray(i.pattern)?i.pattern:[i.pattern],u=n(i.pattern,i.caseSensitive,i.wordsOnly),o(i.node,s))}}(window.document),d=function(){function n(n){var i,s,u,a,f=this;n=n||{},n.input||e.error("input is missing"),i=t.bind(this._onBlur,this),s=t.bind(this._onFocus,this),u=t.bind(this._onKeydown,this),a=t.bind(this._onInput,this),this.$hint=e(n.hint),this.$input=e(n.input).on("blur.tt",i).on("focus.tt",s).on("keydown.tt",u),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(e){o[e.which||e.keyCode]||t.defer(t.bind(f._onInput,f,e))}):this.$input.on("input.tt",a),this.query=this.$input.val(),this.$overflowHelper=r(this.$input)}function r(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function i(e,t){return n.normalizeQuery(e)===n.normalizeQuery(t)}function s(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var o;return o={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(n.prototype,h,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=o[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!s(t);break;case"up":case"down":n=!s(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!s(t);break;default:n=!0}return n},_checkInputValue:function(){var e,t,n;e=this.getInputValue(),t=i(e,this.query),n=t?this.query.length!==e.length:!1,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){this.$input.val(e),t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n,r;e=this.getInputValue(),t=this.getHint(),n=e!==t&&0===t.indexOf(e),r=""!==e&&n&&!this.hasOverflow(),!r&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,n,r;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:document.selection?(r=document.selection.createRange(),r.moveStart("character",-e),e===r.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),n}(),v=function(){function n(n){n=n||{},n.templates=n.templates||{},n.source||e.error("missing source"),n.name&&!s(n.name)&&e.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||t.getUniqueId(),this.source=n.source,this.displayFn=r(n.display||n.displayKey),this.templates=i(n.templates,this.displayFn),this.$el=e(f.dataset.replace("%CLASS%",this.name))}function r(e){function n(t){return t[e]}return e=e||"value",t.isFunction(e)?e:n}function i(e,n){function r(e){return"<p>"+n(e)+"</p>"}return{empty:e.empty&&t.templatify(e.empty),header:e.header&&t.templatify(e.header),footer:e.footer&&t.templatify(e.footer),suggestion:e.suggestion||r}}function s(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var o="ttDataset",u="ttValue",a="ttDatum";return n.extractDatasetName=function(t){return e(t).data(o)},n.extractValue=function(t){return e(t).data(u)},n.extractDatum=function(t){return e(t).data(a)},t.mixin(n.prototype,h,{_render:function(n,r){function i(){return v.templates.empty({query:n,isEmpty:!0})}function s(){function i(t){var n;return n=e(f.suggestion).append(v.templates.suggestion(t)).data(o,v.name).data(u,v.displayFn(t)).data(a,t),n.children().each(function(){e(this).css(l.suggestionChild)}),n}var s,c;return s=e(f.suggestions).css(l.suggestions),c=t.map(r,i),s.append.apply(s,c),v.highlight&&p({className:"tt-highlight",node:s[0],pattern:n}),s}function c(){return v.templates.header({query:n,isEmpty:!d})}function h(){return v.templates.footer({query:n,isEmpty:!d})}if(this.$el){var d,v=this;this.$el.empty(),d=r&&r.length,!d&&this.templates.empty?this.$el.html(i()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null):d&&this.$el.html(s()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(e){function t(t){n.canceled||e!==n.query||n._render(e,t)}var n=this;this.query=e,this.canceled=!1,this.source(e,t)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),n}(),m=function(){function n(n){var i,s,o,u=this;n=n||{},n.menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=t.map(n.datasets,r),i=t.bind(this._onSuggestionClick,this),s=t.bind(this._onSuggestionMouseEnter,this),o=t.bind(this._onSuggestionMouseLeave,this),this.$menu=e(n.menu).on("click.tt",".tt-suggestion",i).on("mouseenter.tt",".tt-suggestion",s).on("mouseleave.tt",".tt-suggestion",o),t.each(this.datasets,function(e){u.$menu.append(e.getRoot()),e.onSync("rendered",u._onRendered,u)})}function r(e){return new v(e)}return t.mixin(n.prototype,h,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",e(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor(),this._setCursor(e(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function e(e){return e.isEmpty()}this.isEmpty=t.every(this.datasets,e),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(e,t){e.first().addClass("tt-cursor"),!t&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(e){var t,n,r,i;if(this.isOpen){if(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),r=t.index(n)+e,r=(r+1)%(t.length+1)-1,-1===r)return void this.trigger("cursorRemoved");-1>r&&(r=t.length-1),this._setCursor(i=t.eq(r)),this._ensureVisible(i)}},_ensureVisible:function(e){var t,n,r,i;t=e.position().top,n=t+e.outerHeight(!0),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),0>t?this.$menu.scrollTop(r+t):n>i&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:v.extractDatum(e),value:v.extractValue(e),datasetName:v.extractDatasetName(e)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(e){function n(t){t.update(e)}t.each(this.datasets,n)},empty:function(){function e(e){e.clear()}t.each(this.datasets,e),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function e(e){e.destroy()}this.$menu.off(".tt"),this.$menu=null,t.each(this.datasets,e)}}),n}(),g=function(){function n(n){var i,s,o;n=n||{},n.input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.$node=r(n.input,n.withHint),i=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(e){var n,r,o;n=document.activeElement,r=i.is(n),o=i.has(n).length>0,t.isMsie()&&(r||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer(function(){s.focus()}))}),i.on("mousedown.tt",function(e){e.preventDefault()}),this.eventBus=n.eventBus||new c({el:s}),this.dropdown=(new m({menu:i,datasets:n.datasets})).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=(new d({input:s,hint:o})).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function r(t,n){var r,s,u,a;r=e(t),s=e(f.wrapper).css(l.wrapper),u=e(f.dropdown).css(l.dropdown),a=r.clone().css(l.hint).css(i(r)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),r.data(o,{dir:r.attr("dir"),autocomplete:r.attr("autocomplete"),spellcheck:r.attr("spellcheck"),style:r.attr("style")}),r.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(n?l.input:l.inputWithNoHint);try{!r.attr("dir")&&r.attr("dir","auto")}catch(c){}return r.wrap(s).parent().prepend(n?a:null).append(u)}function i(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function s(e){var n=e.find(".tt-input");t.each(n.data(o),function(e,r){t.isUndefined(e)?n.removeAttr(r):n.attr(r,e)}),n.detach().removeData(o).removeClass("tt-input").insertAfter(e),e.remove()}var o="ttAttrs";return t.mixin(n.prototype,{_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n)},_onCursorMoved:function(){var e=this.dropdown.getDatumForCursor();this.input.setInputValue(e.value,!0),this.eventBus.trigger("cursorchanged",e.raw,e.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(e,t){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e;this.dir!==(e=this.input.getLanguageDirection())&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,n,r,i,s,o;e=this.dropdown.getDatumForTopSuggestion(),e&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(n=this.input.getInputValue(),r=d.normalizeQuery(n),i=t.escapeRegExChars(r),s=new RegExp("^(?:"+i+")(.+$)","i"),o=s.exec(e.value),o?this.input.setHint(n+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&(i=this.dropdown.getDatumForTopSuggestion(),i&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e){this.input.setQuery(e.value),this.input.setInputValue(e.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",e.raw,e.datasetName),this.dropdown.close(),t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=t.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),s(this.$node),this.$node=null}}),n}();!function(){var n,r,i;n=e.fn.typeahead,r="ttTypeahead",i={initialize:function(n,i){function s(){var s,o,u=e(this);t.each(i,function(e){e.highlight=!!n.highlight}),o=new g({input:u,eventBus:s=new c({el:u}),withHint:t.isUndefined(n.hint)?!0:!!n.hint,minLength:n.minLength,autoselect:n.autoselect,datasets:i}),u.data(r,o)}return i=t.isArray(i)?i:[].slice.call(arguments,1),n=n||{},this.each(s)},open:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.open()}return this.each(t)},close:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.close()}return this.each(t)},val:function(t){function n(){var n,i=e(this);(n=i.data(r))&&n.setVal(t)}function i(e){var t,n;return(t=e.data(r))&&(n=t.getVal()),n}return arguments.length?this.each(n):i(this.first())},destroy:function(){function t(){var t,n=e(this);(t=n.data(r))&&(t.destroy(),n.removeData(r))}return this.each(t)}},e.fn.typeahead=function(t){var n;return i[t]&&"initialize"!==t?(n=this.filter(function(){return!!e(this).data(r)}),i[t].apply(n,[].slice.call(arguments,1))):i.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this}}()}(window.jQuery),define("typeahead",["jquery"],function(){}),define("search",["jquery","config","typeahead"],function(e,t){(function(e){function i(e){return e?document.createElement("a").appendChild(document.createTextNode(e)).parentNode.innerHTML:""}function s(t,n){var t=t.replace("%QUERY",encodeURIComponent(n)),r=e("label.active > input[name=smatch]").val();return r&&(t+="&match="+r),t}var n="search",r={_init:function(n){return this.each(function(){function u(e){return(e.tags||[]).push(e.name)}function a(e){function t(e){return e.split(".").pop()}function n(e){return e.split(".").slice(0,-1).join(".")}var r='<div class="tt-match file type-icon '+t(e.name)+'">'+'<span class="tt-label">'+i(n(e.name));0/0;if(e.tags){r+='<span class="tt-tags">';for(var s=0;s<e.tags.length;s++){var o=e.tags[s];r+='<span class="tt-tag">'+i(o)+"</span>"}r+="</span>"}return e.title&&(r+='<div class="tt-title file">'+i(e.title)+"</div>"),r+="</div>",r}function h(e){var t="";if(e.file!=l||e.alias!=c){var n=e.file.split(".").pop();l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+n+'">'+'<span class="tt-path-file">'+i(e.file)+"</span>"+"</div>"}return t+w(e)}function d(e){return Bloodhound.tokenizers.whitespace(e.text)}function v(e){var t="";if(e.file!=l||e.alias!=c)l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+e.ext+'">'+'<span class="tt-path-alias">'+i(e.alias)+'</span>(<span class="tt-path-file">'+i(e.file)+")</span>"+"</div>";return e.text&&(t+=w(e)),t}function m(e,n){var r=t.trill_on_swish.templates,i=[],s=e.split(" "),o=[];for(var u=0;u<s.length;u++)o.push({prefix:s[u],regex:new RegExp("_"+s[u])});for(var u=0;u<r.length;u++){var a=r[u];if(a.arity!==undefined){for(var f=0,l=!0;f<o.length&&l;f++)!a.name.startsWith(o[f].prefix)&&!a.name.match(o[f].regex)&&(l=!1);l&&i.push(a)}}n(i)}function g(e){var t='<div class="tt-match predicate';return e.type&&(t+=" "+e.type),e.mode&&(t+='" title="'+e.mode),t+='"><span class="tt-label">'+i(e.name)+"/"+e.arity+"</span>",e.iso&&(t+='<span class="tt-tags">',e.iso&&(t+='<span class="tt-tag">ISO</span>'),t+="</span>"),e.summary&&(t+='<div class="tt-title file">'+i(e.summary)+"</div>"),t+="</div>",t+="</div>",t}function b(t,n){r=t;if(t.length<2)return[];var i=[],s=new RegExp("\\b"+t,"g");y=s,e(".prolog-editor").each(function(){var t=this,n=e(t).prologEditor("search",s,{max:7});for(var r=0;r<n.length;r++)n[r].editor=t,n[r].regex=y,i.push(n[r])}),n(i)}function w(e){var t=e.text,n;(n=t.search(y))>20&&(t="..."+t.slice(n-17)),t.length>80&&(t=t.substring(0,80));var r='<div class="tt-match source"><span class="tt-line"><span class="tt-lineno">'+e.line+"</span>"+'<span class="tt-text">'+i(t)+"</span>"+"</span>"+"</div>";return r}function x(e){var t=[],n=e.replace(/\s+/g," ").split(" ");for(var r=0;r<n.length;r++)t.push(E[n[r]]);return t}var n=e(this),r,o=new Bloodhound({name:"files",remote:t.http.locations.swish_typeahead+"?set=file&q=%QUERY",datumTokenizer:u,queryTokenizer:Bloodhound.tokenizers.whitespace});o.initialize();var f=new Bloodhound({name:"store_content",limit:20,cache:!1,remote:{url:t.http.locations.swish_typeahead+"?set=store_content&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});f.initialize();var l=null,c=null,p=new Bloodhound({name:"source",limit:15,cache:!1,query_cache_length:1,remote:{url:t.http.locations.swish_typeahead+"?set=sources&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});p.initialize();var y,E={source:{name:"source",source:b,templates:{suggestion:w}},sources:{name:"sources",source:p.ttAdapter(),templates:{suggestion:v},limit:15},files:{name:"files",source:o.ttAdapter(),templates:{suggestion:a}},store_content:{name:"store_content",source:f.ttAdapter(),templates:{suggestion:h}},predicates:{name:"predicates",source:m,templates:{suggestion:g}}},S=E.sources.source;E.sources.source=function(e,t){return l=null,c=null,y=new RegExp(RegExp.escape(e)),S(e,t)},n.typeahead({minLength:2,highlight:!0},x(n.data("search-in"))).on("typeahead:selected typeahead:autocompleted",function(t,r,i){if(r.type=="store")r.query&&(r.regex=new RegExp(RegExp.escape(r.query),"g"),r.showAllMatches=!0),e(t.target).parents(".trill_on_swish").trill_on_swish("playFile",r);else if(r.arity!==undefined)e(".trill_on_swish-event-receiver").trigger("pldoc",r);else if(r.editor!==undefined&&r.line!==undefined)e(r.editor).prologEditor("gotoLine",r.line,{regex:r.regex,showAllMatches:!0});else if(r.alias!==undefined){var s=encodeURI("/trill_on_swish/"+r.alias+"/"+r.file+"."+r.ext),o={url:s,line:r.line};r.query&&(o.regex=new RegExp(RegExp.escape(r.query),"g"),o.showAllMatches=!0),e(t.target).parents(".trill_on_swish").trill_on_swish("playURL",o)}else n.data("target",{datum:r,set:i}),console.log(n.data("target"))}),n.parents("form").submit(function(e){var t=n.data("target"),r=n.val();if(!t||!t.datum||t.datum.label!=r)t=r;return n.val(""),n.data("target",null),n.search("search",t),!1})})},search:function(e){alert("Full search not yet implemented\nPlease select from auto completion list")}};typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(e){return this.lastIndexOf(e,0)===0}),e.fn.search=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery),RegExp.escape=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}}),define("tabbed",["jquery","form","laconic","search"],function(e,t){var n={tabTypes:{},type:function(e){var t=e.split(".").pop();for(var r in n.tabTypes)if(n.tabTypes.hasOwnProperty(r)&&n.tabTypes[r].dataType==t)return n.tabTypes[r]}};return function(e){function o(t,n,r){e(t).wrap('<div role="tabpanel" class="tab-pane" id="'+n+'"></div>');var i=e(t).parent();return r&&i.addClass("active"),i}function u(t,n){var r=e.el.span({"class":"glyphicon glyphicon-"+t});return n&&e(r).addClass(n),r}function a(){return"tabbed-tab-"+i++}var r="tabbed",i=0,s={_init:function(t){return t=t||{},this.each(function(){var i=e(this),s={};s.newTab=t.newTab,s.tabTypes=t.tabTypes||n.tabTypes,i.data(r,s),i.addClass("tabbed"),i.tabbed("makeTabbed"),i.on("source",function(e,t){i.tabbed("tabFromSource",t)}),i.on("trace-location",function(e,t){i.tabbed("showTracePort",t)})})},makeTabbed:function(){var t=this.children(),n=e.el.ul({"class":"nav nav-tabs",role:"tablist"}),r=e.el.div({"class":"tab-content"});this.prepend(r),this.prepend(n),e(n).on("click","span.xclose",function(t){var n=e(t.target).parent().attr("data-id");e(t.target).parents(".tabbed").first().tabbed("removeTab",n),t.preventDefault()}),e(n).on("click","a",function(t){e(t.target).closest("a").tab("show"),t.preventDefault()});for(var i=0;i<t.length;i++){var s=e(t[i]),f=a(),l=s.attr("data-label")||"Unknown",c=s.attr("data-close")!="disabled",h=i==t.length-1,p=this.tabbed("tabLabel",f,l,c);h&&e(p).addClass("active"),e(n).append(p),e(r).append(o(e(t[i]),f,h))}var d=e.el.a({"class":"tab-new compact",title:"Open a new tab"},u("plus"));e(n).append(e.el.li({role:"presentation"},d)),e(d).on("click",function(t){var n=e(t.target).parents(".tabbed").first();return n.tabbed("newTab"),t.preventDefault(),!1}),e(n).on("shown.bs.tab","a",function(t){var n=e(t.target).data("id");e("#"+n+" .trill_on_swish-event-receiver").trigger("activate-tab")}),this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},newTab:function(t){var n=this.data(r);return t==undefined&&(n.newTab?t=n.newTab():(t=this.tabbed("tabSelect"),e(t).append(this.tabbed("searchForm")))),this.tabbed("addTab",t,{active:!0,close:!0})},tabFromSource:function(t){var n=this.tabbed("newTab",e("<span></span>"));return typeof t=="object"&&delete t.newTab,this.tabbed("setSource",n,t)||this.tabbed("removeTab",n.attr("id")),this},setSource:function(t,r){if(typeof r=="object"&&(r.meta&&r.meta.name||r.url)){var i=r.meta&&r.meta.name?r.meta.name:r.url,s=n.type(i),o=e.el.div();return t.html(""),t.tabbed("title",s.label,s.dataType),t.append(o),s.create(o),e(o).trigger("source",r),!0}return!1},showTracePort:function(t){if(t&&t.source&&t.source.file){var n=t.source.file,r,i,s;function o(){var e;if(n.startsWith("pengine://"))return n.split("/")[2]}function u(){var e="zzzzzztrill_on_swish://";if(n.startsWith(e))return n.slice(e.length)}if(r=o())s=this.find(".prolog-editor").filter(function(t,n){return e(n).prologEditor("pengine",{has:r})});else if(i=u()){s=this.find(".storage").storage("match",{file:i});if(!s)return this.closest(".trill_on_swish").trill_on_swish("playFile",{file:i,newTab:!0,noHistory:!0,prompt:t}),this}s&&s.prologEditor("showTracePort",t)}return this},addTab:function(t,n){var r=this.tabbed("navTabs"),i=a(),s=o(t,i,n.close);this.tabbed("navContent").append(s);var u=this.tabbed("tabLabel",i,"New tab",close,"select"),f=r.find("a.tab-new");return f.length==1?e(u).insertBefore(f.first().parent()):r.append(u),n.active&&e(u).find("a").first().tab("show"),s},removeTab:function(t){var n=this.tabbed("navTabs").find("a[data-id='"+t+"']").parent(),r=e("#"+t),i;if(r.find(".storage").storage("unload","closetab")==0)return;r.is(":visible")&&(i=n.prev()||n.next()),n.remove(),r.find(".prolog-runner").prologRunner("close"),r.remove(),i&&i.length>0?i.find("a").first().tab("show"):this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},show:function(e){var t=this.tabbed("navTabs").find("a[data-id='"+e+"']");if(t.length>0)return t.tab("show"),this},tabLabel:function(t,n,r,i){var s;r&&(s=u("remove","xclose"),e(s).attr("title","Close tab")),i=i||"owl";var o=e.el.a({"class":"compact",href:"#"+t,"data-id":t},e.el.span({"class":"tab-icon type-icon "+i}),e.el.span({"class":"tab-title"},n),s),a=e.el.li({role:"presentation"},o);return a},title:function(e,t){var n=this.closest(".tab-pane"),r=n.closest(".tabbed"),i=n.attr("id"),s=r.tabbed("navTabs"),o=s.find("a[data-id="+i+"]");o.find(".tab-title").text(e);if(t){var u=o.find(".tab-icon");u.removeClass(),u.addClass("tab-icon type-icon "+t)}return r},tabSelect:function(){var t=this.data(r),i=e.el.div({"class":"tabbed-select"},e.el.div({"class":"tabbed-create"},e.el.label("Create a new "),g=e.el.div({"class":"btn-group",role:"group"}),e.el.label("here."))),s=[];for(var o in t.tabTypes)t.tabTypes.hasOwnProperty(o)&&t.tabTypes[o].order&&s.push(o);s.sort(function(e,n){return t.tabTypes[e].order-t.tabTypes[n].order});for(var u=0;u<s.length;u++){var a=t.tabTypes[s[u]];e(g).append(e.el.button({type:"button","class":"btn btn-default","data-type":a.typeName},a.label))}return e(g).on("click",".btn",function(t){var r=e(t.target).data("type"),i=e(t.target).closest(".tab-pane"),s=e.el.div(),o=n.tabTypes[r];i.html(""),i.tabbed("title",o.label,o.dataType),i.append(s),n.tabTypes[r].create(s)}),e(g).addClass("trill_on_swish-event-receiver"),e(g).on("source",function(t,n){var r=e(t.target).closest(".tab-pane");r.is(":visible")&&r.closest(".tabbed").tabbed("setSource",r,n)&&t.stopPropagation()}),i},searchForm:function(){var n=e.el.form({"class":"search-sources"},e.el.label({"class":"control-label"},"Open source file containing"),e.el.div({"class":"input-group"},e.el.input({type:"text","class":"form-control search",placeholder:"Search sources","data-search-in":"sources store_content"}),e.el.div({"class":"input-group-btn"},e.el.button({"class":"btn btn-default",type:"submit"},e.el.i({"class":"glyphicon glyphicon-search"})))),e.el.div({"class":"input-group"},t.fields.radio("smatch",[{label:"Start of line",value:"sol"},{label:"Start of word",value:"sow",active:!0},{label:"Anywhere",value:"anywhere"}])));return e(n).find("input.search").search(),n},navTabs:function(){return this.find("ul.nav-tabs").first()},navContent:function(){return this.find("div.tab-content").first()}};e.fn.tabbed=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+r)}}(jQuery),n}),function(e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else{if(typeof define=="function"&&define.amd)return define("cm/lib/codemirror",[],e);this.CodeMirror=e()}}(function(){function E(e,t){if(!(this instanceof E))return new E(e,t);this.options=t=t?su(t):{},su(Ti,t,!1),P(t);var n=t.value;typeof n=="string"&&(n=new Ys(n,t.mode)),this.doc=n;var o=new E.inputStyles[t.inputStyle](this),u=this.display=new S(e,n,o);u.wrapper.CodeMirror=this,O(this),L(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!p&&u.input.focus(),F(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Jo,keySeq:null,specialChars:null};var a=this;r&&i<11&&setTimeout(function(){a.display.input.reset(!0)},20),vr(this),Nu(),$n(this),this.curOp.forceUpdate=!0,no(this,n),t.autofocus&&!p||a.hasFocus()?setTimeout(ou(Kr,this),20):Qr(this);for(var f in Ni)Ni.hasOwnProperty(f)&&Ni[f](this,t[f],ki);z(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Mi.length;++l)Mi[l](this);Kn(this),s&&t.lineWrapping&&getComputedStyle(u.lineDiv).textRendering=="optimizelegibility"&&(u.lineDiv.style.textRendering="auto")}function S(t,n,o){var u=this;this.input=o,u.scrollbarFiller=pu("div",null,"CodeMirror-scrollbar-filler"),u.scrollbarFiller.setAttribute("cm-not-content","true"),u.gutterFiller=pu("div",null,"CodeMirror-gutter-filler"),u.gutterFiller.setAttribute("cm-not-content","true"),u.lineDiv=pu("div",null,"CodeMirror-code"),u.selectionDiv=pu("div",null,null,"position: relative; z-index: 1"),u.cursorDiv=pu("div",null,"CodeMirror-cursors"),u.measure=pu("div",null,"CodeMirror-measure"),u.lineMeasure=pu("div",null,"CodeMirror-measure"),u.lineSpace=pu("div",[u.measure,u.lineMeasure,u.selectionDiv,u.cursorDiv,u.lineDiv],null,"position: relative; outline: none"),u.mover=pu("div",[pu("div",[u.lineSpace],"CodeMirror-lines")],null,"position: relative"),u.sizer=pu("div",[u.mover],"CodeMirror-sizer"),u.sizerWidth=null,u.heightForcer=pu("div",null,null,"position: absolute; height: "+zo+"px; width: 1px;"),u.gutters=pu("div",null,"CodeMirror-gutters"),u.lineGutter=null,u.scroller=pu("div",[u.sizer,u.heightForcer,u.gutters],"CodeMirror-scroll"),u.scroller.setAttribute("tabIndex","-1"),u.wrapper=pu("div",[u.scrollbarFiller,u.gutterFiller,u.scroller],"CodeMirror"),r&&i<8&&(u.gutters.style.zIndex=-1,u.scroller.style.paddingRight=0),!s&&(!e||!p)&&(u.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(u.wrapper):t(u.wrapper)),u.viewFrom=u.viewTo=n.first,u.reportedViewFrom=u.reportedViewTo=n.first,u.view=[],u.renderedView=null,u.externalMeasured=null,u.viewOffset=0,u.lastWrapHeight=u.lastWrapWidth=0,u.updateLineNumbers=null,u.nativeBarWidth=u.barHeight=u.barWidth=0,u.scrollbarsClipped=!1,u.lineNumWidth=u.lineNumInnerWidth=u.lineNumChars=null,u.alignWidgets=!1,u.cachedCharWidth=u.cachedTextHeight=u.cachedPaddingH=null,u.maxLine=null,u.maxLineLength=0,u.maxLineChanged=!1,u.wheelDX=u.wheelDY=u.wheelStartX=u.wheelStartY=null,u.shift=!1,u.selForContextMenu=null,u.activeTouch=null,o.init(u)}function x(e){e.doc.mode=E.getMode(e.options,e.doc.modeOption),T(e)}function T(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,an(e,100),e.state.modeGen++,e.curOp&&ar(e)}function N(e){e.options.lineWrapping?(Eu(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(wu(e.display.wrapper,"CodeMirror-wrap"),D(e)),k(e),ar(e),Mn(e),setTimeout(function(){I(e)},100)}function C(e){var t=zn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Wn(e.display)-3);return function(i){if(ws(e.doc,i))return 0;var s=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(s+=i.widgets[o].height);return n?s+(Math.ceil(i.text.length/r)||1)*t:s+t}}function k(e){var t=e.doc,n=C(e);t.iter(function(e){var t=n(e);t!=e.height&&oo(e,t)})}function L(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Mn(e)}function A(e){O(e),ar(e),setTimeout(function(){U(e)},20)}function O(e){var t=e.display.gutters,n=e.options.gutters;vu(t);for(var r=0;r<n.length;++r){var i=n[r],s=t.appendChild(pu("div",null,"CodeMirror-gutter "+i));i=="CodeMirror-linenumbers"&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",M(e)}function M(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function _(e){if(e.height==0)return 0;var t=e.text.length,n,r=e;while(n=ps(r)){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}r=e;while(n=ds(r)){var i=n.find(0,!0);t-=r.text.length-i.from.ch,r=i.to.line,t+=r.text.length-i.to.ch}return t}function D(e){var t=e.display,n=e.doc;t.maxLine=ro(n,n.first),t.maxLineLength=_(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=_(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function P(e){var t=tu(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function H(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+pn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+vn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function B(e,t,n){this.cm=n;var s=this.vert=pu("div",[pu("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=pu("div",[pu("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(s),e(o),Do(s,"scroll",function(){s.clientHeight&&t(s.scrollTop,"vertical")}),Do(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedOverlay=!1,r&&i<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function j(){}function F(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&wu(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new E.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Do(t,"mousedown",function(){e.state.focused&&setTimeout(function(){e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?_r(e,t):Mr(e,t)},e),e.display.scrollbars.addClass&&Eu(e.display.wrapper,e.display.scrollbars.addClass)}function I(e,t){t||(t=H(e));var n=e.display.barWidth,r=e.display.barHeight;q(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Y(e),q(e,H(e)),n=e.display.barWidth,r=e.display.barHeight}function q(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function R(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-hn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,s=ao(t,r),o=ao(t,i);if(n&&n.ensure){var u=n.ensure.from.line,a=n.ensure.to.line;u<s?(s=u,o=ao(t,fo(ro(t,u))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=o&&(s=ao(t,fo(ro(t,a))-e.wrapper.clientHeight),o=a)}return{from:s,to:Math.max(o,s+1)}}function U(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;var r=X(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,s=r+"px";for(var o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&n[o].gutter&&(n[o].gutter.style.left=s);var u=n[o].alignable;if(u)for(var a=0;a<u.length;a++)u[a].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function z(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=W(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(pu("div",[pu("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=i.firstChild.offsetWidth,o=i.offsetWidth-s;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(s,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",M(e),!0}return!1}function W(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function X(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function V(e,t,n){var r=e.display;this.viewport=t,this.visible=R(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=mn(e),this.force=n,this.dims=et(e),this.events=[]}function $(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=vn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=vn(e)+"px",t.scrollbarsClipped=!0)}function J(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return lr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&dr(e)==0)return!1;z(e)&&(lr(e),t.dims=et(e));var i=r.first+r.size,s=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),w&&(s=ys(e.doc,s),o=bs(e.doc,o));var u=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;pr(e,s,o),n.viewOffset=fo(ro(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var a=dr(e);if(!u&&a==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=yu();return a>4&&(n.lineDiv.style.display="none"),tt(e,n.updateLineNumbers,t.dims),a>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&yu()!=f&&f.offsetHeight&&f.focus(),vu(n.cursorDiv),vu(n.selectionDiv),n.gutters.style.height=0,u&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,an(e,400)),n.updateLineNumbers=null,!0}function K(e,t){var n=t.viewport;for(var r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==mn(e)){n&&n.top!=null&&(n={top:Math.min(e.doc.height+pn(e.display)-gn(e),n.top)}),t.visible=R(e.display,e.doc,n);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!J(e,t))break;Y(e);var i=H(e);nn(e),G(e,i),I(e,i)}t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo}function Q(e,t){var n=new V(e,t);if(J(e,n)){Y(e),K(e,n);var r=H(e);nn(e),G(e,r),I(e,r),n.finish()}}function G(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+vn(e),t.clientHeight)+"px"}function Y(e){var t=e.display,n=t.lineDiv.offsetTop;for(var s=0;s<t.view.length;s++){var o=t.view[s],u;if(o.hidden)continue;if(r&&i<8){var a=o.node.offsetTop+o.node.offsetHeight;u=a-n,n=a}else{var f=o.node.getBoundingClientRect();u=f.bottom-f.top}var l=o.line.height-u;u<2&&(u=zn(t));if(l>.001||l<-0.001){oo(o.line,u),Z(o.line);if(o.rest)for(var c=0;c<o.rest.length;c++)Z(o.rest[c])}}}function Z(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function et(e){var t=e.display,n={},r={},i=t.gutters.clientLeft;for(var s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o)n[e.options.gutters[o]]=s.offsetLeft+s.clientLeft+i,r[e.options.gutters[o]]=s.clientWidth;return{fixedPos:X(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function tt(e,t,n){function a(t){var n=t.nextSibling;return s&&d&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,u=o.firstChild,f=r.view,l=r.viewFrom;for(var c=0;c<f.length;c++){var h=f[c];if(!h.hidden)if(!h.node||h.node.parentNode!=o){var p=lt(e,h,l,n);o.insertBefore(p,u)}else{while(u!=h.node)u=a(u);var v=i&&t!=null&&t<=l&&h.lineNumber;h.changes&&(tu(h.changes,"gutter")>-1&&(v=!1),nt(e,h,l,n)),v&&(vu(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(W(e.options,l)))),u=h.node.nextSibling}l+=h.size}while(u)u=a(u)}function nt(e,t,n,r){for(var i=0;i<t.changes.length;i++){var s=t.changes[i];s=="text"?ot(e,t):s=="gutter"?at(e,t,n,r):s=="class"?ut(t):s=="widget"&&ft(e,t,r)}t.changes=null}function rt(e){return e.node==e.text&&(e.node=pu("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),r&&i<8&&(e.node.style.zIndex=2)),e.node}function it(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;t&&(t+=" CodeMirror-linebackground");if(e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=rt(e);e.background=n.insertBefore(pu("div",null,t),n.firstChild)}}function st(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):qs(e,t)}function ot(e,t){var n=t.text.className,r=st(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ut(t)):n&&(t.text.className=n)}function ut(e){it(e),e.line.wrapClass?rt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function at(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var s=rt(t),o=t.gutter=pu("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px");e.display.input.setUneditable(o),s.insertBefore(o,t.text),t.line.gutterClass&&(o.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!i||!i["CodeMirror-linenumbers"])&&(t.lineNumber=o.appendChild(pu("div",W(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px")));if(i)for(var u=0;u<e.options.gutters.length;++u){var a=e.options.gutters[u],f=i.hasOwnProperty(a)&&i[a];f&&o.appendChild(pu("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[a]+"px; width: "+r.gutterWidth[a]+"px"))}}}function ft(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i;r;r=i){var i=r.nextSibling;r.className=="CodeMirror-linewidget"&&t.node.removeChild(r)}ct(e,t,n)}function lt(e,t,n,r){var i=st(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ut(t),at(e,t,n,r),ct(e,t,r),t.node}function ct(e,t,n){ht(e,t.line,t,n,!0);if(t.rest)for(var r=0;r<t.rest.length;r++)ht(e,t.rest[r],t,n,!1)}function ht(e,t,n,r,i){if(!t.widgets)return;var s=rt(n);for(var o=0,u=t.widgets;o<u.length;++o){var a=u[o],f=pu("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),pt(a,f,n,r),e.display.input.setUneditable(f),i&&a.above?s.insertBefore(f,n.gutter||n.text):s.appendChild(f),jo(a,"redraw")}}function pt(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function mt(e){return dt(e.line,e.ch)}function gt(e,t){return vt(e,t)<0?t:e}function yt(e,t){return vt(e,t)<0?e:t}function bt(e){e.state.focused||(e.display.input.focus(),Kr(e))}function wt(e){return e.options.readOnly||e.doc.cantEdit}function St(e,t,n,r,i){var s=e.doc;e.display.shift=!1,r||(r=s.sel);var o=_u(t),u=null;e.state.pasteIncoming&&r.ranges.length>1&&(Et&&Et.join("\n")==t?u=r.ranges.length%Et.length==0&&nu(Et,_u):o.length==r.ranges.length&&(u=nu(o,function(e){return[e]})));for(var a=r.ranges.length-1;a>=0;a--){var f=r.ranges[a],l=f.from(),c=f.to();f.empty()&&(n&&n>0?l=dt(l.line,l.ch-n):e.state.overwrite&&!e.state.pasteIncoming&&(c=dt(c.line,Math.min(ro(s,c.line).text.length,c.ch+Zo(o).length))));var h=e.curOp.updateInput,p={from:l,to:c,text:u?u[a%u.length]:o,origin:i||(e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input")};si(e.doc,p),jo(e,"inputRead",e,p)}t&&!e.state.pasteIncoming&&xt(e,t),gi(e),e.curOp.updateInput=h,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function xt(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;var n=e.doc.sel;for(var r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var s=e.getModeAt(i.head),o=!1;if(s.electricChars){for(var u=0;u<s.electricChars.length;u++)if(t.indexOf(s.electricChars.charAt(u))>-1){o=bi(e,i.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(ro(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=bi(e,i.head.line,"smart"));o&&jo(e,"electricInput",e,i.head.line)}}function Tt(e){var t=[],n=[];for(var r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,s={anchor:dt(i,0),head:dt(i+1,0)};n.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:n}}function Nt(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function Ct(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Jo,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function kt(){var e=pu("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=pu("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Nt(e),t}function Lt(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Jo,this.gracePeriod=!1}function At(e,t){var n=Sn(e,t.line);if(!n||n.hidden)return null;var r=ro(e.doc,t.line),i=bn(n,r,t.line),s=lo(r),o="left";if(s){var u=Ju(s,t.ch);o=u%2?"right":"left"}var a=Cn(i.map,t.ch,o);return a.offset=a.collapse=="right"?a.end:a.start,a}function Ot(e,t){return t&&(e.bad=!0),e}function Mt(e,t,n){var r;if(t==e.display.lineDiv){r=e.display.lineDiv.childNodes[n];if(!r)return Ot(e.clipPos(dt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var s=e.display.view[i];if(s.node==r)return _t(s,t,n)}}function _t(e,t,n){function l(t,n,r){for(var i=-1;i<(f?f.length:0);i++){var s=i<0?a.map:f[i];for(var o=0;o<s.length;o+=3){var u=s[o+2];if(u==t||u==n){var l=uo(i<0?e.line:e.rest[i]),c=s[o]+r;if(r<0||u!=t)c=s[o+(r?1:0)];return dt(l,c)}}}}var r=e.text.firstChild,i=!1;if(!t||!gu(r,t))return Ot(dt(uo(e.line),0),!0);if(t==r){i=!0,t=r.childNodes[n],n=0;if(!t){var s=e.rest?Zo(e.rest):e.line;return Ot(dt(uo(s),s.text.length),i)}}var o=t.nodeType==3?t:null,u=t;!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));while(u.parentNode!=r)u=u.parentNode;var a=e.measure,f=a.maps,c=l(o,u,n);if(c)return Ot(c,i);for(var h=u.nextSibling,p=o?o.nodeValue.length-n:0;h;h=h.nextSibling){c=l(h,h.firstChild,0);if(c)return Ot(dt(c.line,c.ch-p),i);p+=h.textContent.length}for(var d=u.previousSibling,p=n;d;d=d.previousSibling){c=l(d,d.firstChild,-1);if(c)return Ot(dt(c.line,c.ch+p),i);p+=h.textContent.length}}function Dt(e,t,n,r,i){function u(e){return function(t){return t.id==e}}function a(t){if(t.nodeType==1){var n=t.getAttribute("cm-text");if(n!=null){n==""&&(n=t.textContent.replace(/\u200b/g,"")),s+=n;return}var f=t.getAttribute("cm-marker"),l;if(f){var c=e.findMarks(dt(r,0),dt(i+1,0),u(+f));c.length&&(l=c[0].find())&&(s+=io(e.doc,l.from,l.to).join("\n"));return}if(t.getAttribute("contenteditable")=="false")return;for(var h=0;h<t.childNodes.length;h++)a(t.childNodes[h]);/^(pre|div|p)$/i.test(t.nodeName)&&(o=!0)}else if(t.nodeType==3){var p=t.nodeValue;if(!p)return;o&&(s+="\n",o=!1),s+=p}}var s="",o=!1;for(;;){a(t);if(t==n)break;t=t.nextSibling}return s}function Pt(e,t){this.ranges=e,this.primIndex=t}function Ht(e,t){this.anchor=e,this.head=t}function Bt(e,t){var n=e[t];e.sort(function(e,t){return vt(e.from(),t.from())}),t=tu(e,n);for(var r=1;r<e.length;r++){var i=e[r],s=e[r-1];if(vt(s.to(),i.from())>=0){var o=yt(s.from(),i.from()),u=gt(s.to(),i.to()),a=s.empty()?i.from()==i.head:s.from()==s.head;r<=t&&--t,e.splice(--r,2,new Ht(a?u:o,a?o:u))}}return new Pt(e,t)}function jt(e,t){return new Pt([new Ht(e,t||e)],0)}function Ft(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function It(e,t){if(t.line<e.first)return dt(e.first,0);var n=e.first+e.size-1;return t.line>n?dt(n,ro(e,n).text.length):qt(t,ro(e,t.line).text.length)}function qt(e,t){var n=e.ch;return n==null||n>t?dt(e.line,t):n<0?dt(e.line,0):e}function Rt(e,t){return t>=e.first&&t<e.first+e.size}function Ut(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=It(e,t[r]);return n}function zt(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var s=vt(n,i)<0;s!=vt(r,i)<0?(i=n,n=r):s!=vt(n,r)<0&&(n=r)}return new Ht(i,n)}return new Ht(r||n,n)}function Wt(e,t,n,r){Qt(e,new Pt([zt(e,e.sel.primary(),t,n)],0),r)}function Xt(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=zt(e,e.sel.ranges[i],t[i],null);var s=Bt(r,e.sel.primIndex);Qt(e,s,n)}function Vt(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qt(e,Bt(i,e.sel.primIndex),r)}function $t(e,t,n,r){Qt(e,jt(t,n),r)}function Jt(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Ht(It(e,t[n].anchor),It(e,t[n].head))}};return Ho(e,"beforeSelectionChange",e,n),e.cm&&Ho(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Bt(n.ranges,n.ranges.length-1):t}function Kt(e,t,n){var r=e.history.done,i=Zo(r);i&&i.ranges?(r[r.length-1]=t,Gt(e,t,n)):Qt(e,t,n)}function Qt(e,t,n){Gt(e,t,n),yo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Gt(e,t,n){if(Ro(e,"beforeSelectionChange")||e.cm&&Ro(e.cm,"beforeSelectionChange"))t=Jt(e,t);var r=n&&n.bias||(vt(t.primary().head,e.sel.primary().head)<0?-1:1);Yt(e,en(e,t,r,!0)),(!n||n.scroll!==!1)&&e.cm&&gi(e.cm)}function Yt(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,qo(e.cm)),jo(e,"cursorActivity",e)}function Zt(e){Yt(e,en(e,e.sel,null,!1),Xo)}function en(e,t,n,r){var i;for(var s=0;s<t.ranges.length;s++){var o=t.ranges[s],u=tn(e,o.anchor,n,r),a=tn(e,o.head,n,r);if(i||u!=o.anchor||a!=o.head)i||(i=t.ranges.slice(0,s)),i[s]=new Ht(u,a)}return i?Bt(i,t.primIndex):t}function tn(e,t,n,r){var i=!1,s=t,o=n||1;e.cantEdit=!1;e:for(;;){var u=ro(e,s.line);if(u.markedSpans)for(var a=0;a<u.markedSpans.length;++a){var f=u.markedSpans[a],l=f.marker;if((f.from==null||(l.inclusiveLeft?f.from<=s.ch:f.from<s.ch))&&(f.to==null||(l.inclusiveRight?f.to>=s.ch:f.to>s.ch))){if(r){Ho(l,"beforeCursorEnter");if(l.explicitlyCleared){if(!u.markedSpans)break;--a;continue}}if(!l.atomic)continue;var c=l.find(o<0?-1:1);if(vt(c,s)==0){c.ch+=o,c.ch<0?c.line>e.first?c=It(e,dt(c.line-1)):c=null:c.ch>u.text.length&&(c.line<e.first+e.size-1?c=dt(c.line+1,0):c=null);if(!c){if(i)return r?(e.cantEdit=!0,dt(e.first,0)):tn(e,t,n,!0);i=!0,c=t,o=-o}}s=c;continue e}}return s}}function nn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function rn(e,t){var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),s=r.selection=document.createDocumentFragment();for(var o=0;o<n.sel.ranges.length;o++){if(t===!1&&o==n.sel.primIndex)continue;var u=n.sel.ranges[o],a=u.empty();(a||e.options.showCursorWhenSelecting)&&sn(e,u,i),a||on(e,u,s)}return r}function sn(e,t,n){var r=jn(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(pu("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px";if(r.other){var s=n.appendChild(pu("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function on(e,t,n){function f(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(pu("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(n==null?a-e:n)+"px; height: "+(r-t)+"px"))}function l(t,n,r){function h(n,r){return Bn(e,dt(t,n),"div",s,r)}var s=ro(i,t),o=s.text.length,l,c;return Fu(lo(s),n||0,r==null?o:r,function(e,t,i){var s=h(e,"left"),p,d,v;if(e==t)p=s,d=v=s.left;else{p=h(t-1,"right");if(i=="rtl"){var m=s;s=p,p=m}d=s.left,v=p.right}n==null&&e==0&&(d=u),p.top-s.top>3&&(f(d,s.top,null,s.bottom),d=u,s.bottom<p.top&&f(d,s.bottom,null,p.top)),r==null&&t==o&&(v=a);if(!l||s.top<l.top||s.top==l.top&&s.left<l.left)l=s;if(!c||p.bottom>c.bottom||p.bottom==c.bottom&&p.right>c.right)c=p;d<u+1&&(d=u),f(d,p.top,v-d,p.bottom)}),{start:l,end:c}}var r=e.display,i=e.doc,s=document.createDocumentFragment(),o=dn(e.display),u=o.left,a=Math.max(r.sizerWidth,mn(e)-r.sizer.offsetLeft)-o.right,c=t.from(),h=t.to();if(c.line==h.line)l(c.line,c.ch,h.ch);else{var p=ro(i,c.line),d=ro(i,h.line),v=ms(p)==ms(d),m=l(c.line,c.ch,v?p.text.length+1:null).end,g=l(h.line,v?0:null,h.ch).start;v&&(m.top<g.top-2?(f(m.right,m.top,null,m.bottom),f(u,g.top,g.left,g.bottom)):f(m.right,m.top,g.left-m.right,m.bottom)),m.bottom<g.top&&f(u,m.bottom,null,g.top)}n.appendChild(s)}function un(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function an(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,ou(fn,e))}function fn(e){var t=e.doc;t.frontier<t.first&&(t.frontier=t.first);if(t.frontier>=e.display.viewTo)return;var n=+(new Date)+e.options.workTime,r=Di(t.mode,cn(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(t.frontier>=e.display.viewFrom){var o=s.styles,u=Ps(e,s,r,!0);s.styles=u.styles;var a=s.styleClasses,f=u.classes;f?s.styleClasses=f:a&&(s.styleClasses=null);var l=!o||o.length!=s.styles.length||a!=f&&(!a||!f||a.bgClass!=f.bgClass||a.textClass!=f.textClass);for(var c=0;!l&&c<o.length;++c)l=o[c]!=s.styles[c];l&&i.push(t.frontier),s.stateAfter=Di(t.mode,r)}else Bs(e,s.text,r),s.stateAfter=t.frontier%5==0?Di(t.mode,r):null;++t.frontier;if(+(new Date)>n)return an(e,e.options.workDelay),!0}),i.length&&nr(e,function(){for(var t=0;t<i.length;t++)fr(e,i[t],"text")})}function ln(e,t,n){var r,i,s=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100);for(var u=t;u>o;--u){if(u<=s.first)return s.first;var a=ro(s,u-1);if(a.stateAfter&&(!n||u<=s.frontier))return u;var f=Ko(a.text,null,e.options.tabSize);if(i==null||r>f)i=u-1,r=f}return i}function cn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var s=ln(e,t,n),o=s>r.first&&ro(r,s-1).stateAfter;return o?o=Di(r.mode,o):o=Pi(r.mode),r.iter(s,t,function(n){Bs(e,n.text,o);var u=s==t-1||s%5==0||s>=i.viewFrom&&s<i.viewTo;n.stateAfter=u?Di(r.mode,o):null,++s}),n&&(r.frontier=s),o}function hn(e){return e.lineSpace.offsetTop}function pn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function dn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=mu(e.measure,pu("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function vn(e){return zo-e.display.nativeBarWidth}function mn(e){return e.display.scroller.clientWidth-vn(e)-e.display.barWidth}function gn(e){return e.display.scroller.clientHeight-vn(e)-e.display.barHeight}function yn(e,t,n){var r=e.options.lineWrapping,i=r&&mn(e);if(!t.measure.heights||r&&t.measure.width!=i){var s=t.measure.heights=[];if(r){t.measure.width=i;var o=t.text.firstChild.getClientRects();for(var u=0;u<o.length-1;u++){var a=o[u],f=o[u+1];Math.abs(a.bottom-f.bottom)>2&&s.push((a.bottom+f.top)/2-n.top)}}s.push(n.bottom-n.top)}}function bn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(uo(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function wn(e,t){t=ms(t);var n=uo(t),r=e.display.externalMeasured=new or(e.doc,t,n);r.lineN=n;var i=r.built=qs(e,r);return r.text=i.pre,mu(e.display.lineMeasure,i.pre),r}function En(e,t,n,r){return Tn(e,xn(e,t),n,r)}function Sn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function xn(e,t){var n=uo(t),r=Sn(e,n);r&&!r.text?r=null:r&&r.changes&&nt(e,r,n,et(e)),r||(r=wn(e,t));var i=bn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Tn(e,t,n,r,i){t.before&&(n=-1);var s=n+(r||""),o;return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(yn(e,t.view,t.rect),t.hasHeights=!0),o=kn(e,t,n,r),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Cn(e,t,n){var r,i,s,o;for(var u=0;u<e.length;u+=3){var a=e[u],f=e[u+1];if(t<a)i=0,s=1,o="left";else if(t<f)i=t-a,s=i+1;else if(u==e.length-3||t==f&&e[u+3]>t)s=f-a,i=s-1,t>=f&&(o="right");if(i!=null){r=e[u+2],a==f&&n==(r.insertLeft?"left":"right")&&(o=n);if(n=="left"&&i==0)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft)r=e[(u-=3)+2],o="left";if(n=="right"&&i==f-a)while(u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft)r=e[(u+=3)+2],o="right";break}}return{node:r,start:i,end:s,collapse:o,coverStart:a,coverEnd:f}}function kn(e,t,n,s){var o=Cn(t.map,n,s),u=o.node,a=o.start,f=o.end,l=o.collapse,c;if(u.nodeType==3){for(var h=0;h<4;h++){while(a&&hu(t.line.text.charAt(o.coverStart+a)))--a;while(o.coverStart+f<o.coverEnd&&hu(t.line.text.charAt(o.coverStart+f)))++f;if(r&&i<9&&a==0&&f==o.coverEnd-o.coverStart)c=u.parentNode.getBoundingClientRect();else if(r&&e.options.lineWrapping){var p=du(u,a,f).getClientRects();p.length?c=p[s=="right"?p.length-1:0]:c=Nn}else c=du(u,a,f).getBoundingClientRect()||Nn;if(c.left||c.right||a==0)break;f=a,a-=1,l="right"}r&&i<11&&(c=Ln(e.display.measure,c))}else{a>0&&(l=s="right");var p;e.options.lineWrapping&&(p=u.getClientRects()).length>1?c=p[s=="right"?p.length-1:0]:c=u.getBoundingClientRect()}if(r&&i<9&&!a&&(!c||!c.left&&!c.right)){var d=u.parentNode.getClientRects()[0];d?c={left:d.left,right:d.left+Wn(e.display),top:d.top,bottom:d.bottom}:c=Nn}var v=c.top-t.rect.top,m=c.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights;for(var h=0;h<y.length-1;h++)if(g<y[h])break;var b=h?y[h-1]:0,w=y[h],E={left:(l=="right"?c.right:c.left)-t.rect.left,right:(l=="left"?c.left:c.right)-t.rect.left,top:b,bottom:w};return!c.left&&!c.right&&(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=v,E.rbottom=m),E}function Ln(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Bu(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function An(e){if(e.measure){e.measure.cache={},e.measure.heights=null;if(e.rest)for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}}function On(e){e.display.externalMeasure=null,vu(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)An(e.display.view[t])}function Mn(e){On(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function _n(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Dn(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Pn(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var s=Ts(t.widgets[i]);n.top+=s,n.bottom+=s}if(r=="line")return n;r||(r="local");var o=fo(t);r=="local"?o+=hn(e.display):o-=e.display.viewOffset;if(r=="page"||r=="window"){var u=e.display.lineSpace.getBoundingClientRect();o+=u.top+(r=="window"?0:Dn());var a=u.left+(r=="window"?0:_n());n.left+=a,n.right+=a}return n.top+=o,n.bottom+=o,n}function Hn(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=_n(),i-=Dn();else if(n=="local"||!n){var s=e.display.sizer.getBoundingClientRect();r+=s.left,i+=s.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Bn(e,t,n,r,i){return r||(r=ro(e.doc,t.line)),Pn(e,r,En(e,r,t.ch,i),n)}function jn(e,t,n,r,i,s){function o(t,o){var u=Tn(e,i,t,o?"right":"left",s);return o?u.left=u.right:u.right=u.left,Pn(e,r,u,n)}function u(e,t){var n=a[t],r=n.level%2;return e==Iu(n)&&t&&n.level<a[t-1].level?(n=a[--t],e=qu(n)-(n.level%2?0:1),r=!0):e==qu(n)&&t<a.length-1&&n.level<a[t+1].level&&(n=a[++t],e=Iu(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?o(e-1):o(e,r)}r=r||ro(e.doc,t.line),i||(i=xn(e,r));var a=lo(r),f=t.ch;if(!a)return o(f);var l=Ju(a,f),c=u(f,l);return $u!=null&&(c.other=u(f,$u)),c}function Fn(e,t){var n=0,t=It(e.doc,t);e.options.lineWrapping||(n=Wn(e.display)*t.ch);var r=ro(e.doc,t.line),i=fo(r)+hn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function In(e,t,n,r){var i=dt(e,t);return i.xRel=r,n&&(i.outside=!0),i}function qn(e,t,n){var r=e.doc;n+=e.display.viewOffset;if(n<0)return In(r.first,0,!0,-1);var i=ao(r,n),s=r.first+r.size-1;if(i>s)return In(r.first+r.size-1,ro(r,s).text.length,!0,1);t<0&&(t=0);var o=ro(r,i);for(;;){var u=Rn(e,o,i,t,n),a=ds(o),f=a&&a.find(0,!0);if(!a||!(u.ch>f.from.ch||u.ch==f.from.ch&&u.xRel>0))return u;i=uo(o=f.to.line)}}function Rn(e,t,n,r,i){function f(r){var i=jn(e,dt(n,r),"line",t,a);return o=!0,s>i.bottom?i.left-u:s<i.top?i.left+u:(o=!1,i.left)}var s=i-fo(t),o=!1,u=2*e.display.wrapper.clientWidth,a=xn(e,t),l=lo(t),c=t.text.length,h=Ru(t),p=Uu(t),d=f(h),v=o,m=f(p),g=o;if(r>m)return In(n,p,g,1);for(;;){if(l?p==h||p==Qu(t,h,1):p-h<=1){var y=r<d||r-d<=m-r?h:p,b=r-(y==h?d:m);while(hu(t.text.charAt(y)))++y;var w=In(n,y,y==h?v:g,b<-1?-1:b>1?1:0);return w}var E=Math.ceil(c/2),S=h+E;if(l){S=h;for(var x=0;x<E;++x)S=Qu(t,S,1)}var T=f(S);if(T>r){p=S,m=T;if(g=o)m+=1e3;c=E}else h=S,d=T,v=o,c-=E}}function zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Un==null){Un=pu("pre");for(var t=0;t<49;++t)Un.appendChild(document.createTextNode("x")),Un.appendChild(pu("br"));Un.appendChild(document.createTextNode("x"))}mu(e.measure,Un);var n=Un.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),vu(e.measure),n||1}function Wn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=pu("span","xxxxxxxxxx"),n=pu("pre",[t]);mu(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function $n(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vn},Xn?Xn.ops.push(e.curOp):e.curOp.ownsGroup=Xn={ops:[e.curOp],delayedCallbacks:[]}}function Jn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function Kn(e){var t=e.curOp,n=t.ownsGroup;if(!n)return;try{Jn(n)}finally{Xn=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Qn(n)}}function Qn(e){var t=e.ops;for(var n=0;n<t.length;n++)Gn(t[n]);for(var n=0;n<t.length;n++)Yn(t[n]);for(var n=0;n<t.length;n++)Zn(t[n]);for(var n=0;n<t.length;n++)er(t[n]);for(var n=0;n<t.length;n++)tr(t[n])}function Gn(e){var t=e.cm,n=t.display;$(t),e.updateMaxLine&&D(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new V(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yn(e){e.updatedDisplay=e.mustUpdate&&J(e.cm,e.update)}function Zn(e){var t=e.cm,n=t.display;e.updatedDisplay&&Y(t),e.barMeasure=H(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=En(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+vn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-mn(t)));if(e.updatedDisplay||e.selectionChanged)e.preparedSelection=n.input.prepareSelection()}function er(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_r(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&G(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&I(t,e.barMeasure),e.selectionChanged&&un(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),e.focus&&e.focus==yu()&&bt(e.cm)}function tr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&K(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)&&(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),e.scrollLeft!=null&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)&&(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-mn(t),e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,U(t));if(e.scrollToPos){var i=pi(t,It(r,e.scrollToPos.from),It(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&hi(t,i)}var s=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(s)for(var u=0;u<s.length;++u)s[u].lines.length||Ho(s[u],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&Ho(o[u],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ho(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function nr(e,t){if(e.curOp)return t();$n(e);try{return t()}finally{Kn(e)}}function rr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);$n(e);try{return t.apply(e,arguments)}finally{Kn(e)}}}function ir(e){return function(){if(this.curOp)return e.apply(this,arguments);$n(this);try{return e.apply(this,arguments)}finally{Kn(this)}}}function sr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);$n(t);try{return e.apply(this,arguments)}finally{Kn(t)}}}function or(e,t,n){this.line=t,this.rest=gs(t),this.size=this.rest?uo(Zo(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ws(e,t)}function ur(e,t,n){var r=[],i;for(var s=t;s<n;s=i){var o=new or(e.doc,ro(e.doc,s),s);i=s+o.size,r.push(o)}return r}function ar(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0;if(t>=i.viewTo)w&&ys(e.doc,t)<i.viewTo&&lr(e);else if(n<=i.viewFrom)w&&bs(e.doc,n+r)>i.viewFrom?lr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)lr(e);else if(t<=i.viewFrom){var s=hr(e,n,n+r,1);s?(i.view=i.view.slice(s.index),i.viewFrom=s.lineN,i.viewTo+=r):lr(e)}else if(n>=i.viewTo){var s=hr(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):lr(e)}else{var o=hr(e,t,t,-1),u=hr(e,n,n+r,1);o&&u?(i.view=i.view.slice(0,o.index).concat(ur(e,o.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):lr(e)}var a=i.externalMeasured;a&&(n<a.lineN?a.lineN+=r:t<a.lineN+a.size&&(i.externalMeasured=null))}function fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null);if(t<r.viewFrom||t>=r.viewTo)return;var s=r.view[cr(e,t)];if(s.node==null)return;var o=s.changes||(s.changes=[]);tu(o,n)==-1&&o.push(n)}function lr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function cr(e,t){if(t>=e.display.viewTo)return null;t-=e.display.viewFrom;if(t<0)return null;var n=e.display.view;for(var r=0;r<n.length;r++){t-=n[r].size;if(t<0)return r}}function hr(e,t,n,r){var i=cr(e,t),s,o=e.display.view;if(!w||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var u=0,a=e.display.viewFrom;u<i;u++)a+=o[u].size;if(a!=t){if(r>0){if(i==o.length-1)return null;s=a+o[i].size-t,i++}else s=a-t;t+=s,n+=s}while(ys(e.doc,n)!=n){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function pr(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=ur(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=ur(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(cr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(ur(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}function dr(e){var t=e.display.view,n=0;for(var r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function vr(e){function o(){t.activeTouch&&(n=setTimeout(function(){t.activeTouch=null},1e3),s=t.activeTouch,s.end=+(new Date))}function u(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var t=e.display;Do(t.scroller,"mousedown",rr(e,wr)),r&&i<11?Do(t.scroller,"dblclick",rr(e,function(t){if(Io(e,t))return;var n=br(e,t);if(!n||kr(e,t)||yr(e.display,t))return;ko(t);var r=e.findWordAt(n);Wt(e.doc,r.anchor,r.head)})):Do(t.scroller,"dblclick",function(t){Io(e,t)||ko(t)}),y||Do(t.scroller,"contextmenu",function(t){Gr(e,t)});var n,s={end:0};Do(t.scroller,"touchstart",function(e){if(!u(e)){clearTimeout(n);var r=+(new Date);t.activeTouch={start:r,moved:!1,prev:r-s.end<=300?s:null},e.touches.length==1&&(t.activeTouch.left=e.touches[0].pageX,t.activeTouch.top=e.touches[0].pageY)}}),Do(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Do(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!yr(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var i=e.coordsChar(t.activeTouch,"page"),s;!r.prev||a(r,r.prev)?s=new Ht(i,i):!r.prev.prev||a(r,r.prev.prev)?s=e.findWordAt(i):s=new Ht(dt(i.line,0),It(e.doc,dt(i.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),ko(n)}o()}),Do(t.scroller,"touchcancel",o),Do(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Mr(e,t.scroller.scrollTop),_r(e,t.scroller.scrollLeft,!0),Ho(e,"scroll",e))}),Do(t.scroller,"mousewheel",function(t){Br(e,t)}),Do(t.scroller,"DOMMouseScroll",function(t){Br(e,t)}),Do(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={simple:function(t){Io(e,t)||Oo(t)},start:function(t){Or(e,t)},drop:rr(e,Ar)};var f=t.input.getField();Do(f,"keyup",function(t){Vr.call(e,t)}),Do(f,"keydown",rr(e,Wr)),Do(f,"keypress",rr(e,$r)),Do(f,"focus",ou(Kr,e)),Do(f,"blur",ou(Qr,e))}function mr(e,t,n){var r=n&&n!=E.Init;if(!t!=!r){var i=e.display.dragFunctions,s=t?Do:Po;s(e.display.scroller,"dragstart",i.start),s(e.display.scroller,"dragenter",i.simple),s(e.display.scroller,"dragover",i.simple),s(e.display.scroller,"drop",i.drop)}}function gr(e){var t=e.display;if(t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth)return;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}function yr(e,t){for(var n=Mo(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function br(e,t,n,r){var i=e.display;if(!n&&Mo(t).getAttribute("cm-not-content")=="true")return null;var s,o,u=i.lineSpace.getBoundingClientRect();try{s=t.clientX-u.left,o=t.clientY-u.top}catch(t){return null}var a=qn(e,s,o),f;if(r&&a.xRel==1&&(f=ro(e.doc,a.line).text).length==a.ch){var l=Ko(f,f.length,e.options.tabSize)-f.length;a=dt(a.line,Math.max(0,Math.round((s-dn(e.display).left)/Wn(e.display))-l))}return a}function wr(e){var t=this,n=t.display;if(n.activeTouch&&n.input.supportsTouch()||Io(t,e))return;n.shift=e.shiftKey;if(yr(n,e)){s||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100));return}if(kr(t,e))return;var r=br(t,e);window.focus();switch(_o(e)){case 1:r?xr(t,e,r):Mo(e)==n.scroller&&ko(e);break;case 2:s&&(t.state.lastMiddleDown=+(new Date)),r&&Wt(t.doc,r),setTimeout(function(){n.input.focus()},20),ko(e);break;case 3:y?Gr(t,e):Jr(t)}}function xr(e,t,n){r?setTimeout(ou(bt,e),0):e.curOp.focus=yu();var i=+(new Date),s;Sr&&Sr.time>i-400&&vt(Sr.pos,n)==0?s="triple":Er&&Er.time>i-400&&vt(Er.pos,n)==0?(s="double",Sr={time:i,pos:n}):(s="single",Er={time:i,pos:n});var o=e.doc.sel,u=d?t.metaKey:t.ctrlKey,a;e.options.dragDrop&&ku&&!wt(e)&&s=="single"&&(a=o.contains(n))>-1&&!o.ranges[a].empty()?Tr(e,t,n,u):Nr(e,t,n,s,u)}function Tr(e,t,n,o){var u=e.display,a=+(new Date),f=rr(e,function(l){s&&(u.scroller.draggable=!1),e.state.draggingText=!1,Po(document,"mouseup",f),Po(u.scroller,"drop",f),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ko(l),!o&&+(new Date)-200<a&&Wt(e.doc,n),s||r&&i==9?setTimeout(function(){document.body.focus(),u.input.focus()},20):u.input.focus())});s&&(u.scroller.draggable=!0),e.state.draggingText=f,u.scroller.dragDrop&&u.scroller.dragDrop(),Do(document,"mouseup",f),Do(u.scroller,"drop",f)}function Nr(e,t,n,r,i){function d(t){if(vt(p,t)==0)return;p=t;if(r=="rect"){var i=[],s=e.options.tabSize,l=Ko(ro(o,n.line).text,n.ch,s),c=Ko(ro(o,t.line).text,t.ch,s),h=Math.min(l,c),d=Math.max(l,c);for(var v=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=m;v++){var g=ro(o,v).text,y=Qo(g,h,s);h==d?i.push(new Ht(dt(v,y),dt(v,y))):g.length>y&&i.push(new Ht(dt(v,y),dt(v,Qo(g,d,s))))}i.length||i.push(new Ht(n,n)),Qt(o,Bt(f.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,w=b.anchor,E=t;if(r!="single"){if(r=="double")var S=e.findWordAt(t);else var S=new Ht(dt(t.line,0),It(o,dt(t.line+1,0)));vt(S.anchor,w)>0?(E=S.head,w=yt(b.from(),S.anchor)):(E=S.anchor,w=gt(b.to(),S.head))}var i=f.ranges.slice(0);i[a]=new Ht(It(o,w),E),Qt(o,Bt(i,a),Vo)}}function g(t){var n=++m,i=br(e,t,!0,r=="rect");if(!i)return;if(vt(i,p)!=0){e.curOp.focus=yu(),d(i);var u=R(s,o);(i.line>=u.to||i.line<u.from)&&setTimeout(rr(e,function(){m==n&&g(t)}),150)}else{var a=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;a&&setTimeout(rr(e,function(){if(m!=n)return;s.scroller.scrollTop+=a,g(t)}),50)}}function y(e){m=Infinity,ko(e),s.input.focus(),Po(document,"mousemove",b),Po(document,"mouseup",w),o.history.lastSelOrigin=null}var s=e.display,o=e.doc;ko(t);var u,a,f=o.sel,l=f.ranges;i&&!t.shiftKey?(a=o.sel.contains(n),a>-1?u=l[a]:u=new Ht(n,n)):(u=o.sel.primary(),a=o.sel.primIndex);if(t.altKey)r="rect",i||(u=new Ht(n,n)),n=br(e,t,!0,!0),a=-1;else if(r=="double"){var c=e.findWordAt(n);e.display.shift||o.extend?u=zt(o,u,c.anchor,c.head):u=c}else if(r=="triple"){var h=new Ht(dt(n.line,0),It(o,dt(n.line+1,0)));e.display.shift||o.extend?u=zt(o,u,h.anchor,h.head):u=h}else u=zt(o,u,n);i?a==-1?(a=l.length,Qt(o,Bt(l.concat([u]),a),{scroll:!1,origin:"*mouse"})):l.length>1&&l[a].empty()&&r=="single"&&!t.shiftKey?(Qt(o,Bt(l.slice(0,a).concat(l.slice(a+1)),0)),f=o.sel):Vt(o,a,u,Vo):(a=0,Qt(o,new Pt([u],0),Vo),f=o.sel);var p=n,v=s.wrapper.getBoundingClientRect(),m=0,b=rr(e,function(e){_o(e)?g(e):y(e)}),w=rr(e,y);Do(document,"mousemove",b),Do(document,"mouseup",w)}function Cr(e,t,n,r,i){try{var s=t.clientX,o=t.clientY}catch(t){return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ko(t);var u=e.display,a=u.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ro(e,n))return Ao(t);o-=a.top-u.viewOffset;for(var f=0;f<e.options.gutters.length;++f){var l=u.gutters.childNodes[f];if(l&&l.getBoundingClientRect().right>=s){var c=ao(e.doc,o),h=e.options.gutters[f];return i(e,n,e,c,h,t),Ao(t)}}}function kr(e,t){return Cr(e,t,"gutterClick",!0,jo)}function Ar(e){var t=this;if(Io(t,e)||yr(t.display,e))return;ko(e),r&&(Lr=+(new Date));var n=br(t,e,!0),i=e.dataTransfer.files;if(!n||wt(t))return;if(i&&i.length&&window.FileReader&&window.File){var s=i.length,o=Array(s),u=0,a=function(e,r){var i=new FileReader;i.onload=rr(t,function(){o[r]=i.result;if(++u==s){n=It(t.doc,n);var e={from:n,to:n,text:_u(o.join("\n")),origin:"paste"};si(t.doc,e),Kt(t.doc,jt(n,Zr(e)))}}),i.readAsText(e)};for(var f=0;f<s;++f)a(i[f],f)}else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){t.display.input.focus()},20);return}try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&(d?!e.altKey:!e.ctrlKey))var l=t.listSelections();Gt(t.doc,jt(n,n));if(l)for(var f=0;f<l.length;++f)ci(t.doc,"",l[f].anchor,l[f].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}function Or(e,t){if(r&&(!e.state.draggingText||+(new Date)-Lr<100)){Oo(t);return}if(Io(e,t)||yr(e.display,t))return;t.dataTransfer.setData("Text",e.getSelection());if(t.dataTransfer.setDragImage&&!f){var n=pu("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),a&&n.parentNode.removeChild(n)}}function Mr(t,n){if(Math.abs(t.doc.scrollTop-n)<2)return;t.doc.scrollTop=n,e||Q(t,{top:n}),t.display.scroller.scrollTop!=n&&(t.display.scroller.scrollTop=n),t.display.scrollbars.setScrollTop(n),e&&Q(t),an(t,100)}function _r(e,t,n){if(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)return;t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,U(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Br(t,n){var r=Hr(n),i=r.x,o=r.y,u=t.display,f=u.scroller;if(!(i&&f.scrollWidth>f.clientWidth||o&&f.scrollHeight>f.clientHeight))return;if(o&&d&&s)e:for(var l=n.target,c=u.view;l!=f;l=l.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==l){t.display.currentWheelTarget=l;break e}if(i&&!e&&!a&&Pr!=null){o&&Mr(t,Math.max(0,Math.min(f.scrollTop+o*Pr,f.scrollHeight-f.clientHeight))),_r(t,Math.max(0,Math.min(f.scrollLeft+i*Pr,f.scrollWidth-f.clientWidth))),ko(n),u.wheelStartX=null;return}if(o&&Pr!=null){var p=o*Pr,v=t.doc.scrollTop,m=v+u.wrapper.clientHeight;p<0?v=Math.max(0,v+p-50):m=Math.min(t.doc.height,m+p+50),Q(t,{top:v,bottom:m})}Dr<20&&(u.wheelStartX==null?(u.wheelStartX=f.scrollLeft,u.wheelStartY=f.scrollTop,u.wheelDX=i,u.wheelDY=o,setTimeout(function(){if(u.wheelStartX==null)return;var e=f.scrollLeft-u.wheelStartX,t=f.scrollTop-u.wheelStartY,n=t&&u.wheelDY&&t/u.wheelDY||e&&u.wheelDX&&e/u.wheelDX;u.wheelStartX=u.wheelStartY=null;if(!n)return;Pr=(Pr*Dr+n)/(Dr+1),++Dr},200)):(u.wheelDX+=i,u.wheelDY+=o))}function jr(e,t,n){if(typeof t=="string"){t=Hi[t];if(!t)return!1}e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{wt(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Wo}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Fr(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Fi(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Fi(t,e.options.extraKeys,n,e)||Fi(t,e.options.keyMap,n,e)}function qr(e,t,n,r){var i=e.state.keySeq;if(i){if(Ii(t))return"handled";Ir.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var s=Fr(e,t,r);s=="multi"&&(e.state.keySeq=t),s=="handled"&&jo(e,"keyHandled",e,t,n);if(s=="handled"||s=="multi")ko(n),un(e);return i&&!s&&/\'$/.test(t)?(ko(n),!0):!!s}function Rr(e,t){var n=qi(t,!0);return n?t.shiftKey&&!e.state.keySeq?qr(e,"Shift-"+n,t,function(t){return jr(e,t,!0)})||qr(e,n,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return jr(e,t)}):qr(e,n,t,function(t){return jr(e,t)}):!1}function Ur(e,t,n){return qr(e,"'"+n+"'",t,function(t){return jr(e,t,!0)})}function Wr(e){var t=this;t.curOp.focus=yu();if(Io(t,e))return;r&&i<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var s=Rr(t,e);a&&(zr=s?n:null,!s&&n==88&&!Pu&&(d?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Xr(t)}function Xr(e){function n(e){if(e.keyCode==18||!e.altKey)wu(t,"CodeMirror-crosshair"),Po(document,"keyup",n),Po(document,"mouseover",n)}var t=e.display.lineDiv;Eu(t,"CodeMirror-crosshair"),Do(document,"keyup",n),Do(document,"mouseover",n)}function Vr(e){e.keyCode==16&&(this.doc.sel.shift=!1),Io(this,e)}function $r(e){var t=this;if(yr(t.display,e)||Io(t,e)||e.ctrlKey&&!e.altKey||d&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(a&&n==zr){zr=null,ko(e);return}if(a&&(!e.which||e.which<10)&&Rr(t,e))return;var i=String.fromCharCode(r==null?n:r);if(Ur(t,e,i))return;t.display.input.onKeyPress(e)}function Jr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qr(e))},100)}function Kr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1);if(e.options.readOnly=="nocursor")return;e.state.focused||(Ho(e,"focus",e),e.state.focused=!0,Eu(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),s&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),un(e)}function Qr(e){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ho(e,"blur",e),e.state.focused=!1,wu(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Gr(e,t){if(yr(e.display,t)||Yr(e,t))return;e.display.input.onContextMenu(t)}function Yr(e,t){return Ro(e,"gutterContextMenu")?Cr(e,t,"gutterContextMenu",!1,Ho):!1}function ei(e,t){if(vt(e,t.from)<0)return e;if(vt(e,t.to)<=0)return Zr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Zr(t).ch-t.to.ch),dt(n,r)}function ti(e,t){var n=[];for(var r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ht(ei(i.anchor,t),ei(i.head,t)))}return Bt(n,e.sel.primIndex)}function ni(e,t,n){return e.line==t.line?dt(n.line,e.ch-t.ch+n.ch):dt(n.line+(e.line-t.line),e.ch)}function ri(e,t,n){var r=[],i=dt(e.first,0),s=i;for(var o=0;o<t.length;o++){var u=t[o],a=ni(u.from,i,s),f=ni(Zr(u),i,s);i=u.to,s=f;if(n=="around"){var l=e.sel.ranges[o],c=vt(l.head,l.anchor)<0;r[o]=new Ht(c?f:a,c?a:f)}else r[o]=new Ht(a,a)}return new Pt(r,e.sel.primIndex)}function ii(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=It(e,t)),n&&(this.to=It(e,n)),r&&(this.text=r),i!==undefined&&(this.origin=i)}),Ho(e,"beforeChange",e,r),e.cm&&Ho(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function si(e,t,n){if(e.cm){if(!e.cm.curOp)return rr(e.cm,si)(e,t,n);if(e.cm.state.suppressEdits)return}if(Ro(e,"beforeChange")||e.cm&&Ro(e.cm,"beforeChange")){t=ii(e,t,!0);if(!t)return}var r=b&&!n&&os(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)oi(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else oi(e,t)}function oi(e,t){if(t.text.length==1&&t.text[0]==""&&vt(t.from,t.to)==0)return;var n=ti(e,t);mo(e,t,n,e.cm?e.cm.curOp.id:NaN),fi(e,t,n,rs(e,t));var r=[];to(e,function(e,n){!n&&tu(r,e.history)==-1&&(Co(e.history,t),r.push(e.history)),fi(e,t,null,rs(e,t))})}function ui(e,t,n){if(e.cm&&e.cm.state.suppressEdits)return;var r=e.history,i,s=e.sel,o=t=="undo"?r.done:r.undone,u=t=="undo"?r.undone:r.done;for(var a=0;a<o.length;a++){i=o[a];if(n?i.ranges&&!i.equals(e.sel):!i.ranges)break}if(a==o.length)return;r.lastOrigin=r.lastSelOrigin=null;for(;;){i=o.pop();if(!i.ranges)break;bo(i,u);if(n&&!i.equals(e.sel)){Qt(e,i,{clearRedo:!1});return}s=i}var f=[];bo(s,u),u.push({changes:f,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;var l=Ro(e,"beforeChange")||e.cm&&Ro(e.cm,"beforeChange");for(var a=i.changes.length-1;a>=0;--a){var c=i.changes[a];c.origin=t;if(l&&!ii(e,c,!1)){o.length=0;return}f.push(ho(e,c));var h=a?ti(e,c):Zo(o);fi(e,c,h,ss(e,c)),!a&&e.cm&&e.cm.scrollIntoView({from:c.from,to:Zr(c)});var p=[];to(e,function(e,t){!t&&tu(p,e.history)==-1&&(Co(e.history,c),p.push(e.history)),fi(e,c,null,ss(e,c))})}}function ai(e,t){if(t==0)return;e.first+=t,e.sel=new Pt(nu(e.sel.ranges,function(e){return new Ht(dt(e.anchor.line+t,e.anchor.ch),dt(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){ar(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)fr(e.cm,r,"gutter")}}function fi(e,t,n,r){if(e.cm&&!e.cm.curOp)return rr(e.cm,fi)(e,t,n,r);if(t.to.line<e.first){ai(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ai(e,i),t={from:dt(e.first,0),to:dt(t.to.line+i,t.to.ch),text:[Zo(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:dt(s,ro(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=io(e,t.from,t.to),n||(n=ti(e,t)),e.cm?li(e.cm,t,r):Js(e,t,r),Gt(e,n,Xo)}function li(e,t,n){var r=e.doc,i=e.display,s=t.from,o=t.to,u=!1,a=s.line;e.options.lineWrapping||(a=uo(ms(ro(r,s.line))),r.iter(a,o.line+1,function(e){if(e==i.maxLine)return u=!0,!0})),r.sel.contains(t.from,t.to)>-1&&qo(e),Js(r,t,n,C(e)),e.options.lineWrapping||(r.iter(a,s.line+t.text.length,function(e){var t=_(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,s.line),an(e,400);var f=t.text.length-(o.line-s.line)-1;t.full?ar(e):s.line==o.line&&t.text.length==1&&!$s(e.doc,t)?fr(e,s.line,"text"):ar(e,s.line,o.line+1,f);var l=Ro(e,"changes"),c=Ro(e,"change");if(c||l){var h={from:s,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&jo(e,"change",e,h),l&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ci(e,t,n,r,i){r||(r=n);if(vt(r,n)<0){var s=r;r=n,n=s}typeof t=="string"&&(t=_u(t)),si(e,{from:n,to:r,text:t,origin:i})}function hi(e,t){if(Io(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(i!=null&&!c){var s=pu("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-hn(e.display))+"px; height: "+(t.bottom-t.top+vn(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(i),e.display.lineSpace.removeChild(s)}}function pi(e,t,n,r){r==null&&(r=0);for(var i=0;i<5;i++){var s=!1,o=jn(e,t),u=!n||n==t?o:jn(e,n),a=vi(e,Math.min(o.left,u.left),Math.min(o.top,u.top)-r,Math.max(o.left,u.left),Math.max(o.bottom,u.bottom)+r),f=e.doc.scrollTop,l=e.doc.scrollLeft;a.scrollTop!=null&&(Mr(e,a.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(s=!0)),a.scrollLeft!=null&&(_r(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-l)>1&&(s=!0));if(!s)break}return o}function di(e,t,n,r,i){var s=vi(e,t,n,r,i);s.scrollTop!=null&&Mr(e,s.scrollTop),s.scrollLeft!=null&&_r(e,s.scrollLeft)}function vi(e,t,n,r,i){var s=e.display,o=zn(e.display);n<0&&(n=0);var u=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,a=gn(e),f={};i-n>a&&(i=n+a);var l=e.doc.height+pn(s),c=n<o,h=i>l-o;if(n<u)f.scrollTop=c?0:n;else if(i>u+a){var p=Math.min(n,(h?l:i)-a);p!=u&&(f.scrollTop=p)}var d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft,v=mn(e)-(e.options.fixedGutter?s.gutters.offsetWidth:0),m=r-t>v;return m&&(r=t+v),t<10?f.scrollLeft=0:t<d?f.scrollLeft=Math.max(0,t-(m?0:10)):r>v+d-3&&(f.scrollLeft=r+(m?0:10)-v),f}function mi(e,t,n){(t!=null||n!=null)&&yi(e),t!=null&&(e.curOp.scrollLeft=(e.curOp.scrollLeft==null?e.doc.scrollLeft:e.curOp.scrollLeft)+t),n!=null&&(e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function gi(e){yi(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?dt(t.line,t.ch-1):t,r=dt(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Fn(e,t.from),r=Fn(e,t.to),i=vi(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function bi(e,t,n,r){var i=e.doc,s;n==null&&(n="add"),n=="smart"&&(i.mode.indent?s=cn(e,t):n="prev");var o=e.options.tabSize,u=ro(i,t),a=Ko(u.text,null,o);u.stateAfter&&(u.stateAfter=null);var f=u.text.match(/^\s*/)[0],l;if(!r&&!/\S/.test(u.text))l=0,n="not";else if(n=="smart"){l=i.mode.indent(s,u.text.slice(f.length),u.text);if(l==Wo||l>150){if(!r)return;n="prev"}}n=="prev"?t>i.first?l=Ko(ro(i,t-1).text,null,o):l=0:n=="add"?l=a+e.options.indentUnit:n=="subtract"?l=a-e.options.indentUnit:typeof n=="number"&&(l=a+n),l=Math.max(0,l);var c="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/o);p;--p)h+=o,c+="	";h<l&&(c+=Yo(l-h));if(c!=f)return ci(i,c,dt(t,0),dt(t,f.length),"+input"),u.stateAfter=null,!0;for(var p=0;p<i.sel.ranges.length;p++){var d=i.sel.ranges[p];if(d.head.line==t&&d.head.ch<f.length){var h=dt(t,f.length);Vt(i,p,new Ht(h,h));break}}}function wi(e,t,n,r){var i=t,s=t;return typeof t=="number"?s=ro(e,Ft(e,t)):i=uo(t),i==null?null:(r(s,i)&&e.cm&&fr(e.cm,i,n),s)}function Ei(e,t){var n=e.doc.sel.ranges,r=[];for(var i=0;i<n.length;i++){var s=t(n[i]);while(r.length&&vt(s.from,Zo(r).to)<=0){var o=r.pop();if(vt(o.from,s.from)<0){s.from=o.from;break}}r.push(s)}nr(e,function(){for(var t=r.length-1;t>=0;t--)ci(e.doc,"",r[t].from,r[t].to,"+delete");gi(e)})}function Si(e,t,n,r,i){function l(){var t=s+n;return t<e.first||t>=e.first+e.size?f=!1:(s=t,a=ro(e,t))}function c(e){var t=(i?Qu:Gu)(a,o,n,!0);if(t==null){if(!!e||!l())return f=!1;i?o=(n<0?Uu:Ru)(a):o=n<0?a.text.length:0}else o=t;return!0}var s=t.line,o=t.ch,u=n,a=ro(e,s),f=!0;if(r=="char")c();else if(r=="column")c(!0);else if(r=="word"||r=="group"){var h=null,p=r=="group",d=e.cm&&e.cm.getHelper(t,"wordChars");for(var v=!0;;v=!1){if(n<0&&!c(!v))break;var m=a.text.charAt(o)||"\n",g=fu(m,d)?"w":p&&m=="\n"?"n":!p||/\s/.test(m)?null:"p";p&&!v&&!g&&(g="s");if(h&&h!=g){n<0&&(n=1,c());break}g&&(h=g);if(n>0&&!c(!v))break}}var y=tn(e,dt(s,o),u,!0);return f||(y.hitSide=!0),y}function xi(e,t,n,r){var i=e.doc,s=t.left,o;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);o=t.top+n*(u-(n<0?1.5:.5)*zn(e.display))}else r=="line"&&(o=n>0?t.bottom+3:t.top-3);for(;;){var a=qn(e,s,o);if(!a.outside)break;if(n<0?o<=0:o>=i.height){a.hitSide=!0;break}o+=n*5}return a}function Ci(e,t,n,r){E.defaults[e]=t,n&&(Ni[e]=r?function(e,t,r){r!=ki&&n(e,t,r)}:n)}function ji(e){var t=e.split(/-(?!$)/),e=t[t.length-1],n,r,i,s;for(var o=0;o<t.length-1;o++){var u=t[o];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))n=!0;else if(/^(c|ctrl|control)$/i.test(u))r=!0;else{if(!/^s(hift)$/i.test(u))throw new Error("Unrecognized modifier name: "+u);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ri(e){return typeof e=="string"?Bi[e]:e}function Xi(e,t,n,r,i){if(r&&r.shared)return $i(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return rr(e.cm,Xi)(e,t,n,r,i);var s=new Wi(e,i),o=vt(t,n);r&&su(r,s,!1);if(o>0||o==0&&s.clearWhenEmpty!==!1)return s;s.replacedWith&&(s.collapsed=!0,s.widgetNode=pu("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0));if(s.collapsed){if(vs(e,t.line,t,n,s)||t.line!=n.line&&vs(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");w=!0}s.addToHistory&&mo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var u=t.line,a=e.cm,f;e.iter(u,n.line+1,function(e){a&&s.collapsed&&!a.options.lineWrapping&&ms(e)==a.display.maxLine&&(f=!0),s.collapsed&&u!=t.line&&oo(e,0),es(e,new Gi(s,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),s.collapsed&&e.iter(t.line,n.line+1,function(t){ws(e,t)&&oo(t,0)}),s.clearOnEnter&&Do(s,"beforeCursorEnter",function(){s.clear()}),s.readOnly&&(b=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++zi,s.atomic=!0);if(a){f&&(a.curOp.updateMaxLine=!0);if(s.collapsed)ar(a,t.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var l=t.line;l<=n.line;l++)fr(a,l,"text");s.atomic&&Zt(a.doc),jo(a,"markerAdded",a,s)}return s}function $i(e,t,n,r,i){r=su(r),r.shared=!1;var s=[Xi(e,t,n,r,i)],o=s[0],u=r.widgetNode;return to(e,function(e){u&&(r.widgetNode=u.cloneNode(!0)),s.push(Xi(e,It(e,t),It(e,n),r,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;o=Zo(s)}),new Vi(s,o)}function Ji(e){return e.findMarks(dt(e.first,0),e.clipPos(dt(e.lastLine())),function(e){return e.parent})}function Ki(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),s=e.clipPos(i.from),o=e.clipPos(i.to);if(vt(s,o)){var u=Xi(e,s,o,r.primary,r.primary.type);r.markers.push(u),u.parent=r}}}function Qi(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];to(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var s=n.markers[i];tu(r,s.doc)==-1&&(s.parent=null,n.markers.splice(i--,1))}}}function Gi(e,t,n){this.marker=e,this.from=t,this.to=n}function Yi(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Zi(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function es(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ts(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||s.from==t&&o.type=="bookmark"&&(!n||!s.marker.insertLeft)){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push(new Gi(o,s.from,a?null:s.to))}}return i}function ns(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);if(u||s.from==t&&o.type=="bookmark"&&(!n||s.marker.insertLeft)){var a=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);(i||(i=[])).push(new Gi(o,a?null:s.from-t,s.to==null?null:s.to-t))}}return i}function rs(e,t){if(t.full)return null;var n=Rt(e,t.from.line)&&ro(e,t.from.line).markedSpans,r=Rt(e,t.to.line)&&ro(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,s=t.to.ch,o=vt(t.from,t.to)==0,u=ts(n,i,o),a=ns(r,s,o),f=t.text.length==1,l=Zo(t.text).length+(f?i:0);if(u)for(var c=0;c<u.length;++c){var h=u[c];if(h.to==null){var p=Yi(a,h.marker);p?f&&(h.to=p.to==null?null:p.to+l):h.to=i}}if(a)for(var c=0;c<a.length;++c){var h=a[c];h.to!=null&&(h.to+=l);if(h.from==null){var p=Yi(u,h.marker);p||(h.from=l,f&&(u||(u=[])).push(h))}else h.from+=l,f&&(u||(u=[])).push(h)}u&&(u=is(u)),a&&a!=u&&(a=is(a));var d=[u];if(!f){var v=t.text.length-2,m;if(v>0&&u)for(var c=0;c<u.length;++c)u[c].to==null&&(m||(m=[])).push(new Gi(u[c].marker,null,null));for(var c=0;c<v;++c)d.push(m);d.push(a)}return d}function is(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ss(e,t){var n=So(e,t),r=rs(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var s=n[i],o=r[i];if(s&&o)e:for(var u=0;u<o.length;++u){var a=o[u];for(var f=0;f<s.length;++f)if(s[f].marker==a.marker)continue e;s.push(a)}else o&&(n[i]=o)}return n}function os(e,t,n){var r=null;e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||tu(r,n)==-1)&&(r||(r=[])).push(n)}});if(!r)return null;var i=[{from:t,to:n}];for(var s=0;s<r.length;++s){var o=r[s],u=o.find(0);for(var a=0;a<i.length;++a){var f=i[a];if(vt(f.to,u.from)<0||vt(f.from,u.to)>0)continue;var l=[a,1],c=vt(f.from,u.from),h=vt(f.to,u.to);(c<0||!o.inclusiveLeft&&!c)&&l.push({from:f.from,to:u.from}),(h>0||!o.inclusiveRight&&!h)&&l.push({from:u.to,to:f.to}),i.splice.apply(i,l),a+=l.length-1}}return i}function us(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function as(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function fs(e){return e.inclusiveLeft?-1:0}function ls(e){return e.inclusiveRight?1:0}function cs(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),s=vt(r.from,i.from)||fs(e)-fs(t);if(s)return-s;var o=vt(r.to,i.to)||ls(e)-ls(t);return o?o:t.id-e.id}function hs(e,t){var n=w&&e.markedSpans,r;if(n)for(var i,s=0;s<n.length;++s)i=n[s],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||cs(r,i.marker)<0)&&(r=i.marker);return r}function ps(e){return hs(e,!0)}function ds(e){return hs(e,!1)}function vs(e,t,n,r,i){var s=ro(e,t),o=w&&s.markedSpans;if(o)for(var u=0;u<o.length;++u){var a=o[u];if(!a.marker.collapsed)continue;var f=a.marker.find(0),l=vt(f.from,n)||fs(a.marker)-fs(i),c=vt(f.to,r)||ls(a.marker)-ls(i);if(l>=0&&c<=0||l<=0&&c>=0)continue;if(l<=0&&(vt(f.to,n)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||l>=0&&(vt(f.from,r)<0||a.marker.inclusiveLeft&&i.inclusiveRight))return!0}}function ms(e){var t;while(t=ps(e))e=t.find(-1,!0).line;return e}function gs(e){var t,n;while(t=ds(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ys(e,t){var n=ro(e,t),r=ms(n);return n==r?t:uo(r)}function bs(e,t){if(t>e.lastLine())return t;var n=ro(e,t),r;if(!ws(e,n))return t;while(r=ds(n))n=r.find(1,!0).line;return uo(n)+1}function ws(e,t){var n=w&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Es(e,t,r))return!0}}function Es(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Es(e,r.line,Yi(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,s=0;s<t.markedSpans.length;++s){i=t.markedSpans[s];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Es(e,t,i))return!0}}function xs(e,t,n){fo(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&mi(e,null,n)}function Ts(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!gu(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),mu(t.display.measure,pu("div",[e.node],null,n))}return e.height=e.node.offsetHeight}function Ns(e,t,n,r){var i=new Ss(e,n,r),s=e.cm;return s&&i.noHScroll&&(s.display.alignWidgets=!0),wi(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);i.insertAt==null?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t;if(s&&!ws(e,t)){var r=fo(t)<e.scrollTop;oo(t,t.height+Ts(i)),r&&mi(s,null,i.height),s.curOp.forceUpdate=!0}return!0}),i}function ks(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),us(e),as(e,n);var i=r?r(e):1;i!=e.height&&oo(e,i)}function Ls(e){e.parent=null,us(e)}function As(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:(new RegExp("(?:^|s)"+n[2]+"(?:$|s)")).test(t[r])||(t[r]+=" "+n[2])}return e}function Os(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=E.innerMode(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Ms(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=E.innerMode(e,n).mode);var s=e.token(t,n);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}function _s(e,t,n,r){function i(e){return{start:l.start,end:l.pos,string:l.current(),type:u||null,state:e?Di(s.mode,f):f}}var s=e.doc,o=s.mode,u;t=It(s,t);var a=ro(s,t.line),f=cn(e,t.line,n),l=new Ui(a.text,e.options.tabSize),c;r&&(c=[]);while((r||l.pos<t.ch)&&!l.eol())l.start=l.pos,u=Ms(o,l,f),r&&c.push(i(!0));return r?c:i()}function Ds(e,t,n,r,i,s,o){var u=n.flattenSpans;u==null&&(u=e.options.flattenSpans);var a=0,f=null,l=new Ui(t,e.options.tabSize),c,h=e.options.addModeClass&&[null];t==""&&As(Os(n,r),s);while(!l.eol()){l.pos>e.options.maxHighlightLength?(u=!1,o&&Bs(e,t,r,l.pos),l.pos=t.length,c=null):c=As(Ms(n,l,r,h),s);if(h){var p=h[0].name;p&&(c="m-"+(c?p+" "+c:p))}if(!u||f!=c){while(a<l.start)a=Math.min(l.start,a+5e4),i(a,f);f=c}l.start=l.pos}while(a<l.pos){var d=Math.min(l.pos,a+5e4);i(d,f),a=d}}function Ps(e,t,n,r){var i=[e.state.modeGen],s={};Ds(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},s,r);for(var o=0;o<e.state.overlays.length;++o){var u=e.state.overlays[o],a=1,f=0;Ds(e,t.text,u.mode,!0,function(e,t){var n=a;while(f<e){var r=i[a];r>e&&i.splice(a,1,e,i[a+1],r),a+=2,f=Math.min(e,r)}if(!t)return;if(u.opaque)i.splice(n,a-n,e,"cm-overlay "+t),a=n+2;else for(;n<a;n+=2){var s=i[n+1];i[n+1]=(s?s+" ":"")+"cm-overlay "+t}},s)}return{styles:i,classes:s.bgClass||s.textClass?s:null}}function Hs(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ps(e,t,t.stateAfter=cn(e,uo(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Bs(e,t,n,r){var i=e.doc.mode,s=new Ui(t,e.options.tabSize);s.start=s.pos=r||0,t==""&&Os(i,n);while(!s.eol()&&s.pos<=e.options.maxHighlightLength)Ms(i,s,n),s.start=s.pos}function Is(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Fs:js;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function qs(e,t){var n=pu("span",null,null,s?"padding-right: .1px":null),i={pre:pu("pre",[n]),content:n,col:0,pos:0,cm:e,splitSpaces:(r||s)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var u=o?t.rest[o-1]:t.line,a;i.pos=0,i.addToken=Us,Mu(e.display.measure)&&(a=lo(u))&&(i.addToken=Ws(i.addToken,a)),i.map=[];var f=t!=e.display.externalMeasured&&uo(u);Vs(u,i,Hs(e,u,f)),u.styleClasses&&(u.styleClasses.bgClass&&(i.bgClass=Su(u.styleClasses.bgClass,i.bgClass||"")),u.styleClasses.textClass&&(i.textClass=Su(u.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(Au(e.display.measure))),o==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return s&&/\bcm-tab\b/.test(i.content.lastChild.className)&&(i.content.className="cm-tab-wrap-hack"),Ho(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=Su(i.pre.className,i.textClass||"")),i}function Rs(e){var t=pu("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Us(e,t,n,s,o,u,a){if(!t)return;var f=e.splitSpaces?t.replace(/ {3,}/g,zs):t,l=e.cm.state.specialChars,c=!1;if(!l.test(t)){e.col+=t.length;var h=document.createTextNode(f);e.map.push(e.pos,e.pos+t.length,h),r&&i<9&&(c=!0),e.pos+=t.length}else{var h=document.createDocumentFragment(),p=0;for(;;){l.lastIndex=p;var d=l.exec(t),v=d?d.index-p:t.length-p;if(v){var m=document.createTextNode(f.slice(p,p+v));r&&i<9?h.appendChild(pu("span",[m])):h.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!d)break;p+=v+1;if(d[0]=="	"){var g=e.cm.options.tabSize,y=g-e.col%g,m=h.appendChild(pu("span",Yo(y),"cm-tab"));m.setAttribute("role","presentation"),m.setAttribute("cm-text","	"),e.col+=y}else{var m=e.cm.options.specialCharPlaceholder(d[0]);m.setAttribute("cm-text",d[0]),r&&i<9?h.appendChild(pu("span",[m])):h.appendChild(m),e.col+=1}e.map.push(e.pos,e.pos+1,m),e.pos++}}if(n||s||o||c||a){var b=n||"";s&&(b+=s),o&&(b+=o);var w=pu("span",[h],b,a);return u&&(w.title=u),e.content.appendChild(w)}e.content.appendChild(h)}function zs(e){var t=" ";for(var n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" ",t}function Ws(e,t){return function(n,r,i,s,o,u,a){i=i?i+" cm-force-border":"cm-force-border";var f=n.pos,l=f+r.length;for(;;){for(var c=0;c<t.length;c++){var h=t[c];if(h.to>f&&h.from<=f)break}if(h.to>=l)return e(n,r,i,s,o,u,a);e(n,r.slice(0,h.to-f),i,s,null,u,a),s=null,r=r.slice(h.to-f),f=h.to}}}function Xs(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Vs(e,t,n){var r=e.markedSpans,i=e.text,s=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(s,s=n[o]),Is(n[o+1],t.cm.options));return}var u=i.length,a=0,o=1,f="",l,c,h=0,p,d,v,m,g;for(;;){if(h==a){p=d=v=m=c="",g=null,h=Infinity;var y=[];for(var b=0;b<r.length;++b){var w=r[b],E=w.marker;E.type=="bookmark"&&w.from==a&&E.widgetNode?y.push(E):w.from<=a&&(w.to==null||w.to>a||E.collapsed&&w.to==a&&w.from==a)?(w.to!=null&&w.to!=a&&h>w.to&&(h=w.to,d=""),E.className&&(p+=" "+E.className),E.css&&(c=E.css),E.startStyle&&w.from==a&&(v+=" "+E.startStyle),E.endStyle&&w.to==h&&(d+=" "+E.endStyle),E.title&&!m&&(m=E.title),E.collapsed&&(!g||cs(g.marker,E)<0)&&(g=w)):w.from>a&&h>w.from&&(h=w.from)}if(g&&(g.from||0)==a){Xs(t,(g.to==null?u+1:g.to)-a,g.marker,g.from==null);if(g.to==null)return;g.to==a&&(g=!1)}if(!g&&y.length)for(var b=0;b<y.length;++b)Xs(t,0,y[b])}if(a>=u)break;var S=Math.min(u,h);for(;;){if(f){var x=a+f.length;if(!g){var T=x>S?f.slice(0,S-a):f;t.addToken(t,T,l?l+p:p,v,a+T.length==h?d:"",m,c)}if(x>=S){f=f.slice(S-a),a=S;break}a=x,v=""}f=i.slice(s,s=n[o++]),l=Is(n[o++],t.cm.options)}}}function $s(e,t){return t.from.ch==0&&t.to.ch==0&&Zo(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Js(e,t,n,r){function i(e){return n?n[e]:null}function s(e,n,i){ks(e,n,i,r),jo(e,"change",e,t)}function o(e,t){for(var n=e,s=[];n<t;++n)s.push(new Cs(f[n],i(n),r));return s}var u=t.from,a=t.to,f=t.text,l=ro(e,u.line),c=ro(e,a.line),h=Zo(f),p=i(f.length-1),d=a.line-u.line;if(t.full)e.insert(0,o(0,f.length)),e.remove(f.length,e.size-f.length);else if($s(e,t)){var v=o(0,f.length-1);s(c,c.text,p),d&&e.remove(u.line,d),v.length&&e.insert(u.line,v)}else if(l==c)if(f.length==1)s(l,l.text.slice(0,u.ch)+h+l.text.slice(a.ch),p);else{var v=o(1,f.length-1);v.push(new Cs(h+l.text.slice(a.ch),p,r)),s(l,l.text.slice(0,u.ch)+f[0],i(0)),e.insert(u.line+1,v)}else if(f.length==1)s(l,l.text.slice(0,u.ch)+f[0]+c.text.slice(a.ch),i(0)),e.remove(u.line+1,d);else{s(l,l.text.slice(0,u.ch)+f[0],i(0)),s(c,h+c.text.slice(a.ch),p);var v=o(1,f.length-1);d>1&&e.remove(u.line+1,d-1),e.insert(u.line+1,v)}jo(e,"change",e,t)}function Ks(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Qs(e){this.children=e;var t=0,n=0;for(var r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function to(e,t,n){function r(e,i,s){if(e.linked)for(var o=0;o<e.linked.length;++o){var u=e.linked[o];if(u.doc==i)continue;var a=s&&u.sharedHist;if(n&&!a)continue;t(u.doc,a),r(u.doc,e,a)}}r(e,null,!0)}function no(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,k(e),x(e),e.options.lineWrapping||D(e),e.options.mode=t.modeOption,ar(e)}function ro(e,t){t-=e.first;if(t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],s=i.chunkSize();if(t<s){n=i;break}t-=s}return n.lines[t]}function io(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var s=e.text;i==n.line&&(s=s.slice(0,n.ch)),i==t.line&&(s=s.slice(t.ch)),r.push(s),++i}),r}function so(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function oo(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function uo(e){if(e.parent==null)return null;var t=e.parent,n=tu(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function ao(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],s=i.height;if(t<s){e=i;continue e}t-=s,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var o=e.lines[r],u=o.height;if(t<u)break;t-=u}return n+r}function fo(e){e=ms(e);var t=0,n=e.parent;for(var r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var s=n.parent;s;n=s,s=n.parent)for(var r=0;r<s.children.length;++r){var o=s.children[r];if(o==n)break;t+=o.height}return t}function lo(e){var t=e.order;return t==null&&(t=e.order=Yu(e.text)),t}function co(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ho(e,t){var n={from:mt(t.from),to:Zr(t),text:io(e,t.from,t.to)};return wo(e,n,t.from.line,t.to.line+1),to(e,function(e){wo(e,n,t.from.line,t.to.line+1)},!0),n}function po(e){while(e.length){var t=Zo(e);if(!t.ranges)break;e.pop()}}function vo(e,t){if(t)return po(e.done),Zo(e.done);if(e.done.length&&!Zo(e.done).ranges)return Zo(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Zo(e.done)}function mo(e,t,n,r){var i=e.history;i.undone.length=0;var s=+(new Date),o;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||t.origin.charAt(0)=="*"))&&(o=vo(i,i.lastOp==r))){var u=Zo(o.changes);vt(t.from,t.to)==0&&vt(t.from,u.to)==0?u.to=Zr(t):o.changes.push(ho(e,t))}else{var a=Zo(i.done);(!a||!a.ranges)&&bo(e.sel,i.done),o={changes:[ho(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,u||Ho(e,"historyAdded")}function go(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function yo(e,t,n,r){var i=e.history,s=r&&r.origin;n==i.lastSelOp||s&&i.lastSelOrigin==s&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==s||go(e,s,Zo(i.done),t))?i.done[i.done.length-1]=t:bo(t,i.done),i.lastSelTime=+(new Date),i.lastSelOrigin=s,i.lastSelOp=n,r&&r.clearRedo!==!1&&po(i.undone)}function bo(e,t){var n=Zo(t);n&&n.ranges&&n.equals(e)||t.push(e)}function wo(e,t,n,r){var i=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[s]=n.markedSpans),++s})}function Eo(e){if(!e)return null;for(var t=0,n;t<e.length;++t)e[t].marker.explicitlyCleared?n||(n=e.slice(0,t)):n&&n.push(e[t]);return n?n.length?n:null:e}function So(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(Eo(n[r]));return i}function xo(e,t,n){for(var r=0,i=[];r<e.length;++r){var s=e[r];if(s.ranges){i.push(n?Pt.prototype.deepCopy.call(s):s);continue}var o=s.changes,u=[];i.push({changes:u});for(var a=0;a<o.length;++a){var f=o[a],l;u.push({from:f.from,to:f.to,text:f.text});if(t)for(var c in f)(l=c.match(/^spans_(\d+)$/))&&tu(t,Number(l[1]))>-1&&(Zo(u)[c]=f[c],delete f[c])}}return i}function To(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function No(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i],o=!0;if(s.ranges){s.copied||(s=e[i]=s.deepCopy(),s.copied=!0);for(var u=0;u<s.ranges.length;u++)To(s.ranges[u].anchor,t,n,r),To(s.ranges[u].head,t,n,r);continue}for(var u=0;u<s.changes.length;++u){var a=s.changes[u];if(n<a.from.line)a.from=dt(a.from.line+r,a.from.ch),a.to=dt(a.to.line+r,a.to.ch);else if(t<=a.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function Co(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;No(e.done,n,r,i),No(e.undone,n,r,i)}function Ao(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==0}function Mo(e){return e.target||e.srcElement}function _o(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),d&&e.ctrlKey&&t==1&&(t=3),t}function jo(e,t){function s(e){return function(){e.apply(null,r)}}var n=e._handlers&&e._handlers[t];if(!n)return;var r=Array.prototype.slice.call(arguments,2),i;Xn?i=Xn.delayedCallbacks:Bo?i=Bo:(i=Bo=[],setTimeout(Fo,0));for(var o=0;o<n.length;++o)i.push(s(n[o]))}function Fo(){var e=Bo;Bo=null;for(var t=0;t<e.length;++t)e[t]()}function Io(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ho(e,n||t.type,e,t),Ao(t)||t.codemirrorIgnore}function qo(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var r=0;r<t.length;++r)tu(n,t[r])==-1&&n.push(t[r])}function Ro(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function Uo(e){e.prototype.on=function(e,t){Do(this,e,t)},e.prototype.off=function(e,t){Po(this,e,t)}}function Jo(){this.id=null}function Qo(e,t,n){for(var r=0,i=0;;){var s=e.indexOf("	",r);s==-1&&(s=e.length);var o=s-r;if(s==e.length||i+o>=t)return r+Math.min(o,t-i);i+=s-r,i+=n-i%n,r=s+1;if(i>=t)return r}}function Yo(e){while(Go.length<=e)Go.push(Zo(Go)+" ");return Go[e]}function Zo(e){return e[e.length-1]}function tu(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function nu(e,t){var n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ru(){}function iu(e,t){var n;return Object.create?n=Object.create(e):(ru.prototype=e,n=new ru),t&&su(t,n),n}function su(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function ou(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function fu(e,t){return t?t.source.indexOf("\\w")>-1&&au(e)?!0:t.test(e):au(e)}function lu(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function hu(e){return e.charCodeAt(0)>=768&&cu.test(e)}function pu(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function vu(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function mu(e,t){return vu(e).appendChild(t)}function yu(){return document.activeElement}function bu(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Su(e,t){var n=e.split(" ");for(var r=0;r<n.length;r++)n[r]&&!bu(n[r]).test(t)&&(t+=" "+n[r]);return t}function xu(e){if(!document.body.getElementsByClassName)return;var t=document.body.getElementsByClassName("CodeMirror");for(var n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Nu(){if(Tu)return;Cu(),Tu=!0}function Cu(){var e;Do(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,xu(gr)},100))}),Do(window,"blur",function(){xu(Qr)})}function Au(e){if(Lu==null){var t=pu("span","​");mu(e,pu("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Lu=t.offsetWidth<=1&&t.offsetHeight>2&&!(r&&i<8))}var n=Lu?pu("span","​"):pu("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Mu(e){if(Ou!=null)return Ou;var t=mu(e,document.createTextNode("AخA")),n=du(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=du(t,1,2).getBoundingClientRect();return Ou=r.right-n.right<3}function Bu(e){if(Hu!=null)return Hu;var t=mu(e,pu("span","x")),n=t.getBoundingClientRect(),r=du(t,0,1).getBoundingClientRect();return Hu=Math.abs(n.left-r.left)>1}function Fu(e,t,n,r){if(!e)return r(t,n,"ltr");var i=!1;for(var s=0;s<e.length;++s){var o=e[s];if(o.from<n&&o.to>t||t==n&&o.to==t)r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr"),i=!0}i||r(t,n,"ltr")}function Iu(e){return e.level%2?e.to:e.from}function qu(e){return e.level%2?e.from:e.to}function Ru(e){var t=lo(e);return t?Iu(t[0]):0}function Uu(e){var t=lo(e);return t?qu(Zo(t)):e.text.length}function zu(e,t){var n=ro(e.doc,t),r=ms(n);r!=n&&(t=uo(r));var i=lo(r),s=i?i[0].level%2?Uu(r):Ru(r):0;return dt(t,s)}function Wu(e,t){var n,r=ro(e.doc,t);while(n=ds(r))r=n.find(1,!0).line,t=null;var i=lo(r),s=i?i[0].level%2?Ru(r):Uu(r):r.text.length;return dt(t==null?uo(r):t,s)}function Xu(e,t){var n=zu(e,t.line),r=ro(e.doc,n.line),i=lo(r);if(!i||i[0].level==0){var s=Math.max(0,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=s&&t.ch;return dt(n.line,o?0:s)}return n}function Vu(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:t<n}function Ju(e,t){$u=null;for(var n=0,r;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(r!=null)return Vu(e,i.level,e[r].level)?(i.from!=i.to&&($u=r),n):(i.from!=i.to&&($u=n),r);r=n}}return r}function Ku(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&hu(e.text.charAt(t)));return t}function Qu(e,t,n,r){var i=lo(e);if(!i)return Gu(e,t,n,r);var s=Ju(i,t),o=i[s],u=Ku(e,t,o.level%2?-n:n,r);for(;;){if(u>o.from&&u<o.to)return u;if(u==o.from||u==o.to)return Ju(i,u)==s?u:(o=i[s+=n],n>0==o.level%2?o.to:o.from);o=i[s+=n];if(!o)return null;n>0==o.level%2?u=Ku(e,o.to,-1,r):u=Ku(e,o.from,1,r)}}function Gu(e,t,n,r){var i=t+n;if(r)while(i>0&&hu(e.text.charAt(i)))i+=n;return i<0||i>e.text.length?null:i}var e=/gecko\/\d/i.test(navigator.userAgent),t=/MSIE \d/.test(navigator.userAgent),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),r=t||n,i=r&&(t?document.documentMode||6:n[1]),s=/WebKit\//.test(navigator.userAgent),o=s&&/Qt\/\d+\.\d+/.test(navigator.userAgent),u=/Chrome\//.test(navigator.userAgent),a=/Opera\//.test(navigator.userAgent),f=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),c=/PhantomJS/.test(navigator.userAgent),h=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),p=h||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),d=h||/Mac/.test(navigator.platform),v=/win/i.test(navigator.platform),m=a&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(a=!1,s=!0);var g=d&&(o||a&&(m==null||m<12.11)),y=e||r&&i>=9,b=!1,w=!1;B.prototype=su({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+s+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(r==0&&this.overlayHack(),this.checkedOverlay=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=d&&!l?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,n=function(e){Mo(e)!=t.vert&&Mo(e)!=t.horiz&&rr(t.cm,wr)(e)};Do(this.vert,"mousedown",n),Do(this.horiz,"mousedown",n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},B.prototype),j.prototype=su({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},j.prototype),E.scrollbarModel={"native":B,"null":j},V.prototype.signal=function(e,t){Ro(e,t)&&this.events.push(arguments)},V.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ho.apply(null,this.events[e])};var dt=E.Pos=function(e,t){if(!(this instanceof dt))return new dt(e,t);this.line=e,this.ch=t},vt=E.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Et=null;Ct.prototype=su({init:function(e){function a(e){if(n.somethingSelected())Et=n.getSelections(),t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,u.value=Et.join("\n"),eu(u));else{if(!n.options.lineWiseCopyCut)return;var r=Tt(n);Et=r.text,e.type=="cut"?n.setSelections(r.ranges,null,Xo):(t.prevInput="",u.value=r.text.join("\n"),eu(u))}e.type=="cut"&&(n.state.cutIncoming=!0)}var t=this,n=this.cm,o=this.wrapper=kt(),u=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),h&&(u.style.width="0px"),Do(u,"input",function(){r&&i>=9&&t.hasSelection&&(t.hasSelection=null),t.poll()}),Do(u,"paste",function(){if(s&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var e=u.selectionStart,r=u.selectionEnd;u.value+="$",u.selectionEnd=r,u.selectionStart=e,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,t.fastPoll()}),Do(u,"cut",a),Do(u,"copy",a),Do(e.scroller,"paste",function(r){if(yr(e,r))return;n.state.pasteIncoming=!0,t.focus()}),Do(e.lineSpace,"selectstart",function(t){yr(e,t)||ko(t)}),Do(u,"compositionstart",function(){var e=n.getCursor("from");t.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Do(u,"compositionend",function(){t.composing&&(t.poll(),t.composing.range.clear(),t.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=rn(e);if(e.options.moveInputWithCursor){var i=jn(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-s.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-s.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;mu(n.cursorDiv,e.cursors),mu(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(this.contextMenuPending)return;var t,n,s=this.cm,o=s.doc;if(s.somethingSelected()){this.prevInput="";var u=o.sel.primary();t=Pu&&(u.to().line-u.from().line>100||(n=s.getSelection()).length>1e3);var a=t?"-":n||s.getSelection();this.textarea.value=a,s.state.focused&&eu(this.textarea),r&&i>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",r&&i>=9&&(this.hasSelection=null));this.inaccurateSelection=t},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!p||yu()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;if(e.pollingFast)return;e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,n)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(!e.state.focused||Du(t)&&!n||wt(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var s=t.value;if(s==n&&!e.somethingSelected())return!1;if(r&&i>=9&&this.hasSelection===s||d&&/[\uf700-\uf7ff]/.test(s))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=s.charCodeAt(0);o==8203&&!n&&(n="​");if(o==8666)return this.reset(),this.cm.execCommand("undo")}var u=0,a=Math.min(n.length,s.length);while(u<a&&n.charCodeAt(u)==s.charCodeAt(u))++u;var f=this;return nr(e,function(){St(e,s.slice(u),n.length-u,null,f.composing?"*compose":null),s.length>1e3||s.indexOf("\n")>-1?t.value=f.prevInput="":f.prevInput=s,f.composing&&(f.composing.range.clear(),f.composing.range=e.markText(f.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){r&&i>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function d(){if(u.selectionStart!=null){var e=n.somethingSelected(),r="​"+(e?u.value:"");u.value="⇚",u.value=r,t.prevInput=e?"":"​",u.selectionStart=1,u.selectionEnd=r.length,o.selForContextMenu=n.doc.sel}}function v(){t.contextMenuPending=!1,t.wrapper.style.position="relative",u.style.cssText=h,r&&i<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l);if(u.selectionStart!=null){(!r||r&&i<9)&&d();var e=0,s=function(){o.selForContextMenu==n.doc.sel&&u.selectionStart==0&&u.selectionEnd>0&&t.prevInput=="​"?rr(n,Hi.selectAll)(n):e++<10?o.detectingSelectAll=setTimeout(s,500):o.input.reset()};o.detectingSelectAll=setTimeout(s,200)}}var t=this,n=t.cm,o=n.display,u=t.textarea,f=br(n,e),l=o.scroller.scrollTop;if(!f||a)return;var c=n.options.resetSelectionOnContextMenu;c&&n.doc.sel.contains(f)==-1&&rr(n,Qt)(n.doc,jt(f),Xo);var h=u.style.cssText;t.wrapper.style.position="absolute",u.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(r?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(s)var p=window.scrollY;o.input.focus(),s&&window.scrollTo(null,p),o.input.reset(),n.somethingSelected()||(u.value=t.prevInput=" "),t.contextMenuPending=!0,o.selForContextMenu=n.doc.sel,clearTimeout(o.detectingSelectAll),r&&i>=9&&d();if(y){Oo(e);var m=function(){Po(window,"mouseup",m),setTimeout(v,20)};Do(window,"mouseup",m)}else setTimeout(v,50)},setUneditable:ru,needsContentAttribute:!1},Ct.prototype),Lt.prototype=su({init:function(e){function i(e){if(n.somethingSelected())Et=n.getSelections(),e.type=="cut"&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Tt(n);Et=t.text,e.type=="cut"&&n.operation(function(){n.setSelections(t.ranges,0,Xo),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!h)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Et.join("\n"));else{var r=kt(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Et.join("\n");var s=document.activeElement;eu(i),setTimeout(function(){n.display.lineSpace.removeChild(r),s.focus()},50)}}var t=this,n=t.cm,r=t.div=e.lineDiv;r.contentEditable="true",Nt(r),Do(r,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),n.replaceSelection(t,null,"paste"))}),Do(r,"compositionstart",function(e){var r=e.data;t.composing={sel:n.doc.sel,data:r,startData:r};if(!r)return;var i=n.doc.sel.primary(),s=n.getLine(i.head.line),o=s.indexOf(r,Math.max(0,i.head.ch-r.length));o>-1&&o<=i.head.ch&&(t.composing.sel=jt(dt(i.head.line,o),dt(i.head.line,o+r.length)))}),Do(r,"compositionupdate",function(e){t.composing.data=e.data}),Do(r,"compositionend",function(e){var n=t.composing;if(!n)return;e.data!=n.startData&&!/\u200b/.test(e.data)&&(n.data=e.data),setTimeout(function(){n.handled||t.applyComposition(n),t.composing==n&&(t.composing=null)},50)}),Do(r,"touchstart",function(){t.forceCompositionEnd()}),Do(r,"input",function(){if(t.composing)return;t.pollContent()||nr(t.cm,function(){ar(n)})}),Do(r,"copy",i),Do(r,"cut",i)},prepareSelection:function(){var e=rn(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){if(!e||!this.cm.display.view.length)return;e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e)},showPrimarySelection:function(){var t=window.getSelection(),n=this.cm.doc.sel.primary(),r=Mt(this.cm,t.anchorNode,t.anchorOffset),i=Mt(this.cm,t.focusNode,t.focusOffset);if(r&&!r.bad&&i&&!i.bad&&vt(yt(r,i),n.from())==0&&vt(gt(r,i),n.to())==0)return;var s=At(this.cm,n.from()),o=At(this.cm,n.to());if(!s&&!o)return;var u=this.cm.display.view,a=t.rangeCount&&t.getRangeAt(0);if(!s)s={node:u[0].measure.map[2],offset:0};else if(!o){var f=u[u.length-1].measure,l=f.maps?f.maps[f.maps.length-1]:f.map;o={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}try{var c=du(s.node,s.offset,o.offset,o.node)}catch(h){}c&&(t.removeAllRanges(),t.addRange(c),a&&t.anchorNode==null?t.addRange(a):e&&this.startGracePeriod()),this.rememberSelection()},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){mu(this.cm.display.cursorDiv,e.cursors),mu(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return gu(this.div,t)},focus:function(){this.cm.options.readOnly!="nocursor"&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}var e=this;this.selectionInEditor()?this.pollSelection():nr(this.cm,function(){e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,t)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=Mt(t,e.anchorNode,e.anchorOffset),r=Mt(t,e.focusNode,e.focusOffset);n&&r&&nr(t,function(){Qt(t.doc,jt(n,r),Xo);if(n.bad||r.bad)t.curOp.selectionChanged=!0})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var s;if(r.line==t.viewFrom||(s=cr(e,r.line))==0)var o=uo(t.view[0].line),u=t.view[0].node;else var o=uo(t.view[s].line),u=t.view[s-1].node.nextSibling;var a=cr(e,i.line);if(a==t.view.length-1)var f=t.viewTo-1,l=t.view[a].node;else var f=uo(t.view[a+1].line)-1,l=t.view[a+1].node.previousSibling;var c=_u(Dt(e,u,l,o,f)),h=io(e.doc,dt(o,0),dt(f,ro(e.doc,f).text.length));while(c.length>1&&h.length>1)if(Zo(c)==Zo(h))c.pop(),h.pop(),f--;else{if(c[0]!=h[0])break;c.shift(),h.shift(),o++}var p=0,d=0,v=c[0],m=h[0],g=Math.min(v.length,m.length);while(p<g&&v.charCodeAt(p)==m.charCodeAt(p))++p;var y=Zo(c),b=Zo(h),w=Math.min(y.length-(c.length==1?p:0),b.length-(h.length==1?p:0));while(d<w&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1))++d;c[c.length-1]=y.slice(0,y.length-d),c[0]=c[0].slice(p);var E=dt(o,p),S=dt(f,h.length?Zo(h).length-d:0);if(c.length>1||c[0]||vt(E,S))return ci(e.doc,c,E,S,"+input"),!0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing||this.composing.handled)return;this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus()},applyComposition:function(e){e.data&&e.data!=e.startData&&rr(this.cm,St)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),rr(this.cm,St)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},onContextMenu:ru,resetPosition:ru,needsContentAttribute:!0},Lt.prototype),E.inputStyles={textarea:Ct,contenteditable:Lt},Pt.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(vt(n.anchor,r.anchor)!=0||vt(n.head,r.head)!=0)return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ht(mt(this.ranges[t].anchor),mt(this.ranges[t].head));return new Pt(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(vt(t,r.from())>=0&&vt(e,r.to())<=0)return n}return-1}},Ht.prototype={from:function(){return yt(this.anchor,this.head)},to:function(){return gt(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Nn={left:0,right:0,top:0,bottom:0},Un,Xn=null,Vn=0,Er,Sr,Lr=0,Dr=0,Pr=null;r?Pr=-0.53:e?Pr=15:u?Pr=-0.7:f&&(Pr=-1/3);var Hr=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}};E.wheelEventPixels=function(e){var t=Hr(e);return t.x*=Pr,t.y*=Pr,t};var Ir=new Jo,zr=null,Zr=E.changeEnd=function(e){return e.text?dt(e.from.line+e.text.length-1,Zo(e.text).length+(e.text.length==1?e.from.ch:0)):e.to};E.prototype={constructor:E,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];if(n[e]==t&&e!="mode")return;n[e]=t,Ni.hasOwnProperty(e)&&rr(this,Ni[e])(this,t,r)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ri(e))},removeKeyMap:function(e){var t=this.state.keyMaps;for(var n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ir(function(e,t){var n=e.token?e:E.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:e,opaque:t&&t.opaque}),this.state.modeGen++,ar(this)}),removeOverlay:ir(function(e){var t=this.state.overlays;for(var n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e=="string"&&r.name==e){t.splice(n,1),this.state.modeGen++,ar(this);return}}}),indentLine:ir(function(e,t,n){typeof t!="string"&&typeof t!="number"&&(t==null?t=this.options.smartIndent?"smart":"prev":t=t?"add":"subtract"),Rt(this.doc,e)&&bi(this,e,t,n)}),indentSelection:ir(function(e){var t=this.doc.sel.ranges,n=-1;for(var r=0;r<t.length;r++){var i=t[r];if(!i.empty()){var s=i.from(),o=i.to(),u=Math.max(n,s.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var a=u;a<n;++a)bi(this,a,e);var f=this.doc.sel.ranges;s.ch==0&&t.length==f.length&&f[r].from().ch>0&&Vt(this.doc,r,new Ht(s,f[r].to()),Xo)}else i.head.line>n&&(bi(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&gi(this))}}),getTokenAt:function(e,t){return _s(this,e,t)},getLineTokens:function(e,t){return _s(this,dt(e),t,!0)},getTokenTypeAt:function(e){e=It(this.doc,e);var t=Hs(this,ro(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,s;if(i==0)s=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else{if(!(t[o*2+1]<i)){s=t[o*2+2];break}n=o+1}}var u=s?s.indexOf("cm-overlay "):-1;return u<0?s:u==0?null:s.slice(0,u-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?E.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!_i.hasOwnProperty(t))return n;var r=_i[t],i=this.getModeAt(e);if(typeof i[t]=="string")r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var s=0;s<i[t].length;s++){var o=r[i[t][s]];o&&n.push(o)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var s=0;s<r._global.length;s++){var u=r._global[s];u.pred(i,this)&&tu(n,u.val)==-1&&n.push(u.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=Ft(n,e==null?n.first+n.size-1:e),cn(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return e==null?n=r.head:typeof e=="object"?n=It(this.doc,e):n=e?r.from():r.to(),jn(this,n,t||"page")},charCoords:function(e,t){return Bn(this,It(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Hn(this,e,t||"page"),qn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Hn(this,{top:e,left:0},t||"page").top,ao(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,r;if(typeof e=="number"){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=ro(this.doc,e)}else r=e;return Pn(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-fo(r):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Wn(this.display)},setGutterMarker:ir(function(e,t,n){return wi(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&lu(r)&&(e.gutterMarkers=null),!0})}),clearGutter:ir(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,fr(t,r,"gutter"),lu(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if(typeof e=="number"){if(!Rt(this.doc,e))return null;var t=e;e=ro(this.doc,e);if(!e)return null}else{var t=uo(e);if(t==null)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var s=this.display;e=jn(this,It(this.doc,e));var o=e.bottom,u=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t);if(r=="over")o=e.top;else if(r=="above"||r=="near"){var a=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(r=="above"||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=o+"px",t.style.left=t.style.right="",i=="right"?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?u=0:i=="middle"&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&di(this,u,o,u+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:ir(Wr),triggerOnKeyPress:ir($r),triggerOnKeyUp:Vr,execCommand:function(e){if(Hi.hasOwnProperty(e))return Hi[e](this)},triggerElectric:ir(function(e){xt(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var s=0,o=It(this.doc,e);s<t;++s){o=Si(this.doc,o,i,n,r);if(o.hitSide)break}return o},moveH:ir(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Si(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},$o)}),deleteH:ir(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ei(this,function(n){var i=Si(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,s=r;t<0&&(i=-1,t=-t);for(var o=0,u=It(this.doc,e);o<t;++o){var a=jn(this,u,"div");s==null?s=a.left:a.left=s,u=xi(this,a,i,n);if(u.hitSide)break}return u},moveV:ir(function(e,t){var n=this,r=this.doc,i=[],s=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(o){if(s)return e<0?o.from():o.to();var u=jn(n,o.head,"div");o.goalColumn!=null&&(u.left=o.goalColumn),i.push(u.left);var a=xi(n,u,e,t);return t=="page"&&o==r.sel.primary()&&mi(n,null,Bn(n,a,"div").top-u.top),a},$o);if(i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=ro(t,e.line).text,r=e.ch,i=e.ch;if(n){var s=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;var o=n.charAt(r),u=fu(o,s)?function(e){return fu(e,s)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!fu(e)};while(r>0&&u(n.charAt(r-1)))--r;while(i<n.length&&u(n.charAt(i)))++i}return new Ht(dt(e.line,r),dt(e.line,i))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?Eu(this.display.cursorDiv,"CodeMirror-overwrite"):wu(this.display.cursorDiv,"CodeMirror-overwrite"),Ho(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==yu()},scrollTo:ir(function(e,t){(e!=null||t!=null)&&yi(this),e!=null&&(this.curOp.scrollLeft=e),t!=null&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-vn(this)-this.display.barHeight,width:e.scrollWidth-vn(this)-this.display.barWidth,clientHeight:gn(this),clientWidth:mn(this)}},scrollIntoView:ir(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t==null&&(t=this.options.cursorScrollMargin)):typeof e=="number"?e={from:dt(e,0),to:null}:e.from==null&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0;if(e.from.line!=null)yi(this),this.curOp.scrollToPos=e;else{var n=vi(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:ir(function(e,t){function r(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e}var n=this;e!=null&&(n.display.wrapper.style.width=r(e)),t!=null&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&On(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fr(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,Ho(n,"refresh",this)}),operation:function(e){return nr(this,e)},refresh:ir(function(){var e=this.display.cachedTextHeight;ar(this),this.curOp.forceUpdate=!0,Mn(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),M(this),(e==null||Math.abs(e-zn(this.display))>.5)&&k(this),Ho(this,"refresh",this)}),swapDoc:ir(function(e){var t=this.doc;return t.cm=null,no(this,e),Mn(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,jo(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Uo(E);var Ti=E.defaults={},Ni=E.optionHandlers={},ki=E.Init={toString:function(){return"CodeMirror.Init"}};Ci("value","",function(e,t){e.setValue(t)},!0),Ci("mode",null,function(e,t){e.doc.modeOption=t,x(e)},!0),Ci("indentUnit",2,x,!0),Ci("indentWithTabs",!1),Ci("smartIndent",!0),Ci("tabSize",4,function(e){T(e),Mn(e),ar(e)},!0),Ci("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("	")?"":"|	"),"g"),n!=E.Init&&e.refresh()}),Ci("specialCharPlaceholder",Rs,function(e){e.refresh()},!0),Ci("electricChars",!0),Ci("inputStyle",p?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Ci("rtlMoveVisually",!v),Ci("wholeLineUpdateBefore",!0),Ci("theme","default",function(e){L(e),A(e)},!0),Ci("keyMap","default",function(e,t,n){var r=Ri(t),i=n!=E.Init&&Ri(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),Ci("extraKeys",null),Ci("lineWrapping",!1,N,!0),Ci("gutters",[],function(e){P(e.options),A(e)},!0),Ci("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?X(e.display)+"px":"0",e.refresh()},!0),Ci("coverGutterNextToScrollbar",!1,function(e){I(e)},!0),Ci("scrollbarStyle","native",function(e){F(e),I(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Ci("lineNumbers",!1,function(e){P(e.options),A(e)},!0),Ci("firstLineNumber",1,A,!0),Ci("lineNumberFormatter",function(e){return e},A,!0),Ci("showCursorWhenSelecting",!1,nn,!0),Ci("resetSelectionOnContextMenu",!0),Ci("lineWiseCopyCut",!0),Ci("readOnly",!1,function(e,t){t=="nocursor"?(Qr(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),Ci("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Ci("dragDrop",!0,mr),Ci("cursorBlinkRate",530),Ci("cursorScrollMargin",0),Ci("cursorHeight",1,nn,!0),Ci("singleCursorHeightPerLine",!0,nn,!0),Ci("workTime",100),Ci("workDelay",100),Ci("flattenSpans",!0,T,!0),Ci("addModeClass",!1,T,!0),Ci("pollInterval",100),Ci("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Ci("historyEventDelay",1250),Ci("viewportMargin",10,function(e){e.refresh()},!0),Ci("maxHighlightLength",1e4,T,!0),Ci("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Ci("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Ci("autofocus",null);var Li=E.modes={},Ai=E.mimeModes={};E.defineMode=function(e,t){!E.defaults.mode&&e!="null"&&(E.defaults.mode=e),arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Li[e]=t},E.defineMIME=function(e,t){Ai[e]=t},E.resolveMode=function(e){if(typeof e=="string"&&Ai.hasOwnProperty(e))e=Ai[e];else if(e&&typeof e.name=="string"&&Ai.hasOwnProperty(e.name)){var t=Ai[e.name];typeof t=="string"&&(t={name:t}),e=iu(t,e),e.name=t.name}else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return E.resolveMode("application/xml");return typeof e=="string"?{name:e}:e||{name:"null"}},E.getMode=function(e,t){var t=E.resolveMode(t),n=Li[t.name];if(!n)return E.getMode(e,"text/plain");var r=n(e,t);if(Oi.hasOwnProperty(t.name)){var i=Oi[t.name];for(var s in i){if(!i.hasOwnProperty(s))continue;r.hasOwnProperty(s)&&(r["_"+s]=r[s]),r[s]=i[s]}}r.name=t.name,t.helperType&&(r.helperType=t.helperType);if(t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r},E.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),E.defineMIME("text/plain","null");var Oi=E.modeExtensions={};E.extendMode=function(e,t){var n=Oi.hasOwnProperty(e)?Oi[e]:Oi[e]={};su(t,n)},E.defineExtension=function(e,t){E.prototype[e]=t},E.defineDocExtension=function(e,t){Ys.prototype[e]=t},E.defineOption=Ci;var Mi=[];E.defineInitHook=function(e){Mi.push(e)};var _i=E.helpers={};E.registerHelper=function(e,t,n){_i.hasOwnProperty(e)||(_i[e]=E[e]={_global:[]}),_i[e][t]=n},E.registerGlobalHelper=function(e,t,n,r){E.registerHelper(e,t,r),_i[e]._global.push({pred:n,val:r})};var Di=E.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},Pi=E.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};E.innerMode=function(e,t){while(e.innerMode){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var Hi=E.commands={selectAll:function(e){e.setSelection(dt(e.firstLine(),0),dt(e.lastLine()),Xo)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Xo)},killLine:function(e){Ei(e,function(t){if(t.empty()){var n=ro(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:dt(t.head.line+1,0)}:{from:t.head,to:dt(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Ei(e,function(t){return{from:dt(t.from().line,0),to:It(e.doc,dt(t.to().line+1,0))}})},delLineLeft:function(e){Ei(e,function(e){return{from:dt(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Ei(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Ei(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(dt(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(dt(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return zu(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return Xu(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return Wu(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},$o)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},$o)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Xu(e,t.head):r},$o)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("	")},insertSoftTab:function(e){var t=[],n=e.listSelections(),r=e.options.tabSize;for(var i=0;i<n.length;i++){var s=n[i].from(),o=Ko(e.getLine(s.line),s.ch,r);t.push((new Array(r-o%r+1)).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){nr(e,function(){var t=e.listSelections(),n=[];for(var r=0;r<t.length;r++){var i=t[r].head,s=ro(e.doc,i.line).text;if(s){i.ch==s.length&&(i=new dt(i.line,i.ch-1));if(i.ch>0)i=new dt(i.line,i.ch+1),e.replaceRange(s.charAt(i.ch-1)+s.charAt(i.ch-2),dt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=ro(e.doc,i.line-1).text;o&&e.replaceRange(s.charAt(0)+"\n"+o.charAt(o.length-1),dt(i.line-1,o.length-1),dt(i.line,1),"+transpose")}}n.push(new Ht(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){nr(e,function(){var t=e.listSelections().length;for(var n=0;n<t;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0),gi(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Bi=E.keyMap={};Bi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Bi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Bi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},Bi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Bi["default"]=d?Bi.macDefault:Bi.pcDefault,E.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}var i=nu(n.split(" "),ji);for(var s=0;s<i.length;s++){var o,u;s==i.length-1?(u=i.join(" "),o=r):(u=i.slice(0,s+1).join(" "),o="...");var a=t[u];if(!a)t[u]=o;else if(a!=o)throw new Error("Inconsistent bindings for "+u)}delete e[n]}for(var f in t)e[f]=t[f];return e};var Fi=E.lookupKey=function(e,t,n,r){t=Ri(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Fi(e,t.fallthrough,n,r);for(var s=0;s<t.fallthrough.length;s++){var o=Fi(e,t.fallthrough[s],n,r);if(o)return o}}},Ii=E.isModifierKey=function(e){var t=typeof e=="string"?e:ju[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"},qi=E.keyName=function(e,t){if(a&&e.keyCode==34&&e["char"])return!1;var n=ju[e.keyCode],r=n;return r==null||e.altGraphKey?!1:(e.altKey&&n!="Alt"&&(r="Alt-"+r),(g?e.metaKey:e.ctrlKey)&&n!="Ctrl"&&(r="Ctrl-"+r),(g?e.ctrlKey:e.metaKey)&&n!="Cmd"&&(r="Cmd-"+r),!t&&e.shiftKey&&n!="Shift"&&(r="Shift-"+r),r)};E.fromTextArea=function(e,t){function r(){e.value=a.getValue()}t=t?su(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder);if(t.autofocus==null){var n=yu();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}if(e.form){Do(e.form,"submit",r);if(!t.leaveSubmitMethodAlone){var i=e.form,s=i.submit;try{var o=i.submit=function(){r(),i.submit=s,i.submit(),i.submit=o}}catch(u){}}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Po(e.form,"submit",r),typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var a=E(function(t){e.parentNode.insertBefore(t,e.nextSibling)},t);return a};var Ui=E.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Ui.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ko(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ko(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Ko(this.string,null,this.tabSize)-(this.lineStart?Ko(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if(typeof e!="string"){var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}var r=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var zi=0,Wi=E.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++zi};Uo(Wi),Wi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;t&&$n(e);if(Ro(this,"clear")){var n=this.find();n&&jo(this,"clear",n.from,n.to)}var r=null,i=null;for(var s=0;s<this.lines.length;++s){var o=this.lines[s],u=Yi(o.markedSpans,this);e&&!this.collapsed?fr(e,uo(o),"text"):e&&(u.to!=null&&(i=uo(o)),u.from!=null&&(r=uo(o))),o.markedSpans=Zi(o.markedSpans,u),u.from==null&&this.collapsed&&!ws(this.doc,o)&&e&&oo(o,zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var a=ms(this.lines[s]),f=_(a);f>e.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ar(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Zt(e.doc)),e&&jo(e,"markerCleared",e,this),t&&Kn(e),this.parent&&this.parent.clear()},Wi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);var n,r;for(var i=0;i<this.lines.length;++i){var s=this.lines[i],o=Yi(s.markedSpans,this);if(o.from!=null){n=dt(t?s:uo(s),o.from);if(e==-1)return n}if(o.to!=null){r=dt(t?s:uo(s),o.to);if(e==1)return r}}return n&&{from:n,to:r}},Wi.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;if(!e||!n)return;nr(n,function(){var r=e.line,i=uo(e.line),s=Sn(n,i);s&&(An(s),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0;if(!ws(t.doc,r)&&t.height!=null){var o=t.height;t.height=null;var u=Ts(t)-o;u&&oo(r,r.height+u)}})},Wi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||tu(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Wi.prototype.detachLine=function(e){this.lines.splice(tu(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var zi=0,Vi=E.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Uo(Vi),Vi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();jo(this,"clear")},Vi.prototype.find=function(e,t){return this.primary.find(e,t)};var Ss=E.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Uo(Ss),Ss.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=uo(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var s=Ts(this);oo(n,Math.max(0,n.height-s)),e&&nr(e,function(){xs(e,n,-s),fr(e,r,"widget")})},Ss.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Ts(this)-e;if(!r)return;oo(n,n.height+r),t&&nr(t,function(){t.curOp.forceUpdate=!0,xs(t,n,r)})};var Cs=E.Line=function(e,t,n){this.text=e,as(this,t),this.height=n?n(this):1};Uo(Cs),Cs.prototype.lineNo=function(){return uo(this)};var js={},Fs={};Ks.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Ls(i),jo(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},Qs.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var s=Math.min(t,i-e),o=r.height;r.removeInner(e,s),this.height-=o-r.height,i==s&&(this.children.splice(n--,1),r.parent=null);if((t-=s)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ks))){var u=[];this.collapse(u),this.children=[new Ks(u)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<=s){i.insertInner(e,t,n);if(i.lines&&i.lines.length>50){while(i.lines.length>50){var o=i.lines.splice(i.lines.length-25,25),u=new Ks(o);i.height-=u.height,this.children.splice(r+1,0,u),u.parent=this}this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Qs(t);if(!e.parent){var r=new Qs(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=tu(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=s}}};var Gs=0,Ys=E.Doc=function(e,t,n){if(!(this instanceof Ys))return new Ys(e,t,n);n==null&&(n=0),Qs.call(this,[new Ks([new Cs("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=dt(n,0);this.sel=jt(r),this.history=new co(null),this.id=++Gs,this.modeOption=t,typeof e=="string"&&(e=_u(e)),Js(this,{from:r,to:r,text:e}),Qt(this,jt(r),Xo)};Ys.prototype=iu(Qs.prototype,{constructor:Ys,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){var n=0;for(var r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=so(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:sr(function(e){var t=dt(this.first,0),n=this.first+this.size-1;si(this,{from:t,to:dt(n,ro(this,n).text.length),text:_u(e),origin:"setValue",full:!0},!0),Qt(this,jt(t))}),replaceRange:function(e,t,n,r){t=It(this,t),n=n?It(this,n):t,ci(this,e,t,n,r)},getRange:function(e,t,n){var r=io(this,It(this,e),It(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Rt(this,e))return ro(this,e)},getLineNumber:function(e){return uo(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ro(this,e)),ms(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return It(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:sr(function(e,t,n){$t(this,It(this,typeof e=="number"?dt(e,t||0):e),null,n)}),setSelection:sr(function(e,t,n){$t(this,It(this,e),It(this,t||e),n)}),extendSelection:sr(function(e,t,n){Wt(this,It(this,e),t&&It(this,t),n)}),extendSelections:sr(function(e,t){Xt(this,Ut(this,e,t))}),extendSelectionsBy:sr(function(e,t){Xt(this,nu(this.sel.ranges,e),t)}),setSelections:sr(function(e,t,n){if(!e.length)return;for(var r=0,i=[];r<e.length;r++)i[r]=new Ht(It(this,e[r].anchor),It(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qt(this,Bt(i,t),n)}),addSelection:sr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ht(It(this,e),It(this,t||e))),Qt(this,Bt(r,r.length-1),n)}),getSelection:function(e){var t=this.sel.ranges,n;for(var r=0;r<t.length;r++){var i=io(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||"\n")},getSelections:function(e){var t=[],n=this.sel.ranges;for(var r=0;r<n.length;r++){var i=io(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n")),t[r]=i}return t},replaceSelection:function(e,t,n){var r=[];for(var i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:sr(function(e,t,n){var r=[],i=this.sel;for(var s=0;s<i.ranges.length;s++){var o=i.ranges[s];r[s]={from:o.from(),to:o.to(),text:_u(e[s]),origin:n}}var u=t&&t!="end"&&ri(this,r,t);for(var s=r.length-1;s>=0;s--)si(this,r[s]);u?Kt(this,u):this.cm&&gi(this.cm)}),undo:sr(function(){ui(this,"undo")}),redo:sr(function(){ui(this,"redo")}),undoSelection:sr(function(){ui(this,"undo",!0)}),redoSelection:sr(function(){ui(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,t=0,n=0;for(var r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new co(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:xo(this.history.done),undone:xo(this.history.undone)}},setHistory:function(e){var t=this.history=new co(this.history.maxGeneration);t.done=xo(e.done.slice(0),null,!0),t.undone=xo(e.undone.slice(0),null,!0)},addLineClass:sr(function(e,t,n){return wi(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[r])e[r]=n;else{if(bu(n).test(e[r]))return!1;e[r]+=" "+n}return!0})}),removeLineClass:sr(function(e,t,n){return wi(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var s=i.match(bu(n));if(!s)return!1;var o=s.index+s[0].length;e[r]=i.slice(0,s.index)+(!s.index||o==i.length?"":" ")+i.slice(o)||null}return!0})}),addLineWidget:sr(function(e,t,n){return Ns(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Xi(this,It(this,e),It(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=It(this,e),Xi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=It(this,e);var t=[],n=ro(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=It(this,e),t=It(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(s){var o=s.markedSpans;if(o)for(var u=0;u<o.length;u++){var a=o[u];!(i==e.line&&e.ch>a.to||a.from==null&&i!=e.line||i==t.line&&a.from>t.ch)&&(!n||n(a.marker))&&r.push(a.marker.parent||a.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;if(i>e)return t=e,!0;e-=i,++n}),It(this,dt(n,t))},indexFromPos:function(e){e=It(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new Ys(so(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Ys(so(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ki(r,Ji(this)),r},unlinkDoc:function(e){e instanceof E&&(e=e.doc);if(this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Qi(Ji(this));break}if(e.history==this.history){var r=[e.id];to(e,function(e){r.push(e.id)},!0),e.history=new co(null),e.history.done=xo(this.history.done,r),e.history.undone=xo(this.history.undone,r)}},iterLinkedDocs:function(e){to(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),Ys.prototype.eachLine=Ys.prototype.iter;var Zs="iter insert remove copy getEditor".split(" ");for(var eo in Ys.prototype)Ys.prototype.hasOwnProperty(eo)&&tu(Zs,eo)<0&&(E.prototype[eo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ys.prototype[eo]));Uo(Ys);var ko=E.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Lo=E.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Oo=E.e_stop=function(e){ko(e),Lo(e)},Do=E.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Po=E.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},Ho=E.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(!n)return;var r=Array.prototype.slice.call(arguments,2);for(var i=0;i<n.length;++i)n[i].apply(null,r)},Bo=null,zo=30,Wo=E.Pass={toString:function(){return"CodeMirror.Pass"}},Xo={scroll:!1},Vo={origin:"*mouse"},$o={origin:"+move"};Jo.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Ko=E.countColumn=function(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=r||0,o=i||0;;){var u=e.indexOf("	",s);if(u<0||u>=t)return o+(t-s);o+=u-s,o+=n-o%n,s=u+1}},Go=[""],eu=function(e){e.select()};h?eu=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:r&&(eu=function(e){try{e.select()}catch(t){}});var uu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,au=E.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||uu.test(e))},cu=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,du;document.createRange?du=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:du=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var gu=E.contains=function(e,t){t.nodeType==3&&(t=t.parentNode);if(e.contains)return e.contains(t);do{t.nodeType==11&&(t=t.host);if(t==e)return!0}while(t=t.parentNode)};r&&i<11&&(yu=function(){try{return document.activeElement}catch(e){return document.body}});var wu=E.rmClass=function(e,t){var n=e.className,r=bu(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Eu=E.addClass=function(e,t){var n=e.className;bu(t).test(n)||(e.className+=(n?" ":"")+t)},Tu=!1,ku=function(){if(r&&i<9)return!1;var e=pu("div");return"draggable"in e||"dragDrop"in e}(),Lu,Ou,_u=E.splitLines="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Du=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Pu=function(){var e=pu("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Hu=null,ju={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};E.keyNames=ju,function(){for(var e=0;e<10;e++)ju[e+48]=ju[e+96]=String(e);for(var e=65;e<=90;e++)ju[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ju[e+111]=ju[e+63235]="F"+e}();var $u,Yu=function(){function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1773?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":n==8204?"b":"L"}function f(e,t,n){this.level=e,this.from=t,this.to=n}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,s=/[LRr]/,o=/[Lb1n]/,u=/[1n]/,a="L";return function(e){if(!r.test(e))return!1;var t=e.length,l=[];for(var c=0,h;c<t;++c)l.push(h=n(e.charCodeAt(c)));for(var c=0,p=a;c<t;++c){var h=l[c];h=="m"?l[c]=p:p=h}for(var c=0,d=a;c<t;++c){var h=l[c];h=="1"&&d=="r"?l[c]="n":s.test(h)&&(d=h,h=="r"&&(l[c]="R"))}for(var c=1,p=l[0];c<t-1;++c){var h=l[c];h=="+"&&p=="1"&&l[c+1]=="1"?l[c]="1":h==","&&p==l[c+1]&&(p=="1"||p=="n")&&(l[c]=p),p=h}for(var c=0;c<t;++c){var h=l[c];if(h==",")l[c]="N";else if(h=="%"){for(var v=c+1;v<t&&l[v]=="%";++v);var m=c&&l[c-1]=="!"||v<t&&l[v]=="1"?"1":"N";for(var g=c;g<v;++g)l[g]=m;c=v-1}}for(var c=0,d=a;c<t;++c){var h=l[c];d=="L"&&h=="1"?l[c]="L":s.test(h)&&(d=h)}for(var c=0;c<t;++c)if(i.test(l[c])){for(var v=c+1;v<t&&i.test(l[v]);++v);var y=(c?l[c-1]:a)=="L",b=(v<t?l[v]:a)=="L",m=y||b?"L":"R";for(var g=c;g<v;++g)l[g]=m;c=v-1}var w=[],E;for(var c=0;c<t;)if(o.test(l[c])){var S=c;for(++c;c<t&&o.test(l[c]);++c);w.push(new f(0,S,c))}else{var x=c,T=w.length;for(++c;c<t&&l[c]!="L";++c);for(var g=x;g<c;)if(u.test(l[g])){x<g&&w.splice(T,0,new f(1,x,g));var N=g;for(++g;g<c&&u.test(l[g]);++g);w.splice(T,0,new f(2,N,g)),x=g}else++g;x<c&&w.splice(T,0,new f(1,x,c))}return w[0].level==1&&(E=e.match(/^\s+/))&&(w[0].from=E[0].length,w.unshift(new f(0,0,E[0].length))),Zo(w).level==1&&(E=e.match(/\s+$/))&&(Zo(w).to-=E[0].length,w.push(new f(0,t-E[0].length,t))),w[0].level==2&&w.unshift(new f(1,w[0].to,w[0].to)),w[0].level!=Zo(w).level&&w.push(new f(w[0].level,t,t)),w}}();return E.version="5.3.0",E}),define("answer",["jquery","laconic"],function(){(function($){function answerHasOutput(e){return e.variables.length>0||e.residuals}function renderSubstitutions(e,t){t.push(', <span class="pl-comment">% where</span><br/>');for(var n=0;n<e.length;n++)t.push('<span class="where-binding">',"<span class='pl-var'>",e[n].var+"</span> = ",e[n].value,"</span>"),n<e.length-1&&t.push(",<br/>")}function renderAnswer(e){var t=[],n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length-1;s++)t.push("<span class='pl-ovar'>",i[s],"</span> = ","<span class='pl-var'>",i[s+1],"</span>, ");t.push("<span class='pl-ovar'>",i[i.length-1],"</span> = ",n[r].value),n[r].substitutions&&renderSubstitutions(n[r].substitutions,t),(r<n.length-1||e.residuals)&&t.push(",<br/>")}var o;if(o=e.residuals)for(var r=0;r<o.length;r++)t.push(o[r]),r<o.length-1&&t.push(",<br/>");return t.join("")}function renderTabledAnswer(e,t){function r(t){var n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length;s++)if(i[s]==t)return n[r]}return null}function u(){t.find("tr.projection th.residuals").length==0&&($("<th class='residuals'>Residual goals</th>").insertBefore(t.find("tr.projection th.answer-nth")),$("<td></td>").insertBefore(t.find("tr td.answer-nth")))}var n=[];for(var i=0;i<e.projection.length;i++){var s=e.projection[i],o=r(s);n.push("<td>"),o?(n.push(o.value),o.substitutions&&renderSubstitutions(o.substitutions,n)):n.push("<span class='pl-var'>",s,"</span>"),n.push("</td>")}var a;if(a=e.residuals){u(),n.push("<td>");for(var i=0;i<a.length;i++)n.push(a[i]),i<a.length-1&&n.push(",<br/>");n.push("</td>")}return e.nth&&n.push("<td class='answer-nth'>",e.nth,"</td>"),n.join("")}function evalScripts(elem){elem.find("script").each(function(){this.getAttribute("type")=="text/javascript"&&($.ajaxScript=$(this)),eval(this.textContent)}),$.ajaxScript&&delete $.ajaxScript}var pluginName="prologAnswer",methods={_init:function(e){return this.each(function(){var t=$(this);if(answerHasOutput(e))if(t.is("table")){var n=$.el.tr();t.append(n),n.innerHTML=renderTabledAnswer(e,t),evalScripts($(n)),$(n).find(".render-multi").renderMulti()}else t[0].innerHTML=renderAnswer(e),evalScripts(t),t.find(".render-multi").renderMulti();else t.append($.el.span({"class":"prolog-true"},"true"))})}};$.fn.prologAnswer=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}})(jQuery),function(e){function s(){var t=e("#render-select");return t[0]||(t=e(e.el.form({id:"render-select",style:"display:none"})),t.on("click",function(){var n=e("input[name=render]:checked",e(this)).val();t.data("target").renderMulti("select",parseInt(n))}),t.hover(function(){r=!0,u()},function(){a()}),e("body").append(t)),t}function o(){if(!r){var e=s(),t=e.data("target");t&&(t.removeClass("render-selecting"),e.data("target",null)),e.hide(400)}}function u(){n=setTimeout(function(){o()},400)}function a(){r=!1,u()}function f(t){var n=t.originalEvent.dataTransfer;return n.setData("Text",e(t.target).renderMulti("prologText")),!0}var t="renderMulti",n=0,r=!1,i={_init:function(n){return this.each(function(){var n=e(this),r={current:0},i=[],s=e.el.div({"class":"render-multi-active"}),o=0;n.children().each(function(){var t=e(this).css("display");i.push(t),o++==0?(n.css("display",t),e(this).attr("draggable",!1)):e(this).hide()}),r.display=i,n.append(s),e(s).hover(function(e){n.renderMulti("showSelect",e)},function(e){n.renderMulti("hideSelect",e)}),n.attr("draggable",!0).bind("dragstart",f),n.data(t,r)})},selectMenu:function(){var n=this.data(t),r=["<label>View as</label><br>"],i=this.children(),s=0;for(var s=0;s<n.display.length;s++){var o=e(i[s]),u=o.attr("data-render");u||(s==0?u="Default rendered":u="Alt rendered ["+(s+1)+"]"),r.push("<input type='radio' name='render' value='",s,"'"),s==n.current&&r.push(" checked"),r.push("> ",u,"<br>")}return r.push("</form"),r.join("")},showSelect:function(e){var t=this,i=s(),o=this.offset(),u;r=!0,n&&(clearTimeout(n),n=0),(u=i.data("target"))&&u.removeClass("render-selecting"),i.data("target",t),i.html(this.renderMulti("selectMenu")),i.css({top:o.top+5+"px",left:o.left+5+"px"}).show(400),this.addClass("render-selecting")},hideSelect:function(e){a()},select:function(n){var r=this.data(t),i=this.children(),s=r.display[n];e(i[r.current]).hide(400),e(i[n]).show(400,function(){e(this).css("display",s)}),this.css("display",s),e(i[n]).is("span.render-as-prolog")?this.attr("draggable",!1):this.attr("draggable",!0),r.current=n,o()},prologText:function(){return this.find("span.render-as-prolog").text()}};e.fn.renderMulti=function(n){if(i[n])return i[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return i._init.apply(this,arguments);e.error("Method "+n+" does not exist on jQuery."+t)}}(jQuery)}),define("runner",["jquery","config","preferences","cm/lib/codemirror","form","answer","laconic"],function(e,t,n,r,o){function u(t,n){n||(n={});var r=n.divClass,i=n.ulClass,s=e.el.div({"class":"btn-group dropdown"+(r?" "+r:"")},e.el.button({"class":"dropdown-toggle","data-toggle":"dropdown"},t),e.el.ul({"class":"dropdown-menu"+(i?" "+i:"")}));return n.actions&&a(e(s),n.client,n.actions),s}function a(t,n,r){function s(t){var r=e(t).data("action");return r&&r.call(n),!1}function o(t,n){var r=e.el.a(t);e(r).data("action",n),i.append(e.el.li(r))}var i=t.find(".dropdown-menu");for(var u in r)r.hasOwnProperty(u)&&o(u,r[u]);return i.on("click","a",function(){s(this)}),t}function f(t,n){var r=e.el.a({href:"#","class":"close btn btn-link btn-sm",title:n},e.el.span({"class":"glyphicon glyphicon-"+t}));return r}(function(e){var t="prologRunners",n={_init:function(n){return this.each(function(){function i(){var t=e.el.span();e(t).html("&#9776");var r=u(t,{divClass:"runners-menu",ulClass:"pull-right",client:n,actions:{"Collapse all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!0)},"Expand all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!1)},"Stop all":function(){this.find(".prolog-runner").prologRunner("stop")},Clear:function(){this.prologRunners("clear")}}});return r}var n=e(this),r={};r.stretch=e(e.el.div({"class":"stretch"})),r.inner=e(e.el.div({"class":"inner"})),n.append(i()),n.append(r.stretch),n.append(r.inner),n.on("pane.resize",function(){n.prologRunners("scrollToBottom",!0)}),n.data(t,r)})},run:function(t){var n=this.data("prologRunners");t.iconifyLast&&this.prologRunners("iconifyLast");var r=e.el.div({"class":"prolog-runner"});return n.inner.append(r),e(r).prologRunner(t),this.prologRunners("scrollToBottom"),this},clear:function(){this.find(".prolog-runner").prologRunner("close")},iconifyLast:function(){var t=e(this.inner).children().last();if(t.length==1){var n=t.prologRunner();n.alive()||n.toggleIconic(!0)}return this},scrollToBottom:function(t){return this.each(function(){var n=e(this),r=n.data("prologRunners"),i=r.inner.height(),s=n.height()-i-4-2;if(s>0||t!==!0)r.stretch.height(s>0?s:0),n.scrollTop(i)}),this}};e.fn.prologRunners=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery),function(e){function p(t){return e(t).parents(".prolog-runners")}function d(e,t){var n=e.find(".runner-results");return n.append(t),this}function v(e){switch(e){case"running":case"wait-next":case"wait-input":case"wait-debug":return!0;default:return!1}}function m(t){var n=[{"class":"projection"}];for(i=0;i<t.length;i++)n.push(e.el.th({"class":"pl-pvar"},t[i]));n.push(e.el.th({"class":"answer-nth"},""));var r=e.el.table({"class":"prolog-answers"},e.el.tbody(e.el.tr.apply(this,n)));return r}function g(t){var n=t.data(l);return e(t).parents(".trill_on_swish").trill_on_swish("breakpoints",n.prolog.id)}function y(){var t=this.pengine.options.runner,n=t.data(l),r={},i;n.query.editor&&e(n.query.editor).prologEditor("pengine",{add:this.pengine.id});if(i=g(t))r.breakpoints=Pengine.stringify(i);n.chunk&&(r.chunk=n.chunk),this.pengine.ask("'$trill_on_swish wrapper'((parse,query_expand("+k(n.query.query)+")"+"))",r),t.prologRunner("setState","running")}function b(){var t=this.pengine.options.runner;for(var n=0;n<this.data.length;n++){var r=this.data[n];this.projection&&(r.projection=this.projection),t.prologRunner("renderAnswer",r)}this.time>.1&&d(t,e.el.div({"class":"cputime"},e.el.span(this.time.toFixed(3)," seconds cpu time"))),t.prologRunner("setState",this.more?"wait-next":"true")}function w(){var t=this.pengine.options.runner;d(t,e.el.span({"class":"prolog-false"},"false")),t.prologRunner("setState","false")}function E(){var e=this.pengine.options.runner;e.prologRunner("setState","stopped")}function S(){var e=this.pengine.options.runner,t=e.data("prologRunner"),n=this.data||"Please enter a Prolog term";t.wait_for="term";if(typeof n=="object"){if(n.type=="trace")return e.prologRunner("trace",this);if(n.type=="jQuery")return e.prologRunner("jQuery",this);n.type=="console"?(n=n.prompt||"console> ",t.wait_for="line"):n=JSON.stringify(n)}e.prologRunner("setPrompt",n),e.prologRunner("setState","wait-input")}function x(){var t=this.pengine.options.runner;this.data=this.data.replace(new RegExp("'[-0-9a-f]{36}':","g"),""),this.location&&(this.data=this.data.replace(/pengine:\/\/[-0-9a-f]*\//,""),e(".trill_on_swish-event-receiver").trigger("source-error",this)),t.prologRunner("outputHTML",this.data),p(t).prologRunners("scrollToBottom")}function T(){var e=this.pengine.options.runner,t;this.code=="too_many_pengines"?t="Too many open queries.  Please complete some\nqueries by using |Next|, |Stop| or by\nclosing some queries.":t=String(this.data).replace(new RegExp("'"+this.pengine.id+"':","g"),""),e.prologRunner("error",t),e.prologRunner("setState","error")}function N(){var e=this.pengine.options.runner;e.prologRunner("error","** Execution aborted **"),e.prologRunner("setState","aborted")}function C(e){return e.variables.length>0||e.residuals}function k(t){return String(e.trim(t)).replace(/\.$/,"")}var l="prologRunner",c={59:"next",186:"next",32:"next",190:"stop",13:"stop",65:"stopOrAbort",27:"stopOrAbort",46:"close",112:"help"},h={_init:function(n){return this.each(function(){function o(){var t=e.el.button({title:"Close query"});return e(t).html("&times"),e(t).on("click",function(){i.prologRunner("close")}),t}function a(){var t=e.el.button({title:"Iconify query"},"_");return e(t).on("click",function(){i.prologRunner("toggleIconic")}),t}function l(){var t=e.el.button({title:"Download CSV"},"⇊");return e(t).on("click",function(){i.prologRunner("downloadCSV")}),t}function h(){var t=e.el.span({"class":"runner-state show-state idle"});return u(t)}function p(){function t(){i.prologRunner("next",1)}function n(){i.prologRunner("next",10)}function r(){i.prologRunner("next",100)}function o(){i.prologRunner("next",1e3)}function u(){s.prolog.stop()}function a(){s.prolog.abort()}function f(t,n){var r=e.el.button(n);return e(r).on("click",t),r}function l(){var t=e.el.input({"class":"prolog-input"}),n=e.el.button("Send");return e(t).keypress(function(n){if(n.which==13&&i.prologRunner("respond",e(t).val()))return e(t).val(""),n.preventDefault(),!1;n.key!="Esc"&&n.stopPropagation()}),e(n).on("click",function(){i.prologRunner("respond",e(t).val())}),{input:t,button:n}}var c=l(),h=e.el.div({"class":"controller show-state"},e.el.div({"class":"running"},f(a,"Abort")),e.el.div({"class":"wait-next"},f(t,"Next"),f(n,"10"),f(r,"100"),f(o,"1,000")," ",f(u,"Stop")),e.el.div({"class":"wait-input"},f(a,"Abort"),c.button,e.el.span(c.input)));return h}var i=e(this),s={};i.addClass("prolog-runner"),n.tabled&&i.addClass("tabled");if(n.title!=0){var d=e.el.span({"class":"query cm-s-prolog"});r.runMode(n.query,"prolog",d),i.append(e.el.div({"class":"runner-title ui-widget-header"},o(),a(),h(),d))}else{var v=f("remove-circle","Close");i.append(v),e(v).on("click",function(){i.prologRunner("close")})}return n.chunk&&(s.chunk=n.chunk),i.append(e.el.div({"class":"runner-results"})),i.append(p()),i.data("prologRunner",s),i.prologRunner("populateActionMenu"),i.keydown(function(e){i.prologRunner("getState")!="wait-input"&&!e.ctrlKey&&!e.altKey&&c[e.which]&&(e.preventDefault(),i.prologRunner(c[e.which]))}),s.savedFocus=document.activeElement,i.attr("tabindex",-1),i.focus(),s.query=n,s.answers=0,require([t.http.locations.pengines+"/pengines.js"],function(){s.prolog=new Pengine({server:t.http.locations.pengines,runner:i,application:"trill_on_swish",src:":- use_module(library(trill_on_swish/trill/trill)).\n	          :- use_module(library(trill_on_swish/translate_rdf)).\n	          :- use_module(library(pengines)).\n	          parse:- \n	             pengine_self(M),\n		     set_prolog_flag(M:unknwon,fail),\n		     load_owl('"+n.source+"').",destroy:!1,format:"json-html",oncreate:y,onsuccess:b,onfailure:w,onstop:E,onprompt:S,onoutput:x,onerror:T,onabort:N}),s.prolog.state="idle"}),this})},renderAnswer:function(t){var n=this.data("prologRunner"),r=++n.answers%2==0;if(n.query.tabled){if(n.answers!=1)return t.projection=n.projection,t.nth=n.answers,e(n.table).prologAnswer(t),this;if(t.projection&&t.projection.length>0){var i=m(t.projection);return d(this,i),n.table=i,n.projection=t.projection,t.nth=n.answers,e(n.table).prologAnswer(t),this}}var s=e.el.div({"class":"answer "+(r?"even":"odd")},e.el.span({"class":"answer-no"},n.answers));d(this,s),e(s).prologAnswer(t)},outputHTML:function(t){var n=e.el.span({"class":"output"});e(n).html(t),d(this,n)},error:function(t){d(this,e.el.pre({"class":"prolog-message msg-error"},t))},trace:function(t){function s(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(n,r,i){var s=e.el.button({"class":r,title:n},e.el.span(n));return e(s).on("click",function(n){i!==undefined&&(r+="("+Pengine.stringify(i(n))+")"),t.pengine.respond(r),e(n.target).parent().remove()}),s}var n=this,r=e.el.span({"class":"goal"}),i=t.data;e(r).html(i.goal),d(this,e.el.div({"class":"prolog-trace"},e.el.span({"class":"depth",style:"width:"+(i.depth*5-1)+"px"}," "),e.el.span({"class":"port "+i.port},s(i.port),":"),r)),i.port=="exception"&&d(this,e.el.div({"class":"prolog-exception"},i.exception.message)),d(this,e.el.div({"class":"trace-buttons"},o("Continue","nodebug",function(t){return g(e(t.target).closest(".prolog-runner"))}),o("Step into","continue"),o("Step over","skip"),o("Step out","up"),o("Retry","retry"),o("Abort","abort"))),this.closest(".trill_on_swish").find(".tabbed").trigger("trace-location",i),this.prologRunner("setState","wait-debug")},setPrompt:function(e){this.find(".controller input").attr("placeholder",e)},jQuery:function(t){var n=t.data,r;if(typeof n.selector=="string")r=e(n.selector);else if(typeof n.selector=="object"){switch(n.selector.root){case"this":root=this;break;case"trill_on_swish":root=this.closest(".trill_on_swish")}n.selector.sub==""?r=root:r=root.find(n.selector.sub)}console.log(r);var i=r[n.method].apply(r,n.arguments);console.log(i),t.pengine.respond(Pengine.stringify(i))},respond:function(t){var n=this.data("prologRunner");if(n.wait_for=="term"){s=k(t);if(s=="")return null}else s=Pengine.stringify(t+"\n");return d(this,e.el.div({"class":"response"},t)),n.prolog.respond(s),this},stop:function(){return this.each(function(){var t=e(this),n=t.data("prologRunner");n.prolog.stop()})},stopOrAbort:function(){return this.each(function(){var t=e(this),n=t.data("prologRunner"),r=t.prologRunner("getState");switch(r){case"running":case"wait-input":n.prolog.abort();break;case"wait-next":n.prolog.stop()}})},next:function(t){return this.each(function(){var n=e(this),r=n.data("prologRunner");r.prolog.next(t),n.prologRunner("setState","running")})},abort:function(){return this.each(function(){var t=e(this),n=t.data("prologRunner");n.prolog.abort()})},close:function(){if(this.length){var t=p(this);this.each(function(){var t=e(this),n=t.data("prologRunner");t.prologRunner("alive")&&(e(".prolog-editor").trigger("pengine-died",n.prolog.id),n.prolog.destroy())}),this.remove(),t.prologRunners("scrollToBottom",!0)}return this},help:function(){e(".trill_on_swish-event-receiver").trigger("help",{file:"runner.html"})},toggleIconic:function(e){return e==undefined?this.toggleClass("iconic"):e?this.addClass("iconic"):this.removeClass("iconic"),p(this).prologRunners("scrollToBottom",!0),this},populateActionMenu:function(t){var n=this.find(".runner-title .btn-group.dropdown");return t=e.extend({"Re-run":function(){console.log("Re-Run ",this)}},t),a(n,this,t),this},downloadCSV:function(r){var i=this,s=this.data("prologRunner"),u=[];r=r||{};if(r.projection){var a,f=r.format||"prolog",l="parse,query_expand("+s.query.query.replace(/\.\s*$/,"")+")";function c(t,n){return e.el.input({type:"hidden",name:t,value:n})}r.distinct&&(l="distinct(["+r.projection+"],("+l+"))");if(r.limit){var h=parseInt(r.limit.replace(/[ _]/g,""));if(typeof h!="number")return alert("Not an integer: ",r.limit),!1;l="limit("+h+",("+l+"))"}a=e.el.form({method:"POST",action:t.http.locations.pengines+"/create",target:"_blank"},c("format","csv"),c("chunk","100000000"),c("application","trill_on_swish"),c("ask",l),c("src_text",s.query.source),c("template",f+"("+r.projection+")")),e("body").append(a),a.submit(),e(a).remove()}else{this.find("span.query span.cm-var").each(function(){var t=e(this).text();u.indexOf(t)<0&&u.push(t)});function p(){var r=e.el.form({"class":"form-horizontal"},o.fields.projection(u.join(",")),o.fields.csvFormat(t.trill_on_swish.csv_formats,n.getVal("csvFormat")),o.fields.limit("10 000",!1),o.fields.buttons({label:"Download CSV",action:function(e,r){return e.preventDefault(),t.trill_on_swish.csv_formats.length>1&&n.setVal("csvFormat",r.format),i.prologRunner("downloadCSV",r),!1}}));this.append(r)}o.showDialog({title:"Download query results as CSV",body:p})}return this},setState:function(t){var n=this.data("prologRunner");if(!n)return;if(n.prolog.state!=t){var r=this.find(".show-state");r.removeClass(n.prolog.state).addClass(t),n.prolog.state=t,!v(t)&&n.savedFocus?(e(n.savedFocus).focus(),n.savedFocus=null):t=="wait-input"&&this.find("input").focus(),v(t)||(e(".prolog-editor").trigger("pengine-died",n.prolog.id),n.prolog.destroy())}if(t=="wait-next"||t=="true"){var i=p(this);setTimeout(function(){i.prologRunners("scrollToBottom")},100)}else p(this).prologRunners("scrollToBottom");return this},getState:function(){var e=this.data("prologRunner");return e.prolog?e.prolog.state:"idle"},alive:function(){return v(this.prologRunner("getState"))}};e.fn.prologRunner=function(t){if(h[t])return h[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return h._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+l)}}(jQuery)}),define("gitty",["jquery","config","form","modal","laconic"],function(e,t,n,r){function i(t,n){function i(e){(t[e]||n[e])&&t[e]!=n[e]&&(r[e]={from:t[e],to:n[e]})}var r={};i("author"),i("title"),i("data"),i("public"),i("example");if(d=o(t.tags,n.tags))r.tags=d;return e.isEmptyObject(r)?null:r}function s(t,n){var r={};for(var i in t)if(t.hasOwnProperty(i)){switch(typeof t[i]){case"object":if(e.isArray(t[i])&&!o(t[i],n[i]))continue;break;case"string":case"boolean":if(n[i]==t[i])continue}r[i]=t[i]}return r}function o(t,n){function s(e,t){var n=[];for(var r=0;r<t.length;r++)e.indexOf(t[r])<0&&n.push(t[r]);return n}var r,i={};return t=t||[],n=n||[],(r=s(t,n)).length>0&&(i.added=r),(r=s(n,t)).length>0&&(i.deleted=r),e.isEmptyObject(i)?null:i}return function(e){var s="gitty",o={_init:function(t){return this.each(function(){function u(t,n,r,i){var s={role:"presentation"},o=[];n&&o.push("active"),i&&o.push("disabled"),o!=[]&&(s.class=o.join(" "));var u=e.el.li(s,e.el.a({href:"#"+r,"data-toggle":"tab"},t));return u}var n=e(this),r=n.data(s)||{},i=t.meta,o;r.commits=[],r.commits[i.commit]=i,r.commit=i.commit,r.editor=t.editor,henabled=!Boolean(i.previous),o=e(e.el.div({"class":"tab-content"})),n.append(e.el.ul({"class":"nav nav-tabs"},u("Meta data",!0,"gitty-meta-data"),u("History",!1,"gitty-history",henabled),u("Changes",!1,"gitty-diff",henabled))),n.append(o),o.append(e.el.div({"class":"tab-pane fade in active gitty-meta-data",id:"gitty-meta-data"})),n.find('[href="#gitty-meta-data"]').on("show.bs.tab",function(e){n.gitty("showMetaData")}),o.append(e.el.div({"class":"tab-pane fade gitty-history",id:"gitty-history"})),n.find('[href="#gitty-history"]').on("show.bs.tab",function(e){n.gitty("showHistory")}),o.append(e.el.div({"class":"tab-pane fade gitty-diff",id:"gitty-diff"})),n.find('[href="#gitty-diff"]').on("show.bs.tab",function(e){n.gitty("showDiff")}),n.data(s,r),n.gitty("showMetaData")})},title:function(t){var n=e.el.span("File ",e.el.span({"class":"filename"},t.name));return t.symbolic!="HEAD"&&t.commit&&e(n).append("@",e.el.span({"class":"sha1 abbrev"},t.commit.substring(0,7))),n},showMetaData:function(){return this.each(function(){var t=e(this),r=t.data(s),i=t.find(".gitty-meta-data"),o,u=r.commits[r.commit];if(r.metaData==r.commit)return;r.metaData=r.commit,i.html(""),o=e.el.form({"class":"form-horizontal"},n.fields.fileName(u.name,u.public,u.example,!0),n.fields.title(u.title),n.fields.author(u.author),n.fields.date(u.time,"Date","date"),n.fields.tags(u.tags)),u.symbolic=="HEAD"&&e(o).append(n.fields.buttons({label:"Update meta data",action:function(e,t){return r.editor.storage("save",t,"only-meta-data"),!1}})),i.append(o)})},showHistory:function(){return this.each(function(){var i=e(this),o=i.data(s),u=i.find(".gitty-history"),a=o.commits[o.commit],f;if(o.history)return;u.html(""),u.append(e.el.table({"class":"table table-striped table-condensed gitty-history","data-click-to-select":!0,"data-single-select":!0},e.el.tr(e.el.th("Comment"),e.el.th("Date"),e.el.th("Author"),e.el.th("Changed")))),f=n.widgets.glyphIconButton("glyphicon-play",{title:"Open the highlighted version in SWISH"}),u.append(f),e(f).on("click",function(t){var n=i.find("tr.success");if(n.length==1){var r=n.data("commit");o.commits[r].symbolic=="HEAD"?file=o.commits[r].name:file=r,i.parents(".trill_on_swish").trill_on_swish("playFile",file),e("#ajaxModal").modal("hide")}return!1});var l=t.http.locations.web_storage+encodeURI(a.name);e.ajax({url:l,contentType:"application/json",type:"GET",data:{format:"history",depth:6,to:o.commit},success:function(e){i.gitty("fillHistoryTable",e),o.history=o.commit},error:function(e){r.ajaxError(jqXHR)}})})},fillHistoryTable:function(t){function f(t){var n,s,o=e.el.span();if(t.previous){if((n=r.commits[t.previous])&&(s=i(t,n)))for(var u in s)s.hasOwnProperty(u)&&e(o).append(e.el.span({"class":"change-type"},u))}else e(o).append("initial");return o}var n=this,r=this.data(s),o=this.find(".table.gitty-history");for(var u=0;u<t.length;u++){var a=t[u];r.commits[a.commit]||(r.commits[a.commit]=a)}for(var u=0;u<t.length;u++){var a=t[u],l;if(u==t.length-1&&a.previous&&!r.commit[a.previous])break;var c={"data-commit":a.commit};r.commit==a.commit&&(c.class="success"),l=e.el.tr(c,e.el.td({"class":"commit-message"},a.commit_message||"No comment"),e.el.td({"class":"date"},(new Date(a.time*1e3)).toLocaleString()),e.el.td({"class":"author"},a.author||"No author"),e.el.td({"class":"changes"},f(a))),o.append(l)}o.on("click","tr",function(t){var r=e(t.target).parents("tr"),i=r.data("commit");n.gitty("setCommit",i)})},setCommit:function(e){var t=this.data(s),n=this.parent(".modal-content").find("h2");return n.html(""),n.append(this.gitty("title",t.commits[e])),this.find("tr.success").removeClass("success"),this.find("tr[data-commit="+e+"]").addClass("success"),t.commit=e,this},showDiff:function(){return this.each(function(){var n=e(this),i=n.data(s);if(i.diff==i.commit)return;n.find(".gitty-diff").html("");var o=t.http.locations.web_storage+encodeURI(i.commit);e.ajax({url:o,contentType:"application/json",type:"GET",data:{format:"diff"},success:function(e){n.gitty("fillDiff",e),i.diff=i.commit},error:function(e){r.ajaxError(e)}})})},fillDiff:function(e){e.tags&&this.gitty("diffTags",e.tags),e.data&&this.gitty("udiffData",e.data)},diffTags:function(t){function s(t,n){i.append(e.el.span({"class":"diff-tag "+n},t))}var n=this.find(".gitty-diff"),r=e(e.el.div({"class":"diff-tags"},e.el.label("Tags"))),i=e(e.el.span({"class":"diff-tags"}));r.append(i);if(t.deleted.length){i.append("Removed: ");for(var o=0;o<t.deleted.length;o++)s(t.deleted[o],"deleted")}if(t.added.length){i.append(t.deleted.length?", ":"","Added: ");for(var o=0;o<t.added.length;o++)s(t.added[o],"added")}return n.append(r),this},udiffData:function(t){var n=this.find(".gitty-diff"),r=t.split("\n"),i=e(e.el.pre({"class":"udiff"}));for(var s=0;s<r.length;s++){var o=r[s],u={"@":"udiff-hdr"," ":"udiff-ctx","+":"udiff-add","-":"udiff-del"};i.append(e.el.span({"class":u[o.charAt(0)]},o),e.el.br())}n.append(i)}};e.fn.gitty=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+s)}}(jQuery),{diffMeta:i,reduceMeta:s,diffTags:o}});var __whitespace={" ":!0,"	":!0,"\n":!0,"\f":!0,"\r":!0},difflib={defaultJunkFunction:function(e){return __whitespace.hasOwnProperty(e)},stripLinebreaks:function(e){return e.replace(/^[\n\r]*|[\n\r]*$/g,"")},stringAsLines:function(e){var t=e.indexOf("\n"),n=e.indexOf("\r"),r=t>-1&&n>-1||n<0?"\n":"\r",i=e.split(r);for(var s=0;s<i.length;s++)i[s]=difflib.stripLinebreaks(i[s]);return i},__reduce:function(e,t,n){if(n!=null)var r=n,i=0;else{if(!t)return null;var r=t[0],i=1}for(;i<t.length;i++)r=e(r,t[i]);return r},__ntuplecomp:function(e,t){var n=Math.max(e.length,t.length);for(var r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.length==t.length?0:e.length<t.length?-1:1},__calculate_ratio:function(e,t){return t?2*e/t:1},__isindict:function(e){return function(t){return e.hasOwnProperty(t)}},__dictget:function(e,t,n){return e.hasOwnProperty(t)?e[t]:n},SequenceMatcher:function(e,t,n){this.set_seqs=function(e,t){this.set_seq1(e),this.set_seq2(t)},this.set_seq1=function(e){if(e==this.a)return;this.a=e,this.matching_blocks=this.opcodes=null},this.set_seq2=function(e){if(e==this.b)return;this.b=e,this.matching_blocks=this.opcodes=this.fullbcount=null,this.__chain_b()},this.__chain_b=function(){var e=this.b,t=e.length,n=this.b2j={},r={};for(var i=0;i<e.length;i++){var s=e[i];if(n.hasOwnProperty(s)){var o=n[s];t>=200&&o.length*100>t?(r[s]=1,delete n[s]):o.push(i)}else n[s]=[i]}for(var s in r)r.hasOwnProperty(s)&&delete n[s];var u=this.isjunk,a={};if(u){for(var s in r)r.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete r[s]);for(var s in n)n.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete n[s])}this.isbjunk=difflib.__isindict(a),this.isbpopular=difflib.__isindict(r)},this.find_longest_match=function(e,t,n,r){var i=this.a,s=this.b,o=this.b2j,u=this.isbjunk,a=e,f=n,l=0,c=null,h,p={},d=[];for(var v=e;v<t;v++){var m={},g=difflib.__dictget(o,i[v],d);for(var y in g)if(g.hasOwnProperty(y)){c=g[y];if(c<n)continue;if(c>=r)break;m[c]=h=difflib.__dictget(p,c-1,0)+1,h>l&&(a=v-h+1,f=c-h+1,l=h)}p=m}while(a>e&&f>n&&!u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&!u(s[f+l])&&i[a+l]==s[f+l])l++;while(a>e&&f>n&&u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&u(s[f+l])&&i[a+l]==s[f+l])l++;return[a,f,l]},this.get_matching_blocks=function(){if(this.matching_blocks!=null)return this.matching_blocks;var e=this.a.length,t=this.b.length,n=[[0,e,0,t]],r=[],i,s,o,u,a,f,l,c,h;while(n.length)a=n.pop(),i=a[0],s=a[1],o=a[2],u=a[3],h=this.find_longest_match(i,s,o,u),f=h[0],l=h[1],c=h[2],c&&(r.push(h),i<f&&o<l&&n.push([i,f,o,l]),f+c<s&&l+c<u&&n.push([f+c,s,l+c,u]));r.sort(difflib.__ntuplecomp);var p=0,d=0,v=0,m=0,g,y,b,w=[];for(var E in r)r.hasOwnProperty(E)&&(m=r[E],g=m[0],y=m[1],b=m[2],p+v==g&&d+v==y?v+=b:(v&&w.push([p,d,v]),p=g,d=y,v=b));return v&&w.push([p,d,v]),w.push([e,t,0]),this.matching_blocks=w,this.matching_blocks},this.get_opcodes=function(){if(this.opcodes!=null)return this.opcodes;var e=0,t=0,n=[];this.opcodes=n;var r,i,s,o,u,a=this.get_matching_blocks();for(var f in a)a.hasOwnProperty(f)&&(r=a[f],i=r[0],s=r[1],o=r[2],u="",e<i&&t<s?u="replace":e<i?u="delete":t<s&&(u="insert"),u&&n.push([u,e,i,t,s]),e=i+o,t=s+o,o&&n.push(["equal",i,e,s,t]));return n},this.get_grouped_opcodes=function(e){e||(e=3);var t=this.get_opcodes();t||(t=[["equal",0,1,0,1]]);var n,r,i,s,o,u;t[0][0]=="equal"&&(n=t[0],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[0]=[r,Math.max(i,s-e),s,Math.max(o,u-e),u]),t[t.length-1][0]=="equal"&&(n=t[t.length-1],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[t.length-1]=[r,i,Math.min(s,i+e),o,Math.min(u,o+e)]);var a=e+e,f=[],l=[];for(var c in t)t.hasOwnProperty(c)&&(n=t[c],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],r=="equal"&&s-i>a&&(f.push([r,i,Math.min(s,i+e),o,Math.min(u,o+e)]),l.push(f),f=[],i=Math.max(i,s-e),o=Math.max(o,u-e)),f.push([r,i,s,o,u]));return f&&(f.length!=1||f[0][0]!="equal")&&l.push(f),l},this.ratio=function(){return matches=difflib.__reduce(function(e,t){return e+t[t.length-1]},this.get_matching_blocks(),0),difflib.__calculate_ratio(matches,this.a.length+this.b.length)},this.quick_ratio=function(){var e,t;if(this.fullbcount==null){this.fullbcount=e={};for(var n=0;n<this.b.length;n++)t=this.b[n],e[t]=difflib.__dictget(e,t,0)+1}e=this.fullbcount;var r={},i=difflib.__isindict(r),s=numb=0;for(var n=0;n<this.a.length;n++)t=this.a[n],i(t)?numb=r[t]:numb=difflib.__dictget(e,t,0),r[t]=numb-1,numb>0&&s++;return difflib.__calculate_ratio(s,this.a.length+this.b.length)},this.real_quick_ratio=function(){var e=this.a.length,t=this.b.length;return _calculate_ratio(Math.min(e,t),e+t)},this.isjunk=n?n:difflib.defaultJunkFunction,this.a=this.b=null,this.set_seqs(e,t)}};define("difflib",function(){}),diffview={buildView:function(e){function a(e,t){var n=document.createElement(e);return n.className=t,n}function f(e,t){var n=document.createElement(e);return n.appendChild(document.createTextNode(t)),n}function l(e,t,n){var r=document.createElement(e);return r.className=t,r.appendChild(document.createTextNode(n)),r}function v(e,t,n,r,i){return t<n?(e.appendChild(f("th",(t+1).toString())),e.appendChild(l("td",i,r[t].replace(/\t/g,"    "))),t+1):(e.appendChild(document.createElement("th")),e.appendChild(a("td","empty")),t)}function m(e,t,n,r,i){e.appendChild(f("th",t==null?"":(t+1).toString())),e.appendChild(f("th",n==null?"":(n+1).toString())),e.appendChild(l("td",i,r[t!=null?t:n].replace(/\t/g,"    ")))}var t=e.baseTextLines,n=e.newTextLines,r=e.opcodes,i=e.baseTextName?e.baseTextName:"Base Text",s=e.newTextName?e.newTextName:"New Text",o=e.contextSize,u=e.viewType==0||e.viewType==1?e.viewType:0;if(t==null)throw"Cannot build diff view; baseTextLines is not defined.";if(n==null)throw"Cannot build diff view; newTextLines is not defined.";if(!r)throw"Canno build diff view; opcodes is not defined.";var c=document.createElement("thead"),h=document.createElement("tr");c.appendChild(h),u?(h.appendChild(document.createElement("th")),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i+" vs. "+s))):(h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i)),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",s))),c=[c];var p=[],d;for(var g=0;g<r.length;g++){code=r[g],change=code[0];var y=code[1],b=code[2],w=code[3],E=code[4],S=Math.max(b-y,E-w),x=[],T=[];for(var N=0;N<S;N++){if(o&&r.length>1&&(g>0&&N==o||g==0&&N==0)&&change=="equal"){var C=S-(g==0?1:2)*o;if(C>1){x.push(h=document.createElement("tr")),y+=C,w+=C,N+=C-1,h.appendChild(f("th","...")),u||h.appendChild(l("td","skip","")),h.appendChild(f("th","...")),h.appendChild(l("td","skip",""));if(g+1==r.length)break;continue}}x.push(h=document.createElement("tr")),u?change=="insert"?m(h,null,w++,n,change):change=="replace"?(T.push(d=document.createElement("tr")),y<b&&m(h,y++,null,t,"delete"),w<E&&m(d,null,w++,n,"insert")):change=="delete"?m(h,y++,null,t,change):m(h,y++,w++,t,change):(y=v(h,y,b,t,change),w=v(h,w,E,n,change))}for(var N=0;N<x.length;N++)p.push(x[N]);for(var N=0;N<T.length;N++)p.push(T[N])}p.push(h=l("th","author","diff view generated by ")),h.setAttribute("colspan",u?3:4),h.appendChild(d=f("a","jsdifflib")),d.setAttribute("href","http://github.com/cemerick/jsdifflib"),c.push(h=document.createElement("tbody"));for(var g in p)p.hasOwnProperty(g)&&h.appendChild(p[g]);h=a("table","diff"+(u?" inlinediff":""));for(var g in c)c.hasOwnProperty(g)&&h.appendChild(c[g]);return h}},define("diffview",function(){}),define("diff",["jquery","difflib","diffview"],function(){(function(e){var t="diff",n={_init:function(t){return this.each(function(){var n=difflib.stringAsLines(t.base),r=difflib.stringAsLines(t.head),i=new difflib.SequenceMatcher(n,r),s=i.get_opcodes(),o=t.contextSize==undefined?3:t.contextSize;this.appendChild(diffview.buildView({baseTextLines:n,newTextLines:r,opcodes:s,baseTextName:t.baseName||"Base text",newTextName:t.headName||"Current text",contextSize:o,viewType:e("inline").checked?1:0}))})}};e.fn.diff=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),define("storage",["jquery","config","modal","form","gitty","history","tabbed","laconic","diff"],function(e,t,n,r,i,s,o){function u(e){return e?e.split(".").slice(0,-1).join("."):null}function a(e){return e?e.split("/").pop():null}(function(e){function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function p(t,n){var r=e.el.table({"class":"table table-striped"});e(r).append(e.el.tr(e.el.th("Path"),e.el.td(n.path))),e(r).append(e.el.tr(e.el.th("Modified"),e.el.td((new Date(n.last_modified*1e3)).toLocaleString()))),e(r).append(e.el.tr(e.el.th("Loaded"),e.el.td(n.modified_since_loaded?"yes (modified)":n.loaded?"yes":"no"))),t.append(r)}var f="storage",l={typeName:"program"},c={_init:function(t){return this.each(function(){function i(t,n){var r=e(t.target);if(r.hasClass("storage")&&r.is(":visible")){var i=r.storage.apply(r,Array.prototype.slice.call(arguments,1));if(i=="propagate")return}t.stopPropagation()}var n=e(this),r=e.extend({},l,t);n.addClass("storage");if(t.title||t.file||t.url){var s=t.file;!s&&t.url&&(s=t.url.split("/").pop()),n.tabbed("title",t.title||u(s),s?s.split(".").pop():"pl")}n.on("source",function(e,t){i(e,"setSource",t)}),n.on("save",function(e,t){i(e,"save",t)}),n.on("download",function(e){i(e,"download")}),n.on("fileInfo",function(e){i(e,"info")}),n.on("diff",function(e){i(e,"diff")}),n.on("revert",function(e){i(e,"revert")}),n.on("activate-tab",function(e){}),e(window).bind("beforeunload",function(e){return n.storage("unload","beforeunload",e)}),n.data(f,r)})},setSource:function(e){function l(e){return e?e.split("/").pop():null}var n=this.data(f),r=o.tabTypes[n.typeName];typeof e=="string"&&(e={data:e});if(e.newTab)return"propagate";if(e.meta&&e.meta.name||e.url){var i=e.meta&&e.meta.name?e.meta.name:e.url,a=i.split(".").pop();if(a!=r.dataType)return"propagate"}if(this.storage("unload","setSource")==0)return!1;e.meta?(n.file=e.meta.name,n.meta=e.meta,n.url=null):(n.file=null,n.meta=null),n.url=e.url||undefined,n.type=e.type||undefined,n.setValue(e),n.cleanGeneration=n.changeGen(),n.cleanData=e.data,n.cleanCheckpoint=e.cleanCheckpoint||"load";var c=u(n.file)||u(l(e.url))||r.label;return e.url||(e.url=t.http.locations.trill_on_swish),this.tabbed("title",c,r.dataType),e.noHistory||s.push(e),this},load:function(r){if(r){var i=this,s=this.data(f);e.ajax({url:t.http.locations.web_storage+r,dataType:"text",success:function(e){i.storage("setSource",{data:e,meta:{name:r}})},error:function(e){n.ajaxError(jqXHR)}})}return this},revert:function(){var e=this.data(f);return e.setValue(e.cleanData),this},save:function(r,u){var a=this.data(f),l=o.tabTypes[a.typeName],c=t.http.locations.web_storage,h="POST",p=this,d;if(a.type!="filesys"&&a.type!="external"||!a.url){if(r=="as")return this.storage("saveAs"),this;a.file&&(!r||!r.name||r.name==a.file)&&(c+=encodeURI(a.file),h="PUT");if(u=="only-meta-data"){r=i.reduceMeta(r,a.meta);if(e.isEmptyObject(r)){alert("No change");return}d={update:"meta-data"}}else if(h=="POST")d={data:a.getValue(),type:l.dataType},a.meta&&(d.previous=a.meta.commit);else if(!a.isClean(a.cleanGeneration))d={data:a.getValue(),type:l.dataType};else if(i.diffTags(a.meta.tags,r.tags)==null){alert("No change");return}return r&&(d.meta=r),e.ajax({url:c,dataType:"json",contentType:"application/json",type:h,data:JSON.stringify(d),success:function(e){e.error?alert(JSON.stringify(e)):(a.meta&&a.meta.example!=e.meta.example&&p.closest(".trill_on_swish").trigger("examples-changed"),a.file=e.file,a.meta=e.meta,a.type="gitty",a.cleanGeneration=a.changeGen(),a.cleanData=a.getValue(),a.cleanCheckpoint="save",n.feedback({html:"Saved",owner:p}),p.tabbed("title",r.name),s.push(e))},error:function(e){n.ajaxError(e)}}),this}return this.storage("saveURL")},saveAs:function(){function l(){this.append(e.el.form({"class":"form-horizontal"},r.fields.fileName(u?null:t.file,n.public,n.example),r.fields.title(n.title),r.fields.author(n.author),s?r.fields.commit_message():undefined,r.fields.tags(n.tags),r.fields.buttons({label:u?"Fork "+a.label:s?"Update "+a.label:"Save "+a.label,action:function(e,t){return i.storage("save",t),!1}})))}var t=this.data(f),n=t.meta||{},i=this,s=Boolean(t.file),u=t.meta&&n.symbolic!="HEAD",a=o.tabTypes[t.typeName];return n.public===undefined&&(n.public=!0),r.showDialog({title:u?"Fork from "+n.commit.substring(0,7):s?"Save new version":"Save "+a.label+" as",body:l}),this},saveURL:function(){var t=this.data(f),r=t.getValue(),i=o.type(t.url)||{},s=this;return t.isClean(t.cleanGeneration)?(alert("No change"),this):(e.ajax({url:t.url,dataType:"json",contentType:i.contentType||"text/plain",type:"PUT",data:r,success:function(e){e.error?alert(JSON.stringify(e)):(t.cleanGeneration=t.changeGen(),t.cleanData=t.getValue(),t.cleanCheckpoint="save",n.feedback({html:"Saved",owner:s}))},error:function(e){n.ajaxError(e)}}),this)},download:function(){var t=this.data(f),n=o.tabTypes[t.typeName],r=t.getValue(),i="data:text/plain;charset=UTF-8,"+encodeURIComponent(r),s=e.el.a({href:i,download:t.file||"trill_on_swish."+n.dataType});return this.append(s),s.click(),e(s).remove(),this},getData:function(t){var n=[];return t=t||{},this.each(function(){var r=e(this).data(f),i={};i.type=r.type,r.url&&(i.url=r.url);if(r.meta){function s(e){r.meta[e]&&(i[e]=r.meta[e])}s("name"),s("path"),s("modified"),s("loaded"),s("modified_since_loaded"),s("module")}e(this).closest(".tab-pane.active").length==1&&(i.active=!0);if(!t.type||t.name&&t.name.split(".").pop()==t.type){if(t.data){var o=r.getValue();i.modified=o!=r.cleanData;if(t.data==1||i.modified&&t.data=="if_modified")i.data=o}n.push(i)}}),n},match:function(t){for(var n=0;n<this.length;n++){me=e(this[n]);var r=me.data(f);if(t.file&&t.file==r.file)return me;if(t.url&&t.url==r.url)return me}},expose:function(e){var t=this.closest(".tab-pane");if(t.length==1){var r=t.closest(".tabbed");return r.tabbed("show",t.attr("id")),e&&n.feedback({html:e,owner:this}),this}},info:function(){function o(){t.type=="gitty"?(t.editor=i,this.gitty(t)):t.type=="filesys"?p(this,n):t.type||this.append(e.el.p("The source is not associated with a file. ","Use ",e.el.b("Save ...")," to save the source with meta information."))}var t=this.data(f),n=t.meta||{},i=this,s;return t.type=="gitty"?s=e().gitty("title",n):t.type=="filesys"?s="File system -- "+a(n.path):t.type=="external"?s="External -- "+t.url:s="Scratch source",r.showDialog({title:s,body:o}),this},diff:function(){function i(){var r=e.el.div(),i=t.getValue();this.append(r),i==t.cleanData?e(r).append(e.el.p("No changes")):(e(r).diff({base:t.cleanData,head:i,baseName:n[t.cleanCheckpoint]}),this.parents("div.modal-dialog").addClass("modal-wide"))}var t=this.data(f),n={load:"Loaded text","new":"New text",save:"Saved text"};return r.showDialog({title:"Changes since "+n[t.cleanCheckpoint],body:i}),this},unload:function(e,t){var n=this.data(f);if(!n)return undefined;n.meta&&s.addRecent({type:"gitty",id:n.meta.name});if(n.cleanData!=n.getValue()){if(e=="beforeunload"){var r="The source editor has unsaved changes.\nThese will be lost if you leave the page";return t=t||window.event,t&&(t.returnValue=r),r}var r="The source editor has unsaved changes.\nThese will be lost"+(e=="setSource"?" if you load a new program":e=="closetab"?" close this tab":"");return confirm(r)}return undefined}};e.fn.storage=function(t){if(c[t])return c[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return c._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+f)}})(jQuery)}),function(e,t){var n=typeof module!="undefined";n&&(e=global);var r="0123456789abcdef".split(""),i=[-2147483648,8388608,32768,128],s=[24,16,8,0],o=[],u=function(e){var t=typeof e!="string";t&&e.constructor==ArrayBuffer&&(e=new Uint8Array(e));var n,u,a,f,l,c=0,h,p=!1,d,v,m,g,y=0,b=0,w=0,E=e.length;n=1732584193,u=4023233417,a=2562383102,f=271733878,l=3285377520;do{o[0]=c,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0;if(t)for(m=b;y<E&&m<64;++y)o[m>>2]|=e[y]<<s[m++&3];else for(m=b;y<E&&m<64;++y)h=e.charCodeAt(y),h<128?o[m>>2]|=h<<s[m++&3]:h<2048?(o[m>>2]|=(192|h>>6)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):h<55296||h>=57344?(o[m>>2]|=(224|h>>12)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):(h=65536+((h&1023)<<10|e.charCodeAt(++y)&1023),o[m>>2]|=(240|h>>18)<<s[m++&3],o[m>>2]|=(128|h>>12&63)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]);w+=m-b,b=m-64,y==E&&(o[m>>2]|=i[m&3],++y),c=o[16],y>E&&m<56&&(o[15]=w<<3,p=!0);for(g=16;g<80;++g)d=o[g-3]^o[g-8]^o[g-14]^o[g-16],o[g]=d<<1|d>>>31;var S=n,x=u,T=a,N=f,C=l;for(g=0;g<20;g+=5)v=x&T|~x&N,d=S<<5|S>>>27,C=d+v+C+1518500249+o[g]<<0,x=x<<30|x>>>2,v=S&x|~S&T,d=C<<5|C>>>27,N=d+v+N+1518500249+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|~C&x,d=N<<5|N>>>27,T=d+v+T+1518500249+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|~N&S,d=T<<5|T>>>27,x=d+v+x+1518500249+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|~T&C,d=x<<5|x>>>27,S=d+v+S+1518500249+o[g+4]<<0,T=T<<30|T>>>2;for(;g<40;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C+1859775393+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N+1859775393+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T+1859775393+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x+1859775393+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S+1859775393+o[g+4]<<0,T=T<<30|T>>>2;for(;g<60;g+=5)v=x&T|x&N|T&N,d=S<<5|S>>>27,C=d+v+C-1894007588+o[g]<<0,x=x<<30|x>>>2,v=S&x|S&T|x&T,d=C<<5|C>>>27,N=d+v+N-1894007588+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|C&x|S&x,d=N<<5|N>>>27,T=d+v+T-1894007588+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|N&S|C&S,d=T<<5|T>>>27,x=d+v+x-1894007588+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|T&C|N&C,d=x<<5|x>>>27,S=d+v+S-1894007588+o[g+4]<<0,T=T<<30|T>>>2;for(;g<80;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C-899497514+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N-899497514+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T-899497514+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x-899497514+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S-899497514+o[g+4]<<0,T=T<<30|T>>>2;n=n+S<<0,u=u+x<<0,a=a+T<<0,f=f+N<<0,l=l+C<<0}while(!p);return r[n>>28&15]+r[n>>24&15]+r[n>>20&15]+r[n>>16&15]+r[n>>12&15]+r[n>>8&15]+r[n>>4&15]+r[n&15]+r[u>>28&15]+r[u>>24&15]+r[u>>20&15]+r[u>>16&15]+r[u>>12&15]+r[u>>8&15]+r[u>>4&15]+r[u&15]+r[a>>28&15]+r[a>>24&15]+r[a>>20&15]+r[a>>16&15]+r[a>>12&15]+r[a>>8&15]+r[a>>4&15]+r[a&15]+r[f>>28&15]+r[f>>24&15]+r[f>>20&15]+r[f>>16&15]+r[f>>12&15]+r[f>>8&15]+r[f>>4&15]+r[f&15]+r[l>>28&15]+r[l>>24&15]+r[l>>20&15]+r[l>>16&15]+r[l>>12&15]+r[l>>8&15]+r[l>>4&15]+r[l&15]};if(!e.JS_SHA1_TEST&&typeof module!="undefined"){var a=require("crypto"),f=require("buffer").Buffer;module.exports=function(e){return typeof e=="string"?a.createHash("sha1").update(e,"utf8").digest("hex"):(e.constructor==ArrayBuffer&&(e=new Uint8Array(e)),a.createHash("sha1").update(new f(e)).digest("hex"))}}else e&&(e.sha1=u)}(this),define("sha1",function(){}),define("notebook",["jquery","config","tabbed","form","laconic","runner","storage","sha1"],function(e,t,n,r){function s(t,n,r,i,s){s=s||"sm";var o=e.el.a({href:"#","class":"btn btn-"+i+" btn-"+s,title:r,"data-action":n},e.el.span({"class":"glyphicon glyphicon-"+t}));return o}function o(){return e.el.span({"class":"thin-space"}," ")}var i={program:{label:"Program"},query:{label:"Query"},markdown:{label:"Markdown"}};(function(e){function a(t){var n=e(t).find(".nb-cell.active");return n.length==1?n.first():null}function f(t){function n(e){attrs=e.match(/[-a-z]+="[^"]*"/g);if(attrs){var t=e.match(/^<[a-z]* /);for(var n=0;n<attrs.length;n++){var r=attrs[n].split(/=(.*)/);attrs[n]=r[0].toLowerCase()+"="+r[1]}return t[0]+attrs.sort().join(" ")+">"}return e}var r=e(e.el.div(t)).html();return r.replace(/(<div [^>]*>|<\/div>)/g,function(e){return"\n"+n(e)+"\n"}).slice(1)}var r="notebook",i=null,u={_init:function(t){return this.each(function(){var t=e(this),n={},i={},u,a;t.addClass("notebook"),t.addClass("trill_on_swish-event-receiver"),t.append(u=e.el.div({"class":"nb-toolbar"},s("trash","delete","Delete cell","warning"),s("copy","copy","Copy cell","default"),s("paste","paste","Paste cell below","default"),o(),s("chevron-up","up","Move cell up","default"),s("chevron-down","down","Move cell down","default"),o(),s("plus","insertBelow","Insert cell below","primary"))),t.append(e.el.div({"class":"nb-view",tabIndex:"-1"},a=e.el.div({"class":"nb-content"}),e.el.div({"class":"nb-bottom"}))),e(u).on("click","a.btn",function(n){var r=e(n.target).closest("a").data("action");return t.notebook(r),n.preventDefault(),!1}),e(a).on("click",".nb-cell-buttons a.btn",function(t){var n=e(t.target).closest("a"),r=n.closest(".nb-cell"),i=n.data("action");return r.nbCell(i),t.preventDefault(),!1}),t.focusin(function(n){var r=e(n.target).closest(".nb-cell");r.length>0?t.notebook("active",r):e(n.target).closest(".nb-view").length>0&&t.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),t.focusout(function(n){e(n.target).closest(".notebook")[0]!=t[0]&&t.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),t.on("activate-tab",function(n){if(n.target==t[0]){var r=t.find(".nb-content").children(".nb-cell.program"),i=r.filter(".active"),s=i[0]||r[0];s&&e(s).find(".prolog-editor").prologEditor("makeCurrent"),n.stopPropagation()}}),t.data(r,i);var a=t.find(".notebook-data");if(a.length>0){function f(e){var t=a.data(e);t&&(n[e]=t)}f("file"),f("url"),f("title"),f("meta"),t.notebook("value",a.text()),a.remove()}else t.notebook("placeHolder");t.notebook("setupStorage",n)})},"delete":function(e){return e=e||a(this),e&&(this.notebook("active",e.next()||e.prev()),e.nbCell("close"),this.notebook("updatePlaceHolder")),this},copy:function(t){t=t||a(this);if(t){var n=e.el.div({"class":"notebook"});e(n).append(e(t).nbCell("saveDOM")),i=f(n)}},paste:function(t){var n=this;t=t||i;if(t){var r=e.el.div();e(r).html(t);var s=e(r).find(".nb-cell");if(s.length>0)return e(r).find(".nb-cell").each(function(){n.notebook("insert",{where:"below",restore:e(this)})}),this;alert("Not a SWISH notebook")}else alert("Clipboard is empty")},up:function(e){return e=e||a(this),e&&e.insertBefore(e.prev()),this},down:function(e){return e=e||a(this),e&&e.insertAfter(e.next()),this},insertAbove:function(){return this.notebook("insert",{where:"above"})},insertBelow:function(){return this.notebook("insert",{where:"below"})},run:function(e){e=e||a(this),e&&e.nbCell("run")},cellType:function(e,t){e=e||a(this),e&&e.nbCell("type",t)},active:function(e,t){if(e){var n=this.find(".nb-content").children(".nb-cell.active");e.length==1&&(n.length!=1||e[0]!=n[0])&&(n.nbCell("active",!1),e.nbCell("active",!0),t&&e.focus())}},insert:function(t){t=t||{};var n=a(this),r=t.cell||e.el.div({"class":"nb-cell"});n?t.where=="above"?e(r).insertBefore(n):e(r).insertAfter(n):this.find(".nb-content").append(r),t.cell||e(r).nbCell(t.restore),this.notebook("updatePlaceHolder"),this.notebook("active",e(r))},setupStorage:function(t){var n=this;return t=e.extend(t,{getValue:function(){return n.notebook("value")},setValue:function(e){return n.notebook("setSource",e)},changeGen:function(){return n.notebook("changeGen")},isClean:function(e){var t=n.notebook("changeGen");return e==t},cleanGeneration:this.notebook("changeGen"),cleanData:this.notebook("value"),cleanCheckpoint:"load",typeName:"notebook"}),this.storage(t)},setSource:function(e){typeof e=="string"&&(e={data:e}),this.notebook("value",e.data)},value:function(t){if(t==undefined){var n=e.el.div({"class":"notebook"});return this.find(".nb-cell").each(function(){cell=e(this),cell.nbCell("isEmpty")||e(n).append(cell.nbCell("saveDOM"))}),f(n)}var r=this,i=this.find(".nb-content"),n=e.el.div();i.html(""),e(n).html(t),e(n).find(".nb-cell").each(function(){var t=e.el.div({"class":"nb-cell"});i.append(t),e(t).nbCell(e(this))}),this.find(".nb-cell.query").nbCell("onload"),this.notebook("updatePlaceHolder")},changeGen:function(){var t=[];return this.find(".nb-cell").each(function(){cell=e(this),t.push(cell.nbCell("changeGen"))}),sha1(t.join())},updatePlaceHolder:function(){this.find(".nb-content").children().length==0?this.notebook("placeHolder"):this.find(".nb-placeholder").remove()},placeHolder:function(){var n=e.el.div({"class":"nb-placeholder"});e.ajax({url:t.http.locations.help+"/notebook.html",dataType:"html",success:function(t){e(n).html(t)}}),this.find(".nb-content").append(n)}};n.tabTypes.notebook={dataType:"swinb",typeName:"notebook",label:"Notebook",contentType:"text/x-prolog-notebook",order:200,create:function(t){e(t).notebook()}},e.fn.notebook=function(t){if(u[t])return u[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return u._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+r)}})(jQuery),function(e){function a(e){return e.find(".editor").prologEditor("getSource")}function f(){var t=e('<input type="file" name="file">');return t.on("change",function(t){var n=new FileReader;return n.onload=function(r){var i=e(t.target).closest(".nb-cell"),s=i.closest(".notebook");s.notebook("paste",n.result)&&i.remove()},n.readAsText(t.target.files[0]),t.preventDefault(),!1}),t}function l(){var t=e('<div class="form-more"> <a href="#">more<a></div>');return t.find("a").on("click",function(t){var n=e(t.target).closest(".form-more");n.hide(400),n.next().show(400)}),t[0]}function c(){var t=e('<div class="form-less" style="display:none"> <div><a href="#" class="less">less<a></div></div>');for(var n=0;n<arguments.length;n++)t.append(arguments[n]);return t.find("a.less").on("click",function(t){var n=e(t.target).closest(".form-less");n.hide(400),n.prev().show(400)}),t[0]}var n="nbCell",o=0,u={_init:function(t){return this.each(function(){var r=e(this),s={},u;r.data(n,s),r.attr("tabIndex",-1),r.attr("id","nbc"+o++);if(t instanceof jQuery)r.nbCell("restoreDOM",t);else{r.append(e.el.div({"class":"nb-type-select"},e.el.label("Create a "),u=e.el.div({"class":"btn-group",role:"group"}),e.el.label("cell here.")));for(var a in i)i.hasOwnProperty(a)&&e(u).append(e.el.button({type:"button","class":"btn btn-default","data-type":a},i[a].label));e(u).on("click",".btn",function(t){r.nbCell("type",e(t.target).data("type"))}),r.append(e.el.div({"class":"nb-type-more"},l(),c(e.el.label("Insert notebook from local file "),f()[0])))}})},active:function(e){var t=this.data(n);if(e){this.addClass("active");switch(t.type){case"program":this.find(".editor").prologEditor("makeCurrent")}}else if(this.length>0){this.removeClass("active");switch(t.type){case"markdown":this.hasClass("runnable")&&this.nbCell("run")}}},type:function(e){var t=this.data(n);return t.type!=e&&(u.type[e].apply(this),t.type=e,this.addClass(e)),this},run:function(){return this.each(function(){var t=e(this);if(t.hasClass("runnable")){var r=t.data(n);return u.run[r.type].apply(t,arguments)}console.log("Cell is not runnable: ",t)})},runTabled:function(){return this.nbCell("run",{tabled:!0})},onload:function(){return this.each(function(){var t=e(this);t.data("run")=="onload"&&t.nbCell("run")})},close:function(){return this.find(".prolog-runner").prologRunner("close"),this.remove()},getSettings:function(){return{tabled:this.data("tabled")=="true",run:this.data("run")=="onload",chunk:parseInt(this.data("chunk")||"1")}},settings:function(){function i(){this.append(e.el.form({"class":"form-horizontal"},r.fields.checkboxes([{name:"tabled",label:"table results",value:n.tabled,title:"Table results"},{name:"run",label:"run on page load",value:n.run,title:"Run when document is loaded"}]),r.fields.chunk(n.chunk),r.fields.buttons({label:"Apply",offset:3,action:function(e,r){r.tabled!=n.tabled&&(r.tabled?t.data("tabled","true"):t.removeData("tabled")),r.run!=n.run&&(r.run?t.data("run","onload"):t.removeData("run")),r.chunk!=n.chunk&&(r.chunk!=1?t.data("chunk",""+r.chunk):t.removeData("chunk"))}})))}var t=this,n=this.nbCell("getSettings");r.showDialog({title:"Set options for query",body:i})},programs:function(){var e=this.data(n);return this.prevAll(".program").first().find(".editor")},isEmpty:function(){return u.isEmpty[this.data(n).type].call(this)},saveDOM:function(){return u.saveDOM[this.data(n).type].call(this)},restoreDOM:function(e){function r(e){for(var t in i)if(i.hasOwnProperty(t)&&e.hasClass(t))return t}var t=this.data(n);t.type=r(e),u.restoreDOM[t.type].apply(this,arguments),this.addClass(t.type)},changeGen:function(){return u.changeGen[this.data(n).type].call(this)}};u.type.markdown=function(t){var n;t=t||{},t.mode="markdown",this.html(""),this.append(n=e.el.div({"class":"editor"})),e(n).prologEditor(t),this.addClass("runnable")},u.type.program=function(t){var n;t=t||{},t.autoCurrent=!1,this.html(""),this.append(n=e.el.div({"class":"editor"})),e(n).prologEditor(t)},u.type.query=function(t){function i(e){t[e]!=undefined&&(r.data(e,""+t[e]),delete t[e])}var n,r=this;this.html(""),t=t||{},i("tabled"),i("chunk"),i("run"),t=e.extend({},t,{mode:"prolog",role:"query",sourceID:function(){return r.nbCell("programs").prologEditor("getSourceID")},prologQuery:function(e){r.nbCell("run")}}),this.append(e.el.div(e.el.div({"class":"nb-cell-buttons"},{"class":"btn-group nb-cell-buttons",role:"group"},s("wrench","settings","Settings","default","xs"),s("play","run","Run query","primary","xs")))),this.append(e.el.div({"class":"query"},e.el.span({"class":"prolog-prompt"},"?-"),n=e.el.div({"class":"editor query"}))),e(n).prologEditor(t),this.addClass("runnable")},u.run.markdown=function(n){function i(t){var n=e(t.target).closest(".nb-cell"),r=n.data("markdownText");n.removeData("markdownText"),u.type.markdown.call(n,{value:r}),n.off("dblclick",i),n.off("click",s)}function s(n){function s(e){var t={},n;(n=e.indexOf(":"))>0&&(t.module=e.substring(0,n),e=e.slice(n+1));if((n=e.indexOf("/"))>0){t.name=e.substring(0,n),e.charAt(n+1)=="/"?t.arity=parseInt(e.slice(n+2))+2:t.arity=parseInt(e.slice(n+1));if(!isNaN(t.arity))return t}}function o(t){if(t){var r=s(decodeURIComponent(t));if(r)return e(".trill_on_swish-event-receiver").trigger("pldoc",r),n.preventDefault(),!0}}var r=e(n.target).closest("a"),i=!1;if(r.hasClass("store")){i=!0,n.preventDefault();var u=t.http.locations.trill_on_swish+"p/",a=r.attr("href");a.startsWith(u)?(file=a.slice(u.length),e(n.target).parents(".trill_on_swish").trill_on_swish("playFile",file)):alert("File does not appear to come from gitty store?")}else r.hasClass("file")?(i=!0,n.preventDefault(),e(n.target).parents(".trill_on_swish").trill_on_swish("playURL",{url:r.attr("href")})):r.hasClass("builtin")?i=o(r.attr("href").split("predicate=").pop()):i=o(r.attr("href").split("object=").pop());i||(n.preventDefault(),window.open(r.attr("href"),"_blank"))}var r=this;n=n||a(this),e.get(t.http.locations.markdown,{text:n},function(e){r.html(e),r.removeClass("runnable"),r.data("markdownText",n),r.on("dblclick",i),r.on("click","a",s)})},u.run.program=function(){alert("Please define a query to run this program")},u.run.query=function(t){var n=this.nbCell("programs"),r=this.nbCell("getSettings");t=t||{};var i={source:n.prologEditor("getSource"),query:a(this),tabled:r.tabled||!1,chunk:r.chunk,title:!1};n[0]&&(i.editor=n[0]);var s=e.el.div({"class":"prolog-runner"});this.find(".prolog-runner").prologRunner("close"),this.append(s),e(s).prologRunner(i)},u.saveDOM.markdown=function(){var t=this.data("markdownText")||a(this);return e.el.div({"class":"nb-cell markdown"},t)},u.saveDOM.program=function(){return e.el.div({"class":"nb-cell program"},a(this))},u.saveDOM.query=function(){function r(r){var i;(i=t.data(r))&&e(n).attr("data-"+r,i)}var t=this,n=e.el.div({"class":"nb-cell query"},a(this));return r("tabled"),r("chunk"),r("run"),n},u.restoreDOM.markdown=function(e){var t=e.text().trim();this.data("markdownText",t),u.run.markdown.call(this,t)},u.restoreDOM.program=function(e){u.type.program.call(this,{value:e.text().trim()})},u.restoreDOM.query=function(e){function n(n){var r;if(r=e.data(n))n=="chunk"?t.chunk=parseInt(r):t[n]=r}var t={value:e.text().trim()};n("tabled"),n("chunk"),n("run"),u.type.query.call(this,t)},u.changeGen.markdown=function(){var e=this.data("markdownText")||a(this);return sha1(e)},u.changeGen.program=function(){return sha1(a(this))},u.changeGen.query=function(){function n(n,r){var i;if(i=t.data(n))e+=r+i}var e="",t=this;return n("tabled","T"),n("chunk","C"),n("run","R"),e+="V"+a(this),sha1(e)},u.isEmpty.markdown=function(){var e=this.data("markdownText")||a(this);return e.trim()==""},u.isEmpty.program=function(){return a(this).trim()==""},u.isEmpty.query=function(){return a(this).trim()==""},e.fn.nbCell=function(t){if(u[t])return u[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return u._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}}(jQuery)}),define("navbar",["jquery","preferences","laconic"],function(e,t){(function(e){function i(n,r,i){if(i=="--")n.append(e.el.li({"class":"divider"}));else if(typeof i=="function"){var s;i.typeIcon?s=e.el.a(e.el.span({"class":"dropdown-icon type-icon "+i.typeIcon}),r):s=e.el.a(r),e(s).data("action",i),i.name&&e(s).attr("id",i.name),n.append(e.el.li(s))}else if(i.type=="checkbox"){var o=e(e.el.input({type:"checkbox"}));i.preference!==undefined?(o.addClass("trill_on_swish-event-receiver"),t.getVal(i.preference)&&o.prop("checked",!0),o.on("click",function(){t.setVal(i.preference,e(this).prop("checked"))}),o.on("preference",function(e){e.name==i.preference&&o.prop("checked",e.value)})):(i.checked&&o.prop("checked",i.checked),o.on("click",function(){i.action(e(this).prop("checked"))})),n.append(e.el.li({"class":"checkbox"},o[0],e.el.span(r)))}else if(i.type=="submenu"){var u=e.el.ul({"class":"dropdown-menu sub-menu"});n.append(e.el.li(e.el.a({"class":"trigger right-caret"},r),u)),i.action&&e(u).data("action",i.action);if(i.items)for(var a=0;a<i.items.length;a++)e(u).append(e.el.li(e.el.a(i.items[a])));i.update&&e(u).on("update",function(e){i.update.call(e.target)})}else alert("Unknown navbar item")}function s(t,n){return t.find(".dropdown-menu").filter(function(){return e(this).attr("name")==n})}function o(t,n){if(!e(t).hasClass("trigger")){var r=e(t).data("action")||e(t).parents("ul").data("action");return a.call(t,n),r?(n.preventDefault(),r.call(t,n)):e(t).hasClass("trigger")&&u.call(t,n),!1}u.call(t,n)}function u(t){var n=e(this).next(),r=e(this).parent().parent();(e(this).hasClass("left-caret")||e(this).hasClass("right-caret"))&&e(this).toggleClass("right-caret left-caret"),r.find(".left-caret").not(this).toggleClass("right-caret left-caret"),r.find(".sub-menu:visible").not(n).hide(),n.trigger("update"),n.toggle(),t.stopPropagation()}function a(t){var n=e(this).closest(".dropdown");n.find(".left-caret").toggleClass("right-caret left-caret"),n.find(".sub-menu:visible").hide()}var n="navbar",r={_init:function(t){return this.each(function(){var n=e(this),r={};for(var i in t)t.hasOwnProperty(i)&&(n.navbar("appendDropdown",i),n.navbar("populateDropdown",i,t[i]));n.on("click","a",function(e){o(this,e)}),e("a#dismisslink").click(function(){var t;return t=document.getElementById("navbarhelp"),t.style.position="absolute",t.style.left="-9999px",document.getElementById("content").style.height="calc(100% - 55px)",e(window).trigger("resize"),!1})})},appendDropdown:function(t){var n=this.children(".nav.navbar-nav"),r=e.el.ul({name:t,"class":"dropdown-menu"}),i=e.el.li({"class":"dropdown"},e.el.a({"class":"dropdown-toggle","data-toggle":"dropdown"},t,e.el.b({"class":"caret"})),r);return n.append(i),this},populateDropdown:function(e,t){if(typeof t=="function")t(this,e);else{var n=s(this,e);for(var r in t)t.hasOwnProperty(r)&&i(n,r,t[r])}},clearDropdown:function(e){var t=s(this,e);return t.html(""),this},extendDropdown:function(e,t,n){var r=s(this,e);i(r,t,n)}};e.fn.navbar=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/templates-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){return e.slice(0,t.length).toUpperCase()==t.toUpperCase()}function i(e){}function s(e){var t=e.template;return document.createTextNode(t.name)}function u(){this.marked=[],this.selectableMarkers=[],this.varIndex=-1}function a(e){return e._templateStack?e._templateStack.length:0}function f(e){this.name=e.name,this.description=e.description,this.text=e.text,e.varTemplates&&(this.varTemplates=e.varTemplates),e.template!=null?this.source=e.template:e.tokens!=null&&(this._tokens=e.tokens)}function l(e){var t=[],n=!1,r=null,i="";for(var s=0;s<e.length;s++){var o=e.charAt(s);if(o=="\n")i!=""&&t.push(i),i="",t.push(o),r=null;else{var u=!0;if(n)o=="}"&&(n=!1,u=!1,i=="cursor"?t.push({cursor:!0}):i=="line_selection"?t.push({line_selection:!0}):t.push({variable:i}),i="");else if(o=="$"&&s+1<=e.length){s++;var a=e.charAt(s);a=="{"&&(n=!0,u=!1,i!=""&&t.push(i),i="")}u&&r!="$"?(i+=o,r=o):r=null}}return i!=""&&t.push(i),t}function c(e,t){var n=e.findMarksAt(t.from);if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i._templateVar)return i}return null}function h(e,t){var n=e._templateState;if(!t.origin||!n||n.updating)return;try{n.updating=!0;var r=c(e,t);if(r==null)g(e);else{var i=r.find(),s=e.getRange(i.from,i.to);for(var o=0;o<n.marked.length;o++){var u=n.marked[o];if(u!=r&&u._templateVar==r._templateVar){var a=u.find();e.replaceRange(s,a.from,a.to)}}}}finally{n.updating=!1}}function p(e){i("template","endCompletion()",a(e)),a(e)&&g(e,!0)}function d(e,t){var n=e._templateState;if(n.selectableMarkers.length>0){n.varIndex++;if(n.varIndex>=n.selectableMarkers.length){if(t){m(e);return}n.varIndex=0}var r=n.selectableMarkers[n.varIndex],i=r.find();e.setSelection(i.from,i.to);var s=r._templateVar;for(var o=0;o<n.marked.length;o++){var u=n.marked[o];u==r?(u.className="",u.startStyle="",u.endStyle=""):u._templateVar==r._templateVar?(u.className="CodeMirror-templates-variable-selected",u.startStyle="",u.endStyle=""):(u.className="CodeMirror-templates-variable",u.startStyle="CodeMirror-templates-variable-start",u.endStyle="CodeMirror-templates-variable-end")}e.refresh()}else m(e)}function v(t){function s(e,t){return e.ch==t.ch&&e.line==t.line}var n=t._templateState,r=n.selectableMarkers[n.varIndex],i={state:n};t._hintTemplateMarker&&(i.marker=t._hintTemplateMarker),t._templateStack||(t._templateStack=[]),t._templateStack.push(i),delete t._templateState,t._hintTemplateMarker=r;var o=r.find(),u=t.listSelections();u.length==1&&s(u[0].anchor,o.from)&&s(u[0].head,o.to)&&t.replaceRange("☰",o.from,o.to),e.commands.autocomplete(t)}function m(e){var t=e._templateState.cursor;if(t!=null){var n=t.find();n!=null&&e.setSelection(n,n)}g(e)}function g(e,t){function r(){i("template","Canceled?");for(var t=0;t<n.marked.length;t++){var r=n.marked[t];if(r==e._hintTemplateMarker){var s=r.find();s&&e.getRange(s.from,s.to)=="☰"&&e.replaceRange(r._templateVar,s.from,s.to)}}}var n=e._templateState;if(n){i("template","Uninstall, clearing: ",n.marked.length);for(var s=0;s<n.marked.length;s++)n.marked[s].clear();n.cursor!=null&&n.cursor.clear(),n.marked.length=0,n.selectableMarkers.length=0}else i("template","Uninstall, no state");if(e._templateStack&&e._templateStack.length>0){i("template","Popping from level",e._templateStack.length);var u=e._templateStack.pop();n=e._templateState=u.state,t&&e._hintTemplateMarker&&r(),u.marker?e._hintTemplateMarker=u.marker:delete e._hintTemplateMarker}else i("template","Leaving template mode"),e.off("change",h),e.off("endCompletion",p),e.removeKeyMap(o),delete e._templateState,delete e._hintTemplateMarker}var t=[],n=e.Pos;e.templatesHint={};var o={Tab:d,Enter:function(e){d(e,!0)},Esc:g,"Ctrl-Space":v};f.prototype.tokens=function(){return this._tokens==null&&(this._tokens=l(this.source)),this._tokens},f.prototype.content=function(){if(this._content==null){var e=this.tokens(),t="";for(var n=0;n<e.length;n++){var r=e[n];typeof r=="string"?t+=r:r.variable&&(t+=r.variable)}this._content=t}return this._content},f.prototype.insert=function(e,t){var r=this,s=a(e);i("template","Insert, nested",s,"template",r);if(e._templateState||s)i("template","Uninstall from insert()",s),g(e);if(r.text){e.replaceRange(r.text,t.from,t.to);return}var f=new u;e._templateState=f;var l=this.tokens(),c="",v=t.from.line,m=t.from.ch,y=[],b=[],w=null;for(var E=0;E<l.length;E++){var S=l[E];if(typeof S=="string")c+=S,S=="\n"?(v++,m=0):m+=S.length;else if(S.variable){c+=S.variable;var x=n(v,m),T=n(v,m+S.variable.length),N=b[S.variable]!=0;m+=S.variable.length,y.push({from:x,to:T,variable:S.variable,selectable:N}),b[S.variable]=!1}else S.cursor&&(w=n(v,m))}var x=t.from,T=t.to,C=x.line;e.replaceRange(c,x,T);for(var E=0;E<y.length;E++){function k(e){return r.varTemplates&&r.varTemplates[e]?r.varTemplates[e]:undefined}var L=y[E],x=L.from,T=L.to,A=e.markText(x,T,{className:"CodeMirror-templates-variable",startStyle:"CodeMirror-templates-variable-start",endStyle:"CodeMirror-templates-variable-end",inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1,_templateVar:L.variable,_templates:k(L.variable)});f.marked.push(A),L.selectable==1&&f.selectableMarkers.push(A)}w!=null&&(f.cursor=e.setBookmark(w));var O=c.split("\n");for(var M=1;M<O.length;M++){var _=C+M;e.indentLine(_)}s||(e.on("change",h),i("template","Installing endCompletion"),e.on("endCompletion",p),e.addKeyMap(o)),d(e,!0)},e.templatesHint.getCompletions=function(n,i,s){var o=n.doc.mode.name,u=t[o];if(u)for(var a=0;a<u.length;a++){var f=u[a];if(r(f.name,s)){var l=f.name;f.description&&(l+="- "+f.description);var c="CodeMirror-hint-template";f.className&&(c=f.className);var h={className:c,text:l,template:f};h.data=h,h.hint=function(e,t,n){n.template.insert(e,t)},h.info=function(t){var r=t.template.content();if(e.runMode){var i=document.createElement("div");return i.className="cm-s-default",n.options&&n.options.theme&&(i.className="cm-s-"+n.options.theme),e.runMode(r,n.getMode().name,i),i}return r},i.push(h)}}},e.templatesHint.Template=f,e.templatesHint.addTemplates=function(e){var n=e.context;if(n){var r=t[n];r||(r=[],t[n]=r),e.templates.forEach(function(e){r.push(new f(e))})}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog-template-hint",["../../lib/codemirror","../../addon/hint/templates-hint","jquery","config","laconic"],e):e(CodeMirror)}(function(e,t,n,r){function s(e){function r(e){var n=/[-+?:^@!]*([A-Z][A-Za-z_0-9]*)/g,r=/\bis\s+(det|nondet|semidet|fail|multi)$/;t.template||(t.template=e.replace(n,"$${$1}").replace(r,""),t.template.match(/\${cursor}/)||(t.template+="${cursor}")),t.displayText||(t.displayText=e);if(!t.varTemplates){var s=e.match(/:[A-Z][A-Za-z_0-9]*/g);if(s&&s.length>0){var o={};for(var u=0;u<s.length;u++)o[s[u].substring(1)]=i;t.varTemplates=o}}}var t=this,s=["template","displayText","text",{from:"summary",to:"description"},"className","varTemplates"];if(typeof e=="string")this.displayText=e,this.text=e;else{for(var o=0;o<s.length;o++){var u=s[o];typeof u=="string"?e[u]&&(this[u]=e[u]):e[u.from]&&(this[u.to]=e[u.from])}e.mode&&r(e.mode),e.classes&&(e.className=e.classes.join(" "))}this.render=function(e,t,r){n(e).append(r.displayText)},this.info=function(e){return e.description}}function o(t,n,r){function f(e,t){return e.slice(0,t.length)==t}var o=n.token.string,u=[],a=i;t._hintTemplateMarker&&(o=="☰"&&(o=""),a=t._hintTemplateMarker._templates);var l=o.length>0&&!o.match(/\w/);if(a)for(var c=0;c<a.length;c++){var h=a[c];if(typeof h=="string")f(h,o)&&u.push(new s(h));else{var p=["name","mode","template","text"];if(l)h.name&&h.name.indexOf(o)>=0&&u.push(new s(h));else for(var d=0;d<p.length;d++)if(h[p[d]]){f(h[p[d]],o)&&u.push(new s(h));break}}}if(u.length==0){var v=e.hint.anyword,m=o==""&&t._hintTemplateMarker?{word:/[A-Z][A-Za-z0-9_]*/}:r,g=v(t,m);for(var c=0;c<g.list.length;c++)u.push(new s(g.list[c]))}return{list:u,from:n.position.from,to:n.position.to}}function u(t,n,r){var i=a(t),s=o(t,i,r);e.attachContextInfo(s),n(s)}function a(t){var n=t.getCursor(),r=t.getTokenAt(n),i=e.innerMode(t.getMode(),r.state);if(i.mode.name!="prolog")return null;var s={from:new e.Pos(n.line,r.start),to:new e.Pos(n.line,r.end)};return{token:r,position:s}}var i=r.trill_on_swish.templates||[];return s.prototype.hint=function(t,n,r){var i=new e.templatesHint.Template(this);i.insert(t,n)},u.async=!0,e.registerHelper("hint","prologTemplate",u),{getHints:u,getState:a}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("prolog",function(t,n){function r(e,t,n){return t.tokenize=n,n(e,t)}function p(e,t,n){if(n>0){while(n-->0)if(!t.test(e.next()))return!1}else while(t.test(e.peek()))e.next();return!0}function d(e){var t=e.next();if(o.test(t))return!0;switch(t){case"u":if(i.unicodeEscape)return p(e,a,4);return!1;case"U":if(i.unicodeEscape)return p(e,a,8);return!1;case null:return!0;case"c":return e.eatSpace(),!0;case"x":return p(e,a,2)}return u.test(t)?p(e,u,-1)?(e.peek()=="\\"&&e.next(),!0):!1:!1}function v(e,t,n){var r;while((r=e.next())!=null){if(r==n&&n!=e.peek())return t.nesting.pop(),!1;if(r=="\\"&&!d(e))return!1}return i.multiLineQuoted}function m(e){return e.nesting.slice(-1)[0]}function g(e){var t=m(e);t?t.arg==0?t.arg=1:t.type=="control"&&(e.goalStart=!1):e.goalStart=!1}function y(e){var t=m(e);t&&!t.alignment&&t.arg!=undefined&&(t.arg==0?t.alignment=t.leftCol?t.leftCol+4:t.column+4:t.alignment=t.column+1)}function b(e){var t=m(e);t?t.arg?t.arg++:t.type=="control"&&(e.goalStart=!0):e.goalStart=!0}function w(e){var t=m(e);return t?t.type=="control"?!0:!1:e.inBody}function x(e,t,n){return E=e,S=n,t}function T(e){return e.eol()||/[\s%]/.test(e.peek())?!0:!1}function N(e,t){var n=e.next();if(n=="(")return t.lastType=="functor"?(t.nesting.push({functor:t.functorName,column:e.column(),leftCol:t.functorColumn,arg:0}),delete t.functorName,delete t.functorColumn):t.nesting.push({type:"control",closeColumn:e.column(),alignment:e.column()+4}),x("solo",null,"(");if(n=="{"&&t.lastType=="tag")return t.nesting.push({tag:t.tagName,column:e.column(),leftCol:t.tagColumn,arg:0}),delete t.tagName,delete t.tagColumn,x("dict_open",null);if(n=="/"&&e.eat("*"))return r(e,t,L);if(n=="%")return e.skipToEnd(),x("comment","comment");g(t);if(l.test(n)){switch(n){case")":t.nesting.pop();break;case"]":return t.nesting.pop(),x("list_close",null);case"}":var s=m(t),o=s&&s.tag?"dict_close":"brace_term_close";return t.nesting.pop(),x(o,null);case",":e.eol()&&(t.commaAtEOL=!0),b(t);case";":w(t)&&(t.goalStart=!0);break;case"[":return t.nesting.push({type:"list",closeColumn:e.column(),alignment:e.column()+2}),x("list_open",null);case"{":return i.quasiQuotations&&e.eat("|")?(t.nesting.push({type:"quasi-quotation",alignment:e.column()+1}),x("qq_open","qq_open")):(t.nesting.push({type:"curly",closeColumn:e.column(),alignment:e.column()+2}),x("brace_term_open",null));case"|":if(i.quasiQuotations){if(e.eat("|"))return t.tokenize=k,x("qq_sep","qq_sep");if(e.eat("}"))return t.nesting.pop(),x("qq_close","qq_close")}w(t)&&(t.goalStart=!0)}return x("solo",null,n)}if(n=='"'||n=="'"||n=="`")return t.nesting.push({type:"quoted",alignment:e.column()+1}),r(e,t,C(n));if(n=="0"){if(e.eat(/x/i))return e.eatWhile(/[\da-f]/i),x("number","number");if(e.eat(/o/i))return e.eatWhile(/[0-7]/i),x("number","number");if(e.eat(/'/)){var u=e.next();return u=="\\"&&!d(e)?x("error","error"):x("code","code")}}if(/\d/.test(n)||/[+-]/.test(n)&&e.eat(/\d/))return i.groupedIntegers?e.match(/^\d*((_|\s+)\d+)*(?:\.\d+)?(?:[eE][+\-]?\d+)?/):e.match(/^\d*(?:\.\d+)?(?:[eE][+\-]?\d+)?/),x(n=="-"?"neg-number":n=="+"?"pos-number":"number");if(f.test(n)){e.eatWhile(f);var a=e.current();if(a=="."&&T(e))return m(t)?x("fullstop","error",a):x("fullstop","fullstop",a);return c.test(a)?x("neck","neck",a):w(t)&&h.test(a)?(t.goalStart=!0,x("symbol","operator",a)):x("symbol","operator",a)}e.eatWhile(/[\w_]/);var p=e.current();if(e.peek()=="{"&&i.dicts)return t.tagName=p,t.tagColumn=e.column(),x("tag","tag",p);if(n=="_"){if(p.length==1)return x("var","anon",p);var v=p.charAt(1);return v==v.toUpperCase()?x("var","var-2",p):x("var","var",p)}return n==n.toUpperCase()?x("var","var",p):e.peek()=="("?(t.functorName=p,t.functorColumn=e.column(),x("functor","functor",p)):x("atom","atom",p)}function C(e){return function(t,n){if(!v(t,n,e)){n.tokenize=N;if(t.peek()=="("){var r=t.current();return n.functorName=r,x("functor","functor",r)}if(t.peek()=="{"&&i.dicts){var r=t.current();return n.tagName=r,x("tag","tag",r)}}return x(s[e],s[e])}}function k(e,t){var n=!1,r;while(r=e.next()){if(r=="}"&&n){t.tokenize=N,e.backUp(2);break}n=r=="|"}return x("qq_content","qq_content")}function L(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=N;break}n=r=="*"}return x("comment","comment")}var i={quasiQuotations:!0,dicts:!0,unicodeEscape:!0,multiLineQuoted:!0,groupedIntegers:!0},s={'"':"string","'":"qatom","`":"bqstring"},o=/[abref\\'"nrtsv]/,u=/[0-7]/,a=/[0-9a-fA-F]/,f=/[-#$&*+./:<=>?@\\^~]/,l=/[[\]{}(),;|!]/,c=/^(:-|-->)$/,h=/^(,|;|->|\*->|\\+|\|)$/,E,S;return{startState:function(){return{tokenize:N,inBody:!1,goalStart:!1,lastType:null,nesting:new Array,curTerm:null,curToken:null}},token:function(e,t){var r;t.curTerm==null&&n.metainfo&&(t.curTerm=0,t.curToken=0),e.sol()&&delete t.commaAtEOL;if(t.tokenize==N&&e.eatSpace())return e.eol()&&y(t),null;var i=t.tokenize(e,t);return e.eol()&&y(t),E=="neck"?(t.inBody=!0,t.goalStart=!0):E=="fullstop"&&(t.inBody=!1,t.goalStart=!1),t.lastType=E,typeof n.enrich=="function"&&(i=n.enrich(e,t,E,S,i)),i},indent:function(t,n){if(t.tokenize==L)return e.Pass;var r;return(r=m(t))?r.closeColumn&&!t.commaAtEOL?r.closeColumn:r.alignment:t.inBody?4:0},theme:"prolog",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"%"}}),e.defineMIME("text/x-prolog","prolog")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_keys",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologStartIfThenElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.state.goalStart==1){t.replaceSelection("(   ","end");return}return e.Pass},e.commands.prologStartThen=function(t){function i(e){var t=e.nesting.length;return t>0?e.nesting[t-1]:null}function s(e){var t=i(e);return t?t.type=="control"?!0:!1:e.inBody}var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(n.ch==r.end&&r.type=="operator"&&r.string=="-"&&s(r.state)){t.replaceSelection(">  ","end");return}return e.Pass},e.commands.prologStartElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.start==0&&n.ch==r.end&&!/\S/.test(r.string)){t.replaceSelection(";   ","end");return}return e.Pass},e.defineOption("prologKeys",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prolog");if(n){var i={name:"prolog","'('":"prologStartIfThenElse","'>'":"prologStartThen","';'":"prologStartElse","Ctrl-L":"refreshHighlight"};t.addKeyMap(i)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_query",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologFireQuery=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);return r.type=="fullstop"?t.prologFireQuery(t.getValue()):e.Pass},e.defineOption("prologQuery",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prologQuery");if(typeof n=="function"){var i={name:"prologQuery",Enter:"prologFireQuery"};t.addKeyMap(i),t.prologFireQuery=n}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("xml",function(t,n){function l(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<")return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(d(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(a=e.eat("/")?"closeTag":"openTag",t.tokenize=c,"tag bracket");if(r=="&"){var i;return e.eat("#")?e.eat("x")?i=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):i=e.eatWhile(/[\d]/)&&e.eat(";"):i=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function c(e,t){var n=e.next();if(n==">"||n=="/"&&e.eat(">"))return t.tokenize=l,a=n==">"?"endTag":"selfcloseTag","tag bracket";if(n=="=")return a="equals",null;if(n=="<"){t.tokenize=l,t.state=y,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=h(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e){var t=function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=c;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=l;break}n.next()}return e}}function d(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=d(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=l;break}return n.tokenize=d(e-1),n.tokenize(t,n)}}return"meta"}}function v(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n;if(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)this.noIndent=!0}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){var n;for(;;){if(!e.context)return;n=e.context.tagName;if(!o.contextGrabbers.hasOwnProperty(n)||!o.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function y(e,t,n){return e=="openTag"?(n.tagStart=t.column(),b):e=="closeTag"?w:y}function b(e,t,n){return e=="word"?(n.tagName=t.current(),f="tag",x):(f="error",b)}function w(e,t,n){if(e=="word"){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r?(f="tag",E):(f="tag error",S)}return f="error",S}function E(e,t,n){return e!="endTag"?(f="error",E):(m(n),y)}function S(e,t,n){return f="error",E(e,t,n)}function x(e,t,n){if(e=="word")return f="attribute",T;if(e=="endTag"||e=="selfcloseTag"){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e=="selfcloseTag"||o.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new v(n,r,i==n.indented)),y}return f="error",x}function T(e,t,n){return e=="equals"?N:(o.allowMissing||(f="error"),x(e,t,n))}function N(e,t,n){return e=="string"?C:e=="word"&&o.allowUnquoted?(f="string",x):(f="error",x(e,t,n))}function C(e,t,n){return e=="string"?C:x(e,t,n)}var r=t.indentUnit,i=n.multilineTagIndentFactor||1,s=n.multilineTagIndentPastTag;s==null&&(s=!0);var o=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},u=n.alignCDATA,a,f;return{startState:function(){return{tokenize:l,state:y,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;a=null;var n=t.tokenize(e,t);return(n||a)&&n!="comment"&&(f=null,t.state=t.state(a||n,e,t),f&&(n=f=="error"?n+" error":f)),n},indent:function(t,n,a){var f=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+r;if(f&&f.noIndent)return e.Pass;if(t.tokenize!=c&&t.tokenize!=l)return a?a.match(/^(\s*)/)[0].length:0;if(t.tagName)return s?t.tagStart+t.tagName.length+2:t.tagStart+r*i;if(u&&/<!\[CDATA\[/.test(n))return 0;var h=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(h&&h[1])while(f){if(f.tagName==h[2]){f=f.prev;break}if(!o.implicitlyClosed.hasOwnProperty(f.tagName))break;f=f.prev}else if(h)while(f){var p=o.contextGrabbers[f.tagName];if(!p||!p.hasOwnProperty(h[2]))break;f=f.prev}while(f&&!f.startOfLine)f=f.prev;return f?f.indent+r:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/fold/xml-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,t){return e.line-t.line||e.ch-t.ch}function o(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function u(e,n){var r=e.cm.getTokenTypeAt(t(e.line,n));return r&&/\btag\b/.test(r)}function a(e){if(e.line>=e.max)return;return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function f(e){if(e.line<=e.min)return;return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(a(e))continue;return}if(!u(e,t+1)){e.ch=t+1;continue}var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(f(e))continue;return}if(!u(e,t+1)){e.ch=t;continue}s.lastIndex=t,e.ch=t;var n=s.exec(e.text);if(n&&n.index==t)return n}}function h(e){for(;;){s.lastIndex=e.ch;var t=s.exec(e.text);if(!t){if(a(e))continue;return}if(!u(e,t.index+1)){e.ch=t.index+1;continue}return e.ch=t.index+t[0].length,t}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(f(e))continue;return}if(!u(e,t+1)){e.ch=t;continue}var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}}function d(e,n){var r=[];for(;;){var i=h(e),s,o=e.line,u=e.ch-(i?i[0].length:0);if(!i||!(s=l(e)))return;if(s=="selfClose")continue;if(i[1]){for(var a=r.length-1;a>=0;--a)if(r[a]==i[2]){r.length=a;break}if(a<0&&(!n||n==i[2]))return{tag:i[2],from:t(o,u),to:t(e.line,e.ch)}}else r.push(i[2])}}function v(e,n){var r=[];for(;;){var i=p(e);if(!i)return;if(i=="selfClose"){c(e);continue}var s=e.line,o=e.ch,u=c(e);if(!u)return;if(u[1])r.push(u[2]);else{for(var a=r.length-1;a>=0;--a)if(r[a]==u[2]){r.length=a;break}if(a<0&&(!n||n==u[2]))return{tag:u[2],from:t(e.line,e.ch),to:t(s,o)}}}}var t=e.Pos,r="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s=new RegExp("<(/?)(["+r+"]["+i+"]*)","g");e.registerHelper("fold","xml",function(e,n){var r=new o(e,n.line,0);for(;;){var i=h(r),s;if(!i||r.line!=n.line||!(s=l(r)))return;if(!i[1]&&s!="selfClose"){var n=t(r.line,r.ch),u=d(r,i[2]);return u&&{from:n,to:u.from}}}}),e.findMatchingTag=function(e,r,i){var s=new o(e,r.line,r.ch,i);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var u=l(s),a=u&&t(s.line,s.ch),f=u&&c(s);if(!u||!f||n(s,r)>0)return;var h={from:t(s.line,s.ch),to:a,tag:f[2]};return u=="selfClose"?{open:h,close:null,at:"open"}:f[1]?{open:v(s,f[2]),close:h,at:"close"}:(s=new o(e,a.line,a.ch,i),{open:h,close:d(s,f[2]),at:"open"})},e.findEnclosingTag=function(e,t,n){var r=new o(e,t.line,t.ch,n);for(;;){var i=v(r);if(!i)break;var s=new o(e,t.line,t.ch,n),u=d(s,i.tag);if(u)return{open:i,close:u}}},e.scanForClosingTag=function(e,t,n,r){var i=new o(e,t.line,t.ch,r?{from:0,to:r}:null);return d(i,n)}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../fold/xml-fold")):typeof define=="function"&&define.amd?define("cm/addon/edit/matchtags",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){t(n);if(n.somethingSelected())return;var r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var s=e.findMatchingTag(n,r,i);if(!s)return;if(n.state.matchBothTags){var o=s.at=="open"?s.open:s.close;o&&(n.state.tagHit=n.markText(o.from,o.to,{className:"CodeMirror-matchingtag"}))}var u=s.at=="close"?s.open:s.close;u?n.state.tagOther=n.markText(u.from,u.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,s,o){o&&o!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),s&&(i.state.matchBothTags=typeof s=="object"&&s.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r=n.at=="close"?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/meta",["../lib/codemirror"],e):e(CodeMirror)}(function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps"},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),s=i>-1&&t.substring(i+1,t.length);if(s)return e.findModeByExtension(s)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):typeof define=="function"&&define.amd?define("cm/mode/markdown/markdown",["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){e.defineMode("markdown",function(t,n){function s(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return i.name=="null"?null:i}function O(e,t,n){return t.f=t.inline=n,n(e,t)}function M(e,t,n){return t.f=t.block=n,n(e,t)}function _(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,!r&&e.f==P&&(e.f=I,e.block=D),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function D(e,t){var r=e.sol(),i=t.list!==!1;i&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var o=null;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),a;if(e.eatSpace())return null;if(o=e.match(k))return t.header=Math.min(6,o[0].indexOf(" ")!==-1?o[0].length-1:o[0].length),n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,j(t);if(t.prevLineHasContent&&(o=e.match(L)))return t.header=o[0].charAt(0)=="="?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,j(t);if(e.eat(">"))return t.indentation++,t.quote=r?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),j(t);if(e.peek()==="[")return O(e,t,z);if(e.match(x,!0))return p;if((!t.prevLineHasContent||i)&&(e.match(T,!1)||e.match(N,!1))){var u=null;return e.match(T,!0)?u="ul":(e.match(N,!0),u="ol"),t.indentation+=4,t.list=!0,t.listDepth++,n.taskLists&&e.match(C,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+u]),j(t)}return n.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=s(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=H,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,j(t)):O(e,t,t.inline)}function P(e,t){var n=i.token(e,t.htmlState);if(r&&t.htmlState.tagStart===null&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)t.f=I,t.block=D,t.htmlState=null;return n}function H(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=B,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a)}function B(e,t){e.match("```"),t.block=D,t.f=I,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=j(t);return t.code=!1,r}function j(e){var t=[];if(e.formatting){t.push(v),typeof e.formatting=="string"&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(v+"-"+e.formatting[r]),e.formatting[r]==="header"&&t.push(v+"-"+e.formatting[r]+"-"+e.header),e.formatting[r]==="quote"&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(v+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref)return t.push(b),t.length?t.join(" "):null;e.strong&&t.push(E),e.em&&t.push(w),e.strikethrough&&t.push(S),e.linkText&&t.push(y),e.code&&t.push(a),e.header&&(t.push(u),t.push(u+"-"+e.header)),e.quote&&(t.push(f),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(f+"-"+e.quote):t.push(f+"-"+n.maxBlockquoteDepth));if(e.list!==!1){var i=(e.listDepth-1)%3;i?i===1?t.push(c):t.push(h):t.push(l)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function F(e,t){return e.match(A,!0)?j(t):undefined}function I(t,r){var s=r.text(t,r);if(typeof s!="undefined")return s;if(r.list)return r.list=null,j(r);if(r.taskList){var u=t.match(C,!0)[1]!=="x";return u?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,j(r)}r.taskOpen=!1,r.taskClosed=!1;if(r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),j(r);var a=t.sol(),f=t.next();if(f==="\\"){t.next();if(n.highlightFormatting){var l=j(r);return l?l+" formatting-escape":"formatting-escape"}}if(r.linkTitle){r.linkTitle=!1;var c=f;f==="("&&(c=")"),c=(c+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+c+"\\\\]+|\\\\\\\\|\\\\.)"+c;if(t.match(new RegExp(h),!0))return b}if(f==="`"){var p=r.formatting;n.highlightFormatting&&(r.formatting="code");var v=j(r),y=t.pos;t.eatWhile("`");var w=1+t.pos-y;return r.code?w===o?(r.code=!1,v):(r.formatting=p,j(r)):(o=w,r.code=!0,j(r))}if(r.code)return j(r);if(f==="!"&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=R,d;if(f==="["&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),j(r);if(f==="]"&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var l=j(r);return r.linkText=!1,r.inline=r.f=R,l}if(f==="<"&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=q,n.highlightFormatting&&(r.formatting="link");var l=j(r);return l?l+=" ":l="",l+m}if(f==="<"&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=q,n.highlightFormatting&&(r.formatting="link");var l=j(r);return l?l+=" ":l="",l+g}if(f==="<"&&t.match(/^\w/,!1)){if(t.string.indexOf(">")!=-1){var E=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(E)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),M(t,r,P)}if(f==="<"&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var S=!1;if(!n.underscoresBreakWords&&f==="_"&&t.peek()!=="_"&&t.match(/(\w)/,!1)){var x=t.pos-2;if(x>=0){var T=t.string.charAt(x);T!=="_"&&T.match(/(\w)/,!1)&&(S=!0)}}if(f==="*"||f==="_"&&!S){if(!a||t.peek()!==" "){if(r.strong===f&&t.eat(f)){n.highlightFormatting&&(r.formatting="strong");var v=j(r);return r.strong=!1,v}if(!r.strong&&t.eat(f))return r.strong=f,n.highlightFormatting&&(r.formatting="strong"),j(r);if(r.em===f){n.highlightFormatting&&(r.formatting="em");var v=j(r);return r.em=!1,v}if(!r.em)return r.em=f,n.highlightFormatting&&(r.formatting="em"),j(r)}}else if(f===" ")if(t.eat("*")||t.eat("_")){if(t.peek()===" ")return j(r);t.backUp(1)}if(n.strikethrough)if(f==="~"&&t.eatWhile(f)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=j(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),j(r)}else if(f===" "&&t.match(/^~~/,!0)){if(t.peek()===" ")return j(r);t.backUp(2)}return f===" "&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),j(r)}function q(e,t){var r=e.next();if(r===">"){t.f=t.inline=I,n.highlightFormatting&&(t.formatting="link");var i=j(t);return i?i+=" ":i="",i+m}return e.match(/^[^>]+/,!0),m}function R(e,t){if(e.eatSpace())return null;var r=e.next();return r==="("||r==="["?(t.f=t.inline=U(r==="("?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,j(t)):"error"}function U(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=I,n.highlightFormatting&&(r.formatting="link-string");var s=j(r);return r.linkHref=!1,s}return t.match($(e),!0)&&t.backUp(1),r.linkHref=!0,j(r)}}function z(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=W,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,j(t)):O(e,t,I)}function W(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=X,n.highlightFormatting&&(t.formatting="link");var r=j(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),y}function X(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===undefined?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=I,b)}function $(e){return V[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),V[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),V[e]}var r=e.modes.hasOwnProperty("xml"),i=e.getMode(t,r?{name:"xml",htmlMode:!0}:"text/plain");n.highlightFormatting===undefined&&(n.highlightFormatting=!1),n.maxBlockquoteDepth===undefined&&(n.maxBlockquoteDepth=0),n.underscoresBreakWords===undefined&&(n.underscoresBreakWords=!0),n.fencedCodeBlocks===undefined&&(n.fencedCodeBlocks=!1),n.taskLists===undefined&&(n.taskLists=!1),n.strikethrough===undefined&&(n.strikethrough=!1);var o=0,u="header",a="comment",f="quote",l="variable-2",c="variable-3",h="keyword",p="hr",d="tag",v="formatting",m="link",g="link",y="link",b="string",w="em",E="strong",S="strikethrough",x=/^([*\-=_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,N=/^[0-9]+\.\s+/,C=/^\[(x| )\](?=\s)/,k=/^#+ ?/,L=/^(?:\={1,}|-{1,})$/,A=/^[^#!\[\]*_\\<>` "'(~]+/,V=[],J={startState:function(){return{f:D,prevLineHasContent:!1,thisLineHasContent:!1,block:D,htmlState:null,indentation:0,inline:I,text:F,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){t.formatting=!1;if(e.sol()){var n=!!t.header;t.header=0;if(e.match(/^\s*$/,!0)||n)return t.prevLineHasContent=!1,_(t),n?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length,i=Math.floor((r-t.indentation)/4)*4;i>4&&(i=4);var s=t.indentation+i;t.indentationDiff=s-t.indentation,t.indentation=s;if(r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==P?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:J}},blankLine:_,getType:j,fold:"markdown"};return J},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/edit/matchbrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e,t,i,o){var u=e.getLineHandle(t.line),a=t.ch-1,f=a>=0&&r[u.text.charAt(a)]||r[u.text.charAt(++a)];if(!f)return null;var l=f.charAt(1)==">"?1:-1;if(i&&l>0!=(a==t.ch))return null;var c=e.getTokenTypeAt(n(t.line,a+1)),h=s(e,n(t.line,a+(l>0?1:0)),l,c||null,o);return h==null?null:{from:n(t.line,a),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:l>0}}function s(e,t,i,s,o){var u=o&&o.maxScanLineLength||1e4,a=o&&o.maxScanLines||1e3,f=[],l=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,c=i>0?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a);for(var h=t.line;h!=c;h+=i){var p=e.getLine(h);if(!p)continue;var d=i>0?0:p.length-1,v=i>0?p.length:-1;if(p.length>u)continue;h==t.line&&(d=t.ch-(i<0?1:0));for(;d!=v;d+=i){var m=p.charAt(d);if(l.test(m)&&(s===undefined||e.getTokenTypeAt(n(h,d+1))==s)){var g=r[m];if(g.charAt(1)==">"==i>0)f.push(m);else{if(!f.length)return{pos:n(h,d),ch:m};f.pop()}}}}return h-i==(i>0?e.lastLine():e.firstLine())?!1:null}function o(e,r,s){var o=e.state.matchBrackets.maxHighlightLineLength||1e3,u=[],a=e.listSelections();for(var f=0;f<a.length;f++){var l=a[f].empty()&&i(e,a[f].head,!1,s);if(l&&e.getLine(l.from.line).length<=o){var c=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";u.push(e.markText(l.from,n(l.from.line,l.from.ch+1),{className:c})),l.to&&e.getLine(l.to.line).length<=o&&u.push(e.markText(l.to,n(l.to.line,l.to.ch+1),{className:c}))}}if(u.length){t&&e.state.focused&&e.focus();var h=function(){e.operation(function(){for(var e=0;e<u.length;e++)u[e].clear()})};if(!r)return h;setTimeout(h,800)}}function a(e){e.operation(function(){u&&(u(),u=null),u=o(e,!1,e.state.matchBrackets)})}var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},u=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",a),n&&(t.state.matchBrackets=typeof n=="object"?n:{},t.on("cursorActivity",a))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,n){return i(this,e,t,n)}),e.defineExtension("scanForBracket",function(e,t,n,r){return s(this,e,t,n,r)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/continuecomment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(t){if(t.getOption("disableInput"))return e.Pass;var n=t.listSelections(),r,s=[];for(var o=0;o<n.length;o++){var u=n[o].head,a=t.getTokenAt(u);if(a.type!="comment")return e.Pass;var f=e.innerMode(t.getMode(),a.state).mode;if(!r)r=f;else if(r!=f)return e.Pass;var l=null;if(r.blockCommentStart&&r.blockCommentContinue){var c=a.string.indexOf(r.blockCommentEnd),h=t.getRange(e.Pos(u.line,0),e.Pos(u.line,a.end)),p;if(!(c!=-1&&c==a.string.length-r.blockCommentEnd.length&&u.ch>=c))if(a.string.indexOf(r.blockCommentStart)==0){l=h.slice(0,a.start);if(!/^\s*$/.test(l)){l="";for(var d=0;d<a.start;++d)l+=" "}}else(p=h.indexOf(r.blockCommentContinue))!=-1&&p+r.blockCommentContinue.length>a.start&&/^\s*$/.test(h.slice(0,p))&&(l=h.slice(0,p));l!=null&&(l+=r.blockCommentContinue)}if(l==null&&r.lineComment&&i(t)){var v=t.getLine(u.line),p=v.indexOf(r.lineComment);p>-1&&(l=v.slice(0,p),/\S/.test(l)?l=null:l+=r.lineComment+v.slice(p+r.lineComment.length).match(/^\s*/)[0])}if(l==null)return e.Pass;s[o]="\n"+l}t.operation(function(){for(var e=n.length-1;e>=0;e--)t.replaceRange(s[e],n[e].from(),n[e].to(),"+insert")})}function i(e){var t=e.getOption("continueComments");return t&&typeof t=="object"?t.continueLineComment!==!1:!0}var t=["clike","css","javascript"];for(var n=0;n<t.length;++n)e.extendMode(t[n],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(t,n,i){i&&i!=e.Init&&t.removeKeyMap("continueComment");if(n){var s="Enter";typeof n=="string"?s=n:typeof n=="object"&&n.key&&(s=n.key);var o={name:"continueComment"};o[s]=r,t.addKeyMap(o)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/comment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e){var t=e.search(n);return t==-1?0:t}var t={},n=/[^\s\u00a0]/,r=e.Pos;e.commands.toggleComment=function(e){var t=Infinity,n=e.listSelections(),i=null;for(var s=n.length-1;s>=0;s--){var o=n[s].from(),u=n[s].to();if(o.line>=t)continue;u.line>=t&&(u=r(t,0)),t=o.line,i==null?e.uncomment(o,u)?i="un":(e.lineComment(o,u),i="line"):i=="un"?e.uncomment(o,u):e.lineComment(o,u)}},e.defineExtension("lineComment",function(e,s,o){o||(o=t);var u=this,a=u.getModeAt(e),f=o.lineComment||a.lineComment;if(!f){if(o.blockCommentStart||a.blockCommentStart)o.fullLines=!0,u.blockComment(e,s,o);return}var l=u.getLine(e.line);if(l==null)return;var c=Math.min(s.ch!=0||s.line==e.line?s.line+1:s.line,u.lastLine()+1),h=o.padding==null?" ":o.padding,p=o.commentBlankLines||e.line==s.line;u.operation(function(){if(o.indent){var t=l.slice(0,i(l));for(var s=e.line;s<c;++s){var a=u.getLine(s),d=t.length;if(!p&&!n.test(a))continue;a.slice(0,d)!=t&&(d=i(a)),u.replaceRange(t+f+h,r(s,0),r(s,d))}}else for(var s=e.line;s<c;++s)(p||n.test(u.getLine(s)))&&u.replaceRange(f+h,r(s,0))})}),e.defineExtension("blockComment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=s.blockCommentStart||u.blockCommentStart,f=s.blockCommentEnd||u.blockCommentEnd;if(!a||!f){(s.lineComment||u.lineComment)&&s.fullLines!=0&&o.lineComment(e,i,s);return}var l=Math.min(i.line,o.lastLine());l!=e.line&&i.ch==0&&n.test(o.getLine(l))&&--l;var c=s.padding==null?" ":s.padding;if(e.line>l)return;o.operation(function(){if(s.fullLines!=0){var t=n.test(o.getLine(l));o.replaceRange(c+f,r(l)),o.replaceRange(a+c,r(e.line,0));var h=s.blockCommentLead||u.blockCommentLead;if(h!=null)for(var p=e.line+1;p<=l;++p)(p!=l||t)&&o.replaceRange(h+c,r(p,0))}else o.replaceRange(f,i),o.replaceRange(a,e)})}),e.defineExtension("uncomment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=Math.min(i.ch!=0||i.line==e.line?i.line:i.line-1,o.lastLine()),f=Math.min(e.line,a),l=s.lineComment||u.lineComment,c=[],h=s.padding==null?" ":s.padding,p;e:{if(!l)break e;for(var d=f;d<=a;++d){var v=o.getLine(d),m=v.indexOf(l);m>-1&&!/comment/.test(o.getTokenTypeAt(r(d,m+1)))&&(m=-1);if(!(m!=-1||d==a&&d!=f||!n.test(v)))break e;if(m>-1&&n.test(v.slice(0,m)))break e;c.push(v)}o.operation(function(){for(var e=f;e<=a;++e){var t=c[e-f],n=t.indexOf(l),i=n+l.length;if(n<0)continue;t.slice(i,i+h.length)==h&&(i+=h.length),p=!0,o.replaceRange("",r(e,n),r(e,i))}});if(p)return!0}var g=s.blockCommentStart||u.blockCommentStart,y=s.blockCommentEnd||u.blockCommentEnd;if(!g||!y)return!1;var b=s.blockCommentLead||u.blockCommentLead,w=o.getLine(f),E=a==f?w:o.getLine(a),S=w.indexOf(g),x=E.lastIndexOf(y);x==-1&&f!=a&&(E=o.getLine(--a),x=E.lastIndexOf(y));if(S==-1||x==-1||!/comment/.test(o.getTokenTypeAt(r(f,S+1)))||!/comment/.test(o.getTokenTypeAt(r(a,x+1))))return!1;var T=w.lastIndexOf(g,e.ch),N=T==-1?-1:w.slice(0,e.ch).indexOf(y,T+g.length);if(T!=-1&&N!=-1&&N+y.length!=e.ch)return!1;N=E.indexOf(y,i.ch);var C=E.slice(i.ch).lastIndexOf(g,N-i.ch);return T=N==-1||C==-1?-1:i.ch+C,N!=-1&&T!=-1&&T!=i.ch?!1:(o.operation(function(){o.replaceRange("",r(a,x-(h&&E.slice(x-h.length,x)==h?h.length:0)),r(a,x+y.length));var e=S+g.length;h&&w.slice(e,e+h.length)==h&&(e+=h.length),o.replaceRange("",r(f,S),r(f,e));if(b)for(var t=f+1;t<=a;++t){var i=o.getLine(t),s=i.indexOf(b);if(s==-1||n.test(i.slice(0,s)))continue;var u=s+b.length;h&&i.slice(u,u+h.length)==h&&(u+=h.length),o.replaceRange("",r(t,s),r(t,u))}}),!0)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){this.cm=e,this.options=this.buildOptions(t),this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(),this.startLen=this.cm.getLine(this.startPos.line).length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function o(e){return typeof e=="string"?e:e.text}function u(e,t){function s(e,r){var s;typeof r!="string"?s=function(e){return r(e,t)}:n.hasOwnProperty(r)?s=n[r]:s=r,i[e]=s}var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,i=r?{}:n;if(r)for(var o in r)r.hasOwnProperty(o)&&s(o,r[o]);var u=e.options.extraKeys;if(u)for(var o in u)u.hasOwnProperty(o)&&s(o,u[o]);return i}function a(e,t){while(t&&t!=e){if(t.nodeName.toUpperCase()==="LI"&&t.parentNode==e)return t;t=t.parentNode}}function f(r,i){this.completion=r,this.data=i,this.picked=!1;var s=this,f=r.cm,l=this.hints=document.createElement("ul");l.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;var c=i.list;for(var h=0;h<c.length;++h){var p=l.appendChild(document.createElement("li")),d=c[h],v=t+(h!=this.selectedHint?"":" "+n);d.className!=null&&(v=d.className+" "+v),p.className=v,d.render?d.render(p,i,d):p.appendChild(document.createTextNode(d.displayText||o(d))),p.hintId=h}var m=f.cursorCoords(r.options.alignWithWord?i.from:null),g=m.left,y=m.bottom,b=!0;l.style.left=g+"px",l.style.top=y+"px";var w=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),E=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(r.options.container||document.body).appendChild(l);var S=l.getBoundingClientRect(),x=S.bottom-E;if(x>0){var T=S.bottom-S.top,N=m.top-(m.bottom-S.top);if(N-T>0)l.style.top=(y=m.top-T)+"px",b=!1;else if(T>E){l.style.height=E-5+"px",l.style.top=(y=m.bottom-S.top)+"px";var C=f.getCursor();i.from.ch!=C.ch&&(m=f.cursorCoords(C),l.style.left=(g=m.left)+"px",S=l.getBoundingClientRect())}}var k=S.right-w;k>0&&(S.right-S.left>w&&(l.style.width=w-5+"px",k-=S.right-S.left-w),l.style.left=(g=m.left-k)+"px"),f.addKeyMap(this.keyMap=u(r,{moveFocus:function(e,t){s.changeActive(s.selectedHint+e,t)},setFocus:function(e){s.changeActive(e)},menuSize:function(){return s.screenAmount()},length:c.length,close:function(){r.close()},pick:function(){s.pick()},data:i}));if(r.options.closeOnUnfocus){var L;f.on("blur",this.onBlur=function(){L=setTimeout(function(){r.close()},100)}),f.on("focus",this.onFocus=function(){clearTimeout(L)})}var A=f.getScrollInfo();return f.on("scroll",this.onScroll=function(){var e=f.getScrollInfo(),t=f.getWrapperElement().getBoundingClientRect(),n=y+A.top-e.top,i=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);b||(i+=l.offsetHeight);if(i<=t.top||i>=t.bottom)return r.close();l.style.top=n+"px",l.style.left=g+A.left-e.left+"px"}),e.on(l,"dblclick",function(e){var t=a(l,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),s.pick())}),e.on(l,"click",function(e){var t=a(l,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),r.options.completeOnSingleClick&&s.pick())}),e.on(l,"mousedown",function(){setTimeout(function(){f.focus()},20)}),e.signal(i,"select",c[0],l.firstChild),!0}var t="CodeMirror-hint",n="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",function(t){if(this.listSelections().length>1||this.somethingSelected())return;this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new r(this,t);if(!n.options.hint)return;e.signal(this,"startCompletion",this),n.update(!0)});var i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},s=window.cancelAnimationFrame||clearTimeout;r.prototype={close:function(){if(!this.active())return;this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm)},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n];r.hint?r.hint(this.cm,t,r):this.cm.replaceRange(o(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(s(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=i(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(t){if(this.tick==null)return;this.data&&e.signal(this.data,"update");if(!this.options.hint.async)this.finishUpdate(this.options.hint(this.cm,this.options),t);else{var n=++this.tick,r=this;this.options.hint(this.cm,function(e){r.tick==n&&r.finishUpdate(e,t)},this.options)}},finishUpdate:function(t,n){this.data=t;var r=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close(),t&&t.list.length&&(r&&t.list.length==1?this.pick(t,0):(this.widget=new f(this,t),e.signal(t,"shown")))},buildOptions:function(e){var t=this.cm.options.hintOptions,n={};for(var r in l)n[r]=l[r];if(t)for(var r in t)t[r]!==undefined&&(n[r]=t[r]);if(e)for(var r in e)e[r]!==undefined&&(n[r]=e[r]);return n}},f.prototype={close:function(){if(this.completion.widget!=this)return;this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1);if(this.selectedHint==t)return;var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+n,""),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+n,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",function(t,n){var r=t.getHelpers(t.getCursor(),"hint"),i;if(r.length)for(var s=0;s<r.length;s++){var o=r[s](t,n);if(o&&o.list.length)return o}else if(i=t.getHelper(t.getCursor(),"hintWords")){if(i)return e.hint.fromList(t,{words:i})}else if(e.hint.anyword)return e.hint.anyword(t,n)}),e.registerHelper("hint","fromList",function(t,n){var r=t.getCursor(),i=t.getTokenAt(r),s=[];for(var o=0;o<n.words.length;o++){var u=n.words[o];u.slice(0,i.string.length)==i.string&&s.push(u)}if(s.length)return{list:s,from:e.Pos(r.line,i.start),to:e.Pos(r.line,i.end)}}),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/anyword-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=/[\w$]+/,n=500;e.registerHelper("hint","anyword",function(r,i){var s=i&&i.word||t,o=i&&i.range||n,u=r.getCursor(),a=r.getLine(u.line),f=u.ch,l=f;while(l&&s.test(a.charAt(l-1)))--l;var c=l!=f&&a.slice(l,f),h=[],p={},d=new RegExp(s.source,"g");for(var v=-1;v<=1;v+=2){var m=u.line,g=Math.min(Math.max(m+v*o,r.firstLine()),r.lastLine())+v;for(;m!=g;m+=v){var y=r.getLine(m),b;while(b=d.exec(y)){if(m==u.line&&b[0]===c)continue;(!c||b[0].lastIndexOf(c,0)==0)&&!Object.prototype.hasOwnProperty.call(p,b[0])&&(p[b[0]]=!0,h.push(b[0]))}}}return{list:h,from:e.Pos(u.line,l),to:e.Pos(u.line,f)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/display/placeholder",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder",n.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){s(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=s(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function s(e){return e.lineCount()===1&&e.getLine(0)===""}e.defineOption("placeholder","",function(n,s,o){var u=o&&o!=e.Init;if(s&&!u)n.on("blur",r),n.on("change",i),i(n);else if(!s&&u){n.off("blur",r),n.off("change",i),t(n);var a=n.getWrapperElement();a.className=a.className.replace(" CodeMirror-empty","")}s&&!n.hasFocus()&&r(n)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/runmode/runmode",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.runMode=function(t,n,r,i){var s=e.getMode(e.defaults,n),o=/MSIE \d/.test(navigator.userAgent),u=o&&(document.documentMode==null||document.documentMode<9);if(r.nodeType==1){var a=i&&i.tabSize||e.defaults.tabSize,f=r,l=0;f.innerHTML="",r=function(e,t){if(e=="\n"){f.appendChild(document.createTextNode(u?"\r":e)),l=0;return}var n="";for(var r=0;;){var i=e.indexOf("	",r);if(i==-1){n+=e.slice(r),l+=e.length-r;break}l+=i-r,n+=e.slice(r,i);var s=a-l%a;l+=s;for(var o=0;o<s;++o)n+=" ";r=i+1}if(t){var c=f.appendChild(document.createElement("span"));c.className="cm-"+t.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(n))}else f.appendChild(document.createTextNode(n))}}var c=e.splitLines(t),h=i&&i.state||e.startState(s);for(var p=0,d=c.length;p<d;++p){p&&r("\n");var v=new e.StringStream(c[p]);!v.string&&s.blankLine&&s.blankLine(h);while(!v.eol()){var m=s.token(v,h);r(v.current(),m,p,v.start,h),v.start=v.pos}}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hover/text-hover",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){(function(){function n(t,n){function i(t){if(!r.parentNode)return e.off(document,"mousemove",i);r.style.top=Math.max(0,t.clientY-r.offsetHeight-5)+"px",r.style.left=t.clientX+5+"px"}var r=document.createElement("div");return r.className="CodeMirror-hover-tooltip",typeof n=="string"&&(n=document.createTextNode(n)),r.appendChild(n),document.body.appendChild(r),e.on(document,"mousemove",i),i(t),r.style.opacity!=null&&(r.style.opacity=1),r}function r(e){e.parentNode&&e.parentNode.removeChild(e)}function i(e){if(!e.parentNode)return;e.style.opacity==null&&r(e),e.style.opacity=0,setTimeout(function(){r(e)},600)}function s(r,s,o,u,a){function l(){e.off(o,"mouseout",l),e.off(o,"click",l),o.className=o.className.replace(t,""),f&&(i(f),f=null),a.removeKeyMap(u.keyMap)}var f=n(r,s),c=setInterval(function(){if(f)for(var e=o;;e=e.parentNode){if(e==document.body)return;if(!e){l();break}}if(!f)return clearInterval(c)},400);e.on(o,"mouseout",l),e.on(o,"click",l),u.keyMap={Esc:l},a.addKeyMap(u.keyMap)}function o(e,t){this.options=t,this.timeout=null,t.delay?this.onMouseOver=function(t){a(e,t)}:this.onMouseOver=function(t){f(e,t)},this.keyMap=null}function u(t,n){if(n instanceof Function)return{getTextHover:n};if(!n||n===!0)n={};n.getTextHover||(n.getTextHover=t.getHelper(e.Pos(0,0),"textHover"));if(!n.getTextHover)throw new Error("Required option 'getTextHover' missing (text-hover addon)");return n}function a(e,t){var n=e.state.textHover,r=n.options.delay;clearTimeout(n.timeout);if(t.srcElement){var i={srcElement:t.srcElement,clientX:t.clientX,clientY:t.clientY};t=i}n.timeout=setTimeout(function(){f(e,t)},r)}function f(e,n){var r=n.target||n.srcElement;if(r){var i=e.state.textHover,o=h(e,n),u=i.options.getTextHover(e,o,n);u&&(r.className+=t,typeof u=="function"?u(s,o,n,r,i,e):s(n,u,r,i,e))}}function l(t,n,r){r&&r!=e.Init&&(e.off(t.getWrapperElement(),"mouseover",t.state.textHover.onMouseOver),delete t.state.textHover);if(n){var i=t.state.textHover=new o(t,u(t,n));e.on(t.getWrapperElement(),"mouseover",i.onMouseOver)}}function h(e,t){var n=t.target||t.srcElement,r=n.innerText||n.textContent;for(var i=0;i<c.length;i+=2){var s=e.coordsChar({left:t.clientX+c[i],top:t.clientY+c[i+1]}),o=e.getTokenAt(s);if(o&&o.string===r)return{token:o,pos:s}}}var t=" CodeMirror-hover",c=[0,0,0,5,0,-5,5,0,-5,0];e.defineOption("textHover",!1,l)})()}),define("cm/addon/hover/prolog-hover",["../../lib/codemirror","jquery","laconic"],function(e,t){function i(e){return t.el.span({"class":"pred-name"},e.text+"/"+e.arity)}function s(e,t,r){n[r]=t}function o(e,t){var r;return n[e.file]?n[e.file]:(r=e.file.lastIndexOf("/"))?e.file.substring(r+1):e.file}var n={},r={goal_built_in:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Built-in predicate"},goal_global:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Global predicate"},goal_autoload:function(e,n){return e?t.el.div(i(e)," (autoload from ",o(e,n),"): ",n.tokenInfo(e)):"Autoloaded predicate"},goal_imported:function(e,n){return e?t.el.div(i(e)," (imported from ",o(e,n),"): ",n.tokenInfo(e)):"Imported predicate"},goal_recursion:"Recursive call",goal_dynamic:"Dynamic predicate",goal_undefined:"Undefined predicate",goal_local:function(e,n){return e&&e.file?t.el.div("Predicate included from ",t.el.span({"class":"file-path"},e.file)):e&&e.line?"Predicate defined in line "+e.line:"Locally defined predicate"},head_unreferenced:"Predicate is not called",file:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path))):"File name"},file_no_depends:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path),t.el.div({"class":"hover-remark"},"does not resolve any dependencies"))):"File name (does not resolve any dependencies)"},error:function(e,n){return e&&e.expected?t.el.div("error: ",t.el.strong(e.expected)," expected"):"error"},singleton:"Variable appearing only once",codes:"List of Unicode code points (integers)",chars:"List of one-character atoms",string:"Packed string (SWI7, use `text` for a list of codes)",qatom:"Quoted atom",tag:"Tag of a SWI7 dict",head:null,control:null,fullstop:null,"var":null,"int":null,"float":null,number:null,atom:null,functor:null,comment:null,neck:null,operator:null,sep:null,list_open:null,list_close:null,dict_open:null,dict_close:null};e.registerHelper("textHover","prolog",function(e,n,i){if(n){var s=n.token,o=r[s.type],u;if(o===undefined)return(u=e.getEnrichedToken(s))?u.summary&&u.info==="ask"?t.el.div(u.summary,e.tokenInfo(u)):u.summary?t.el.div(u.summary):t.el.div(s.type):t.el.div(s.type);if(typeof o=="function"){var a=o(e.getEnrichedToken(s),e);return typeof a=="string"?t.el.div(a):a}if(typeof o=="string")return t.el.div(o)}return null})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-context-info",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=null;e.attachContextInfo=function(n){e.on(n,"select",function(e,n){n=n.parentNode;var r=null;e.info&&(r=e.info(e));if(r){var i=n.getBoundingClientRect();t==null&&(t=document.createElement("div"),t.className="CodeMirror-hints-contextInfo",document.body.appendChild(t)),t.innerHTML="",t.style.top=n.style.top,t.style.left=i.right+"px",typeof r=="string"?t.innerHTML=r:t.appendChild(r),t.style.display="block"}else t!=null&&(t.innerHTML="",t.style.display="none")}),e.on(n,"close",function(){t!=null&&t.parentNode.removeChild(t),t=null})},e.showContextInfo=function(t){return function(n,r,i){i||(i=r);var s=t(n,i);return e.attachContextInfo(s),s}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/keymap/emacs",["../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,t){return e.line==t.line&&e.ch==t.ch}function i(e){r.push(e),r.length>50&&r.shift()}function s(e){if(!r.length)return i(e);r[r.length-1]+=e}function o(e){return r[r.length-(e?Math.min(e,1):1)]||""}function u(){return r.length>1&&r.pop(),o()}function f(e,t,r,o,u){u==null&&(u=e.getRange(t,r)),o&&a&&a.cm==e&&n(t,a.pos)&&e.isClean(a.gen)?s(u):i(u),e.replaceRange("",t,r,"+delete"),o?a={cm:e,pos:t,gen:e.changeGeneration()}:a=null}function l(e,t,n){return e.findPosH(t,n,"char",!0)}function c(e,t,n){return e.findPosH(t,n,"word",!0)}function h(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function p(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function d(e,n,r){var i=n.line,s=e.getLine(i),o=/\S/.test(r<0?s.slice(0,n.ch):s.slice(n.ch)),u=e.firstLine(),a=e.lastLine();for(;;){i+=r;if(i<u||i>a)return e.clipPos(t(i-r,r<0?0:null));s=e.getLine(i);var f=/\S/.test(s);if(f)o=!0;else if(o)return t(i,0)}}function v(e,n,r){var i=n.line,s=n.ch,o=e.getLine(n.line),u=!1;for(;;){var a=o.charAt(s+(r<0?-1:0));if(!a){if(i==(r<0?e.firstLine():e.lastLine()))return t(i,s);o=e.getLine(i+r);if(!/\S/.test(o))return t(i,s);i+=r,s=r<0?o.length:0;continue}if(u&&/[!?.]/.test(a))return t(i,s+(r>0?1:0));u||(u=/\w/.test(a)),s+=r}}function m(e,r,i){var s;if(e.findMatchingBracket&&(s=e.findMatchingBracket(r,!0))&&s.match&&(s.forward?1:-1)==i)return i>0?t(s.to.line,s.to.ch+1):s.to;for(var o=!0;;o=!1){var u=e.getTokenAt(r),a=t(r.line,i<0?u.start:u.end);if(!(o&&i>0&&u.end==r.ch||!/\w/.test(u.string)))return a;var f=e.findPosH(a,i,"char");if(n(a,f))return r;r=f}}function g(e,t){var n=e.state.emacsPrefix;return n?(C(e),n=="-"?-1:Number(n)):t?null:1}function y(e){var t=typeof e=="string"?function(t){t.execCommand(e)}:e;return function(e){var n=g(e);t(e);for(var r=1;r<n;++r)t(e)}}function b(e,t,r,i){var s=g(e);s<0&&(i=-i,s=-s);for(var o=0;o<s;++o){var u=r(e,t,i);if(n(u,t))break;t=u}return t}function w(e,t){var n=function(n){n.extendSelection(b(n,n.getCursor(),e,t))};return n.motion=!0,n}function E(e,t,n){var r=e.listSelections(),i,s=r.length;while(s--)i=r[s].head,f(e,i,b(e,i,t,n),!0)}function S(e){if(e.somethingSelected()){var t=e.listSelections(),n,r=t.length;while(r--)n=t[r],f(e,n.anchor,n.head);return!0}}function x(e,t){if(e.state.emacsPrefix){t!="-"&&(e.state.emacsPrefix+=t);return}e.state.emacsPrefix=t,e.on("keyHandled",N),e.on("inputRead",k)}function N(e,t){!e.state.emacsPrefixMap&&!T.hasOwnProperty(t)&&C(e)}function C(e){e.state.emacsPrefix=null,e.off("keyHandled",N),e.off("inputRead",k)}function k(e,t){var n=g(e);if(n>1&&t.origin=="+input"){var r=t.text.join("\n"),i="";for(var s=1;s<n;++s)i+=r;e.replaceSelection(i)}}function L(e){e.state.emacsPrefixMap=!0,e.addKeyMap(j),e.on("keyHandled",A),e.on("inputRead",A)}function A(e,t){if(!(typeof t!="string"||!/^\d$/.test(t)&&t!="Ctrl-U"))return;e.removeKeyMap(j),e.state.emacsPrefixMap=!1,e.off("keyHandled",A),e.off("inputRead",A)}function O(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function M(e){e.setExtending(!1),e.setCursor(e.getCursor())}function _(e,t,n){e.openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))}function D(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}function P(e){var n=e.getCursor(),r=n.line,i=n.ch,s=[];while(r>=e.firstLine()){var o=e.getLine(r);for(var u=i==null?o.length:i;u>0;){var i=o.charAt(--u);if(i==")")s.push("(");else if(i=="]")s.push("[");else if(i=="}")s.push("{");else if(/[\(\{\[]/.test(i)&&(!s.length||s.pop()!=i))return e.extendSelection(t(r,u))}--r,i=null}}function H(e){e.execCommand("clearSearch"),M(e)}function F(e){j[e]=function(t){x(t,e)},B["Ctrl-"+e]=function(t){x(t,e)},T["Ctrl-"+e]=!0}var t=e.Pos,r=[],a=null,T={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},B=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){f(e,e.getCursor("start"),e.getCursor("end"))},"Ctrl-K":y(function(e){var n=e.getCursor(),r=e.clipPos(t(n.line)),i=e.getRange(n,r);/\S/.test(i)||(i+="\n",r=t(n.line+1,0)),f(e,n,r,!0,i)}),"Alt-W":function(e){i(e.getSelection()),M(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(o(g(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection(u(),"around","paste")},"Ctrl-Space":O,"Ctrl-Shift-2":O,"Ctrl-F":w(l,1),"Ctrl-B":w(l,-1),Right:w(l,1),Left:w(l,-1),"Ctrl-D":function(e){E(e,l,1)},Delete:function(e){S(e)||E(e,l,1)},"Ctrl-H":function(e){E(e,l,-1)},Backspace:function(e){S(e)||E(e,l,-1)},"Alt-F":w(c,1),"Alt-B":w(c,-1),"Alt-D":function(e){E(e,c,1)},"Alt-Backspace":function(e){E(e,c,-1)},"Ctrl-N":w(h,1),"Ctrl-P":w(h,-1),Down:w(h,1),Up:w(h,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":w(p,-1),"Ctrl-V":w(p,1),PageUp:w(p,-1),PageDown:w(p,1),"Ctrl-Up":w(d,-1),"Ctrl-Down":w(d,1),"Alt-A":w(v,-1),"Alt-E":w(v,1),"Alt-K":function(e){E(e,v,1)},"Ctrl-Alt-K":function(e){E(e,m,1)},"Ctrl-Alt-Backspace":function(e){E(e,m,-1)},"Ctrl-Alt-F":w(m,1),"Ctrl-Alt-B":w(m,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(b(e,t,m,1),t)},"Ctrl-Alt-T":function(e){var t=m(e,e.getCursor(),-1),n=m(e,t,1),r=m(e,n,1),i=m(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":y(P),"Alt-Space":function(e){var n=e.getCursor(),r=n.ch,i=n.ch,s=e.getLine(n.line);while(r&&/\s/.test(s.charAt(r-1)))--r;while(i<s.length&&/\s/.test(s.charAt(i)))++i;e.replaceRange(" ",t(n.line,r),t(n.line,i))},"Ctrl-O":y(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":y(function(e){e.execCommand("transposeChars")}),"Alt-C":y(function(e){D(e,function(e){var t=e.search(/\w/);return t==-1?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":y(function(e){D(e,function(e){return e.toUpperCase()})}),"Alt-L":y(function(e){D(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":y("undo"),"Shift-Ctrl--":y("undo"),"Ctrl-Z":y("undo"),"Cmd-Z":y("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findNext","Ctrl-R":"findPrev","Ctrl-G":H,"Shift-Alt-5":"replace","Alt-/":"autocomplete","Ctrl-J":"newlineAndIndent",Enter:!1,Tab:"indentAuto","Alt-G G":function(e){var t=g(e,!0);if(t!=null&&t>0)return e.setCursor(t-1);_(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==n|0&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(g(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":y("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){f(e,e.getCursor(),v(e,e.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":y("insertTab"),"Ctrl-U":L}),j={"Ctrl-G":C};for(var I=0;I<10;++I)F(String(I));F("-")}),define("editor",["cm/lib/codemirror","config","preferences","form","cm/mode/prolog/prolog-template-hint","modal","tabbed","storage","cm/mode/prolog/prolog","cm/mode/prolog/prolog_keys","cm/mode/prolog/prolog_query","cm/mode/xml/xml","cm/addon/fold/xml-fold","cm/addon/edit/matchtags","cm/mode/markdown/markdown","cm/addon/edit/matchbrackets","cm/addon/comment/continuecomment","cm/addon/comment/comment","cm/addon/hint/show-hint","cm/addon/hint/anyword-hint","cm/addon/display/placeholder","cm/addon/runmode/runmode","cm/addon/hover/text-hover","cm/addon/hover/prolog-hover","cm/addon/hint/templates-hint","cm/addon/hint/show-context-info","jquery","laconic","cm/keymap/emacs"],function(e,t,n,r,i,s,o){function u(e,t){var n=[];t=t||"",n.push("<style>\n");for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n.push(t,r,"{");for(var s in i)i.hasOwnProperty(s)&&n.push(s,":",i[s],";");n.push("}\n")}n.push("</style>\n"),$("body").append(n.join(""))}(function(r){var u="prologEditor",a={prolog:{mode:"prolog",role:"source",placeholder:"Your Prolog rules and facts go here ...",lineNumbers:!0,autoCurrent:!0,save:!1,theme:"prolog",matchBrackets:!0,textHover:!1,prologKeys:!0,matchTags:!1,extraKeys:{"Ctrl-Space":"autocomplete","Alt-/":"autocomplete"},hintOptions:{hint:i.getHints,completeSingle:!1}},xml:{mode:"xml",role:"source",placeholder:"Your ontology goes here (use RDF/XML format) ...",lineNumbers:!0,autoCurrent:!0,save:!1,matchTags:{bothTags:!0},extraKeys:{"Ctrl-J":"toMatchingTag"},matchBrackets:!1,textHover:!1,prologKeys:!1},markdown:{mode:"markdown",placeholder:"Your markdown block goes here ...",lineWrapping:!0,save:!1}},f={query:{mode:"prolog",role:"query",placeholder:"Your query goes here ...",lineNumbers:!1,lineWrapping:!0,save:!1,extraKeys:{"Ctrl-Space":"autocomplete","Alt-/":"autocomplete"}}},l={_init:function(i){return this.each(function(){var s=r(this),o={},l={},c;i=i||{},i.mode=i.mode||"xml";var h=r.extend({},a[i.mode]);i.role&&f[i.role]&&(h=r.extend(h,f[i.role])),h=r.extend(h,i),n.getVal("emacs-keybinding")&&(h.keyMap="emacs");if(h.mode=="xml"||h.mode=="prolog")l.role=h.role,t.http.locations.cm_highlight&&(h.prologHighlightServer={url:t.http.locations.cm_highlight,role:h.role,enabled:n.getVal("semantic-highlighting")},h.sourceID&&(h.prologHighlightServer.sourceID=h.sourceID),h.extraKeys["Ctrl-R"]="refreshHighlight"),h.role=="source"&&(h.continueComments="Enter");if(c=s.children("textarea")[0]){function p(e){var t=r(c).data(e);t&&(o[e]=t)}p("file"),p("url"),p("title"),p("meta"),o.meta&&o.meta.path&&(o.type="filesys"),l.cm=e.fromTextArea(c,h)}else h.value||(h.value=s.text()),l.cm=e(s[0],h);s.data(u,l),s.prologEditor("loadMode",h.mode),s.addClass("trill_on_swish-event-receiver"),s.addClass("prolog-editor"),s.on("preference",function(e,t){s.prologEditor("preference",t)}),h.save&&(o.typeName=h.typeName||"program",s.prologEditor("setupStorage",o)),(h.mode=="xml"||h.mode=="prolog")&&l.role=="source"&&(s.on("activate-tab",function(e){h.autoCurrent&&s.prologEditor("makeCurrent"),l.cm.refresh()}),s.on("source-error",function(e,t){s.prologEditor("highlightError",t)}),s.on("clearMessages",function(e){s.prologEditor("clearMessages")}),s.on("pengine-died",function(e,t){if(l.pengines){var n=l.pengines.indexOf(t);n>=0&&l.pengines.splice(n,1)}l.traceMark&&l.traceMark.pengine==t&&(l.traceMark.clear(),l.traceMark=null)}))})},getOption:function(e){return this.data(u)[e]},setKeybinding:function(e){e=e||"default",this.data(u).cm.options.keyMap=e},loadMode:function(t){var n=this.data(u);return e.modes[t]?t!=n.mode&&n.cm.setOption("mode",t):require(["cm/mode/"+t+"/"+t],function(){n.cm.setOption("mode",t)}),this},isPengineSource:function(){var e=r(this).data(u);if(e&&e.role=="source"){var t=r(this).data("storage");if(t&&t.meta)if(t.meta.loaded||t.meta.module)return!1}return this},getBreakpoints:function(e){var t=[];return this.each(function(){var n=r(this).data(u),i=[],s=0,o=n.cm,a=o.firstLine(),f=o.lastLine();for(;a<f;a++){var l=o.lineInfo(a);l.gutterMarkers&&i.push(s+a+1)}if(i.length>0){var c;if(n.pengines&&n.pengines.indexOf(e)>=0)c="pengine://"+e+"/src";else{var h=r(this).data("storage");h&&(c="trill_on_swish://"+h.file)}c&&t.push({file:c,breakpoints:i})}}),t},getSource:function(e){var t=[];return this.each(function(){if(r(this).prologEditor("isPengineSource")){var n=r(this).data(u);n&&(!e||e==n.role)&&t.push(n.cm.getValue())}}),t.join("\n\n")},getSourceEx:function(){var e={value:this.data(u).cm.getValue()},t=this.prologEditor("getBreakpoints");return t.length>0&&(e.breakpoints=t),e},getSourceID:function(){var e=[];return this.each(function(){var t=r(this).data(u);t&&t.cm&&t.cm.state.prologHighlightServer?e.push(t.cm.state.prologHighlightServer.uuid):e.push(null)}),e},setSource:function(e,t){typeof e=="string"&&(e={data:e});if(this.data("storage")&&t!=1)this.storage("setSource",e);else{var n=this.data(u);n.cm.setValue(e.data);if(e.line||e.prompt)n.cm.refresh(),e.line?this.prologEditor("gotoLine",e.line,e):this.prologEditor("showTracePort",e.prompt);n.role=="source"&&r(".trill_on_swish-event-receiver").trigger("program-loaded",this)}return this},makeCurrent:function(){return r(".trill_on_swish-event-receiver").trigger("current-program",this),this},pengine:function(e){var t=this.data(u);if(e.add)return t.pengines=t.pengines||[],t.pengines.indexOf(e.add)<0&&t.pengines.push(e.add),this;if(e.has)return t.pengines&&t.pengines.indexOf(e.has)>=0},print:function(t){function i(e){var t=r.el.iframe({src:"about:blank"});r("body").append(t),r("body",t.contentWindow.document).append(e),t.contentWindow.print()}var n=r.el.pre({"class":"cm-s-default"});return t||(t=this.prologEditor("getSource")),e.runMode(t,"xml",n),r.ajax({url:"/trill_on_swish/css/print.css",dataType:"text",success:function(e){i(r.el.div(r.el.style(e),n))},error:function(e){s.ajaxError(jqXHR)}}),this},preference:function(e){var t=this.data(u);return e.name=="semantic-highlighting"&&t.cm.setOption("prologHighlightServer",{enabled:e.value}),e.name=="emacs-keybinding"&&(e.value==1?t.cm.setOption("keyMap","emacs"):t.cm.setOption("keyMap","default")),this},highlightError:function(e){if(e.location.file&&this.prologEditor("isMyFile",e.location.file)){var t=this.data(u),n=r(e.data).text(),i;e.location.ch?i=t.cm.charCoords({line:e.location.line-1,ch:e.location.ch},"local").left:i=0,n=n.replace(/^.*?:[0-9][0-9]*: /,"");var s=r.el.span({"class":"source-msg error"},n,r("<span>&times;</span>")[0]);r(s).css("margin-left",i+"px");var o=t.cm.addLineWidget(e.location.line-1,s);r(s).on("click",function(){o.clear()}),r(s).data("cm-widget",o)}return this},refreshHighlight:function(){var e=this.data(u);return this},clearMessages:function(){return this.find(".source-msg").each(function(){r(this).data("cm-widget").clear()}),this.prologEditor("showTracePort",null),this},isMyFile:function(e){var t="trill_on_swish://";if(e.startsWith("pengine://")){var n=this.data(u);if(n.pengines&&(id=e.split("/")[2])&&n.pengines.indexOf(id)>=0)return!0}if(e.startsWith(t)){var r=this.data("storage");if(e.slice(t.length)==r.file)return!0}return!1},showTracePort:function(e){if(this.length==0)return this;var t=this.data(u);t.traceMark&&(t.traceMark.clear(),t.traceMark=null);if(!(e&&e.source&&e.source.file))return this;var n=e.source.file;if(this.prologEditor("isMyFile",n)){if(e.source.from&&e.source.to){var r=t.cm.charOffsetToPos(e.source.from),i=t.cm.charOffsetToPos(e.source.to);this.is(":visible")||this.storage("expose","trace"),r&&i&&(t.traceMark=t.cm.markText(r,i,{className:"trace "+e.port}),t.traceMark.pengine=e.pengine,t.cm.scrollIntoView(r,50))}return this}},getExamples:function(e,t){var n=e?e:this.prologEditor("getSource"),i,s=[];if(r.trim(n)=="")return null;t==0?i=[e]:i=n.match(/\/\*\* *<?examples>?[\s\S]*?\*\//igm);if(i)for(var o=0;o<i.length;o++){var u=i[o].match(/^ *\?-[\s\S]*?[^-#$&*+./:<=>?@\\^~]\.\s/gm);if(u)for(var a=0;a<u.length;a++){var f=u[a].replace(/^ *\?-\s*/,"").replace(/\s*$/,"").replace(/\\'/g,"'");s.push(f)}}return s},search:function(e,t){var n=this.data(u).cm,r=n.firstLine(),i=n.lastLine(),s=[];for(var o=r;o<=i;o++){var a=n.getLine(o);if(a.search(e)>=0){s.push({line:o+1,text:a});if(t.max&&t.max===s.length)return s}}return s},gotoLine:function(e,t){function o(e){if(e._searchMarkers!==undefined){for(var t=0;t<e._searchMarkers.length;t++)e._searchMarkers[t].clear();e.off("cursorActivity",o)}e._searchMarkers=[]}var n=this.data(u),r=n.cm,i=0,s;o(r),t=t||{},s=t.regex,e-=1,s&&(i=r.getLine(e).search(s),i<0&&(i=0)),r.setCursor({line:e,ch:i});var a=r.getScrollInfo().clientHeight,f=r.charCoords({line:e,ch:0},"local");r.scrollTo(null,(f.top+f.bottom-a)/2);if(s){function l(e,t){var n;while(n=s.exec(r.getLine(e)))r._searchMarkers.push(r.markText({line:e,ch:n.index},{line:e,ch:n.index+n[0].length},{className:t,clearOnEnter:!0,clearWhenEmpty:!0,title:"Search match"}))}l(e,"CodeMirror-search-match");if(t.showAllMatches){var c=r.getViewport();for(var h=c.from;h<c.to;h++)h!=e&&l(h,"CodeMirror-search-alt-match")}r._searchMarkers.length>0&&r.on("cursorActivity",o)}},changeGen:function(){return this.data(u).cm.changeGeneration()},setupStorage:function(e){var t=this.data(u),n=this;return e.setValue=function(e){n.prologEditor("setSource",e,!0)},e.getValue=function(){return t.cm.getValue()},e.changeGen=function(){return t.cm.changeGeneration()},e.isClean=function(e){return t.cm.isClean(e)},e.cleanGeneration=t.cm.changeGeneration(),e.cleanData=t.cm.getValue(),e.cleanCheckpoint="load",this.storage(e),this}};o.tabTypes.program={dataType:"owl",typeName:"program",label:"Program",contentType:"text/x-html",order:100,create:function(e){r(e).addClass("prolog-editor").prologEditor({save:!0}).prologEditor("makeCurrent")}};if(t.trill_on_swish.tab_types){var c={save:!0,lineNumbers:!0};for(var h=0;h<t.trill_on_swish.tab_types.length;h++){var p=t.trill_on_swish.tab_types[h];if(p.editor){var d=r.extend({typeName:p.typeName},c,p.editor);p.create=function(e){r(e).addClass("prolog-editor").prologEditor(d)},o.tabTypes[p.typeName]=p}}}r.fn.prologEditor=function(e){if(l[e])return l[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return l._init.apply(this,arguments);r.error("Method "+e+" does not exist on jQuery."+u)}})(jQuery),e.prototype.charOffsetToPos=function(e){var t=this.firstLine(),n=this.lastLine(),r=0;for(;t<n;t++){var i=this.getLine(t);if(r<=e&&r+i.length>=e)return{line:t,ch:e-r};r+=i.length+1}},e.keyMap.emacs.Enter="newlineAndIndent",t.trill_on_swish.cm_style&&u(t.trill_on_swish.cm_style,".cm-s-prolog span.cm-"),t.trill_on_swish.cm_hover_style&&u(t.trill_on_swish.cm_hover_style,".CodeMirror-hover-tooltip ")}),define("query",["jquery","config","preferences","cm/lib/codemirror","laconic","editor"],function(e,t,n,r){(function(e){function u(t){return e(t).parents(".prolog-query-editor")}function a(t,n,r){var i=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+t,"data-toggle":"dropdown"},n,e.el.span({"class":"caret"})),e.el.ul({"class":"dropdown-menu "+t}));return e(i).on("click","a",function(){u(this).queryEditor("setQuery",e(this).text())}),i}function f(t){function i(t){var r=t.examples();e.isArray(r)&&u(n).queryEditor("setExamples",r,!0)}var n=a("examples","Examples",t),r=e(n).find("ul");if(typeof t.examples=="function")e(n).mousedown(function(e){e.which==1&&i(t)});else if(t.examples){var s=t.examples;for(var o=0;o<s.length;o++)r.append(e.el.li(e.el.a(s[o])))}return n}function l(e){return a("history","History",e)}function c(t){var n="aggregate",r=t.aggregates||["Aggregate (count all)","Limit","--","Time"],i,s=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+n,"data-toggle":"dropdown"},"Solutions",e.el.span({"class":"caret"})),i=e.el.ul({"class":"dropdown-menu "+n}));for(var o=0;o<r.length;o++){var a=r[o];a=="--"?e(i).append(e.el.li({"class":"divider"})):e(i).append(e.el.li(e.el.a(a)))}return e(s).on("click","a",function(){u(this).queryEditor("wrapSolution",e(this).text())}),s}function h(t){var n=e.el.button({"class":"run-btn-query","class":"btn btn-default btn-primary btn-xs"},"Run!");return e(n).on("click",function(){u(this).queryEditor("run",undefined,p(this))}),n}function p(t){return e(t).parent().find("input").prop("checked")}function d(r){var i=n.getVal("tabled_results"),s={type:"checkbox",name:"table"};i===undefined&&(i=t.trill_on_swish.tabled_results),i&&(s.checked="checked");var o=e.el.input(s),u=e.el.span({"class":"run-chk-table"},o," table results");return e(o).on("change",function(t){n.setVal("tabled_results",e(t.target).prop("checked"))}),u}var i="queryEditor",s={maxHistoryLength:50},o={_init:function(t){return this.each(function(){function p(){return e(u).find("input").prop("checked")}var n=e(this),r=e.extend({},s,t),o=e.el.div({"class":"query",style:"height:100%"}),u=d(r),a=e.el.table({"class":"prolog-query"},e.el.tr(e.el.td({"class":"prolog-prompt"},"?-"),e.el.td({colspan:2,style:"height:100%"},o),e.el.td()),e.el.tr(e.el.td(),e.el.td({"class":"buttons-left"},f(r),l(r),c(r)),e.el.td({"class":"buttons-right"},u,h(r))));n.addClass("prolog-query-editor trill_on_swish-event-receiver"),n.append(a),e(o).append(n.children("textarea")).prologEditor({mode:"prolog",role:"query",sourceID:function(){return r.sourceID()},prologQuery:function(e){n.queryEditor("run",e,p())}}).set,typeof r.examples=="object"&&r.examples[0]&&!e(o).prologEditor("getSource","query")&&e(o).prologEditor("setSource",r.examples[0]),n.on("current-program",function(t,r){n[i]("setProgramEditor",e(r))}),n.on("program-loaded",function(t,i){if(e(r.editor).data("prologEditor")==e(i).data("prologEditor")){var s=r.examples();n.queryEditor("setQuery",s&&s[0]?s[0]:"")}}),n.data(i,r)})},setProgramEditor:function(t){var n=this.data(i);n.editor=t[0];if(n.editor){n.examples=function(){var n=t.prologEditor("getExamples")||[],r=t.parents(".trill_on_swish").trill_on_swish("examples",!0)||[];return e.isArray(r)&&n.concat(r),n},t.prologEditor("isPengineSource")?n.source=function(){var n=t.prologEditor("getSource","source"),r=e(".background.prolog.source").text();return r&&(n+="\n\n"+r),n}:n.source="",n.sourceID=function(){return t.prologEditor("getSourceID")};var r=n.examples();r&&r[0]?this.queryEditor("setQuery",r[0]):t.prologEditor("refreshHighlight")}else n.examples=""},setExamples:function(t,n){function i(e){var t;if((t=r.data("examples"))&&t.length==e.length){for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}return!1}var r=this.find("ul.examples");t||(t=[]),n===undefined&&(n=!0);if(n&&i(t))return this;n===!0&&r.html("");for(var s=0;s<t.length;s++)r.append(e.el.li(e.el.a(t[s])));return r.data("examples",t.slice(0)),this},addHistory:function(t){function i(){return n.children().filter(function(){return e(this).text()==t})}var n=this.find("ul.history"),r=this.data("queryEditor");if(t){var s;(s=i())&&s.remove(),n.children().length>=r.maxHistoryLength&&n.children().first().remove(),n.append(e.el.li(e.el.a(t)))}return this},setQuery:function(e){return this.find(".query").prologEditor("setSource",e).focus()},getQuery:function(){return this.find(".query").prologEditor("getSource","query")},variables:function(t){var n=e.el.span({"class":"query cm-s-prolog"}),i=[];return r.runMode(t,"prolog",n),e(n).find("span.cm-var").each(function(){var t=e(this).text();i.indexOf(t)<0&&i.push(t)}),i},wrapSolution:function(e){function i(e,r){return n.queryEditor("setQuery",e+"("+t+")"+r+"."),n}function s(e){var t=[];for(var n=0;n<r.length;n++)t.push("asc("+r[n]+")");return t.join(",")}var t=this.queryEditor("getQuery").replace(/\.\s*$/m,""),n=this,r=this.queryEditor("variables",t);switch(e){case"Aggregate (count all)":return i("aggregate_all(count, ",", Count)");case"Limit":return i("limit(10, ",")");case"Time":return i("time(",")");default:alert('Unknown wrapper: "'+e+'"')}},run:function(t,n){var r=this.data("queryEditor");t===undefined&&(t=this.queryEditor("getQuery")),t=e.trim(t);if(!t)return e(".trill_on_swish-event-receiver").trigger("help",{file:"query.html"}),this;e(".trill_on_swish-event-receiver").trigger("clearMessages");var i={query:t,editor:r.editor};return typeof r.source=="function"?i.source=r.source(t):typeof r.source=="string"&&(i.source=r.source),n&&(i.tabled=!0),this.queryEditor("addHistory",t),r.runner.prologRunners("run",i),this}};e.fn.queryEditor=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+i)}})(jQuery)}),define("term",["jquery"],function(){function e(){$(this).next().toggleClass("fold"),$(this).remove()}$(document).on("click",".pl-functor, .pl-infix",function(){var t=$(this).parent();$(t).toggleClass("fold"),$(t).before('<span class="pl-ellipsis">...</span>').prev().click(e)})}),!function(){function p(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d(e){return e===null?NaN:+e}function v(e){return!isNaN(e)}function m(e){return{left:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)<0?r=s+1:i=s}return r},right:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}function y(e){return e.length}function w(e){var t=1;while(e*t%1)t*=10;return t}function E(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function S(){this._=Object.create(null)}function N(e){return(e+="")===x||e[0]===T?T+e:e}function C(e){return(e+="")[0]===T?e.slice(1):e}function k(e){return N(e)in this._}function L(e){return(e=N(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(C(t));return e}function O(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function _(){this._=Object.create(null)}function D(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function P(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=H.length;n<r;++n){var i=H[n]+t;if(i in e)return i}}function B(){}function j(){}function F(e){function r(){var n=t,r=-1,i=n.length,s;while(++r<i)(s=n[r].on)&&s.apply(this,arguments);return e}var t=[],n=new S;return r.on=function(r,i){var s=n.get(r),o;return arguments.length<2?s&&s.on:(s&&(s.on=null,t=t.slice(0,o=t.indexOf(s)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function I(){e.event.preventDefault()}function q(){var t=e.event,n;while(n=t.sourceEvent)t=n;return t}function R(t){var n=new j,r=0,i=arguments.length;while(++r<i)n[arguments[r]]=F(n);return n.of=function(r,i){return function(s){try{var o=s.sourceEvent=e.event;s.target=t,e.event=s,n[s.type].apply(r,i)}finally{e.event=o}}},n}function W(e){return z(e,K),e}function Q(e){return typeof e=="function"?e:function(){return X(e,this)}}function G(e){return typeof e=="function"?e:function(){return V(e,this)}}function Z(t,n){function r(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function s(){this.setAttribute(t,n)}function o(){this.setAttributeNS(t.space,t.local,n)}function u(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function a(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=e.ns.qualify(t),n==null?t.local?i:r:typeof n=="function"?t.local?a:u:t.local?o:s}function et(e){return e.trim().replace(/\s+/g," ")}function tt(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function nt(e){return(e+"").trim().split(/^|\s+/)}function rt(e,t){function r(){var r=-1;while(++r<n)e[r](this,t)}function i(){var r=-1,i=t.apply(this,arguments);while(++r<n)e[r](this,i)}e=nt(e).map(it);var n=e.length;return typeof t=="function"?i:r}function it(e){var t=tt(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",et(i+" "+e))):n.setAttribute("class",et(i.replace(t," ")))}}function st(e,t,n){function r(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,t,n)}function s(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return t==null?r:typeof t=="function"?s:i}function ot(e,t){function n(){delete this[e]}function r(){this[e]=t}function i(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}return t==null?n:typeof t=="function"?i:r}function ut(t){return typeof t=="function"?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,t)}}function at(){var e=this.parentNode;e&&e.removeChild(this)}function ft(e){return{__data__:e}}function lt(e){return function(){return J(this,e)}}function ct(e){return arguments.length||(e=p),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function ht(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,o=i.length,u;s<o;s++)(u=i[s])&&t(u,s,n);return e}function pt(e){return z(e,dt),e}function vt(e){var t,n;return function(r,i,s){var o=e[s].update,u=o.length,a;s!=n&&(n=s,t=0),i>=t&&(t=i+1);while(!(a=o[t])&&++t<u);return a}}function mt(e){var t=e.__transition__;t&&++t.active}function yt(t,r,i){function f(){var e=this[s];e&&(this.removeEventListener(t,e,e.$),delete this[s])}function l(){var e=u(r,n(arguments));f.call(this),this.addEventListener(t,this[s]=e,e.$=i),e._=r}function c(){var n=new RegExp("^__on([^.]+)"+e.requote(t)+"$"),r;for(var i in this)if(r=i.match(n)){var s=this[i];this.removeEventListener(r[1],s,s.$),delete this[i]}}var s="__on"+t,o=t.indexOf("."),u=wt;o>0&&(t=t.slice(0,o));var a=bt.get(t);return a&&(t=a,u=Et),o?r?l:f:r?B:c}function wt(t,n){return function(r){var i=e.event;e.event=r,n[0]=this.__data__;try{t.apply(this,n)}finally{e.event=i}}}function Et(e,t){var n=wt(e,t);return function(e){var t=this,r=e.relatedTarget;(!r||r!==t&&!(r.compareDocumentPosition(t)&8))&&n.call(t,e)}}function Tt(){var t=".dragsuppress-"+ ++xt,n="click"+t,r=e.select(s).on("touchmove"+t,I).on("dragstart"+t,I).on("selectstart"+t,I);if(St){var o=i.style,u=o[St];o[St]="none"}return function(e){r.on(t,null),St&&(o[St]=u);if(e){var i=function(){r.on(n,null)};r.on(n,function(){I(),i()},!0),setTimeout(i,0)}}}function Ct(t,n){n.changedTouches&&(n=n.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Nt<0&&(s.scrollX||s.scrollY)){r=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Nt=!o.f&&!o.e,r.remove()}return Nt?(i.x=n.pageX,i.y=n.pageY):(i.x=n.clientX,i.y=n.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var u=t.getBoundingClientRect();return[n.clientX-u.left-t.clientLeft,n.clientY-u.top-t.clientTop]}function kt(){return e.event.changedTouches[0].identifier}function Lt(){return e.event.target}function At(){return s}function Ft(e){return e>0?1:e<0?-1:0}function It(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function qt(e){return e>1?0:e<-1?_t:Math.acos(e)}function Rt(e){return e>1?Ht:e<-1?-Ht:Math.asin(e)}function Ut(e){return((e=Math.exp(e))-1/e)/2}function zt(e){return((e=Math.exp(e))+1/e)/2}function Wt(e){return((e=Math.exp(2*e))-1)/(e+1)}function Xt(e){return(e=Math.sin(e/2))*e}function Yt(){}function Zt(e,t,n){return this instanceof Zt?void (this.h=+e,this.s=+t,this.l=+n):arguments.length<2?e instanceof Zt?new Zt(e.h,e.s,e.l):Sn(""+e,xn,Zt):new Zt(e,t,n)}function tn(e,t,n){function s(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}function o(e){return Math.round(s(e)*255)}var r,i;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i,new gn(o(e+120),o(e),o(e-120))}function nn(t,n,r){return this instanceof nn?void (this.h=+t,this.c=+n,this.l=+r):arguments.length<2?t instanceof nn?new nn(t.h,t.c,t.l):t instanceof on?pn(t.l,t.a,t.b):pn((t=Tn((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new nn(t,n,r)}function sn(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new on(n,Math.cos(e*=Bt)*t,Math.sin(e)*t)}function on(e,t,n){return this instanceof on?void (this.l=+e,this.a=+t,this.b=+n):arguments.length<2?e instanceof on?new on(e.l,e.a,e.b):e instanceof nn?sn(e.h,e.c,e.l):Tn((e=gn(e)).r,e.g,e.b):new on(e,t,n)}function hn(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=dn(i)*an,r=dn(r)*fn,s=dn(s)*ln,new gn(mn(3.2404542*i-1.5371385*r-.4985314*s),mn(-0.969266*i+1.8760108*r+.041556*s),mn(.0556434*i-.2040259*r+1.0572252*s))}function pn(e,t,n){return e>0?new nn(Math.atan2(n,t)*jt,Math.sqrt(t*t+n*n),e):new nn(NaN,NaN,e)}function dn(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function vn(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function mn(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function gn(e,t,n){return this instanceof gn?void (this.r=~~e,this.g=~~t,this.b=~~n):arguments.length<2?e instanceof gn?new gn(e.r,e.g,e.b):Sn(""+e,gn,tn):new gn(e,t,n)}function yn(e){return new gn(e>>16,e>>8&255,e&255)}function bn(e){return yn(e)+""}function En(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function Sn(e,t,n){var r=0,i=0,s=0,o,u,a;o=/([a-z]+)\((.*)\)/i.exec(e);if(o){u=o[2].split(",");switch(o[1]){case"hsl":return n(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(Cn(u[0]),Cn(u[1]),Cn(u[2]))}}return(a=kn.get(e))?t(a.r,a.g,a.b):(e!=null&&e.charAt(0)==="#"&&!isNaN(a=parseInt(e.slice(1),16))&&(e.length===4?(r=(a&3840)>>4,r=r>>4|r,i=a&240,i=i>>4|i,s=a&15,s=s<<4|s):e.length===7&&(r=(a&16711680)>>16,i=(a&65280)>>8,s=a&255)),t(r,i,s))}function xn(e,t,n){var r=Math.min(e/=255,t/=255,n/=255),i=Math.max(e,t,n),s=i-r,o,u,a=(i+r)/2;return s?(u=a<.5?s/(i+r):s/(2-i-r),e==i?o=(t-n)/s+(t<n?6:0):t==i?o=(n-e)/s+2:o=(e-t)/s+4,o*=60):(o=NaN,u=a>0&&a<1?0:o),new Zt(o,u,a)}function Tn(e,t,n){e=Nn(e),t=Nn(t),n=Nn(n);var r=vn((.4124564*e+.3575761*t+.1804375*n)/an),i=vn((.2126729*e+.7151522*t+.072175*n)/fn),s=vn((.0193339*e+.119192*t+.9503041*n)/ln);return on(116*i-16,500*(r-i),200*(i-s))}function Nn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Cn(e){var t=parseFloat(e);return e.charAt(e.length-1)==="%"?Math.round(t*2.55):t}function Ln(e){return typeof e=="function"?e:function(){return e}}function An(e){return e}function On(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=null),Mn(t,n,e,r)}}function Mn(t,r,i,o){function h(){var e=l.status,t;if(!e&&Dn(l)||e>=200&&e<300||e===304){try{t=i.call(u,l)}catch(n){a.error.call(u,n);return}a.load.call(u,t)}else a.error.call(u,l)}var u={},a=e.dispatch("beforesend","progress","load","error"),f={},l=new XMLHttpRequest,c=null;return s.XDomainRequest&&!("withCredentials"in l)&&/^(http(s)?:)?\/\//.test(t)&&(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=h:l.onreadystatechange=function(){l.readyState>3&&h()},l.onprogress=function(t){var n=e.event;e.event=t;try{a.progress.call(u,l)}finally{e.event=n}},u.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?f[e]:(t==null?delete f[e]:f[e]=t+"",u)},u.mimeType=function(e){return arguments.length?(r=e==null?null:e+"",u):r},u.responseType=function(e){return arguments.length?(c=e,u):c},u.response=function(e){return i=e,u},["get","post"].forEach(function(e){u[e]=function(){return u.send.apply(u,[e].concat(n(arguments)))}}),u.send=function(e,n,i){arguments.length===2&&typeof n=="function"&&(i=n,n=null),l.open(e,t,!0),r!=null&&!("accept"in f)&&(f.accept=r+",*/*");if(l.setRequestHeader)for(var s in f)l.setRequestHeader(s,f[s]);return r!=null&&l.overrideMimeType&&l.overrideMimeType(r),c!=null&&(l.responseType=c),i!=null&&u.on("error",i).on("load",function(e){i(null,e)}),a.beforesend.call(u,l),l.send(n==null?null:n),u},u.abort=function(){return l.abort(),u},e.rebind(u,a,"on"),o==null?u:u.get(_n(o))}function _n(e){return e.length===1?function(t,n){e(t==null?n:null)}:e}function Dn(e){var t=e.responseType;return t&&t!=="text"?e.response:e.responseText}function qn(){var e=Rn(),t=Un()-e;t>24?(isFinite(t)&&(clearTimeout(jn),jn=setTimeout(qn,t)),Bn=0):(Bn=1,In(qn))}function Rn(){var e=Date.now();Fn=Pn;while(Fn)e>=Fn.t&&(Fn.f=Fn.c(e-Fn.t)),Fn=Fn.n;return e}function Un(){var e,t=Pn,n=Infinity;while(t)t.f?t=e?e.n=t.n:Pn=t.n:(t.t<n&&(n=t.t),t=(e=t).n);return Hn=e,n}function zn(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function Xn(e,t){var n=Math.pow(10,b(8-t)*3);return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function Vn(t){var n=t.decimal,r=t.thousands,i=t.grouping,s=t.currency,o=i&&r?function(e,t){var n=e.length,s=[],o=0,u=i[0],a=0;while(n>0&&u>0){a+u+1>t&&(u=Math.max(1,t-a)),s.push(e.substring(n-=u,n+u));if((a+=u+1)>t)break;u=i[o=(o+1)%i.length]}return s.reverse().join(r)}:An;return function(t){var r=$n.exec(t),i=r[1]||" ",u=r[2]||">",a=r[3]||"-",f=r[4]||"",l=r[5],c=+r[6],h=r[7],p=r[8],d=r[9],v=1,m="",g="",y=!1,b=!0;p&&(p=+p.substring(1));if(l||i==="0"&&u==="=")l=i="0",u="=";switch(d){case"n":h=!0,d="g";break;case"%":v=100,g="%",d="f";break;case"p":v=100,g="%",d="r";break;case"b":case"o":case"x":case"X":f==="#"&&(m="0"+d.toLowerCase());case"c":b=!1;case"d":y=!0,p=0;break;case"s":v=-1,d="r"}f==="$"&&(m=s[0],g=s[1]),d=="r"&&!p&&(d="g");if(p!=null)if(d=="g")p=Math.max(1,Math.min(21,p));else if(d=="e"||d=="f")p=Math.max(0,Math.min(20,p));d=Jn.get(d)||Kn;var w=l&&h;return function(t){var r=g;if(y&&t%1)return"";var s=t<0||t===0&&1/t<0?(t=-t,"-"):a==="-"?"":a;if(v<0){var f=e.formatPrefix(t,p);t=f.scale(t),r=f.symbol+g}else t*=v;t=d(t,p);var E=t.lastIndexOf("."),S,x;if(E<0){var T=b?t.lastIndexOf("e"):-1;T<0?(S=t,x=""):(S=t.substring(0,T),x=t.substring(T))}else S=t.substring(0,E),x=n+t.substring(E+1);!l&&h&&(S=o(S,Infinity));var N=m.length+S.length+x.length+(w?0:s.length),C=N<c?(new Array(N=c-N+1)).join(i):"";return w&&(S=o(C+S,C.length?c-x.length:Infinity)),s+=m,t=S+x,(u==="<"?s+t+C:u===">"?C+s+t:u==="^"?C.substring(0,N>>=1)+s+t+C.substring(N):s+(w?t:C+t))+r}}}function Kn(e){return e+""}function Yn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function er(e,t,n){function r(t){var n=e(t),r=s(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new Gn(n-1)),1),n}function s(e,n){return t(e=new Gn(+e),n),e}function o(e,r,s){var o=i(e),u=[];if(s>1)while(o<r)n(o)%s||u.push(new Date(+o)),t(o,1);else while(o<r)u.push(new Date(+o)),t(o,1);return u}function u(e,t,n){try{Gn=Yn;var r=new Yn;return r._=e,o(r,t,n)}finally{Gn=Date}}e.floor=e,e.round=r,e.ceil=i,e.offset=s,e.range=o;var a=e.utc=tr(e);return a.floor=a,a.round=tr(r),a.ceil=tr(i),a.offset=tr(s),a.range=u,e}function tr(e){return function(t,n){try{Gn=Yn;var r=new Yn;return r._=t,e(r,n)._}finally{Gn=Date}}}function nr(t){function l(e){function n(n){var r=[],i=-1,s=0,o,u,a;while(++i<t)if(e.charCodeAt(i)===37){r.push(e.slice(s,i)),(u=rr[o=e.charAt(++i)])!=null&&(o=e.charAt(++i));if(a=E[o])o=a(n,u==null?o==="e"?" ":"0":u);r.push(o),s=i+1}return r.push(e.slice(s,i)),r.join("")}var t=e.length;return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},r=c(n,e,t,0);if(r!=t.length)return null;"p"in n&&(n.H=n.H%12+n.p*12);var i=n.Z!=null&&Gn!==Yn,s=new(i?Yn:Gn);return"j"in n?s.setFullYear(n.y,0,n.j):"w"in n&&("W"in n||"U"in n)?(s.setFullYear(n.y,0,1),s.setFullYear(n.y,0,"W"in n?(n.w+6)%7+n.W*7-(s.getDay()+5)%7:n.w+n.U*7-(s.getDay()+6)%7)):s.setFullYear(n.y,n.m,n.d),s.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?s._:s},n.toString=function(){return e},n}function c(e,t,n,r){var i,s,o,u=0,a=t.length,f=n.length;while(u<a){if(r>=f)return-1;i=t.charCodeAt(u++);if(i===37){o=t.charAt(u++),s=S[o in rr?t.charAt(u++):o];if(!s||(r=s(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function x(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){p.lastIndex=0;var r=p.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1}function N(e,t,n){b.lastIndex=0;var r=b.exec(t.slice(n));return r?(e.m=w.get(r[0].toLowerCase()),n+r[0].length):-1}function C(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){return c(e,E.c.toString(),t,n)}function L(e,t,n){return c(e,E.x.toString(),t,n)}function A(e,t,n){return c(e,E.X.toString(),t,n)}function O(e,t,n){var r=h.get(t.slice(n,n+=2).toLowerCase());return r==null?-1:(e.p=r,n)}var n=t.dateTime,r=t.date,i=t.time,s=t.periods,o=t.days,u=t.shortDays,a=t.months,f=t.shortMonths;l.utc=function(e){function n(e){try{Gn=Yn;var n=new Gn;return n._=e,t(n)}finally{Gn=Date}}var t=l(e);return n.parse=function(e){try{Gn=Yn;var n=t.parse(e);return n&&n._}finally{Gn=Date}},n.toString=t.toString,n},l.multi=l.utc.multi=Nr;var h=e.map(),p=ur(o),d=ar(o),v=ur(u),m=ar(u),g=ur(a),y=ar(a),b=ur(f),w=ar(f);s.forEach(function(e,t){h.set(e.toLowerCase(),t)});var E={a:function(e){return u[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return f[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:l(n),d:function(e,t){return or(e.getDate(),t,2)},e:function(e,t){return or(e.getDate(),t,2)},H:function(e,t){return or(e.getHours(),t,2)},I:function(e,t){return or(e.getHours()%12||12,t,2)},j:function(e,t){return or(1+Qn.dayOfYear(e),t,3)},L:function(e,t){return or(e.getMilliseconds(),t,3)},m:function(e,t){return or(e.getMonth()+1,t,2)},M:function(e,t){return or(e.getMinutes(),t,2)},p:function(e){return s[+(e.getHours()>=12)]},S:function(e,t){return or(e.getSeconds(),t,2)},U:function(e,t){return or(Qn.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return or(Qn.mondayOfYear(e),t,2)},x:l(r),X:l(i),y:function(e,t){return or(e.getFullYear()%100,t,2)},Y:function(e,t){return or(e.getFullYear()%1e4,t,4)},Z:xr,"%":function(){return"%"}},S={a:x,A:T,b:N,B:C,c:k,d:gr,e:gr,H:br,I:br,j:yr,L:Sr,m:mr,M:wr,p:O,S:Er,U:lr,w:fr,W:cr,x:L,X:A,y:pr,Y:hr,Z:dr,"%":Tr};return l}function or(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?(new Array(n-s+1)).join(t)+i:i)}function ur(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function ar(e){var t=new S,n=-1,r=e.length;while(++n<r)t.set(e[n].toLowerCase(),n);return t}function fr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function lr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function cr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function hr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function pr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.y=vr(+r[0]),n+r[0].length):-1}function dr(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function vr(e){return e+(e>68?1900:2e3)}function mr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function yr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function br(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function wr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Er(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Sr(e,t,n){ir.lastIndex=0;var r=ir.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xr(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=b(t)/60|0,i=b(t)%60;return n+or(r,"0",2)+or(i,"0",2)}function Tr(e,t,n){sr.lastIndex=0;var r=sr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Nr(e){var t=e.length,n=-1;while(++n<t)e[n][0]=this(e[n][0]);return function(t){var n=0,r=e[n];while(!r[1](t))r=e[++n];return r[0](t)}}function kr(){}function Ar(e,t,n){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}function Or(e,t){e&&_r.hasOwnProperty(e.type)&&_r[e.type](e,t)}function Dr(e,t,n){var r=-1,i=e.length-n,s;t.lineStart();while(++r<i)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Pr(e,t){var n=-1,r=e.length;t.polygonStart();while(++n<r)Dr(e[n],t,1);t.polygonEnd()}function Fr(){function s(e,t){e*=Bt,t=t*Bt/2+_t/4;var s=e-n,o=s>=0?1:-1,u=o*s,a=Math.cos(t),f=Math.sin(t),l=i*f,c=r*a+l*Math.cos(u),h=l*o*Math.sin(u);Br.add(Math.atan2(h,c)),n=e,r=a,i=f}var e,t,n,r,i;jr.point=function(o,u){jr.point=s,n=(e=o)*Bt,r=Math.cos(u=(t=u)*Bt/2+_t/4),i=Math.sin(u)},jr.lineEnd=function(){s(e,t)}}function Ir(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function qr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Rr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Ur(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function zr(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Wr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Xr(e){return[Math.atan2(e[1],e[0]),Rt(e[2])]}function Vr(e,t){return b(e[0]-t[0])<Ot&&b(e[1]-t[1])<Ot}function si(e,t){e*=Bt;var n=Math.cos(t*=Bt);oi(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function oi(e,t,n){++$r,Kr+=(e-Kr)/$r,Qr+=(t-Qr)/$r,Gr+=(n-Gr)/$r}function ui(){function r(r,i){r*=Bt;var s=Math.cos(i*=Bt),o=s*Math.cos(r),u=s*Math.sin(r),a=Math.sin(i),f=Math.atan2(Math.sqrt((f=t*a-n*u)*f+(f=n*o-e*a)*f+(f=e*u-t*o)*f),e*o+t*u+n*a);Jr+=f,Yr+=f*(e+(e=o)),Zr+=f*(t+(t=u)),ei+=f*(n+(n=a)),oi(e,t,n)}var e,t,n;ii.point=function(i,s){i*=Bt;var o=Math.cos(s*=Bt);e=o*Math.cos(i),t=o*Math.sin(i),n=Math.sin(s),ii.point=r,oi(e,t,n)}}function ai(){ii.point=si}function fi(){function s(e,t){e*=Bt;var s=Math.cos(t*=Bt),o=s*Math.cos(e),u=s*Math.sin(e),a=Math.sin(t),f=r*a-i*u,l=i*o-n*a,c=n*u-r*o,h=Math.sqrt(f*f+l*l+c*c),p=n*o+r*u+i*a,d=h&&-qt(p)/h,v=Math.atan2(h,p);ti+=d*f,ni+=d*l,ri+=d*c,Jr+=v,Yr+=v*(n+(n=o)),Zr+=v*(r+(r=u)),ei+=v*(i+(i=a)),oi(n,r,i)}var e,t,n,r,i;ii.point=function(o,u){e=o,t=u,ii.point=s,o*=Bt;var a=Math.cos(u*=Bt);n=a*Math.cos(o),r=a*Math.sin(o),i=Math.sin(u),oi(n,r,i)},ii.lineEnd=function(){s(e,t),ii.lineEnd=ai,ii.point=si}}function li(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function ci(){return!0}function hi(e,t,n,r,i){var s=[],o=[];e.forEach(function(e){if((t=e.length-1)<=0)return;var t,n=e[0],r=e[t];if(Vr(n,r)){i.lineStart();for(var u=0;u<t;++u)i.point((n=e[u])[0],n[1]);i.lineEnd();return}var a=new di(n,e,null,!0),f=new di(n,null,a,!1);a.o=f,s.push(a),o.push(f),a=new di(r,e,null,!1),f=new di(r,null,a,!0),a.o=f,s.push(a),o.push(f)}),o.sort(t),pi(s),pi(o);if(!s.length)return;for(var u=0,a=n,f=o.length;u<f;++u)o[u].e=a=!a;var l=s[0],c,h;for(;;){var p=l,d=!0;while(p.v)if((p=p.n)===l)return;c=p.z,i.lineStart();do{p.v=p.o.v=!0;if(p.e){if(d)for(var u=0,f=c.length;u<f;++u)i.point((h=c[u])[0],h[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){c=p.p.z;for(var u=c.length-1;u>=0;--u)i.point((h=c[u])[0],h[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}function pi(e){if(!(t=e.length))return;var t,n=0,r=e[0],i;while(++n<t)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}function di(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function vi(t,n,r,i){return function(s,o){function l(e,n){var r=s(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function c(e,t){var n=s(e,t);u.point(n[0],n[1])}function h(){f.point=c,u.lineStart()}function p(){f.point=l,u.lineEnd()}function w(e,t){b.push([e,t]);var n=s(e,t);m.point(n[0],n[1])}function E(){m.lineStart(),b=[]}function S(){w(b[0][0],b[0][1]),m.lineEnd();var e=m.clean(),t=v.buffer(),n,r=t.length;b.pop(),y.push(b),b=null;if(!r)return;if(e&1){n=t[0];var r=n.length-1,i=-1,s;if(r>0){g||(o.polygonStart(),g=!0),o.lineStart();while(++i<r)o.point((s=n[i])[0],s[1]);o.lineEnd()}return}r>1&&e&2&&t.push(t.pop().concat(t.shift())),d.push(t.filter(mi))}var u=n(o),a=s.invert(i[0],i[1]),f={point:l,lineStart:h,lineEnd:p,polygonStart:function(){f.point=w,f.lineStart=E,f.lineEnd=S,d=[],y=[]},polygonEnd:function(){f.point=l,f.lineStart=h,f.lineEnd=p,d=e.merge(d);var t=xi(a,y);d.length?(g||(o.polygonStart(),g=!0),hi(d,yi,t,r,o)):t&&(g||(o.polygonStart(),g=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),g&&(o.polygonEnd(),g=!1),d=y=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},d,v=gi(),m=n(v),g=!1,y,b;return f}}function mi(e){return e.length>1}function gi(){var e=[],t;return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:B,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function yi(e,t){return((e=e.x)[0]<0?e[1]-Ht-Ot:Ht-e[1])-((t=t.x)[0]<0?t[1]-Ht-Ot:Ht-t[1])}function wi(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,o){var u=s>0?_t:-_t,a=b(s-t);b(a-_t)<Ot?(e.point(t,n=(n+o)/2>0?Ht:-Ht),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(s,n),i=0):r!==u&&a>=_t&&(b(t-r)<Ot&&(t-=r*Ot),b(s-u)<Ot&&(s-=u*Ot),n=Ei(t,n,s,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),i=0),e.point(t=s,n=o),r=u},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Ei(e,t,n,r){var i,s,o=Math.sin(e-n);return b(o)>Ot?Math.atan((Math.sin(t)*(s=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*s*o)):(t+r)/2}function Si(e,t,n,r){var i;if(e==null)i=n*Ht,r.point(-_t,i),r.point(0,i),r.point(_t,i),r.point(_t,0),r.point(_t,-i),r.point(0,-i),r.point(-_t,-i),r.point(-_t,0),r.point(-_t,i);else if(b(e[0]-t[0])>Ot){var s=e[0]<t[0]?_t:-_t;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function xi(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],s=0,o=0;Br.reset();for(var u=0,a=t.length;u<a;++u){var f=t[u],l=f.length;if(!l)continue;var c=f[0],h=c[0],p=c[1]/2+_t/4,d=Math.sin(p),v=Math.cos(p),m=1;for(;;){m===l&&(m=0),e=f[m];var g=e[0],y=e[1]/2+_t/4,b=Math.sin(y),w=Math.cos(y),E=g-h,S=E>=0?1:-1,x=S*E,T=x>_t,N=d*b;Br.add(Math.atan2(N*S*Math.sin(x),v*w+N*Math.cos(x))),s+=T?E+S*Dt:E;if(T^h>=n^g>=n){var C=Rr(Ir(c),Ir(e));Wr(C);var k=Rr(i,C);Wr(k);var L=(T^E>=0?-1:1)*Rt(k[2]);if(r>L||r===L&&(C[0]||C[1]))o+=T^E>=0?1:-1}if(!(m++))break;h=g,d=b,v=w,c=e}}return(s<-Ot||s<Ot&&Br<0)^o&1}function Ti(e){function s(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e){var t,i,o,f,l;return{lineStart:function(){f=o=!1,l=1},point:function(c,h){var p=[c,h],d,v=s(c,h),m=n?v?0:a(c,h):v?a(c+(c<0?_t:-_t),h):0;!t&&(f=o=v)&&e.lineStart();if(v!==o){d=u(t,p);if(Vr(t,d)||Vr(p,d))p[0]+=Ot,p[1]+=Ot,v=s(p[0],p[1])}if(v!==o)l=0,v?(e.lineStart(),d=u(p,t),e.point(d[0],d[1])):(d=u(t,p),e.point(d[0],d[1]),e.lineEnd()),t=d;else if(r&&t&&n^v){var g;!(m&i)&&(g=u(p,t,!0))&&(l=0,n?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1])))}v&&(!t||!Vr(t,p))&&e.point(p[0],p[1]),t=p,o=v,i=m},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return l|(f&&o)<<1}}}function u(e,n,r){var i=Ir(e),s=Ir(n),o=[1,0,0],u=Rr(i,s),a=qr(u,u),f=u[0],l=a-f*f;if(!l)return!r&&e;var c=t*a/l,h=-t*f/l,p=Rr(o,u),d=zr(o,c),v=zr(u,h);Ur(d,v);var m=p,g=qr(d,m),y=qr(m,m),w=g*g-y*(qr(d,d)-1);if(w<0)return;var E=Math.sqrt(w),S=zr(m,(-g-E)/y);Ur(S,d),S=Xr(S);if(!r)return S;var x=e[0],T=n[0],N=e[1],C=n[1],k;T<x&&(k=x,x=T,T=k);var L=T-x,A=b(L-_t)<Ot,O=A||L<Ot;!A&&C<N&&(k=N,N=C,C=k);if(O?A?N+C>0^S[1]<(b(S[0]-x)<Ot?N:C):N<=S[1]&&S[1]<=C:L>_t^(x<=S[0]&&S[0]<=T)){var M=zr(m,(-g+E)/y);return Ur(M,d),[S,Xr(M)]}}function a(t,r){var i=n?e:_t-e,s=0;return t<-i?s|=1:t>i&&(s|=2),r<-i?s|=4:r>i&&(s|=8),s}var t=Math.cos(e),n=t>0,r=b(t)>Ot,i=us(e,6*Bt);return vi(s,o,i,n?[0,-e]:[-_t,e-_t])}function Ni(e,t,n,r){return function(i){var s=i.a,o=i.b,u=s.x,a=s.y,f=o.x,l=o.y,c=0,h=1,p=f-u,d=l-a,v;v=e-u;if(!p&&v>0)return;v/=p;if(p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}v=n-u;if(!p&&v<0)return;v/=p;if(p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}v=t-a;if(!d&&v>0)return;v/=d;if(d<0){if(v<c)return;v<h&&(h=v)}else if(d>0){if(v>h)return;v>c&&(c=v)}v=r-a;if(!d&&v<0)return;v/=d;if(d<0){if(v>h)return;v>c&&(c=v)}else if(d>0){if(v<c)return;v<h&&(h=v)}return c>0&&(i.a={x:u+c*p,y:a+c*d}),h<1&&(i.b={x:u+h*p,y:a+h*d}),i}}function ki(t,n,r,i){function s(e,i){return b(e[0]-t)<Ot?i>0?0:3:b(e[0]-r)<Ot?i>0?2:1:b(e[1]-n)<Ot?i>0?1:0:i>0?3:2}function o(e,t){return u(e.x,t.x)}function u(e,t){var n=s(e,1),r=s(t,1);return n!==r?n-r:n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]}return function(a){function m(e){var t=0,n=p.length,r=e[1];for(var i=0;i<n;++i)for(var s=1,o=p[i],u=o.length,a=o[0],f;s<u;++s)f=o[s],a[1]<=r?f[1]>r&&It(a,f,e)>0&&++t:f[1]<=r&&It(a,f,e)<0&&--t,a=f;return t!==0}function g(e,o,a,f){var l=0,c=0;if(e==null||(l=s(e,a))!==(c=s(o,a))||u(e,o)<0^a>0){do f.point(l===0||l===3?t:r,l>1?i:n);while((l=(l+a+4)%4)!==c)}else f.point(o[0],o[1])}function y(e,s){return t<=e&&e<=r&&n<=s&&s<=i}function b(e,t){y(e,t)&&a.point(e,t)}function L(){v.point=O,p&&p.push(d=[]),C=!0,N=!1,x=T=NaN}function A(){h&&(O(w,E),S&&N&&l.rejoin(),h.push(l.buffer())),v.point=b,N&&a.lineEnd()}function O(e,t){e=Math.max(-Ci,Math.min(Ci,e)),t=Math.max(-Ci,Math.min(Ci,t));var n=y(e,t);p&&d.push([e,t]);if(C)w=e,E=t,S=n,C=!1,n&&(a.lineStart(),a.point(e,t));else if(n&&N)a.point(e,t);else{var r={a:{x:x,y:T},b:{x:e,y:t}};c(r)?(N||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),n||a.lineEnd(),k=!1):n&&(a.lineStart(),a.point(e,t),k=!1)}x=e,T=t,N=n}var f=a,l=gi(),c=Ni(t,n,r,i),h,p,d,v={point:b,lineStart:L,lineEnd:A,polygonStart:function(){a=l,h=[],p=[],k=!0},polygonEnd:function(){a=f,h=e.merge(h);var n=m([t,i]),r=k&&n,s=h.length;if(r||s)a.polygonStart(),r&&(a.lineStart(),g(null,null,1,a),a.lineEnd()),s&&hi(h,o,n,g,a),a.polygonEnd();h=p=d=null}},w,E,S,x,T,N,C,k;return v}}function Li(e){var t=0,n=_t/3,r=Zi(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*_t/180,n=e[1]*_t/180):[t/_t*180,n/_t*180]},i}function Ai(e,t){function o(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),s-n*Math.cos(e)]}var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),s=Math.sqrt(i)/r;return o.invert=function(e,t){var n=s-t;return[Math.atan2(e,n)/r,Rt((i-(e*e+n*n)*r*r)/(2*r))]},o}function Di(){function i(e,t){Mi+=r*e-n*t,n=e,r=t}var e,t,n,r;_i.point=function(s,o){_i.point=i,e=n=s,t=r=o},_i.lineEnd=function(){i(e,t)}}function Ii(e,t){e<Pi&&(Pi=e),e>Bi&&(Bi=e),t<Hi&&(Hi=t),t>ji&&(ji=t)}function qi(){function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=s}function s(e,n){t.push("L",e,",",n)}function o(){n.point=r}function u(){t.push("Z")}var e=Ri(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(t){return e=Ri(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};return n}function Ri(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+ -2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function zi(e,t){Kr+=e,Qr+=t,++Gr}function Wi(){function n(n,r){var i=n-e,s=r-t,o=Math.sqrt(i*i+s*s);Yr+=o*(e+n)/2,Zr+=o*(t+r)/2,ei+=o,zi(e=n,t=r)}var e,t;Ui.point=function(r,i){Ui.point=n,zi(e=r,t=i)}}function Xi(){Ui.point=zi}function Vi(){function i(e,t){var i=e-n,s=t-r,o=Math.sqrt(i*i+s*s);Yr+=o*(n+e)/2,Zr+=o*(r+t)/2,ei+=o,o=r*e-n*t,ti+=o*(n+e),ni+=o*(r+t),ri+=o*3,zi(n=e,r=t)}var e,t,n,r;Ui.point=function(s,o){Ui.point=i,zi(e=n=s,t=r=o)},Ui.lineEnd=function(){i(e,t)}}function $i(e){function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Dt)}function i(t,r){e.moveTo(t,r),n.point=s}function s(t,n){e.lineTo(t,n)}function o(){n.point=r}function u(){e.closePath()}var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(e){return t=e,n},result:B};return n}function Ji(e){function i(e){return(r?o:s)(e)}function s(t){return Gi(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function o(t){function y(n,r){n=e(n,r),t.point(n[0],n[1])}function b(){h=NaN,g.point=w,t.lineStart()}function w(n,i){var s=Ir([n,i]),o=e(n,i);u(h,p,c,d,v,m,h=o[0],p=o[1],c=n,d=s[0],v=s[1],m=s[2],r,t),t.point(h,p)}function E(){g.point=y,t.lineEnd()}function S(){b(),g.point=x,g.lineEnd=T}function x(e,t){w(n=e,i=t),s=h,o=p,a=d,f=v,l=m,g.point=w}function T(){u(h,p,c,d,v,m,s,o,n,a,f,l,r,t),g.lineEnd=E,E()}var n,i,s,o,a,f,l,c,h,p,d,v,m,g={point:y,lineStart:b,lineEnd:E,polygonStart:function(){t.polygonStart(),g.lineStart=S},polygonEnd:function(){t.polygonEnd(),g.lineStart=b}};return g}function u(r,i,s,o,a,f,l,c,h,p,d,v,m,g){var y=l-r,w=c-i,E=y*y+w*w;if(E>4*t&&m--){var S=o+p,x=a+d,T=f+v,N=Math.sqrt(S*S+x*x+T*T),C=Math.asin(T/=N),k=b(b(T)-1)<Ot||b(s-h)<Ot?(s+h)/2:Math.atan2(x,S),L=e(k,C),A=L[0],O=L[1],M=A-r,_=O-i,D=w*M-y*_;if(D*D/E>t||b((y*M+w*_)/E-.5)>.3||o*p+a*d+f*v<n)u(r,i,s,o,a,f,A,O,k,S/=N,x/=N,T,m,g),g.point(A,O),u(A,O,k,S,x,T,l,c,h,p,d,v,m,g)}}var t=.5,n=Math.cos(30*Bt),r=16;return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Ki(e){var t=Ji(function(t,n){return e([t*jt,n*jt])});return function(e){return es(t(e))}}function Qi(e){this.stream=e}function Gi(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Yi(e){return Zi(function(){return e})()}function Zi(t){function E(e){return e=i(e[0]*Bt,e[1]*Bt),[e[0]*o+d,v-e[1]*o]}function S(e){return e=i.invert((e[0]-d)/o,(v-e[1])/o),e&&[e[0]*jt,e[1]*jt]}function x(){i=li(r=rs(c,h,p),n);var e=n(f,l);return d=u-e[0]*o,v=a+e[1]*o,T()}function T(){return w&&(w.valid=!1,w=null),E}var n,r,i,s=Ji(function(e,t){return e=n(e,t),[e[0]*o+d,v-e[1]*o]}),o=150,u=480,a=250,f=0,l=0,c=0,h=0,p=0,d,v,m=bi,g=An,y=null,b=null,w;return E.stream=function(e){return w&&(w.valid=!1),w=es(m(r,s(g(e)))),w.valid=!0,w},E.clipAngle=function(e){return arguments.length?(m=e==null?(y=e,bi):Ti((y=+e)*Bt),T()):y},E.clipExtent=function(e){return arguments.length?(b=e,g=e?ki(e[0][0],e[0][1],e[1][0],e[1][1]):An,T()):b},E.scale=function(e){return arguments.length?(o=+e,x()):o},E.translate=function(e){return arguments.length?(u=+e[0],a=+e[1],x()):[u,a]},E.center=function(e){return arguments.length?(f=e[0]%360*Bt,l=e[1]%360*Bt,x()):[f*jt,l*jt]},E.rotate=function(e){return arguments.length?(c=e[0]%360*Bt,h=e[1]%360*Bt,p=e.length>2?e[2]%360*Bt:0,x()):[c*jt,h*jt,p*jt]},e.rebind(E,s,"precision"),function(){return n=t.apply(this,arguments),E.invert=n.invert&&S,x()}}function es(e){return Gi(e,function(t,n){e.point(t*Bt,n*Bt)})}function ts(e,t){return[e,t]}function ns(e,t){return[e>_t?e-Dt:e<-_t?e+Dt:e,t]}function rs(e,t,n){return e?t||n?li(ss(e),os(t,n)):ss(e):t||n?os(t,n):ns}function is(e){return function(t,n){return t+=e,[t>_t?t-Dt:t<-_t?t+Dt:t,n]}}function ss(e){var t=is(e);return t.invert=is(-e),t}function os(e,t){function o(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*n+u*r;return[Math.atan2(a*i-l*s,u*n-f*r),Rt(l*i+a*s)]}var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),s=Math.sin(t);return o.invert=function(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*i-a*s;return[Math.atan2(a*i+f*s,u*n+l*r),Rt(l*n-u*r)]},o}function us(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,s,o,u){var a=o*t;if(i!=null){i=as(n,i),s=as(n,s);if(o>0?i<s:i>s)i+=o*Dt}else i=e+o*Dt,s=e-.5*a;for(var f,l=i;o>0?l>s:l<s;l-=a)u.point((f=Xr([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],f[1])}}function as(e,t){var n=Ir(t);n[0]-=e,Wr(n);var r=qt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Ot)%(2*Math.PI)}function fs(t,n,r){var i=e.range(t,n-Ot,r).concat(n);return function(e){return i.map(function(t){return[e,t]})}}function ls(t,n,r){var i=e.range(t,n-Ot,r).concat(n);return function(e){return i.map(function(t){return[t,e]})}}function cs(e){return e.source}function hs(e){return e.target}function ps(e,t,n,r){var i=Math.cos(t),s=Math.sin(t),o=Math.cos(r),u=Math.sin(r),a=i*Math.cos(e),f=i*Math.sin(e),l=o*Math.cos(n),c=o*Math.sin(n),h=2*Math.asin(Math.sqrt(Xt(r-t)+i*o*Xt(n-e))),p=1/Math.sin(h),d=h?function(e){var t=Math.sin(e*=h)*p,n=Math.sin(h-e)*p,r=n*a+t*l,i=n*f+t*c,o=n*s+t*u;return[Math.atan2(i,r)*jt,Math.atan2(o,Math.sqrt(r*r+i*i))*jt]}:function(){return[e*jt,t*jt]};return d.distance=h,d}function ms(){function r(r,i){var s=Math.sin(i*=Bt),o=Math.cos(i),u=b((r*=Bt)-e),a=Math.cos(u);ds+=Math.atan2(Math.sqrt((u=o*Math.sin(u))*u+(u=n*s-t*o*a)*u),t*s+n*o*a),e=r,t=s,n=o}var e,t,n;vs.point=function(i,s){e=i*Bt,t=Math.sin(s*=Bt),n=Math.cos(s),vs.point=r},vs.lineEnd=function(){vs.point=vs.lineEnd=B}}function gs(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),s=e(r*i);return[s*i*Math.sin(t),s*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),s=Math.sin(i),o=Math.cos(i);return[Math.atan2(e*s,r*o),Math.asin(r&&n*s/r)]},n}function ws(e,t){function o(e,t){s>0?t<-Ht+Ot&&(t=-Ht+Ot):t>Ht-Ot&&(t=Ht-Ot);var n=s/Math.pow(r(t),i);return[n*Math.sin(i*e),s-n*Math.cos(i*e)]}var n=Math.cos(e),r=function(e){return Math.tan(_t/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),s=n*Math.pow(r(e),i)/i;return i?(o.invert=function(e,t){var n=s-t,r=Ft(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(s/r,1/i))-Ht]},o):xs}function Es(e,t){function s(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;return b(r)<Ot?ts:(s.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Ft(r)*Math.sqrt(e*e+n*n)]},s)}function xs(e,t){return[e,Math.log(Math.tan(_t/4+t/2))]}function Ts(e){var t=Yi(e),n=t.scale,r=t.translate,i=t.clipExtent,s;return t.scale=function(){var e=n.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.translate=function(){var e=r.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.clipExtent=function(e){var o=i.apply(t,arguments);if(o===t){if(s=e==null){var u=_t*n(),a=r();i([[a[0]-u,a[1]-u],[a[0]+u,a[1]+u]])}}else s&&(o=null);return o},t.clipExtent(null)}function ks(e,t){return[Math.log(Math.tan(_t/4+t/2)),-e]}function Ls(e){return e[0]}function As(e){return e[1]}function Os(e){var t=e.length,n=[0,1],r=2;for(var i=2;i<t;i++){while(r>1&&It(e[n[r-2]],e[n[r-1]],e[i])<=0)--r;n[r++]=i}return n.slice(0,r)}function Ms(e,t){return e[0]-t[0]||e[1]-t[1]}function Ds(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Ps(e,t,n,r){var i=e[0],s=n[0],o=t[0]-i,u=r[0]-s,a=e[1],f=n[1],l=t[1]-a,c=r[1]-f,h=(u*(a-f)-c*(i-s))/(c*o-u*l);return[i+h*o,a+h*l]}function Hs(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function zs(){lo(this),this.edge=this.site=this.circle=null}function Ws(e){var t=Is.pop()||new zs;return t.site=e,t}function Xs(e){to(e),Fs.remove(e),Is.push(e),lo(e)}function Vs(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},s=e.P,o=e.N,u=[e];Xs(e);var a=s;while(a.circle&&b(n-a.circle.x)<Ot&&b(r-a.circle.cy)<Ot)s=a.P,u.unshift(a),Xs(a),a=s;u.unshift(a),to(a);var f=o;while(f.circle&&b(n-f.circle.x)<Ot&&b(r-f.circle.cy)<Ot)o=f.N,u.push(f),Xs(f),f=o;u.push(f),to(f);var l=u.length,c;for(c=1;c<l;++c)f=u[c],a=u[c-1],uo(f.edge,a.site,f.site,i);a=u[0],f=u[l-1],f.edge=so(a.site,f.site,null,i),eo(a),eo(f)}function $s(e){var t=e.x,n=e.y,r,i,s,o,u=Fs._;while(u){s=Js(u,n)-t;if(s>Ot)u=u.L;else{o=t-Ks(u,n);if(!(o>Ot)){s>-Ot?(r=u.P,i=u):o>-Ot?(r=u,i=u.N):r=i=u;break}if(!u.R){r=u;break}u=u.R}}var a=Ws(e);Fs.insert(r,a);if(!r&&!i)return;if(r===i){to(r),i=Ws(r.site),Fs.insert(a,i),a.edge=i.edge=so(r.site,a.site),eo(r),eo(i);return}if(!i){a.edge=so(r.site,a.site);return}to(r),to(i);var f=r.site,l=f.x,c=f.y,h=e.x-l,p=e.y-c,d=i.site,v=d.x-l,m=d.y-c,g=2*(h*m-p*v),y=h*h+p*p,b=v*v+m*m,w={x:(m*y-p*b)/g+l,y:(h*b-v*y)/g+c};uo(i.edge,f,d,w),a.edge=so(f,e,null,w),i.edge=so(e,d,null,w),eo(r),eo(i)}function Js(e,t){var n=e.site,r=n.x,i=n.y,s=i-t;if(!s)return r;var o=e.P;if(!o)return-Infinity;n=o.site;var u=n.x,a=n.y,f=a-t;if(!f)return u;var l=u-r,c=1/s-1/f,h=l/f;return c?(-h+Math.sqrt(h*h-2*c*(l*l/(-2*f)-a+f/2+i-s/2)))/c+r:(r+u)/2}function Ks(e,t){var n=e.N;if(n)return Js(n,t);var r=e.site;return r.y===t?r.x:Infinity}function Qs(e){this.site=e,this.edges=[]}function Gs(e){var t=e[0][0],n=e[1][0],r=e[0][1],i=e[1][1],s,o,u,a,f=js,l=f.length,c,h,p,d,v,m;while(l--){c=f[l];if(!c||!c.prepare())continue;p=c.edges,d=p.length,h=0;while(h<d){m=p[h].end(),u=m.x,a=m.y,v=p[++h%d].start(),s=v.x,o=v.y;if(b(u-s)>Ot||b(a-o)>Ot)p.splice(h,0,new ao(oo(c.site,m,b(u-t)<Ot&&i-a>Ot?{x:t,y:b(s-t)<Ot?o:i}:b(a-i)<Ot&&n-u>Ot?{x:b(o-i)<Ot?s:n,y:i}:b(u-n)<Ot&&a-r>Ot?{x:n,y:b(s-n)<Ot?o:r}:b(a-r)<Ot&&u-t>Ot?{x:b(o-r)<Ot?s:t,y:r}:null),c.site,null)),++d}}}function Ys(e,t){return t.angle-e.angle}function Zs(){lo(this),this.x=this.y=this.arc=this.site=this.cy=null}function eo(e){var t=e.P,n=e.N;if(!t||!n)return;var r=t.site,i=e.site,s=n.site;if(r===s)return;var o=i.x,u=i.y,a=r.x-o,f=r.y-u,l=s.x-o,c=s.y-u,h=2*(a*c-f*l);if(h>=-Mt)return;var p=a*a+f*f,d=l*l+c*c,v=(c*p-f*d)/h,m=(a*d-l*p)/h,c=m+u,g=Us.pop()||new Zs;g.arc=e,g.site=i,g.x=v+o,g.y=c+Math.sqrt(v*v+m*m),g.cy=c,e.circle=g;var y=null,b=Rs._;while(b)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}Rs.insert(y,g),y||(qs=g)}function to(e){var t=e.circle;t&&(t.P||(qs=t.N),Rs.remove(t),Us.push(t),lo(t),e.circle=null)}function no(e){var t=Bs,n=Ni(e[0][0],e[0][1],e[1][0],e[1][1]),r=t.length,i;while(r--){i=t[r];if(!ro(i,e)||!n(i)||b(i.a.x-i.b.x)<Ot&&b(i.a.y-i.b.y)<Ot)i.a=i.b=null,t.splice(r,1)}}function ro(e,t){var n=e.b;if(n)return!0;var r=e.a,i=t[0][0],s=t[1][0],o=t[0][1],u=t[1][1],a=e.l,f=e.r,l=a.x,c=a.y,h=f.x,p=f.y,d=(l+h)/2,v=(c+p)/2,m,g;if(p===c){if(d<i||d>=s)return;if(l>h){if(!r)r={x:d,y:o};else if(r.y>=u)return;n={x:d,y:u}}else{if(!r)r={x:d,y:u};else if(r.y<o)return;n={x:d,y:o}}}else{m=(l-h)/(p-c),g=v-m*d;if(m<-1||m>1)if(l>h){if(!r)r={x:(o-g)/m,y:o};else if(r.y>=u)return;n={x:(u-g)/m,y:u}}else{if(!r)r={x:(u-g)/m,y:u};else if(r.y<o)return;n={x:(o-g)/m,y:o}}else if(c<p){if(!r)r={x:i,y:m*i+g};else if(r.x>=s)return;n={x:s,y:m*s+g}}else{if(!r)r={x:s,y:m*s+g};else if(r.x<i)return;n={x:i,y:m*i+g}}}return e.a=r,e.b=n,!0}function io(e,t){this.l=e,this.r=t,this.a=this.b=null}function so(e,t,n,r){var i=new io(e,t);return Bs.push(i),n&&uo(i,e,t,n),r&&uo(i,t,e,r),js[e.i].edges.push(new ao(i,e,t)),js[t.i].edges.push(new ao(i,t,e)),i}function oo(e,t,n){var r=new io(e,null);return r.a=t,r.b=n,Bs.push(r),r}function uo(e,t,n,r){!e.a&&!e.b?(e.a=r,e.l=t,e.r=n):e.l===n?e.b=r:e.a=r}function ao(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function fo(){this._=null}function lo(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function co(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function ho(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function po(e){while(e.L)e=e.L;return e}function vo(e,t){var n=e.sort(mo).pop(),r,i,s;Bs=[],js=new Array(e.length),Fs=new fo,Rs=new fo;for(;;){s=qs;if(n&&(!s||n.y<s.y||n.y===s.y&&n.x<s.x)){if(n.x!==r||n.y!==i)js[n.i]=new Qs(n),$s(n),r=n.x,i=n.y;n=e.pop()}else{if(!s)break;Vs(s.arc)}}t&&(no(t),Gs(t));var o={cells:js,edges:Bs};return Fs=Rs=Bs=js=null,o}function mo(e,t){return t.y-e.y||t.x-e.x}function yo(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function bo(e){return e.x}function wo(e){return e.y}function Eo(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function So(e,t,n,r,i,s){if(!e(t,n,r,i,s)){var o=(n+i)*.5,u=(r+s)*.5,a=t.nodes;a[0]&&So(e,a[0],n,r,o,u),a[1]&&So(e,a[1],o,r,i,u),a[2]&&So(e,a[2],n,u,o,s),a[3]&&So(e,a[3],o,u,i,s)}}function xo(e,t,n,r,i,s,o){var u=Infinity,a;return function f(e,l,c,h,p){if(l>s||c>o||h<r||p<i)return;if(d=e.point){var d,v=t-d[0],m=n-d[1],g=v*v+m*m;if(g<u){var y=Math.sqrt(u=g);r=t-y,i=n-y,s=t+y,o=n+y,a=d}}var b=e.nodes,w=(l+h)*.5,E=(c+p)*.5,S=t>=w,x=n>=E;for(var T=x<<1|S,N=T+4;T<N;++T)if(e=b[T&3])switch(T&3){case 0:f(e,l,c,w,E);break;case 1:f(e,w,c,h,E);break;case 2:f(e,l,E,w,p);break;case 3:f(e,w,E,h,p)}}(e,r,i,s,o),a}function To(t,n){t=e.rgb(t),n=e.rgb(n);var r=t.r,i=t.g,s=t.b,o=n.r-r,u=n.g-i,a=n.b-s;return function(e){return"#"+En(Math.round(r+o*e))+En(Math.round(i+u*e))+En(Math.round(s+a*e))}}function No(e,t){var n={},r={},i;for(i in e)i in t?n[i]=Oo(e[i],t[i]):r[i]=e[i];for(i in t)i in e||(r[i]=t[i]);return function(e){for(i in n)r[i]=n[i](e);return r}}function Co(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ko(e,t){var n=Lo.lastIndex=Ao.lastIndex=0,r,i,s,o=-1,u=[],a=[];e+="",t+="";while((r=Lo.exec(e))&&(i=Ao.exec(t)))(s=i.index)>n&&(s=t.slice(n,s),u[o]?u[o]+=s:u[++o]=s),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,a.push({i:o,x:Co(r,i)})),n=Ao.lastIndex;return n<t.length&&(s=t.slice(n),u[o]?u[o]+=s:u[++o]=s),u.length<2?a[0]?(t=a[0].x,function(e){return t(e)+""}):function(){return t}:(t=a.length,function(e){for(var n=0,r;n<t;++n)u[(r=a[n]).i]=r.x(e);return u.join("")})}function Oo(t,n){var r=e.interpolators.length,i;while(--r>=0&&!(i=e.interpolators[r](t,n)));return i}function Mo(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u<o;++u)n.push(Oo(e[u],t[u]));for(;u<i;++u)r[u]=e[u];for(;u<s;++u)r[u]=t[u];return function(e){for(u=0;u<o;++u)r[u]=n[u](e);return r}}function Ho(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function Bo(e){return function(t){return 1-e(1-t)}}function jo(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Fo(e){return e*e}function Io(e){return e*e*e}function qo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function Ro(e){return function(t){return Math.pow(t,e)}}function Uo(e){return 1-Math.cos(e*Ht)}function zo(e){return Math.pow(2,10*(e-1))}function Wo(e){return 1-Math.sqrt(1-e*e)}function Xo(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Dt*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Dt/t)}}function Vo(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function $o(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Jo(t,n){t=e.hcl(t),n=e.hcl(n);var r=t.h,i=t.c,s=t.l,o=n.h-r,u=n.c-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.c:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return sn(r+o*e,i+u*e,s+a*e)+""}}function Ko(t,n){t=e.hsl(t),n=e.hsl(n);var r=t.h,i=t.s,s=t.l,o=n.h-r,u=n.s-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.s:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return tn(r+o*e,i+u*e,s+a*e)+""}}function Qo(t,n){t=e.lab(t),n=e.lab(n);var r=t.l,i=t.a,s=t.b,o=n.l-r,u=n.a-i,a=n.b-s;return function(e){return hn(r+o*e,i+u*e,s+a*e)+""}}function Go(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Yo(e){var t=[e.a,e.b],n=[e.c,e.d],r=eu(t),i=Zo(t,n),s=eu(tu(n,t,-i))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*jt,this.translate=[e.e,e.f],this.scale=[r,s],this.skew=s?Math.atan2(i,s)*jt:0}function Zo(e,t){return e[0]*t[0]+e[1]*t[1]}function eu(e){var t=Math.sqrt(Zo(e,e));return t&&(e[0]/=t,e[1]/=t),t}function tu(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function ru(t,n){var r=[],i=[],s,o=e.transform(t),u=e.transform(n),a=o.translate,f=u.translate,l=o.rotate,c=u.rotate,h=o.skew,p=u.skew,d=o.scale,v=u.scale;return a[0]!=f[0]||a[1]!=f[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:Co(a[0],f[0])},{i:3,x:Co(a[1],f[1])})):f[0]||f[1]?r.push("translate("+f+")"):r.push(""),l!=c?(l-c>180?c+=360:c-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:Co(l,c)})):c&&r.push(r.pop()+"rotate("+c+")"),h!=p?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:Co(h,p)}):p&&r.push(r.pop()+"skewX("+p+")"),d[0]!=v[0]||d[1]!=v[1]?(s=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:s-4,x:Co(d[0],v[0])},{i:s-2,x:Co(d[1],v[1])})):(v[0]!=1||v[1]!=1)&&r.push(r.pop()+"scale("+v+")"),s=i.length,function(e){var t=-1,n;while(++t<s)r[(n=i[t]).i]=n.x(e);return r.join("")}}function iu(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function su(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function ou(e){var t=e.source,n=e.target,r=au(t,n),i=[t];while(t!==r)t=t.parent,i.push(t);var s=i.length;while(n!==r)i.splice(s,0,n),n=n.parent;return i}function uu(e){var t=[],n=e.parent;while(n!=null)t.push(e),e=n,n=n.parent;return t.push(e),t}function au(e,t){if(e===t)return e;var n=uu(e),r=uu(t),i=n.pop(),s=r.pop(),o=null;while(i===s)o=i,i=n.pop(),s=r.pop();return o}function fu(e){e.fixed|=2}function lu(e){e.fixed&=-7}function cu(e){e.fixed|=4,e.px=e.x,e.py=e.y}function hu(e){e.fixed&=-5}function pu(e,t,n){var r=0,i=0;e.charge=0;if(!e.leaf){var s=e.nodes,o=s.length,u=-1,a;while(++u<o){a=s[u];if(a==null)continue;pu(a,t,n),e.charge+=a.charge,r+=a.charge*a.cx,i+=a.charge*a.cy}}if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var f=t*n[e.point.index];e.charge+=e.pointCharge=f,r+=f*e.point.x,i+=f*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}function gu(t,n){return e.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=xu,t}function yu(e,t){var n=[e];while((e=n.pop())!=null){t(e);if((i=e.children)&&(r=i.length)){var r,i;while(--r>=0)n.push(i[r])}}}function bu(e,t){var n=[e],r=[];while((e=n.pop())!=null){r.push(e);if((o=e.children)&&(s=o.length)){var i=-1,s,o;while(++i<s)n.push(o[i])}}while((e=r.pop())!=null)t(e)}function wu(e){return e.children}function Eu(e){return e.value}function Su(e,t){return t.value-e.value}function xu(t){return e.merge(t.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function Nu(e){return e.x}function Cu(e){return e.y}function ku(e,t,n){e.y0=t,e.y=n}function Ou(t){return e.range(t.length)}function Mu(e){var t=-1,n=e[0].length,r=[];while(++t<n)r[t]=0;return r}function _u(e){var t=1,n=0,r=e[0][1],i,s=e.length;for(;t<s;++t)(i=e[t][1])>r&&(n=t,r=i);return n}function Du(e){return e.reduce(Pu,0)}function Pu(e,t){return e+t[1]}function Hu(e,t){return Bu(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Bu(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function ju(t){return[e.min(t),e.max(t)]}function Fu(e,t){return e.value-t.value}function Iu(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function qu(e,t){e._pack_next=t,t._pack_prev=e}function Ru(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function Uu(e){function p(e){n=Math.min(e.x-e.r,n),r=Math.max(e.x+e.r,r),i=Math.min(e.y-e.r,i),s=Math.max(e.y+e.r,s)}if(!(t=e.children)||!(h=t.length))return;var t,n=Infinity,r=-Infinity,i=Infinity,s=-Infinity,o,u,a,f,l,c,h;t.forEach(zu),o=t[0],o.x=-o.r,o.y=0,p(o);if(h>1){u=t[1],u.x=u.r,u.y=0,p(u);if(h>2){a=t[2],Vu(o,u,a),p(a),Iu(o,a),o._pack_prev=a,Iu(a,u),u=o._pack_next;for(f=3;f<h;f++){Vu(o,u,a=t[f]);var d=0,v=1,m=1;for(l=u._pack_next;l!==u;l=l._pack_next,v++)if(Ru(l,a)){d=1;break}if(d==1)for(c=o._pack_prev;c!==l._pack_prev;c=c._pack_prev,m++)if(Ru(c,a))break;d?(v<m||v==m&&u.r<o.r?qu(o,u=l):qu(o=c,u),f--):(Iu(o,a),u=a,p(a))}}}var g=(n+r)/2,y=(i+s)/2,b=0;for(f=0;f<h;f++)a=t[f],a.x-=g,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=b,t.forEach(Wu)}function zu(e){e._pack_next=e._pack_prev=e}function Wu(e){delete e._pack_next,delete e._pack_prev}function Xu(e,t,n,r){var i=e.children;e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r;if(i){var s=-1,o=i.length;while(++s<o)Xu(i[s],t,n,r)}}function Vu(e,t,n){var r=e.r+n.r,i=t.x-e.x,s=t.y-e.y;if(r&&(i||s)){var o=t.r+n.r,u=i*i+s*s;o*=o,r*=r;var a=.5+(r-o)/(2*u),f=Math.sqrt(Math.max(0,2*o*(r+u)-(r-=u)*r-o*o))/(2*u);n.x=e.x+a*i+f*s,n.y=e.y+a*s-f*i}else n.x=e.x+r,n.y=e.y}function $u(e,t){return e.parent==t.parent?1:2}function Ju(e){var t=e.children;return t.length?t[0]:e.t}function Ku(e){var t=e.children,n;return(n=t.length)?t[n-1]:e.t}function Qu(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Gu(e){var t=0,n=0,r=e.children,i=r.length,s;while(--i>=0)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Yu(e,t,n){return e.a.parent===t.parent?e.a:n}function Zu(t){return 1+e.max(t,function(e){return e.y})}function ea(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function ta(e){var t=e.children;return t&&t.length?ta(t[0]):e}function na(e){var t=e.children,n;return t&&(n=t.length)?na(t[n-1]):e}function ra(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ia(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}function sa(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function oa(e){return e.rangeExtent?e.rangeExtent():sa(e.range())}function ua(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function aa(e,t){var n=0,r=e.length-1,i=e[n],s=e[r],o;return s<i&&(o=n,n=r,r=o,o=i,i=s,s=o),e[n]=t.floor(i),e[r]=t.ceil(s),e}function fa(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:la}function ca(t,n,r,i){var s=[],o=[],u=0,a=Math.min(t.length,n.length)-1;t[a]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());while(++u<=a)s.push(r(t[u-1],t[u])),o.push(i(n[u-1],n[u]));return function(n){var r=e.bisect(t,n,1,a)-1;return o[r](s[r](n))}}function ha(e,t,n,r){function o(){var o=Math.min(e.length,t.length)>2?ca:ua,a=r?su:iu;return i=o(e,t,a,n),s=o(t,e,a,Oo),u}function u(e){return i(e)}var i,s;return u.invert=function(e){return s(e)},u.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},u.range=function(e){return arguments.length?(t=e,o()):t},u.rangeRound=function(e){return u.range(e).interpolate(Go)},u.clamp=function(e){return arguments.length?(r=e,o()):r},u.interpolate=function(e){return arguments.length?(n=e,o()):n},u.ticks=function(t){return ma(e,t)},u.tickFormat=function(t,n){return ga(e,t,n)},u.nice=function(t){return da(e,t),o()},u.copy=function(){return ha(e,t,n,r)},o()}function pa(t,n){return e.rebind(t,n,"range","rangeRound","interpolate","clamp")}function da(e,t){return aa(e,fa(va(e,t)[2]))}function va(e,t){t==null&&(t=10);var n=sa(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function ma(t,n){return e.range.apply(e,va(t,n))}function ga(t,n,r){var i=va(t,n);if(r){var s=$n.exec(r);s.shift();if(s[8]==="s"){var o=e.formatPrefix(Math.max(b(i[0]),b(i[1])));return s[7]||(s[7]="."+ba(o.scale(i[2]))),s[8]="f",r=e.format(s.join("")),function(e){return r(o.scale(e))+o.symbol}}s[7]||(s[7]="."+wa(s[8],i)),r=s.join("")}else r=",."+ba(i[2])+"f";return e.format(r)}function ba(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function wa(e,t){var n=ba(t[2]);return e in ya?Math.abs(n-ba(Math.max(b(t[0]),b(t[1]))))+ +(e!=="e"):n-(e==="%")*2}function Ea(t,n,r,i){function s(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function o(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function u(e){return t(s(e))}return u.invert=function(e){return o(t.invert(e))},u.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),u):i},u.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),u):n},u.nice=function(){var e=aa(i.map(s),r?Math:xa);return t.domain(e),i=e.map(o),u},u.ticks=function(){var e=sa(i),t=[],u=e[0],a=e[1],f=Math.floor(s(u)),l=Math.ceil(s(a)),c=n%1?2:n;if(isFinite(l-f)){if(r){for(;f<l;f++)for(var h=1;h<c;h++)t.push(o(f)*h);t.push(o(f))}else{t.push(o(f));for(;f++<l;)for(var h=c-1;h>0;h--)t.push(o(f)*h)}for(f=0;t[f]<u;f++);for(l=t.length;t[l-1]>a;l--);t=t.slice(f,l)}return t},u.tickFormat=function(t,n){if(!arguments.length)return Sa;arguments.length<2?n=Sa:typeof n!="function"&&(n=e.format(n));var i=Math.max(.1,t/u.ticks().length),a=r?(f=1e-12,Math.ceil):(f=-1e-12,Math.floor),f;return function(e){return e/o(a(s(e)+f))<=i?n(e):""}},u.copy=function(){return Ea(t.copy(),n,r,i)},pa(u,t)}function Ta(e,t,n){function s(t){return e(r(t))}var r=Na(t),i=Na(1/t);return s.invert=function(t){return i(e.invert(t))},s.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),s):n},s.ticks=function(e){return ma(n,e)},s.tickFormat=function(e,t){return ga(n,e,t)},s.nice=function(e){return s.domain(da(n,e))},s.exponent=function(o){return arguments.length?(r=Na(t=o),i=Na(1/t),e.domain(n.map(r)),s):t},s.copy=function(){return Ta(e.copy(),t,n)},pa(s,e)}function Na(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ca(t,n){function o(e){return i[((r.get(e)||(n.t==="range"?r.set(e,t.push(e)):NaN))-1)%i.length]}function u(n,r){return e.range(t.length).map(function(e){return n+r*e})}var r,i,s;return o.domain=function(e){if(!arguments.length)return t;t=[],r=new S;var i=-1,s=e.length,u;while(++i<s)r.has(u=e[i])||r.set(u,t.push(u));return o[n.t].apply(o,n.a)},o.range=function(e){return arguments.length?(i=e,s=0,n={t:"range",a:arguments},o):i},o.rangePoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=(a+f)/2,0):(f-a)/(t.length-1+r);return i=u(a+l*r/2,l),s=0,n={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=f=Math.round((a+f)/2),0):(f-a)/(t.length-1+r)|0;return i=u(a+Math.round(l*r/2+(f-a-(t.length-1+r)*l)/2),l),s=0,n={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=(c-l)/(t.length-r+2*a);return i=u(l+h*a,h),f&&i.reverse(),s=h*(1-r),n={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=Math.floor((c-l)/(t.length-r+2*a));return i=u(l+Math.round((c-l-(t.length-r)*h)/2),h),f&&i.reverse(),s=Math.round(h*(1-r)),n={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return s},o.rangeExtent=function(){return sa(n.a[0])},o.copy=function(){return Ca(t,n)},o.domain(t)}function Ma(t,n){function i(){var i=0,o=n.length;r=[];while(++i<o)r[i-1]=e.quantile(t,i/o);return s}function s(t){if(!isNaN(t=+t))return n[e.bisect(r,t)]}var r;return s.domain=function(e){return arguments.length?(t=e.map(d).filter(v).sort(p),i()):t},s.range=function(e){return arguments.length?(n=e,i()):n},s.quantiles=function(){return r},s.invertExtent=function(e){return e=n.indexOf(e),e<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},s.copy=function(){return Ma(t,n)},i()}function _a(e,t,n){function s(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function o(){return r=n.length/(t-e),i=n.length-1,s}var r,i;return s.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],o()):[e,t]},s.range=function(e){return arguments.length?(n=e,o()):n},s.invertExtent=function(t){return t=n.indexOf(t),t=t<0?NaN:t/r+e,[t,t+1/r]},s.copy=function(){return _a(e,t,n)},o()}function Da(t,n){function r(r){if(r<=r)return n[e.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(e){return arguments.length?(n=e,r):n},r.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},r.copy=function(){return Da(t,n)},r}function Pa(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return ma(e,t)},t.tickFormat=function(t,n){return ga(e,t,n)},t.copy=function(){return Pa(e)},t}function Ha(){return 0}function ja(e){return e.innerRadius}function Fa(e){return e.outerRadius}function Ia(e){return e.startAngle}function qa(e){return e.endAngle}function Ra(e){return e&&e.padAngle}function Ua(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function za(e,t,n,r,i){var s=e[0]-t[0],o=e[1]-t[1],u=(i?r:-r)/Math.sqrt(s*s+o*o),a=u*o,f=-u*s,l=e[0]+a,c=e[1]+f,h=t[0]+a,p=t[1]+f,d=(l+h)/2,v=(c+p)/2,m=h-l,g=p-c,y=m*m+g*g,b=n-r,w=l*p-h*c,E=(g<0?-1:1)*Math.sqrt(b*b*y-w*w),S=(w*g-m*E)/y,x=(-w*m-g*E)/y,T=(w*g+m*E)/y,N=(-w*m+g*E)/y,C=S-d,k=x-v,L=T-d,A=N-v;return C*C+k*k>L*L+A*A&&(S=T,x=N),[[S-a,x-f],[S*n/b,x*n/b]]}function Wa(e){function u(s){function d(){u.push("M",i(e(a),o))}var u=[],a=[],f=-1,l=s.length,c,h=Ln(t),p=Ln(n);while(++f<l)r.call(this,c=s[f],f)?a.push([+h.call(this,c,f),+p.call(this,c,f)]):a.length&&(d(),a=[]);return a.length&&d(),u.length?u.join(""):null}var t=Ls,n=As,r=ci,i=Va,s=i.key,o=.7;return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(e){return arguments.length?(n=e,u):n},u.defined=function(e){return arguments.length?(r=e,u):r},u.interpolate=function(e){return arguments.length?(typeof e=="function"?s=i=e:s=(i=Xa.get(e)||Va).key,u):s},u.tension=function(e){return arguments.length?(o=e,u):o},u}function Va(e){return e.join("L")}function $a(e){return Va(e)+"Z"}function Ja(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")}function Ka(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function Qa(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function Ga(e,t){return e.length<4?Va(e):e[1]+ef(e.slice(1,-1),tf(e,t))}function Ya(e,t){return e.length<3?Va(e):e[0]+ef((e.push(e[0]),e),tf([e[e.length-2]].concat(e,[e[1]]),t))}function Za(e,t){return e.length<3?Va(e):e[0]+ef(e,tf(e,t))}function ef(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return Va(e);var n=e.length!=t.length,r="",i=e[0],s=e[1],o=t[0],u=o,a=1;n&&(r+="Q"+(s[0]-o[0]*2/3)+","+(s[1]-o[1]*2/3)+","+s[0]+","+s[1],i=e[1],a=2);if(t.length>1){u=t[1],s=e[a],a++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1];for(var f=2;f<t.length;f++,a++)s=e[a],u=t[f],r+="S"+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1]}if(n){var l=e[a];r+="Q"+(s[0]+u[0]*2/3)+","+(s[1]+u[1]*2/3)+","+l[0]+","+l[1]}return r}function tf(e,t){var n=[],r=(1-t)/2,i,s=e[0],o=e[1],u=1,a=e.length;while(++u<a)i=s,s=o,o=e[u],n.push([r*(o[0]-i[0]),r*(o[1]-i[1])]);return n}function nf(e){if(e.length<3)return Va(e);var t=1,n=e.length,r=e[0],i=r[0],s=r[1],o=[i,i,i,(r=e[1])[0]],u=[s,s,s,r[1]],a=[i,",",s,"L",uf(lf,o),",",uf(lf,u)];e.push(e[n-1]);while(++t<=n)r=e[t],o.shift(),o.push(r[0]),u.shift(),u.push(r[1]),cf(a,o,u);return e.pop(),a.push("L",r),a.join("")}function rf(e){if(e.length<4)return Va(e);var t=[],n=-1,r=e.length,i,s=[0],o=[0];while(++n<3)i=e[n],s.push(i[0]),o.push(i[1]);t.push(uf(lf,s)+","+uf(lf,o)),--n;while(++n<r)i=e[n],s.shift(),s.push(i[0]),o.shift(),o.push(i[1]),cf(t,s,o);return t.join("")}function sf(e){var t,n=-1,r=e.length,i=r+4,s,o=[],u=[];while(++n<4)s=e[n%r],o.push(s[0]),u.push(s[1]);t=[uf(lf,o),",",uf(lf,u)],--n;while(++n<i)s=e[n%r],o.shift(),o.push(s[0]),u.shift(),u.push(s[1]),cf(t,o,u);return t.join("")}function of(e,t){var n=e.length-1;if(n){var r=e[0][0],i=e[0][1],s=e[n][0]-r,o=e[n][1]-i,u=-1,a,f;while(++u<=n)a=e[u],f=u/n,a[0]=t*a[0]+(1-t)*(r+f*s),a[1]=t*a[1]+(1-t)*(i+f*o)}return nf(e)}function uf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function cf(e,t,n){e.push("C",uf(af,t),",",uf(af,n),",",uf(ff,t),",",uf(ff,n),",",uf(lf,t),",",uf(lf,n))}function hf(e,t){return(t[1]-e[1])/(t[0]-e[0])}function pf(e){var t=0,n=e.length-1,r=[],i=e[0],s=e[1],o=r[0]=hf(i,s);while(++t<n)r[t]=(o+(o=hf(i=s,s=e[t+1])))/2;return r[t]=o,r}function df(e){var t=[],n,r,i,s,o=pf(e),u=-1,a=e.length-1;while(++u<a)n=hf(e[u],e[u+1]),b(n)<Ot?o[u]=o[u+1]=0:(r=o[u]/n,i=o[u+1]/n,s=r*r+i*i,s>9&&(s=n*3/Math.sqrt(s),o[u]=s*r,o[u+1]=s*i));u=-1;while(++u<=a)s=(e[Math.min(a,u+1)][0]-e[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),t.push([s||0,o[u]*s||0]);return t}function vf(e){return e.length<3?Va(e):e[0]+ef(e,df(e))}function mf(e){var t,n=-1,r=e.length,i,s;while(++n<r)t=e[n],i=t[0],s=t[1]-Ht,t[0]=i*Math.cos(s),t[1]=i*Math.sin(s);return e}function gf(e){function c(u){function x(){c.push("M",o(e(p),l),f,a(e(h.reverse()),l),"Z")}var c=[],h=[],p=[],d=-1,v=u.length,m,g=Ln(t),y=Ln(r),b=t===n?function(){return E}:Ln(n),w=r===i?function(){return S}:Ln(i),E,S;while(++d<v)s.call(this,m=u[d],d)?(h.push([E=+g.call(this,m,d),S=+y.call(this,m,d)]),p.push([+b.call(this,m,d),+w.call(this,m,d)])):h.length&&(x(),h=[],p=[]);return h.length&&x(),c.length?c.join(""):null}var t=Ls,n=Ls,r=0,i=As,s=ci,o=Va,u=o.key,a=o,f="L",l=.7;return c.x=function(e){return arguments.length?(t=n=e,c):n},c.x0=function(e){return arguments.length?(t=e,c):t},c.x1=function(e){return arguments.length?(n=e,c):n},c.y=function(e){return arguments.length?(r=i=e,c):i},c.y0=function(e){return arguments.length?(r=e,c):r},c.y1=function(e){return arguments.length?(i=e,c):i},c.defined=function(e){return arguments.length?(s=e,c):s},c.interpolate=function(e){return arguments.length?(typeof e=="function"?u=o=e:u=(o=Xa.get(e)||Va).key,a=o.reverse||o,f=o.closed?"M":"L",c):u},c.tension=function(e){return arguments.length?(l=e,c):l},c}function yf(e){return e.radius}function bf(e){return[e.x,e.y]}function wf(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-Ht;return[n*Math.cos(r),n*Math.sin(r)]}}function Ef(){return 64}function Sf(){return"circle"}function xf(e){var t=Math.sqrt(e/_t);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+ -t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function kf(e,t,n){return z(e,Lf),e.namespace=t,e.id=n,e}function _f(e,t,n,r){var i=e.id,s=e.namespace;return ht(e,typeof n=="function"?function(e,o,u){e[s][i].tween.set(t,r(n.call(e,e.__data__,o,u)))}:(n=r(n),function(e){e[s][i].tween.set(t,n)}))}function Df(e){return e==null&&(e=""),function(){this.textContent=e}}function Pf(e){return e==null?"__transition__":"__transition_"+e+"__"}function Hf(t,n,r,i,s){var o=t[r]||(t[r]={active:0,count:0}),u=o[i];if(!u){var a=s.time;u=o[i]={tween:new S,time:a,delay:s.delay,duration:s.duration,ease:s.ease},s=null,++o.count,e.timer(function(s){function v(r){if(o.active>i)return g(!1);o.active=i,u.event&&u.event.start.call(t,f,n),u.tween.forEach(function(e,r){(r=r.call(t,f,n))&&d.push(r)}),h=u.ease,c=u.duration,e.timer(function(){return p.c=m(r||1)?ci:m,1},0,a)}function m(e){if(o.active!==i)return g(!1);var n=e/c,r=h(n),s=d.length;while(s>0)d[--s].call(t,r);if(n>=1)return g(!0)}function g(e){return u.event&&u.event[e?"end":"interrupt"].call(t,f,n),--o.count?delete o[i]:delete t[r],1}var f=t.__data__,l=u.delay,c,h,p=Fn,d=[];p.t=l+a;if(l<=s)return v(s-l);p.c=v},0,a)}}function Ff(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function If(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}function Xf(e){return e.toISOString()}function Vf(t,n,r){function i(e){return t(e)}function s(t,r){var i=t[1]-t[0],s=i/r,o=e.bisect(Jf,s);return o==Jf.length?[n.year,va(t.map(function(e){return e/31536e6}),r)[2]]:o?n[s/Jf[o-1]<Jf[o]/s?o-1:o]:[Gf,va(t,r)[2]]}return i.invert=function(e){return $f(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map($f)},i.nice=function(e,t){function u(n){return!isNaN(n)&&!e.range(n,$f(+n+1),t).length}var n=i.domain(),r=sa(n),o=e==null?s(r,10):typeof e=="number"&&s(r,e);return o&&(e=o[0],t=o[1]),i.domain(aa(n,t>1?{floor:function(t){while(u(t=e.floor(t)))t=$f(t-1);return t},ceil:function(t){while(u(t=e.ceil(t)))t=$f(+t+1);return t}}:e))},i.ticks=function(e,t){var n=sa(i.domain()),r=e==null?s(n,10):typeof e=="number"?s(n,e):!e.range&&[{range:e},t];return r&&(e=r[0],t=r[1]),e.range(n[0],$f(+n[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Vf(t.copy(),n,r)},pa(i,t)}function $f(e){return new Date(e)}function el(e){return JSON.parse(e.responseText)}function tl(e){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(e.responseText)}var e={version:"3.5.0"};Date.now||(Date.now=function(){return+(new Date)});var t=[].slice,n=function(e){return t.call(e)},r=document,i=r.documentElement,s=window;try{n(i.childNodes)[0].nodeType}catch(o){n=function(e){var t=e.length,n=new Array(t);while(t--)n[t]=e[t];return n}}try{r.createElement("div").style.setProperty("opacity",0,"")}catch(u){var a=s.Element.prototype,f=a.setAttribute,l=a.setAttributeNS,c=s.CSSStyleDeclaration.prototype,h=c.setProperty;a.setAttribute=function(e,t){f.call(this,e,t+"")},a.setAttributeNS=function(e,t,n){l.call(this,e,t,n+"")},c.setProperty=function(e,t,n){h.call(this,e,t+"",n)}}e.ascending=p,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&i>s&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&i>s&&(i=s)}return i},e.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&s>i&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&s>i&&(i=s)}return i},e.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=o=s;break}while(++n<r)(s=e[n])!=null&&(i>s&&(i=s),o<s&&(o=s))}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=o=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&(i>s&&(i=s),o<s&&(o=s))}return[i,o]},e.sum=function(e,t){var n=0,r=e.length,i,s=-1;if(arguments.length===1)while(++s<r)v(i=+e[s])&&(n+=i);else while(++s<r)v(i=+t.call(e,e[s],s))&&(n+=i);return n},e.mean=function(e,t){var n=0,r=e.length,i,s=-1,o=r;if(arguments.length===1)while(++s<r)v(i=d(e[s]))?n+=i:--o;else while(++s<r)v(i=d(t.call(e,e[s],s)))?n+=i:--o;if(o)return n/o},e.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],s=n-r;return s?i+s*(e[r]-i):i},e.median=function(t,n){var r=[],i=t.length,s,o=-1;if(arguments.length===1)while(++o<i)v(s=d(t[o]))&&r.push(s);else while(++o<i)v(s=d(n.call(t,t[o],o)))&&r.push(s);if(r.length)return e.quantile(r.sort(p),.5)};var g=m(p);e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(e.length===1?function(t,n){return p(e(t),n)}:e)},e.shuffle=function(e,t,n){(r=arguments.length)<3&&(n=e.length,r<2&&(t=0));var r=n-t,i,s;while(r)s=Math.random()*r--|0,i=e[r+t],e[r+t]=e[s+t],e[s+t]=i;return e},e.permute=function(e,t){var n=t.length,r=new Array(n);while(n--)r[n]=e[t[n]];return r},e.pairs=function(e){var t=0,n=e.length-1,r,i=e[0],s=new Array(n<0?0:n);while(t<n)s[t]=[r=i,i=e[++t]];return s},e.zip=function(){if(!(s=arguments.length))return[];for(var t=-1,n=e.min(arguments,y),r=new Array(n);++t<n;)for(var i=-1,s,o=r[t]=new Array(s);++i<s;)o[i]=arguments[i][t];return r},e.transpose=function(t){return e.zip.apply(e,t)},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t},e.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},e.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},e.merge=function(e){var t=e.length,n,r=-1,i=0,s,o;while(++r<t)i+=e[r].length;s=new Array(i);while(--t>=0){o=e[t],n=o.length;while(--n>=0)s[--i]=o[n]}return s};var b=Math.abs;e.range=function(e,t,n){arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0));if((t-e)/n===Infinity)throw new Error("infinite range");var r=[],i=w(b(n)),s=-1,o;e*=i,t*=i,n*=i;if(n<0)while((o=e+n*++s)>t)r.push(o/i);else while((o=e+n*++s)<t)r.push(o/i);return r},e.map=function(e,t){var n=new S;if(e instanceof S)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r=-1,i=e.length,s;if(arguments.length===1)while(++r<i)n.set(r,e[r]);else while(++r<i)n.set(t.call(e,s=e[r],r),s)}else for(var o in e)n.set(o,e[o]);return n};var x="__proto__",T="\0";E(S,{has:k,get:function(e){return this._[N(e)]},set:function(e,t){return this._[N(e)]=t},remove:L,keys:A,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:C(t),value:this._[t]});return e},size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t),this._[t])}}),e.nest=function(){function o(e,r,u){if(u>=n.length)return s?s.call(t,r):i?r.sort(i):r;var a=-1,f=r.length,l=n[u++],c,h,p,d=new S,v;while(++a<f)(v=d.get(c=l(h=r[a])))?v.push(h):d.set(c,[h]);return e?(h=e(),p=function(t,n){h.set(t,o(e,n,u))}):(h={},p=function(t,n){h[t]=o(e,n,u)}),d.forEach(p),h}function u(e,t){if(t>=n.length)return e;var i=[],s=r[t++];return e.forEach(function(e,n){i.push({key:e,values:u(n,t)})}),s?i.sort(function(e,t){return s(e.key,t.key)}):i}var t={},n=[],r=[],i,s;return t.map=function(e,t){return o(t,e,0)},t.entries=function(t){return u(o(e.map,t,0),0)},t.key=function(e){return n.push(e),t},t.sortKeys=function(e){return r[n.length-1]=e,t},t.sortValues=function(e){return i=e,t},t.rollup=function(e){return s=e,t},t},e.set=function(e){var t=new _;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},E(_,{has:k,add:function(e){return this._[N(e+="")]=!0,e},remove:L,values:A,size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t))}}),e.behavior={},e.rebind=function(e,t){var n=1,r=arguments.length,i;while(++n<r)e[i=arguments[n]]=D(e,t,t[i]);return e};var H=["webkit","ms","moz","Moz","o","O"];e.dispatch=function(){var e=new j,t=-1,n=arguments.length;while(++t<n)e[arguments[t]]=F(e);return e},j.prototype.on=function(e,t){var n=e.indexOf("."),r="";n>=0&&(r=e.slice(n+1),e=e.slice(0,n));if(e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(arguments.length===2){if(t==null)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},e.event=null,e.requote=function(e){return e.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,z={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},X=function(e,t){return t.querySelector(e)},V=function(e,t){return t.querySelectorAll(e)},$=i.matches||i[P(i,"matchesSelector")],J=function(e,t){return $.call(e,t)};typeof Sizzle=="function"&&(X=function(e,t){return Sizzle(e,t)[0]||null},V=Sizzle,J=Sizzle.matchesSelector),e.selection=function(){return gt};var K=e.selection.prototype=[];K.select=function(e){var t=[],n,r,i,s;e=Q(e);for(var o=-1,u=this.length;++o<u;){t.push(n=[]),n.parentNode=(i=this[o]).parentNode;for(var a=-1,f=i.length;++a<f;)(s=i[a])?(n.push(r=e.call(s,s.__data__,a,o)),r&&"__data__"in s&&(r.__data__=s.__data__)):n.push(null)}return W(t)},K.selectAll=function(e){var t=[],r,i;e=G(e);for(var s=-1,o=this.length;++s<o;)for(var u=this[s],a=-1,f=u.length;++a<f;)if(i=u[a])t.push(r=n(e.call(i,i.__data__,a,s))),r.parentNode=i;return W(t)};var Y={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};e.ns={prefix:Y,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.slice(0,t),e=e.slice(t+1)),Y.hasOwnProperty(n)?{space:Y[n],local:e}:e}},K.attr=function(t,n){if(arguments.length<2){if(typeof t=="string"){var r=this.node();return t=e.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(n in t)this.each(Z(n,t[n]));return this}return this.each(Z(t,n))},K.classed=function(e,t){if(arguments.length<2){if(typeof e=="string"){var n=this.node(),r=(e=nt(e)).length,i=-1;if(t=n.classList){while(++i<r)if(!t.contains(e[i]))return!1}else{t=n.getAttribute("class");while(++i<r)if(!tt(e[i]).test(t))return!1}return!0}for(t in e)this.each(rt(t,e[t]));return this}return this.each(rt(e,t))},K.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.each(st(n,e[n],t));return this}if(r<2)return s.getComputedStyle(this.node(),null).getPropertyValue(e);n=""}return this.each(st(e,t,n))},K.property=function(e,t){if(arguments.length<2){if(typeof e=="string")return this.node()[e];for(t in e)this.each(ot(t,e[t]));return this}return this.each(ot(e,t))},K.text=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}:e==null?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},K.html=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},K.append=function(e){return e=ut(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},K.insert=function(e,t){return e=ut(e),t=Q(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},K.remove=function(){return this.each(at)},K.data=function(e,t){function o(e,n){var r,i=e.length,s=n.length,o=Math.min(i,s),l=new Array(s),c=new Array(s),h=new Array(i),p,d;if(t){var v=new S,m=new Array(i),g;for(r=-1;++r<i;)v.has(g=t.call(p=e[r],p.__data__,r))?h[r]=p:v.set(g,p),m[r]=g;for(r=-1;++r<s;)(p=v.get(g=t.call(n,d=n[r],r)))?p!==!0&&(l[r]=p,p.__data__=d):c[r]=ft(d),v.set(g,!0);for(r=-1;++r<i;)v.get(m[r])!==!0&&(h[r]=e[r])}else{for(r=-1;++r<o;)p=e[r],d=n[r],p?(p.__data__=d,l[r]=p):c[r]=ft(d);for(;r<s;++r)c[r]=ft(n[r]);for(;r<i;++r)h[r]=e[r]}c.update=l,c.parentNode=l.parentNode=h.parentNode=e.parentNode,u.push(c),a.push(l),f.push(h)}var n=-1,r=this.length,i,s;if(!arguments.length){e=new Array(r=(i=this[0]).length);while(++n<r)if(s=i[n])e[n]=s.__data__;return e}var u=pt([]),a=W([]),f=W([]);if(typeof e=="function")while(++n<r)o(i=this[n],e.call(i,i.parentNode.__data__,n));else while(++n<r)o(i=this[n],e);return a.enter=function(){return u},a.exit=function(){return f},a},K.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},K.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=lt(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]),n.parentNode=(r=this[s]).parentNode;for(var u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return W(t)},K.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n=this[e],r=n.length-1,i=n[r],s;--r>=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},K.sort=function(e){e=ct.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},K.each=function(e){return ht(this,function(t,n,r){e.call(t,t.__data__,n,r)})},K.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},K.empty=function(){return!this.node()},K.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var s=n[r];if(s)return s}return null},K.size=function(){var e=0;return ht(this,function(){++e}),e};var dt=[];e.selection.enter=pt,e.selection.enter.prototype=dt,dt.append=K.append,dt.empty=K.empty,dt.node=K.node,dt.call=K.call,dt.size=K.size,dt.select=function(e){var t=[],n,r,i,s,o;for(var u=-1,a=this.length;++u<a;){i=(s=this[u]).update,t.push(n=[]),n.parentNode=s.parentNode;for(var f=-1,l=s.length;++f<l;)(o=s[f])?(n.push(i[f]=r=e.call(s.parentNode,o.__data__,f,u)),r.__data__=o.__data__):n.push(null)}return W(t)},dt.insert=function(e,t){return arguments.length<2&&(t=vt(this)),K.insert.call(this,e,t)},K.transition=function(e){var t=Of||++Af,n=Pf(e),r=[],i,s,o=Mf||{time:Date.now(),ease:qo,delay:0,duration:250};for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(s=f[l])&&Hf(s,l,n,t,o),i.push(s)}return kf(r,n,t)},K.interrupt=function(e){var t=Pf(e);return this.each(function(){var e=this[t];e&&++e.active})},e.select=function(e){var t=[typeof e=="string"?X(e,r):e];return t.parentNode=i,W([t])},e.selectAll=function(e){var t=n(typeof e=="string"?V(e,r):e);return t.parentNode=i,W([t])};var gt=e.select(i);K.on=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t=!1);for(n in e)this.each(yt(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(yt(e,t,n))};var bt=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});bt.forEach(function(e){"on"+e in r&&bt.remove(e)});var St="onselectstart"in r?null:P(i.style,"userSelect"),xt=0;e.mouse=function(e){return Ct(e,q())};var Nt=/WebKit/.test(s.navigator.userAgent)?-1:0;e.touch=function(e,t,n){arguments.length<3&&(n=t,t=q().changedTouches);if(t)for(var r=0,i=t.length,s;r<i;++r)if((s=t[r]).identifier===n)return Ct(e,s)},e.behavior.drag=function(){function s(){this.on("mousedown.drag",r).on("touchstart.drag",i)}function o(r,i,s,o,u){return function(){function b(){var e=i(l,p),t,n;if(!e)return;t=e[0]-y[0],n=e[1]-y[1],h|=t|n,y=e,c({type:"drag",x:e[0]+v[0],y:e[1]+v[1],dx:t,dy:n})}function w(){if(!i(l,p))return;m.on(o+d,null).on(u+d,null),g(h&&e.event.target===f),c({type:"dragend"})}var a=this,f=e.event.target,l=a.parentNode,c=t.of(a,arguments),h=0,p=r(),d=".drag"+(p==null?"":"-"+p),v,m=e.select(s()).on(o+d,b).on(u+d,w),g=Tt(),y=i(l,p);n?(v=n.apply(a,arguments),v=[v.x-y[0],v.y-y[1]]):v=[0,0],c({type:"dragstart"})}}var t=R(s,"drag","dragstart","dragend"),n=null,r=o(B,e.mouse,At,"mousemove","mouseup"),i=o(kt,e.touch,Lt,"touchmove","touchend");return s.origin=function(e){return arguments.length?(n=e,s):n},e.rebind(s,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=q().touches),t?n(t).map(function(t){var n=Ct(e,t);return n.identifier=t.identifier,n}):[]};var Ot=1e-6,Mt=Ot*Ot,_t=Math.PI,Dt=2*_t,Pt=Dt-Ot,Ht=_t/2,Bt=_t/180,jt=180/_t,Vt=Math.SQRT2,$t=2,Jt=4;e.interpolateZoom=function(e,t){function y(e){var t=e*g;if(m){var s=zt(d),o=i/($t*c)*(s*Wt(Vt*t+d)-Ut(d));return[n+o*a,r+o*f,i*s/zt(Vt*t+d)]}return[n+e*a,r+e*f,i*Math.exp(Vt*t)]}var n=e[0],r=e[1],i=e[2],s=t[0],o=t[1],u=t[2],a=s-n,f=o-r,l=a*a+f*f,c=Math.sqrt(l),h=(u*u-i*i+Jt*l)/(2*i*$t*c),p=(u*u-i*i-Jt*l)/(2*u*$t*c),d=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(p*p+1)-p),m=v-d,g=(m||Math.log(u/i))/Vt;return y.duration=g*1e3,y},e.behavior.zoom=function(){function E(e){e.on(l,M).on(Gt+".zoom",D).on("dblclick.zoom",P).on(d,_)}function S(e){return[(e[0]-t.x)/t.k,(e[1]-t.y)/t.k]}function x(e){return[e[0]*t.k+t.x,e[1]*t.k+t.y]}function T(e){t.k=Math.max(u[0],Math.min(u[1],e))}function N(e,n){n=x(n),t.x+=e[0]-n[0],t.y+=e[1]-n[1]}function C(n,i,s,o){n.__chart__={x:t.x,y:t.y,k:t.k},T(Math.pow(2,o)),N(r=i,s),n=e.select(n),a>0&&(n=n.transition().duration(a)),n.call(E.event)}function k(){y&&y.domain(g.range().map(function(e){return(e-t.x)/t.k}).map(g.invert)),w&&w.domain(b.range().map(function(e){return(e-t.y)/t.k}).map(b.invert))}function L(e){f++||e({type:"zoomstart"})}function A(e){k(),e({type:"zoom",scale:t.k,translate:[t.x,t.y]})}function O(e){--f||e({type:"zoomend"}),r=null}function M(){function f(){i=1,N(e.mouse(t),u),A(r)}function l(){o.on(c,null).on(h,null),a(i&&e.event.target===n),O(r)}var t=this,n=e.event.target,r=m.of(t,arguments),i=0,o=e.select(s).on(c,f).on(h,l),u=S(e.mouse(t)),a=Tt();mt(t),L(r)}function _(){function g(){var r=e.touches(n);return o=t.k,r.forEach(function(e){e.identifier in i&&(i[e.identifier]=S(e))}),r}function y(){var r=e.event.target;e.select(r).on(a,b).on(f,w),c.push(r);var o=e.event.changedTouches;for(var u=0,l=o.length;u<l;++u)i[o[u].identifier]=null;var h=g(),p=Date.now();if(h.length===1){if(p-v<500){var d=h[0];C(n,d,i[d.identifier],Math.floor(Math.log(t.k)/Math.LN2)+1),I()}v=p}else if(h.length>1){var d=h[0],m=h[1],y=d[0]-m[0],E=d[1]-m[1];s=y*y+E*E}}function b(){var t=e.touches(n),u,a,f,l;mt(n);for(var c=0,h=t.length;c<h;++c,l=null){f=t[c];if(l=i[f.identifier]){if(a)break;u=f,a=l}}if(l){var p=(p=f[0]-u[0])*p+(p=f[1]-u[1])*p,d=s&&Math.sqrt(p/s);u=[(u[0]+f[0])/2,(u[1]+f[1])/2],a=[(a[0]+l[0])/2,(a[1]+l[1])/2],T(d*o)}v=null,N(u,a),A(r)}function w(){if(e.event.touches.length){var t=e.event.changedTouches;for(var n=0,s=t.length;n<s;++n)delete i[t[n].identifier];for(var o in i)return void g()}e.selectAll(c).on(u,null),h.on(l,M).on(d,_),p(),O(r)}var n=this,r=m.of(n,arguments),i={},s=0,o,u=".zoom-"+e.event.changedTouches[0].identifier,a="touchmove"+u,f="touchend"+u,c=[],h=e.select(n),p=Tt();y(),L(r),h.on(l,null).on(d,y)}function D(){var s=m.of(this,arguments);p?clearTimeout(p):(n=S(r=i||e.mouse(this)),mt(this),L(s)),p=setTimeout(function(){p=null,O(s)},50),I(),T(Math.pow(2,Qt()*.002)*t.k),N(r,n),A(s)}function P(){var n=e.mouse(this),r=Math.log(t.k)/Math.LN2;C(this,n,S(n),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var t={x:0,y:0,k:1},n,r,i,o=[960,500],u=Kt,a=250,f=0,l="mousedown.zoom",c="mousemove.zoom",h="mouseup.zoom",p,d="touchstart.zoom",v,m=R(E,"zoomstart","zoom","zoomend"),g,y,b,w;return E.event=function(n){n.each(function(){var n=m.of(this,arguments),i=t;Of?e.select(this).transition().each("start.zoom",function(){t=this.__chart__||{x:0,y:0,k:1},L(n)}).tween("zoom:zoom",function(){var s=o[0],u=o[1],a=r?r[0]:s/2,f=r?r[1]:u/2,l=e.interpolateZoom([(a-t.x)/t.k,(f-t.y)/t.k,s/t.k],[(a-i.x)/i.k,(f-i.y)/i.k,s/i.k]);return function(e){var r=l(e),i=s/r[2];this.__chart__=t={x:a-r[0]*i,y:f-r[1]*i,k:i},A(n)}}).each("interrupt.zoom",function(){O(n)}).each("end.zoom",function(){O(n)}):(this.__chart__=t,L(n),A(n),O(n))})},E.translate=function(e){return arguments.length?(t={x:+e[0],y:+e[1],k:t.k},k(),E):[t.x,t.y]},E.scale=function(e){return arguments.length?(t={x:t.x,y:t.y,k:+e},k(),E):t.k},E.scaleExtent=function(e){return arguments.length?(u=e==null?Kt:[+e[0],+e[1]],E):u},E.center=function(e){return arguments.length?(i=e&&[+e[0],+e[1]],E):i},E.size=function(e){return arguments.length?(o=e&&[+e[0],+e[1]],E):o},E.duration=function(e){return arguments.length?(a=+e,E):a},E.x=function(e){return arguments.length?(y=e,g=e.copy(),t={x:0,y:0,k:1},E):y},E.y=function(e){return arguments.length?(w=e,b=e.copy(),t={x:0,y:0,k:1},E):w},e.rebind(E,m,"on")};var Kt=[0,Infinity],Qt,Gt="onwheel"in r?(Qt=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in r?(Qt=function(){return e.event.wheelDelta},"mousewheel"):(Qt=function(){return-e.event.detail},"MozMousePixelScroll");e.color=Yt,Yt.prototype.toString=function(){return this.rgb()+""},e.hsl=Zt;var en=Zt.prototype=new Yt;en.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Zt(this.h,this.s,this.l/e)},en.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Zt(this.h,this.s,e*this.l)},en.rgb=function(){return tn(this.h,this.s,this.l)},e.hcl=nn;var rn=nn.prototype=new Yt;rn.brighter=function(e){return new nn(this.h,this.c,Math.min(100,this.l+un*(arguments.length?e:1)))},rn.darker=function(e){return new nn(this.h,this.c,Math.max(0,this.l-un*(arguments.length?e:1)))},rn.rgb=function(){return sn(this.h,this.c,this.l).rgb()},e.lab=on;var un=18,an=.95047,fn=1,ln=1.08883,cn=on.prototype=new Yt;cn.brighter=function(e){return new on(Math.min(100,this.l+un*(arguments.length?e:1)),this.a,this.b)},cn.darker=function(e){return new on(Math.max(0,this.l-un*(arguments.length?e:1)),this.a,this.b)},cn.rgb=function(){return hn(this.l,this.a,this.b)},e.rgb=gn;var wn=gn.prototype=new Yt;wn.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?new gn(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new gn(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e)))},wn.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new gn(e*this.r,e*this.g,e*this.b)},wn.hsl=function(){return xn(this.r,this.g,this.b)},wn.toString=function(){return"#"+En(this.r)+En(this.g)+En(this.b)};var kn=e.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});kn.forEach(function(e,t){kn.set(e,yn(t))}),e.functor=Ln,e.xhr=On(An),e.dsv=function(e,t){function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=Mn(e,t,n==null?s:o(n),r);return i.row=function(e){return arguments.length?i.response((n=e)==null?s:o(e)):n},i}function s(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function u(t){return t.map(a).join(e)}function a(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);return i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){function c(){if(u>=o)return i;if(l)return l=!1,n;var t=u;if(e.charCodeAt(t)===34){var s=t;while(s++<o)if(e.charCodeAt(s)===34){if(e.charCodeAt(s+1)!==34)break;++s}u=s+2;var a=e.charCodeAt(s+1);return a===13?(l=!0,e.charCodeAt(s+2)===10&&++u):a===10&&(l=!0),e.slice(t+1,s).replace(/""/g,'"')}while(u<o){var a=e.charCodeAt(u++),f=1;if(a===10)l=!0;else if(a===13)l=!0,e.charCodeAt(u)===10&&(++u,++f);else if(a!==r)continue;return e.slice(t,u-f)}return e.slice(t)}var n={},i={},s=[],o=e.length,u=0,a=0,f,l;while((f=c())!==i){var h=[];while(f!==n&&f!==i)h.push(f),f=c();if(t&&(h=t(h,a++))==null)continue;s.push(h)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new _,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(a).join(e)].concat(t.map(function(t){return r.map(function(e){return a(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(u).join("\n")},i},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("	","text/tab-separated-values");var Pn,Hn,Bn,jn,Fn,In=s[P(s,"requestAnimationFrame")]||function(e){setTimeout(e,17)};e.timer=function(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i=n+t,s={c:e,t:i,f:!1,n:null};Hn?Hn.n=s:Pn=s,Hn=s,Bn||(jn=clearTimeout(jn),Bn=1,In(qn))},e.timer.flush=function(){Rn(),Un()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Wn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Xn);e.formatPrefix=function(t,n){var r=0;return t&&(t<0&&(t*=-1),n&&(t=e.round(t,zn(t,n))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,Math.floor((r-1)/3)*3))),Wn[8+r/3]};var $n=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Jn=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,n){return(t=e.round(t,zn(t,n))).toFixed(Math.max(0,Math.min(20,zn(t*(1+1e-15),n))))}}),Qn=e.time={},Gn=Date;Yn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Zn.setUTCDate.apply(this._,arguments)},setDay:function(){Zn.setUTCDay.apply(this._,arguments)},setFullYear:function(){Zn.setUTCFullYear.apply(this._,arguments)},setHours:function(){Zn.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Zn.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Zn.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Zn.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Zn.setUTCSeconds.apply(this._,arguments)},setTime:function(){Zn.setTime.apply(this._,arguments)}};var Zn=Date.prototype;Qn.year=er(function(e){return e=Qn.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),Qn.years=Qn.year.range,Qn.years.utc=Qn.year.utc.range,Qn.day=er(function(e){var t=new Gn(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),Qn.days=Qn.day.range,Qn.days.utc=Qn.day.utc.range,Qn.dayOfYear=function(e){var t=Qn.year(e);return Math.floor((e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=Qn[e]=er(function(e){return(e=Qn.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+Math.floor(t)*7)},function(e){var n=Qn.year(e).getDay();return Math.floor((Qn.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});Qn[e+"s"]=n.range,Qn[e+"s"].utc=n.utc.range,Qn[e+"OfYear"]=function(e){var n=Qn.year(e).getDay();return Math.floor((Qn.dayOfYear(e)+(n+t)%7)/7)}}),Qn.week=Qn.sunday,Qn.weeks=Qn.sunday.range,Qn.weeks.utc=Qn.sunday.utc.range,Qn.weekOfYear=Qn.sundayOfYear;var rr={"-":"",_:" ",0:"0"},ir=/^\s*\d+/,sr=/^%/;e.locale=function(e){return{numberFormat:Vn(e),timeFormat:nr(e)}};var Cr=e.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});e.format=Cr.numberFormat,e.geo={},kr.prototype={s:0,t:0,add:function(e){Ar(e,this.t,Lr),Ar(Lr.s,this.s,this),this.s?this.t+=Lr.t:this.s=Lr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Lr=new kr;e.geo.stream=function(e,t){e&&Mr.hasOwnProperty(e.type)?Mr[e.type](e,t):Or(e,t)};var Mr={Feature:function(e,t){Or(e.geometry,t)},FeatureCollection:function(e,t){var n=e.features,r=-1,i=n.length;while(++r<i)Or(n[r].geometry,t)}},_r={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Dr(e.coordinates,t,0)},MultiLineString:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Dr(n[r],t,0)},Polygon:function(e,t){Pr(e.coordinates,t)},MultiPolygon:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Pr(n[r],t)},GeometryCollection:function(e,t){var n=e.geometries,r=-1,i=n.length;while(++r<i)Or(n[r],t)}};e.geo.area=function(t){return Hr=0,e.geo.stream(t,jr),Hr};var Hr,Br=new kr,jr={sphere:function(){Hr+=4*_t},point:B,lineStart:B,lineEnd:B,polygonStart:function(){Br.reset(),jr.lineStart=Fr},polygonEnd:function(){var e=2*Br;Hr+=e<0?4*_t+e:e,jr.lineStart=jr.lineEnd=jr.point=B}};e.geo.bounds=function(){function p(e,s){l.push(c=[t=e,r=e]),s<n&&(n=s),s>i&&(i=s)}function d(e,o){var u=Ir([e*Bt,o*Bt]);if(a){var f=Rr(a,u),l=[f[1],-f[0],0],c=Rr(l,f);Wr(c),c=Xr(c);var h=e-s,d=h>0?1:-1,v=c[0]*jt*d,m=b(h)>180;if(m^(d*s<v&&v<d*e)){var g=c[1]*jt;g>i&&(i=g)}else if(v=(v+360)%360-180,m^(d*s<v&&v<d*e)){var g=-c[1]*jt;g<n&&(n=g)}else o<n&&(n=o),o>i&&(i=o);m?e<s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e):r>=t?(e<t&&(t=e),e>r&&(r=e)):e>s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e)}else p(e,o);a=u,s=e}function v(){h.point=d}function m(){c[0]=t,c[1]=r,h.point=p,a=null}function g(e,t){if(a){var n=e-s;f+=b(n)>180?n+(n>0?360:-360):n}else o=e,u=t;jr.point(e,t),d(e,t)}function y(){jr.lineStart()}function w(){g(o,u),jr.lineEnd(),b(f)>Ot&&(t=-(r=180)),c[0]=t,c[1]=r,a=null}function E(e,t){return(t-=e)<0?t+360:t}function S(e,t){return e[0]-t[0]}function x(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var t,n,r,i,s,o,u,a,f,l,c,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=y,h.lineEnd=w,f=0,jr.polygonStart()},polygonEnd:function(){jr.polygonEnd(),h.point=p,h.lineStart=v,h.lineEnd=m,Br<0?(t=-(r=180),n=-(i=90)):f>Ot?i=90:f<-Ot&&(n=-90),c[0]=t,c[1]=r}};return function(s){i=r=-(t=n=Infinity),l=[],e.geo.stream(s,h);var o=l.length;if(o){l.sort(S);for(var u=1,a=l[0],f,p=[a];u<o;++u)f=l[u],x(f[0],a)||x(f[1],a)?(E(a[0],f[1])>E(a[0],a[1])&&(a[1]=f[1]),E(f[0],a[1])>E(a[0],a[1])&&(a[0]=f[0])):p.push(a=f);var d=-Infinity,v;for(var o=p.length-1,u=0,a=p[o],f;u<=o;a=f,++u)f=p[u],(v=E(a[1],f[0]))>d&&(d=v,t=f[0],r=a[1])}return l=c=null,t===Infinity||n===Infinity?[[NaN,NaN],[NaN,NaN]]:[[t,n],[r,i]]}}(),e.geo.centroid=function(t){$r=Jr=Kr=Qr=Gr=Yr=Zr=ei=ti=ni=ri=0,e.geo.stream(t,ii);var n=ti,r=ni,i=ri,s=n*n+r*r+i*i;if(s<Mt){n=Yr,r=Zr,i=ei,Jr<Ot&&(n=Kr,r=Qr,i=Gr),s=n*n+r*r+i*i;if(s<Mt)return[NaN,NaN]}return[Math.atan2(r,n)*jt,Rt(i/Math.sqrt(s))*jt]};var $r,Jr,Kr,Qr,Gr,Yr,Zr,ei,ti,ni,ri,ii={sphere:B,point:si,lineStart:ui,lineEnd:ai,polygonStart:function(){ii.lineStart=fi},polygonEnd:function(){ii.lineStart=ui}},bi=vi(ci,wi,Si,[-_t,-_t/2]),Ci=1e9;e.geo.clipExtent=function(){var e,t,n,r,i,s,o={stream:function(e){return i&&(i.valid=!1),i=s(e),i.valid=!0,i},extent:function(u){return arguments.length?(s=ki(e=+u[0][0],t=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),o):[[e,t],[n,r]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return Li(Ai)}).raw=Ai,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-0.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){function f(e){var t=e[0],n=e[1];return i=null,(o(t,n),i)||(u(t,n),i)||a(t,n),i}var t=e.geo.albers(),n=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),r=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i,s={point:function(e,t){i=[e,t]}},o,u,a;return f.invert=function(e){var i=t.scale(),s=t.translate(),o=(e[0]-s[0])/i,u=(e[1]-s[1])/i;return(u>=.12&&u<.234&&o>=-0.425&&o<-0.214?n:u>=.166&&u<.234&&o>=-0.214&&o<-0.115?r:t).invert(e)},f.stream=function(e){var i=t.stream(e),s=n.stream(e),o=r.stream(e);return{point:function(e,t){i.point(e,t),s.point(e,t),o.point(e,t)},sphere:function(){i.sphere(),s.sphere(),o.sphere()},lineStart:function(){i.lineStart(),s.lineStart(),o.lineStart()},lineEnd:function(){i.lineEnd(),s.lineEnd(),o.lineEnd()},polygonStart:function(){i.polygonStart(),s.polygonStart(),o.polygonStart()},polygonEnd:function(){i.polygonEnd(),s.polygonEnd(),o.polygonEnd()}}},f.precision=function(e){return arguments.length?(t.precision(e),n.precision(e),r.precision(e),f):t.precision()},f.scale=function(e){return arguments.length?(t.scale(e),n.scale(e*.35),r.scale(e),f.translate(t.translate())):t.scale()},f.translate=function(e){if(!arguments.length)return t.translate();var i=t.scale(),l=+e[0],c=+e[1];return o=t.translate(e).clipExtent([[l-.455*i,c-.238*i],[l+.455*i,c+.238*i]]).stream(s).point,u=n.translate([l-.307*i,c+.201*i]).clipExtent([[l-.425*i+Ot,c+.12*i+Ot],[l-.214*i-Ot,c+.234*i-Ot]]).stream(s).point,a=r.translate([l-.205*i,c+.212*i]).clipExtent([[l-.214*i+Ot,c+.166*i+Ot],[l-.115*i-Ot,c+.234*i-Ot]]).stream(s).point,f},f.scale(1070)};var Oi,Mi,_i={point:B,lineStart:B,lineEnd:B,polygonStart:function(){Mi=0,_i.lineStart=Di},polygonEnd:function(){_i.lineStart=_i.lineEnd=_i.point=B,Oi+=b(Mi/2)}},Pi,Hi,Bi,ji,Fi={point:Ii,lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B},Ui={point:zi,lineStart:Wi,lineEnd:Xi,polygonStart:function(){Ui.lineStart=Vi},polygonEnd:function(){Ui.point=zi,Ui.lineStart=Wi,Ui.lineEnd=Xi}};e.geo.path=function(){function u(n){if(n){typeof t=="function"&&s.pointRadius(+t.apply(this,arguments));if(!o||!o.valid)o=i(s);e.geo.stream(n,o)}return s.result()}function a(){return o=null,u}var t=4.5,n,r,i,s,o;return u.area=function(t){return Oi=0,e.geo.stream(t,i(_i)),Oi},u.centroid=function(t){return Kr=Qr=Gr=Yr=Zr=ei=ti=ni=ri=0,e.geo.stream(t,i(Ui)),ri?[ti/ri,ni/ri]:ei?[Yr/ei,Zr/ei]:Gr?[Kr/Gr,Qr/Gr]:[NaN,NaN]},u.bounds=function(t){return Bi=ji=-(Pi=Hi=Infinity),e.geo.stream(t,i(Fi)),[[Pi,Hi],[Bi,ji]]},u.projection=function(e){return arguments.length?(i=(n=e)?e.stream||Ki(e):An,a()):n},u.context=function(e){return arguments.length?(s=(r=e)==null?new qi:new $i(e),typeof t!="function"&&s.pointRadius(t),a()):r},u.pointRadius=function(e){return arguments.length?(t=typeof e=="function"?e:(s.pointRadius(+e),+e),u):t},u.projection(e.geo.albersUsa()).context(null)},e.geo.transform=function(e){return{stream:function(t){var n=new Qi(t);for(var r in e)n[r]=e[r];return n}}},Qi.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},e.geo.projection=Yi,e.geo.projectionMutator=Zi,(e.geo.equirectangular=function(){return Yi(ts)}).raw=ts.invert=ts,e.geo.rotation=function(e){function t(t){return t=e(t[0]*Bt,t[1]*Bt),t[0]*=jt,t[1]*=jt,t}return e=rs(e[0]%360*Bt,e[1]*Bt,e.length>2?e[2]*Bt:0),t.invert=function(t){return t=e.invert(t[0]*Bt,t[1]*Bt),t[0]*=jt,t[1]*=jt,t},t},ns.invert=ts,e.geo.circle=function(){function i(){var t=typeof e=="function"?e.apply(this,arguments):e,n=rs(-t[0]*Bt,-t[1]*Bt,0).invert,i=[];return r(null,null,1,{point:function(e,t){i.push(e=n(e,t)),e[0]*=jt,e[1]*=jt}}),{type:"Polygon",coordinates:[i]}}var e=[0,0],t,n=6,r;return i.origin=function(t){return arguments.length?(e=t,i):e},i.angle=function(e){return arguments.length?(r=us((t=+e)*Bt,n*Bt),i):t},i.precision=function(e){return arguments.length?(r=us(t*Bt,(n=+e)*Bt),i):n},i.angle(90)},e.geo.distance=function(e,t){var n=(t[0]-e[0])*Bt,r=e[1]*Bt,i=t[1]*Bt,s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),a=Math.cos(r),f=Math.sin(i),l=Math.cos(i),c;return Math.atan2(Math.sqrt((c=l*s)*c+(c=a*f-u*l*o)*c),u*f+a*l*o)},e.geo.graticule=function(){function y(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(Math.ceil(i/c)*c,r,c).map(v).concat(e.range(Math.ceil(a/h)*h,u,h).map(m)).concat(e.range(Math.ceil(n/f)*f,t,f).filter(function(e){return b(e%c)>Ot}).map(p)).concat(e.range(Math.ceil(o/l)*l,s,l).filter(function(e){return b(e%h)>Ot}).map(d))}var t,n,r,i,s,o,u,a,f=10,l=f,c=90,h=360,p,d,v,m,g=2.5;return y.lines=function(){return w().map(function(e){return{type:"LineString",coordinates:e}})},y.outline=function(){return{type:"Polygon",coordinates:[v(i).concat(m(u).slice(1),v(r).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],a=+e[0][1],u=+e[1][1],i>r&&(e=i,i=r,r=e),a>u&&(e=a,a=u,u=e),y.precision(g)):[[i,a],[r,u]]},y.minorExtent=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],s=+e[1][1],n>t&&(e=n,n=t,t=e),o>s&&(e=o,o=s,s=e),y.precision(g)):[[n,o],[t,s]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(c=+e[0],h=+e[1],y):[c,h]},y.minorStep=function(e){return arguments.length?(f=+e[0],l=+e[1],y):[f,l]},y.precision=function(e){return arguments.length?(g=+e,p=fs(o,s,90),d=ls(n,t,g),v=fs(a,u,90),m=ls(i,r,g),y):g},y.majorExtent([[-180,-90+Ot],[180,90-Ot]]).minorExtent([[-180,-80-Ot],[180,80+Ot]])},e.geo.greatArc=function(){function s(){return{type:"LineString",coordinates:[n||t.apply(this,arguments),i||r.apply(this,arguments)]}}var t=cs,n,r=hs,i;return s.distance=function(){return e.geo.distance(n||t.apply(this,arguments),i||r.apply(this,arguments))},s.source=function(e){return arguments.length?(t=e,n=typeof e=="function"?null:e,s):t},s.target=function(e){return arguments.length?(r=e,i=typeof e=="function"?null:e,s):r},s.precision=function(){return arguments.length?s:0},s},e.geo.interpolate=function(e,t){return ps(e[0]*Bt,e[1]*Bt,t[0]*Bt,t[1]*Bt)},e.geo.length=function(t){return ds=0,e.geo.stream(t,vs),ds};var ds,vs={sphere:B,point:B,lineStart:ms,lineEnd:B,polygonStart:B,polygonEnd:B},ys=gs(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(e.geo.azimuthalEqualArea=function(){return Yi(ys)}).raw=ys;var bs=gs(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},An);(e.geo.azimuthalEquidistant=function(){return Yi(bs)}).raw=bs,(e.geo.conicConformal=function(){return Li(ws)}).raw=ws,(e.geo.conicEquidistant=function(){return Li(Es)}).raw=Es;var Ss=gs(function(e){return 1/e},Math.atan);(e.geo.gnomonic=function(){return Yi(Ss)}).raw=Ss,xs.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Ht]},(e.geo.mercator=function(){return Ts(xs)}).raw=xs;var Ns=gs(function(){return 1},Math.asin);(e.geo.orthographic=function(){return Yi(Ns)}).raw=Ns;var Cs=gs(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(e.geo.stereographic=function(){return Yi(Cs)}).raw=Cs,ks.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Ht]},(e.geo.transverseMercator=function(){var e=Ts(ks),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=ks,e.geom={},e.geom.hull=function(e){function r(e){if(e.length<3)return[];var r=Ln(t),i=Ln(n),s,o=e.length,u=[],a=[];for(s=0;s<o;s++)u.push([+r.call(this,e[s],s),+i.call(this,e[s],s),s]);u.sort(Ms);for(s=0;s<o;s++)a.push([u[s][0],-u[s][1]]);var f=Os(u),l=Os(a),c=l[0]===f[0],h=l[l.length-1]===f[f.length-1],p=[];for(s=f.length-1;s>=0;--s)p.push(e[u[f[s]][2]]);for(s=+c;s<l.length-h;++s)p.push(e[u[l[s]][2]]);return p}var t=Ls,n=As;return arguments.length?r(e):(r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r)},e.geom.polygon=function(e){return z(e,_s),e};var _s=e.geom.polygon.prototype=[];_s.area=function(){var e=-1,t=this.length,n,r=this[t-1],i=0;while(++e<t)n=r,r=this[e],i+=n[1]*r[0]-n[0]*r[1];return i*.5},_s.centroid=function(e){var t=-1,n=this.length,r=0,i=0,s,o=this[n-1],u;arguments.length||(e=-1/(6*this.area()));while(++t<n)s=o,o=this[t],u=s[0]*o[1]-o[0]*s[1],r+=(s[0]+o[0])*u,i+=(s[1]+o[1])*u;return[r*e,i*e]},_s.clip=function(e){var t,n=Hs(e),r=-1,i=this.length-Hs(this),s,o,u=this[i-1],a,f,l;while(++r<i){t=e.slice(),e.length=0,a=this[r],f=t[(o=t.length-n)-1],s=-1;while(++s<o)l=t[s],Ds(l,u,a)?(Ds(f,u,a)||e.push(Ps(f,l,u,a)),e.push(l)):Ds(f,u,a)&&e.push(Ps(f,l,u,a)),f=l;n&&e.push(e[0]),u=a}return e};var Bs,js,Fs,Is=[],qs,Rs,Us=[];Qs.prototype.prepare=function(){var e=this.edges,t=e.length,n;while(t--)n=e[t].edge,(!n.b||!n.a)&&e.splice(t,1);return e.sort(Ys),e.length},ao.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},fo.prototype={insert:function(e,t){var n,r,i;if(e){t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t;if(e.R){e=e.R;while(e.L)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=po(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);t.L=t.R=null,t.U=n,t.C=!0,e=t;while(n&&n.C)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(co(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ho(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(ho(this,n),e=n,n=e.U),n.C=!1,r.C=!0,co(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,i=e.R,s,o;r?i?s=po(i):s=r:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,r&&i?(o=s.C,s.C=e.C,s.L=r,r.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(o=e.C,e=s),e&&(e.U=t);if(o)return;if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){n=t.R,n.C&&(n.C=!1,t.C=!0,co(this,t),n=t.R);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.R||!n.R.C)n.L.C=!1,n.C=!0,ho(this,n),n=t.R;n.C=t.C,t.C=n.R.C=!1,co(this,t),e=this._;break}}else{n=t.L,n.C&&(n.C=!1,t.C=!0,ho(this,t),n=t.L);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.L||!n.L.C)n.R.C=!1,n.C=!0,co(this,n),n=t.L;n.C=t.C,t.C=n.L.C=!1,ho(this,t),e=this._;break}}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},e.geom.voronoi=function(e){function o(e){var t=new Array(e.length),n=s[0][0],r=s[0][1],i=s[1][0],o=s[1][1];return vo(u(e),s).cells.forEach(function(s,u){var a=s.edges,f=s.site,l=t[u]=a.length?a.map(function(e){var t=e.start();return[t.x,t.y]}):f.x>=n&&f.x<=i&&f.y>=r&&f.y<=o?[[n,o],[i,o],[i,r],[n,r]]:[];l.point=e[u]}),t}function u(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/Ot)*Ot,y:Math.round(i(e,t)/Ot)*Ot,i:t}})}var t=Ls,n=As,r=t,i=n,s=go;return e?o(e):(o.links=function(e){return vo(u(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return vo(u(e)).cells.forEach(function(n,r){var i=n.site,s=n.edges.sort(Ys),o=-1,u=s.length,a,f,l=s[u-1].edge,c=l.l===i?l.r:l.l;while(++o<u)a=l,f=c,l=s[o].edge,c=l.l===i?l.r:l.l,r<f.i&&r<c.i&&yo(i,f,c)<0&&t.push([e[r],e[f.i],e[c.i]])}),t},o.x=function(e){return arguments.length?(r=Ln(t=e),o):t},o.y=function(e){return arguments.length?(i=Ln(n=e),o):n},o.clipExtent=function(e){return arguments.length?(s=e==null?go:e,o):s===go?null:s},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):s===go?null:s&&s[1]},o)};var go=[[-1e6,-1e6],[1e6,1e6]];e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,n,r,i){function a(e){function T(e,t,n,r,i,s,o,u){if(isNaN(n)||isNaN(r))return;if(e.leaf){var a=e.x,f=e.y;if(a!=null)if(b(a-n)+b(f-r)<.01)N(e,t,n,r,i,s,o,u);else{var l=e.point;e.x=e.y=e.point=null,N(e,l,a,f,i,s,o,u),N(e,t,n,r,i,s,o,u)}else e.x=n,e.y=r,e.point=t}else N(e,t,n,r,i,s,o,u)}function N(e,t,n,r,i,s,o,u){var a=(i+o)*.5,f=(s+u)*.5,l=n>=a,c=r>=f,h=c<<1|l;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=Eo()),l?i=a:o=a,c?s=f:u=f,T(e,t,n,r,i,s,o,u)}var a,f=Ln(s),l=Ln(o),c,h,p,d,v,m,g,y;if(t!=null)v=t,m=n,g=r,y=i;else{g=y=-(v=m=Infinity),c=[],h=[],d=e.length;if(u)for(p=0;p<d;++p)a=e[p],a.x<v&&(v=a.x),a.y<m&&(m=a.y),a.x>g&&(g=a.x),a.y>y&&(y=a.y),c.push(a.x),h.push(a.y);else for(p=0;p<d;++p){var w=+f(a=e[p],p),E=+l(a,p);w<v&&(v=w),E<m&&(m=E),w>g&&(g=w),E>y&&(y=E),c.push(w),h.push(E)}}var S=g-v,x=y-m;S>x?y=m+S:g=v+x;var C=Eo();C.add=function(e){T(C,e,+f(e,++p),+l(e,p),v,m,g,y)},C.visit=function(e){So(e,C,v,m,g,y)},C.find=function(e){return xo(C,e[0],e[1],v,m,g,y)},p=-1;if(t==null){while(++p<d)T(C,e[p],c[p],h[p],v,m,g,y);--p}else e.forEach(C.add);return c=h=e=a=null,C}var s=Ls,o=As,u;return(u=arguments.length)?(s=bo,o=wo,u===3&&(i=n,r=t,n=t=0),a(e)):(a.x=function(e){return arguments.length?(s=e,a):s},a.y=function(e){return arguments.length?(o=e,a):o},a.extent=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),a):t==null?null:[[t,n],[r,i]]},a.size=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),a):t==null?null:[r-t,i-n]},a)},e.interpolateRgb=To,e.interpolateObject=No,e.interpolateNumber=Co,e.interpolateString=ko;var Lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ao=new RegExp(Lo.source,"g");e.interpolate=Oo,e.interpolators=[function(e,t){var n=typeof t;return(n==="string"?kn.has(t)||/^(#|rgb\(|hsl\()/.test(t)?To:ko:t instanceof Yt?To:Array.isArray(t)?Mo:n==="object"&&isNaN(t)?No:Co)(e,t)}],e.interpolateArray=Mo;var _o=function(){return An},Do=e.map({linear:_o,poly:Ro,quad:function(){return Fo},cubic:function(){return Io},sin:function(){return Uo},exp:function(){return zo},circle:function(){return Wo},elastic:Xo,back:Vo,bounce:function(){return $o}}),Po=e.map({"in":An,out:Bo,"in-out":jo,"out-in":function(e){return jo(Bo(e))}});e.ease=function(e){var n=e.indexOf("-"),r=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return r=Do.get(r)||_o,i=Po.get(i)||An,Ho(i(r.apply(null,t.call(arguments,1))))},e.interpolateHcl=Jo,e.interpolateHsl=Ko,e.interpolateLab=Qo,e.interpolateRound=Go,e.transform=function(t){var n=r.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(e!=null){n.setAttribute("transform",e);var t=n.transform.baseVal.consolidate()}return new Yo(t?t.matrix:nu)})(t)},Yo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var nu={a:1,b:0,c:0,d:1,e:0,f:0};e.interpolateTransform=ru,e.layout={},e.layout.bundle=function(){return function(e){var t=[],n=-1,r=e.length;while(++n<r)t.push(ou(e[n]));return t}},e.layout.chord=function(){function l(){var t={},l=[],h=e.range(s),p=[],d,v,m,g,y;n=[],r=[],d=0,g=-1;while(++g<s){v=0,y=-1;while(++y<s)v+=i[g][y];l.push(v),p.push(e.range(s)),d+=v}u&&h.sort(function(e,t){return u(l[e],l[t])}),a&&p.forEach(function(e,t){e.sort(function(e,n){return a(i[t][e],i[t][n])})}),d=(Dt-o*s)/d,v=0,g=-1;while(++g<s){m=v,y=-1;while(++y<s){var b=h[g],w=p[b][y],E=i[b][w],S=v,x=v+=E*d;t[b+"-"+w]={index:b,subindex:w,startAngle:S,endAngle:x,value:E}}r[b]={index:b,startAngle:m,endAngle:v,value:(v-m)/d},v+=o}g=-1;while(++g<s){y=g-1;while(++y<s){var T=t[g+"-"+y],N=t[y+"-"+g];(T.value||N.value)&&n.push(T.value<N.value?{source:N,target:T}:{source:T,target:N})}}f&&c()}function c(){n.sort(function(e,t){return f((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var t={},n,r,i,s,o=0,u,a,f;return t.matrix=function(e){return arguments.length?(s=(i=e)&&i.length,n=r=null,t):i},t.padding=function(e){return arguments.length?(o=e,n=r=null,t):o},t.sortGroups=function(e){return arguments.length?(u=e,n=r=null,t):u},t.sortSubgroups=function(e){return arguments.length?(a=e,n=null,t):a},t.sortChords=function(e){return arguments.length?(f=e,n&&c(),t):f},t.chords=function(){return n||l(),n},t.groups=function(){return r||l(),r},t},e.layout.force=function(){function y(e){return function(t,n,r,i){if(t.point!==e){var s=t.cx-e.x,o=t.cy-e.y,u=i-n,a=s*s+o*o;if(u*u/h<a){if(a<l){var f=t.charge/a;e.px-=s*f,e.py-=o*f}return!0}if(t.point&&a&&a<l){var f=t.pointCharge/a;e.px-=s*f,e.py-=o*f}}return!t.charge}}function b(n){n.px=e.event.x,n.py=e.event.y,t.resume()}var t={},n=e.dispatch("start","tick","end"),r=[1,1],i,s,o=.9,u=du,a=vu,f=-30,l=mu,c=.1,h=.64,p=[],d=[],v,m,g;return t.tick=function(){if((s*=.99)<.005)return n.end({type:"end",alpha:s=0}),!0;var t=p.length,i=d.length,u,a,l,h,b,w,E,S,x;for(a=0;a<i;++a){l=d[a],h=l.source,b=l.target,S=b.x-h.x,x=b.y-h.y;if(w=S*S+x*x)w=s*m[a]*((w=Math.sqrt(w))-v[a])/w,S*=w,x*=w,b.x-=S*(E=h.weight/(b.weight+h.weight)),b.y-=x*E,h.x+=S*(E=1-E),h.y+=x*E}if(E=s*c){S=r[0]/2,x=r[1]/2,a=-1;if(E)while(++a<t)l=p[a],l.x+=(S-l.x)*E,l.y+=(x-l.y)*E}if(f){pu(u=e.geom.quadtree(p),s,g),a=-1;while(++a<t)(l=p[a]).fixed||u.visit(y(l))}a=-1;while(++a<t)l=p[a],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*o,l.y-=(l.py-(l.py=l.y))*o);n.tick({type:"tick",alpha:s})},t.nodes=function(e){return arguments.length?(p=e,t):p},t.links=function(e){return arguments.length?(d=e,t):d},t.size=function(e){return arguments.length?(r=e,t):r},t.linkDistance=function(e){return arguments.length?(u=typeof e=="function"?e:+e,t):u},t.distance=t.linkDistance,t.linkStrength=function(e){return arguments.length?(a=typeof e=="function"?e:+e,t):a},t.friction=function(e){return arguments.length?(o=+e,t):o},t.charge=function(e){return arguments.length?(f=typeof e=="function"?e:+e,t):f},t.chargeDistance=function(e){return arguments.length?(l=e*e,t):Math.sqrt(l)},t.gravity=function(e){return arguments.length?(c=+e,t):c},t.theta=function(e){return arguments.length?(h=e*e,t):Math.sqrt(h)},t.alpha=function(r){return arguments.length?(r=+r,s?r>0?s=r:s=0:r>0&&(n.start({type:"start",alpha:s=r}),e.timer(t.tick)),t):s},t.start=function(){function h(t,r){if(!l){l=new Array(n);for(o=0;o<n;++o)l[o]=[];for(o=0;o<u;++o){var i=d[o];l[i.source.index].push(i.target),l[i.target.index].push(i.source)}}var s=l[e],o=-1,u=s.length,a;while(++o<u)if(!isNaN(a=s[o][t]))return a;return Math.random()*r}var e,n=p.length,i=d.length,s=r[0],o=r[1],l,c;for(e=0;e<n;++e)(c=p[e]).index=e,c.weight=0;for(e=0;e<i;++e)c=d[e],typeof c.source=="number"&&(c.source=p[c.source]),typeof c.target=="number"&&(c.target=p[c.target]),++c.source.weight,++c.target.weight;for(e=0;e<n;++e)c=p[e],isNaN(c.x)&&(c.x=h("x",s)),isNaN(c.y)&&(c.y=h("y",o)),isNaN(c.px)&&(c.px=c.x),isNaN(c.py)&&(c.py=c.y);v=[];if(typeof u=="function")for(e=0;e<i;++e)v[e]=+u.call(this,d[e],e);else for(e=0;e<i;++e)v[e]=u;m=[];if(typeof a=="function")for(e=0;e<i;++e)m[e]=+a.call(this,d[e],e);else for(e=0;e<i;++e)m[e]=a;g=[];if(typeof f=="function")for(e=0;e<n;++e)g[e]=+f.call(this,p[e],e);else for(e=0;e<n;++e)g[e]=f;return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){i||(i=e.behavior.drag().origin(An).on("dragstart.force",fu).on("drag.force",b).on("dragend.force",lu));if(!arguments.length)return i;this.on("mouseover.force",cu).on("mouseout.force",hu).call(i)},e.rebind(t,n,"on")};var du=20,vu=1,mu=Infinity;e.layout.hierarchy=function(){function r(i){var s=[i],o=[],u;i.depth=0;while((u=s.pop())!=null){o.push(u);if((f=t.call(r,u,u.depth))&&(a=f.length)){var a,f,l;while(--a>=0)s.push(l=f[a]),l.parent=u,l.depth=u.depth+1;n&&(u.value=0),u.children=f}else n&&(u.value=+n.call(r,u,u.depth)||0),delete u.children}return bu(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),o}var e=Su,t=wu,n=Eu;return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(yu(e,function(e){e.children&&(e.value=0)}),bu(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0);if(t=e.parent)t.value+=e.value})),e},r},e.layout.partition=function(){function r(e,t,n,i){var s=e.children;e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i;if(s&&(u=s.length)){var o=-1,u,a,f;n=e.value?n/e.value:0;while(++o<u)r(a=s[o],t,f=a.value*n,i),t+=f}}function i(e){var t=e.children,n=0;if(t&&(s=t.length)){var r=-1,s;while(++r<s)n=Math.max(n,i(t[r]))}return 1+n}function s(e,s){var o=t.call(this,e,s);return r(o[0],0,n[0],n[1]/i(o[0])),o}var t=e.layout.hierarchy(),n=[1,1];return s.size=function(e){return arguments.length?(n=e,s):n},gu(s,t)},e.layout.pie=function(){function o(u){var a=u.length,f=u.map(function(e,n){return+t.call(o,e,n)}),l=+(typeof r=="function"?r.apply(this,arguments):r),c=(typeof i=="function"?i.apply(this,arguments):i)-l,h=Math.min(Math.abs(c)/a,+(typeof s=="function"?s.apply(this,arguments):s)),p=h*(c<0?-1:1),d=(c-a*p)/e.sum(f),v=e.range(a),m=[],g;return n!=null&&v.sort(n===Tu?function(e,t){return f[t]-f[e]}:function(e,t){return n(u[e],u[t])}),v.forEach(function(e){m[e]={data:u[e],value:g=f[e],startAngle:l,endAngle:l+=g*d+p,padAngle:h}}),m}var t=Number,n=Tu,r=0,i=Dt,s=0;return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(n=e,o):n},o.startAngle=function(e){return arguments.length?(r=e,o):r},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(s=e,o):s},o};var Tu={};e.layout.stack=function(){function u(a,f){if(!(v=a.length))return a;var l=a.map(function(e,n){return t.call(u,e,n)}),c=l.map(function(e){return e.map(function(e,t){return[s.call(u,e,t),o.call(u,e,t)]})}),h=n.call(u,c,f);l=e.permute(l,h),c=e.permute(c,h);var p=r.call(u,c,f),d=l[0].length,v,m,g,y;for(g=0;g<d;++g){i.call(u,l[0][g],y=p[g],c[0][g][1]);for(m=1;m<v;++m)i.call(u,l[m][g],y+=c[m-1][g][1],c[m][g][1])}return a}var t=An,n=Ou,r=Mu,i=ku,s=Nu,o=Cu;return u.values=function(e){return arguments.length?(t=e,u):t},u.order=function(e){return arguments.length?(n=typeof e=="function"?e:Lu.get(e)||Ou,u):n},u.offset=function(e){return arguments.length?(r=typeof e=="function"?e:Au.get(e)||Mu,u):r},u.x=function(e){return arguments.length?(s=e,u):s},u.y=function(e){return arguments.length?(o=e,u):o},u.out=function(e){return arguments.length?(i=e,u):i},u};var Lu=e.map({"inside-out":function(t){var n=t.length,r,i,s=t.map(_u),o=t.map(Du),u=e.range(n).sort(function(e,t){return s[e]-s[t]}),a=0,f=0,l=[],c=[];for(r=0;r<n;++r)i=u[r],a<f?(a+=o[i],l.push(i)):(f+=o[i],c.push(i));return c.reverse().concat(l)},reverse:function(t){return e.range(t.length).reverse()},"default":Ou}),Au=e.map({silhouette:function(e){var t=e.length,n=e[0].length,r=[],i=0,s,o,u,a=[];for(o=0;o<n;++o){for(s=0,u=0;s<t;s++)u+=e[s][o][1];u>i&&(i=u),r.push(u)}for(o=0;o<n;++o)a[o]=(i-r[o])/2;return a},wiggle:function(e){var t=e.length,n=e[0],r=n.length,i,s,o,u,a,f,l,c,h,p=[];p[0]=c=h=0;for(s=1;s<r;++s){for(i=0,u=0;i<t;++i)u+=e[i][s][1];for(i=0,a=0,l=n[s][0]-n[s-1][0];i<t;++i){for(o=0,f=(e[i][s][1]-e[i][s-1][1])/(2*l);o<i;++o)f+=(e[o][s][1]-e[o][s-1][1])/l;a+=f*e[i][s][1]}p[s]=c-=u?a/u*l:0,c<h&&(h=c)}for(s=0;s<r;++s)p[s]-=h;return p},expand:function(e){var t=e.length,n=e[0].length,r=1/t,i,s,o,u=[];for(s=0;s<n;++s){for(i=0,o=0;i<t;i++)o+=e[i][s][1];if(o)for(i=0;i<t;i++)e[i][s][1]/=o;else for(i=0;i<t;i++)e[i][s][1]=r}for(s=0;s<n;++s)u[s]=0;return u},zero:Mu});e.layout.histogram=function(){function s(s,o){var u=[],a=s.map(n,this),f=r.call(this,a,o),l=i.call(this,f,a,o),c,o=-1,h=a.length,p=l.length-1,d=t?1:1/h,v;while(++o<p)c=u[o]=[],c.dx=l[o+1]-(c.x=l[o]),c.y=0;if(p>0){o=-1;while(++o<h)v=a[o],v>=f[0]&&v<=f[1]&&(c=u[e.bisect(l,v,1,p)-1],c.y+=d,c.push(s[o]))}return u}var t=!0,n=Number,r=ju,i=Hu;return s.value=function(e){return arguments.length?(n=e,s):n},s.range=function(e){return arguments.length?(r=Ln(e),s):r},s.bins=function(e){return arguments.length?(i=typeof e=="number"?function(t){return Bu(t,e)}:Ln(e),s):i},s.frequency=function(e){return arguments.length?(t=!!e,s):t},s},e.layout.pack=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a=r[0],f=r[1],l=i==null?Math.sqrt:typeof i=="function"?i:function(){return i};u.x=u.y=0,bu(u,function(e){e.r=+l(e.value)}),bu(u,Uu);if(n){var c=n*(i?1:Math.max(2*u.r/a,2*u.r/f))/2;bu(u,function(e){e.r+=c}),bu(u,Uu),bu(u,function(e){e.r-=c})}return Xu(u,a/2,f/2,i?1:1/Math.max(2*u.r/a,2*u.r/f)),o}var t=e.layout.hierarchy().sort(Fu),n=0,r=[1,1],i;return s.size=function(e){return arguments.length?(r=e,s):r},s.radius=function(e){return arguments.length?(i=e==null||typeof e=="function"?e:+e,s):i},s.padding=function(e){return arguments.length?(n=+e,s):n},gu(s,t)},e.layout.tree=function(){function s(e,s){var f=t.call(this,e,s),c=f[0],h=o(c);bu(h,u),h.parent.m=-h.z,yu(h,a);if(i)yu(c,l);else{var p=c,d=c,v=c;yu(c,function(e){e.x<p.x&&(p=e),e.x>d.x&&(d=e),e.depth>v.depth&&(v=e)});var m=n(p,d)/2-p.x,g=r[0]/(d.x+n(d,p)/2+m),y=r[1]/(v.depth||1);yu(c,function(e){e.x=(e.x+m)*g,e.y=e.depth*y})}return f}function o(e){var t={A:null,children:[e]},n=[t],r;while((r=n.pop())!=null)for(var i=r.children,s,o=0,u=i.length;o<u;++o)n.push((i[o]=s={_:i[o],parent:r,children:(s=i[o].children)&&s.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=s);return t.children[0]}function u(e){var t=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(t.length){Gu(e);var s=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+n(e._,i._),e.m=e.z-s):e.z=s}else i&&(e.z=i.z+n(e._,i._));e.parent.A=f(e,i,e.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function f(e,t,r){if(t){var i=e,s=e,o=t,u=i.parent.children[0],a=i.m,f=s.m,l=o.m,c=u.m,h;while(o=Ku(o),i=Ju(i),o&&i)u=Ju(u),s=Ku(s),s.a=e,h=o.z+l-i.z-a+n(o._,i._),h>0&&(Qu(Yu(o,e,r),e,h),a+=h,f+=h),l+=o.m,a+=i.m,c+=u.m,f+=s.m;o&&!Ku(s)&&(s.t=o,s.m+=l-f),i&&!Ju(u)&&(u.t=i,u.m+=a-c,r=e)}return r}function l(e){e.x*=r[0],e.y=e.depth*r[1]}var t=e.layout.hierarchy().sort(null).value(null),n=$u,r=[1,1],i=null;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null?l:null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)==null?null:l,s):i?r:null},gu(s,t)},e.layout.cluster=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a,f=0;bu(u,function(e){var t=e.children;t&&t.length?(e.x=ea(t),e.y=Zu(t)):(e.x=a?f+=n(e,a):0,e.y=0,a=e)});var l=ta(u),c=na(u),h=l.x-n(l,c)/2,p=c.x+n(c,l)/2;return bu(u,i?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-h)/(p-h)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),o}var t=e.layout.hierarchy().sort(null).value(null),n=$u,r=[1,1],i=!1;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)!=null,s):i?r:null},gu(s,t)},e.layout.treemap=function(){function l(e,t){var n=-1,r=e.length,i,s;while(++n<r)s=(i=e[n]).value*(t<0?0:t),i.area=isNaN(s)||s<=0?0:s}function c(e){var t=e.children;if(t&&t.length){var n=s(e),r=[],i=t.slice(),o,u=Infinity,f,h=a==="slice"?n.dx:a==="dice"?n.dy:a==="slice-dice"?e.depth&1?n.dy:n.dx:Math.min(n.dx,n.dy),v;l(i,n.dx*n.dy/e.value),r.area=0;while((v=i.length)>0)r.push(o=i[v-1]),r.area+=o.area,a!=="squarify"||(f=p(r,h))<=u?(i.pop(),u=f):(r.area-=r.pop().area,d(r,h,n,!1),h=Math.min(n.dx,n.dy),r.length=r.area=0,u=Infinity);r.length&&(d(r,h,n,!0),r.length=r.area=0),t.forEach(c)}}function h(e){var t=e.children;if(t&&t.length){var n=s(e),r=t.slice(),i,o=[];l(r,n.dx*n.dy/e.value),o.area=0;while(i=r.pop())o.push(i),o.area+=i.area,i.z!=null&&(d(o,i.z?n.dx:n.dy,n,!r.length),o.length=o.area=0);t.forEach(h)}}function p(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++o<u){if(!(r=e[o].area))continue;r<s&&(s=r),r>i&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*f/n,n/(t*s*f)):Infinity}function d(e,t,r,i){var s=-1,o=e.length,u=r.x,a=r.y,f=t?n(e.area/t):0,l;if(t==r.dx){if(i||f>r.dy)f=r.dy;while(++s<o)l=e[s],l.x=u,l.y=a,l.dy=f,u+=l.dx=Math.min(r.x+r.dx-u,f?n(l.area/f):0);l.z=!0,l.dx+=r.x+r.dx-u,r.y+=f,r.dy-=f}else{if(i||f>r.dx)f=r.dx;while(++s<o)l=e[s],l.x=u,l.y=a,l.dx=f,a+=l.dy=Math.min(r.y+r.dy-a,f?n(l.area/f):0);l.z=!1,l.dy+=r.y+r.dy-a,r.x+=f,r.dx-=f}}function v(e){var n=u||t(e),i=n[0];return i.x=0,i.y=0,i.dx=r[0],i.dy=r[1],u&&t.revalue(i),l([i],i.dx*i.dy/i.value),(u?h:c)(i),o&&(u=n),n}var t=e.layout.hierarchy(),n=Math.round,r=[1,1],i=null,s=ra,o=!1,u,a="squarify",f=.5*(1+Math.sqrt(5));return v.size=function(e){return arguments.length?(r=e,v):r},v.padding=function(e){function t(t){var n=e.call(v,t,t.depth);return n==null?ra(t):ia(t,typeof n=="number"?[n,n,n,n]:n)}function n(t){return ia(t,e)}if(!arguments.length)return i;var r;return s=(i=e)==null?ra:(r=typeof e)==="function"?t:r==="number"?(e=[e,e,e,e],n):n,v},v.round=function(e){return arguments.length?(n=e?Math.round:Number,v):n!=Number},v.sticky=function(e){return arguments.length?(o=e,u=null,v):o},v.ratio=function(e){return arguments.length?(f=e,v):f},v.mode=function(e){return arguments.length?(a=e+"",v):a},gu(v,t)},e.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do n=Math.random()*2-1,r=Math.random()*2-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=e.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},e.scale={};var la={floor:An,ceil:An};e.scale.linear=function(){return ha([0,1],[0,1],Oo,!1)};var ya={s:1,g:1,p:1,r:1,e:1};e.scale.log=function(){return Ea(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Sa=e.format(".0e"),xa={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};e.scale.pow=function(){return Ta(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return Ca([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(ka)},e.scale.category20=function(){return e.scale.ordinal().range(La)},e.scale.category20b=function(){return e.scale.ordinal().range(Aa)},e.scale.category20c=function(){return e.scale.ordinal().range(Oa)};var ka=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(bn),La=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(bn),Aa=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(bn),Oa=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(bn);e.scale.quantile=function(){return Ma([],[])},e.scale.quantize=function(){return _a(0,1,[0,1])},e.scale.threshold=function(){return Da([.5],[0,1])},e.scale.identity=function(){return Pa([0,1])},e.svg={},e.svg.arc=function(){function u(){var u=Math.max(0,+e.apply(this,arguments)),f=Math.max(0,+t.apply(this,arguments)),l=i.apply(this,arguments)-Ht,c=s.apply(this,arguments)-Ht,h=Math.abs(c-l),p=l>c?0:1;f<u&&(d=f,f=u,u=d);if(h>=Pt)return a(f,p)+(u?a(u,1-p):"")+"Z";var d,v,m,g,y=0,b=0,w,E,S,x,T,N,C,k,L=[];if(g=(+o.apply(this,arguments)||0)/2)m=r===Ba?Math.sqrt(u*u+f*f):+r.apply(this,arguments),p||(b*=-1),f&&(b=Rt(m/f*Math.sin(g))),u&&(y=Rt(m/u*Math.sin(g)));if(f){w=f*Math.cos(l+b),E=f*Math.sin(l+b),S=f*Math.cos(c-b),x=f*Math.sin(c-b);var A=Math.abs(c-l-2*b)<=_t?0:1;if(b&&Ua(w,E,S,x)===p^A){var O=(l+c)/2;w=f*Math.cos(O),E=f*Math.sin(O),S=x=null}}else w=E=0;if(u){T=u*Math.cos(c-y),N=u*Math.sin(c-y),C=u*Math.cos(l+y),k=u*Math.sin(l+y);var M=Math.abs(l-c+2*y)<=_t?0:1;if(y&&Ua(T,N,C,k)===1-p^M){var _=(l+c)/2;T=u*Math.cos(_),N=u*Math.sin(_),C=k=null}}else T=N=0;if((d=Math.min(Math.abs(f-u)/2,+n.apply(this,arguments)))>.001){v=u<f^p?0:1;var D=C==null?[T,N]:S==null?[w,E]:Ps([w,E],[C,k],[S,x],[T,N]),P=w-D[0],H=E-D[1],B=S-D[0],j=x-D[1],F=1/Math.sin(Math.acos((P*B+H*j)/(Math.sqrt(P*P+H*H)*Math.sqrt(B*B+j*j)))/2),I=Math.sqrt(D[0]*D[0]+D[1]*D[1]);if(S!=null){var q=Math.min(d,(f-I)/(F+1)),R=za(C==null?[T,N]:[C,k],[w,E],f,q,p),U=za([S,x],[T,N],f,q,p);d===q?L.push("M",R[0],"A",q,",",q," 0 0,",v," ",R[1],"A",f,",",f," 0 ",1-p^Ua(R[1][0],R[1][1],U[1][0],U[1][1]),",",p," ",U[1],"A",q,",",q," 0 0,",v," ",U[0]):L.push("M",R[0],"A",q,",",q," 0 1,",v," ",U[0])}else L.push("M",w,",",E);if(C!=null){var z=Math.min(d,(u-I)/(F-1)),W=za([w,E],[C,k],u,-z,p),X=za([T,N],S==null?[w,E]:[S,x],u,-z,p);d===z?L.push("L",X[0],"A",z,",",z," 0 0,",v," ",X[1],"A",u,",",u," 0 ",p^Ua(X[1][0],X[1][1],W[1][0],W[1][1]),",",1-p," ",W[1],"A",z,",",z," 0 0,",v," ",W[0]):L.push("L",X[0],"A",z,",",z," 0 0,",v," ",W[0])}else L.push("L",T,",",N)}else L.push("M",w,",",E),S!=null&&L.push("A",f,",",f," 0 ",A,",",p," ",S,",",x),L.push("L",T,",",N),C!=null&&L.push("A",u,",",u," 0 ",M,",",1-p," ",C,",",k);return L.push("Z"),L.join("")}function a(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+ -e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}var e=ja,t=Fa,n=Ha,r=Ba,i=Ia,s=qa,o=Ra;return u.innerRadius=function(t){return arguments.length?(e=Ln(t),u):e},u.outerRadius=function(e){return arguments.length?(t=Ln(e),u):t},u.cornerRadius=function(e){return arguments.length?(n=Ln(e),u):n},u.padRadius=function(e){return arguments.length?(r=e==Ba?Ba:Ln(e),u):r},u.startAngle=function(e){return arguments.length?(i=Ln(e),u):i},u.endAngle=function(e){return arguments.length?(s=Ln(e),u):s},u.padAngle=function(e){return arguments.length?(o=Ln(e),u):o},u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Ht;return[Math.cos(r)*n,Math.sin(r)*n]},u};var Ba="auto";e.svg.line=function(){return Wa(An)};var Xa=e.map({linear:Va,"linear-closed":$a,step:Ja,"step-before":Ka,"step-after":Qa,basis:nf,"basis-open":rf,"basis-closed":sf,bundle:of,cardinal:Za,"cardinal-open":Ga,"cardinal-closed":Ya,monotone:vf});Xa.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var af=[0,2/3,1/3,0],ff=[0,1/3,2/3,0],lf=[0,1/6,2/3,1/6];e.svg.line.radial=function(){var e=Wa(mf);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Ka.reverse=Qa,Qa.reverse=Ka,e.svg.area=function(){return gf(An)},e.svg.area.radial=function(){var e=gf(mf);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){function s(n,r){var i=o(this,e,n,r),s=o(this,t,n,r);return"M"+i.p0+a(i.r,i.p1,i.a1-i.a0)+(u(i,s)?f(i.r,i.p1,i.r,i.p0):f(i.r,i.p1,s.r,s.p0)+a(s.r,s.p1,s.a1-s.a0)+f(s.r,s.p1,i.r,i.p0))+"Z"}function o(e,t,s,o){var u=t.call(e,s,o),a=n.call(e,u,o),f=r.call(e,u,o)-Ht,l=i.call(e,u,o)-Ht;return{r:a,a0:f,a1:l,p0:[a*Math.cos(f),a*Math.sin(f)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function u(e,t){return e.a0==t.a0&&e.a1==t.a1}function a(e,t,n){return"A"+e+","+e+" 0 "+ +(n>_t)+",1 "+t}function f(e,t,n,r){return"Q 0,0 "+r}var e=cs,t=hs,n=yf,r=Ia,i=qa;return s.radius=function(e){return arguments.length?(n=Ln(e),s):n},s.source=function(t){return arguments.length?(e=Ln(t),s):e},s.target=function(e){return arguments.length?(t=Ln(e),s):t},s.startAngle=function(e){return arguments.length?(r=Ln(e),s):r},s.endAngle=function(e){return arguments.length?(i=Ln(e),s):i},s},e.svg.diagonal=function(){function r(r,i){var s=e.call(this,r,i),o=t.call(this,r,i),u=(s.y+o.y)/2,a=[s,{x:s.x,y:u},{x:o.x,y:u},o];return a=a.map(n),"M"+a[0]+"C"+a[1]+" "+a[2]+" "+a[3]}var e=cs,t=hs,n=bf;return r.source=function(t){return arguments.length?(e=Ln(t),r):e},r.target=function(e){return arguments.length?(t=Ln(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),n=bf,r=t.projection;return t.projection=function(e){return arguments.length?r(wf(n=e)):n},t},e.svg.symbol=function(){function n(n,r){return(Tf.get(e.call(this,n,r))||xf)(t.call(this,n,r))}var e=Sf,t=Ef;return n.type=function(t){return arguments.length?(e=Ln(t),n):e},n.size=function(e){return arguments.length?(t=Ln(e),n):t},n};var Tf=e.map({circle:xf,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+ -3*t+","+ -t+"H"+ -t+"V"+ -3*t+"H"+t+"V"+ -t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+ -t+"V"+t+"H"+ -3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Cf)),n=t*Cf;return"M0,"+ -t+"L"+n+",0"+" 0,"+t+" "+ -n+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+ -t+","+ -t+"L"+t+","+ -t+" "+t+","+t+" "+ -t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Nf),n=t*Nf/2;return"M0,"+n+"L"+t+","+ -n+" "+ -t+","+ -n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Nf),n=t*Nf/2;return"M0,"+ -n+"L"+t+","+n+" "+ -t+","+n+"Z"}});e.svg.symbolTypes=Tf.keys();var Nf=Math.sqrt(3),Cf=Math.tan(30*Bt),Lf=[],Af=0,Of,Mf;Lf.call=K.call,Lf.empty=K.empty,Lf.node=K.node,Lf.size=K.size,e.transition=function(e){return arguments.length?Of?e.transition():e:gt.transition()},e.transition.prototype=Lf,Lf.select=function(e){var t=this.id,n=this.namespace,r=[],i,s,o;e=Q(e);for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(o=f[l])&&(s=e.call(o,o.__data__,l,u))?("__data__"in o&&(s.__data__=o.__data__),Hf(s,l,n,t,o[n][t]),i.push(s)):i.push(null)}return kf(r,n,t)},Lf.selectAll=function(e){var t=this.id,n=this.namespace,r=[],i,s,o,u,a;e=G(e);for(var f=-1,l=this.length;++f<l;)for(var c=this[f],h=-1,p=c.length;++h<p;)if(o=c[h]){a=o[n][t],s=e.call(o,o.__data__,h,f),r.push(i=[]);for(var d=-1,v=s.length;++d<v;)(u=s[d])&&Hf(u,d,n,t,a),i.push(u)}return kf(r,n,t)},Lf.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=lt(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]);for(var r=this[s],u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return kf(t,this.namespace,this.id)},Lf.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):ht(this,t==null?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Lf.attr=function(t,n){function s(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function u(e){return e==null?s:(e+="",function(){var t=this.getAttribute(i),n;return t!==e&&(n=r(t,e),function(e){this.setAttribute(i,n(e))})})}function a(e){return e==null?o:(e+="",function(){var t=this.getAttributeNS(i.space,i.local),n;return t!==e&&(n=r(t,e),function(e){this.setAttributeNS(i.space,i.local,n(e))})})}if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=t=="transform"?ru:Oo,i=e.ns.qualify(t);return _f(this,"attr."+t,n,i.local?a:u)},Lf.attrTween=function(t,n){function i(e,t){var i=n.call(this,e,t,this.getAttribute(r));return i&&function(e){this.setAttribute(r,i(e))}}function s(e,t){var i=n.call(this,e,t,this.getAttributeNS(r.space,r.local));return i&&function(e){this.setAttributeNS(r.space,r.local,i(e))}}var r=e.ns.qualify(t);return this.tween("attr."+t,r.local?s:i)},Lf.style=function(e,t,n){function i(){this.style.removeProperty(e)}function o(t){return t==null?i:(t+="",function(){var r=s.getComputedStyle(this,null).getPropertyValue(e),i;return r!==t&&(i=Oo(r,t),function(t){this.style.setProperty(e,i(t),n)})})}var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.style(n,e[n],t);return this}n=""}return _f(this,"style."+e,t,o)},Lf.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,s.getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}}return arguments.length<3&&(n=""),this.tween("style."+e,r)},Lf.text=function(e){return _f(this,"text",e,Df)},Lf.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Lf.ease=function(t){var n=this.id,r=this.namespace;return arguments.length<1?this.node()[r][n].ease:(typeof t!="function"&&(t=e.ease.apply(e,arguments)),ht(this,function(e){e[r][n].ease=t}))},Lf.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:ht(this,typeof e=="function"?function(r,i,s){r[n][t].delay=+e.call(r,r.__data__,i,s)}:(e=+e,function(r){r[n][t].delay=e}))},Lf.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:ht(this,typeof e=="function"?function(r,i,s){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,s))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Lf.each=function(t,n){var r=this.id,i=this.namespace;if(arguments.length<2){var s=Mf,o=Of;Of=r,ht(this,function(e,n,s){Mf=e[i][r],t.call(e,e.__data__,n,s)}),Mf=s,Of=o}else ht(this,function(s){var o=s[i][r];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,n)});return this},Lf.transition=function(){var e=this.id,t=++Af,n=this.namespace,r=[],i,s,o,u;for(var a=0,f=this.length;a<f;a++){r.push(i=[]);for(var s=this[a],l=0,c=s.length;l<c;l++){if(o=s[l])u=o[n][e],Hf(o,l,n,t,{time:u.time,ease:u.ease,delay:u.delay+u.duration,duration:u.duration});i.push(o)}}return kf(r,n,t)},e.svg.axis=function(){function f(f){f.each(function(){var f=e.select(this),l=this.__chart__||t,c=this.__chart__=t.copy(),h=u==null?c.ticks?c.ticks.apply(c,o):c.domain():u,p=a==null?c.tickFormat?c.tickFormat.apply(c,o):An:a,d=f.selectAll(".tick").data(h,c),v=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Ot),m=e.transition(d.exit()).style("opacity",Ot).remove(),g=e.transition(d.order()).style("opacity",1),y=Math.max(r,0)+s,b,w=oa(c),E=f.selectAll(".domain").data([0]),S=(E.enter().append("path").attr("class","domain"),e.transition(E));v.append("line"),v.append("text");var x=v.select("line"),T=g.select("line"),N=d.select("text").text(p),C=v.select("text"),k=g.select("text"),L=n==="top"||n==="left"?-1:1,A,O,M,_;n==="bottom"||n==="top"?(b=Ff,A="x",M="y",O="x2",_="y2",N.attr("dy",L<0?"0em":".71em").style("text-anchor","middle"),S.attr("d","M"+w[0]+","+L*i+"V0H"+w[1]+"V"+L*i)):(b=If,A="y",M="x",O="y2",_="x2",N.attr("dy",".32em").style("text-anchor",L<0?"end":"start"),S.attr("d","M"+L*i+","+w[0]+"H0V"+w[1]+"H"+L*i)),x.attr(_,L*r),C.attr(M,L*y),T.attr(O,0).attr(_,L*r),k.attr(A,0).attr(M,L*y);if(c.rangeBand){var D=c,P=D.rangeBand()/2;l=c=function(e){return D(e)+P}}else l.rangeBand?l=c:m.call(b,c,l);v.call(b,l,c),g.call(b,c,c)})}var t=e.scale.linear(),n=Bf,r=6,i=6,s=3,o=[10],u=null,a;return f.scale=function(e){return arguments.length?(t=e,f):t},f.orient=function(e){return arguments.length?(n=e in jf?e+"":Bf,f):n},f.ticks=function(){return arguments.length?(o=arguments,f):o},f.tickValues=function(e){return arguments.length?(u=e,f):u},f.tickFormat=function(e){return arguments.length?(a=e,f):a},f.tickSize=function(e){var t=arguments.length;return t?(r=+e,i=+arguments[t-1],f):r},f.innerTickSize=function(e){return arguments.length?(r=+e,f):r},f.outerTickSize=function(e){return arguments.length?(i=+e,f):i},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.tickSubdivide=function(){return arguments.length&&f},f};var Bf="bottom",jf={top:1,right:1,bottom:1,left:1};e.svg.brush=function(){function h(t){t.each(function(){var t=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),i=t.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=t.selectAll(".resize").data(c,An);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return qf[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",h.empty()?"none":null);var o=e.transition(t),u=e.transition(i),a;n&&(a=oa(n),u.attr("x",a[0]).attr("width",a[1]-a[0]),d(o)),r&&(a=oa(r),u.attr("y",a[0]).attr("height",a[1]-a[0]),v(o)),p(o)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+i[+/e$/.test(e)]+","+o[+/^s/.test(e)]+")"})}function d(e){e.select(".extent").attr("x",i[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",i[1]-i[0])}function v(e){e.select(".extent").attr("y",o[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",o[1]-o[0])}function m(){function O(){e.event.keyCode==32&&(S||(T=null,N[0]-=i[1],N[1]-=o[1],S=2),I())}function M(){e.event.keyCode==32&&S==2&&(N[0]+=i[1],N[1]+=o[1],S=0,I())}function _(){var t=e.mouse(c),s=!1;C&&(t[0]+=C[0],t[1]+=C[1]),S||(e.event.altKey?(T||(T=[(i[0]+i[1])/2,(o[0]+o[1])/2]),N[0]=i[+(t[0]<T[0])],N[1]=o[+(t[1]<T[1])]):T=null),w&&D(t,n,0)&&(d(y),s=!0),E&&D(t,r,1)&&(v(y),s=!0),s&&(p(y),g({type:"brush",mode:S?"move":"resize"}))}function D(e,t,n){var r=oa(t),s=r[0],c=r[1],h=N[n],p=n?o:i,d=p[1]-p[0],v,m;S&&(s-=h,c-=d+h),v=(n?l:f)?Math.max(s,Math.min(c,e[n])):e[n],S?m=(v+=h)+d:(T&&(h=Math.max(s,Math.min(c,2*T[n]-v))),h<v?(m=v,v=h):m=h);if(p[0]!=v||p[1]!=m)return n?a=null:u=null,p[0]=v,p[1]=m,!0}function P(){_(),y.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),e.select("body").style("cursor",null),k.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),x(),g({type:"brushend"})}var c=this,m=e.select(e.event.target),g=t.of(c,arguments),y=e.select(c),b=m.datum(),w=!/^(n|s)$/.test(b)&&n,E=!/^(e|w)$/.test(b)&&r,S=m.classed("extent"),x=Tt(),T,N=e.mouse(c),C,k=e.select(s).on("keydown.brush",O).on("keyup.brush",M);e.event.changedTouches?k.on("touchmove.brush",_).on("touchend.brush",P):k.on("mousemove.brush",_).on("mouseup.brush",P),y.interrupt().selectAll("*").interrupt();if(S)N[0]=i[0]-N[0],N[1]=o[0]-N[1];else if(b){var L=+/w$/.test(b),A=+/^n/.test(b);C=[i[1-L]-N[0],o[1-A]-N[1]],N[0]=i[L],N[1]=o[A]}else e.event.altKey&&(T=N.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",m.style("cursor")),g({type:"brushstart"}),_()}var t=R(h,"brushstart","brush","brushend"),n=null,r=null,i=[0,0],o=[0,0],u,a,f=!0,l=!0,c=Rf[0];return h.event=function(n){n.each(function(){var n=t.of(this,arguments),r={x:i,y:o,i:u,j:a},s=this.__chart__||r;this.__chart__=r,Of?e.select(this).transition().each("start.brush",function(){u=s.i,a=s.j,i=s.x,o=s.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=Mo(i,r.x),t=Mo(o,r.y);return u=a=null,function(s){i=r.x=e(s),o=r.y=t(s),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=r.i,a=r.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},h.x=function(e){return arguments.length?(n=e,c=Rf[!n<<1|!r],h):n},h.y=function(e){return arguments.length?(r=e,c=Rf[!n<<1|!r],h):r},h.clamp=function(e){return arguments.length?(n&&r?(f=!!e[0],l=!!e[1]):n?f=!!e:r&&(l=!!e),h):n&&r?[f,l]:n?f:r?l:null},h.extent=function(e){var t,s,f,l,c;if(!arguments.length)return n&&(u?(t=u[0],s=u[1]):(t=i[0],s=i[1],n.invert&&(t=n.invert(t),s=n.invert(s)),s<t&&(c=t,t=s,s=c))),r&&(a?(f=a[0],l=a[1]):(f=o[0],l=o[1],r.invert&&(f=r.invert(f),l=r.invert(l)),l<f&&(c=f,f=l,l=c))),n&&r?[[t,f],[s,l]]:n?[t,s]:r&&[f,l];if(n){t=e[0],s=e[1],r&&(t=t[0],s=s[0]),u=[t,s],n.invert&&(t=n(t),s=n(s)),s<t&&(c=t,t=s,s=c);if(t!=i[0]||s!=i[1])i=[t,s]}if(r){f=e[0],l=e[1],n&&(f=f[1],l=l[1]),a=[f,l],r.invert&&(f=r(f),l=r(l)),l<f&&(c=f,f=l,l=c);if(f!=o[0]||l!=o[1])o=[f,l]}return h},h.clear=function(){return h.empty()||(i=[0,0],o=[0,0],u=a=null),h},h.empty=function(){return!!n&&i[0]==i[1]||!!r&&o[0]==o[1]},e.rebind(h,t,"on")};var qf={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Rf=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Uf=Qn.format=Cr.timeFormat,zf=Uf.utc,Wf=zf("%Y-%m-%dT%H:%M:%S.%LZ");Uf.iso=Date.prototype.toISOString&&+(new Date("2000-01-01T00:00:00.000Z"))?Xf:Wf,Xf.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Xf.toString=Wf.toString,Qn.second=er(function(e){return new Gn(Math.floor(e/1e3)*1e3)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*1e3)},function(e){return e.getSeconds()}),Qn.seconds=Qn.second.range,Qn.seconds.utc=Qn.second.utc.range,Qn.minute=er(function(e){return new Gn(Math.floor(e/6e4)*6e4)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*6e4)},function(e){return e.getMinutes()}),Qn.minutes=Qn.minute.range,Qn.minutes.utc=Qn.minute.utc.range,Qn.hour=er(function(e){var t=e.getTimezoneOffset()/60;return new Gn((Math.floor(e/36e5-t)+t)*36e5)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()}),Qn.hours=Qn.hour.range,Qn.hours.utc=Qn.hour.utc.range,Qn.month=er(function(e){return e=Qn.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),Qn.months=Qn.month.range,Qn.months.utc=Qn.month.utc.range;var Jf=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kf=[[Qn.second,1],[Qn.second,5],[Qn.second,15],[Qn.second,30],[Qn.minute,1],[Qn.minute,5],[Qn.minute,15],[Qn.minute,30],[Qn.hour,1],[Qn.hour,3],[Qn.hour,6],[Qn.hour,12],[Qn.day,1],[Qn.day,2],[Qn.week,1],[Qn.month,1],[Qn.month,3],[Qn.year,1]],Qf=Uf.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&e.getDate()!=1}],["%b %d",function(e){return e.getDate()!=1}],["%B",function(e){return e.getMonth()}],["%Y",ci]]),Gf={range:function(t,n,r){return e.range(Math.ceil(t/r)*r,+n,r).map($f)},floor:An,ceil:An};Kf.year=Qn.year,Qn.scale=function(){return Vf(e.scale.linear(),Kf,Qf)};var Yf=Kf.map(function(e){return[e[0].utc,e[1]]}),Zf=zf.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],["%b %d",function(e){return e.getUTCDate()!=1}],["%B",function(e){return e.getUTCMonth()}],["%Y",ci]]);Yf.year=Qn.year.utc,Qn.scale.utc=function(){return Vf(e.scale.linear(),Yf,Zf)},e.text=On(function(e){return e.responseText}),e.json=function(e,t){return Mn(e,"application/json",el,t)},e.html=function(e,t){return Mn(e,"text/html",tl,t)},e.xml=On(function(e){return e.responseXML}),typeof define=="function"&&define.amd?define("d3",e):typeof module=="object"&&module.exports&&(module.exports=e),this.d3=e}(),function(e){function s(e){this.owner=e}function o(e,t){if(Object.create)t.prototype=Object.create(e.prototype);else{var n=function(){};n.prototype=e.prototype,t.prototype=new n}return t.prototype.constructor=t,t}function u(e){var t=this.internal=new a(this);t.loadConfig(e),t.init(),function r(e,t,n){Object.keys(e).forEach(function(i){t[i]=e[i].bind(n),Object.keys(e[i]).length>0&&r(e[i],t[i],n)})}(n,this,this)}function a(t){var n=this;n.d3=e.d3?e.d3:typeof require!="undefined"?require("d3"):undefined,n.api=t,n.config=n.getDefaultConfig(),n.data={},n.cache={},n.axes={}}function f(e){s.call(this,e)}function N(e,t){function p(e,t){e.attr("transform",function(e){return"translate("+Math.ceil(t(e)+l)+", 0)"})}function d(e,t){e.attr("transform",function(e){return"translate(0,"+Math.ceil(t(e))+")"})}function v(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function m(e){var t,n,r=[];if(e.ticks)return e.ticks.apply(e,f);n=e.domain();for(t=Math.ceil(n[0]);t<n[1];t++)r.push(t);return r.length>0&&r[0]>0&&r.unshift(r[0]-(r[1]-r[0])),r}function g(){var e=n.copy(),r;return t.isCategory&&(r=n.domain(),e.domain([r[0],r[1]-1])),e}function y(e){var t=a?a(e):e;return typeof t!="undefined"?t:""}function b(e){if(T)return T;var t={h:11.5,w:5.5};return e.select("text").text(y).each(function(e){var n=this.getBoundingClientRect(),r=y(e),i=n.height,s=r?n.width/r.length:undefined;i&&s&&(t.h=i,t.w=s)}).text(""),T=t,t}function w(n){return t.withoutTransition?n:e.transition(n)}function E(a){a.each(function(){function z(e,n){function a(e,t){s=undefined;for(var r=1;r<t.length;r++){t.charAt(r)===" "&&(s=r),i=t.substr(0,r+1),o=I.w*i.length;if(n<o)return a(e.concat(t.substr(0,s?s:r)),t.slice(s?s+1:r))}return e.concat(t)}var r=y(e),i,s,o,u=[];if(Object.prototype.toString.call(r)==="[object Array]")return r;if(!n||n<=0)n=U?95:t.isCategory?Math.ceil(c(S[1])-c(S[0]))-12:110;return a(u,r+"")}function W(e,t){var n=I.h;return t===0&&(r==="left"||r==="right"?n=-((q[e.index]-1)*(I.h/2)-3):n=".71em"),n}function X(e){var t=n(e)+(h?0:l);return O[0]<t&&t<O[1]?i:0}function $(e){return e?e>0?"start":"end":"middle"}function J(e){return e?"rotate("+e+")":""}function K(e){return e?8*Math.sin(Math.PI*(e/180)):0}function Q(e){return e?11.5-2.5*(e/15)*(e>0?1:-1):R}var a=E.g=e.select(this),f=this.__chart__||n,c=this.__chart__=g(),S=u?u:m(c),x=a.selectAll(".tick").data(S,c),T=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),N=x.exit().remove(),C=w(x).style("opacity",1),k,L,A,O=n.rangeExtent?n.rangeExtent():v(n.range()),M=a.selectAll(".domain").data([0]),_=(M.enter().append("path").attr("class","domain"),w(M));T.append("line"),T.append("text");var D=T.select("line"),P=C.select("line"),H=T.select("text"),B=C.select("text");t.isCategory?(l=Math.ceil((c(1)-c(0))/2),L=h?0:l,A=h?l:0):l=L=0;var j,F,I=b(a.select(".tick")),q=[],R=Math.max(i,0)+o,U=r==="left"||r==="right";j=x.select("text"),F=j.selectAll("tspan").data(function(e,n){var r=t.tickMultiline?z(e,t.tickWidth):[].concat(y(e));return q[n]=r.length,r.map(function(e){return{index:n,splitted:e}})}),F.enter().append("tspan"),F.exit().remove(),F.text(function(e){return e.splitted});var V=t.tickTextRotate;switch(r){case"bottom":k=p,D.attr("y2",i),H.attr("y",R),P.attr("x1",L).attr("x2",L).attr("y2",X),B.attr("x",0).attr("y",Q(V)).style("text-anchor",$(V)).attr("transform",J(V)),F.attr("x",0).attr("dy",W).attr("dx",K(V)),_.attr("d","M"+O[0]+","+s+"V0H"+O[1]+"V"+s);break;case"top":k=p,D.attr("y2",-i),H.attr("y",-R),P.attr("x2",0).attr("y2",-i),B.attr("x",0).attr("y",-R),j.style("text-anchor","middle"),F.attr("x",0).attr("dy","0em"),_.attr("d","M"+O[0]+","+ -s+"V0H"+O[1]+"V"+ -s);break;case"left":k=d,D.attr("x2",-i),H.attr("x",-R),P.attr("x2",-i).attr("y1",A).attr("y2",A),B.attr("x",-R).attr("y",l),j.style("text-anchor","end"),F.attr("x",-R).attr("dy",W),_.attr("d","M"+ -s+","+O[0]+"H0V"+O[1]+"H"+ -s);break;case"right":k=d,D.attr("x2",i),H.attr("x",R),P.attr("x2",i).attr("y2",0),B.attr("x",R).attr("y",0),j.style("text-anchor","start"),F.attr("x",R).attr("dy",W),_.attr("d","M"+s+","+O[0]+"H0V"+O[1]+"H"+s)}if(c.rangeBand){var G=c,Y=G.rangeBand()/2;f=c=function(e){return G(e)+Y}}else f.rangeBand?f=c:N.call(k,c);T.call(k,f),C.call(k,c)})}var n=e.scale.linear(),r="bottom",i=6,s,o=3,u=null,a,f,l=0,c=!0,h;return t=t||{},s=t.withOuterTick?6:0,E.scale=function(e){return arguments.length?(n=e,E):n},E.orient=function(e){return arguments.length?(r=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",E):r},E.tickFormat=function(e){return arguments.length?(a=e,E):a},E.tickCentered=function(e){return arguments.length?(h=e,E):h},E.tickOffset=function(){return l},E.tickInterval=function(){var e,n;return t.isCategory?e=l*2:(n=E.g.select("path.domain").node().getTotalLength()-s*2,e=n/E.g.selectAll("line").size()),e===Infinity?0:e},E.ticks=function(){return arguments.length?(f=arguments,E):f},E.tickCulling=function(e){return arguments.length?(c=e,E):c},E.tickValues=function(e){if(typeof e=="function")u=function(){return e(n.domain())};else{if(!arguments.length)return u;u=e}return E},E}var t={version:"0.4.10"},n,r,i;t.generate=function(e){return new u(e)},t.chart={fn:u.prototype,internal:{fn:a.prototype,axis:{fn:f.prototype}}},n=t.chart.fn,r=t.chart.internal.fn,i=t.chart.internal.axis.fn,r.init=function(){var e=this,t=e.config;e.initParams();if(t.data_url)e.convertUrlToData(t.data_url,t.data_mimeType,t.data_keys,e.initWithData);else if(t.data_json)e.initWithData(e.convertJsonToData(t.data_json,t.data_keys));else if(t.data_rows)e.initWithData(e.convertRowsToData(t.data_rows));else{if(!t.data_columns)throw Error("url or json or rows or columns is required.");e.initWithData(e.convertColumnsToData(t.data_columns))}},r.initParams=function(){var e=this,t=e.d3,n=e.config;e.clipId="c3-"+ +(new Date)+"-clip",e.clipIdForXAxis=e.clipId+"-xaxis",e.clipIdForYAxis=e.clipId+"-yaxis",e.clipIdForGrid=e.clipId+"-grid",e.clipIdForSubchart=e.clipId+"-subchart",e.clipPath=e.getClipPath(e.clipId),e.clipPathForXAxis=e.getClipPath(e.clipIdForXAxis),e.clipPathForYAxis=e.getClipPath(e.clipIdForYAxis),e.clipPathForGrid=e.getClipPath(e.clipIdForGrid),e.clipPathForSubchart=e.getClipPath(e.clipIdForSubchart),e.dragStart=null,e.dragging=!1,e.flowing=!1,e.cancelClick=!1,e.mouseover=!1,e.transiting=!1,e.color=e.generateColor(),e.levelColor=e.generateLevelColor(),e.dataTimeFormat=n.data_xLocaltime?t.time.format:t.time.format.utc,e.axisTimeFormat=n.axis_x_localtime?t.time.format:t.time.format.utc,e.defaultAxisTimeFormat=e.axisTimeFormat.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%-m/%-d",function(e){return e.getDay()&&e.getDate()!==1}],["%-m/%-d",function(e){return e.getDate()!==1}],["%-m/%-d",function(e){return e.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),e.hiddenTargetIds=[],e.hiddenLegendIds=[],e.focusedTargetIds=[],e.defocusedTargetIds=[],e.xOrient=n.axis_rotated?"left":"bottom",e.yOrient=n.axis_rotated?n.axis_y_inner?"top":"bottom":n.axis_y_inner?"right":"left",e.y2Orient=n.axis_rotated?n.axis_y2_inner?"bottom":"top":n.axis_y2_inner?"left":"right",e.subXOrient=n.axis_rotated?"left":"bottom",e.isLegendRight=n.legend_position==="right",e.isLegendInset=n.legend_position==="inset",e.isLegendTop=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="top-right",e.isLegendLeft=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="bottom-left",e.legendStep=0,e.legendItemWidth=0,e.legendItemHeight=0,e.currentMaxTickWidths={x:0,y:0,y2:0},e.rotated_padding_left=30,e.rotated_padding_right=n.axis_rotated&&!n.axis_x_show?0:30,e.rotated_padding_top=5,e.withoutFadeIn={},e.intervalForObserveInserted=undefined,e.axes.subx=t.selectAll([])},r.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},r.initWithData=function(t){var n=this,r=n.d3,i=n.config,s,o,u=!0;n.axis=new f(n),n.initPie&&n.initPie(),n.initBrush&&n.initBrush(),n.initZoom&&n.initZoom(),i.bindto?typeof i.bindto.node=="function"?n.selectChart=i.bindto:n.selectChart=r.select(i.bindto):n.selectChart=r.selectAll([]),n.selectChart.empty()&&(n.selectChart=r.select(document.createElement("div")).style("opacity",0),n.observeInserted(n.selectChart),u=!1),n.selectChart.html("").classed("c3",!0),n.data.xs={},n.data.targets=n.convertDataToTargets(t),i.data_filter&&(n.data.targets=n.data.targets.filter(i.data_filter)),i.data_hide&&n.addHiddenTargetIds(i.data_hide===!0?n.mapToIds(n.data.targets):i.data_hide),i.legend_hide&&n.addHiddenLegendIds(i.legend_hide===!0?n.mapToIds(n.data.targets):i.legend_hide),n.hasType("gauge")&&(i.legend_show=!1),n.updateSizes(),n.updateScales(),n.x.domain(r.extent(n.getXDomain(n.data.targets))),n.y.domain(n.getYDomain(n.data.targets,"y")),n.y2.domain(n.getYDomain(n.data.targets,"y2")),n.subX.domain(n.x.domain()),n.subY.domain(n.y.domain()),n.subY2.domain(n.y2.domain()),n.orgXDomain=n.x.domain(),n.brush&&n.brush.scale(n.subX),i.zoom_enabled&&n.zoom.scale(n.x),n.svg=n.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return i.onmouseover.call(n)}).on("mouseleave",function(){return i.onmouseout.call(n)}),s=n.svg.append("defs"),n.clipChart=n.appendClip(s,n.clipId),n.clipXAxis=n.appendClip(s,n.clipIdForXAxis),n.clipYAxis=n.appendClip(s,n.clipIdForYAxis),n.clipGrid=n.appendClip(s,n.clipIdForGrid),n.clipSubchart=n.appendClip(s,n.clipIdForSubchart),n.updateSvgSize(),o=n.main=n.svg.append("g").attr("transform",n.getTranslate("main")),n.initSubchart&&n.initSubchart(),n.initTooltip&&n.initTooltip(),n.initLegend&&n.initLegend(),o.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),n.initRegion(),n.initGrid(),o.append("g").attr("clip-path",n.clipPath).attr("class",l.chart),i.grid_lines_front&&n.initGridLines(),n.initEventRect(),n.initChartElements(),o.insert("rect",i.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",n.width).attr("height",n.height).style("opacity",0).on("dblclick.zoom",null),i.axis_x_extent&&n.brush.extent(n.getDefaultExtent()),n.axis.init(),n.updateTargets(n.data.targets),u&&(n.updateDimension(),n.config.oninit.call(n),n.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),e.onresize==null&&(e.onresize=n.generateResize()),e.onresize.add&&(e.onresize.add(function(){i.onresize.call(n)}),e.onresize.add(function(){n.api.flush()}),e.onresize.add(function(){i.onresized.call(n)})),n.api.element=n.selectChart.node()},r.smoothLines=function(e,t){var n=this;t==="grid"&&e.each(function(){var e=n.d3.select(this),t=e.attr("x1"),r=e.attr("x2"),i=e.attr("y1"),s=e.attr("y2");e.attr({x1:Math.ceil(t),x2:Math.ceil(r),y1:Math.ceil(i),y2:Math.ceil(s)})})},r.updateSizes=function(){var e=this,t=e.config,n=e.legend?e.getLegendHeight():0,r=e.legend?e.getLegendWidth():0,i=e.isLegendRight||e.isLegendInset?0:n,s=e.hasArcType(),o=t.axis_rotated||s?0:e.getHorizontalAxisHeight("x"),u=t.subchart_show&&!s?t.subchart_size_height+o:0;e.currentWidth=e.getCurrentWidth(),e.currentHeight=e.getCurrentHeight(),e.margin=t.axis_rotated?{top:e.getHorizontalAxisHeight("y2")+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:e.getHorizontalAxisHeight("y")+i+e.getCurrentPaddingBottom(),left:u+(s?0:e.getCurrentPaddingLeft())}:{top:4+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:o+u+i+e.getCurrentPaddingBottom(),left:s?0:e.getCurrentPaddingLeft()},e.margin2=t.axis_rotated?{top:e.margin.top,right:NaN,bottom:20+i,left:e.rotated_padding_left}:{top:e.currentHeight-u-i,right:NaN,bottom:o+i,left:e.margin.left},e.margin3={top:0,right:NaN,bottom:0,left:0},e.updateSizeForLegend&&e.updateSizeForLegend(n,r),e.width=e.currentWidth-e.margin.left-e.margin.right,e.height=e.currentHeight-e.margin.top-e.margin.bottom,e.width<0&&(e.width=0),e.height<0&&(e.height=0),e.width2=t.axis_rotated?e.margin.left-e.rotated_padding_left-e.rotated_padding_right:e.width,e.height2=t.axis_rotated?e.height:e.currentHeight-e.margin2.top-e.margin2.bottom,e.width2<0&&(e.width2=0),e.height2<0&&(e.height2=0),e.arcWidth=e.width-(e.isLegendRight?r+10:0),e.arcHeight=e.height-(e.isLegendRight?0:10),e.hasType("gauge")&&(e.arcHeight+=e.height-e.getGaugeLabelHeight()),e.updateRadius&&e.updateRadius(),e.isLegendRight&&s&&(e.margin3.left=e.arcWidth/2+e.radiusExpanded*1.1)},r.updateTargets=function(e){var t=this;t.updateTargetsForText(e),t.updateTargetsForBar(e),t.updateTargetsForLine(e),t.hasArcType()&&t.updateTargetsForArc&&t.updateTargetsForArc(e),t.updateTargetsForSubchart&&t.updateTargetsForSubchart(e),t.showTargets()},r.showTargets=function(){var e=this;e.svg.selectAll("."+l.target).filter(function(t){return e.isTargetToShow(t.id)}).transition().duration(e.config.transition_duration).style("opacity",1)},r.redraw=function(e,t){var n=this,r=n.main,i=n.d3,s=n.config,o=n.getShapeIndices(n.isAreaType),u=n.getShapeIndices(n.isBarType),a=n.getShapeIndices(n.isLineType),f,c,h,p,d,v,m,g,y,b,w,S,x,T=n.hasArcType(),N,C,k,L,A,O,M,_,D,P,H=n.filterTargetsToShow(n.data.targets),B,j,F,I,q=n.xv.bind(n),R,U;e=e||{},f=E(e,"withY",!0),c=E(e,"withSubchart",!0),h=E(e,"withTransition",!0),v=E(e,"withTransform",!1),m=E(e,"withUpdateXDomain",!1),g=E(e,"withUpdateOrgXDomain",!1),y=E(e,"withTrimXDomain",!0),x=E(e,"withUpdateXAxis",m),b=E(e,"withLegend",!1),w=E(e,"withEventRect",!0),S=E(e,"withDimension",!0),p=E(e,"withTransitionForExit",h),d=E(e,"withTransitionForAxis",h),O=h?s.transition_duration:0,M=p?O:0,_=d?O:0,t=t||n.axis.generateTransitions(_),b&&s.legend_show?n.updateLegend(n.mapToIds(n.data.targets),e,t):S&&n.updateDimension(!0),n.isCategorized()&&H.length===0&&n.x.domain([0,n.axes.x.selectAll(".tick").size()]),H.length?(n.updateXDomain(H,m,g,y),s.axis_x_tick_values||(B=n.axis.updateXAxisTickValues(H))):(n.xAxis.tickValues([]),n.subXAxis.tickValues([])),s.zoom_rescale&&!e.flow&&(I=n.x.orgDomain()),n.y.domain(n.getYDomain(H,"y",I)),n.y2.domain(n.getYDomain(H,"y2",I)),!s.axis_y_tick_values&&s.axis_y_tick_count&&n.yAxis.tickValues(n.axis.generateTickValues(n.y.domain(),s.axis_y_tick_count)),!s.axis_y2_tick_values&&s.axis_y2_tick_count&&n.y2Axis.tickValues(n.axis.generateTickValues(n.y2.domain(),s.axis_y2_tick_count)),n.axis.redraw(t,T),n.axis.updateLabels(h);if((m||x)&&H.length)if(s.axis_x_tick_culling&&B){for(j=1;j<B.length;j++)if(B.length/j<s.axis_x_tick_culling_max){F=j;break}n.svg.selectAll("."+l.axisX+" .tick text").each(function(e){var t=B.indexOf(e);t>=0&&i.select(this).style("display",t%F?"none":"block")})}else n.svg.selectAll("."+l.axisX+" .tick text").style("display","block");N=n.generateDrawArea?n.generateDrawArea(o,!1):undefined,C=n.generateDrawBar?n.generateDrawBar(u):undefined,k=n.generateDrawLine?n.generateDrawLine(a,!1):undefined,L=n.generateXYForText(o,u,a,!0),A=n.generateXYForText(o,u,a,!1),f&&(n.subY.domain(n.getYDomain(H,"y")),n.subY2.domain(n.getYDomain(H,"y2"))),n.tooltip.style("display","none"),n.updateXgridFocus(),r.select("text."+l.text+"."+l.empty).attr("x",n.width/2).attr("y",n.height/2).text(s.data_empty_label_text).transition().style("opacity",H.length?0:1),n.updateGrid(O),n.updateRegion(O),n.updateBar(M),n.updateLine(M),n.updateArea(M),n.updateCircle(),n.hasDataLabel()&&n.updateText(M),n.redrawArc&&n.redrawArc(O,M,v),n.redrawSubchart&&n.redrawSubchart(c,t,O,M,o,u,a),r.selectAll("."+l.selectedCircles).filter(n.isBarType.bind(n)).selectAll("circle").remove(),s.interaction_enabled&&!e.flow&&w&&(n.redrawEventRect(),n.updateZoom&&n.updateZoom()),n.updateCircleY(),R=(n.config.axis_rotated?n.circleY:n.circleX).bind(n),U=(n.config.axis_rotated?n.circleX:n.circleY).bind(n),e.flow&&(P=n.generateFlow({targets:H,flow:e.flow,duration:e.flow.duration,drawBar:C,drawLine:k,drawArea:N,cx:R,cy:U,xv:q,xForText:L,yForText:A})),(O||P)&&n.isTabVisible()?i.transition().duration(O).each(function(){var t=[];[n.redrawBar(C,!0),n.redrawLine(k,!0),n.redrawArea(N,!0),n.redrawCircle(R,U,!0),n.redrawText(L,A,e.flow,!0),n.redrawRegion(!0),n.redrawGrid(!0)].forEach(function(e){e.forEach(function(e){t.push(e)})}),D=n.generateWait(),t.forEach(function(e){D.add(e)})}).call(D,function(){P&&P(),s.onrendered&&s.onrendered.call(n)}):(n.redrawBar(C),n.redrawLine(k),n.redrawArea(N),n.redrawCircle(R,U),n.redrawText(L,A,e.flow),n.redrawRegion(),n.redrawGrid(),s.onrendered&&s.onrendered.call(n)),n.mapToIds(n.data.targets).forEach(function(e){n.withoutFadeIn[e]=!0})},r.updateAndRedraw=function(e){var t=this,n=t.config,r;e=e||{},e.withTransition=E(e,"withTransition",!0),e.withTransform=E(e,"withTransform",!1),e.withLegend=E(e,"withLegend",!1),e.withUpdateXDomain=!0,e.withUpdateOrgXDomain=!0,e.withTransitionForExit=!1,e.withTransitionForTransform=E(e,"withTransitionForTransform",e.withTransition),t.updateSizes();if(!e.withLegend||!n.legend_show)r=t.axis.generateTransitions(e.withTransitionForAxis?n.transition_duration:0),t.updateScales(),t.updateSvgSize(),t.transformAll(e.withTransitionForTransform,r);t.redraw(e,r)},r.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},r.isTimeSeries=function(){return this.config.axis_x_type==="timeseries"},r.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},r.isCustomX=function(){var e=this,t=e.config;return!e.isTimeSeries()&&(t.data_x||w(t.data_xs))},r.isTimeSeriesY=function(){return this.config.axis_y_type==="timeseries"},r.getTranslate=function(e){var t=this,n=t.config,r,i;return e==="main"?(r=g(t.margin.left),i=g(t.margin.top)):e==="context"?(r=g(t.margin2.left),i=g(t.margin2.top)):e==="legend"?(r=t.margin3.left,i=t.margin3.top):e==="x"?(r=0,i=n.axis_rotated?0:t.height):e==="y"?(r=0,i=n.axis_rotated?t.height:0):e==="y2"?(r=n.axis_rotated?0:t.width,i=n.axis_rotated?1:0):e==="subx"?(r=0,i=n.axis_rotated?0:t.height2):e==="arc"&&(r=t.arcWidth/2,i=t.arcHeight/2),"translate("+r+","+i+")"},r.initialOpacity=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?1:0},r.initialOpacityForCircle=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?this.opacityForCircle(e):0},r.opacityForCircle=function(e){var t=this.config.point_show?1:0;return c(e.value)?this.isScatterType(e)?.5:t:0},r.opacityForText=function(){return this.hasDataLabel()?1:0},r.xx=function(e){return e?this.x(e.x):null},r.xv=function(e){var t=this,n=e.value;return t.isTimeSeries()?n=t.parseDate(e.value):t.isCategorized()&&typeof e.value=="string"&&(n=t.config.axis_x_categories.indexOf(e.value)),Math.ceil(t.x(n))},r.yv=function(e){var t=this,n=e.axis&&e.axis==="y2"?t.y2:t.y;return Math.ceil(n(e.value))},r.subxx=function(e){return e?this.subX(e.x):null},r.transformMain=function(e,t){var n=this,r,i,s;t&&t.axisX?r=t.axisX:(r=n.main.select("."+l.axisX),e&&(r=r.transition())),t&&t.axisY?i=t.axisY:(i=n.main.select("."+l.axisY),e&&(i=i.transition())),t&&t.axisY2?s=t.axisY2:(s=n.main.select("."+l.axisY2),e&&(s=s.transition())),(e?n.main.transition():n.main).attr("transform",n.getTranslate("main")),r.attr("transform",n.getTranslate("x")),i.attr("transform",n.getTranslate("y")),s.attr("transform",n.getTranslate("y2")),n.main.select("."+l.chartArcs).attr("transform",n.getTranslate("arc"))},r.transformAll=function(e,t){var n=this;n.transformMain(e,t),n.config.subchart_show&&n.transformContext(e,t),n.legend&&n.transformLegend(e)},r.updateSvgSize=function(){var e=this,t=e.svg.select(".c3-brush .background");e.svg.attr("width",e.currentWidth).attr("height",e.currentHeight),e.svg.selectAll(["#"+e.clipId,"#"+e.clipIdForGrid]).select("rect").attr("width",e.width).attr("height",e.height),e.svg.select("#"+e.clipIdForXAxis).select("rect").attr("x",e.getXAxisClipX.bind(e)).attr("y",e.getXAxisClipY.bind(e)).attr("width",e.getXAxisClipWidth.bind(e)).attr("height",e.getXAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForYAxis).select("rect").attr("x",e.getYAxisClipX.bind(e)).attr("y",e.getYAxisClipY.bind(e)).attr("width",e.getYAxisClipWidth.bind(e)).attr("height",e.getYAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForSubchart).select("rect").attr("width",e.width).attr("height",t.size()?t.attr("height"):0),e.svg.select("."+l.zoomRect).attr("width",e.width).attr("height",e.height),e.selectChart.style("max-height",e.currentHeight+"px")},r.updateDimension=function(e){var t=this;e||(t.config.axis_rotated?(t.axes.x.call(t.xAxis),t.axes.subx.call(t.subXAxis)):(t.axes.y.call(t.yAxis),t.axes.y2.call(t.y2Axis))),t.updateSizes(),t.updateScales(),t.updateSvgSize(),t.transformAll(!1)},r.observeInserted=function(t){var n=this,r;if(typeof MutationObserver=="undefined"){e.console.error("MutationObserver not defined.");return}r=new MutationObserver(function(i){i.forEach(function(i){i.type==="childList"&&i.previousSibling&&(r.disconnect(),n.intervalForObserveInserted=e.setInterval(function(){t.node().parentNode&&(e.clearInterval(n.intervalForObserveInserted),n.updateDimension(),n.config.oninit.call(n),n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})}),r.observe(t.node(),{attributes:!0,childList:!0,characterData:!0})},r.generateResize=function(){function t(){e.forEach(function(e){e()})}var e=[];return t.add=function(t){e.push(t)},t},r.endall=function(e,t){var n=0;e.each(function(){++n}).each("end",function(){--n||t.apply(this,arguments)})},r.generateWait=function(){var e=[],t=function(t,n){var r=setInterval(function(){var t=0;e.forEach(function(e){if(e.empty()){t+=1;return}try{e.transition()}catch(n){t+=1}}),t===e.length&&(clearInterval(r),n&&n())},10)};return t.add=function(t){e.push(t)},t},r.parseDate=function(t){var n=this,r;if(t instanceof Date)r=t;else if(typeof t=="string")r=n.dataTimeFormat(n.config.data_xFormat).parse(t);else if(typeof t=="number"||!isNaN(t))r=new Date(+t);return(!r||isNaN(+r))&&e.console.error("Failed to parse x '"+t+"' to Date object"),r},r.isTabVisible=function(){var e;return typeof document.hidden!="undefined"?e="hidden":typeof document.mozHidden!="undefined"?e="mozHidden":typeof document.msHidden!="undefined"?e="msHidden":typeof document.webkitHidden!="undefined"&&(e="webkitHidden"),document[e]?!1:!0},r.getDefaultConfig=function(){var e={bindto:"#chart",size_width:undefined,size_height:undefined,padding_left:undefined,padding_right:undefined,padding_top:undefined,padding_bottom:undefined,zoom_enabled:!1,zoom_extent:undefined,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:undefined,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(e){return e},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:undefined,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:undefined,data_colors:{},data_hide:!1,data_filter:undefined,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:undefined,data_json:undefined,data_rows:undefined,data_columns:undefined,data_mimeType:undefined,data_keys:undefined,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:undefined,legend_item_onclick:undefined,legend_item_onmouseover:undefined,legend_item_onmouseout:undefined,legend_equally:!1,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:undefined,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:undefined,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:undefined,axis_x_min:undefined,axis_x_padding:{},axis_x_height:undefined,axis_x_extent:undefined,axis_x_label:{},axis_y_show:!0,axis_y_type:undefined,axis_y_max:undefined,axis_y_min:undefined,axis_y_inverted:!1,axis_y_center:undefined,axis_y_inner:undefined,axis_y_label:{},axis_y_tick_format:undefined,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_count:undefined,axis_y_tick_time_value:undefined,axis_y_tick_time_interval:undefined,axis_y_padding:{},axis_y_default:undefined,axis_y2_show:!1,axis_y2_max:undefined,axis_y2_min:undefined,axis_y2_inverted:!1,axis_y2_center:undefined,axis_y2_inner:undefined,axis_y2_label:{},axis_y2_tick_format:undefined,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:undefined,axis_y2_padding:{},axis_y2_default:undefined,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_focus_expand_enabled:!0,point_focus_expand_r:undefined,point_select_r:undefined,line_connectNull:!1,line_step_type:"step",bar_width:undefined,bar_width_ratio:.6,bar_width_max:undefined,bar_zerobased:!0,area_zerobased:!0,pie_label_show:!0,pie_label_format:undefined,pie_label_threshold:.05,pie_expand:!0,gauge_label_show:!0,gauge_label_format:undefined,gauge_expand:!0,gauge_min:0,gauge_max:100,gauge_units:undefined,gauge_width:undefined,donut_label_show:!0,donut_label_format:undefined,donut_label_threshold:.05,donut_width:undefined,donut_expand:!0,donut_title:"",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:undefined,tooltip_format_name:undefined,tooltip_format_value:undefined,tooltip_position:undefined,tooltip_contents:function(e,t,n,r){return this.getTooltipContent?this.getTooltipContent(e,t,n,r):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"}};return Object.keys(this.additionalConfig).forEach(function(t){e[t]=this.additionalConfig[t]},this),e},r.additionalConfig={},r.loadConfig=function(e){function s(){var e=r.shift();return e&&n&&typeof n=="object"&&e in n?(n=n[e],s()):e?undefined:n}var t=this.config,n,r,i;Object.keys(t).forEach(function(o){n=e,r=o.split("_"),i=s(),v(i)&&(t[o]=i)})},r.getScale=function(e,t,n){return(n?this.d3.time.scale():this.d3.scale.linear()).range([e,t])},r.getX=function(e,t,n,r){var i=this,s=i.getScale(e,t,i.isTimeSeries()),o=n?s.domain(n):s,u;i.isCategorized()?(r=r||function(){return 0},s=function(e,t){var n=o(e)+r(e);return t?n:Math.ceil(n)}):s=function(e,t){var n=o(e);return t?n:Math.ceil(n)};for(u in o)s[u]=o[u];return s.orgDomain=function(){return o.domain()},i.isCategorized()&&(s.domain=function(e){return arguments.length?(o.domain(e),s):(e=this.orgDomain(),[e[0],e[1]+1])}),s},r.getY=function(e,t,n){var r=this.getScale(e,t,this.isTimeSeriesY());return n&&r.domain(n),r},r.getYScale=function(e){return this.axis.getId(e)==="y2"?this.y2:this.y},r.getSubYScale=function(e){return this.axis.getId(e)==="y2"?this.subY2:this.subY},r.updateScales=function(){var e=this,t=e.config,n=!e.x;e.xMin=t.axis_rotated?1:0,e.xMax=t.axis_rotated?e.height:e.width,e.yMin=t.axis_rotated?0:e.height,e.yMax=t.axis_rotated?e.width:1,e.subXMin=e.xMin,e.subXMax=e.xMax,e.subYMin=t.axis_rotated?0:e.height2,e.subYMax=t.axis_rotated?e.width2:1,e.x=e.getX(e.xMin,e.xMax,n?undefined:e.x.orgDomain(),function(){return e.xAxis.tickOffset()}),e.y=e.getY(e.yMin,e.yMax,n?t.axis_y_default:e.y.domain()),e.y2=e.getY(e.yMin,e.yMax,n?t.axis_y2_default:e.y2.domain()),e.subX=e.getX(e.xMin,e.xMax,e.orgXDomain,function(t){return t%1?0:e.subXAxis.tickOffset()}),e.subY=e.getY(e.subYMin,e.subYMax,n?t.axis_y_default:e.subY.domain()),e.subY2=e.getY(e.subYMin,e.subYMax,n?t.axis_y2_default:e.subY2.domain()),e.xAxisTickFormat=e.axis.getXAxisTickFormat(),e.xAxisTickValues=e.axis.getXAxisTickValues(),e.yAxisTickValues=e.axis.getYAxisTickValues(),e.y2AxisTickValues=e.axis.getY2AxisTickValues(),e.xAxis=e.axis.getXAxis(e.x,e.xOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.subXAxis=e.axis.getXAxis(e.subX,e.subXOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.yAxis=e.axis.getYAxis(e.y,e.yOrient,t.axis_y_tick_format,e.yAxisTickValues,t.axis_y_tick_outer),e.y2Axis=e.axis.getYAxis(e.y2,e.y2Orient,t.axis_y2_tick_format,e.y2AxisTickValues,t.axis_y2_tick_outer),n||(e.brush&&e.brush.scale(e.subX),t.zoom_enabled&&e.zoom.scale(e.x)),e.updateArc&&e.updateArc()},r.getYDomainMin=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasNegativeValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e<0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e>0)&&(i[u][n]+=+e)})}}}return t.d3.min(Object.keys(i).map(function(e){return t.d3.min(i[e])}))},r.getYDomainMax=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasPositiveValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e>0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e<0)&&(i[u][n]+=+e)})}}}return t.d3.max(Object.keys(i).map(function(e){return t.d3.max(i[e])}))},r.getYDomain=function(e,t,n){var r=this,i=r.config,s=e.filter(function(e){return r.axis.getId(e.id)===t}),o=n?r.filterByXDomain(s,n):s,u=t==="y2"?i.axis_y2_min:i.axis_y_min,a=t==="y2"?i.axis_y2_max:i.axis_y_max,f=r.getYDomainMin(o),l=r.getYDomainMax(o),h,p,d,v,m,g=t==="y2"?i.axis_y2_center:i.axis_y_center,b,E,S,x,T,N,C=r.hasType("bar",o)&&i.bar_zerobased||r.hasType("area",o)&&i.area_zerobased,k=t==="y2"?i.axis_y2_inverted:i.axis_y_inverted,L=r.hasDataLabel()&&i.axis_rotated,A=r.hasDataLabel()&&!i.axis_rotated;f=c(u)?u:c(a)?f<a?f:a-10:f,l=c(a)?a:c(u)?u<l?l:u+10:l;if(o.length===0)return t==="y2"?r.y2.domain():r.y.domain();isNaN(f)&&(f=0),isNaN(l)&&(l=f),f===l&&(f<0?l=0:f=0),T=f>=0&&l>=0,N=f<=0&&l<=0;if(c(u)&&T||c(a)&&N)C=!1;return C&&(T&&(f=0),N&&(l=0)),p=Math.abs(l-f),d=v=m=p*.1,typeof g!="undefined"&&(b=Math.max(Math.abs(f),Math.abs(l)),l=g+b,f=g-b),L?(E=r.getDataLabelLength(f,l,"width"),S=y(r.y.range()),x=[E[0]/S,E[1]/S],v+=p*(x[1]/(1-x[0]-x[1])),m+=p*(x[0]/(1-x[0]-x[1]))):A&&(E=r.getDataLabelLength(f,l,"height"),v+=r.axis.convertPixelsToAxisPadding(E[1],p),m+=r.axis.convertPixelsToAxisPadding(E[0],p)),t==="y"&&w(i.axis_y_padding)&&(v=r.axis.getPadding(i.axis_y_padding,"top",v,p),m=r.axis.getPadding(i.axis_y_padding,"bottom",m,p)),t==="y2"&&w(i.axis_y2_padding)&&(v=r.axis.getPadding(i.axis_y2_padding,"top",v,p),m=r.axis.getPadding(i.axis_y2_padding,"bottom",m,p)),C&&(T&&(m=f),N&&(v=-l)),h=[f-m,l+v],k?h.reverse():h},r.getXDomainMin=function(e){var t=this,n=t.config;return v(n.axis_x_min)?t.isTimeSeries()?this.parseDate(n.axis_x_min):n.axis_x_min:t.d3.min(e,function(e){return t.d3.min(e.values,function(e){return e.x})})},r.getXDomainMax=function(e){var t=this,n=t.config;return v(n.axis_x_max)?t.isTimeSeries()?this.parseDate(n.axis_x_max):n.axis_x_max:t.d3.max(e,function(e){return t.d3.max(e.values,function(e){return e.x})})},r.getXDomainPadding=function(e){var t=this,n=t.config,r=e[1]-e[0],i,s,o,u;return t.isCategorized()?s=0:t.hasType("bar")?(i=t.getMaxDataCount(),s=i>1?r/(i-1)/2:.5):s=r*.01,typeof n.axis_x_padding=="object"&&w(n.axis_x_padding)?(o=c(n.axis_x_padding.left)?n.axis_x_padding.left:s,u=c(n.axis_x_padding.right)?n.axis_x_padding.right:s):typeof n.axis_x_padding=="number"?o=u=n.axis_x_padding:o=u=s,{left:o,right:u}},r.getXDomain=function(e){var t=this,n=[t.getXDomainMin(e),t.getXDomainMax(e)],r=n[0],i=n[1],s=t.getXDomainPadding(n),o=0,u=0;r-i===0&&!t.isCategorized()&&(t.isTimeSeries()?(r=new Date(r.getTime()*.5),i=new Date(i.getTime()*1.5)):(r=r===0?1:r*.5,i=i===0?-1:i*1.5));if(r||r===0)o=t.isTimeSeries()?new Date(r.getTime()-s.left):r-s.left;if(i||i===0)u=t.isTimeSeries()?new Date(i.getTime()+s.right):i+s.right;return[o,u]},r.updateXDomain=function(e,t,n,r,i){var s=this,o=s.config;return n&&(s.x.domain(i?i:s.d3.extent(s.getXDomain(e))),s.orgXDomain=s.x.domain(),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent(),s.subX.domain(s.x.domain()),s.brush&&s.brush.scale(s.subX)),t&&(s.x.domain(i?i:!s.brush||s.brush.empty()?s.orgXDomain:s.brush.extent()),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent()),r&&s.x.domain(s.trimXDomain(s.x.orgDomain())),s.x.domain()},r.trimXDomain=function(e){var t=this;return e[0]<=t.orgXDomain[0]&&(e[1]=+e[1]+(t.orgXDomain[0]-e[0]),e[0]=t.orgXDomain[0]),t.orgXDomain[1]<=e[1]&&(e[0]=+e[0]-(e[1]-t.orgXDomain[1]),e[1]=t.orgXDomain[1]),e},r.isX=function(e){var t=this,n=t.config;return n.data_x&&e===n.data_x||w(n.data_xs)&&S(n.data_xs,e)},r.isNotX=function(e){return!this.isX(e)},r.getXKey=function(e){var t=this,n=t.config;return n.data_x?n.data_x:w(n.data_xs)?n.data_xs[e]:null},r.getXValuesOfXKey=function(e,t){var n=this,r,i=t&&w(t)?n.mapToIds(t):[];return i.forEach(function(t){n.getXKey(t)===e&&(r=n.data.xs[t])}),r},r.getIndexByX=function(e){var t=this,n=t.filterByX(t.data.targets,e);return n.length?n[0].index:null},r.getXValue=function(e,t){var n=this;return e in n.data.xs&&n.data.xs[e]&&c(n.data.xs[e][t])?n.data.xs[e][t]:t},r.getOtherTargetXs=function(){var e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null},r.getOtherTargetX=function(e){var t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null},r.addXs=function(e){var t=this;Object.keys(e).forEach(function(n){t.config.data_xs[n]=e[n]})},r.hasMultipleX=function(e){return this.d3.set(Object.keys(e).map(function(t){return e[t]})).size()>1},r.isMultipleX=function(){return w(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},r.addName=function(e){var t=this,n;return e&&(n=t.config.data_names[e.id],e.name=n?n:e.id),e},r.getValueOnIndex=function(e,t){var n=e.filter(function(e){return e.index===t});return n.length?n[0]:null},r.updateTargetX=function(e,t){var n=this;e.forEach(function(e){e.values.forEach(function(r,i){r.x=n.generateTargetX(t[i],e.id,i)}),n.data.xs[e.id]=t})},r.updateTargetXs=function(e,t){var n=this;e.forEach(function(e){t[e.id]&&n.updateTargetX([e],t[e.id])})},r.generateTargetX=function(e,t,n){var r=this,i;return r.isTimeSeries()?i=e?r.parseDate(e):r.parseDate(r.getXValue(t,n)):r.isCustomX()&&!r.isCategorized()?i=c(e)?+e:r.getXValue(t,n):i=n,i},r.cloneTarget=function(e){return{id:e.id,id_org:e.id_org,values:e.values.map(function(e){return{x:e.x,value:e.value,id:e.id}})}},r.updateXs=function(){var e=this;e.data.targets.length&&(e.xs=[],e.data.targets[0].values.forEach(function(t){e.xs[t.index]=t.x}))},r.getPrevX=function(e){var t=this.xs[e-1];return typeof t!="undefined"?t:null},r.getNextX=function(e){var t=this.xs[e+1];return typeof t!="undefined"?t:null},r.getMaxDataCount=function(){var e=this;return e.d3.max(e.data.targets,function(e){return e.values.length})},r.getMaxDataCountTarget=function(e){var t=e.length,n=0,r;return t>1?e.forEach(function(e){e.values.length>n&&(r=e,n=e.values.length)}):r=t?e[0]:null,r},r.getEdgeX=function(e){var t=this;return e.length?[t.d3.min(e,function(e){return e.values[0].x}),t.d3.max(e,function(e){return e.values[e.values.length-1].x})]:[0,0]},r.mapToIds=function(e){return e.map(function(e){return e.id})},r.mapToTargetIds=function(e){var t=this;return e?p(e)?[e]:e:t.mapToIds(t.data.targets)},r.hasTarget=function(e,t){var n=this.mapToIds(e),r;for(r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},r.isTargetToShow=function(e){return this.hiddenTargetIds.indexOf(e)<0},r.isLegendToShow=function(e){return this.hiddenLegendIds.indexOf(e)<0},r.filterTargetsToShow=function(e){var t=this;return e.filter(function(e){return t.isTargetToShow(e.id)})},r.mapTargetsToUniqueXs=function(e){var t=this,n=t.d3.set(t.d3.merge(e.map(function(e){return e.values.map(function(e){return+e.x})}))).values();return t.isTimeSeries()?n.map(function(e){return new Date(+e)}):n.map(function(e){return+e})},r.addHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.concat(e)},r.removeHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},r.addHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.concat(e)},r.removeHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},r.getValuesAsIdKeyed=function(e){var t={};return e.forEach(function(e){t[e.id]=[],e.values.forEach(function(n){t[e.id].push(n.value)})}),t},r.checkValueInTargets=function(e,t){var n=Object.keys(e),r,i,s;for(r=0;r<n.length;r++){s=e[n[r]].values;for(i=0;i<s.length;i++)if(t(s[i].value))return!0}return!1},r.hasNegativeValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e<0})},r.hasPositiveValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e>0})},r.isOrderDesc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="desc"},r.isOrderAsc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="asc"},r.orderTargets=function(e){var t=this,n=t.config,r=t.isOrderAsc(),i=t.isOrderDesc();return r||i?e.sort(function(e,t){var n=function(e,t){return e+Math.abs(t.value)},i=e.values.reduce(n,0),s=t.values.reduce(n,0);return r?s-i:i-s}):h(n.data_order)&&e.sort(n.data_order),e},r.filterByX=function(e,t){return this.d3.merge(e.map(function(e){return e.values})).filter(function(e){return e.x-t===0})},r.filterRemoveNull=function(e){return e.filter(function(e){return c(e.value)})},r.filterByXDomain=function(e,t){return e.map(function(e){return{id:e.id,id_org:e.id_org,values:e.values.filter(function(e){return t[0]<=e.x&&e.x<=t[1]})}})},r.hasDataLabel=function(){var e=this.config;return typeof e.data_labels=="boolean"&&e.data_labels?!0:typeof e.data_labels=="object"&&w(e.data_labels)?!0:!1},r.getDataLabelLength=function(e,t,n){var r=this,i=[0,0],s=1.3;return r.selectChart.select("svg").selectAll(".dummy").data([e,t]).enter().append("text").text(function(e){return r.dataLabelFormat(e.id)(e)}).each(function(e,t){i[t]=this.getBoundingClientRect()[n]*s}).remove(),i},r.isNoneArc=function(e){return this.hasTarget(this.data.targets,e.id)},r.isArc=function(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)},r.findSameXOfValues=function(e,t){var n,r=e[t].x,i=[];for(n=t-1;n>=0;n--){if(r!==e[n].x)break;i.push(e[n])}for(n=t;n<e.length;n++){if(r!==e[n].x)break;i.push(e[n])}return i},r.findClosestFromTargets=function(e,t){var n=this,r;return r=e.map(function(e){return n.findClosest(e.values,t)}),n.findClosest(r,t)},r.findClosest=function(e,t){var n=this,r=100,i;return e.filter(function(e){return e&&n.isBarType(e.id)}).forEach(function(e){var t=n.main.select("."+l.bars+n.getTargetSelectorSuffix(e.id)+" ."+l.bar+"-"+e.index).node();!i&&n.isWithinBar(t)&&(i=e)}),e.filter(function(e){return e&&!n.isBarType(e.id)}).forEach(function(e){var s=n.dist(e,t);s<r&&(r=s,i=e)}),i},r.dist=function(e,t){var n=this,r=n.config,i=r.axis_rotated?1:0,s=r.axis_rotated?0:1,o=n.circleY(e,e.index),u=n.x(e.x);return Math.pow(u-t[i],2)+Math.pow(o-t[s],2)},r.convertValuesToStep=function(e){var t=[].concat(e),n;if(!this.isCategorized())return e;for(n=e.length+1;0<n;n--)t[n]=t[n-1];return t[0]={x:t[0].x-1,value:t[0].value,id:t[0].id},t[e.length+1]={x:t[e.length].x+1,value:t[e.length].value,id:t[e.length].id},t},r.updateDataAttributes=function(e,t){var n=this,r=n.config,i=r["data_"+e];return typeof t=="undefined"?i:(Object.keys(t).forEach(function(e){i[e]=t[e]}),n.redraw({withLegend:!0}),i)},r.convertUrlToData=function(e,t,n,r){var i=this,s=t?t:"csv";i.d3.xhr(e,function(e,t){var o;if(!t)throw new Error(e.responseURL+" "+e.status+" ("+e.statusText+")");s==="json"?o=i.convertJsonToData(JSON.parse(t.response),n):s==="tsv"?o=i.convertTsvToData(t.response):o=i.convertCsvToData(t.response),r.call(i,o)})},r.convertXsvToData=function(e,t){var n=t.parseRows(e),r;return n.length===1?(r=[{}],n[0].forEach(function(e){r[0][e]=null})):r=t.parse(e),r},r.convertCsvToData=function(e){return this.convertXsvToData(e,this.d3.csv)},r.convertTsvToData=function(e){return this.convertXsvToData(e,this.d3.tsv)},r.convertJsonToData=function(e,t){var n=this,r=[],i,s;return t?(t.x?(i=t.value.concat(t.x),n.config.data_x=t.x):i=t.value,r.push(i),e.forEach(function(e){var t=[];i.forEach(function(n){var r=d(e[n])?null:e[n];t.push(r)}),r.push(t)}),s=n.convertRowsToData(r)):(Object.keys(e).forEach(function(t){r.push([t].concat(e[t]))}),s=n.convertColumnsToData(r)),s},r.convertRowsToData=function(e){var t=e[0],n={},r=[],i,s;for(i=1;i<e.length;i++){n={};for(s=0;s<e[i].length;s++){if(d(e[i][s]))throw new Error("Source data is missing a component at ("+i+","+s+")!");n[t[s]]=e[i][s]}r.push(n)}return r},r.convertColumnsToData=function(e){var t=[],n,r,i;for(n=0;n<e.length;n++){i=e[n][0];for(r=1;r<e[n].length;r++){d(t[r-1])&&(t[r-1]={});if(d(e[n][r]))throw new Error("Source data is missing a component at ("+n+","+r+")!");t[r-1][i]=e[n][r]}}return t},r.convertDataToTargets=function(e,t){var n=this,r=n.config,i=n.d3.keys(e[0]).filter(n.isNotX,n),s=n.d3.keys(e[0]).filter(n.isX,n),o;return i.forEach(function(i){var o=n.getXKey(i);n.isCustomX()||n.isTimeSeries()?s.indexOf(o)>=0?n.data.xs[i]=(t&&n.data.xs[i]?n.data.xs[i]:[]).concat(e.map(function(e){return e[o]}).filter(c).map(function(e,t){return n.generateTargetX(e,i,t)})):r.data_x?n.data.xs[i]=n.getOtherTargetXs():w(r.data_xs)&&(n.data.xs[i]=n.getXValuesOfXKey(o,n.data.targets)):n.data.xs[i]=e.map(function(e,t){return t})}),i.forEach(function(e){if(!n.data.xs[e])throw new Error('x is not defined for id = "'+e+'".')}),o=i.map(function(t,i){var s=r.data_idConverter(t);return{id:s,id_org:t,values:e.map(function(e,o){var u=n.getXKey(t),a=e[u],f=n.generateTargetX(a,t,o);n.isCustomX()&&n.isCategorized()&&i===0&&a&&(o===0&&(r.axis_x_categories=[]),r.axis_x_categories.push(a));if(d(e[t])||n.data.xs[t].length<=o)f=undefined;return{x:f,value:e[t]!==null&&!isNaN(e[t])?+e[t]:null,id:s}}).filter(function(e){return v(e.x)})}}),o.forEach(function(e){var t;r.data_xSort&&(e.values=e.values.sort(function(e,t){var n=e.x||e.x===0?e.x:Infinity,r=t.x||t.x===0?t.x:Infinity;return n-r})),t=0,e.values.forEach(function(e){e.index=t++}),n.data.xs[e.id].sort(function(e,t){return e-t})}),r.data_type&&n.setTargetType(n.mapToIds(o).filter(function(e){return!(e in r.data_types)}),r.data_type),o.forEach(function(e){n.addCache(e.id_org,e)}),o},r.load=function(e,t){var n=this;e&&(t.filter&&(e=e.filter(t.filter)),(t.type||t.types)&&e.forEach(function(e){var r=t.types&&t.types[e.id]?t.types[e.id]:t.type;n.setTargetType(e.id,r)}),n.data.targets.forEach(function(t){for(var n=0;n<e.length;n++)if(t.id===e[n].id){t.values=e[n].values,e.splice(n,1);break}}),n.data.targets=n.data.targets.concat(e)),n.updateTargets(n.data.targets),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()},r.loadFromArgs=function(e){var t=this;e.data?t.load(t.convertDataToTargets(e.data),e):e.url?t.convertUrlToData(e.url,e.mimeType,e.keys,function(n){t.load(t.convertDataToTargets(n),e)}):e.json?t.load(t.convertDataToTargets(t.convertJsonToData(e.json,e.keys)),e):e.rows?t.load(t.convertDataToTargets(t.convertRowsToData(e.rows)),e):e.columns?t.load(t.convertDataToTargets(t.convertColumnsToData(e.columns)),e):t.load(null,e)},r.unload=function(e,t){var n=this;t||(t=function(){}),e=e.filter(function(e){return n.hasTarget(n.data.targets,e)});if(!e||e.length===0){t();return}n.svg.selectAll(e.map(function(e){return n.selectorTarget(e)})).transition().style("opacity",0).remove().call(n.endall,t),e.forEach(function(e){n.withoutFadeIn[e]=!1,n.legend&&n.legend.selectAll("."+l.legendItem+n.getTargetSelectorSuffix(e)).remove(),n.data.targets=n.data.targets.filter(function(t){return t.id!==e})})},r.categoryName=function(e){var t=this.config;return e<t.axis_x_categories.length?t.axis_x_categories[e]:e},r.initEventRect=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},r.redrawEventRect=function(){var e=this,t=e.config,n,r,i=e.isMultipleX(),s=e.main.select("."+l.eventRects).style("cursor",t.zoom_enabled?t.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,i).classed(l.eventRectsSingle,!i);s.selectAll("."+l.eventRect).remove(),e.eventRect=s.selectAll("."+l.eventRect),i?(n=e.eventRect.data([0]),e.generateEventRectsForMultipleXs(n.enter()),e.updateEventRect(n)):(r=e.getMaxDataCountTarget(e.data.targets),s.datum(r?r.values:[]),e.eventRect=s.selectAll("."+l.eventRect),n=e.eventRect.data(function(e){return e}),e.generateEventRectsForSingleX(n.enter()),e.updateEventRect(n),n.exit().remove())},r.updateEventRect=function(e){var t=this,n=t.config,r,i,s,o,u,a;e=e||t.eventRect.data(function(e){return e}),t.isMultipleX()?(r=0,i=0,s=t.width,o=t.height):((t.isCustomX()||t.isTimeSeries())&&!t.isCategorized()?(t.updateXs(),u=function(e){var r=t.getPrevX(e.index),i=t.getNextX(e.index);return r===null&&i===null?n.axis_rotated?t.height:t.width:(r===null&&(r=t.x.domain()[0]),i===null&&(i=t.x.domain()[1]),Math.max(0,(t.x(i)-t.x(r))/2))},a=function(e){var n=t.getPrevX(e.index),r=t.getNextX(e.index),i=t.data.xs[e.id][e.index];return n===null&&r===null?0:(n===null&&(n=t.x.domain()[0]),(t.x(i)+t.x(n))/2)}):(u=t.getEventRectWidth(),a=function(e){return t.x(e.x)-u/2}),r=n.axis_rotated?0:a,i=n.axis_rotated?a:0,s=n.axis_rotated?t.width:u,o=n.axis_rotated?u:t.height),e.attr("class",t.classEvent.bind(t)).attr("x",r).attr("y",i).attr("width",s).attr("height",o)},r.generateEventRectsForSingleX=function(e){var t=this,n=t.d3,r=t.config;e.append("rect").attr("class",t.classEvent.bind(t)).style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("mouseover",function(e){var n=e.index;if(t.dragging||t.flowing)return;if(t.hasArcType())return;r.point_focus_expand_enabled&&t.expandCircles(n,null,!0),t.expandBars(n,null,!0),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseover.call(t.api,e)})}).on("mouseout",function(e){var n=e.index;if(!t.config)return;if(t.hasArcType())return;t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars(),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseout.call(t.api,e)})}).on("mousemove",function(e){var i,s=e.index,o=t.svg.select("."+l.eventRect+"-"+s);if(t.dragging||t.flowing)return;if(t.hasArcType())return;t.isStepType(e)&&t.config.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,s))&&(s-=1),i=t.filterTargetsToShow(t.data.targets).map(function(e){return t.addName(t.getValueOnIndex(e.values,s))}),r.tooltip_grouped&&(t.showTooltip(i,this),t.showXGridFocus(i));if(r.tooltip_grouped&&(!r.data_selection_enabled||r.data_selection_grouped))return;t.main.selectAll("."+l.shape+"-"+s).each(function(){n.select(this).classed(l.EXPANDED,!0),r.data_selection_enabled&&o.style("cursor",r.data_selection_grouped?"pointer":null),r.tooltip_grouped||(t.hideXGridFocus(),t.hideTooltip(),r.data_selection_grouped||(t.unexpandCircles(s),t.unexpandBars(s)))}).filter(function(e){return t.isWithinShape(this,e)}).each(function(e){r.data_selection_enabled&&(r.data_selection_grouped||r.data_selection_isselectable(e))&&o.style("cursor","pointer"),r.tooltip_grouped||(t.showTooltip([e],this),t.showXGridFocus([e]),r.point_focus_expand_enabled&&t.expandCircles(s,e.id,!0),t.expandBars(s,e.id,!0))})}).on("click",function(e){var i=e.index;if(t.hasArcType()||!t.toggleShape)return;if(t.cancelClick){t.cancelClick=!1;return}t.isStepType(e)&&r.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,i))&&(i-=1),t.main.selectAll("."+l.shape+"-"+i).each(function(e){if(r.data_selection_grouped||t.isWithinShape(this,e))t.toggleShape(this,e,i),t.config.data_onclick.call(t.api,e,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.generateEventRectsForMultipleXs=function(e){function i(){t.svg.select("."+l.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()}var t=this,n=t.d3,r=t.config;e.append("rect").attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).attr("class",l.eventRect).on("mouseout",function(){if(!t.config)return;if(t.hasArcType())return;i()}).on("mousemove",function(){var e=t.filterTargetsToShow(t.data.targets),s,o,u,a;if(t.dragging)return;if(t.hasArcType(e))return;s=n.mouse(this),o=t.findClosestFromTargets(e,s),t.mouseover&&(!o||o.id!==t.mouseover.id)&&(r.data_onmouseout.call(t.api,t.mouseover),t.mouseover=undefined);if(!o){i();return}t.isScatterType(o)||!r.tooltip_grouped?u=[o]:u=t.filterByX(e,o.x),a=u.map(function(e){return t.addName(e)}),t.showTooltip(a,this),r.point_focus_expand_enabled&&t.expandCircles(o.index,o.id,!0),t.expandBars(o.index,o.id,!0),t.showXGridFocus(a);if(t.isBarType(o.id)||t.dist(o,s)<100)t.svg.select("."+l.eventRect).style("cursor","pointer"),t.mouseover||(r.data_onmouseover.call(t.api,o),t.mouseover=o)}).on("click",function(){var e=t.filterTargetsToShow(t.data.targets),i,s;if(t.hasArcType(e))return;i=n.mouse(this),s=t.findClosestFromTargets(e,i);if(!s)return;(t.isBarType(s.id)||t.dist(s,i)<100)&&t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(s.id)).selectAll("."+l.shape+"-"+s.index).each(function(){if(r.data_selection_grouped||t.isWithinShape(this,s))t.toggleShape(this,s,s.index),t.config.data_onclick.call(t.api,s,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.dispatchEvent=function(t,n,r){var i=this,s="."+l.eventRect+(i.isMultipleX()?"":"-"+n),o=i.main.select(s).node(),u=o.getBoundingClientRect(),a=u.left+(r?r[0]:0),f=u.top+(r?r[1]:0),c=document.createEvent("MouseEvents");c.initMouseEvent(t,!0,!0,e,0,a,f,a,f,!1,!1,!1,!1,0,null),o.dispatchEvent(c)},r.getCurrentWidth=function(){var e=this,t=e.config;return t.size_width?t.size_width:e.getParentWidth()},r.getCurrentHeight=function(){var e=this,t=e.config,n=t.size_height?t.size_height:e.getParentHeight();return n>0?n:320/(e.hasType("gauge")?2:1)},r.getCurrentPaddingTop=function(){var e=this.config;return c(e.padding_top)?e.padding_top:0},r.getCurrentPaddingBottom=function(){var e=this.config;return c(e.padding_bottom)?e.padding_bottom:0},r.getCurrentPaddingLeft=function(e){var t=this,n=t.config;return c(n.padding_left)?n.padding_left:n.axis_rotated?n.axis_x_show?Math.max(m(t.getAxisWidthByAxisId("x",e)),40):1:!n.axis_y_show||n.axis_y_inner?t.axis.getYAxisLabelPosition().isOuter?30:1:m(t.getAxisWidthByAxisId("y",e))},r.getCurrentPaddingRight=function(){var e=this,t=e.config,n=10,r=e.isLegendRight?e.getLegendWidth()+20:0;return c(t.padding_right)?t.padding_right+1:t.axis_rotated?n+r:!t.axis_y2_show||t.axis_y2_inner?2+r+(e.axis.getY2AxisLabelPosition().isOuter?20:0):m(e.getAxisWidthByAxisId("y2"))+r},r.getParentRectValue=function(e){var t=this.selectChart.node(),n;while(t&&t.tagName!=="BODY"){try{n=t.getBoundingClientRect()[e]}catch(r){e==="width"&&(n=t.offsetWidth)}if(n)break;t=t.parentNode}return n},r.getParentWidth=function(){return this.getParentRectValue("width")},r.getParentHeight=function(){var e=this.selectChart.style("height");return e.indexOf("px")>0?+e.replace("px",""):0},r.getSvgLeft=function(e){var t=this,n=t.config,r=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,i=n.axis_rotated?l.axisX:l.axisY,s=t.main.select("."+i).node(),o=s&&r?s.getBoundingClientRect():{right:0},u=t.selectChart.node().getBoundingClientRect(),a=t.hasArcType(),f=o.right-u.left-(a?0:t.getCurrentPaddingLeft(e));return f>0?f:0},r.getAxisWidthByAxisId=function(e,t){var n=this,r=n.axis.getLabelPositionById(e);return n.axis.getMaxTickWidth(e,t)+(r.isInner?20:40)},r.getHorizontalAxisHeight=function(e){var t=this,n=t.config,r=30;return e==="x"&&!n.axis_x_show?8:e==="x"&&n.axis_x_height?n.axis_x_height:e==="y"&&!n.axis_y_show?n.legend_show&&!t.isLegendRight&&!t.isLegendInset?10:1:e==="y2"&&!n.axis_y2_show?t.rotated_padding_top:(e==="x"&&!n.axis_rotated&&n.axis_x_tick_rotate&&(r=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-n.axis_x_tick_rotate)/180)),r+(t.axis.getLabelPositionById(e).isInner?0:10)+(e==="y2"?-10:0))},r.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},r.getShapeIndices=function(e){var t=this,n=t.config,r={},i=0,s,o;return t.filterTargetsToShow(t.data.targets.filter(e,t)).forEach(function(e){for(s=0;s<n.data_groups.length;s++){if(n.data_groups[s].indexOf(e.id)<0)continue;for(o=0;o<n.data_groups[s].length;o++)if(n.data_groups[s][o]in r){r[e.id]=r[n.data_groups[s][o]];break}}d(r[e.id])&&(r[e.id]=i++)}),r.__max__=i-1,r},r.getShapeX=function(e,t,n,r){var i=this,s=r?i.subX:i.x;return function(r){var i=r.id in n?n[r.id]:0;return r.x||r.x===0?s(r.x)-e*(t/2-i):0}},r.getShapeY=function(e){var t=this;return function(n){var r=e?t.getSubYScale(n.id):t.getYScale(n.id);return r(n.value)}},r.getShapeOffset=function(e,t,n){var r=this,i=r.orderTargets(r.filterTargetsToShow(r.data.targets.filter(e,r))),s=i.map(function(e){return e.id});return function(e,o){var u=n?r.getSubYScale(e.id):r.getYScale(e.id),a=u(0),f=a;return i.forEach(function(n){var i=r.isStepType(e)?r.convertValuesToStep(n.values):n.values;if(n.id===e.id||t[n.id]!==t[e.id])return;s.indexOf(n.id)<s.indexOf(e.id)&&i[o].value*e.value>=0&&(f+=u(i[o].value)-a)}),f}},r.isWithinShape=function(e,t){var n=this,r=n.d3.select(e),i;return n.isTargetToShow(t.id)?e.nodeName==="circle"?i=n.isStepType(t)?n.isWithinStep(e,n.getYScale(t.id)(t.value)):n.isWithinCircle(e,n.pointSelectR(t)*1.5):e.nodeName==="path"&&(i=r.classed(l.bar)?n.isWithinBar(e):!0):i=!1,i},r.getInterpolate=function(e){var t=this;return t.isSplineType(e)?"cardinal":t.isStepType(e)?t.config.line_step_type:"linear"},r.initLine=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartLines)},r.updateTargetsForLine=function(e){var t=this,n=t.config,r,i,s=t.classChartLine.bind(t),o=t.classLines.bind(t),u=t.classAreas.bind(t),a=t.classCircles.bind(t),f=t.classFocus.bind(t);r=t.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",function(e){return s(e)+f(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o),i.append("g").attr("class",u),i.append("g").attr("class",function(e){return t.generateClass(l.selectedCircles,e.id)}),i.append("g").attr("class",a).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null}),e.forEach(function(e){t.main.selectAll("."+l.selectedCircles+t.getTargetSelectorSuffix(e.id)).selectAll("."+l.selectedCircle).each(function(t){t.value=e.values[t.index].value})})},r.updateLine=function(e){var t=this;t.mainLine=t.main.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.mainLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.mainLine.style("opacity",t.initialOpacity.bind(t)).style("shape-rendering",function(e){return t.isStepType(e)?"crispEdges":""}).attr("transform",null),t.mainLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLine=function(e,t){return[(t?this.mainLine.transition():this.mainLine).attr("d",e).style("stroke",this.color).style("opacity",1)]},r.generateDrawLine=function(e,t){var n=this,r=n.config,i=n.d3.svg.line(),s=n.generateGetLinePoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x(a).y(u):i.x(u).y(a),r.line_connectNull||(i=i.defined(function(e){return e.value!=null})),function(e){var s=r.line_connectNull?n.filterRemoveNull(e.values):e.values,u=t?n.x:n.subX,a=o.call(n,e.id),f=0,l=0,c;return n.isLineType(e)?r.data_regions[e.id]?c=n.lineWithRegions(s,u,a,r.data_regions[e.id]):(n.isStepType(e)&&(s=n.convertValuesToStep(s)),c=i.interpolate(n.getInterpolate(e))(s)):(s[0]&&(f=u(s[0].x),l=a(s[0].value)),c=r.axis_rotated?"M "+l+" "+f:"M "+f+" "+l),c?c:"M 0 0"}},r.generateGetLinePoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isLineType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)]]}},r.lineWithRegions=function(e,t,n,r){function T(e,t){var n;for(n=0;n<t.length;n++)if(t[n].start<e&&e<=t[n].end)return!0;return!1}function N(e){return"M"+e[0][0]+" "+e[0][1]+" "+e[1][0]+" "+e[1][1]}var i=this,s=i.config,o=-1,u,a,f="M",l,c,h,p,m,g,y,b,w=i.isCategorized()?.5:0,E,S,x=[];if(v(r))for(u=0;u<r.length;u++)x[u]={},d(r[u].start)?x[u].start=e[0].x:x[u].start=i.isTimeSeries()?i.parseDate(r[u].start):r[u].start,d(r[u].end)?x[u].end=e[e.length-1].x:x[u].end=i.isTimeSeries()?i.parseDate(r[u].end):r[u].end;E=s.axis_rotated?function(e){return n(e.value)}:function(e){return t(e.x)},S=s.axis_rotated?function(e){return t(e.x)}:function(e){return n(e.value)},i.isTimeSeries()?l=function(e,r,i,o){var u=e.x.getTime(),a=r.x-e.x,f=new Date(u+a*i),l=new Date(u+a*(i+o)),c;return s.axis_rotated?c=[[n(h(i)),t(f)],[n(h(i+o)),t(l)]]:c=[[t(f),n(h(i))],[t(l),n(h(i+o))]],N(c)}:l=function(e,r,i,o){var u;return s.axis_rotated?u=[[n(h(i),!0),t(c(i))],[n(h(i+o),!0),t(c(i+o))]]:u=[[t(c(i),!0),n(h(i))],[t(c(i+o),!0),n(h(i+o))]],N(u)};for(u=0;u<e.length;u++){if(d(x)||!T(e[u].x,x))f+=" "+E(e[u])+" "+S(e[u]);else{c=i.getScale(e[u-1].x+w,e[u].x+w,i.isTimeSeries()),h=i.getScale(e[u-1].value,e[u].value),p=t(e[u].x)-t(e[u-1].x),m=n(e[u].value)-n(e[u-1].value),g=Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),y=2/g,b=y*2;for(a=y;a<=1;a+=b)f+=l(e[u-1],e[u],a,y)}o=e[u].x}return f},r.updateArea=function(e){var t=this,n=t.d3;t.mainArea=t.main.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.mainArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.mainArea.style("opacity",t.orgAreaOpacity),t.mainArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawArea=function(e,t){return[(t?this.mainArea.transition():this.mainArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},r.generateDrawArea=function(e,t){var n=this,r=n.config,i=n.d3.svg.area(),s=n.generateGetAreaPoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(n.getAreaBaseValue(e.id))},f=function(e,t){return r.data_groups.length>0?s(e,t)[1][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x0(a).x1(f).y(u):i.x(u).y0(a).y1(f),r.line_connectNull||(i=i.defined(function(e){return e.value!==null})),function(e){var t=r.line_connectNull?n.filterRemoveNull(e.values):e.values,s=0,o=0,u;return n.isAreaType(e)?(n.isStepType(e)&&(t=n.convertValuesToStep(t)),u=i.interpolate(n.getInterpolate(e))(t)):(t[0]&&(s=n.x(t[0].x),o=n.getYScale(e.id)(t[0].value)),u=r.axis_rotated?"M "+o+" "+s:"M "+s+" "+o),u?u:"M 0 0"}},r.getAreaBaseValue=function(){return 0},r.generateGetAreaPoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isAreaType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,f],[l,c-(i-f)],[l,c-(i-f)],[l,f]]}},r.updateCircle=function(){var e=this;e.mainCircle=e.main.selectAll("."+l.circles).selectAll("."+l.circle).data(e.lineOrScatterData.bind(e)),e.mainCircle.enter().append("circle").attr("class",e.classCircle.bind(e)).attr("r",e.pointR.bind(e)).style("fill",e.color),e.mainCircle.style("opacity",e.initialOpacityForCircle.bind(e)),e.mainCircle.exit().remove()},r.redrawCircle=function(e,t,n){var r=this.main.selectAll("."+l.selectedCircle);return[(n?this.mainCircle.transition():this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",e).attr("cy",t),(n?r.transition():r).attr("cx",e).attr("cy",t)]},r.circleX=function(e){return e.x||e.x===0?this.x(e.x):null},r.updateCircleY=function(){var e=this,t,n;e.config.data_groups.length>0?(t=e.getShapeIndices(e.isLineType),n=e.generateGetLinePoints(t),e.circleY=function(e,t){return n(e,t)[0][1]}):e.circleY=function(t){return e.getYScale(t.id)(t.value)}},r.getCircles=function(e,t){var n=this;return(t?n.main.selectAll("."+l.circles+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.circle+(c(e)?"-"+e:""))},r.expandCircles=function(e,t,n){var r=this,i=r.pointExpandedR.bind(r);n&&r.unexpandCircles(),r.getCircles(e,t).classed(l.EXPANDED,!0).attr("r",i)},r.unexpandCircles=function(e){var t=this,n=t.pointR.bind(t);t.getCircles(e).filter(function(){return t.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",n)},r.pointR=function(e){var t=this,n=t.config;return t.isStepType(e)?0:h(n.point_r)?n.point_r(e):n.point_r},r.pointExpandedR=function(e){var t=this,n=t.config;return n.point_focus_expand_enabled?n.point_focus_expand_r?n.point_focus_expand_r:t.pointR(e)*1.75:t.pointR(e)},r.pointSelectR=function(e){var t=this,n=t.config;return n.point_select_r?n.point_select_r:t.pointR(e)*4},r.isWithinCircle=function(e,t){var n=this.d3,r=n.mouse(e),i=n.select(e),s=+i.attr("cx"),o=+i.attr("cy");return Math.sqrt(Math.pow(s-r[0],2)+Math.pow(o-r[1],2))<t},r.isWithinStep=function(e,t){return Math.abs(t-this.d3.mouse(e)[1])<30},r.initBar=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartBars)},r.updateTargetsForBar=function(e){var t=this,n=t.config,r,i,s=t.classChartBar.bind(t),o=t.classBars.bind(t),u=t.classFocus.bind(t);r=t.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",function(e){return s(e)+u(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null})},r.updateBar=function(e){var t=this,n=t.barData.bind(t),r=t.classBar.bind(t),i=t.initialOpacity.bind(t),s=function(e){return t.color(e.id)};t.mainBar=t.main.selectAll("."+l.bars).selectAll("."+l.bar).data(n),t.mainBar.enter().append("path").attr("class",r).style("stroke",s).style("fill",s),t.mainBar.style("opacity",i),t.mainBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBar=function(e,t){return[(t?this.mainBar.transition():this.mainBar).attr("d",e).style("fill",this.color).style("opacity",1)]},r.getBarW=function(e,t){var n=this,r=n.config,i=typeof r.bar_width=="number"?r.bar_width:t?e.tickInterval()*r.bar_width_ratio/t:0;return r.bar_width_max&&i>r.bar_width_max?r.bar_width_max:i},r.getBars=function(e,t){var n=this;return(t?n.main.selectAll("."+l.bars+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.bar+(c(e)?"-"+e:""))},r.expandBars=function(e,t,n){var r=this;n&&r.unexpandBars(),r.getBars(e,t).classed(l.EXPANDED,!0)},r.unexpandBars=function(e){var t=this;t.getBars(e).classed(l.EXPANDED,!1)},r.generateDrawBar=function(e,t){var n=this,r=n.config,i=n.generateGetBarPoints(e,t);return function(e,t){var n=i(e,t),s=r.axis_rotated?1:0,o=r.axis_rotated?0:1,u="M "+n[0][s]+","+n[0][o]+" "+"L"+n[1][s]+","+n[1][o]+" "+"L"+n[2][s]+","+n[2][o]+" "+"L"+n[3][s]+","+n[3][o]+" "+"z";return u}},r.generateGetBarPoints=function(e,t){var n=this,r=t?n.subXAxis:n.xAxis,i=e.__max__+1,s=n.getBarW(r,i),o=n.getShapeX(s,i,e,!!t),u=n.getShapeY(!!t),a=n.getShapeOffset(n.isBarType,e,!!t),f=t?n.getSubYScale:n.getYScale;return function(e,t){var r=f.call(n,e.id)(0),i=a(e,t)||r,l=o(e),c=u(e);return n.config.axis_rotated&&(0<e.value&&c<r||e.value<0&&r<c)&&(c=r),[[l,i],[l,c-(r-i)],[l+s,c-(r-i)],[l+s,i]]}},r.isWithinBar=function(e){var t=this.d3.mouse(e),n=e.getBoundingClientRect(),r=e.pathSegList.getItem(0),i=e.pathSegList.getItem(1),s=Math.min(r.x,i.x),o=Math.min(r.y,i.y),u=n.width,a=n.height,f=2,l=s-f,c=s+u+f,h=o+a+f,p=o-f;return l<t[0]&&t[0]<c&&p<t[1]&&t[1]<h},r.initText=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartTexts),e.mainText=e.d3.selectAll([])},r.updateTargetsForText=function(e){var t=this,n,r,i=t.classChartText.bind(t),s=t.classTexts.bind(t),o=t.classFocus.bind(t);n=t.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(e).attr("class",function(e){return i(e)+o(e)}),r=n.enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none"),r.append("g").attr("class",s)},r.updateText=function(e){var t=this,n=t.config,r=t.barOrLineData.bind(t),i=t.classText.bind(t);t.mainText=t.main.selectAll("."+l.texts).selectAll("."+l.text).data(r),t.mainText.enter().append("text").attr("class",i).attr("text-anchor",function(e){return n.axis_rotated?e.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(e){return t.color(e)}).style("fill-opacity",0),t.mainText.text(function(e,n,r){return t.dataLabelFormat(e.id)(e.value,e.id,n,r)}),t.mainText.exit().transition().duration(e).style("fill-opacity",0).remove()},r.redrawText=function(e,t,n,r){return[(r?this.mainText.transition():this.mainText).attr("x",e).attr("y",t).style("fill",this.color).style("fill-opacity",n?0:this.opacityForText.bind(this))]},r.getTextRect=function(e,t){var n=this.d3.select("body").append("div").classed("c3",!0),r=n.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),i;return r.selectAll(".dummy").data([e]).enter().append("text").classed(t?t:"",!0).text(e).each(function(){i=this.getBoundingClientRect()}),n.remove(),i},r.generateXYForText=function(e,t,n,r){var i=this,s=i.generateGetAreaPoints(e,!1),o=i.generateGetBarPoints(t,!1),u=i.generateGetLinePoints(n,!1),a=r?i.getXForText:i.getYForText;return function(e,t){var n=i.isAreaType(e)?s:i.isBarType(e)?o:u;return a.call(i,n(e,t),e,this)}},r.getXForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s,o;return r.config.axis_rotated?(o=r.isBarType(t)?4:6,s=e[2][1]+o*(t.value<0?-1:1)):s=r.hasType("bar")?(e[2][0]+e[0][0])/2:e[0][0],t.value===null&&(s>r.width?s=r.width-i.width:s<0&&(s=4)),s},r.getYForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s;return r.config.axis_rotated?s=(e[0][0]+e[2][0]+i.height*.6)/2:(s=e[2][1],t.value<0?(s+=i.height,r.isBarType(t)&&r.isSafari()?s-=3:!r.isBarType(t)&&r.isChrome()&&(s+=3)):s+=r.isBarType(t)?-3:-6),t.value===null&&!r.config.axis_rotated&&(s<i.height?s=i.height:s>this.height&&(s=this.height-4)),s},r.setTargetType=function(e,t){var n=this,r=n.config;n.mapToTargetIds(e).forEach(function(e){n.withoutFadeIn[e]=t===r.data_types[e],r.data_types[e]=t}),e||(r.data_type=t)},r.hasType=function(e,t){var n=this,r=n.config.data_types,i=!1;return t=t||n.data.targets,t&&t.length?t.forEach(function(t){var n=r[t.id];if(n&&n.indexOf(e)>=0||!n&&e==="line")i=!0}):Object.keys(r).length?Object.keys(r).forEach(function(t){r[t]===e&&(i=!0)}):i=n.config.data_type===e,i},r.hasArcType=function(e){return this.hasType("pie",e)||this.hasType("donut",e)||this.hasType("gauge",e)},r.isLineType=function(e){var t=this.config,n=p(e)?e:e.id;return!t.data_types[n]||["line","spline","area","area-spline","step","area-step"].indexOf(t.data_types[n])>=0},r.isStepType=function(e){var t=p(e)?e:e.id;return["step","area-step"].indexOf(this.config.data_types[t])>=0},r.isSplineType=function(e){var t=p(e)?e:e.id;return["spline","area-spline"].indexOf(this.config.data_types[t])>=0},r.isAreaType=function(e){var t=p(e)?e:e.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[t])>=0},r.isBarType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="bar"},r.isScatterType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="scatter"},r.isPieType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="pie"},r.isGaugeType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="gauge"},r.isDonutType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="donut"},r.isArcType=function(e){return this.isPieType(e)||this.isDonutType(e)||this.isGaugeType(e)},r.lineData=function(e){return this.isLineType(e)?[e]:[]},r.arcData=function(e){return this.isArcType(e.data)?[e]:[]},r.barData=function(e){return this.isBarType(e)?e.values:[]},r.lineOrScatterData=function(e){return this.isLineType(e)||this.isScatterType(e)?e.values:[]},r.barOrLineData=function(e){return this.isBarType(e)||this.isLineType(e)?e.values:[]},r.initGrid=function(){var e=this,t=e.config,n=e.d3;e.grid=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid),t.grid_x_show&&e.grid.append("g").attr("class",l.xgrids),t.grid_y_show&&e.grid.append("g").attr("class",l.ygrids),t.grid_focus_show&&e.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),e.xgrid=n.selectAll([]),t.grid_lines_front||e.initGridLines()},r.initGridLines=function(){var e=this,t=e.d3;e.gridLines=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),e.gridLines.append("g").attr("class",l.xgridLines),e.gridLines.append("g").attr("class",l.ygridLines),e.xgridLines=t.selectAll([])},r.updateXGrid=function(e){var t=this,n=t.config,r=t.d3,i=t.generateGridData(n.grid_x_type,t.x),s=t.isCategorized()?t.xAxis.tickOffset():0;t.xgridAttr=n.axis_rotated?{x1:0,x2:t.width,y1:function(e){return t.x(e)-s},y2:function(e){return t.x(e)-s}}:{x1:function(e){return t.x(e)+s},x2:function(e){return t.x(e)+s},y1:0,y2:t.height},t.xgrid=t.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(i),t.xgrid.enter().append("line").attr("class",l.xgrid),e||t.xgrid.attr(t.xgridAttr).style("opacity",function(){return+r.select(this).attr(n.axis_rotated?"y1":"x1")===(n.axis_rotated?t.height:0)?0:1}),t.xgrid.exit().remove()},r.updateYGrid=function(){var e=this,t=e.config,n=e.yAxis.tickValues()||e.y.ticks(t.grid_y_ticks);e.ygrid=e.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(n),e.ygrid.enter().append("line").attr("class",l.ygrid),e.ygrid.attr("x1",t.axis_rotated?e.y:0).attr("x2",t.axis_rotated?e.y:e.width).attr("y1",t.axis_rotated?0:e.y).attr("y2",t.axis_rotated?e.height:e.y),e.ygrid.exit().remove(),e.smoothLines(e.ygrid,"grid")},r.gridTextAnchor=function(e){return e.position?e.position:"end"},r.gridTextDx=function(e){return e.position==="start"?4:e.position==="middle"?0:-4},r.xGridTextX=function(e){return e.position==="start"?-this.height:e.position==="middle"?-this.height/2:0},r.yGridTextX=function(e){return e.position==="start"?0:e.position==="middle"?this.width/2:this.width},r.updateGrid=function(e){var t=this,n=t.main,r=t.config,i,s,o;t.grid.style("visibility",t.hasArcType()?"hidden":"visible"),n.select("line."+l.xgridFocus).style("visibility","hidden"),r.grid_x_show&&t.updateXGrid(),t.xgridLines=n.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(r.grid_x_lines),i=t.xgridLines.enter().append("g").attr("class",function(e){return l.xgridLine+(e["class"]?" "+e["class"]:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"":"rotate(-90)").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),t.xgridLines.exit().transition().duration(e).style("opacity",0).remove(),r.grid_y_show&&t.updateYGrid(),t.ygridLines=n.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(r.grid_y_lines),s=t.ygridLines.enter().append("g").attr("class",function(e){return l.ygridLine+(e["class"]?" "+e["class"]:"")}),s.append("line").style("opacity",0),s.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"rotate(-90)":"").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),o=t.yv.bind(t),t.ygridLines.select("line").transition().duration(e).attr("x1",r.axis_rotated?o:0).attr("x2",r.axis_rotated?o:t.width).attr("y1",r.axis_rotated?0:o).attr("y2",r.axis_rotated?t.height:o).style("opacity",1),t.ygridLines.select("text").transition().duration(e).attr("x",r.axis_rotated?t.xGridTextX.bind(t):t.yGridTextX.bind(t)).attr("y",o).text(function(e){return e.text}).style("opacity",1),t.ygridLines.exit().transition().duration(e).style("opacity",0).remove()},r.redrawGrid=function(e){var t=this,n=t.config,r=t.xv.bind(t),i=t.xgridLines.select("line"),s=t.xgridLines.select("text");return[(e?i.transition():i).attr("x1",n.axis_rotated?0:r).attr("x2",n.axis_rotated?t.width:r).attr("y1",n.axis_rotated?r:0).attr("y2",n.axis_rotated?r:t.height).style("opacity",1),(e?s.transition():s).attr("x",n.axis_rotated?t.yGridTextX.bind(t):t.xGridTextX.bind(t)).attr("y",r).text(function(e){return e.text}).style("opacity",1)]},r.showXGridFocus=function(e){var t=this,n=t.config,r=e.filter(function(e){return e&&c(e.value)}),i=t.main.selectAll("line."+l.xgridFocus),s=t.xx.bind(t);if(!n.tooltip_show)return;if(t.hasType("scatter")||t.hasArcType())return;i.style("visibility","visible").data([r[0]]).attr(n.axis_rotated?"y1":"x1",s).attr(n.axis_rotated?"y2":"x2",s),t.smoothLines(i,"grid")},r.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},r.updateXgridFocus=function(){var e=this,t=e.config;e.main.select("line."+l.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?e.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:e.height)},r.generateGridData=function(e,t){var n=this,r=[],i,s,o,u,a=n.main.select("."+l.axisX).selectAll(".tick").size();if(e==="year"){i=n.getXDomain(),s=i[0].getFullYear(),o=i[1].getFullYear();for(u=s;u<=o;u++)r.push(new Date(u+"-01-01 00:00:00"))}else r=t.ticks(10),r.length>a&&(r=r.filter(function(e){return(""+e).indexOf(".")<0}));return r},r.getGridFilterToRemove=function(e){return e?function(t){var n=!1;return[].concat(e).forEach(function(e){if("value"in e&&t.value===e.value||"class"in e&&t["class"]===e["class"])n=!0}),n}:function(){return!0}},r.removeGridLines=function(e,t){var n=this,r=n.config,i=n.getGridFilterToRemove(e),s=function(e){return!i(e)},o=t?l.xgridLines:l.ygridLines,u=t?l.xgridLine:l.ygridLine;n.main.select("."+o).selectAll("."+u).filter(i).transition().duration(r.transition_duration).style("opacity",0).remove(),t?r.grid_x_lines=r.grid_x_lines.filter(s):r.grid_y_lines=r.grid_y_lines.filter(s)},r.initTooltip=function(){var e=this,t=e.config,n;e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none");if(t.tooltip_init_show){if(e.isTimeSeries()&&p(t.tooltip_init_x)){t.tooltip_init_x=e.parseDate(t.tooltip_init_x);for(n=0;n<e.data.targets[0].values.length;n++)if(e.data.targets[0].values[n].x-t.tooltip_init_x===0)break;t.tooltip_init_x=n}e.tooltip.html(t.tooltip_contents.call(e,e.data.targets.map(function(n){return e.addName(n.values[t.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",t.tooltip_init_position.top).style("left",t.tooltip_init_position.left).style("display","block")}},r.getTooltipContent=function(e,t,n,r){var i=this,s=i.config,o=s.tooltip_format_title||t,u=s.tooltip_format_name||function(e){return e},a=s.tooltip_format_value||n,f,c,h,p,d,v;for(c=0;c<e.length;c++){if(!e[c]||!e[c].value&&e[c].value!==0)continue;f||(h=o?o(e[c].x):e[c].x,f="<table class='"+l.tooltip+"'>"+(h||h===0?"<tr><th colspan='2'>"+h+"</th></tr>":"")),p=a(e[c].value,e[c].ratio,e[c].id,e[c].index),p!==undefined&&(d=u(e[c].name,e[c].ratio,e[c].id,e[c].index),v=i.levelColor?i.levelColor(e[c].value):r(e[c].id),f+="<tr class='"+l.tooltipName+"-"+e[c].id+"'>",f+="<td class='name'><span style='background-color:"+v+"'></span>"+d+"</td>",f+="<td class='value'>"+p+"</td>",f+="</tr>")}return f+"</table>"},r.tooltipPosition=function(e,t,n,r){var i=this,s=i.config,o=i.d3,u,a,f,l,c,h=i.hasArcType(),p=o.mouse(r);return h?(a=(i.width-(i.isLegendRight?i.getLegendWidth():0))/2+p[0],l=i.height/2+p[1]+20):(u=i.getSvgLeft(!0),s.axis_rotated?(a=u+p[0]+100,f=a+t,c=i.currentWidth-i.getCurrentPaddingRight(),l=i.x(e[0].x)+20):(a=u+i.getCurrentPaddingLeft(!0)+i.x(e[0].x)+20,f=a+t,c=u+i.currentWidth-i.getCurrentPaddingRight(),l=p[1]+15),f>c&&(a-=f-c+20),l+n>i.currentHeight&&(l-=n+30)),l<0&&(l=0),{top:l,left:a}},r.showTooltip=function(e,t){var n=this,i=n.config,s,o,u,a=n.hasArcType(),f=e.filter(function(e){return e&&c(e.value)}),l=i.tooltip_position||r.tooltipPosition;if(f.length===0||!i.tooltip_show)return;n.tooltip.html(i.tooltip_contents.call(n,e,n.axis.getXAxisTickFormat(),n.getYFormat(a),n.color)).style("display","block"),s=n.tooltip.property("offsetWidth"),o=n.tooltip.property("offsetHeight"),u=l.call(this,f,s,o,t),n.tooltip.style("top",u.top+"px").style("left",u.left+"px")},r.hideTooltip=function(){this.tooltip.style("display","none")},r.initLegend=function(){var e=this;e.legendItemTextBox={},e.legendHasRendered=!1,e.legend=e.svg.append("g").attr("transform",e.getTranslate("legend"));if(!e.config.legend_show){e.legend.style("visibility","hidden"),e.hiddenLegendIds=e.mapToIds(e.data.targets);return}e.updateLegendWithDefaults()},r.updateLegendWithDefaults=function(){var e=this;e.updateLegend(e.mapToIds(e.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},r.updateSizeForLegend=function(e,t){var n=this,r=n.config,i={top:n.isLegendTop?n.getCurrentPaddingTop()+r.legend_inset_y+5.5:n.currentHeight-e-n.getCurrentPaddingBottom()-r.legend_inset_y,left:n.isLegendLeft?n.getCurrentPaddingLeft()+r.legend_inset_x+.5:n.currentWidth-t-n.getCurrentPaddingRight()-r.legend_inset_x+.5};n.margin3={top:n.isLegendRight?0:n.isLegendInset?i.top:n.currentHeight-e,right:NaN,bottom:0,left:n.isLegendRight?n.currentWidth-t:n.isLegendInset?i.left:0}},r.transformLegend=function(e){var t=this;(e?t.legend.transition():t.legend).attr("transform",t.getTranslate("legend"))},r.updateLegendStep=function(e){this.legendStep=e},r.updateLegendItemWidth=function(e){this.legendItemWidth=e},r.updateLegendItemHeight=function(e){this.legendItemHeight=e},r.getLegendWidth=function(){var e=this;return e.config.legend_show?e.isLegendRight||e.isLegendInset?e.legendItemWidth*(e.legendStep+1):e.currentWidth:0},r.getLegendHeight=function(){var e=this,t=0;return e.config.legend_show&&(e.isLegendRight?t=e.currentHeight:t=Math.max(20,e.legendItemHeight)*(e.legendStep+1)),t},r.opacityForLegend=function(e){return e.classed(l.legendItemHidden)?null:1},r.opacityForUnfocusedLegend=function(e){return e.classed(l.legendItemHidden)?null:.3},r.toggleFocusLegend=function(e,t){var n=this;e=n.mapToTargetIds(e),n.legend.selectAll("."+l.legendItem).filter(function(t){return e.indexOf(t)>=0}).classed(l.legendItemFocused,t).transition().duration(100).style("opacity",function(){var e=t?n.opacityForLegend:n.opacityForUnfocusedLegend;return e.call(n,n.d3.select(this))})},r.revertLegend=function(){var e=this,t=e.d3;e.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return e.opacityForLegend(t.select(this))})},r.showLegend=function(e){var t=this,n=t.config;n.legend_show||(n.legend_show=!0,t.legend.style("visibility","visible"),t.legendHasRendered||t.updateLegendWithDefaults()),t.removeHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("visibility","visible").transition().style("opacity",function(){return t.opacityForLegend(t.d3.select(this))})},r.hideLegend=function(e){var t=this,n=t.config;n.legend_show&&b(e)&&(n.legend_show=!1,t.legend.style("visibility","hidden")),t.addHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("opacity",0).style("visibility","hidden")},r.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},r.updateLegend=function(e,t,n){function P(e,t){return r.legendItemTextBox[t]||(r.legendItemTextBox[t]=r.getTextRect(e.textContent,l.legendItem)),r.legendItemTextBox[t]}function H(t,n,s){function L(e,t){t||(b=(v-w-c)/2,b<g&&(b=(v-c)/2,w=0,k++)),C[e]=k,N[k]=r.isLegendInset?10:b,S[e]=w,w+=c}var o=s===0,u=s===e.length-1,a=P(t,n),f=a.width+y+(u&&!r.isLegendRight&&!r.isLegendInset?0:p),l=a.height+h,c=r.isLegendRight||r.isLegendInset?l:f,v=r.isLegendRight||r.isLegendInset?r.getLegendHeight():r.getLegendWidth(),b,E;o&&(w=0,k=0,d=0,m=0);if(i.legend_show&&!r.isLegendToShow(n)){x[n]=T[n]=C[n]=S[n]=0;return}x[n]=f,T[n]=l;if(!d||f>=d)d=f;if(!m||l>=m)m=l;E=r.isLegendRight||r.isLegendInset?m:d,i.legend_equally?(Object.keys(x).forEach(function(e){x[e]=d}),Object.keys(T).forEach(function(e){T[e]=m}),b=(v-E*e.length)/2,b<g?(w=0,k=0,e.forEach(function(e){L(e)})):L(n,!0)):L(n)}var r=this,i=r.config,s,o,u,a,f,c,h=4,p=10,d=0,m=0,g=10,y=15,b,w=0,S={},x={},T={},N=[0],C={},k=0,L,A,O,M,_,D;t=t||{},L=E(t,"withTransition",!0),A=E(t,"withTransitionForTransform",!0),r.isLegendInset&&(k=i.legend_inset_step?i.legend_inset_step:e.length,r.updateLegendStep(k)),r.isLegendRight?(s=function(e){return d*C[e]},a=function(e){return N[C[e]]+S[e]}):r.isLegendInset?(s=function(e){return d*C[e]+10},a=function(e){return N[C[e]]+S[e]}):(s=function(e){return N[C[e]]+S[e]},a=function(e){return m*C[e]}),o=function(e,t){return s(e,t)+14},f=function(e,t){return a(e,t)+9},u=function(e,t){return s(e,t)},c=function(e,t){return a(e,t)-5},b=r.legend.selectAll("."+l.legendItem).data(e).enter().append("g").attr("class",function(e){return r.generateClass(l.legendItem,e)}).style("visibility",function(e){return r.isLegendToShow(e)?"visible":"hidden"}).style("cursor","pointer").on("click",function(e){i.legend_item_onclick?i.legend_item_onclick.call(r,e):r.d3.event.altKey?(r.api.hide(),r.api.show(e)):(r.api.toggle(e),r.isTargetToShow(e)?r.api.focus(e):r.api.revert())}).on("mouseover",function(e){r.d3.select(this).classed(l.legendItemFocused,!0),!r.transiting&&r.isTargetToShow(e)&&r.api.focus(e),i.legend_item_onmouseover&&i.legend_item_onmouseover.call(r,e)}).on("mouseout",function(e){r.d3.select(this).classed(l.legendItemFocused,!1),r.api.revert(),i.legend_item_onmouseout&&i.legend_item_onmouseout.call(r,e)}),b.append("text").text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){H(this,e,t)}).style("pointer-events","none").attr("x",r.isLegendRight||r.isLegendInset?o:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:f),b.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",r.isLegendRight||r.isLegendInset?u:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:c),b.append("rect").attr("class",l.legendItemTile).style("pointer-events","none").style("fill",r.color).attr("x",r.isLegendRight||r.isLegendInset?o:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:a).attr("width",10).attr("height",10),D=r.legend.select("."+l.legendBackground+" rect"),r.isLegendInset&&d>0&&D.size()===0&&(D=r.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),O=r.legend.selectAll("text").data(e).text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){H(this,e,t)}),(L?O.transition():O).attr("x",o).attr("y",f),M=r.legend.selectAll("rect."+l.legendItemEvent).data(e),(L?M.transition():M).attr("width",function(e){return x[e]}).attr("height",function(e){return T[e]}).attr("x",u).attr("y",c),_=r.legend.selectAll("rect."+l.legendItemTile).data(e),(L?_.transition():_).style("fill",r.color).attr("x",s).attr("y",a),D&&(L?D.transition():D).attr("height",r.getLegendHeight()-12).attr("width",d*(k+1)+10),r.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(e){return!r.isTargetToShow(e)}),r.updateLegendItemWidth(d),r.updateLegendItemHeight(m),r.updateLegendStep(k),r.updateSizes(),r.updateScales(),r.updateSvgSize(),r.transformAll(A,n),r.legendHasRendered=!0},o(s,f),f.prototype.init=function(){var t=this.owner,n=t.config,r=t.main;t.axes.x=r.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",n.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",n.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=r.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",n.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",n.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=r.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",n.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(t,n,r,i,s,o,u){var a=this.owner,f=a.config,l={isCategory:a.isCategorized(),withOuterTick:s,tickMultiline:f.axis_x_tick_multiline,tickWidth:f.axis_x_tick_width,tickTextRotate:u?0:f.axis_x_tick_rotate,withoutTransition:o},c=N(a.d3,l).scale(t).orient(n);return a.isTimeSeries()&&i&&(i=i.map(function(e){return a.parseDate(e)})),c.tickFormat(r).tickValues(i),a.isCategorized()&&(c.tickCentered(f.axis_x_tick_centered),b(f.axis_x_tick_culling)&&(f.axis_x_tick_culling=!1)),c},f.prototype.updateXAxisTickValues=function(t,n){var r=this.owner,i=r.config,s;if(i.axis_x_tick_fit||i.axis_x_tick_count)s=this.generateTickValues(r.mapTargetsToUniqueXs(t),i.axis_x_tick_count,r.isTimeSeries());return n?n.tickValues(s):(r.xAxis.tickValues(s),r.subXAxis.tickValues(s)),s},f.prototype.getYAxis=function(t,n,r,i,s,o){var u={withOuterTick:s,withoutTransition:o},a=this.owner,f=a.d3,l=a.config,c=N(f,u).scale(t).orient(n).tickFormat(r);return a.isTimeSeriesY()?c.ticks(f.time[l.axis_y_tick_time_value],l.axis_y_tick_time_interval):c.tickValues(i),c},f.prototype.getId=function(t){var n=this.owner.config;return t in n.data_axes?n.data_axes[t]:"y"},f.prototype.getXAxisTickFormat=function(){var t=this.owner,n=t.config,r=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(e){return e<0?e.toFixed(0):e};return n.axis_x_tick_format&&(h(n.axis_x_tick_format)?r=n.axis_x_tick_format:t.isTimeSeries()&&(r=function(e){return e?t.axisTimeFormat(n.axis_x_tick_format)(e):""})),h(r)?function(e){return r.call(t,e)}:r},f.prototype.getTickValues=function(t,n){return t?t:n?n.tickValues():undefined},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(t){var n=this.owner,r=n.config,i;return t==="y"?i=r.axis_y_label:t==="y2"?i=r.axis_y2_label:t==="x"&&(i=r.axis_x_label),i},f.prototype.getLabelText=function(t){var n=this.getLabelOptionByAxisId(t);return p(n)?n:n?n.text:null},f.prototype.setLabelText=function(t,n){var r=this.owner,i=r.config,s=this.getLabelOptionByAxisId(t);p(s)?t==="y"?i.axis_y_label=n:t==="y2"?i.axis_y2_label=n:t==="x"&&(i.axis_x_label=n):s&&(s.text=n)},f.prototype.getLabelPosition=function(t,n){var r=this.getLabelOptionByAxisId(t),i=r&&typeof r=="object"&&r.position?r.position:n;return{isInner:i.indexOf("inner")>=0,isOuter:i.indexOf("outer")>=0,isLeft:i.indexOf("left")>=0,isCenter:i.indexOf("center")>=0,isRight:i.indexOf("right")>=0,isTop:i.indexOf("top")>=0,isMiddle:i.indexOf("middle")>=0,isBottom:i.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(t){return t==="y2"?this.getY2AxisLabelPosition():t==="y"?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(t,n){var r=this.owner;return t?n.isLeft?0:n.isCenter?r.width/2:r.width:n.isBottom?-r.height:n.isMiddle?-r.height/2:0},f.prototype.dxForAxisLabel=function(t,n){return t?n.isLeft?"0.5em":n.isRight?"-0.5em":"0":n.isTop?"-0.5em":n.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(t,n){return t?n.isLeft?"start":n.isCenter?"middle":"end":n.isBottom?"start":n.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var t=this.owner,n=t.config,r=this.getXAxisLabelPosition();return n.axis_rotated?r.isInner?"1.2em":-25-this.getMaxTickWidth("x"):r.isInner?"-0.5em":n.axis_x_height?n.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var t=this.owner,n=this.getYAxisLabelPosition();return t.config.axis_rotated?n.isInner?"-0.5em":"3em":n.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var t=this.owner,n=this.getY2AxisLabelPosition();return t.config.axis_rotated?n.isInner?"1.2em":"-2.2em":n.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(t,n){var r=this.owner,i=r.config,s=0,o,u,a,f,l;return n&&r.currentMaxTickWidths[t]?r.currentMaxTickWidths[t]:(r.svg&&(o=r.filterTargetsToShow(r.data.targets),t==="y"?(u=r.y.copy().domain(r.getYDomain(o,"y")),a=this.getYAxis(u,r.yOrient,i.axis_y_tick_format,r.yAxisTickValues,!1,!0)):t==="y2"?(u=r.y2.copy().domain(r.getYDomain(o,"y2")),a=this.getYAxis(u,r.y2Orient,i.axis_y2_tick_format,r.y2AxisTickValues,!1,!0)):(u=r.x.copy().domain(r.getXDomain(o)),a=this.getXAxis(u,r.xOrient,r.xAxisTickFormat,r.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(o,a)),f=r.d3.select("body").append("div").classed("c3",!0),l=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),l.append("g").call(a).each(function(){r.d3.select(this).selectAll("text").each(function(){var e=this.getBoundingClientRect();s<e.width&&(s=e.width)}),f.remove()})),r.currentMaxTickWidths[t]=s<=0?r.currentMaxTickWidths[t]:s,r.currentMaxTickWidths[t])},f.prototype.updateLabels=function(t){var n=this.owner,r=n.main.select("."+l.axisX+" ."+l.axisXLabel),i=n.main.select("."+l.axisY+" ."+l.axisYLabel),s=n.main.select("."+l.axisY2+" ."+l.axisY2Label);(t?r.transition():r).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?i.transition():i).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?s.transition():s).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(t,n,r,i){return c(t[n])?t.unit==="ratio"?t[n]*i:this.convertPixelsToAxisPadding(t[n],i):r},f.prototype.convertPixelsToAxisPadding=function(t,n){var r=this.owner,i=r.config.axis_rotated?r.width:r.height;return n*(t/i)},f.prototype.generateTickValues=function(t,n,r){var i=t,s,o,u,a,f,l,c;if(n){s=h(n)?n():n;if(s===1)i=[t[0]];else if(s===2)i=[t[0],t[t.length-1]];else if(s>2){a=s-2,o=t[0],u=t[t.length-1],f=(u-o)/(a+1),i=[o];for(l=0;l<a;l++)c=+o+f*(l+1),i.push(r?new Date(c):c);i.push(u)}}return r||(i=i.sort(function(e,t){return e-t})),i},f.prototype.generateTransitions=function(t){var n=this.owner,r=n.axes;return{axisX:t?r.x.transition().duration(t):r.x,axisY:t?r.y.transition().duration(t):r.y,axisY2:t?r.y2.transition().duration(t):r.y2,axisSubX:t?r.subx.transition().duration(t):r.subx}},f.prototype.redraw=function(t,n){var r=this.owner;r.axes.x.style("opacity",n?0:1),r.axes.y.style("opacity",n?0:1),r.axes.y2.style("opacity",n?0:1),r.axes.subx.style("opacity",n?0:1),t.axisX.call(r.xAxis),t.axisY.call(r.yAxis),t.axisY2.call(r.y2Axis),t.axisSubX.call(r.subXAxis)},r.getClipPath=function(t){var n=e.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(n?"":document.URL.split("#")[0])+"#"+t+")"},r.appendClip=function(e,t){return e.append("clipPath").attr("id",t).append("rect")},r.getAxisClipX=function(e){var t=Math.max(30,this.margin.left);return e?-(1+t):-(t-1)},r.getAxisClipY=function(e){return e?-20:-this.margin.top},r.getXAxisClipX=function(){var e=this;return e.getAxisClipX(!e.config.axis_rotated)},r.getXAxisClipY=function(){var e=this;return e.getAxisClipY(!e.config.axis_rotated)},r.getYAxisClipX=function(){var e=this;return e.config.axis_y_inner?-1:e.getAxisClipX(e.config.axis_rotated)},r.getYAxisClipY=function(){var e=this;return e.getAxisClipY(e.config.axis_rotated)},r.getAxisClipWidth=function(e){var t=this,n=Math.max(30,t.margin.left),r=Math.max(30,t.margin.right);return e?t.width+2+n+r:t.margin.left+20},r.getAxisClipHeight=function(e){return(e?this.margin.bottom:this.margin.top+this.height)+20},r.getXAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(!e.config.axis_rotated)},r.getXAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(!e.config.axis_rotated)},r.getYAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(e.config.axis_rotated)+(e.config.axis_y_inner?20:0)},r.getYAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(e.config.axis_rotated)},r.initPie=function(){var e=this,t=e.d3,n=e.config;e.pie=t.layout.pie().value(function(e){return e.values.reduce(function(e,t){return e+t.value},0)}),n.data_order||e.pie.sort(null)},r.updateRadius=function(){var e=this,t=e.config,n=t.gauge_width||t.donut_width;e.radiusExpanded=Math.min(e.arcWidth,e.arcHeight)/2,e.radius=e.radiusExpanded*.95,e.innerRadiusRatio=n?(e.radius-n)/e.radius:.6,e.innerRadius=e.hasType("donut")||e.hasType("gauge")?e.radius*e.innerRadiusRatio:0},r.updateArc=function(){var e=this;e.svgArc=e.getSvgArc(),e.svgArcExpanded=e.getSvgArcExpanded(),e.svgArcExpandedSub=e.getSvgArcExpanded(.98)},r.updateAngle=function(e){var t=this,n=t.config,r=!1,i=0,s=n.gauge_min,o=n.gauge_max,u,a;return t.pie(t.filterTargetsToShow(t.data.targets)).forEach(function(t){!r&&t.data.id===e.data.id&&(r=!0,e=t,e.index=i),i++}),isNaN(e.startAngle)&&(e.startAngle=0),isNaN(e.endAngle)&&(e.endAngle=e.startAngle),t.isGaugeType(e.data)&&(u=Math.PI/(o-s),a=e.value<s?0:e.value<o?e.value-s:o-s,e.startAngle=-1*(Math.PI/2),e.endAngle=e.startAngle+u*a),r?e:null},r.getSvgArc=function(){var e=this,t=e.d3.svg.arc().outerRadius(e.radius).innerRadius(e.innerRadius),n=function(n,r){var i;return r?t(n):(i=e.updateAngle(n),i?t(i):"M 0 0")};return n.centroid=t.centroid,n},r.getSvgArcExpanded=function(e){var t=this,n=t.d3.svg.arc().outerRadius(t.radiusExpanded*(e?e:1)).innerRadius(t.innerRadius);return function(e){var r=t.updateAngle(e);return r?n(r):"M 0 0"}},r.getArc=function(e,t,n){return n||this.isArcType(e.data)?this.svgArc(e,t):"M 0 0"},r.transformForArcLabel=function(e){var t=this,n=t.updateAngle(e),r,i,s,o,u,a="";return n&&!t.hasType("gauge")&&(r=this.svgArc.centroid(n),i=isNaN(r[0])?0:r[0],s=isNaN(r[1])?0:r[1],o=Math.sqrt(i*i+s*s),u=t.radius&&o?(36/t.radius>.375?1.175-36/t.radius:.8)*t.radius/o:0,a="translate("+i*u+","+s*u+")"),a},r.getArcRatio=function(e){var t=this,n=t.hasType("gauge")?Math.PI:Math.PI*2;return e?(e.endAngle-e.startAngle)/n:null},r.convertToArcData=function(e){return this.addName({id:e.data.id,value:e.value,ratio:this.getArcRatio(e),index:e.index})},r.textForArcLabel=function(e){var t=this,n,r,i,s,o;return t.shouldShowArcLabel()?(n=t.updateAngle(e),r=n?n.value:null,i=t.getArcRatio(n),s=e.data.id,!t.hasType("gauge")&&!t.meetsArcLabelThreshold(i)?"":(o=t.getArcLabelFormat(),o?o(r,i,s):t.defaultArcValueFormat(r,i))):""},r.expandArc=function(t){var n=this,r;if(n.transiting){r=e.setInterval(function(){n.transiting||(e.clearInterval(r),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))},10);return}t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+l.chartArc)).each(function(e){if(!n.shouldExpand(e.data.id))return;n.d3.select(this).selectAll("path").transition().duration(50).attr("d",n.svgArcExpanded).transition().duration(100).attr("d",n.svgArcExpandedSub).each(function(e){n.isDonutType(e.data)})})},r.unexpandArc=function(e){var t=this;if(t.transiting)return;e=t.mapToTargetIds(e),t.svg.selectAll(t.selectorTargets(e,"."+l.chartArc)).selectAll("path").transition().duration(50).attr("d",t.svgArc),t.svg.selectAll("."+l.arc).style("opacity",1)},r.shouldExpand=function(e){var t=this,n=t.config;return t.isDonutType(e)&&n.donut_expand||t.isGaugeType(e)&&n.gauge_expand||t.isPieType(e)&&n.pie_expand},r.shouldShowArcLabel=function(){var e=this,t=e.config,n=!0;return e.hasType("donut")?n=t.donut_label_show:e.hasType("pie")&&(n=t.pie_label_show),n},r.meetsArcLabelThreshold=function(e){var t=this,n=t.config,r=t.hasType("donut")?n.donut_label_threshold:n.pie_label_threshold;return e>=r},r.getArcLabelFormat=function(){var e=this,t=e.config,n=t.pie_label_format;return e.hasType("gauge")?n=t.gauge_label_format:e.hasType("donut")&&(n=t.donut_label_format),n},r.getArcTitle=function(){var e=this;return e.hasType("donut")?e.config.donut_title:""},r.updateTargetsForArc=function(e){var t=this,n=t.main,r,i,s=t.classChartArc.bind(t),o=t.classArcs.bind(t),u=t.classFocus.bind(t);r=n.select("."+l.chartArcs).selectAll("."+l.chartArc).data(t.pie(e)).attr("class",function(e){return s(e)+u(e.data)}),i=r.enter().append("g").attr("class",s),i.append("g").attr("class",o),i.append("text").attr("dy",t.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},r.initArc=function(){var e=this;e.arcs=e.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",e.getTranslate("arc")),e.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(e.getArcTitle())},r.redrawArc=function(e,t,n){var r=this,i=r.d3,s=r.config,o=r.main,u;u=o.selectAll("."+l.arcs).selectAll("."+l.arc).data(r.arcData.bind(r)),u.enter().append("path").attr("class",r.classArc.bind(r)).style("fill",function(e){return r.color(e.data)}).style("cursor",function(e){return s.interaction_enabled&&s.data_selection_isselectable(e)?"pointer":null}).style("opacity",0).each(function(e){r.isGaugeType(e.data)&&(e.startAngle=e.endAngle=-1*(Math.PI/2)),this._current=e}),u.attr("transform",function(e){return!r.isGaugeType(e.data)&&n?"scale(0)":""}).style("opacity",function(e){return e===this._current?0:1}).on("mouseover",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),n=r.convertToArcData(t),r.expandArc(t.data.id),r.api.focus(t.data.id),r.toggleFocusLegend(t.data.id,!0),r.config.data_onmouseover(n,this)}:null).on("mousemove",s.interaction_enabled?function(e){var t=r.updateAngle(e),n=r.convertToArcData(t),i=[n];r.showTooltip(i,this)}:null).on("mouseout",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),n=r.convertToArcData(t),r.unexpandArc(t.data.id),r.api.revert(),r.revertLegend(),r.hideTooltip(),r.config.data_onmouseout(n,this)}:null).on("click",s.interaction_enabled?function(e,t){var n=r.updateAngle(e),i=r.convertToArcData(n);r.toggleShape&&r.toggleShape(this,i,t),r.config.data_onclick.call(r.api,i,this)}:null).each(function(){r.transiting=!0}).transition().duration(e).attrTween("d",function(e){var t=r.updateAngle(e),n;return t?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),n=i.interpolate(this._current,t),this._current=n(0),function(t){var i=n(t);return i.data=e.data,r.getArc(i,!0)}):function(){return"M 0 0"}}).attr("transform",n?"scale(1)":"").style("fill",function(e){return r.levelColor?r.levelColor(e.data.values[0].value):r.color(e.data.id)}).style("opacity",1).call(r.endall,function(){r.transiting=!1}),u.exit().transition().duration(t).style("opacity",0).remove(),o.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(e){return r.isGaugeType(e.data)?l.gaugeValue:""}).text(r.textForArcLabel.bind(r)).attr("transform",r.transformForArcLabel.bind(r)).style("font-size",function(e){return r.isGaugeType(e.data)?Math.round(r.radius/5)+"px":""}).transition().duration(e).style("opacity",function(e){return r.isTargetToShow(e.data.id)&&r.isArcType(e.data)?1:0}),o.select("."+l.chartArcsTitle).style("opacity",r.hasType("donut")||r.hasType("gauge")?1:0),r.hasType("gauge")&&(r.arcs.select("."+l.chartArcsBackground).attr("d",function(){var e={data:[{value:s.gauge_max}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return r.getArc(e,!0,!0)}),r.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(s.gauge_label_show?s.gauge_units:""),r.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(r.innerRadius+(r.radius-r.innerRadius)/2)+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_min:""),r.arcs.select("."+l.chartArcsGaugeMax).attr("dx",r.innerRadius+(r.radius-r.innerRadius)/2+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_max:""))},r.initGauge=function(){var e=this.arcs;this.hasType("gauge")&&(e.append("path").attr("class",l.chartArcsBackground),e.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},r.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},r.initRegion=function(){var e=this;e.region=e.main.append("g").attr("clip-path",e.clipPath).attr("class",l.regions)},r.updateRegion=function(e){var t=this,n=t.config;t.region.style("visibility",t.hasArcType()?"hidden":"visible"),t.mainRegion=t.main.select("."+l.regions).selectAll("."+l.region).data(n.regions),t.mainRegion.enter().append("g").attr("class",t.classRegion.bind(t)).append("rect").style("fill-opacity",0),t.mainRegion.exit().transition().duration(e).style("opacity",0).remove()},r.redrawRegion=function(e){var t=this,n=t.mainRegion.selectAll("rect"),r=t.regionX.bind(t),i=t.regionY.bind(t),s=t.regionWidth.bind(t),o=t.regionHeight.bind(t);return[(e?n.transition():n).attr("x",r).attr("y",i).attr("width",s).attr("height",o).style("fill-opacity",function(e){return c(e.opacity)?e.opacity:.1})]},r.regionX=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?"start"in e?i(e.start):0:0:r=n.axis_rotated?0:"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0,r},r.regionY=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?0:"end"in e?i(e.end):0:r=n.axis_rotated?"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0:0,r},r.regionWidth=function(e){var t=this,n=t.config,r=t.regionX(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?"end"in e?s(e.end):t.width:t.width:i=n.axis_rotated?t.width:"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.width,i<r?0:i-r},r.regionHeight=function(e){var t=this,n=t.config,r=this.regionY(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?t.height:"start"in e?s(e.start):t.height:i=n.axis_rotated?"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.height:t.height,i<r?0:i-r},r.isRegionOnX=function(e){return!e.axis||e.axis==="x"},r.drag=function(e){var t=this,n=t.config,r=t.main,i=t.d3,s,o,u,a,f,c,h,p;if(t.hasArcType())return;if(!n.data_selection_enabled)return;if(n.zoom_enabled&&!t.zoom.altDomain)return;if(!n.data_selection_multiple)return;s=t.dragStart[0],o=t.dragStart[1],u=e[0],a=e[1],f=Math.min(s,u),c=Math.max(s,u),h=n.data_selection_grouped?t.margin.top:Math.min(o,a),p=n.data_selection_grouped?t.height:Math.max(o,a),r.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",c-f).attr("height",p-h),r.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(e){return n.data_selection_isselectable(e)}).each(function(e,n){var r=i.select(this),s=r.classed(l.SELECTED),o=r.classed(l.INCLUDED),u,a,d,v,m,g=!1,y;if(r.classed(l.circle))u=r.attr("cx")*1,a=r.attr("cy")*1,m=t.togglePoint,g=f<u&&u<c&&h<a&&a<p;else{if(!r.classed(l.bar))return;y=x(this),u=y.x,a=y.y,d=y.width,v=y.height,m=t.togglePath,g=!(c<u||u+d<f)&&!(p<a||a+v<h)}g^o&&(r.classed(l.INCLUDED,!o),r.classed(l.SELECTED,!s),m.call(t,!s,r,e,n))})},r.dragstart=function(e){var t=this,n=t.config;if(t.hasArcType())return;if(!n.data_selection_enabled)return;t.dragStart=e,t.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),t.dragging=!0},r.dragend=function(){var e=this,t=e.config;if(e.hasArcType())return;if(!t.data_selection_enabled)return;e.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),e.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),e.dragging=!1},r.selectPoint=function(e,t,n){var r=this,i=r.config,s=(i.axis_rotated?r.circleY:r.circleX).bind(r),o=(i.axis_rotated?r.circleX:r.circleY).bind(r),u=r.pointSelectR.bind(r);i.data_onselected.call(r.api,t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).data([t]).enter().append("circle").attr("class",function(){return r.generateClass(l.selectedCircle,n)}).attr("cx",s).attr("cy",o).attr("stroke",function(){return r.color(t)}).attr("r",function(e){return r.pointSelectR(e)*1.4}).transition().duration(100).attr("r",u)},r.unselectPoint=function(e,t,n){var r=this;r.config.data_onunselected(t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).transition().duration(100).attr("r",0).remove()},r.togglePoint=function(e,t,n,r){e?this.selectPoint(t,n,r):this.unselectPoint(t,n,r)},r.selectPath=function(e,t){var n=this;n.config.data_onselected.call(n,t,e.node()),e.transition().duration(100).style("fill",function(){return n.d3.rgb(n.color(t)).brighter(.75)})},r.unselectPath=function(e,t){var n=this;n.config.data_onunselected.call(n,t,e.node()),e.transition().duration(100).style("fill",function(){return n.color(t)})},r.togglePath=function(e,t,n,r){e?this.selectPath(t,n,r):this.unselectPath(t,n,r)},r.getToggle=function(e,t){var n=this,r;return e.nodeName==="circle"?n.isStepType(t)?r=function(){}:r=n.togglePoint:e.nodeName==="path"&&(r=n.togglePath),r},r.toggleShape=function(e,t,n){var r=this,i=r.d3,s=r.config,o=i.select(e),u=o.classed(l.SELECTED),a=r.getToggle(e,t).bind(r);s.data_selection_enabled&&s.data_selection_isselectable(t)&&(s.data_selection_multiple||r.main.selectAll("."+l.shapes+(s.data_selection_grouped?r.getTargetSelectorSuffix(t.id):"")).selectAll("."+l.shape).each(function(e,t){var n=i.select(this);n.classed(l.SELECTED)&&a(!1,n.classed(l.SELECTED,!1),e,t)}),o.classed(l.SELECTED,!u),a(!u,o,t,n))},r.initBrush=function(){var e=this,t=e.d3;e.brush=t.svg.brush().on("brush",function(){e.redrawForBrush()}),e.brush.update=function(){return e.context&&e.context.select("."+l.brush).call(this),this},e.brush.scale=function(t){return e.config.axis_rotated?this.y(t):this.x(t)}},r.initSubchart=function(){var e=this,t=e.config,n=e.context=e.svg.append("g").attr("transform",e.getTranslate("context"));n.style("visibility",t.subchart_show?"visible":"hidden"),n.append("g").attr("clip-path",e.clipPathForSubchart).attr("class",l.chart),n.select("."+l.chart).append("g").attr("class",l.chartBars),n.select("."+l.chart).append("g").attr("class",l.chartLines),n.append("g").attr("clip-path",e.clipPath).attr("class",l.brush).call(e.brush),e.axes.subx=n.append("g").attr("class",l.axisX).attr("transform",e.getTranslate("subx")).attr("clip-path",t.axis_rotated?"":e.clipPathForXAxis)},r.updateTargetsForSubchart=function(e){var t=this,n=t.context,r=t.config,i,s,o,u,a=t.classChartBar.bind(t),f=t.classBars.bind(t),c=t.classChartLine.bind(t),h=t.classLines.bind(t),p=t.classAreas.bind(t);r.subchart_show&&(u=n.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",a),o=u.enter().append("g").style("opacity",0).attr("class",a),o.append("g").attr("class",f),s=n.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",c),i=s.enter().append("g").style("opacity",0).attr("class",c),i.append("g").attr("class",h),i.append("g").attr("class",p),n.selectAll("."+l.brush+" rect").attr(r.axis_rotated?"width":"height",r.axis_rotated?t.width2:t.height2))},r.updateBarForSubchart=function(e){var t=this;t.contextBar=t.context.selectAll("."+l.bars).selectAll("."+l.bar).data(t.barData.bind(t)),t.contextBar.enter().append("path").attr("class",t.classBar.bind(t)).style("stroke","none").style("fill",t.color),t.contextBar.style("opacity",t.initialOpacity.bind(t)),t.contextBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBarForSubchart=function(e,t,n){(t?this.contextBar.transition().duration(n):this.contextBar).attr("d",e).style("opacity",1)},r.updateLineForSubchart=function(e){var t=this;t.contextLine=t.context.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.contextLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.contextLine.style("opacity",t.initialOpacity.bind(t)),t.contextLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLineForSubchart=function(e,t,n){(t?this.contextLine.transition().duration(n):this.contextLine).attr("d",e).style("opacity",1)},r.updateAreaForSubchart=function(e){var t=this,n=t.d3;t.contextArea=t.context.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.contextArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.contextArea.style("opacity",0),t.contextArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawAreaForSubchart=function(e,t,n){(t?this.contextArea.transition().duration(n):this.contextArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)},r.redrawSubchart=function(e,t,n,r,i,s,o){var u=this,a=u.d3,f=u.config,l,c,h;u.context.style("visibility",f.subchart_show?"visible":"hidden"),f.subchart_show&&(a.event&&a.event.type==="zoom"&&u.brush.extent(u.x.orgDomain()).update(),e&&(u.brush.empty()||u.brush.extent(u.x.orgDomain()).update(),l=u.generateDrawArea(i,!0),c=u.generateDrawBar(s,!0),h=u.generateDrawLine(o,!0),u.updateBarForSubchart(n),u.updateLineForSubchart(n),u.updateAreaForSubchart(n),u.redrawBarForSubchart(c,n,n),u.redrawLineForSubchart(h,n,n),u.redrawAreaForSubchart(l,n,n)))},r.redrawForBrush=function(){var e=this,t=e.x;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),e.config.subchart_onbrush.call(e.api,t.orgDomain())},r.transformContext=function(e,t){var n=this,r;t&&t.axisSubX?r=t.axisSubX:(r=n.context.select("."+l.axisX),e&&(r=r.transition())),n.context.attr("transform",n.getTranslate("context")),r.attr("transform",n.getTranslate("subx"))},r.getDefaultExtent=function(){var e=this,t=e.config,n=h(t.axis_x_extent)?t.axis_x_extent(e.getXDomain(e.data.targets)):t.axis_x_extent;return e.isTimeSeries()&&(n=[e.parseDate(n[0]),e.parseDate(n[1])]),n},r.initZoom=function(){var e=this,t=e.d3,n=e.config,r;e.zoom=t.behavior.zoom().on("zoomstart",function(){r=t.event.sourceEvent,e.zoom.altDomain=t.event.sourceEvent.altKey?e.x.orgDomain():null,n.zoom_onzoomstart.call(e.api,t.event.sourceEvent)}).on("zoom",function(){e.redrawForZoom.call(e)}).on("zoomend",function(){var i=t.event.sourceEvent;if(i&&r.clientX===i.clientX&&r.clientY===i.clientY)return;e.redrawEventRect(),e.updateZoom(),n.zoom_onzoomend.call(e.api,e.x.orgDomain())}),e.zoom.scale=function(e){return n.axis_rotated?this.y(e):this.x(e)},e.zoom.orgScaleExtent=function(){var t=n.zoom_extent?n.zoom_extent:[1,10];return[t[0],Math.max(e.getMaxDataCount()/t[1],t[1])]},e.zoom.updateScaleExtent=function(){var t=y(e.x.orgDomain())/y(e.orgXDomain),n=this.orgScaleExtent();return this.scaleExtent([n[0]*t,n[1]*t]),this}},r.updateZoom=function(){var e=this,t=e.config.zoom_enabled?e.zoom:function(){};e.main.select("."+l.zoomRect).call(t).on("dblclick.zoom",null),e.main.selectAll("."+l.eventRect).call(t).on("dblclick.zoom",null)},r.redrawForZoom=function(){var e=this,t=e.d3,n=e.config,r=e.zoom,i=e.x;if(!n.zoom_enabled)return;if(e.filterTargetsToShow(e.data.targets).length===0)return;if(t.event.sourceEvent.type==="mousemove"&&r.altDomain){i.domain(r.altDomain),r.scale(i).updateScaleExtent();return}e.isCategorized()&&i.orgDomain()[0]===e.orgXDomain[0]&&i.domain([e.orgXDomain[0]-1e-10,i.orgDomain()[1]]),e.redraw({withTransition:!1,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),t.event.sourceEvent.type==="mousemove"&&(e.cancelClick=!0),n.zoom_onzoom.call(e.api,i.orgDomain())},r.generateColor=function(){var e=this,t=e.config,n=e.d3,r=t.data_colors,i=w(t.color_pattern)?t.color_pattern:n.scale.category10().range(),s=t.data_color,o=[];return function(e){var t=e.id||e.data&&e.data.id||e,n;return r[t]instanceof Function?n=r[t](e):r[t]?n=r[t]:(o.indexOf(t)<0&&o.push(t),n=i[o.indexOf(t)%i.length],r[t]=n),s instanceof Function?s(n,e):n}},r.generateLevelColor=function(){var e=this,t=e.config,n=t.color_pattern,r=t.color_threshold,i=r.unit==="value",s=r.values&&r.values.length?r.values:[],o=r.max||100;return w(t.color_threshold)?function(e){var t,r,u=n[n.length-1];for(t=0;t<s.length;t++){r=i?e:e*100/o;if(r<s[t]){u=n[t];break}}return u}:null},r.getYFormat=function(e){var t=this,n=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.yFormat,r=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.y2Format;return function(e,i,s){var o=t.axis.getId(s)==="y2"?r:n;return o.call(t,e,i)}},r.yFormat=function(e){var t=this,n=t.config,r=n.axis_y_tick_format?n.axis_y_tick_format:t.defaultValueFormat;return r(e)},r.y2Format=function(e){var t=this,n=t.config,r=n.axis_y2_tick_format?n.axis_y2_tick_format:t.defaultValueFormat;return r(e)},r.defaultValueFormat=function(e){return c(e)?+e:""},r.defaultArcValueFormat=function(e,t){return(t*100).toFixed(1)+"%"},r.dataLabelFormat=function(e){var t=this,n=t.config.data_labels,r,i=function(e){return c(e)?+e:""};return typeof n.format=="function"?r=n.format:typeof n.format=="object"?n.format[e]?r=n.format[e]===!0?i:n.format[e]:r=function(){return""}:r=i,r},r.hasCaches=function(e){for(var t=0;t<e.length;t++)if(!(e[t]in this.cache))return!1;return!0},r.addCache=function(e,t){this.cache[e]=this.cloneTarget(t)},r.getCaches=function(e){var t=[],n;for(n=0;n<e.length;n++)e[n]in this.cache&&t.push(this.cloneTarget(this.cache[e[n]]));return t};var l=r.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};r.generateClass=function(e,t){return" "+e+" "+e+this.getTargetSelectorSuffix(t)},r.classText=function(e){return this.generateClass(l.text,e.index)},r.classTexts=function(e){return this.generateClass(l.texts,e.id)},r.classShape=function(e){return this.generateClass(l.shape,e.index)},r.classShapes=function(e){return this.generateClass(l.shapes,e.id)},r.classLine=function(e){return this.classShape(e)+this.generateClass(l.line,e.id)},r.classLines=function(e){return this.classShapes(e)+this.generateClass(l.lines,e.id)},r.classCircle=function(e){return this.classShape(e)+this.generateClass(l.circle,e.index)},r.classCircles=function(e){return this.classShapes(e)+this.generateClass(l.circles,e.id)},r.classBar=function(e){return this.classShape(e)+this.generateClass(l.bar,e.index)},r.classBars=function(e){return this.classShapes(e)+this.generateClass(l.bars,e.id)},r.classArc=function(e){return this.classShape(e.data)+this.generateClass(l.arc,e.data.id)},r.classArcs=function(e){return this.classShapes(e.data)+this.generateClass(l.arcs,e.data.id)},r.classArea=function(e){return this.classShape(e)+this.generateClass(l.area,e.id)},r.classAreas=function(e){return this.classShapes(e)+this.generateClass(l.areas,e.id)},r.classRegion=function(e,t){return this.generateClass(l.region,t)+" "+("class"in e?e["class"]:"")},r.classEvent=function(e){return this.generateClass(l.eventRect,e.index)},r.classTarget=function(e){var t=this,n=t.config.data_classes[e],r="";return n&&(r=" "+l.target+"-"+n),t.generateClass(l.target,e)+r},r.classFocus=function(e){return this.classFocused(e)+this.classDefocused(e)},r.classFocused=function(e){return" "+(this.focusedTargetIds.indexOf(e.id)>=0?l.focused:"")},r.classDefocused=function(e){return" "+(this.defocusedTargetIds.indexOf(e.id)>=0?l.defocused:"")},r.classChartText=function(e){return l.chartText+this.classTarget(e.id)},r.classChartLine=function(e){return l.chartLine+this.classTarget(e.id)},r.classChartBar=function(e){return l.chartBar+this.classTarget(e.id)},r.classChartArc=function(e){return l.chartArc+this.classTarget(e.data.id)},r.getTargetSelectorSuffix=function(e){return e||e===0?("-"+e).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},r.selectorTarget=function(e,t){return(t||"")+"."+l.target+this.getTargetSelectorSuffix(e)},r.selectorTargets=function(e,t){var n=this;return e=e||[],e.length?e.map(function(e){return n.selectorTarget(e,t)}):null},r.selectorLegend=function(e){return"."+l.legendItem+this.getTargetSelectorSuffix(e)},r.selectorLegends=function(e){var t=this;return e&&e.length?e.map(function(e){return t.selectorLegend(e)}):null};var c=r.isValue=function(e){return e||e===0},h=r.isFunction=function(e){return typeof e=="function"},p=r.isString=function(e){return typeof e=="string"},d=r.isUndefined=function(e){return typeof e=="undefined"},v=r.isDefined=function(e){return typeof e!="undefined"},m=r.ceil10=function(e){return Math.ceil(e/10)*10},g=r.asHalfPixel=function(e){return Math.ceil(e)+.5},y=r.diffDomain=function(e){return e[1]-e[0]},b=r.isEmpty=function(e){return!e||p(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0},w=r.notEmpty=function(e){return Object.keys(e).length>0},E=r.getOption=function(e,t,n){return v(e[t])?e[t]:n},S=r.hasValue=function(e,t){var n=!1;return Object.keys(e).forEach(function(r){e[r]===t&&(n=!0)}),n},x=r.getPathBox=function(e){var t=e.getBoundingClientRect(),n=[e.pathSegList.getItem(0),e.pathSegList.getItem(1)],r=n[0].x,i=Math.min(n[0].y,n[1].y);return{x:r,y:i,width:t.width,height:t.height}};n.focus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),this.revert(),this.defocus(),n.classed(l.focused,!0).classed(l.defocused,!1),t.hasArcType()&&t.expandArc(e),t.toggleFocusLegend(e,!0),t.focusedTargetIds=e,t.defocusedTargetIds=t.defocusedTargetIds.filter(function(t){return e.indexOf(t)<0})},n.defocus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),n.classed(l.focused,!1).classed(l.defocused,!0),t.hasArcType()&&t.unexpandArc(e),t.toggleFocusLegend(e,!1),t.focusedTargetIds=t.focusedTargetIds.filter(function(t){return e.indexOf(t)<0}),t.defocusedTargetIds=e},n.revert=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e)),n.classed(l.focused,!1).classed(l.defocused,!1),t.hasArcType()&&t.unexpandArc(e),t.config.legend_show&&(t.showLegend(e.filter(t.isLegendToShow.bind(t))),t.legend.selectAll(t.selectorLegends(e)).filter(function(){return t.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),t.focusedTargetIds=[],t.defocusedTargetIds=[]},n.show=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.removeHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",1,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",1)}),t.withLegend&&n.showLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.hide=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.addHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",0,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",0)}),t.withLegend&&n.hideLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.toggle=function(e,t){var n=this,r=this.internal;r.mapToTargetIds(e).forEach(function(e){r.isTargetToShow(e)?n.hide(e,t):n.show(e,t)})},n.zoom=function(e){var t=this.internal;return e&&(t.isTimeSeries()&&(e=e.map(function(e){return t.parseDate(e)})),t.brush.extent(e),t.redraw({withUpdateXDomain:!0,withY:t.config.zoom_rescale}),t.config.zoom_onzoom.call(this,t.x.orgDomain())),t.brush.extent()},n.zoom.enable=function(e){var t=this.internal;t.config.zoom_enabled=e,t.updateAndRedraw()},n.unzoom=function(){var e=this.internal;e.brush.clear().update(),e.redraw({withUpdateXDomain:!0})},n.load=function(e){var t=this.internal,n=t.config;e.xs&&t.addXs(e.xs),"classes"in e&&Object.keys(e.classes).forEach(function(t){n.data_classes[t]=e.classes[t]}),"categories"in e&&t.isCategorized()&&(n.axis_x_categories=e.categories),"axes"in e&&Object.keys(e.axes).forEach(function(t){n.data_axes[t]=e.axes[t]}),"colors"in e&&Object.keys(e.colors).forEach(function(t){n.data_colors[t]=e.colors[t]});if("cacheIds"in e&&t.hasCaches(e.cacheIds)){t.load(t.getCaches(e.cacheIds),e.done);return}"unload"in e?t.unload(t.mapToTargetIds(typeof e.unload=="boolean"&&e.unload?null:e.unload),function(){t.loadFromArgs(e)}):t.loadFromArgs(e)},n.unload=function(e){var t=this.internal;e=e||{},e instanceof Array?e={ids:e}:typeof e=="string"&&(e={ids:[e]}),t.unload(t.mapToTargetIds(e.ids),function(){t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()})},n.flow=function(e){var t=this.internal,n,r,i=[],s=t.getMaxDataCount(),o,u,a,f,l=0,h=0,p,d;if(e.json)r=t.convertJsonToData(e.json,e.keys);else if(e.rows)r=t.convertRowsToData(e.rows);else{if(!e.columns)return;r=t.convertColumnsToData(e.columns)}n=t.convertDataToTargets(r,!0),t.data.targets.forEach(function(e){var r=!1,s,o;for(s=0;s<n.length;s++)if(e.id===n[s].id){r=!0,e.values[e.values.length-1]&&(h=e.values[e.values.length-1].index+1),l=n[s].values.length;for(o=0;o<l;o++)n[s].values[o].index=h+o,t.isTimeSeries()||(n[s].values[o].x=h+o);e.values=e.values.concat(n[s].values),n.splice(s,1);break}r||i.push(e.id)}),t.data.targets.forEach(function(e){var n,r;for(n=0;n<i.length;n++)if(e.id===i[n]){h=e.values[e.values.length-1].index+1;for(r=0;r<l;r++)e.values.push({id:e.id,index:h+r,x:t.isTimeSeries()?t.getOtherTargetX(h+r):h+r,value:null})}}),t.data.targets.length&&n.forEach(function(e){var n,r=[];for(n=t.data.targets[0].values[0].index;n<h;n++)r.push({id:e.id,index:n,x:t.isTimeSeries()?t.getOtherTargetX(n):n,value:null});e.values.forEach(function(e){e.index+=h,t.isTimeSeries()||(e.x+=h)}),e.values=r.concat(e.values)}),t.data.targets=t.data.targets.concat(n),o=t.getMaxDataCount(),a=t.data.targets[0],f=a.values[0],v(e.to)?(l=0,d=t.isTimeSeries()?t.parseDate(e.to):e.to,a.values.forEach(function(e){e.x<d&&l++})):v(e.length)&&(l=e.length),s?s===1&&t.isTimeSeries()&&(p=(a.values[a.values.length-1].x-f.x)/2,u=[new Date(+f.x-p),new Date(+f.x+p)],t.updateXDomain(null,!0,!0,!1,u)):(t.isTimeSeries()?a.values.length>1?p=a.values[a.values.length-1].x-f.x:p=f.x-t.getXDomain(t.data.targets)[0]:p=1,u=[f.x-p,f.x],t.updateXDomain(null,!0,!0,!1,u)),t.updateTargets(t.data.targets),t.redraw({flow:{index:f.index,length:l,duration:c(e.duration)?e.duration:t.config.transition_duration,done:e.done,orgDataCount:s},withLegend:!0,withTransition:s>1,withTrimXDomain:!1,withUpdateXAxis:!0})},r.generateFlow=function(e){var t=this,n=t.config,r=t.d3;return function(){var i=e.targets,s=e.flow,o=e.drawBar,u=e.drawLine,a=e.drawArea,f=e.cx,c=e.cy,h=e.xv,p=e.xForText,d=e.yForText,v=e.duration,m,g=1,b,w=s.index,E=s.length,S=t.getValueOnIndex(t.data.targets[0].values,w),x=t.getValueOnIndex(t.data.targets[0].values,w+E),T=t.x.domain(),N,C=s.duration||v,k=s.done||function(){},L=t.generateWait(),A=t.xgrid||r.selectAll([]),O=t.xgridLines||r.selectAll([]),M=t.mainRegion||r.selectAll([]),_=t.mainText||r.selectAll([]),D=t.mainBar||r.selectAll([]),P=t.mainLine||r.selectAll([]),H=t.mainArea||r.selectAll([]),B=t.mainCircle||r.selectAll([]);t.flowing=!0,t.data.targets.forEach(function(e){e.values.splice(0,E)}),N=t.updateXDomain(i,!0,!0),t.updateXGrid&&t.updateXGrid(!0),s.orgDataCount?s.orgDataCount===1||S.x===x.x?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?m=t.x(T[0])-t.x(N[0]):m=t.x(S.x)-t.x(x.x):t.data.targets[0].values.length!==1?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?(S=t.getValueOnIndex(t.data.targets[0].values,0),x=t.getValueOnIndex(t.data.targets[0].values,t.data.targets[0].values.length-1),m=t.x(S.x)-t.x(x.x)):m=y(N)/2,g=y(T)/y(N),b="translate("+m+",0) scale("+g+",1)",t.hideXGridFocus(),t.hideTooltip(),r.transition().ease("linear").duration(C).each(function(){L.add(t.axes.x.transition().call(t.xAxis)),L.add(D.transition().attr("transform",b)),L.add(P.transition().attr("transform",b)),L.add(H.transition().attr("transform",b)),L.add(B.transition().attr("transform",b)),L.add(_.transition().attr("transform",b)),L.add(M.filter(t.isRegionOnX).transition().attr("transform",b)),L.add(A.transition().attr("transform",b)),L.add(O.transition().attr("transform",b))}).call(L,function(){var e,r=[],i=[],s=[];if(E){for(e=0;e<E;e++)r.push("."+l.shape+"-"+(w+e)),i.push("."+l.text+"-"+(w+e)),s.push("."+l.eventRect+"-"+(w+e));t.svg.selectAll("."+l.shapes).selectAll(r).remove(),t.svg.selectAll("."+l.texts).selectAll(i).remove(),t.svg.selectAll("."+l.eventRects).selectAll(s).remove(),t.svg.select("."+l.xgrid).remove()}A.attr("transform",null).attr(t.xgridAttr),O.attr("transform",null),O.select("line").attr("x1",n.axis_rotated?0:h).attr("x2",n.axis_rotated?t.width:h),O.select("text").attr("x",n.axis_rotated?t.width:0).attr("y",h),D.attr("transform",null).attr("d",o),P.attr("transform",null).attr("d",u),H.attr("transform",null).attr("d",a),B.attr("transform",null).attr("cx",f).attr("cy",c),_.attr("transform",null).attr("x",p).attr("y",d).style("fill-opacity",t.opacityForText.bind(t)),M.attr("transform",null),M.select("rect").filter(t.isRegionOnX).attr("x",t.regionX.bind(t)).attr("width",t.regionWidth.bind(t)),n.interaction_enabled&&t.redrawEventRect(),k(),t.flowing=!1})}},n.selected=function(e){var t=this.internal,n=t.d3;return n.merge(t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(e)).selectAll("."+l.shape).filter(function(){return n.select(this).classed(l.SELECTED)}).map(function(e){return e.map(function(e){var t=e.__data__;return t.data?t.data:t})}))},n.select=function(e,t,n){var r=this.internal,i=r.d3,s=r.config;if(!s.data_selection_enabled)return;r.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(o,u){var a=i.select(this),f=o.data?o.data.id:o.id,c=r.getToggle(this,o).bind(r),h=s.data_selection_grouped||!e||e.indexOf(f)>=0,p=!t||t.indexOf(u)>=0,d=a.classed(l.SELECTED);if(a.classed(l.line)||a.classed(l.area))return;h&&p?s.data_selection_isselectable(o)&&!d&&c(!0,a.classed(l.SELECTED,!0),o,u):v(n)&&n&&d&&c(!1,a.classed(l.SELECTED,!1),o,u)})},n.unselect=function(e,t){var n=this.internal,r=n.d3,i=n.config;if(!i.data_selection_enabled)return;n.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(s,o){var u=r.select(this),a=s.data?s.data.id:s.id,f=n.getToggle(this,s).bind(n),c=i.data_selection_grouped||!e||e.indexOf(a)>=0,h=!t||t.indexOf(o)>=0,p=u.classed(l.SELECTED);if(u.classed(l.line)||u.classed(l.area))return;c&&h&&i.data_selection_isselectable(s)&&p&&f(!1,u.classed(l.SELECTED,!1),s,o)})},n.transform=function(e,t){var n=this.internal,r=["pie","donut"].indexOf(e)>=0?{withTransform:!0}:null;n.transformTo(t,e,r)},r.transformTo=function(e,t,n){var r=this,i=!r.hasArcType(),s=n||{withTransitionForAxis:i};s.withTransitionForTransform=!1,r.transiting=!1,r.setTargetType(e,t),r.updateTargets(r.data.targets),r.updateAndRedraw(s)},n.groups=function(e){var t=this.internal,n=t.config;return d(e)?n.data_groups:(n.data_groups=e,t.redraw(),n.data_groups)},n.xgrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_x_lines=e,t.redrawWithoutRescale(),n.grid_x_lines):n.grid_x_lines},n.xgrids.add=function(e){var t=this.internal;return this.xgrids(t.config.grid_x_lines.concat(e?e:[]))},n.xgrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!0)},n.ygrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_y_lines=e,t.redrawWithoutRescale(),n.grid_y_lines):n.grid_y_lines},n.ygrids.add=function(e){var t=this.internal;return this.ygrids(t.config.grid_y_lines.concat(e?e:[]))},n.ygrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!1)},n.regions=function(e){var t=this.internal,n=t.config;return e?(n.regions=e,t.redrawWithoutRescale(),n.regions):n.regions},n.regions.add=function(e){var t=this.internal,n=t.config;return e?(n.regions=n.regions.concat(e),t.redrawWithoutRescale(),n.regions):n.regions},n.regions.remove=function(e){var t=this.internal,n=t.config,r,i,s;return e=e||{},r=t.getOption(e,"duration",n.transition_duration),i=t.getOption(e,"classes",[l.region]),s=t.main.select("."+l.regions).selectAll(i.map(function(e){return"."+e})),(r?s.transition().duration(r):s).style("opacity",0).remove(),n.regions=n.regions.filter(function(e){var t=!1;return e["class"]?(e["class"].split(" ").forEach(function(e){i.indexOf(e)>=0&&(t=!0)}),!t):!0}),n.regions},n.data=function(e){var t=this.internal.data.targets;return typeof e=="undefined"?t:t.filter(function(t){return[].concat(e).indexOf(t.id)>=0})},n.data.shown=function(e){return this.internal.filterTargetsToShow(this.data(e))},n.data.values=function(e){var t,n=null;return e&&(t=this.data(e),n=t[0]?t[0].values.map(function(e){return e.value}):null),n},n.data.names=function(e){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",e)},n.data.colors=function(e){return this.internal.updateDataAttributes("colors",e)},n.data.axes=function(e){return this.internal.updateDataAttributes("axes",e)},n.category=function(e,t){var n=this.internal,r=n.config;return arguments.length>1&&(r.axis_x_categories[e]=t,n.redraw()),r.axis_x_categories[e]},n.categories=function(e){var t=this.internal,n=t.config;return arguments.length?(n.axis_x_categories=e,t.redraw(),n.axis_x_categories):n.axis_x_categories},n.color=function(e){var t=this.internal;return t.color(e)},n.x=function(e){var t=this.internal;return arguments.length&&(t.updateTargetX(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.xs=function(e){var t=this.internal;return arguments.length&&(t.updateTargetXs(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.axis=function(){},n.axis.labels=function(e){var t=this.internal;arguments.length&&(Object.keys(e).forEach(function(n){t.axis.setLabelText(n,e[n])}),t.axis.updateLabels())},n.axis.max=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_max,y:n.axis_y_max,y2:n.axis_y2_max};typeof e=="object"?(c(e.x)&&(n.axis_x_max=e.x),c(e.y)&&(n.axis_y_max=e.y),c(e.y2)&&(n.axis_y2_max=e.y2)):n.axis_y_max=n.axis_y2_max=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.min=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_min,y:n.axis_y_min,y2:n.axis_y2_min};typeof e=="object"?(c(e.x)&&(n.axis_x_min=e.x),c(e.y)&&(n.axis_y_min=e.y),c(e.y2)&&(n.axis_y2_min=e.y2)):n.axis_y_min=n.axis_y2_min=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.range=function(e){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};v(e.max)&&this.axis.max(e.max),v(e.min)&&this.axis.min(e.min)},n.legend=function(){},n.legend.show=function(e){var t=this.internal;t.showLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.legend.hide=function(e){var t=this.internal;t.hideLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.resize=function(e){var t=this.internal,n=t.config;n.size_width=e?e.width:null,n.size_height=e?e.height:null,this.flush()},n.flush=function(){var e=this.internal;e.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},n.destroy=function(){var t=this.internal;return e.clearInterval(t.intervalForObserveInserted),e.onresize=null,t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},n.tooltip=function(){},n.tooltip.show=function(e){var t=this.internal,n,r;e.mouse&&(r=e.mouse),e.data?t.isMultipleX()?(r=[t.x(e.data.x),t.getYScale(e.data.id)(e.data.value)],n=null):n=c(e.data.index)?e.data.index:t.getIndexByX(e.data.x):typeof e.x!="undefined"?n=t.getIndexByX(e.x):typeof e.index!="undefined"&&(n=e.index),t.dispatchEvent("mouseover",n,r),t.dispatchEvent("mousemove",n,r)},n.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0)};var T;r.isSafari=function(){var t=e.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},r.isChrome=function(){var t=e.navigator.userAgent;return t.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(e){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),typeof define=="function"&&define.amd?define("c3",["d3"],t):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=t:e.c3=t}(window),define("jswish",["jquery","config","preferences","history","modal","jquery-ui","splitter","bootstrap","pane","tabbed","notebook","navbar","search","editor","query","runner","term","laconic","d3","c3"],function(e,t,n,r,i){n.setDefault("semantic-highlighting",!1),n.setDefault("emacs-keybinding",!1),function(e){function u(t,n){e(".trill_on_swish-event-receiver").trigger(t,n)}function a(){e(".swish-logo").append(e.el.b(e.el.span({style:"color:darkblue"},"TRILL "),e.el.span({style:"color:maroon"},"on "),e.el.span({style:"color:darkblue"},"SWI"),e.el.span({style:"color:maroon"},"SH"))).css("margin-left","30px").css("font-size","24px").addClass("navbar-brand")}function f(){e("#modal").length==0&&(e("body").append(e.el.div({id:"modal"})),e("#modal").swishModal())}function l(){e(".tile").tile(),e(window).resize(function(){e(".tile").tile("resize")}),e("body").on("click","button.close-pane",function(){closePane(e(this).parent())}),e(".tabbed").tabbed()}function c(){e(window).resize(function(){e(".reactive-size").trigger("reactive-resize")})}var n="trill_on_swish",s={menu:{File:{"Save ...":function(){u("save","as")},"Info & history ...":function(){u("fileInfo")},"Open recent":{type:"submenu",action:function(t){r.openRecent(t,e(this).data("document"))},update:r.updateRecentUL},Share:"--",Download:function(){u("download")},"Collaborate ...":function(){e("body").trill_on_swish("collaborate")},"Print group":"--","Print ...":function(){e(".prolog-editor").prologEditor("print")}},Edit:{"Edit with WebProtégé":function(){u("dialog",{title:"Coming Soon!",body:"We are working to allow the use of WebProtégé as editor of knowledge bases. The update date rapidly approaches!"})},Changes:"--","View changes":function(){u("diff")},"Revert changes":function(){u("revert")},Options:"--","Emacs Keybinding":{preference:"emacs-keybinding",type:"checkbox",value:"false"}},Examples:function(t,n){e("body").trill_on_swish("populateExamples",t,n)},Help:{"About ...":function(){u("help",{file:"about.html"})},Topics:"--","Help ...":function(){u("help",{file:"help.html"})},"Runner ...":function(){u("help",{file:"runner.html"})},"Debugging ...":function(){u("help",{file:"debug.html"})},"Notebook ...":function(){u("help",{file:"notebook.html"})},Background:"--","Limitations ...":function(){u("help",{file:"beware.html"})},"Caveats ...":function(){u("help",{file:"caveats.html"})},"Background ...":function(){u("help",{file:"background.html"})}}}},o={_init:function(t){return a(),f(),l(),c(),e("#search").search(),t=t||{},this.addClass("trill_on_swish"),this.each(function(){var r=e(this),i={};e("#navbar").navbar(s.menu);var o=e(".prolog-editor").prologEditor({save:!0});i.runner=e(".prolog-runners").prologRunners(),i.query=e(".prolog-query").queryEditor({source:function(){return r.trill_on_swish("prologSource")},sourceID:function(){return o.prologEditor("getSourceID")},examples:r.trill_on_swish("examples"),runner:i.runner}),o.prologEditor("makeCurrent"),e(".notebook").notebook(),t.show_beware&&u("help",{file:"beware.html",notagain:"beware"}),r.data(n,i)})},trigger:function(e,t){return u(e,t),this},playFile:function(n){typeof n=="string"&&(n={file:n});var r=t.http.locations.web_storage+n.file;return e.ajax({url:r,type:"GET",data:{format:"json"},success:function(e){function t(t){for(var r=0;r<t.length;r++){var i=t[r];n[i]&&(e[i]=n[i])}}e.url=r,e.type="gitty",t(["line","regex","showAllMatches","newTab","noHistory","prompt"]),u("source",e)},error:function(e){i.ajaxError(e)}}),this},playURL:function(t){var n=this.find(".storage").storage("match",t);if(n&&n.storage("expose","Already open"))return this;e.ajax({url:t.url,type:"GET",data:{format:"json"},success:function(e){function r(e){for(var r=0;r<e.length;r++){var i=e[r];t[i]&&(n[i]=t[i])}}var n;if(typeof e=="string")n={data:e},n.type="external";else{if(typeof e!="object"||typeof e.data!="string"){alert("Invalid data");return}n=e,n.type="filesys"}n.url=t.url,r(["line","regex","showAllMatches","newTab","noHistory","prompt"]),u("source",n)},error:function(e){i.ajaxError(e)}})},openExampleFunction:function(e){var t=this;return e.type=="divider"?"--":e.type=="store"?function(){o.playFile.call(t,e.file)}:function(){o.playURL.call(t,{url:e.href})}},populateExamples:function(n,r){var i=this;return i.off("examples-changed").on("examples-changed",function(){e("#navbar").navbar("clearDropdown",r),i.trill_on_swish("populateExamples",n,r)}),e.ajax(t.http.locations.swish_examples,{dataType:"json",success:function(t){for(var n=0;n<t.length;n++){var s=t[n],o,u;if(s=="--"||s.type=="divider")o="--",u="--";else{var a=s.file||s.href;o=s.title,u=i.trill_on_swish("openExampleFunction",s),a&&(u.typeIcon=a.split(".").pop())}e("#navbar").navbar("extendDropdown",r,o,u)}}}),this},prologSource:function(){var t=[],n;return(n=e(".prolog-editor").prologEditor("getSource","source"))&&t.push(n),(n=e(".background.prolog.source").text())&&t.push(n),t.join("\n\n")},breakpoints:function(e){return this.find(".prolog-editor").prologEditor("getBreakpoints",e)||[]},tabData:function(e){return e=e||{},e.active?this.find(".tab-pane.active .storage").storage("getData",e):this.find(".storage").storage("getData",e)},examples:function(t){var n=e(".examples.prolog").text();if(n)return e().prologEditor("getExamples",n,!1);if(t!=1)return function(){return e(".prolog-editor").prologEditor("getExamples")}},collaborate:function(){var t=this;return e(this).attr("data-end-togetherjs-html","End collaboration"),require(["https://togetherjs.com/togetherjs-min.js"],function(){TogetherJS(t)}),this}};e.fn.trill_on_swish=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}}(jQuery)}),require.config({urlArgs:"ts="+(new Date).getTime(),waitSeconds:60,paths:{jquery:"../bower_components/jquery/dist/jquery.min","jquery-ui":"../bower_components/jquery-ui/jquery-ui.min",laconic:"../bower_components/laconic/laconic",bootstrap:"../bower_components/bootstrap/dist/js/bootstrap.min",typeahead:"../bower_components/typeahead.js/dist/typeahead.bundle.min",splitter:"../bower_components/jquery.splitter/js/jquery.splitter-0.15.0",tagmanager:"../bower_components/tagmanager/tagmanager",sha1:"../bower_components/js-sha1/src/sha1",c3:"../bower_components/c3/c3",d3:"../bower_components/d3/d3","svg-pan-zoom":"../bower_components/svg-pan-zoom/dist/svg-pan-zoom.min","cm/mode/prolog":"codemirror/mode/prolog","cm/addon/hover/prolog-hover":"codemirror/addon/hover/prolog-hover","cm/addon/hover/text-hover":"codemirror/addon/hover/text-hover","cm/addon/hint/templates-hint":"codemirror/addon/hint/templates-hint","cm/addon/hint/show-context-info":"codemirror/addon/hint/show-context-info",cm:"../bower_components/codemirror"},shim:{bootstrap:{deps:["jquery"]},typeahead:{deps:["jquery"]},splitter:{deps:["jquery"]},laconic:{deps:["jquery"]},tagmanager:{deps:["jquery"]}}}),require(["jquery","config","jswish"],function(e,t,n){e(function(){e("body").trill_on_swish(t.trill_on_swish||{})})}),define("trill_on_swish",function(){});
\ No newline at end of file
diff --git a/web/js/trill_on_swish-min.js.gz b/web/js/trill_on_swish-min.js.gz
deleted file mode 100644
index 4ed4d53..0000000
Binary files a/web/js/trill_on_swish-min.js.gz and /dev/null differ